[cluttermm] Added custom default ctor to Knot class.



commit 03cc489b64833e0bbd341598dc5be253e2428435
Author: Chris Kühl <chrisk openismus com>
Date:   Tue Aug 31 12:15:43 2010 +0200

    Added custom default ctor to Knot class.

 ChangeLog             |    7 +++++++
 clutter/src/types.ccg |    6 ++++++
 clutter/src/types.hg  |   43 +++++++++++++++++++++++++------------------
 3 files changed, 38 insertions(+), 18 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f1f1a56..6b27a0a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-09-02  Chris Kühl  <chrisk openismus com>
+
+	Added custom default ctor to Knot class.
+
+	* clutter/src/types.hg: Needed changes to add custom default ctor.
+	* clutter/src/types/ccg: Implementation of custom default ctor.
+
 2010-08-27  Chris Kühl  <chrisk openismus com>
 
 	Added previously removed pick_vfunc to Actor class.
diff --git a/clutter/src/types.ccg b/clutter/src/types.ccg
index 0e8a5d2..ac869b1 100644
--- a/clutter/src/types.ccg
+++ b/clutter/src/types.ccg
@@ -20,6 +20,12 @@
 namespace Clutter
 {
 
+Knot::Knot()
+{
+  ClutterKnot tmp = {0, 0};
+  gobject_ = clutter_knot_copy(&tmp);
+}
+
 Knot::Knot(int x, int y)
 {
   ClutterKnot tmp = {x, y};
diff --git a/clutter/src/types.hg b/clutter/src/types.hg
index df2bde4..b498d7c 100644
--- a/clutter/src/types.hg
+++ b/clutter/src/types.hg
@@ -47,24 +47,6 @@ _WRAP_ENUM(RequestMode, ClutterRequestMode)
 _WRAP_ENUM(FontFlags, ClutterFontFlags)
 _WRAP_ENUM(TextDirection, ClutterTextDirection)
 
-class Knot
-{
-  _CLASS_BOXEDTYPE(Knot, ClutterKnot, NONE, clutter_knot_copy, clutter_knot_free)
-public:
-  Knot(int x, int y);
-
-  _MEMBER_GET(x, x, int, int)
-  void set_x(int x);
-  _MEMBER_GET(y, y, int, int)
-  void set_y(int y);
-  void set_xy(int x, int y);
-
-#m4begin
-  _WRAP_EQUAL(clutter_knot_equal)
-#m4end
-  _IGNORE(clutter_knot_equal)
-};
-
 class Vertex
 {
   _CLASS_BOXEDTYPE_STATIC(Vertex, ClutterVertex)
@@ -98,4 +80,29 @@ public:
   void set_size(unsigned int width, unsigned int height);
 };
 
+class Knot
+{
+  _CLASS_BOXEDTYPE(Knot, ClutterKnot, NONE, clutter_knot_copy, clutter_knot_free)
+  _IGNORE(clutter_knot_copy)
+  _IGNORE(clutter_knot_free)
+public:
+
+  // NOTE: _CUSTOM_DEFAULT_CTOR must be used on the last class definition
+  // as it "falls through" to any following definitions in the same file.
+  _CUSTOM_DEFAULT_CTOR
+  Knot();
+  Knot(int x, int y);
+
+  _MEMBER_GET(x, x, int, int)
+  void set_x(int x);
+  _MEMBER_GET(y, y, int, int)
+  void set_y(int y);
+  void set_xy(int x, int y);
+
+#m4begin
+  _WRAP_EQUAL(clutter_knot_equal)
+#m4end
+  _IGNORE(clutter_knot_equal)
+};
+
 } // namespace Clutter



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