[clutter-gtkmm] Wrap GtkClutterActor



commit c9672c8b661aac0192814f9983a01f68d8fd44e3
Author: Juan R. GarcĂ­a Blanco <juanrgar gmail com>
Date:   Tue Sep 23 21:52:50 2014 +0200

    Wrap GtkClutterActor
    
        * clutter-gtk/src/actor.[ccg|hg]: New files.
        * clutter-gtk/src/filelist.am: Add actor.hg to files_hg.

 clutter-gtk/src/actor.ccg   |   26 +++++++++++++++++
 clutter-gtk/src/actor.hg    |   63 +++++++++++++++++++++++++++++++++++++++++++
 clutter-gtk/src/filelist.am |    4 ++-
 3 files changed, 92 insertions(+), 1 deletions(-)
---
diff --git a/clutter-gtk/src/actor.ccg b/clutter-gtk/src/actor.ccg
new file mode 100644
index 0000000..0a91cee
--- /dev/null
+++ b/clutter-gtk/src/actor.ccg
@@ -0,0 +1,26 @@
+/* Copyright (C) 2014 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-gtk/clutter-gtk.h>
+
+namespace Clutter
+{
+namespace Gtk
+{
+
+} // namespace Gtk
+} // namespace Clutter
diff --git a/clutter-gtk/src/actor.hg b/clutter-gtk/src/actor.hg
new file mode 100644
index 0000000..f8d9581
--- /dev/null
+++ b/clutter-gtk/src/actor.hg
@@ -0,0 +1,63 @@
+/* Copyright (C) 2014 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/actor.h>
+#include <gtkmm/widget.h>
+
+_DEFS(clutter-gtkmm,clutter-gtk)
+_PINCLUDE(cluttermm/private/actor_p.h)
+
+
+namespace Clutter
+{
+namespace Gtk
+{
+
+/** Actor for embedding a Widget in a Clutter stage.
+ *
+ * Clutter::Gtk::Actor is a Clutter::Container that also allows embedding
+ * any Gtk::Widget in a Clutter scenegraph.
+ *
+ * Clutter::Gtk::Actor only allows embedding Gtk::Widgets when inside
+ * the Clutter::Stage provided by a Clutter::Gtk::Embed: it is not possible to
+ * use Clutter::Gtk::Actor in a Clutter::Stage handled by Clutter alone.
+ */
+class Actor : public ::Clutter::Actor
+{
+  _CLASS_GOBJECT(Actor, GtkClutterActor, GTK_CLUTTER_ACTOR, ::Clutter::Actor, ClutterActor)
+
+protected:
+  _CTOR_DEFAULT
+#m4 _CONVERSION(`::Gtk::Widget&',`GtkWidget*',`($3).gobj()')
+  _WRAP_CTOR(Actor(::Gtk::Widget& contents), gtk_clutter_actor_new_with_contents)
+
+public:
+  _WRAP_CREATE()
+  _WRAP_CREATE(::Gtk::Widget& contents)
+
+#m4 _CONVERSION(`GtkWidget*',`::Gtk::Widget*',`Glib::wrap($3, true)')
+  _WRAP_METHOD(::Gtk::Widget* get_contents(), gtk_clutter_actor_get_contents)
+  _WRAP_METHOD(const ::Gtk::Widget* get_contents() const, gtk_clutter_actor_get_contents, constversion)
+
+  _WRAP_METHOD(::Gtk::Widget* get_widget(), gtk_clutter_actor_get_widget)
+  _WRAP_METHOD(const ::Gtk::Widget* get_widget() const, gtk_clutter_actor_get_widget, constversion)
+
+  _WRAP_PROPERTY("contents", ::Gtk::Widget*)
+};
+
+} // namespace Gtk
+} // namespace Clutter
diff --git a/clutter-gtk/src/filelist.am b/clutter-gtk/src/filelist.am
index 02ce08f..7f3fe29 100644
--- a/clutter-gtk/src/filelist.am
+++ b/clutter-gtk/src/filelist.am
@@ -9,5 +9,7 @@ files_defs =                            \
        clutter-gtk_vfuncs.defs         \
        clutter-gtk_docs.xml
 
-files_hg  = embed.hg
+files_hg  = \
+       embed.hg \
+       actor.hg
 files_ccg = $(files_hg:.hg=.ccg)


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