rollback to 3428, before the mysterious removal of libs/* at 3431/3432
[ardour.git] / libs / libgnomecanvasmm / libgnomecanvasmm / line.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3 #include <libgnomecanvasmm/line.h>
4 #include <libgnomecanvasmm/private/line_p.h>
5
6 /* $Id$ */
7
8 /* line.ccg
9  *
10  * Copyright (C) 1998 EMC Capital Management Inc.
11  * Developed by Havoc Pennington <hp@pobox.com>
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Library General Public
15  * License as published by the Free Software Foundation; either
16  * version 2 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21  * Library General Public License for more details.
22  *
23  * You should have received a copy of the GNU Library General Public
24  * License along with this library; if not, write to the Free
25  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26  */
27
28 //#include <libgnomecanvasmm/group.h>
29
30 namespace Gnome
31 {
32
33 namespace Canvas
34 {
35
36 Points::Points(size_type nbpoints)
37 : std::vector<Art::Point>(nbpoints), points_(0), owned_(false)
38 {}
39
40 Points::Points(GnomeCanvasPoints *castitem)
41 : points_(castitem),owned_(false)
42 {
43   while (size() < points_->num_points) {
44        push_back (Art::Point());
45   }
46
47   //GnomeCanvasPoints has an array of doubles, used 2 at a time:
48   int i = 0;
49   for(iterator it = begin(); i < points_->num_points; i += 2, ++it)
50   {
51     (*it).set_x(points_->coords[i]);
52     (*it).set_y(points_->coords[i+1]);
53   }
54 }
55
56 Points::~Points()
57 {
58   if (owned_ && points_)
59     gnome_canvas_points_free(points_);
60 }
61
62 Points::operator bool() const
63 {
64   return (!is_null());
65 }
66
67 bool Points::is_null() const
68 {
69   return size() == 0;
70 }
71
72 GnomeCanvasPoints* Points::_gobj() const
73 {
74   int i = 0;
75   
76   if(!points_)
77   {
78     points_ = gnome_canvas_points_new(size());
79     owned_ = true;
80   }
81   else if(size() != static_cast<unsigned int>(points_->num_points))
82   {
83     if (owned_)
84      gnome_canvas_points_free(points_);
85
86     points_ = gnome_canvas_points_new(size());
87     owned_ = true;
88   }
89   
90   for(const_iterator it = begin(); it != end(); ++it, i+=2)
91   {
92     points_->coords[i] = (*it).get_x();
93     points_->coords[i+1] = (*it).get_y();
94   }
95
96   return points_;
97 }
98
99
100 Line::Line(Group& parentx)
101   : Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0)))
102 {
103   item_construct(parentx);
104 }
105
106 Line::Line(Group& parentx, const Points& points)
107   : Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0)))
108 {
109   item_construct(parentx);
110   property_points().set_value(points);
111 }
112
113 } /* namespace Canvas */
114 } /* namespace Gnome */
115
116
117 // static
118 GType Glib::Value<Gnome::Canvas::Points>::value_type()
119 {
120   return Gnome::Canvas::Points::get_type();
121 }
122
123
124 namespace
125 {
126 } // anonymous namespace
127
128
129 namespace Glib
130 {
131
132 Gnome::Canvas::Line* wrap(GnomeCanvasLine* object, bool take_copy)
133 {
134   return dynamic_cast<Gnome::Canvas::Line *> (Glib::wrap_auto ((GObject*)(object), take_copy));
135 }
136
137 } /* namespace Glib */
138
139 namespace Gnome
140 {
141
142 namespace Canvas
143 {
144
145
146 /* The *_Class implementation: */
147
148 const Glib::Class& Line_Class::init()
149 {
150   if(!gtype_) // create the GType if necessary
151   {
152     // Glib::Class has to know the class init function to clone custom types.
153     class_init_func_ = &Line_Class::class_init_function;
154
155     // This is actually just optimized away, apparently with no harm.
156     // Make sure that the parent type has been created.
157     //CppClassParent::CppObjectType::get_type();
158
159     // Create the wrapper type, with the same class/instance size as the base type.
160     register_derived_type(gnome_canvas_line_get_type());
161
162     // Add derived versions of interfaces, if the C type implements any interfaces:
163   }
164
165   return *this;
166 }
167
168 void Line_Class::class_init_function(void* g_class, void* class_data)
169 {
170   BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
171   CppClassParent::class_init_function(klass, class_data);
172
173 }
174
175
176 Glib::ObjectBase* Line_Class::wrap_new(GObject* o)
177 {
178   return manage(new Line((GnomeCanvasLine*)(o)));
179
180 }
181
182
183 /* The implementation: */
184
185 Line::Line(const Glib::ConstructParams& construct_params)
186 :
187   Item(construct_params)
188 {
189   }
190
191 Line::Line(GnomeCanvasLine* castitem)
192 :
193   Item((GnomeCanvasItem*)(castitem))
194 {
195   }
196
197 Line::~Line()
198 {
199   destroy_();
200 }
201
202 Line::CppClassType Line::line_class_; // initialize static member
203
204 GType Line::get_type()
205 {
206   return line_class_.init().get_type();
207 }
208
209 GType Line::get_base_type()
210 {
211   return gnome_canvas_line_get_type();
212 }
213
214
215 Glib::PropertyProxy<Points> Line::property_points() 
216 {
217   return Glib::PropertyProxy<Points>(this, "points");
218 }
219
220 Glib::PropertyProxy_ReadOnly<Points> Line::property_points() const
221 {
222   return Glib::PropertyProxy_ReadOnly<Points>(this, "points");
223 }
224
225 Glib::PropertyProxy<Glib::ustring> Line::property_fill_color() 
226 {
227   return Glib::PropertyProxy<Glib::ustring>(this, "fill-color");
228 }
229
230 Glib::PropertyProxy_ReadOnly<Glib::ustring> Line::property_fill_color() const
231 {
232   return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "fill-color");
233 }
234
235 Glib::PropertyProxy<Gdk::Color> Line::property_fill_color_gdk() 
236 {
237   return Glib::PropertyProxy<Gdk::Color>(this, "fill-color-gdk");
238 }
239
240 Glib::PropertyProxy_ReadOnly<Gdk::Color> Line::property_fill_color_gdk() const
241 {
242   return Glib::PropertyProxy_ReadOnly<Gdk::Color>(this, "fill-color-gdk");
243 }
244
245 Glib::PropertyProxy<guint> Line::property_fill_color_rgba() 
246 {
247   return Glib::PropertyProxy<guint>(this, "fill-color-rgba");
248 }
249
250 Glib::PropertyProxy_ReadOnly<guint> Line::property_fill_color_rgba() const
251 {
252   return Glib::PropertyProxy_ReadOnly<guint>(this, "fill-color-rgba");
253 }
254
255 Glib::PropertyProxy< Glib::RefPtr<Gdk::Bitmap> > Line::property_fill_stipple() 
256 {
257   return Glib::PropertyProxy< Glib::RefPtr<Gdk::Bitmap> >(this, "fill-stipple");
258 }
259
260 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Bitmap> > Line::property_fill_stipple() const
261 {
262   return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Bitmap> >(this, "fill-stipple");
263 }
264
265 Glib::PropertyProxy<guint> Line::property_width_pixels() 
266 {
267   return Glib::PropertyProxy<guint>(this, "width-pixels");
268 }
269
270 Glib::PropertyProxy_ReadOnly<guint> Line::property_width_pixels() const
271 {
272   return Glib::PropertyProxy_ReadOnly<guint>(this, "width-pixels");
273 }
274
275 Glib::PropertyProxy<double> Line::property_width_units() 
276 {
277   return Glib::PropertyProxy<double>(this, "width-units");
278 }
279
280 Glib::PropertyProxy_ReadOnly<double> Line::property_width_units() const
281 {
282   return Glib::PropertyProxy_ReadOnly<double>(this, "width-units");
283 }
284
285 Glib::PropertyProxy<Gdk::CapStyle> Line::property_cap_style() 
286 {
287   return Glib::PropertyProxy<Gdk::CapStyle>(this, "cap-style");
288 }
289
290 Glib::PropertyProxy_ReadOnly<Gdk::CapStyle> Line::property_cap_style() const
291 {
292   return Glib::PropertyProxy_ReadOnly<Gdk::CapStyle>(this, "cap-style");
293 }
294
295 Glib::PropertyProxy<Gdk::JoinStyle> Line::property_join_style() 
296 {
297   return Glib::PropertyProxy<Gdk::JoinStyle>(this, "join-style");
298 }
299
300 Glib::PropertyProxy_ReadOnly<Gdk::JoinStyle> Line::property_join_style() const
301 {
302   return Glib::PropertyProxy_ReadOnly<Gdk::JoinStyle>(this, "join-style");
303 }
304
305 Glib::PropertyProxy<Gdk::LineStyle> Line::property_line_style() 
306 {
307   return Glib::PropertyProxy<Gdk::LineStyle>(this, "line-style");
308 }
309
310 Glib::PropertyProxy_ReadOnly<Gdk::LineStyle> Line::property_line_style() const
311 {
312   return Glib::PropertyProxy_ReadOnly<Gdk::LineStyle>(this, "line-style");
313 }
314
315 Glib::PropertyProxy<bool> Line::property_first_arrowhead() 
316 {
317   return Glib::PropertyProxy<bool>(this, "first-arrowhead");
318 }
319
320 Glib::PropertyProxy_ReadOnly<bool> Line::property_first_arrowhead() const
321 {
322   return Glib::PropertyProxy_ReadOnly<bool>(this, "first-arrowhead");
323 }
324
325 Glib::PropertyProxy<bool> Line::property_last_arrowhead() 
326 {
327   return Glib::PropertyProxy<bool>(this, "last-arrowhead");
328 }
329
330 Glib::PropertyProxy_ReadOnly<bool> Line::property_last_arrowhead() const
331 {
332   return Glib::PropertyProxy_ReadOnly<bool>(this, "last-arrowhead");
333 }
334
335 Glib::PropertyProxy<bool> Line::property_smooth() 
336 {
337   return Glib::PropertyProxy<bool>(this, "smooth");
338 }
339
340 Glib::PropertyProxy_ReadOnly<bool> Line::property_smooth() const
341 {
342   return Glib::PropertyProxy_ReadOnly<bool>(this, "smooth");
343 }
344
345 Glib::PropertyProxy<guint> Line::property_spline_steps() 
346 {
347   return Glib::PropertyProxy<guint>(this, "spline-steps");
348 }
349
350 Glib::PropertyProxy_ReadOnly<guint> Line::property_spline_steps() const
351 {
352   return Glib::PropertyProxy_ReadOnly<guint>(this, "spline-steps");
353 }
354
355 Glib::PropertyProxy<double> Line::property_arrow_shape_a() 
356 {
357   return Glib::PropertyProxy<double>(this, "arrow-shape-a");
358 }
359
360 Glib::PropertyProxy_ReadOnly<double> Line::property_arrow_shape_a() const
361 {
362   return Glib::PropertyProxy_ReadOnly<double>(this, "arrow-shape-a");
363 }
364
365 Glib::PropertyProxy<double> Line::property_arrow_shape_b() 
366 {
367   return Glib::PropertyProxy<double>(this, "arrow-shape-b");
368 }
369
370 Glib::PropertyProxy_ReadOnly<double> Line::property_arrow_shape_b() const
371 {
372   return Glib::PropertyProxy_ReadOnly<double>(this, "arrow-shape-b");
373 }
374
375 Glib::PropertyProxy<double> Line::property_arrow_shape_c() 
376 {
377   return Glib::PropertyProxy<double>(this, "arrow-shape-c");
378 }
379
380 Glib::PropertyProxy_ReadOnly<double> Line::property_arrow_shape_c() const
381 {
382   return Glib::PropertyProxy_ReadOnly<double>(this, "arrow-shape-c");
383 }
384
385
386 } // namespace Canvas
387
388 } // namespace Gnome
389
390