[cluttermm/cluttermm-1.2] Initial wrapping of ClutterBoxLayout.



commit 94085da27202b5ea957b276f6fc3208819fefea6
Author: Chris Kühl <chrisk openismus com>
Date:   Fri Jan 14 02:05:09 2011 +0100

    Initial wrapping of ClutterBoxLayout.
    
    * clutter/cluttermm.h: Added header file for new class.
    * clutter/src/box-layout.[hg|ccg]: Initial wrapping of ClutterBoxLayout.
    * clutter/src/clutter_signals.defs: Added properties for new class.
    * clutter/src/filelist.am: Added new classes to files_hg list.
    * codegen/extradefs/generate_extra_defs_clutter.cc: Added new class.
    * codegen/m4/convert_clutter.m4: Added enum conversion for BoxAlignment.

 ChangeLog                                        |   11 +++
 clutter/cluttermm.h                              |    3 +-
 clutter/src/box-layout.ccg                       |   24 +++++++
 clutter/src/box-layout.hg                        |   76 ++++++++++++++++++++++
 clutter/src/clutter_signals.defs                 |   67 +++++++++++++++++++
 clutter/src/filelist.am                          |    1 +
 codegen/extradefs/generate_extra_defs_clutter.cc |    1 +
 codegen/m4/convert_clutter.m4                    |    3 +
 8 files changed, 185 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index abe9f66..c36b825 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-01-14  Chris Kühl  <chrisk openismus com>
+
+	Initial wrapping of ClutterBoxLayout.
+
+	* clutter/cluttermm.h: Added header file for new class.
+	* clutter/src/box-layout.[hg|ccg]: Initial wrapping of ClutterBoxLayout.
+	* clutter/src/clutter_signals.defs: Added properties for new class.
+	* clutter/src/filelist.am: Added new classes to files_hg list.
+	* codegen/extradefs/generate_extra_defs_clutter.cc: Added new class.
+	* codegen/m4/convert_clutter.m4: Added enum conversion for BoxAlignment.
+
 2011-01-13  Chris Kühl  <chrisk openismus com>
 
 	Wrapped clutter_bin_layout_get_alignment.
diff --git a/clutter/cluttermm.h b/clutter/cluttermm.h
index 117450f..7e6f40c 100644
--- a/clutter/cluttermm.h
+++ b/clutter/cluttermm.h
@@ -63,9 +63,10 @@
 #include <cluttermm/behaviour-opacity.h>
 #include <cluttermm/behaviour-path.h>
 #include <cluttermm/behaviour-rotate.h>
-#include <cluttermm/bin-layout.h>
 #include <cluttermm/behaviour-scale.h>
+#include <cluttermm/bin-layout.h>
 #include <cluttermm/box.h>
+#include <cluttermm/box-layout.h>
 #include <cluttermm/cairo-texture.h>
 #include <cluttermm/clone.h>
 #include <cluttermm/color.h>
diff --git a/clutter/src/box-layout.ccg b/clutter/src/box-layout.ccg
new file mode 100644
index 0000000..9200f72
--- /dev/null
+++ b/clutter/src/box-layout.ccg
@@ -0,0 +1,24 @@
+/* Copyright (C) 2011 The cluttermm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <clutter/clutter.h>
+
+namespace Clutter
+{
+
+} //namespace Clutter
+
diff --git a/clutter/src/box-layout.hg b/clutter/src/box-layout.hg
new file mode 100644
index 0000000..c4a7266
--- /dev/null
+++ b/clutter/src/box-layout.hg
@@ -0,0 +1,76 @@
+/* Copyright (C) 2011 The cluttermm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <cluttermm/layout-manager.h>
+
+_DEFS(cluttermm,clutter)
+_PINCLUDE(cluttermm/private/layout-manager_p.h)
+
+namespace Clutter
+{
+
+_WRAP_ENUM(BoxAlignment, ClutterBoxAlignment)
+
+class BoxLayout :
+    public LayoutManager
+{
+  _CLASS_GOBJECT(BoxLayout, ClutterBoxLayout, CLUTTER_BOX_LAYOUT, LayoutManager, ClutterLayoutManager)
+
+protected:
+  _CTOR_DEFAULT()
+
+public:
+  _WRAP_CREATE()
+
+  _WRAP_METHOD(void set_pack_start(bool pack_start), clutter_box_layout_set_pack_start)
+  _WRAP_METHOD(bool get_pack_start(), clutter_box_layout_get_pack_start)
+  _WRAP_METHOD(void set_spacing(guint spacing), clutter_box_layout_set_spacing)
+  _WRAP_METHOD(guint get_spacing(), clutter_box_layout_get_spacing)
+  _WRAP_METHOD(void set_vertical(bool vertical), clutter_box_layout_set_vertical)
+  _WRAP_METHOD(bool get_vertical(), clutter_box_layout_get_vertical)
+  // 1.4
+  // _WRAP_METHOD(void set_homogeneous(bool homogeneous), clutter_box_layout_set_homogeneous)
+  // _WRAP_METHOD(bool get_homogeneous(), clutter_box_layout_get_homogeneous)
+
+  _WRAP_METHOD(void pack(const Glib::RefPtr<Actor>&, bool expand, bool x_fill, bool y_fill, BoxAlignment x_align, BoxAlignment y_align), clutter_box_layout_pack)
+
+  _WRAP_METHOD(void set_alignment(const Glib::RefPtr<Actor>& child, BoxAlignment x_align, BoxAlignment y_align), clutter_box_layout_set_alignment)
+  _WRAP_METHOD(void get_alignment(const Glib::RefPtr<Actor>& child, BoxAlignment &x_align, BoxAlignment &y_align), clutter_box_layout_get_alignment)
+  _WRAP_METHOD(void set_expand(const Glib::RefPtr<Actor>& child, bool expand), clutter_box_layout_set_expand)
+  _WRAP_METHOD(bool get_expand(const Glib::RefPtr<Actor>& child), clutter_box_layout_get_expand)
+  _WRAP_METHOD(void set_fill(const Glib::RefPtr<Actor>& child, bool x_fill, bool y_fill), clutter_box_layout_set_fill)
+  #m4 _CONVERSION(`bool&',`gboolean*',`(($2) &($3))')
+  _WRAP_METHOD(void get_fill(const Glib::RefPtr<Actor>& child, bool &x_fill, bool &y_fill), clutter_box_layout_get_fill)
+
+  _WRAP_METHOD(void set_use_animations(bool animate), set_use_animations)
+  _WRAP_METHOD(bool get_use_animations(), clutter_box_layout_get_use_animations)
+  _WRAP_METHOD(void set_easing_duration(guint msecs), clutter_box_layout_set_easing_duration)
+  _WRAP_METHOD(guint get_easing_duration(), clutter_box_layout_get_easing_duration)
+  _WRAP_METHOD(void set_easing_mode(gulong mode), clutter_box_layout_set_easing_mode)
+  _WRAP_METHOD(gulong get_easing_mode(), clutter_box_layout_get_easing_mode)
+
+  _WRAP_PROPERTY("easing-duration", unsigned int)
+  _WRAP_PROPERTY("easing-mode", unsigned long)
+  // 1.4 _WRAP_PROPERTY("homogeneous", bool)
+  _WRAP_PROPERTY("pack-start", bool)
+  _WRAP_PROPERTY("spacing", unsigned int)
+  _WRAP_PROPERTY("use-animations", bool)
+  _WRAP_PROPERTY("vertical", bool)
+};
+
+} // namespace Clutter
+
diff --git a/clutter/src/clutter_signals.defs b/clutter/src/clutter_signals.defs
index 49fa57e..7a0b4a9 100644
--- a/clutter/src/clutter_signals.defs
+++ b/clutter/src/clutter_signals.defs
@@ -1084,6 +1084,73 @@
   (construct-only #f)
 )
 
+;; From BoxLayout
+
+
+(define-property spacing
+  (of-object "ClutterBoxLayout")
+  (prop-type "GParamUInt")
+  (docs "Spacing between children")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property vertical
+  (of-object "ClutterBoxLayout")
+  (prop-type "GParamBoolean")
+  (docs "Whether the layout should be vertical, rather than horizontal")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+;; 1.4
+;; (define-property homogeneous
+;;   (of-object "ClutterBoxLayout")
+;;   (prop-type "GParamBoolean")
+;;   (docs "Whether the layout should be homogeneous, i.e. all children get the same size")
+;;   (readable #t)
+;;   (writable #t)
+;;   (construct-only #f)
+;; )
+
+(define-property pack-start
+  (of-object "ClutterBoxLayout")
+  (prop-type "GParamBoolean")
+  (docs "Whether to pack items at the start of the box")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property use-animations
+  (of-object "ClutterBoxLayout")
+  (prop-type "GParamBoolean")
+  (docs "Whether layout changes should be animated")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property easing-mode
+  (of-object "ClutterBoxLayout")
+  (prop-type "GParamULong")
+  (docs "The easing mode of the animations")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property easing-duration
+  (of-object "ClutterBoxLayout")
+  (prop-type "GParamUInt")
+  (docs "The duration of the animations")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
 ;; From ClutterCairoTexture
 
 (define-property name
diff --git a/clutter/src/filelist.am b/clutter/src/filelist.am
index e4044c0..b528c65 100644
--- a/clutter/src/filelist.am
+++ b/clutter/src/filelist.am
@@ -24,6 +24,7 @@ files_hg =			\
 	behaviour-scale.hg	\
 	bin-layout.hg           \
 	box.hg			\
+	box-layout.hg           \
 	cairo-texture.hg	\
 	childmeta.hg		\
 	clone.hg		\
diff --git a/codegen/extradefs/generate_extra_defs_clutter.cc b/codegen/extradefs/generate_extra_defs_clutter.cc
index e5ee4f3..e829bc9 100644
--- a/codegen/extradefs/generate_extra_defs_clutter.cc
+++ b/codegen/extradefs/generate_extra_defs_clutter.cc
@@ -38,6 +38,7 @@ int main(int argc, char** argv)
     << get_defs(CLUTTER_TYPE_BEHAVIOUR_SCALE)
     << get_defs(CLUTTER_TYPE_BIN_LAYOUT)
     << get_defs(CLUTTER_TYPE_BOX)
+    << get_defs(CLUTTER_TYPE_BOX_LAYOUT)
     << get_defs(CLUTTER_TYPE_CAIRO_TEXTURE)
     << get_defs(CLUTTER_TYPE_CHILD_META)
     << get_defs(CLUTTER_TYPE_CLONE)
diff --git a/codegen/m4/convert_clutter.m4 b/codegen/m4/convert_clutter.m4
index 9a3af35..cf66a59 100644
--- a/codegen/m4/convert_clutter.m4
+++ b/codegen/m4/convert_clutter.m4
@@ -118,6 +118,7 @@ _CONV_ENUM(Clutter,ActorFlags)
 _CONV_ENUM(Clutter,AllocationFlags)
 _CONV_ENUM(Clutter,AnimationMode)
 _CONV_ENUM(Clutter,BinAlignment)
+_CONV_ENUM(Clutter,BoxAlignment)
 _CONV_ENUM(Clutter,LayoutFlags)
 _CONV_ENUM(Clutter,PackType)
 _CONV_ENUM(Clutter,PickMode)
@@ -134,6 +135,8 @@ _CONV_ENUM(Pango,WrapMode)
 
 _CONVERSION(`guint32', `ActorFlags', `static_cast<ActorFlags>($3)')
 _CONVERSION(`const gchar*', `const Glib::ustring&',__GCHARP_TO_USTRING)
+
 _CONVERSION(`BinAlignment&',`ClutterBinAlignment*',`(($2) &($3))')
+_CONVERSION(`BoxAlignment&',`ClutterBoxAlignment*',`(($2) &($3))')
 
 _CONVERSION(`PangoContext*',`Glib::RefPtr<const Pango::Context>',Glib::wrap($3))



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