gnomemm r1518 - in geglmm/trunk: . libgegl/src tools/m4



Author: murrayc
Date: Wed May 21 18:31:58 2008
New Revision: 1518
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1518&view=rev

Log:
2008-05-21  Murray Cumming  <murrayc murrayc com>

* NEWS:
* README: Added missing files. automake fails without these, even 
with --add-missing
* libgegl/src/libgegl_docs.xml:
* libgegl/src/libgegl_docs_override.xml: Added these files, currently 
empty, to avoid gmmproc warnings.

* tools/m4/convert_libgeglmm.m4: Moved signal-specific conversions into 
.hg files, to avoid the risk of them being used mistakenly for methods, 
which would generally be wrong and would cause reference-counting 
problems.
* libgegl/src/buffer.hg:
* libgegl/src/color.hg:
* libgegl/src/curve.hg:
* libgegl/src/node.ccg:
* libgegl/src/node.hg:
* libgegl/src/operation.hg:
* libgegl/src/processor.hg:
* libgegl/src/rectangle.hg: Various const corrections.
Made constructors protected and added public create() methods (see 
gmmproc appendix about problems with *_new() functions, in case gegl is 
not doing the right thing).
Added use of refreturn for getters that return RefPtr.

Added:
   geglmm/trunk/NEWS
   geglmm/trunk/README
   geglmm/trunk/libgegl/src/libgegl_docs.xml
   geglmm/trunk/libgegl/src/libgegl_docs_override.xml
Modified:
   geglmm/trunk/ChangeLog
   geglmm/trunk/libgegl/src/buffer.hg
   geglmm/trunk/libgegl/src/color.hg
   geglmm/trunk/libgegl/src/curve.hg
   geglmm/trunk/libgegl/src/node.ccg
   geglmm/trunk/libgegl/src/node.hg
   geglmm/trunk/libgegl/src/operation.hg
   geglmm/trunk/libgegl/src/processor.hg
   geglmm/trunk/libgegl/src/rectangle.hg
   geglmm/trunk/tools/m4/convert_libgeglmm.m4

Added: geglmm/trunk/NEWS
==============================================================================

Added: geglmm/trunk/README
==============================================================================

Modified: geglmm/trunk/libgegl/src/buffer.hg
==============================================================================
--- geglmm/trunk/libgegl/src/buffer.hg	(original)
+++ geglmm/trunk/libgegl/src/buffer.hg	Wed May 21 18:31:58 2008
@@ -34,11 +34,15 @@
 	: public Glib::Object
 {
 	_CLASS_GOBJECT(Buffer, GeglBuffer, GEGL_BUFFER, Glib::Object, GObject)
+protected:
+	_WRAP_CTOR(Buffer(const Rectangle & extent, const Babl *format), gegl_buffer_new) //TODO: Add an overload if format can be NULL, and use a const & for this one.
+
 public:
-	_WRAP_CTOR(Buffer(const Rectangle & extent, const Babl *format), gegl_buffer_new)
-	_WRAP_METHOD(Glib::RefPtr<Buffer> create_sub_buffer(const Rectangle & extent), gegl_buffer_create_sub_buffer)
-	_WRAP_METHOD(void destroy(), gegl_buffer_destroy)
-	_WRAP_METHOD(const Rectangle & get_extent(), gegl_buffer_get_extent)
+	_WRAP_CREATE(const Rectangle & extent, const Babl *format) //TODO: Add an overload if format can be NULL, and use a const & for this one.
+
+	_WRAP_METHOD(Glib::RefPtr<Buffer> create_sub_buffer(const Rectangle & extent), gegl_buffer_create_sub_buffer) //TODO: Should this be const?
+	//TODO: What does this do. It looks odd: _WRAP_METHOD(void destroy(), gegl_buffer_destroy)
+	_WRAP_METHOD(Rectangle get_extent() const, gegl_buffer_get_extent)
 	
 
 	// TODO macros
@@ -48,15 +52,20 @@
 	//height
 	//pixel_count
 
-	_WRAP_METHOD(void get(double scale, const Rectangle & rect, const Babl *format, void * dest, int rowstride), gegl_buffer_get);
+	//TODO: Add an overload if format can be NULL, and use a const & for this one.
+	_WRAP_METHOD(void get(double scale, const Rectangle & rect, const Babl *format, void * dest, int rowstride) const, gegl_buffer_get);
+
+	//TODO: Add an overload if format can be NULL, and use a const & for this one.
 	_WRAP_METHOD(void set(const Rectangle & rect, const Babl *format, void *src, int rowstride), gegl_buffer_set)
 	_WRAP_METHOD(void copy(const Rectangle & src_rect, const Glib::RefPtr<Buffer> & dest, const Rectangle & dest_rect), gegl_buffer_copy)
-	_WRAP_METHOD(Glib::RefPtr<Buffer> dup(), gegl_buffer_dup)
+	_WRAP_METHOD(Glib::RefPtr<Buffer> dup() const, gegl_buffer_dup)
 
+	//TODO: Add an overload if format can be NULL, and use a const & for this one.
 	_WRAP_METHOD(void sample(double x, double y, double scale, void *dest, const Babl* format, Interpolation interpolation), gegl_buffer_sample)
 	_WRAP_METHOD(void sample_cleanup(), gegl_buffer_sample_cleanup)
 	_WRAP_METHOD(static Interpolation interpolation_from_string(const Glib::ustring & string), gegl_buffer_interpolation_from_string)
 	
+#m4 _CONVERSION(`GeglRectangle*',`const Rectangle&',`Glib::wrap($3)')
 	_WRAP_SIGNAL(void changed(const Rectangle &r), "changed", no_default_handler)
 
 	// Properties

Modified: geglmm/trunk/libgegl/src/color.hg
==============================================================================
--- geglmm/trunk/libgegl/src/color.hg	(original)
+++ geglmm/trunk/libgegl/src/color.hg	Wed May 21 18:31:58 2008
@@ -29,9 +29,12 @@
 	: public Glib::Object
 {
 	_CLASS_GOBJECT(Color, GeglColor, GEGL_COLOR, Glib::Object, GObject)
-public:
+protected:
 	_WRAP_CTOR(Color(const Glib::ustring & s), gegl_color_new)
-	_WRAP_METHOD(void get_rgba(float & r, float & g, float & b, float & a), gegl_color_get_rgba)
+
+public:
+	_WRAP_CREATE(const Glib::ustring & s)
+	_WRAP_METHOD(void get_rgba(float & r, float & g, float & b, float & a) const, gegl_color_get_rgba)
 	_WRAP_METHOD(void set_rgba(float r, float g, float b, float a), gegl_color_set_rgba)
 
 

Modified: geglmm/trunk/libgegl/src/curve.hg
==============================================================================
--- geglmm/trunk/libgegl/src/curve.hg	(original)
+++ geglmm/trunk/libgegl/src/curve.hg	Wed May 21 18:31:58 2008
@@ -28,15 +28,20 @@
 	: public Glib::Object
 {
 	_CLASS_GOBJECT(Curve, GeglCurve, GEGL_CURVE, Glib::Object, GObject)
-public:
+
+protected:
 	_WRAP_CTOR(Curve(double y_min, double y_max), gegl_curve_new)
-	_WRAP_METHOD(static Glib::RefPtr<Curve> default_curve(), gegl_curve_default_curve)
-	_WRAP_METHOD(void get_y_bounds(double & min_y, double & max_y), gegl_curve_get_y_bounds)
+
+public:
+	_WRAP_CREATE(double y_min, double y_max)
+	_WRAP_METHOD(static Glib::RefPtr<Curve> create_default_curve(), gegl_curve_default_curve) //TODO: The default values should be in the C properties or its *_init(), so we don't need to use this C function.
+
+	_WRAP_METHOD(void get_y_bounds(double & min_y, double & max_y) const, gegl_curve_get_y_bounds)
 	_WRAP_METHOD(void get_bounds(double & min_x, double & max_x, double & min_y, double & max_y), gegl_curve_get_bounds)
 	_WRAP_METHOD(guint add_point(double x, double y), gegl_curve_add_point)
-	_WRAP_METHOD(void get_point(guint index, double &x, double &y), gegl_curve_get_point)
+	_WRAP_METHOD(void get_point(guint index, double &x, double &y) const, gegl_curve_get_point)
 	_WRAP_METHOD(void set_point(guint index, double x, double y), gegl_curve_set_point)
-	_WRAP_METHOD(guint num_points(), gegl_curve_num_points)
+	_WRAP_METHOD(guint num_points() const, gegl_curve_num_points)
 	_WRAP_METHOD(double calc_value(double x), gegl_curve_calc_value)
 	_WRAP_METHOD(void calc_values(double x_min, double x_max, guint num_samples, double & xs, double & ys), gegl_curve_calc_values)
 

Added: geglmm/trunk/libgegl/src/libgegl_docs.xml
==============================================================================
--- (empty file)
+++ geglmm/trunk/libgegl/src/libgegl_docs.xml	Wed May 21 18:31:58 2008
@@ -0,0 +1,2 @@
+<root>
+</root>

Added: geglmm/trunk/libgegl/src/libgegl_docs_override.xml
==============================================================================
--- (empty file)
+++ geglmm/trunk/libgegl/src/libgegl_docs_override.xml	Wed May 21 18:31:58 2008
@@ -0,0 +1,2 @@
+<root>
+</root>

Modified: geglmm/trunk/libgegl/src/node.ccg
==============================================================================
--- geglmm/trunk/libgegl/src/node.ccg	(original)
+++ geglmm/trunk/libgegl/src/node.ccg	Wed May 21 18:31:58 2008
@@ -26,10 +26,10 @@
 
 namespace  Gegl {
 
-	const Glib::RefPtr<Node> Node::get_producer(const Glib::ustring & input_pad_name, Glib::ustring * output_pad_name)
+	Glib::RefPtr<Node> Node::get_producer(const Glib::ustring & input_pad_name, Glib::ustring * output_pad_name) const
 	{
 		gchar *s = NULL;
-		Glib::RefPtr<Node> node(Glib::wrap(gegl_node_get_producer(gobj(), 
+		Glib::RefPtr<Node> node(Glib::wrap(gegl_node_get_producer(const_cast<GeglNode*>(gobj()), 
 																  (gchar*)input_pad_name.c_str(), 
 																  output_pad_name?&s:NULL)));
 		if(output_pad_name) {

Modified: geglmm/trunk/libgegl/src/node.hg
==============================================================================
--- geglmm/trunk/libgegl/src/node.hg	(original)
+++ geglmm/trunk/libgegl/src/node.hg	Wed May 21 18:31:58 2008
@@ -38,14 +38,20 @@
 	: public Glib::Object
 {
 	_CLASS_GOBJECT(Node, GeglNode, GEGL_NODE, Glib::Object, GObject)
-public:
+protected:
 	_CTOR_DEFAULT
+
+public:
+	_WRAP_CREATE()
 	
 	//	_WRAP_METHOD(static Glib::RefPtr<Node> new_child(const Glib::RefPtr<Node> & parent, const Glib::ustring & first_property_name, ...) G_GNUC_NULL_TERMINATED, gegl_node_new_child)
-	_WRAP_METHOD(bool connect_from(const Glib::ustring&input_pad_name, const Glib::RefPtr<Node> & source, const Glib::ustring & output_pad_name), gegl_node_connect_from)
+	_WRAP_METHOD(bool connect_from(const Glib::ustring & input_pad_name, const Glib::RefPtr<Node> & source, const Glib::ustring & output_pad_name), gegl_node_connect_from)
 	_WRAP_METHOD(bool connect_to(const Glib::ustring & output_pad_name, const Glib::RefPtr<Node> & sink, const Glib::ustring & input_pad_name), gegl_node_connect_to)
+
+//TODO: Return this, and throw an exception, to allow node->link(node2)->link(node3), like in gstreammermm?
 	_WRAP_METHOD(void link(const Glib::RefPtr<Node> & sink), gegl_node_link)
 //	_WRAP_METHOD(void link_many(const Glib::RefPtr<Node> & first_sink, ...) G_GNUC_NULL_TERMINATED, gegl_node_link_many)
+
 	_WRAP_METHOD(bool disconnect(const Glib::ustring & input_pad), gegl_node_disconnect)
 //	_WRAP_METHOD(void set(const Glib::ustring & first_property_name, ...) G_GNUC_NULL_TERMINATED, gegl_node_set)
 //	_WRAP_METHOD(void get(const Glib::ustring & first_property_name, ...) G_GNUC_NULL_TERMINATED, gegl_node_get)	
@@ -53,21 +59,35 @@
 	_WRAP_METHOD(void blit(double scale, const Rectangle &roi, const Babl * format, void * destination_buf, int rowstride, BlitFlags flags), gegl_node_blit)
 	_WRAP_METHOD(void process(), gegl_node_process)
 	// not sure.
-	_WRAP_METHOD(const Glib::RefPtr<Node> adopt_child(const Glib::RefPtr<Node> & child), gegl_node_adopt_child)
-	_WRAP_METHOD(const Glib::RefPtr<Node> get_parent(), gegl_node_get_parent)
-	_WRAP_METHOD(const Glib::RefPtr<Node> detect(int x, int y), gegl_node_detect)
+	_WRAP_METHOD(Glib::RefPtr<Node> adopt_child(const Glib::RefPtr<Node> & child), gegl_node_adopt_child)
+
+	_WRAP_METHOD(Glib::RefPtr<Node> get_parent(), gegl_node_get_parent, refreturn)
+	_WRAP_METHOD(Glib::RefPtr<const Node> get_parent() const, gegl_node_get_parent, refreturn, constversion)
+
+	_WRAP_METHOD(Glib::RefPtr<Node> detect(int x, int y), gegl_node_detect, refreturn)
+	_WRAP_METHOD(Glib::RefPtr<const Node> detect(int x, int y) const, gegl_node_detect, refreturn, constversion)
+
 	_WRAP_METHOD(GParamSpec* find_property(const Glib::ustring & property_name), gegl_node_find_property)
-	_WRAP_METHOD(Rectangle get_bounding_box(), gegl_node_get_bounding_box)
+	_WRAP_METHOD(Rectangle get_bounding_box() const, gegl_node_get_bounding_box)
+
+//TODO: Use the appropriate SListHandle ownership, and add a const version:
 	_WRAP_METHOD(Glib::SListHandle< Glib::RefPtr<Node> > get_children(), gegl_node_get_children)
 
-	_WRAP_METHOD(int get_consumers(const Glib::ustring & output_pad, GeglNode    ***nodes, const gchar ***pads), gegl_node_get_consumers)
-	_WRAP_METHOD(const Glib::RefPtr<Node> get_input_proxy  (const Glib::ustring & pad_name), gegl_node_get_input_proxy)
-	_WRAP_METHOD(const Glib::RefPtr<Node> get_output_proxy  (const Glib::ustring & pad_name), gegl_node_get_output_proxy)
-	_WRAP_METHOD(Glib::ustring get_operation(), gegl_node_get_operation)
+	_WRAP_METHOD(int get_consumers(const Glib::ustring & output_pad, GeglNode    ***nodes, const gchar ***pads) const, gegl_node_get_consumers)
+
+	_WRAP_METHOD(Glib::RefPtr<Node> get_input_proxy(const Glib::ustring & pad_name), gegl_node_get_input_proxy, refreturn)
+	_WRAP_METHOD(Glib::RefPtr<const Node> get_input_proxy(const Glib::ustring & pad_name) const, gegl_node_get_input_proxy, refreturn, constversion)
+
+	_WRAP_METHOD(Glib::RefPtr<Node> get_output_proxy(const Glib::ustring & pad_name), gegl_node_get_output_proxy, refreturn)
+	_WRAP_METHOD(Glib::RefPtr<const Node> get_output_proxy(const Glib::ustring & pad_name) const, gegl_node_get_output_proxy, refreturn, constversion)
+
+	_WRAP_METHOD(Glib::ustring get_operation() const, gegl_node_get_operation)
 
 	// implemented by hand
-	//	_WRAP_METHOD(const Glib::RefPtr<Node> get_producer(const Glib::ustring & input_pad_name, Glib::ustring * output_pad_name), gegl_node_get_producer)
-	const Glib::RefPtr<Node> get_producer(const Glib::ustring & input_pad_name, Glib::ustring * output_pad_name);
+	//	_WRAP_METHOD(Glib::RefPtr<Node> get_producer(const Glib::ustring & input_pad_name, Glib::ustring * output_pad_name), gegl_node_get_producer)
+
+//TODO: Use a & instead of a * and add an override witout the output_pad_name:
+	Glib::RefPtr<Node> get_producer(const Glib::ustring & input_pad_name, Glib::ustring * output_pad_name) const;
 
 	_WRAP_METHOD(static Glib::RefPtr<Node> create_child(const Glib::RefPtr<Node> & parent, const Glib::ustring & operation), gegl_node_create_child)
 
@@ -75,19 +95,18 @@
 	//	_WRAP_METHOD(void get_property(const Glib::ustring & property_name, Glib::ValueBase & value), gegl_node_get_property)
 	//	_WRAP_METHOD(void set_property(const Glib::ustring & property_name, const Glib::ValueBase & value), gegl_node_set_property)
 
-	_WRAP_METHOD(static const Glib::RefPtr<Node> new_from_xml(const Glib::ustring & xmldata, const Glib::ustring & path_root), gegl_node_new_from_xml)
-	_WRAP_METHOD(static const Glib::RefPtr<Node> new_from_file(const Glib::ustring & path), gegl_node_new_from_file)
-	_WRAP_METHOD(Glib::ustring to_xml(const Glib::ustring & path_root), gegl_node_to_xml)
+	_WRAP_METHOD(static Glib::RefPtr<Node> new_from_xml(const Glib::ustring & xmldata, const Glib::ustring & path_root), gegl_node_new_from_xml)
+	_WRAP_METHOD(static Glib::RefPtr<Node> new_from_file(const Glib::ustring & path), gegl_node_new_from_file)
+	_WRAP_METHOD(Glib::ustring to_xml(const Glib::ustring & path_root) const, gegl_node_to_xml)
 
-	_WRAP_METHOD(const Glib::RefPtr<Processor> new_processor(const Rectangle & rectangle), gegl_node_new_processor)
+	_WRAP_METHOD(Glib::RefPtr<Processor> new_processor(const Rectangle & rectangle), gegl_node_new_processor)
 
 	// Properties.
 	_WRAP_PROPERTY("gegl-operation", Glib::RefPtr<Operation>)
 	_WRAP_PROPERTY("operation", Glib::ustring)
 	_WRAP_PROPERTY("name", Glib::ustring)
 
-
-	// can't wrap the signals as we don't have GeglNodeClass...
+#m4 _CONVERSION(`GeglRectangle*',`const Rectangle&',`Glib::wrap($3)')
 	_WRAP_SIGNAL(void invalidated(const Rectangle &r), "invalidated", no_default_handler)
 	_WRAP_SIGNAL(void computed(const Rectangle &r), "computed", no_default_handler)
 };

Modified: geglmm/trunk/libgegl/src/operation.hg
==============================================================================
--- geglmm/trunk/libgegl/src/operation.hg	(original)
+++ geglmm/trunk/libgegl/src/operation.hg	Wed May 21 18:31:58 2008
@@ -32,24 +32,28 @@
 class Node;
 class NodeContext;
 
+//TODO: Document how these should be created (Add create() methods?) or obtained.
+
 class Operation
 	: public Glib::Object
 {
 	_CLASS_GOBJECT(Operation, GeglOperation, GEGL_OPERATION, Glib::Object, GObject)
 public:
-	_WRAP_METHOD(Rectangle get_invalidated_by_change(const Glib::ustring & input_pad, const Rectangle & input_region), gegl_operation_get_invalidated_by_change)
-	_WRAP_METHOD(Rectangle get_bounding_box(), gegl_operation_get_bounding_box)
-	_WRAP_METHOD(const Rectangle& source_get_bounding_box(const Glib::ustring & pad_name), gegl_operation_source_get_bounding_box)
-	_WRAP_METHOD(Rectangle get_cached_region(const Rectangle & roi), gegl_operation_get_cached_region)
-	_WRAP_METHOD(Rectangle get_required_for_output(const Glib::ustring & input_pda, const Rectangle & roi), gegl_operation_get_required_for_output)
-	_WRAP_METHOD(const Glib::RefPtr<Node> detect(int x, int y), gegl_operation_detect)
+	_WRAP_METHOD(Rectangle get_invalidated_by_change(const Glib::ustring & input_pad, const Rectangle & input_region) const, gegl_operation_get_invalidated_by_change)
+	_WRAP_METHOD(Rectangle get_bounding_box() const, gegl_operation_get_bounding_box)
+	_WRAP_METHOD(Rectangle source_get_bounding_box(const Glib::ustring & pad_name) const, gegl_operation_source_get_bounding_box)
+	_WRAP_METHOD(Rectangle get_cached_region(const Rectangle & roi) const, gegl_operation_get_cached_region)
+	_WRAP_METHOD(Rectangle get_required_for_output(const Glib::ustring & input_pda, const Rectangle & roi) const, gegl_operation_get_required_for_output)
+	_WRAP_METHOD(Glib::RefPtr<Node> detect(int x, int y), gegl_operation_detect, refreturn)
+	_WRAP_METHOD(Glib::RefPtr<const Node> detect(int x, int y) const, gegl_operation_detect, refreturn, constversion)
 	_WRAP_METHOD(void attach(const Glib::RefPtr<Node> & node), gegl_operation_attach)
 	_WRAP_METHOD(void prepare(), gegl_operation_prepare)
 	_WRAP_METHOD(bool process(const Glib::RefPtr<NodeContext> & context, const Glib::ustring & output_pad, const Rectangle & result_rect), gegl_operation_process)
-	_WRAP_METHOD(void create_pad(GParamSpec    *param_spec), gegl_operation_create_pad)
+	_WRAP_METHOD(void create_pad(GParamSpec *param_spec), gegl_operation_create_pad)
 	_WRAP_METHOD(void set_format(const Glib::ustring & pad_name, const Babl *format), gegl_operation_set_format)
-	_WRAP_METHOD(const Babl* get_format(const Glib::ustring & pad_name), gegl_operation_get_format)
-	_WRAP_METHOD(Glib::RefPtr<Node> get_source_node(const Glib::ustring & pad_name), gegl_operation_get_source_node)
+	_WRAP_METHOD(const Babl* get_format(const Glib::ustring & pad_name), gegl_operation_get_format) //TODO: Wrap Babl.
+	_WRAP_METHOD(Glib::RefPtr<Node> get_source_node(const Glib::ustring & pad_name), gegl_operation_get_source_node, refreturn)
+	_WRAP_METHOD(Glib::RefPtr<const Node> get_source_node(const Glib::ustring & pad_name) const, gegl_operation_get_source_node, refreturn, constversion)
 
 	// this one is implemented in OperationMeta
 	_IGNORE(gegl_operation_meta_redirect)
@@ -108,7 +112,7 @@
 	_CLASS_GOBJECT(OperationMeta, GeglOperationMeta, GEGL_OPERATION_META, Operation, GeglOperation)
 public:
 	//	_WRAP_METHOD(void redirect(const Glib::ustring & name, const Glib::RefPtr<Node> & internal, const Glib::ustring & internal_name), gegl_operation_meta_redirect)
-	_WRAP_METHOD(void propert_changed(GParamSpec * arg1, void *user_data), gegl_operation_meta_property_changed)
+	_WRAP_METHOD(void property_changed(GParamSpec * arg1, void *user_data), gegl_operation_meta_property_changed)
 };
 
 

Modified: geglmm/trunk/libgegl/src/processor.hg
==============================================================================
--- geglmm/trunk/libgegl/src/processor.hg	(original)
+++ geglmm/trunk/libgegl/src/processor.hg	Wed May 21 18:31:58 2008
@@ -35,6 +35,10 @@
 
 	_WRAP_METHOD(void set_rectangle(const Rectangle & rectangle), gegl_processor_set_rectangle);
 	_WRAP_METHOD(bool work(double & progress), gegl_processor_work);
+
+//TODO: This "Frees up resources used by a processing handle", 
+//but does it really destroy the whole GeglProcessor? If so, how does that work/clash with reference-counting.
+//We should generally avoid having this in public C++ API.
 	_WRAP_METHOD(void destroy(), gegl_processor_destroy);
 };
 

Modified: geglmm/trunk/libgegl/src/rectangle.hg
==============================================================================
--- geglmm/trunk/libgegl/src/rectangle.hg	(original)
+++ geglmm/trunk/libgegl/src/rectangle.hg	Wed May 21 18:31:58 2008
@@ -28,15 +28,15 @@
 	_CLASS_BOXEDTYPE_STATIC(Rectangle, GeglRectangle)
 public:
 	//	_CTOR_DEFAULT
-	Rectangle(const GeglRectangle & rect);
+	Rectangle(const GeglRectangle & rect); //TODO: Doesn't _CLASS_BOXEDTYPE_STATIC() create a GegRectangle* constructor already?
 
 	_WRAP_METHOD(void set(int x, int y, guint witdth, guint height), gegl_rectangle_set)
-	_WRAP_METHOD(bool equal(const Rectangle & s), gegl_rectangle_equal)
-	_WRAP_METHOD(bool equal_coords(int x, int y, int width, int heght), gegl_rectangle_equal_coords)
-	_WRAP_METHOD(void copy(const Rectangle & from), gegl_rectangle_copy)
+	_WRAP_METHOD(bool equal(const Rectangle & s) const, gegl_rectangle_equal) //TODO: Rename to operator==() const?
+	_WRAP_METHOD(bool equal_coords(int x, int y, int width, int heght) const, gegl_rectangle_equal_coords)
+	_WRAP_METHOD(void copy(const Rectangle & from), gegl_rectangle_copy) //Rename to copy constructor?
 	_WRAP_METHOD(void bounding_box(const Rectangle & src1, const Rectangle & src2), gegl_rectangle_bounding_box)
-	_WRAP_METHOD(bool intersect(const Rectangle & src1, const Rectangle & src2), gegl_rectangle_intersect)
-	_WRAP_METHOD(bool contains(const Rectangle & s), gegl_rectangle_contains)
+	_WRAP_METHOD(bool intersect(const Rectangle & src1, const Rectangle & src2), gegl_rectangle_intersect) //TODO: Make this const?
+	_WRAP_METHOD(bool contains(const Rectangle & s) const, gegl_rectangle_contains)
 };
 
 }

Modified: geglmm/trunk/tools/m4/convert_libgeglmm.m4
==============================================================================
--- geglmm/trunk/tools/m4/convert_libgeglmm.m4	(original)
+++ geglmm/trunk/tools/m4/convert_libgeglmm.m4	Wed May 21 18:31:58 2008
@@ -5,40 +5,45 @@
 _CONV_ENUM(Gegl,Interpolation)
 
 
-_CONVERSION(`GeglNode*',`const Glib::RefPtr<Node>&',Glib::wrap($3))
-_CONVERSION(`GeglNode*',`const Glib::RefPtr<Node>',Glib::wrap($3))
+#_CONVERSION(`GeglNode*',`const Glib::RefPtr<Node>&',Glib::wrap($3))
 _CONVERSION(`GeglNode*',`Glib::RefPtr<Node>',Glib::wrap($3))
+_CONVERSION(`GeglNode*',`Glib::RefPtr<const Node>',Glib::wrap($3))
 _CONVERSION(`const Glib::RefPtr<Node>&',`GeglNode*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<Node>',`GeglNode*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`Glib::RefPtr<Node>',`GeglNode*',__CONVERT_REFPTR_TO_P)
 
-_CONVERSION(`GeglProcessor*',`const Glib::RefPtr<Processor>&',Glib::wrap($3))
-_CONVERSION(`GeglProcessor*',`const Glib::RefPtr<Processor>',Glib::wrap($3))
+#_CONVERSION(`GeglProcessor*',`const Glib::RefPtr<Processor>&',Glib::wrap($3))
+_CONVERSION(`GeglProcessor*',`Glib::RefPtr<Processor>',Glib::wrap($3))
+_CONVERSION(`GeglProcessor*',`Glib::RefPtr<const Processor>',Glib::wrap($3))
 _CONVERSION(`const Glib::RefPtr<Processor>&',`GeglProcessor*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<Processor>',`GeglProcessor*',__CONVERT_REFPTR_TO_P)
 
 _CONVERSION(`GeglBuffer*',`Glib::RefPtr<Buffer>',Glib::wrap($3))
+_CONVERSION(`GeglBuffer*',`Glib::RefPtr<const Buffer>',Glib::wrap($3))
 _CONVERSION(`const Glib::RefPtr<Buffer>&',`GeglBuffer*',__CONVERT_REFPTR_TO_P)
 
 _CONVERSION(`GeglCurve*',`Glib::RefPtr<Curve>',Glib::wrap($3))
+_CONVERSION(`GeglCurve*',`Glib::RefPtr<const Curve>',Glib::wrap($3))
 _CONVERSION(`const Glib::RefPtr<Curve>&',`GeglCurve*',__CONVERT_REFPTR_TO_P)
 
 _CONVERSION(`GeglOperation*',`Glib::RefPtr<Operation>',Glib::wrap($3))
+_CONVERSION(`GeglOperation*',`Glib::RefPtr<const Operation>',Glib::wrap($3))
 _CONVERSION(`const Glib::RefPtr<Operation>&',`GeglOperation*',__CONVERT_REFPTR_TO_P)
 
 _CONVERSION(`const Glib::RefPtr<NodeContext>&',`GeglNodeContext*',__CONVERT_REFPTR_TO_P)
 
 _CONVERSION(`GeglColor*',`Glib::RefPtr<Color>',Glib::wrap($3))
-
+_CONVERSION(`GeglColor*',`Glib::RefPtr<const Color>',Glib::wrap($3))
 
 _CONVERSION(`GObject*',`Glib::RefPtr<Parameter>',`Glib::wrap($3)')
+_CONVERSION(`GObject*',`Glib::RefPtr<const Parameter>',`Glib::wrap($3)')
 
 _CONVERSION(const Gegl::Rectangle&,GeglRectangle*,__CFR2P)
 _CONVERSION(const Rectangle&,GeglRectangle*,__CFR2P)
 _CONVERSION(`const Rectangle&',`const GeglRectangle*',__CFR2P)
-_CONVERSION(`const GeglRectangle*',`const Gegl::Rectangle&',`Glib::wrap($3)')
-_CONVERSION(`const GeglRectangle*',`const Rectangle &',`Glib::wrap($3)')
-_CONVERSION(`GeglRectangle*',`const Rectangle&',`Glib::wrap($3)')
+_CONVERSION(`GeglRectangle*',`Rectangle',`Glib::wrap($3)')
+_CONVERSION(`const GeglRectangle*',`Rectangle',`Glib::wrap($3)')
+#_CONVERSION(`const GeglRectangle*',`const Rectangle &',`Glib::wrap($3)')
 _CONVERSION(`GeglRectangle',`Rectangle',`Rectangle($3)')
 
 _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<Node> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]