[cluttermm] Initial wrapping of ClutterFlowLayout.



commit 2235605413c55d0e0f26a7a395ef0734b5c86bbd
Author: Chris Kühl <chrisk openismus com>
Date:   Fri Jan 14 02:52:48 2011 +0100

    Initial wrapping of ClutterFlowLayout.
    
    * clutter/cluttermm.h: Added header file for new class.
    * clutter/src/flow-layout.[hg|ccg]: Initial wrapping of ClutterFlowLayout.
    * 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 FlowOrientation.

 ChangeLog                                        |   11 +++
 clutter/cluttermm.h                              |    3 +-
 clutter/src/clutter_signals.defs                 |   74 ++++++++++++++++++++++
 clutter/src/filelist.am                          |    1 +
 clutter/src/flow-layout.ccg                      |   24 +++++++
 clutter/src/flow-layout.hg                       |   65 +++++++++++++++++++
 codegen/extradefs/generate_extra_defs_clutter.cc |    1 +
 codegen/m4/convert_clutter.m4                    |    1 +
 8 files changed, 179 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f8f00ff..e37cbee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2011-01-14  Chris Kühl  <chrisk openismus com>
 
+	Initial wrapping of ClutterFlowLayout.
+
+	* clutter/cluttermm.h: Added header file for new class.
+	* clutter/src/flow-layout.[hg|ccg]: Initial wrapping of ClutterFlowLayout.
+	* 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 FlowOrientation.
+
+2011-01-14  Chris Kühl  <chrisk openismus com>
+
 	Initial wrapping of ClutterBoxLayout.
 
 	* clutter/cluttermm.h: Added header file for new class.
diff --git a/clutter/cluttermm.h b/clutter/cluttermm.h
index dff0bb2..e7a701b 100644
--- a/clutter/cluttermm.h
+++ b/clutter/cluttermm.h
@@ -73,8 +73,9 @@
 #include <cluttermm/clone.h>
 #include <cluttermm/color.h>
 #include <cluttermm/event.h>
-#include <cluttermm/frame-source.h>
 #include <cluttermm/fixed-layout.h>
+#include <cluttermm/flow-layout.h>
+#include <cluttermm/frame-source.h>
 #include <cluttermm/group.h>
 #include <cluttermm/init.h>
 #include <cluttermm/interval.h>
diff --git a/clutter/src/clutter_signals.defs b/clutter/src/clutter_signals.defs
index 7a0b4a9..312144d 100644
--- a/clutter/src/clutter_signals.defs
+++ b/clutter/src/clutter_signals.defs
@@ -2165,6 +2165,80 @@
 
 ;; From ClutterEvent
 
+;; From FlowLayout
+
+(define-property orientation
+  (of-object "ClutterFlowLayout")
+  (prop-type "GParamEnum")
+  (docs "The orientation of the layout")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property homogeneous
+  (of-object "ClutterFlowLayout")
+  (prop-type "GParamBoolean")
+  (docs "Whether each item should receive the same allocation")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property column-spacing
+  (of-object "ClutterFlowLayout")
+  (prop-type "GParamFloat")
+  (docs "The spacing between columns")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property row-spacing
+  (of-object "ClutterFlowLayout")
+  (prop-type "GParamFloat")
+  (docs "The spacing between rows")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property min-column-width
+  (of-object "ClutterFlowLayout")
+  (prop-type "GParamFloat")
+  (docs "Minimum width for each column")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property max-column-width
+  (of-object "ClutterFlowLayout")
+  (prop-type "GParamFloat")
+  (docs "Maximum width for each column")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property min-row-height
+  (of-object "ClutterFlowLayout")
+  (prop-type "GParamFloat")
+  (docs "Minimum height for each row")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property max-row-height
+  (of-object "ClutterFlowLayout")
+  (prop-type "GParamFloat")
+  (docs "Maximum height for each row")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
 ;; From ClutterGroup
 
 (define-property name
diff --git a/clutter/src/filelist.am b/clutter/src/filelist.am
index 5eef145..8335301 100644
--- a/clutter/src/filelist.am
+++ b/clutter/src/filelist.am
@@ -34,6 +34,7 @@ files_hg =			\
 	container.hg		\
 	effect.hg               \
 	fixed-layout.hg         \
+	flow-layout.hg          \
 	group.hg		\
 	interval.hg		\
 	layoutmeta.hg		\
diff --git a/clutter/src/flow-layout.ccg b/clutter/src/flow-layout.ccg
new file mode 100644
index 0000000..9200f72
--- /dev/null
+++ b/clutter/src/flow-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/flow-layout.hg b/clutter/src/flow-layout.hg
new file mode 100644
index 0000000..16217f2
--- /dev/null
+++ b/clutter/src/flow-layout.hg
@@ -0,0 +1,65 @@
+/* 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(FlowOrientation, ClutterFlowOrientation)
+
+class FlowLayout :
+    public LayoutManager
+{
+  _CLASS_GOBJECT(FlowLayout, ClutterFlowLayout, CLUTTER_FLOW_LAYOUT, LayoutManager, ClutterLayoutManager)
+
+protected:
+  _WRAP_CTOR(FlowLayout(FlowOrientation orientation), clutter_flow_layout_new)
+
+public:
+  _WRAP_CREATE(FlowOrientation orientation)
+
+  _WRAP_METHOD(void set_homogeneous(bool homogeneous), clutter_flow_layout_set_homogeneous)
+  _WRAP_METHOD(bool get_homogeneous(), clutter_flow_layout_get_homogeneous)
+
+  _WRAP_METHOD(void set_orientation(FlowOrientation orientation), clutter_flow_layout_set_orientation)
+  _WRAP_METHOD(ClutterFlowOrientation get_orientation(), clutter_flow_layout_get_orientation)
+
+  _WRAP_METHOD(void set_column_spacing(float spacing), clutter_flow_layout_set_column_spacing)
+  _WRAP_METHOD(float get_column_spacing(), clutter_flow_layout_get_column_spacing)
+  _WRAP_METHOD(void set_row_spacing(float spacing), clutter_flow_layout_set_row_spacing)
+  _WRAP_METHOD(float get_row_spacing(), clutter_flow_layout_get_row_spacing)
+  _WRAP_METHOD(void set_column_width(float min_width, float max_width), clutter_flow_layout_set_column_width)
+  _WRAP_METHOD(void get_column_width(float &min_width, float &max_width), clutter_flow_layout_get_column_width)
+  _WRAP_METHOD(void set_row_height(float min_height, float max_height), clutter_flow_layout_set_row_height)
+  _WRAP_METHOD(void get_row_height(float &min_height, float &max_height), clutter_flow_layout_get_row_height)
+
+  _WRAP_PROPERTY("homogeneous", bool)
+  _WRAP_PROPERTY("orientation", FlowOrientation)
+  _WRAP_PROPERTY("column-spacing", float)
+  _WRAP_PROPERTY("row-spacing", float)
+  _WRAP_PROPERTY("min-column-width", float)
+  _WRAP_PROPERTY("max-column-width", float)
+  _WRAP_PROPERTY("min-row-width", float)
+  _WRAP_PROPERTY("max-row-width", float)
+};
+
+} // namespace Clutter
+
diff --git a/codegen/extradefs/generate_extra_defs_clutter.cc b/codegen/extradefs/generate_extra_defs_clutter.cc
index c2c3633..9800b48 100644
--- a/codegen/extradefs/generate_extra_defs_clutter.cc
+++ b/codegen/extradefs/generate_extra_defs_clutter.cc
@@ -49,6 +49,7 @@ int main(int argc, char** argv)
     << get_defs(CLUTTER_TYPE_EFFECT)
     << get_defs(CLUTTER_TYPE_EVENT)
     << get_defs(CLUTTER_TYPE_FIXED_LAYOUT)
+    << get_defs(CLUTTER_TYPE_FLOW_LAYOUT)
     << get_defs(CLUTTER_TYPE_GROUP)
     << get_defs(CLUTTER_TYPE_INTERVAL)
 //    << get_defs(CLUTTER_TYPE_HBOX)
diff --git a/codegen/m4/convert_clutter.m4 b/codegen/m4/convert_clutter.m4
index cf66a59..01ea734 100644
--- a/codegen/m4/convert_clutter.m4
+++ b/codegen/m4/convert_clutter.m4
@@ -119,6 +119,7 @@ _CONV_ENUM(Clutter,AllocationFlags)
 _CONV_ENUM(Clutter,AnimationMode)
 _CONV_ENUM(Clutter,BinAlignment)
 _CONV_ENUM(Clutter,BoxAlignment)
+_CONV_ENUM(Clutter,FlowOrientation)
 _CONV_ENUM(Clutter,LayoutFlags)
 _CONV_ENUM(Clutter,PackType)
 _CONV_ENUM(Clutter,PickMode)



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