// Generated by gtkmmproc -- DO NOT MODIFY! #include #include /* $Id$ */ /* line.ccg * * Copyright (C) 1998 EMC Capital Management Inc. * Developed by Havoc Pennington * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ //#include namespace Gnome { namespace Canvas { Points::Points(size_type nbpoints) : std::vector(nbpoints), points_(0), owned_(false) {} Points::Points(GnomeCanvasPoints *castitem) : points_(castitem),owned_(false) { reserve(points_->num_points); //GnomeCanvasPoints has an array of doubles, used 2 at a time: int i = 0; for(iterator it = begin(); i < points_->num_points; i += 2, ++it) { (*it).set_x(points_->coords[i]); (*it).set_y(points_->coords[i+1]); } } Points::~Points() { if (owned_ && points_) gnome_canvas_points_free(points_); } Points::operator bool() const { return (!is_null()); } bool Points::is_null() const { return size() == 0; } GnomeCanvasPoints* Points::_gobj() const { int i = 0; if(!points_) { points_ = gnome_canvas_points_new(size()); owned_ = true; } else if(size() != static_cast(points_->num_points)) { if (owned_) gnome_canvas_points_free(points_); points_ = gnome_canvas_points_new(size()); owned_ = true; } for(const_iterator it = begin(); it != end(); ++it, i+=2) { points_->coords[i] = (*it).get_x(); points_->coords[i+1] = (*it).get_y(); } return points_; } Line::Line(Group& parentx) : Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0))) { item_construct(parentx); } Line::Line(Group& parentx, const Points& points) : Item(GNOME_CANVAS_ITEM(g_object_new(get_type(),0))) { item_construct(parentx); property_points().set_value(points); } } /* namespace Canvas */ } /* namespace Gnome */ // static GType Glib::Value::value_type() { return Gnome::Canvas::Points::get_type(); } namespace { } // anonymous namespace namespace Glib { Gnome::Canvas::Line* wrap(GnomeCanvasLine* object, bool take_copy) { return dynamic_cast (Glib::wrap_auto ((GObject*)(object), take_copy)); } } /* namespace Glib */ namespace Gnome { namespace Canvas { /* The *_Class implementation: */ const Glib::Class& Line_Class::init() { if(!gtype_) // create the GType if necessary { // Glib::Class has to know the class init function to clone custom types. class_init_func_ = &Line_Class::class_init_function; // This is actually just optimized away, apparently with no harm. // Make sure that the parent type has been created. //CppClassParent::CppObjectType::get_type(); // Create the wrapper type, with the same class/instance size as the base type. register_derived_type(gnome_canvas_line_get_type()); // Add derived versions of interfaces, if the C type implements any interfaces: } return *this; } void Line_Class::class_init_function(void* g_class, void* class_data) { BaseClassType *const klass = static_cast(g_class); CppClassParent::class_init_function(klass, class_data); } Glib::ObjectBase* Line_Class::wrap_new(GObject* o) { return manage(new Line((GnomeCanvasLine*)(o))); } /* The implementation: */ Line::Line(const Glib::ConstructParams& construct_params) : Item(construct_params) { } Line::Line(GnomeCanvasLine* castitem) : Item((GnomeCanvasItem*)(castitem)) { } Line::~Line() { destroy_(); } Line::CppClassType Line::line_class_; // initialize static member GType Line::get_type() { return line_class_.init().get_type(); } GType Line::get_base_type() { return gnome_canvas_line_get_type(); } Glib::PropertyProxy Line::property_points() { return Glib::PropertyProxy(this, "points"); } Glib::PropertyProxy_ReadOnly Line::property_points() const { return Glib::PropertyProxy_ReadOnly(this, "points"); } Glib::PropertyProxy Line::property_fill_color() { return Glib::PropertyProxy(this, "fill-color"); } Glib::PropertyProxy_ReadOnly Line::property_fill_color() const { return Glib::PropertyProxy_ReadOnly(this, "fill-color"); } Glib::PropertyProxy Line::property_fill_color_gdk() { return Glib::PropertyProxy(this, "fill-color-gdk"); } Glib::PropertyProxy_ReadOnly Line::property_fill_color_gdk() const { return Glib::PropertyProxy_ReadOnly(this, "fill-color-gdk"); } Glib::PropertyProxy Line::property_fill_color_rgba() { return Glib::PropertyProxy(this, "fill-color-rgba"); } Glib::PropertyProxy_ReadOnly Line::property_fill_color_rgba() const { return Glib::PropertyProxy_ReadOnly(this, "fill-color-rgba"); } Glib::PropertyProxy< Glib::RefPtr > Line::property_fill_stipple() { return Glib::PropertyProxy< Glib::RefPtr >(this, "fill-stipple"); } Glib::PropertyProxy_ReadOnly< Glib::RefPtr > Line::property_fill_stipple() const { return Glib::PropertyProxy_ReadOnly< Glib::RefPtr >(this, "fill-stipple"); } Glib::PropertyProxy Line::property_width_pixels() { return Glib::PropertyProxy(this, "width-pixels"); } Glib::PropertyProxy_ReadOnly Line::property_width_pixels() const { return Glib::PropertyProxy_ReadOnly(this, "width-pixels"); } Glib::PropertyProxy Line::property_width_units() { return Glib::PropertyProxy(this, "width-units"); } Glib::PropertyProxy_ReadOnly Line::property_width_units() const { return Glib::PropertyProxy_ReadOnly(this, "width-units"); } Glib::PropertyProxy Line::property_cap_style() { return Glib::PropertyProxy(this, "cap-style"); } Glib::PropertyProxy_ReadOnly Line::property_cap_style() const { return Glib::PropertyProxy_ReadOnly(this, "cap-style"); } Glib::PropertyProxy Line::property_join_style() { return Glib::PropertyProxy(this, "join-style"); } Glib::PropertyProxy_ReadOnly Line::property_join_style() const { return Glib::PropertyProxy_ReadOnly(this, "join-style"); } Glib::PropertyProxy Line::property_line_style() { return Glib::PropertyProxy(this, "line-style"); } Glib::PropertyProxy_ReadOnly Line::property_line_style() const { return Glib::PropertyProxy_ReadOnly(this, "line-style"); } Glib::PropertyProxy Line::property_first_arrowhead() { return Glib::PropertyProxy(this, "first-arrowhead"); } Glib::PropertyProxy_ReadOnly Line::property_first_arrowhead() const { return Glib::PropertyProxy_ReadOnly(this, "first-arrowhead"); } Glib::PropertyProxy Line::property_last_arrowhead() { return Glib::PropertyProxy(this, "last-arrowhead"); } Glib::PropertyProxy_ReadOnly Line::property_last_arrowhead() const { return Glib::PropertyProxy_ReadOnly(this, "last-arrowhead"); } Glib::PropertyProxy Line::property_smooth() { return Glib::PropertyProxy(this, "smooth"); } Glib::PropertyProxy_ReadOnly Line::property_smooth() const { return Glib::PropertyProxy_ReadOnly(this, "smooth"); } Glib::PropertyProxy Line::property_spline_steps() { return Glib::PropertyProxy(this, "spline-steps"); } Glib::PropertyProxy_ReadOnly Line::property_spline_steps() const { return Glib::PropertyProxy_ReadOnly(this, "spline-steps"); } Glib::PropertyProxy Line::property_arrow_shape_a() { return Glib::PropertyProxy(this, "arrow-shape-a"); } Glib::PropertyProxy_ReadOnly Line::property_arrow_shape_a() const { return Glib::PropertyProxy_ReadOnly(this, "arrow-shape-a"); } Glib::PropertyProxy Line::property_arrow_shape_b() { return Glib::PropertyProxy(this, "arrow-shape-b"); } Glib::PropertyProxy_ReadOnly Line::property_arrow_shape_b() const { return Glib::PropertyProxy_ReadOnly(this, "arrow-shape-b"); } Glib::PropertyProxy Line::property_arrow_shape_c() { return Glib::PropertyProxy(this, "arrow-shape-c"); } Glib::PropertyProxy_ReadOnly Line::property_arrow_shape_c() const { return Glib::PropertyProxy_ReadOnly(this, "arrow-shape-c"); } } // namespace Canvas } // namespace Gnome