1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <libgnomecanvasmm/line.h>
4 #include <libgnomecanvasmm/private/line_p.h>
10 * Copyright (C) 1998 EMC Capital Management Inc.
11 * Developed by Havoc Pennington <hp@pobox.com>
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.
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.
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.
28 //#include <libgnomecanvasmm/group.h>
36 Points::Points(size_type nbpoints)
37 : std::vector<Art::Point>(nbpoints), points_(0), owned_(false)
40 Points::Points(GnomeCanvasPoints *castitem)
41 : points_(castitem),owned_(false)
43 while (size() < points_->num_points) {
44 push_back (Art::Point());
47 //GnomeCanvasPoints has an array of doubles, used 2 at a time:
49 for(iterator it = begin(); i < points_->num_points; i += 2, ++it)
51 (*it).set_x(points_->coords[i]);
52 (*it).set_y(points_->coords[i+1]);
58 if (owned_ && points_)
59 gnome_canvas_points_free(points_);
62 Points::operator bool() const
67 bool Points::is_null() const
72 GnomeCanvasPoints* Points::_gobj() const
78 points_ = gnome_canvas_points_new(size());
81 else if(size() != static_cast<unsigned int>(points_->num_points))
84 gnome_canvas_points_free(points_);
86 points_ = gnome_canvas_points_new(size());
90 for(const_iterator it = begin(); it != end(); ++it, i+=2)
92 points_->coords[i] = (*it).get_x();
93 points_->coords[i+1] = (*it).get_y();
100 Line::Line(Group& parentx)
101 : Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0)))
103 item_construct(parentx);
106 Line::Line(Group& parentx, const Points& points)
107 : Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0)))
109 item_construct(parentx);
110 property_points().set_value(points);
113 } /* namespace Canvas */
114 } /* namespace Gnome */
118 GType Glib::Value<Gnome::Canvas::Points>::value_type()
120 return Gnome::Canvas::Points::get_type();
126 } // anonymous namespace
132 Gnome::Canvas::Line* wrap(GnomeCanvasLine* object, bool take_copy)
134 return dynamic_cast<Gnome::Canvas::Line *> (Glib::wrap_auto ((GObject*)(object), take_copy));
137 } /* namespace Glib */
146 /* The *_Class implementation: */
148 const Glib::Class& Line_Class::init()
150 if(!gtype_) // create the GType if necessary
152 // Glib::Class has to know the class init function to clone custom types.
153 class_init_func_ = &Line_Class::class_init_function;
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();
159 // Create the wrapper type, with the same class/instance size as the base type.
160 register_derived_type(gnome_canvas_line_get_type());
162 // Add derived versions of interfaces, if the C type implements any interfaces:
168 void Line_Class::class_init_function(void* g_class, void* class_data)
170 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
171 CppClassParent::class_init_function(klass, class_data);
176 Glib::ObjectBase* Line_Class::wrap_new(GObject* o)
178 return manage(new Line((GnomeCanvasLine*)(o)));
183 /* The implementation: */
185 Line::Line(const Glib::ConstructParams& construct_params)
187 Item(construct_params)
191 Line::Line(GnomeCanvasLine* castitem)
193 Item((GnomeCanvasItem*)(castitem))
202 Line::CppClassType Line::line_class_; // initialize static member
204 GType Line::get_type()
206 return line_class_.init().get_type();
209 GType Line::get_base_type()
211 return gnome_canvas_line_get_type();
215 Glib::PropertyProxy<Points> Line::property_points()
217 return Glib::PropertyProxy<Points>(this, "points");
220 Glib::PropertyProxy_ReadOnly<Points> Line::property_points() const
222 return Glib::PropertyProxy_ReadOnly<Points>(this, "points");
225 Glib::PropertyProxy<Glib::ustring> Line::property_fill_color()
227 return Glib::PropertyProxy<Glib::ustring>(this, "fill-color");
230 Glib::PropertyProxy_ReadOnly<Glib::ustring> Line::property_fill_color() const
232 return Glib::PropertyProxy_ReadOnly<Glib::ustring>(this, "fill-color");
235 Glib::PropertyProxy<Gdk::Color> Line::property_fill_color_gdk()
237 return Glib::PropertyProxy<Gdk::Color>(this, "fill-color-gdk");
240 Glib::PropertyProxy_ReadOnly<Gdk::Color> Line::property_fill_color_gdk() const
242 return Glib::PropertyProxy_ReadOnly<Gdk::Color>(this, "fill-color-gdk");
245 Glib::PropertyProxy<guint> Line::property_fill_color_rgba()
247 return Glib::PropertyProxy<guint>(this, "fill-color-rgba");
250 Glib::PropertyProxy_ReadOnly<guint> Line::property_fill_color_rgba() const
252 return Glib::PropertyProxy_ReadOnly<guint>(this, "fill-color-rgba");
255 Glib::PropertyProxy< Glib::RefPtr<Gdk::Bitmap> > Line::property_fill_stipple()
257 return Glib::PropertyProxy< Glib::RefPtr<Gdk::Bitmap> >(this, "fill-stipple");
260 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Bitmap> > Line::property_fill_stipple() const
262 return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Bitmap> >(this, "fill-stipple");
265 Glib::PropertyProxy<guint> Line::property_width_pixels()
267 return Glib::PropertyProxy<guint>(this, "width-pixels");
270 Glib::PropertyProxy_ReadOnly<guint> Line::property_width_pixels() const
272 return Glib::PropertyProxy_ReadOnly<guint>(this, "width-pixels");
275 Glib::PropertyProxy<double> Line::property_width_units()
277 return Glib::PropertyProxy<double>(this, "width-units");
280 Glib::PropertyProxy_ReadOnly<double> Line::property_width_units() const
282 return Glib::PropertyProxy_ReadOnly<double>(this, "width-units");
285 Glib::PropertyProxy<Gdk::CapStyle> Line::property_cap_style()
287 return Glib::PropertyProxy<Gdk::CapStyle>(this, "cap-style");
290 Glib::PropertyProxy_ReadOnly<Gdk::CapStyle> Line::property_cap_style() const
292 return Glib::PropertyProxy_ReadOnly<Gdk::CapStyle>(this, "cap-style");
295 Glib::PropertyProxy<Gdk::JoinStyle> Line::property_join_style()
297 return Glib::PropertyProxy<Gdk::JoinStyle>(this, "join-style");
300 Glib::PropertyProxy_ReadOnly<Gdk::JoinStyle> Line::property_join_style() const
302 return Glib::PropertyProxy_ReadOnly<Gdk::JoinStyle>(this, "join-style");
305 Glib::PropertyProxy<Gdk::LineStyle> Line::property_line_style()
307 return Glib::PropertyProxy<Gdk::LineStyle>(this, "line-style");
310 Glib::PropertyProxy_ReadOnly<Gdk::LineStyle> Line::property_line_style() const
312 return Glib::PropertyProxy_ReadOnly<Gdk::LineStyle>(this, "line-style");
315 Glib::PropertyProxy<bool> Line::property_first_arrowhead()
317 return Glib::PropertyProxy<bool>(this, "first-arrowhead");
320 Glib::PropertyProxy_ReadOnly<bool> Line::property_first_arrowhead() const
322 return Glib::PropertyProxy_ReadOnly<bool>(this, "first-arrowhead");
325 Glib::PropertyProxy<bool> Line::property_last_arrowhead()
327 return Glib::PropertyProxy<bool>(this, "last-arrowhead");
330 Glib::PropertyProxy_ReadOnly<bool> Line::property_last_arrowhead() const
332 return Glib::PropertyProxy_ReadOnly<bool>(this, "last-arrowhead");
335 Glib::PropertyProxy<bool> Line::property_smooth()
337 return Glib::PropertyProxy<bool>(this, "smooth");
340 Glib::PropertyProxy_ReadOnly<bool> Line::property_smooth() const
342 return Glib::PropertyProxy_ReadOnly<bool>(this, "smooth");
345 Glib::PropertyProxy<guint> Line::property_spline_steps()
347 return Glib::PropertyProxy<guint>(this, "spline-steps");
350 Glib::PropertyProxy_ReadOnly<guint> Line::property_spline_steps() const
352 return Glib::PropertyProxy_ReadOnly<guint>(this, "spline-steps");
355 Glib::PropertyProxy<double> Line::property_arrow_shape_a()
357 return Glib::PropertyProxy<double>(this, "arrow-shape-a");
360 Glib::PropertyProxy_ReadOnly<double> Line::property_arrow_shape_a() const
362 return Glib::PropertyProxy_ReadOnly<double>(this, "arrow-shape-a");
365 Glib::PropertyProxy<double> Line::property_arrow_shape_b()
367 return Glib::PropertyProxy<double>(this, "arrow-shape-b");
370 Glib::PropertyProxy_ReadOnly<double> Line::property_arrow_shape_b() const
372 return Glib::PropertyProxy_ReadOnly<double>(this, "arrow-shape-b");
375 Glib::PropertyProxy<double> Line::property_arrow_shape_c()
377 return Glib::PropertyProxy<double>(this, "arrow-shape-c");
380 Glib::PropertyProxy_ReadOnly<double> Line::property_arrow_shape_c() const
382 return Glib::PropertyProxy_ReadOnly<double>(this, "arrow-shape-c");
386 } // namespace Canvas