summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2009-06-25 12:11:17 +0200
committerEmmanuele Bassi <ebassi@linux.intel.com>2009-06-27 15:21:06 +0100
commit39aee7284af2836542d7e8ec081158af9b7e5ac9 (patch)
treece8a6cf66c0b37dfbc0ca8f1854c2b5cf159281a
parent7639ca01d2ce9114e4d4136db90804a167c2f345 (diff)
downloadclutter-gtk-39aee7284af2836542d7e8ec081158af9b7e5ac9.tar.gz
Make GtkClutterEmbed derive from GtkContainer
This is required to later add child widgets when embedding Gtk+ widgets in clutter. Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
-rw-r--r--clutter-gtk/gtk-clutter-embed.c37
-rw-r--r--clutter-gtk/gtk-clutter-embed.h4
2 files changed, 38 insertions, 3 deletions
diff --git a/clutter-gtk/gtk-clutter-embed.c b/clutter-gtk/gtk-clutter-embed.c
index e3137af..954ada5 100644
--- a/clutter-gtk/gtk-clutter-embed.c
+++ b/clutter-gtk/gtk-clutter-embed.c
@@ -58,7 +58,7 @@
#endif /* HAVE_CLUTTER_GTK_{X11,WIN32} */
-G_DEFINE_TYPE (GtkClutterEmbed, gtk_clutter_embed, GTK_TYPE_WIDGET);
+G_DEFINE_TYPE (GtkClutterEmbed, gtk_clutter_embed, GTK_TYPE_CONTAINER);
#define GTK_CLUTTER_EMBED_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_CLUTTER_TYPE_EMBED, GtkClutterEmbedPrivate))
@@ -514,10 +514,40 @@ gtk_clutter_embed_style_set (GtkWidget *widget,
}
static void
+gtk_clutter_embed_add (GtkContainer *container,
+ GtkWidget *widget)
+{
+ g_warning ("GtkClutterEmbed children not yet supported");
+}
+
+static void
+gtk_clutter_embed_remove (GtkContainer *container,
+ GtkWidget *widget)
+{
+ g_warning ("GtkClutterEmbed children not yet supported");
+}
+
+static void
+gtk_clutter_embed_forall (GtkContainer *container,
+ gboolean include_internals,
+ GtkCallback callback,
+ gpointer callback_data)
+{
+}
+
+static GType
+gtk_clutter_embed_child_type (GtkContainer *container)
+{
+ /* No children supported yet */
+ return G_TYPE_NONE;
+}
+
+static void
gtk_clutter_embed_class_init (GtkClutterEmbedClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
g_type_class_add_private (klass, sizeof (GtkClutterEmbedPrivate));
@@ -542,6 +572,11 @@ gtk_clutter_embed_class_init (GtkClutterEmbedClass *klass)
widget_class->focus_in_event = gtk_clutter_embed_focus_in;
widget_class->focus_out_event = gtk_clutter_embed_focus_out;
widget_class->scroll_event = gtk_clutter_embed_scroll_event;
+
+ container_class->add = gtk_clutter_embed_add;
+ container_class->remove = gtk_clutter_embed_remove;
+ container_class->forall = gtk_clutter_embed_forall;
+ container_class->child_type = gtk_clutter_embed_child_type;
}
static void
diff --git a/clutter-gtk/gtk-clutter-embed.h b/clutter-gtk/gtk-clutter-embed.h
index eda509c..0a352fc 100644
--- a/clutter-gtk/gtk-clutter-embed.h
+++ b/clutter-gtk/gtk-clutter-embed.h
@@ -53,7 +53,7 @@ typedef struct _GtkClutterEmbedClass GtkClutterEmbedClass;
struct _GtkClutterEmbed
{
/*< private >*/
- GtkWidget parent_instance;
+ GtkContainer parent_instance;
GtkClutterEmbedPrivate *priv;
};
@@ -68,7 +68,7 @@ struct _GtkClutterEmbed
struct _GtkClutterEmbedClass
{
/*< private >*/
- GtkWidgetClass parent_class;
+ GtkContainerClass parent_class;
/* padding for future expansion */
void (*_clutter_gtk_reserved1) (void);