1 /* Lepton EDA library
2  * Copyright (C) 1998-2010 Ales Hvezda
3  * Copyright (C) 1998-2016 gEDA Contributors
4  * Copyright (C) 2017-2021 Lepton EDA Contributors
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 /*! \file net_object.h
21  *
22  *  \brief Functions operating on net drawing objects
23  */
24 
25 G_BEGIN_DECLS
26 
27 /* for lepton_net_object_orientation */
28 #define NEITHER    0
29 #define HORIZONTAL 1
30 #define VERTICAL   2
31 
32 /* construction, destruction */
33 
34 LeptonObject*
35 lepton_net_object_new (int color,
36                        int x1,
37                        int y1,
38                        int x2,
39                        int y2);
40 LeptonObject*
41 lepton_net_object_copy (LeptonObject *o_current);
42 
43 /* methods */
44 
45 void
46 lepton_net_object_calculate_bounds (const LeptonObject *object,
47                                     LeptonBounds *bounds);
48 void
49 lepton_net_object_consolidate (LeptonPage *page);
50 
51 gboolean
52 lepton_net_object_get_position (const LeptonObject *object,
53                                 gint *x,
54                                 gint *y);
55 gint
56 lepton_net_object_get_x0 (const LeptonObject *object);
57 
58 gint
59 lepton_net_object_get_x1 (const LeptonObject *object);
60 
61 gint
62 lepton_net_object_get_y0 (const LeptonObject *object);
63 
64 gint
65 lepton_net_object_get_y1 (const LeptonObject *object);
66 
67 void
68 lepton_net_object_mirror (int world_centerx,
69                           int world_centery,
70                           LeptonObject *object);
71 void
72 lepton_net_object_modify (LeptonObject *object,
73                           int x,
74                           int y,
75                           int whichone);
76 int
77 lepton_net_object_orientation (LeptonObject *object);
78 
79 void
80 lepton_net_object_rotate (int world_centerx,
81                           int world_centery,
82                           int angle,
83                           LeptonObject *object);
84 void
85 lepton_net_object_set_x0 (LeptonObject *object,
86                           gint x);
87 void
88 lepton_net_object_set_x1 (LeptonObject *object,
89                           gint x);
90 void
91 lepton_net_object_set_y0 (LeptonObject *object,
92                           gint y);
93 void
94 lepton_net_object_set_y1 (LeptonObject *object,
95                           gint y);
96 gchar*
97 lepton_net_object_to_buffer (const LeptonObject *object);
98 
99 void
100 lepton_net_object_translate (LeptonObject *object,
101                              int dx,
102                              int dy);
103 LeptonObject*
104 o_net_read (const char buf[],
105             unsigned int release_ver,
106             unsigned int fileformat_ver,
107             GError **err);
108 
109 G_END_DECLS
110