+2007-12-04 Emmanuele Bassi <ebassi@openedhand.com>
+
+ Update after the API changes in Clutter core
+
+ * clutter-gtk/clutter-gtk.c:
+ (gtk_clutter_destroy): Do not call clutter_actor_destroy()
+ on the stage.
+
+ (gtk_clutter_map): Use the new X11 API for retrieving the
+ XID of the stage window.
+
+ (gtk_clutter_init): Set the widget as paintable and the stage
+ as resizable.
+
+ * examples/gtk-clutter-events.c:
+ (on_x_changed), (on_y_changed), (on_z_changed): Use the new
+ clutter_actor_set_rotation() API.
+
+ * examples/gtk-clutter-test.c (frame_cb): Ditto as above.
+
2007-08-20 Emmanuele Bassi <ebassi@openedhand.com>
* doc/reference/clutter-gtk-sections.txt:
#include <clutter/clutter-main.h>
#include <clutter/clutter-stage.h>
-#include <clutter/clutter-glx.h>
+#include <clutter/clutter-x11.h>
#include "clutter-gtk.h"
priv = GTK_CLUTTER (object)->priv;
+ /* XXX - there's no clutter main loop running, so we cannot
+ * release the resources we create when we initialise clutter.
+ */
if (priv->stage)
- {
- clutter_actor_destroy (priv->stage);
- priv->stage = NULL;
- }
+ priv->stage = NULL;
GTK_OBJECT_CLASS (gtk_clutter_parent_class)->destroy (object);
}
{
g_object_ref (widget);
- gtk_socket_add_id (socket, clutter_glx_get_stage_window (stage));
+ gtk_socket_add_id (socket, clutter_x11_get_stage_window (stage));
priv->is_embedded = TRUE;
g_object_notify (G_OBJECT (widget), "embedded");
clutter->priv = priv = GTK_CLUTTER_GET_PRIVATE (clutter);
gtk_widget_set_double_buffered (GTK_WIDGET (clutter), FALSE);
+ gtk_widget_set_app_paintable (GTK_WIDGET (clutter), TRUE);
priv->stage = clutter_stage_get_default ();
+ clutter_stage_set_user_resizable (CLUTTER_STAGE (priv->stage), TRUE);
+
priv->is_embedded = FALSE;
}
static void
on_x_changed (GtkSpinButton *button, EventApp *app)
{
- clutter_actor_rotate_x (app->hand,
- gtk_spin_button_get_value (button),
- clutter_actor_get_height (app->hand),
- 0);
+ clutter_actor_set_rotation (app->hand, CLUTTER_X_AXIS,
+ gtk_spin_button_get_value (button),
+ 0,
+ clutter_actor_get_height (app->hand) / 2,
+ 0);
}
static void
on_y_changed (GtkSpinButton *button, EventApp *app)
{
- clutter_actor_rotate_y (app->hand,
- gtk_spin_button_get_value (button),
- clutter_actor_get_width (app->hand) /2,
- 0);
+ clutter_actor_set_rotation (app->hand, CLUTTER_Y_AXIS,
+ gtk_spin_button_get_value (button),
+ clutter_actor_get_width (app->hand) / 2,
+ 0,
+ 0);
}
static void
on_z_changed (GtkSpinButton *button, EventApp *app)
{
- clutter_actor_rotate_z (app->hand,
- gtk_spin_button_get_value (button),
- clutter_actor_get_width (app->hand) /2,
- clutter_actor_get_height (app->hand)/2);
+ clutter_actor_set_rotation (app->hand, CLUTTER_Z_AXIS,
+ gtk_spin_button_get_value (button),
+ clutter_actor_get_width (app->hand) / 2,
+ clutter_actor_get_height (app->hand) / 2,
+ 0);
}
static void
#endif
/* Rotate everything clockwise about stage center*/
- clutter_actor_rotate_z (CLUTTER_ACTOR(oh->group),
- frame_num,
- WINWIDTH/2,
- WINHEIGHT/2);
+ clutter_actor_set_rotation (CLUTTER_ACTOR (oh->group),
+ CLUTTER_Z_AXIS,
+ frame_num,
+ WINWIDTH / 2, WINHEIGHT / 2, 0);
+
for (i = 0; i < NHANDS; i++)
{
/* rotate each hand around there centers */
- clutter_actor_rotate_z (oh->hand[i],
- - 6.0 * frame_num,
- clutter_actor_get_width (oh->hand[i])/2,
- clutter_actor_get_height (oh->hand[i])/2);
- if (fade == TRUE) {
- clutter_actor_set_opacity (oh->hand[i], (255 - (frame_num % 255)));
- }
+ clutter_actor_set_rotation (oh->hand[i],
+ CLUTTER_Z_AXIS,
+ - 6.0 * frame_num,
+ clutter_actor_get_width (oh->hand[i]) / 2,
+ clutter_actor_get_height (oh->hand[i]) / 2,
+ 0);
+ if (fade == TRUE)
+ clutter_actor_set_opacity (oh->hand[i], (255 - (frame_num % 255)));
}
-
/*
clutter_actor_rotate_x (CLUTTER_ACTOR(oh->group),
75.0,
main (int argc, char *argv[])
{
ClutterTimeline *timeline;
- ClutterActor *stage;
+ ClutterActor *stage;
ClutterColor stage_color = { 0x61, 0x64, 0x8c, 0xff };
GtkWidget *window, *clutter, *socket_box;
GtkWidget *label, *button, *vbox;