#include <stdio.h>
#include <glib.h>
#include <glib-object.h>
+#include <gtk-clutter-embed.h>
enum {
/* normal signals */
static guint champlain_widget_signals[LAST_SIGNAL] = { 0, };
-#define WEBKIT_WEB_FRAME_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_FRAME, WebKitWebFramePrivate))
+#define CHAMPLAIN_WIDGET_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), CHAMPLAIN_TYPE_WIDGET, ChamplainWidgetPrivate))
struct _ChamplainWidgetPrivate {
- gboolean temp;
+ GtkWidget* clutterEmbed;
};
-G_DEFINE_TYPE(ChamplainWidget, champlain_widget, GTK_TYPE_CONTAINER)
+G_DEFINE_TYPE(ChamplainWidget, champlain_widget, GTK_TYPE_ALIGNMENT)
+
static void
champlain_widget_class_init(ChamplainWidgetClass* champlainWidgetClass)
{
-/*
- GtkWidgetClass* widgetClass = GTK_WIDGET_CLASS(champlainWidget);
+/* GtkWidgetClass* widgetClass = GTK_WIDGET_CLASS(champlainWidget);
widgetClass->realize = champlain_widget_realize;
widgetClass->expose_event = champlain_widget_expose_event;
widgetClass->key_press_event = champlain_widget_key_press_event;
widgetClass->focus_in_event = champlain_widget_focus_in_event;
widgetClass->focus_out_event = champlain_widget_focus_out_event;
widgetClass->get_accessible = champlain_widget_get_accessible;
-
- GtkContainerClass* containerClass = GTK_CONTAINER_CLASS(champlainWidget);
- containerClass->add = champlain_widget_container_add;
- containerClass->remove = champlain_widget_container_remove;
- containerClass->forall = champlain_widget_container_forall;
*/
g_type_class_add_private(champlainWidgetClass, sizeof(ChamplainWidgetPrivate));
}
GtkWidget* champlain_widget_new()
-{
+{
ChamplainWidget* widget = CHAMPLAIN_WIDGET(g_object_new(CHAMPLAIN_TYPE_WIDGET, NULL));
-
+ ChamplainWidgetPrivate* priv = CHAMPLAIN_WIDGET_GET_PRIVATE(widget);
+
+ priv->clutterEmbed = gtk_clutter_embed_new();
+ gtk_container_add(GTK_CONTAINER(widget), priv->clutterEmbed);
+ gtk_widget_show_all(GTK_WIDGET(widget));
+
return GTK_WIDGET(widget);
}
typedef struct _ChamplainWidgetPrivate ChamplainWidgetPrivate;
-struct _ChamplainWidget {
- GtkContainer parent_instance;
+struct _ChamplainWidget {
+ GtkAlignment bin;
ChamplainWidgetPrivate *priv;
};
-struct _ChamplainWidgetClass {
- GtkContainerClass parent_class;
+struct _ChamplainWidgetClass {
+ GtkBinClass parent_class;
+
ChamplainWidget * (* create_widget) (ChamplainWidget* widget);
GtkWidget *widget;
gtk_init (&argc, &argv);
+ clutter_init (&argc, &argv);
/* create the main, top level, window */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), PACKAGE " " VERSION);
/* open it a bit wider so that both the label and title show up */
- gtk_window_set_default_size (GTK_WINDOW (window), 200, 50);
+ gtk_window_set_default_size (GTK_WINDOW (window), 500, 500);
/* Connect the destroy event of the window with our on_destroy function