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 line_object.h
21  *
22  *  \brief Functions operating on line objects
23  */
24 
25 G_BEGIN_DECLS
26 
27 #define LINE_END1 0
28 #define LINE_END2 1
29 
30 /* construction, destruction */
31 
32 LeptonObject*
33 lepton_line_object_new (gint color,
34                         gint x1,
35                         gint y1,
36                         gint x2,
37                         gint y2);
38 LeptonObject*
39 lepton_line_object_copy (LeptonObject *o_current);
40 
41 /* methods */
42 
43 void
44 lepton_line_object_calculate_bounds (const LeptonObject *object,
45                                      LeptonBounds *bounds);
46 gboolean
47 lepton_line_object_get_position (const LeptonObject *object,
48                                  gint *x,
49                                  gint *y);
50 gint
51 lepton_line_object_get_x0 (const LeptonObject *object);
52 
53 gint
54 lepton_line_object_get_x1 (const LeptonObject *object);
55 
56 gint
57 lepton_line_object_get_y0 (const LeptonObject *object);
58 
59 gint
60 lepton_line_object_get_y1 (const LeptonObject *object);
61 
62 double
63 lepton_line_object_length (LeptonObject *object);
64 
65 void
66 lepton_line_object_mirror (int world_centerx,
67                            int world_centery,
68                            LeptonObject *object);
69 void
70 lepton_line_object_modify (LeptonObject *object,
71                            int x,
72                            int y,
73                            int whichone);
74 void
75 lepton_line_object_rotate (int world_centerx,
76                            int world_centery,
77                            int angle,
78                            LeptonObject *object);
79 void
80 lepton_line_object_set_x0 (LeptonObject *object,
81                            gint x);
82 void
83 lepton_line_object_set_x1 (LeptonObject *object,
84                            gint x);
85 void
86 lepton_line_object_set_y0 (LeptonObject *object,
87                            gint y);
88 void
89 lepton_line_object_set_y1 (LeptonObject *object,
90                            gint y);
91 double
92 lepton_line_object_shortest_distance (LeptonObject *object,
93                                       int x,
94                                       int y,
95                                       int force_soild,
96                                       gboolean include_hidden);
97 gchar*
98 lepton_line_object_to_buffer (const LeptonObject *object);
99 
100 void
101 lepton_line_object_translate (LeptonObject *object,
102                               int dx,
103                               int dy);
104 LeptonObject*
105 o_line_read (const char buf[],
106              unsigned int release_ver,
107              unsigned int fileformat_ver,
108              GError **err);
109 
110 G_END_DECLS
111