gnomemm r1993 - in cluttermm/trunk: . clutter/src tools/extra_defs_gen tools/m4



Author: daniel
Date: Tue Jan 13 14:49:58 2009
New Revision: 1993
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1993&view=rev

Log:
* clutter/src/childmeta.{ccg,hg}: New files, implementing the
Clutter::ChildMeta wrapper class for ClutterChildMeta.
* clutter/src/Makefile_list_of_hg.am_fragment (files_hg): Add
childmeta.hg.
* tools/extra_defs_gen/generate_defs_clutter.cc: Add
CLUTTER_TYPE_CHILD_META.
* clutter/src/clutter_signals.defs: Regenerate and merge.
* clutter/src/container.hg (Container): Wrap methods and vfuncs
dealing with per-child meta data.
* tools/m4/convert_cluttermm.m4: Add conversion for the newly added
ChildMeta wrapper class, and also a couple of const variations for
other types.

Added:
   cluttermm/trunk/clutter/src/childmeta.ccg
   cluttermm/trunk/clutter/src/childmeta.hg
Modified:
   cluttermm/trunk/ChangeLog
   cluttermm/trunk/clutter/src/Makefile_list_of_hg.am_fragment
   cluttermm/trunk/clutter/src/clutter_signals.defs
   cluttermm/trunk/clutter/src/container.hg
   cluttermm/trunk/tools/extra_defs_gen/generate_defs_clutter.cc
   cluttermm/trunk/tools/m4/convert_cluttermm.m4

Modified: cluttermm/trunk/clutter/src/Makefile_list_of_hg.am_fragment
==============================================================================
--- cluttermm/trunk/clutter/src/Makefile_list_of_hg.am_fragment	(original)
+++ cluttermm/trunk/clutter/src/Makefile_list_of_hg.am_fragment	Tue Jan 13 14:49:58 2009
@@ -12,6 +12,7 @@
 behaviour-path.hg \
 behaviour-rotate.hg \
 behaviour-scale.hg \
+childmeta.hg \
 clone-texture.hg \
 color.hg \
 container.hg \

Added: cluttermm/trunk/clutter/src/childmeta.ccg
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter/src/childmeta.ccg	Tue Jan 13 14:49:58 2009
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2009  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 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <clutter/clutter.h>
+#include <cluttermm/container.h>
+
+namespace Clutter
+{
+
+ChildMeta::ChildMeta(const Glib::RefPtr<Container>& container, const Glib::RefPtr<Actor>& actor)
+:
+  _CONSTRUCT("container", Glib::unwrap(container), "actor", Glib::unwrap(actor))
+{}
+
+} // namespace Clutter

Added: cluttermm/trunk/clutter/src/childmeta.hg
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter/src/childmeta.hg	Tue Jan 13 14:49:58 2009
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2009  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 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <glibmm/object.h>
+#include <glibmm/refptr.h>
+
+_DEFS(cluttermm,clutter)
+_PINCLUDE(glibmm/private/object_p.h)
+
+extern "C" { typedef struct _ClutterChildMeta ClutterChildMeta; }
+
+namespace Clutter
+{
+
+class Actor;
+class Container;
+
+class ChildMeta : public Glib::Object
+{
+  _CLASS_GOBJECT(ChildMeta, ClutterChildMeta, CLUTTER_CHILD_META, Glib::Object, GObject)
+protected:
+  ChildMeta(const Glib::RefPtr<Container>& container, const Glib::RefPtr<Actor>& actor);
+
+public:
+  _WRAP_METHOD(Glib::RefPtr<Container> get_container(), clutter_child_meta_get_container, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Container> get_container() const, clutter_child_meta_get_container, refreturn, constversion)
+  _WRAP_METHOD(Glib::RefPtr<Actor> get_actor(), clutter_child_meta_get_actor, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Actor> get_actor() const, clutter_child_meta_get_actor, refreturn, constversion)
+
+  _WRAP_PROPERTY("container", Glib::RefPtr<Container>)
+  _WRAP_PROPERTY("actor", Glib::RefPtr<Actor>)
+};
+
+} // namespace Clutter

Modified: cluttermm/trunk/clutter/src/clutter_signals.defs
==============================================================================
--- cluttermm/trunk/clutter/src/clutter_signals.defs	(original)
+++ cluttermm/trunk/clutter/src/clutter_signals.defs	Tue Jan 13 14:49:58 2009
@@ -842,6 +842,26 @@
   (construct-only #f)
 )
 
+;; From ClutterChildMeta
+
+(define-property container
+  (of-object "ClutterChildMeta")
+  (prop-type "GParamObject")
+  (docs "The container that created this data")
+  (readable #t)
+  (writable #t)
+  (construct-only #t)
+)
+
+(define-property actor
+  (of-object "ClutterChildMeta")
+  (prop-type "GParamObject")
+  (docs "The actor wrapped by this data")
+  (readable #t)
+  (writable #t)
+  (construct-only #t)
+)
+
 ;; From ClutterCloneTexture
 
 (define-property name
@@ -1571,19 +1591,19 @@
   (construct-only #f)
 )
 
-(define-property buffer-percent
+(define-property can-seek
   (of-object "ClutterMedia")
-  (prop-type "GParamInt")
-  (docs "The percentage the current stream buffer is filled.")
+  (prop-type "GParamBoolean")
+  (docs "TRUE if the current stream is seekable.")
   (readable #t)
   (writable #f)
   (construct-only #f)
 )
 
-(define-property volume
+(define-property position
   (of-object "ClutterMedia")
-  (prop-type "GParamDouble")
-  (docs "The audio volume.")
+  (prop-type "GParamInt")
+  (docs "The position in the current stream in seconds.")
   (readable #t)
   (writable #t)
   (construct-only #f)
@@ -1598,21 +1618,21 @@
   (construct-only #f)
 )
 
-(define-property can-seek
+(define-property volume
   (of-object "ClutterMedia")
-  (prop-type "GParamBoolean")
-  (docs "TRUE if the current stream is seekable.")
+  (prop-type "GParamDouble")
+  (docs "The audio volume.")
   (readable #t)
-  (writable #f)
+  (writable #t)
   (construct-only #f)
 )
 
-(define-property position
+(define-property buffer-percent
   (of-object "ClutterMedia")
   (prop-type "GParamInt")
-  (docs "The position in the current stream in seconds.")
+  (docs "The percentage the current stream buffer is filled.")
   (readable #t)
-  (writable #t)
+  (writable #f)
   (construct-only #f)
 )
 

Modified: cluttermm/trunk/clutter/src/container.hg
==============================================================================
--- cluttermm/trunk/clutter/src/container.hg	(original)
+++ cluttermm/trunk/clutter/src/container.hg	Tue Jan 13 14:49:58 2009
@@ -16,6 +16,7 @@
  */
 
 #include <cluttermm/actor.h>
+#include <cluttermm/childmeta.h>
 #include <glibmm/interface.h>
 #include <glibmm/ustring.h>
 #include <clutter/clutter.h>
@@ -23,7 +24,6 @@
 _DEFS(cluttermm,clutter)
 _PINCLUDE(glibmm/private/interface_p.h)
 
-
 namespace Clutter
 {
 
@@ -73,33 +73,16 @@
   void get_child_property_value(const Glib::RefPtr<const Actor>& child, const Glib::ustring& property_name, Glib::ValueBase& value) const;
   _IGNORE(clutter_container_child_get_property)
 
-
-  /*
-
-void              clutter_container_child_get_property          (ClutterContainer *container,
-                                                                 ClutterActor     *child,
-                                                                 const gchar      *property,
-                                                                 GValue           *value);
-void              clutter_container_child_set                   (ClutterContainer *container,
-                                                                 ClutterActor     *actor,
-                                                                 const gchar      *first_prop,
-                                                                 ...) G_GNUC_NULL_TERMINATED;
-void              clutter_container_child_get                   (ClutterContainer *container,
-                                                                 ClutterActor     *actor,
-                                                                 const gchar      *first_prop,
-                                                                 ...) G_GNUC_NULL_TERMINATED;
-
-  */
-
-  // TODO: clutter_container_get_child_meta?
-
+  _WRAP_METHOD(Glib::RefPtr<ChildMeta> get_child_meta(const Glib::RefPtr<const Actor>& actor),
+               clutter_container_get_child_meta, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const ChildMeta> get_child_meta(const Glib::RefPtr<const Actor>& actor) const,
+               clutter_container_get_child_meta, refreturn, constversion)
 
 #m4 _CONVERSION(`ClutterActor*',`const Glib::RefPtr<Actor>&',`Glib::wrap($3, true)')
   _WRAP_SIGNAL(void actor_added(const Glib::RefPtr<Actor>& actor), "actor_added")
   _WRAP_SIGNAL(void actor_removed(const Glib::RefPtr<Actor>& actor), "actor_removed")
 
-  // TODO: child-notify signal? Perhaps doesn't make sense until we wrap
-  // the ClutterChildMeta stuff, and clutter_container_get/set_child_property.
+  _WRAP_SIGNAL(void child_notify(const Glib::RefPtr<Actor>& actor, GParamSpec* pspec), "child_notify")
 
 protected:
 
@@ -123,8 +106,9 @@
    */
   void actor_removed(const Glib::RefPtr<Actor>& actor);
 
-  // TODO: Do we want to wrap create_child_meta, destory_child_meta,
-  // get_child_meta?
+  _WRAP_VFUNC(void create_child_meta(const Glib::RefPtr<Actor>& actor), create_child_meta)
+  _WRAP_VFUNC(void destroy_child_meta(const Glib::RefPtr<Actor>& actor), destroy_child_meta)
+  _WRAP_VFUNC(Glib::RefPtr<ChildMeta> get_child_meta(const Glib::RefPtr<Actor>& actor), get_child_meta)
 };
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS

Modified: cluttermm/trunk/tools/extra_defs_gen/generate_defs_clutter.cc
==============================================================================
--- cluttermm/trunk/tools/extra_defs_gen/generate_defs_clutter.cc	(original)
+++ cluttermm/trunk/tools/extra_defs_gen/generate_defs_clutter.cc	Tue Jan 13 14:49:58 2009
@@ -35,6 +35,7 @@
     << get_defs(CLUTTER_TYPE_BEHAVIOUR_ROTATE)
     << get_defs(CLUTTER_TYPE_BEHAVIOUR_SCALE)
 //    << get_defs(CLUTTER_TYPE_BOX)
+    << get_defs(CLUTTER_TYPE_CHILD_META)
     << get_defs(CLUTTER_TYPE_CLONE_TEXTURE)
     << get_defs(CLUTTER_TYPE_COLOR)
 //    << get_defs(CLUTTER_TYPE_CONTAINER)

Modified: cluttermm/trunk/tools/m4/convert_cluttermm.m4
==============================================================================
--- cluttermm/trunk/tools/m4/convert_cluttermm.m4	(original)
+++ cluttermm/trunk/tools/m4/convert_cluttermm.m4	Tue Jan 13 14:49:58 2009
@@ -1,9 +1,11 @@
 _CONVERSION(`const Glib::RefPtr<Actor>&',`ClutterActor*',__CONVERT_REFPTR_TO_P)
-_CONVERSION(`const Glib::RefPtr<ActorBox>&',`ClutterActorBox*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<const Actor>&',`ClutterActor*',__CONVERT_CONST_REFPTR_TO_P)
 
 _CONVERSION(`ClutterActor*',`Glib::RefPtr<Actor>',`Glib::wrap($3)')
 _CONVERSION(`ClutterActor*',`Glib::RefPtr<const Actor>',`Glib::wrap($3)')
 
+_CONVERSION(`const Glib::RefPtr<ActorBox>&',`ClutterActorBox*',__CONVERT_REFPTR_TO_P)
+
 _CONVERSION(`const Glib::RefPtr<Shader>&',`ClutterShader*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`ClutterShader*',`Glib::RefPtr<Shader>', `Glib::wrap($3)')
 _CONVERSION(`ClutterShader*',`Glib::RefPtr<const Shader>', `Glib::wrap($3)')
@@ -23,6 +25,15 @@
 _CONVERSION(`ClutterPath*',`Glib::RefPtr<Path>',`Glib::wrap($3)')
 _CONVERSION(`ClutterPath*',`Glib::RefPtr<const Path>',`Glib::wrap($3)')
 
+_CONVERSION(`const Glib::RefPtr<Container>&',`ClutterContainer*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`ClutterContainer*',`Glib::RefPtr<Container>',`Glib::wrap($3)')
+_CONVERSION(`ClutterContainer*',`Glib::RefPtr<const Container>',`Glib::wrap($3)')
+
+_CONVERSION(`const Glib::RefPtr<ChildMeta>&',`ClutterChildMeta*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`Glib::RefPtr<ChildMeta>',`ClutterChildMeta*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`ClutterChildMeta*',`Glib::RefPtr<ChildMeta>',`Glib::wrap($3)')
+_CONVERSION(`ClutterChildMeta*',`Glib::RefPtr<const ChildMeta>',`Glib::wrap($3)')
+
 _CONVERSION(`const Color&',`const ClutterColor*',`($3).gobj()')
 _CONVERSION(`const Margin&',`const ClutterMargin*',`($3).gobj()')
 



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