gnomemm r1473 - in cluttermm/trunk: . clutter-gtk clutter-gtk/cluttermm-gtk clutter-gtk/cluttermm-gtk/private clutter-gtk/src examples
- From: siavashs svn gnome org
- To: svn-commits-list gnome org
- Subject: gnomemm r1473 - in cluttermm/trunk: . clutter-gtk clutter-gtk/cluttermm-gtk clutter-gtk/cluttermm-gtk/private clutter-gtk/src examples
- Date: Tue, 22 Apr 2008 19:42:09 +0100 (BST)
Author: siavashs
Date: Tue Apr 22 18:42:08 2008
New Revision: 1473
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1473&view=rev
Log:
wrap clutter-gtk library
* Makefile.am:
* clutter-gtk/Makefile.am:
* clutter-gtk/README:
* clutter-gtk/cluttermm-gtk-config.h.in:
* clutter-gtk/cluttermm-gtk.h:
* clutter-gtk/cluttermm-gtk.pc.in:
* clutter-gtk/cluttermm-gtk/Makefile.am:
* clutter-gtk/cluttermm-gtk/init.cc:
* clutter-gtk/cluttermm-gtk/init.h:
* clutter-gtk/cluttermm-gtk/private/Makefile.am:
* clutter-gtk/cluttermm-gtk/wrap_init.h:
* clutter-gtk/src/Makefile.am:
* clutter-gtk/src/Makefile_list_of_hg.am_fragment:
* clutter-gtk/src/clutter-gtk.defs:
* clutter-gtk/src/clutter-gtk_enums.defs:
* clutter-gtk/src/clutter-gtk_methods.defs:
* clutter-gtk/src/clutter-gtk_others.defs:
* clutter-gtk/src/clutter-gtk_signals.defs:
* clutter-gtk/src/clutter-gtk_vfuncs.defs:
* clutter-gtk/src/embed.ccg:
* clutter-gtk/src/embed.hg:
* configure.in:
* examples/Makefile.am:
* examples/Makefile.am_fragment:
* examples/embed-gtk.cc: Added support for clutter-gtk library.
Added:
cluttermm/trunk/clutter-gtk/
cluttermm/trunk/clutter-gtk/Makefile.am
cluttermm/trunk/clutter-gtk/README
cluttermm/trunk/clutter-gtk/cluttermm-gtk/
cluttermm/trunk/clutter-gtk/cluttermm-gtk-config.h.in
cluttermm/trunk/clutter-gtk/cluttermm-gtk.h
cluttermm/trunk/clutter-gtk/cluttermm-gtk.pc.in
cluttermm/trunk/clutter-gtk/cluttermm-gtk/Makefile.am
cluttermm/trunk/clutter-gtk/cluttermm-gtk/init.cc
cluttermm/trunk/clutter-gtk/cluttermm-gtk/init.h
cluttermm/trunk/clutter-gtk/cluttermm-gtk/private/
cluttermm/trunk/clutter-gtk/cluttermm-gtk/private/Makefile.am
cluttermm/trunk/clutter-gtk/cluttermm-gtk/wrap_init.h
cluttermm/trunk/clutter-gtk/src/
cluttermm/trunk/clutter-gtk/src/Makefile.am
cluttermm/trunk/clutter-gtk/src/Makefile_list_of_hg.am_fragment
cluttermm/trunk/clutter-gtk/src/clutter-gtk.defs
cluttermm/trunk/clutter-gtk/src/clutter-gtk_enums.defs
cluttermm/trunk/clutter-gtk/src/clutter-gtk_methods.defs
cluttermm/trunk/clutter-gtk/src/clutter-gtk_others.defs
cluttermm/trunk/clutter-gtk/src/clutter-gtk_signals.defs
cluttermm/trunk/clutter-gtk/src/clutter-gtk_vfuncs.defs
cluttermm/trunk/clutter-gtk/src/embed.ccg
cluttermm/trunk/clutter-gtk/src/embed.hg
cluttermm/trunk/examples/embed-gtk.cc
Modified:
cluttermm/trunk/ChangeLog
cluttermm/trunk/Makefile.am
cluttermm/trunk/configure.in
cluttermm/trunk/examples/Makefile.am
cluttermm/trunk/examples/Makefile.am_fragment
Modified: cluttermm/trunk/Makefile.am
==============================================================================
--- cluttermm/trunk/Makefile.am (original)
+++ cluttermm/trunk/Makefile.am Tue Apr 22 18:42:08 2008
@@ -1,4 +1,4 @@
-SUBDIRS = tools clutter clutter-cairo docs examples tests
+SUBDIRS = tools clutter clutter-cairo clutter-gtk docs examples tests
DIST_SUBDIRS = $(SUBDIRS) scripts
EXTRA_DIST = \
Added: cluttermm/trunk/clutter-gtk/Makefile.am
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter-gtk/Makefile.am Tue Apr 22 18:42:08 2008
@@ -0,0 +1,15 @@
+SUBDIRS = src cluttermm-gtk
+
+EXTRA_DIST = README \
+ cluttermm-gtk-config.h.in cluttermm-gtk.h \
+ cluttermm-gtk-1.0.pc.in
+
+cluttermm_includedir = $(includedir)/$(CLUTTERMM_GTK_API_VER)
+cluttermm_include_HEADERS = cluttermm-gtk.h
+
+cluttermm_configdir = $(libdir)/$(CLUTTERMM_GTK_API_VER)/include
+cluttermm_config_DATA = cluttermm-gtk-config.h
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = cluttermm-gtk-1.0.pc
+
Added: cluttermm/trunk/clutter-gtk/README
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter-gtk/README Tue Apr 22 18:42:08 2008
@@ -0,0 +1,6 @@
+Base directory for cluttermm-gtk, which integrates cluttermm and gtkmm
+
+Here is the layout
+
+ src - actual sources used to build, processed with gmmproc
+ cluttermm-gtk - built sources (do not edit)
Added: cluttermm/trunk/clutter-gtk/cluttermm-gtk-config.h.in
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter-gtk/cluttermm-gtk-config.h.in Tue Apr 22 18:42:08 2008
@@ -0,0 +1,13 @@
+#ifndef _LIBCLUTTERMM_CONFIG_H
+#define _LIBCLUTTERMM_CONFIG_H 1
+
+#include "glibmmconfig.h"
+
+/* version numbers */
+#undef LIBCLUTTERMM_MAJOR_VERSION
+#undef LIBCLUTTERMM_MINOR_VERSION
+#undef LIBCLUTTERMM_MICRO_VERSION
+#undef LIBCLUTTERMM_VERSION
+
+#endif /* _LIBCLUTTERMM_CONFIG_H */
+
Added: cluttermm/trunk/clutter-gtk/cluttermm-gtk.h
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter-gtk/cluttermm-gtk.h Tue Apr 22 18:42:08 2008
@@ -0,0 +1,32 @@
+/* cluttermm-gtk - a C++ wrapper for clutter-gtk
+ *
+ * Copyright 2007 The cluttermm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef LIBCLUTTERMM_GTK_H
+#define LIBCLUTTERMM_GTK_H
+
+/* cluttermm version. */
+extern const int cluttermm_major_version;
+extern const int cluttermm_minor_version;
+extern const int cluttermm_micro_version;
+
+#include <cluttermm.h>
+#include <cluttermm-gtk/init.h>
+#include <cluttermm-gtk/embed.h>
+
+#endif /* #ifndef LIBCLUTTERMM_GTK_H */
Added: cluttermm/trunk/clutter-gtk/cluttermm-gtk.pc.in
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter-gtk/cluttermm-gtk.pc.in Tue Apr 22 18:42:08 2008
@@ -0,0 +1,11 @@
+prefix= prefix@
+exec_prefix= exec_prefix@
+libdir= libdir@
+includedir= includedir@
+
+Name: cluttermm-gtk
+Description: C++ wrapper for clutter
+Requires: clutter-0.6 cluttermm-1.0 gtkmm-2.4
+Version: @VERSION@
+Libs: -L${libdir} -lcluttermm-gtk-1.0
+Cflags: -I${includedir}/cluttermm-gtk-1.0
Added: cluttermm/trunk/clutter-gtk/cluttermm-gtk/Makefile.am
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter-gtk/cluttermm-gtk/Makefile.am Tue Apr 22 18:42:08 2008
@@ -0,0 +1,24 @@
+## Copyright (c) 2001
+## The cluttermm development team.
+
+SUBDIRS = private
+
+sublib_name = cluttermm-gtk
+sublib_libname = cluttermm-gtk-1.0
+sublib_libversion = $(CLUTTERMM_SO_VERSION)
+sublib_namespace = Clutter
+sublib_cflags = $(CLUTTERMM_GTK_CFLAGS) -I$(top_srcdir)/clutter
+sublib_topdir = clutter-gtk
+
+
+files_extra_h = wrap_init.h init.h
+files_extra_cc = init.cc
+
+include $(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment
+
+lib_LTLIBRARIES = libcluttermm-gtk-1.0.la
+libcluttermm_gtk_1_0_la_SOURCES = $(files_all_cc)
+libcluttermm_gtk_1_0_la_LDFLAGS = $(common_ldflags)
+libcluttermm_gtk_1_0_la_LIBADD = $(CLUTTERMM_GTK_LIBS) \
+ $(top_builddir)/clutter/cluttermm/libcluttermm-1.0.la
+
Added: cluttermm/trunk/clutter-gtk/cluttermm-gtk/init.cc
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter-gtk/cluttermm-gtk/init.cc Tue Apr 22 18:42:08 2008
@@ -0,0 +1,36 @@
+// -*- c++ -*-
+/*
+ * Copyright 2008 Jonathon Jongsma
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library 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-gtk-config.h> //For LIBCLUTTERMM_VERSION
+#include <cluttermm-gtk/wrap_init.h>
+#include <cluttermm/init.h>
+
+namespace Clutter
+{
+namespace Gtk
+{
+
+void init(int* nargs, gchar **args[])
+{
+ Clutter::init (nargs, args);
+ wrap_init (); //Tells the Glib::wrap() table about the libcluttermm-gtk classes.
+}
+
+} //namespace Gtk
+} //namespace Clutter
Added: cluttermm/trunk/clutter-gtk/cluttermm-gtk/init.h
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter-gtk/cluttermm-gtk/init.h Tue Apr 22 18:42:08 2008
@@ -0,0 +1,35 @@
+// -*- c++ -*-
+#ifndef _LIBCLUTTERMM_GTK_INIT_H
+#define _LIBCLUTTERMM_GTK_INIT_H
+/*
+ * Copyright 2008 Jonathon Jongsma
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <glibmm.h>
+
+namespace Clutter
+{
+namespace Gtk
+{
+
+void init(int* nargs, gchar** args[]);
+
+} //namespace Gtk
+} //namespace Clutter
+
+#endif //_LIBCLUTTERMM_GTK_INIT_H
+
Added: cluttermm/trunk/clutter-gtk/cluttermm-gtk/private/Makefile.am
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter-gtk/cluttermm-gtk/private/Makefile.am Tue Apr 22 18:42:08 2008
@@ -0,0 +1,12 @@
+## Copyright (c) 2001
+## The cluttermm development team.
+
+include $(srcdir)/../../src/Makefile_list_of_hg.am_fragment
+files_built_h = $(files_hg:.hg=_p.h)
+
+private_includedir = ${includedir}/$(CLUTTERMM_GTK_API_VER)/cluttermm-gtk/private
+private_include_HEADERS = $(files_built_h)
+
+maintainer-clean-local:
+ (cd $(srcdir) && rm -f $(files_built_h))
+
Added: cluttermm/trunk/clutter-gtk/cluttermm-gtk/wrap_init.h
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter-gtk/cluttermm-gtk/wrap_init.h Tue Apr 22 18:42:08 2008
@@ -0,0 +1,32 @@
+#ifndef _LIBCLUTTERMM_WRAP_INIT_H
+#define _LIBCLUTTERMM_WRAP_INIT_H
+
+/* wrap_init.h
+ *
+ * Copyright (C) 2002-2003 The cluttermm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+// wrap_init.cc is generated by tools/generate_wrap_init.pl
+
+namespace Clutter
+{
+
+void wrap_init();
+
+} //namespace Clutter
+
+#endif // _LIBCLUTTERMM_WRAP_INIT_H
Added: cluttermm/trunk/clutter-gtk/src/Makefile.am
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter-gtk/src/Makefile.am Tue Apr 22 18:42:08 2008
@@ -0,0 +1,16 @@
+## Copyright (c) 2001
+## The cluttermm development team.
+
+sublib_name = cluttermm-gtk
+#nested namespaces separated with spaces
+sublib_namespace = Clutter Gtk
+sublib_parentdir = cluttermm-gtk
+files_defs = clutter-gtk.defs \
+ clutter-gtk_methods.defs \
+ clutter-gtk_signals.defs \
+ clutter-gtk_enums.defs \
+ clutter-gtk_vfuncs.defs \
+ clutter-gtk_others.defs
+
+include $(top_srcdir)/build_shared/Makefile_gensrc.am_fragment
+
Added: cluttermm/trunk/clutter-gtk/src/Makefile_list_of_hg.am_fragment
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter-gtk/src/Makefile_list_of_hg.am_fragment Tue Apr 22 18:42:08 2008
@@ -0,0 +1,6 @@
+# This file is include by other Makefile.am files, using the new automake include feature.
+# The include happens in Makefile.am, not Makefile.in or Makefile,
+# so it's like copy-and-pasting this into each of those Makefile.am files.
+
+files_hg = \
+ embed.hg
Added: cluttermm/trunk/clutter-gtk/src/clutter-gtk.defs
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter-gtk/src/clutter-gtk.defs Tue Apr 22 18:42:08 2008
@@ -0,0 +1,5 @@
+(include clutter-gtk_methods.defs)
+(include clutter-gtk_signals.defs)
+(include clutter-gtk_vfuncs.defs)
+(include clutter-gtk_enums.defs)
+(include clutter-gtk_others.defs)
Added: cluttermm/trunk/clutter-gtk/src/clutter-gtk_enums.defs
==============================================================================
Added: cluttermm/trunk/clutter-gtk/src/clutter-gtk_methods.defs
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter-gtk/src/clutter-gtk_methods.defs Tue Apr 22 18:42:08 2008
@@ -0,0 +1,32 @@
+;; -*- scheme -*-
+; object definitions ...
+(define-object ClutterEmbed
+ (in-module "Gtk")
+ (parent "GtkWidget")
+ (c-name "GtkClutterEmbed")
+ (gtype-id "GTK_TYPE_CLUTTER_EMBED")
+)
+
+;; Enumerations and flags ...
+
+
+;; From gtk-clutter-embed.h
+
+(define-function gtk_clutter_embed_get_type
+ (c-name "gtk_clutter_embed_get_type")
+ (return-type "GType")
+)
+
+(define-function gtk_clutter_embed_new
+ (c-name "gtk_clutter_embed_new")
+ (is-constructor-of "GtkClutterEmbed")
+ (return-type "GtkWidget*")
+)
+
+(define-method get_stage
+ (of-object "GtkClutterEmbed")
+ (c-name "gtk_clutter_embed_get_stage")
+ (return-type "ClutterActor*")
+)
+
+
Added: cluttermm/trunk/clutter-gtk/src/clutter-gtk_others.defs
==============================================================================
Added: cluttermm/trunk/clutter-gtk/src/clutter-gtk_signals.defs
==============================================================================
Added: cluttermm/trunk/clutter-gtk/src/clutter-gtk_vfuncs.defs
==============================================================================
Added: cluttermm/trunk/clutter-gtk/src/embed.ccg
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter-gtk/src/embed.ccg Tue Apr 22 18:42:08 2008
@@ -0,0 +1,27 @@
+/* Copyright (C) 2007 The cluttermm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library 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/gtk-clutter-embed.h>
+
+namespace Clutter
+{
+namespace Gtk
+{
+
+} //namespace Gtk
+} //namespace Clutter
+
Added: cluttermm/trunk/clutter-gtk/src/embed.hg
==============================================================================
--- (empty file)
+++ cluttermm/trunk/clutter-gtk/src/embed.hg Tue Apr 22 18:42:08 2008
@@ -0,0 +1,46 @@
+/* Copyright (C) 2007 The cluttermm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library 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/stage.h>
+#include <gtkmm/widget.h>
+
+_DEFS(cluttermm-gtk,clutter-gtk)
+_PINCLUDE(cluttermm/private/stage_p.h)
+_PINCLUDE(gtkmm/private/widget_p.h)
+
+
+namespace Clutter
+{
+namespace Gtk
+{
+
+class Embed :
+ public ::Gtk::Widget
+{
+ _CLASS_GTKOBJECT(Embed, GtkClutterEmbed, GTK_CLUTTER_EMBED, ::Gtk::Widget, GtkWidget)
+
+public:
+ _CTOR_DEFAULT
+
+#m4 _CONVERSION(`ClutterActor*',`Glib::RefPtr<Stage>',`Glib::wrap(CLUTTER_STAGE($3), false)')
+ _WRAP_METHOD(Glib::RefPtr<Stage> get_stage(), gtk_clutter_embed_get_stage)
+};
+
+} // namespace Gtk
+} // namespace Clutter
+
+//vim: ts=2,sw=2
Modified: cluttermm/trunk/configure.in
==============================================================================
--- cluttermm/trunk/configure.in (original)
+++ cluttermm/trunk/configure.in Tue Apr 22 18:42:08 2008
@@ -38,6 +38,7 @@
dnl Specify a configuration file (no autoheader)
AM_CONFIG_HEADER(clutter/cluttermmconfig.h)
AM_CONFIG_HEADER(clutter-cairo/cluttermm-cairo-config.h)
+AM_CONFIG_HEADER(clutter-gtk/cluttermm-gtk-config.h)
AM_MAINTAINER_MODE
AL_ACLOCAL_INCLUDE(scripts)
@@ -88,6 +89,13 @@
CLUTTERMM_CAIRO_API_VER=[cluttermm-cairo-1.0]
AC_SUBST(CLUTTERMM_CAIRO_API_VER)
+PKG_CHECK_MODULES(CLUTTERMM_GTK,
+ [gtkmm-2.4
+ clutter-gtk-0.6])
+
+CLUTTERMM_GTK_API_VER=[cluttermm-gtk-1.0]
+AC_SUBST(CLUTTERMM_GTK_API_VER)
+
GMM_PROCDIR=`pkg-config --variable=gmmprocdir glibmm-2.4`
AC_SUBST(GMM_PROCDIR)
GMM_PROC=$GMM_PROCDIR/gmmproc
@@ -120,6 +128,12 @@
clutter-cairo/cluttermm-cairo/Makefile
clutter-cairo/cluttermm-cairo/private/Makefile
+ clutter-gtk/Makefile
+ clutter-gtk/$CLUTTERMM_GTK_API_VER.pc:clutter-gtk/cluttermm-gtk.pc.in
+ clutter-gtk/src/Makefile
+ clutter-gtk/cluttermm-gtk/Makefile
+ clutter-gtk/cluttermm-gtk/private/Makefile
+
tools/Makefile
tools/extra_defs_gen/Makefile
tools/m4/Makefile
Modified: cluttermm/trunk/examples/Makefile.am
==============================================================================
--- cluttermm/trunk/examples/Makefile.am (original)
+++ cluttermm/trunk/examples/Makefile.am Tue Apr 22 18:42:08 2008
@@ -4,8 +4,9 @@
include Makefile.am_fragment
-noinst_PROGRAMS = actors flowers simple-cairo
+noinst_PROGRAMS = actors flowers simple-cairo embed-gtk
actors_SOURCES = test-actors.cc
flowers_SOURCES = flowers.cc
simple_cairo_SOURCES = simple-cairo.cc
+embed_gtk_SOURCES = embed-gtk.cc
#boxes_SOURCES = test-boxes.cc
Modified: cluttermm/trunk/examples/Makefile.am_fragment
==============================================================================
--- cluttermm/trunk/examples/Makefile.am_fragment (original)
+++ cluttermm/trunk/examples/Makefile.am_fragment Tue Apr 22 18:42:08 2008
@@ -1,11 +1,13 @@
local_cluttermm_libs = $(top_builddir)/clutter/cluttermm/libcluttermm-1.0.la \
- $(top_builddir)/clutter-cairo/cluttermm-cairo/libcluttermm-cairo-1.0.la
+ $(top_builddir)/clutter-cairo/cluttermm-cairo/libcluttermm-cairo-1.0.la \
+ $(top_builddir)/clutter-gtk/cluttermm-gtk/libcluttermm-gtk-1.0.la
-LIBS = $(CLUTTERMM_LIBS) $(CLUTTERMM_CAIRO_LIBS) $(local_cluttermm_libs)
+LIBS = $(CLUTTERMM_LIBS) $(CLUTTERMM_CAIRO_LIBS) $(CLUTTERMM_GTK_LIBS) $(local_cluttermm_libs)
all_includes = -I$(top_builddir)/clutter -I$(top_srcdir)/clutter \
-I$(top_builddir)/clutter-cairo -I$(top_srcdir)/clutter-cairo \
- $(CLUTTERMM_CFLAGS) $(CLUTTERMM_CAIRO_CFLAGS)
+ -I$(top_builddir)/clutter-gtk -I$(top_srcdir)/clutter-gtk \
+ $(CLUTTERMM_CFLAGS) $(CLUTTERMM_CAIRO_CFLAGS) $(CLUTTERMM_GTK_CFLAGS)
DEFS = @DEFS@
DEFAULT_INCLUDES =
Added: cluttermm/trunk/examples/embed-gtk.cc
==============================================================================
--- (empty file)
+++ cluttermm/trunk/examples/embed-gtk.cc Tue Apr 22 18:42:08 2008
@@ -0,0 +1,70 @@
+#include <gtkmm.h>
+#include <cluttermm-gtk.h>
+
+Glib::RefPtr<Clutter::Label> label;
+Gtk::Entry *pentry;
+
+void on_button_clicked()
+{
+ label->set_text(pentry->get_text());
+}
+
+int main(int argc, char** argv)
+{
+ // init cluttermm-gtk
+ Clutter::Gtk::init(&argc, &argv);
+
+ // init gtkmm
+ Gtk::Main kit(argc, argv);
+
+ Gtk::Window window;
+ Gtk::VBox vbox;
+ Gtk::HBox hbox;
+ Gtk::Frame frame;
+ Gtk::Entry entry;
+ Gtk::Button button("Apply");
+
+ button.signal_clicked().connect(sigc::ptr_fun(&on_button_clicked));
+
+ pentry = &entry;
+
+ Glib::RefPtr<Gdk::Pixbuf> pixbuf = Gdk::Pixbuf::create_from_file("actor.png");
+
+ Clutter::Gtk::Embed embed;
+
+ Glib::RefPtr<Clutter::Texture> texture = Clutter::Texture::create(pixbuf);
+ texture->set_opacity(50);
+
+ label = Clutter::Label::create("Sans 10", "Enter some text in the Entry and click 'Apply' to update this text!");
+
+ window.set_default_size(600, 320);
+ window.add(vbox);
+
+ vbox.set_border_width(10);
+ vbox.set_spacing(5);
+ vbox.pack_start(frame, Gtk::PACK_EXPAND_WIDGET);
+ vbox.pack_start(hbox, Gtk::PACK_SHRINK);
+
+ frame.add(embed);
+
+ hbox.set_spacing(5);
+ hbox.pack_start(entry, Gtk::PACK_EXPAND_WIDGET);
+ hbox.pack_start(button, Gtk::PACK_SHRINK);
+
+ // get the stage from the embed widget
+ Glib::RefPtr<Clutter::Stage> stage = embed.get_stage();
+
+ stage->add_actor(texture);
+ stage->add_actor(label);
+
+ texture->set_position(10, 10);
+ label->set_position(40, 40);
+
+ // Note: using show_all_children() causes corrupt results!
+ window.show_all();
+ stage->show_all();
+
+ kit.run(window);
+
+ return 0;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]