From 5295efbbdd87869144b62d53c51b6ae4c1c83c77 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 4 Jul 2008 10:49:14 +0000 Subject: [PATCH] 2008-07-04 Emmanuele Bassi * clutter-gtk.pc.in: Fix the inclusion directory * clutter-gtk/gtk-clutter-embed.c: Synch up with the stable branch to handle focus. Also remove the ClutterContainer implementation. * clutter-gtk/gtk-clutter-util.[ch]: Fully document and add the gtk_clutter_texture_set_from_icon_name() helper function. * configure.ac: Whitespace * examples/gtk-clutter-test.c: Update. --- ChangeLog | 42 ++++--- clutter-gtk.pc.in | 2 +- clutter-gtk/gtk-clutter-embed.c | 125 +++++---------------- clutter-gtk/gtk-clutter-util.c | 237 +++++++++++++++++++++++++++++++++------ clutter-gtk/gtk-clutter-util.h | 69 ++++++++---- configure.ac | 1 + examples/gtk-clutter-test.c | 2 +- 7 files changed, 312 insertions(+), 166 deletions(-) diff --git a/ChangeLog b/ChangeLog index c29738e..263f986 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2008-07-04 Emmanuele Bassi + + * clutter-gtk.pc.in: Fix the inclusion directory + + * clutter-gtk/gtk-clutter-embed.c: Synch up with the stable branch + to handle focus. Also remove the ClutterContainer implementation. + + * clutter-gtk/gtk-clutter-util.[ch]: Fully document and add the + gtk_clutter_texture_set_from_icon_name() helper function. + + * configure.ac: Whitespace + + * examples/gtk-clutter-test.c: Update. + 2008-05-19 Tomas Frydrych * clutter-gtk/gtk-clutter-embed.c: @@ -13,7 +27,7 @@ 2008-05-07 Matthew Allum * clutter-gtk/gtk-clutter-embed.c: - Add motion event handling - fixes #907 + Add motion event handling - fixes #907 2008-04-24 Emmanuele Bassi @@ -122,7 +136,7 @@ * examples/Makefile.am: * examples/gtk-clutter-multistage.c: - Add a *very* simple multiple stage example. + Add a *very* simple multiple stage example. 2008-04-01 Neil Roberts @@ -134,8 +148,8 @@ 2008-04-01 Matthew Allum * clutter-gtk/gtk-clutter-embed.c: - Update for latest trunk multistage. - Should now support multple widgets. + Update for latest trunk multistage. + Should now support multple widgets. 2008-02-29 Emmanuele Bassi @@ -149,23 +163,23 @@ * clutter-gtk.pc.in: * configure.ac: - Bump up to unstable 0.7 version and clutter req. + Bump up to unstable 0.7 version and clutter req. * clutter-gtk/gtk-clutter-embed.c: * clutter-gtk/gtk-clutter-embed.h: - Add clutter_gtk_init(), as to use new API to share DISPLAY and - turn off Clutter 'automatic' event collection. - Add methods for; - expose - Queue a Clutter redraw. - map - set Actor mapped flag. - show/hide - Forward to stage also. - Minor doc additions. + Add clutter_gtk_init(), as to use new API to share DISPLAY and + turn off Clutter 'automatic' event collection. + Add methods for; + expose - Queue a Clutter redraw. + map - set Actor mapped flag. + show/hide - Forward to stage also. + Minor doc additions. * examples/gtk-clutter-events.c: - Add some minor comments re when to call show_all(). + Add some minor comments re when to call show_all(). * examples/gtk-clutter-test.c: - Fix event->actor mapping. + Fix event->actor mapping. 2008-02-21 Emmanuele Bassi diff --git a/clutter-gtk.pc.in b/clutter-gtk.pc.in index 13a86ab..3e8b1c0 100644 --- a/clutter-gtk.pc.in +++ b/clutter-gtk.pc.in @@ -7,5 +7,5 @@ Name: clutter-gtk Description: GTK+ widget for Clutter Version: @VERSION@ Libs: -L${libdir} -lclutter-gtk-0.7 -Cflags: -I${includedir}/clutter-0.6/clutter-gtk +Cflags: -I${includedir}/clutter-0.7/clutter-gtk Requires: clutter-x11-0.7 gtk+-2.0 diff --git a/clutter-gtk/gtk-clutter-embed.c b/clutter-gtk/gtk-clutter-embed.c index b7b7ac7..32f811e 100644 --- a/clutter-gtk/gtk-clutter-embed.c +++ b/clutter-gtk/gtk-clutter-embed.c @@ -63,13 +63,7 @@ #include "gtk-clutter-embed.h" -static void clutter_container_iface_init (ClutterContainerIface *iface); - -G_DEFINE_TYPE_WITH_CODE (GtkClutterEmbed, - gtk_clutter_embed, - GTK_TYPE_WIDGET, - G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_CONTAINER, - clutter_container_iface_init)); +G_DEFINE_TYPE (GtkClutterEmbed, gtk_clutter_embed, GTK_TYPE_WIDGET); #define GTK_CLUTTER_EMBED_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_CLUTTER_EMBED, GtkClutterEmbedPrivate)) @@ -117,11 +111,12 @@ gtk_clutter_embed_show (GtkWidget *widget) GtkClutterEmbedPrivate *priv = GTK_CLUTTER_EMBED (widget)->priv; /* Make sure the widget is realised before we show */ - gtk_widget_realize (widget); - - GTK_WIDGET_CLASS (gtk_clutter_embed_parent_class)->show (widget); + if (!GTK_WIDGET_REALIZED (widget)) + gtk_widget_realize (widget); clutter_actor_show (priv->stage); + + GTK_WIDGET_CLASS (gtk_clutter_embed_parent_class)->show (widget); } static void @@ -129,9 +124,9 @@ gtk_clutter_embed_hide (GtkWidget *widget) { GtkClutterEmbedPrivate *priv = GTK_CLUTTER_EMBED (widget)->priv; - GTK_WIDGET_CLASS (gtk_clutter_embed_parent_class)->hide (widget); - clutter_actor_hide (priv->stage); + + GTK_WIDGET_CLASS (gtk_clutter_embed_parent_class)->hide (widget); } static void @@ -156,9 +151,12 @@ gtk_clutter_embed_realize (GtkWidget *widget) * throtling. */ attributes.event_mask = gtk_widget_get_events (widget) - | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_MOTION_NOTIFY; - + | GDK_EXPOSURE_MASK + | GDK_BUTTON_PRESS_MASK + | GDK_BUTTON_RELEASE_MASK + | GDK_KEY_PRESS_MASK + | GDK_KEY_RELEASE_MASK + | GDK_MOTION_NOTIFY; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; @@ -180,7 +178,7 @@ gtk_clutter_embed_realize (GtkWidget *widget) GDK_WINDOW_HWND (widget->window)); #endif /* HAVE_CLUTTER_GTK_{X11,WIN32} */ - clutter_redraw (CLUTTER_STAGE (priv->stage)); + clutter_actor_queue_redraw (CLUTTER_ACTOR (priv->stage)); gtk_clutter_embed_send_configure (GTK_CLUTTER_EMBED (widget)); } @@ -304,19 +302,20 @@ gtk_clutter_embed_key_event (GtkWidget *widget, } static gboolean -gtk_clutter_embed_expose_event (GtkWidget *widget, GdkEventExpose *event) +gtk_clutter_embed_expose_event (GtkWidget *widget, + GdkEventExpose *event) { GtkClutterEmbedPrivate *priv = GTK_CLUTTER_EMBED (widget)->priv; if (CLUTTER_ACTOR_IS_VISIBLE (priv->stage)) clutter_actor_queue_redraw (priv->stage); - return TRUE; + return FALSE; } static gboolean -gtk_clutter_embed_map_event (GtkWidget *widget, - GdkEventAny *event) +gtk_clutter_embed_map_event (GtkWidget *widget, + GdkEventAny *event) { GtkClutterEmbedPrivate *priv = GTK_CLUTTER_EMBED (widget)->priv; @@ -325,86 +324,19 @@ gtk_clutter_embed_map_event (GtkWidget *widget, */ CLUTTER_ACTOR_SET_FLAGS (priv->stage, CLUTTER_ACTOR_MAPPED); - return TRUE; -} - -static void -gtk_clutter_embed_add (ClutterContainer *container, - ClutterActor *actor) -{ - GtkClutterEmbedPrivate *priv = GTK_CLUTTER_EMBED (container)->priv; - ClutterContainer *stage = CLUTTER_CONTAINER (priv->stage); - - clutter_container_add_actor (stage, actor); - g_signal_emit_by_name (container, "actor-added", actor); -} - -static void -gtk_clutter_embed_remove (ClutterContainer *container, - ClutterActor *actor) -{ - GtkClutterEmbedPrivate *priv = GTK_CLUTTER_EMBED (container)->priv; - ClutterContainer *stage = CLUTTER_CONTAINER (priv->stage); - - g_object_ref (actor); - - clutter_container_remove_actor (stage, actor); - g_signal_emit_by_name (container, "actor-removed", actor); - - g_object_unref (actor); -} - -static void -gtk_clutter_embed_foreach (ClutterContainer *container, - ClutterCallback callback, - gpointer callback_data) -{ - GtkClutterEmbedPrivate *priv = GTK_CLUTTER_EMBED (container)->priv; - ClutterContainer *stage = CLUTTER_CONTAINER (priv->stage); - - clutter_container_foreach (stage, callback, callback_data); -} - -static void -gtk_clutter_embed_raise (ClutterContainer *container, - ClutterActor *child, - ClutterActor *sibling) -{ - GtkClutterEmbedPrivate *priv = GTK_CLUTTER_EMBED (container)->priv; - ClutterContainer *stage = CLUTTER_CONTAINER (priv->stage); - - clutter_container_raise_child (stage, child, sibling); -} - -static void -gtk_clutter_embed_lower (ClutterContainer *container, - ClutterActor *child, - ClutterActor *sibling) -{ - GtkClutterEmbedPrivate *priv = GTK_CLUTTER_EMBED (container)->priv; - ClutterContainer *stage = CLUTTER_CONTAINER (priv->stage); - - clutter_container_lower_child (stage, child, sibling); + return FALSE; } -static void -gtk_clutter_embed_sort_depth_order (ClutterContainer *container) +static gboolean +gtk_clutter_embed_focus_out (GtkWidget *widget, + GdkEventFocus *event) { - GtkClutterEmbedPrivate *priv = GTK_CLUTTER_EMBED (container)->priv; - ClutterContainer *stage = CLUTTER_CONTAINER (priv->stage); + GtkClutterEmbedPrivate *priv = GTK_CLUTTER_EMBED (widget)->priv; - clutter_container_sort_depth_order (stage); -} + /* give back key focus to the stage */ + clutter_stage_set_key_focus (CLUTTER_STAGE (priv->stage), NULL); -static void -clutter_container_iface_init (ClutterContainerIface *iface) -{ - iface->add = gtk_clutter_embed_add; - iface->remove = gtk_clutter_embed_remove; - iface->foreach = gtk_clutter_embed_foreach; - iface->raise = gtk_clutter_embed_raise; - iface->lower = gtk_clutter_embed_lower; - iface->sort_depth_order = gtk_clutter_embed_sort_depth_order; + return FALSE; } static void @@ -428,6 +360,7 @@ gtk_clutter_embed_class_init (GtkClutterEmbedClass *klass) widget_class->motion_notify_event = gtk_clutter_embed_motion_notify_event; widget_class->expose_event = gtk_clutter_embed_expose_event; widget_class->map_event = gtk_clutter_embed_map_event; + widget_class->focus_out_event = gtk_clutter_embed_focus_out; } static void @@ -437,6 +370,8 @@ gtk_clutter_embed_init (GtkClutterEmbed *embed) embed->priv = priv = GTK_CLUTTER_EMBED_GET_PRIVATE (embed); + GTK_WIDGET_SET_FLAGS (embed, GTK_CAN_FOCUS); + /* disable double-buffering: it's automatically provided * by OpenGL */ diff --git a/clutter-gtk/gtk-clutter-util.c b/clutter-gtk/gtk-clutter-util.c index 6cb0bd9..6ef293e 100644 --- a/clutter-gtk/gtk-clutter-util.c +++ b/clutter-gtk/gtk-clutter-util.c @@ -12,8 +12,12 @@ * SECTION:gtk-clutter-util * @short_description: Utility functions for integrating Clutter in GTK+ * - * FIXME + * In order to properly integrate a Clutter scene into a GTK+ applications + * a certain degree of state must be retrieved from GTK+ itself. * + * Clutter-GTK provides API for easing the process of synchronizing colors + * with the current GTK+ theme and for loading image sources from #GdkPixbuf, + * GTK+ stock items and icon themes. */ static inline void @@ -48,18 +52,20 @@ gtk_clutter_get_component (GtkWidget *widget, break; } - color->red = (guint8) ((gtk_color.red / 65535.0) * 255); - color->green = (guint8) ((gtk_color.green / 65535.0) * 255); - color->blue = (guint8) ((gtk_color.blue / 65535.0) * 255); + color->red = CLAMP (((gtk_color.red / 65535.0) * 255), 0, 255); + color->green = CLAMP (((gtk_color.green / 65535.0) * 255), 0, 255); + color->blue = CLAMP (((gtk_color.blue / 65535.0) * 255), 0, 255); + color->alpha = 255; } /** * gtk_clutter_get_fg_color: - * @widget: - * @state: - * @color: + * @widget: a #GtkWidget + * @state: a state + * @color: return location for a #ClutterColor * - * FIXME + * Retrieves the foreground color of @widget for the given @state and copies + * it into @color. * * Since: 0.8 */ @@ -78,11 +84,12 @@ gtk_clutter_get_fg_color (GtkWidget *widget, /** * gtk_clutter_get_bg_color: - * @widget: - * @state: - * @color: + * @widget: a #GtkWidget + * @state: a state + * @color: return location for a #ClutterColor * - * FIXME + * Retrieves the background color of @widget for the given @state and copies + * it into @color. * * Since: 0.8 */ @@ -101,11 +108,12 @@ gtk_clutter_get_bg_color (GtkWidget *widget, /** * gtk_clutter_get_text_color: - * @widget: - * @state: - * @color: + * @widget: a #GtkWidget + * @state: a state + * @color: return location for a #ClutterColor * - * FIXME + * Retrieves the text color of @widget for the given @state and copies it + * into @color. * * Since: 0.8 */ @@ -124,11 +132,12 @@ gtk_clutter_get_text_color (GtkWidget *widget, /** * gtk_clutter_get_base_color: - * @widget: - * @state: - * @color: + * @widget: a #GtkWidget + * @state: a state + * @color: return location for a #ClutterColor * - * FIXME + * Retrieves the base color of @widget for the given @state and copies it + * into @color. * * Since: 0.8 */ @@ -149,7 +158,8 @@ gtk_clutter_get_base_color (GtkWidget *widget, * gtk_clutter_texture_new_from_pixbuf: * @pixbuf: a #GdkPixbuf * - * FIXME + * Creates a new #ClutterTexture and sets its contents with a copy + * of @pixbuf. * * Return value: the newly created #ClutterTexture * @@ -184,12 +194,47 @@ gtk_clutter_texture_new_from_pixbuf (GdkPixbuf *pixbuf) } /** + * gtk_clutter_texture_set_from_pixbuf: + * @texture: a #ClutterTexture + * @pixbuf: a #GdkPixbuf + * + * Sets the contents of @texture with a copy of @pixbuf. + * + * Since: 0.8 + */ +void +gtk_clutter_texture_set_from_pixbuf (ClutterTexture *texture, + GdkPixbuf *pixbuf) +{ + GError *error; + + g_return_if_fail (CLUTTER_IS_TEXTURE (texture)); + g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); + + error = NULL; + clutter_texture_set_from_rgb_data (texture, + gdk_pixbuf_get_pixels (pixbuf), + gdk_pixbuf_get_has_alpha (pixbuf), + gdk_pixbuf_get_width (pixbuf), + gdk_pixbuf_get_height (pixbuf), + gdk_pixbuf_get_rowstride (pixbuf), + 4, 0, + &error); + if (error) + { + g_warning ("Unable to set the pixbuf: %s", error->message); + g_error_free (error); + } +} + +/** * gtk_clutter_texture_new_from_stock: * @widget: a #GtkWidget - * @stock_id: FIXME - * @size: FIXME + * @stock_id: the stock id of the icon + * @size: the size of the icon, or -1 * - * FIXME + * Creates a new #ClutterTexture and sets its contents using the stock + * icon @stock_id as rendered by @widget. * * Return value: the newly created #ClutterTexture * @@ -220,14 +265,51 @@ gtk_clutter_texture_new_from_stock (GtkWidget *widget, } /** - * gtk_clutter_texture_new_from_icon_name: + * gtk_clutter_texture_set_from_stock: + * @texture: a #ClutterTexture * @widget: a #GtkWidget - * @icon_name: FIXME - * @size: FIXME + * @stock_id: the stock id of the icon + * @size: the size of the icon, or -1 * - * FIXME + * Sets the contents of @texture using the stock icon @stock_id, as + * rendered by @widget. * - * Return value: the newly created #ClutterTexture + * Since: 0.8 + */ +void +gtk_clutter_texture_set_from_stock (ClutterTexture *texture, + GtkWidget *widget, + const gchar *stock_id, + GtkIconSize size) +{ + GdkPixbuf *pixbuf; + + g_return_if_fail (CLUTTER_IS_TEXTURE (texture)); + g_return_if_fail (GTK_IS_WIDGET (widget)); + g_return_if_fail (stock_id != NULL); + g_return_if_fail (size > GTK_ICON_SIZE_INVALID || size == -1); + + pixbuf = gtk_widget_render_icon (widget, stock_id, size, NULL); + if (!pixbuf) + pixbuf = gtk_widget_render_icon (widget, + GTK_STOCK_MISSING_IMAGE, size, + NULL); + + gtk_clutter_texture_set_from_pixbuf (texture, pixbuf); + g_object_unref (pixbuf); +} + +/** + * gtk_clutter_texture_new_from_icon_name: + * @widget: a #GtkWidget or %NULL + * @icon_name: the name of the icon + * @size: the size of the icon, or -1 + * + * Creates a new #ClutterTexture and sets its contents to be + * the @icon_name from the current icon theme. + * + * Return value: the newly created texture, or %NULL if @widget + * was %NULL and @icon_name was not found. * * Since: 0.8 */ @@ -243,11 +325,11 @@ gtk_clutter_texture_new_from_icon_name (GtkWidget *widget, GError *error; ClutterActor *retval; - g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); + g_return_val_if_fail (widget == NULL || GTK_IS_WIDGET (widget), NULL); g_return_val_if_fail (icon_name != NULL, NULL); g_return_val_if_fail (size > GTK_ICON_SIZE_INVALID || size == -1, NULL); - if (gtk_widget_has_screen (widget)) + if (widget && gtk_widget_has_screen (widget)) { GdkScreen *screen; @@ -261,9 +343,9 @@ gtk_clutter_texture_new_from_icon_name (GtkWidget *widget, icon_theme = gtk_icon_theme_get_default (); } - if (!gtk_icon_size_lookup_for_settings (settings, size, &width, &height)) + if (size == -1 || + !gtk_icon_size_lookup_for_settings (settings, size, &width, &height)) { - g_warning ("Invalid icon size"); width = height = 48; } @@ -274,10 +356,18 @@ gtk_clutter_texture_new_from_icon_name (GtkWidget *widget, &error); if (error) { + g_warning ("Unable to load the icon `%s' from the theme: %s", + icon_name, + error->message); + g_error_free (error); - return gtk_clutter_texture_new_from_stock (widget, - GTK_STOCK_MISSING_IMAGE, - size); + + if (widget) + return gtk_clutter_texture_new_from_stock (widget, + GTK_STOCK_MISSING_IMAGE, + size); + else + return NULL; } retval = gtk_clutter_texture_new_from_pixbuf (pixbuf); @@ -285,3 +375,78 @@ gtk_clutter_texture_new_from_icon_name (GtkWidget *widget, return retval; } + +/** + * gtk_clutter_texture_set_from_icon_name: + * @texture: a #ClutterTexture + * @widget: a #GtkWidget or %NULL + * @icon_name: the name of the icon + * @size: the icon size or -1 + * + * Sets the contents of @texture using the @icon_name from the + * current icon theme. + * + * Since: 0.8 + */ +void +gtk_clutter_texture_set_from_icon_name (ClutterTexture *texture, + GtkWidget *widget, + const gchar *icon_name, + GtkIconSize size) +{ + GtkSettings *settings; + GtkIconTheme *icon_theme; + gint width, height; + GdkPixbuf *pixbuf; + GError *error; + + g_return_if_fail (CLUTTER_IS_TEXTURE (texture)); + g_return_if_fail (widget == NULL || GTK_IS_WIDGET (widget)); + g_return_if_fail (icon_name != NULL); + g_return_if_fail (size > GTK_ICON_SIZE_INVALID || size == -1); + + if (widget && gtk_widget_has_screen (widget)) + { + GdkScreen *screen; + + screen = gtk_widget_get_screen (widget); + settings = gtk_settings_get_for_screen (screen); + icon_theme = gtk_icon_theme_get_for_screen (screen); + } + else + { + settings = gtk_settings_get_default (); + icon_theme = gtk_icon_theme_get_default (); + } + + if (size == -1 || + !gtk_icon_size_lookup_for_settings (settings, size, &width, &height)) + { + width = height = 48; + } + + error = NULL; + pixbuf = gtk_icon_theme_load_icon (icon_theme, + icon_name, + MIN (width, height), 0, + &error); + if (error) + { + g_warning ("Unable to load the icon `%s' from the theme: %s", + icon_name, + error->message); + + g_error_free (error); + + if (widget) + gtk_clutter_texture_set_from_stock (texture, + widget, + GTK_STOCK_MISSING_IMAGE, + size); + else + return; + } + + gtk_clutter_texture_set_from_pixbuf (texture, pixbuf); + g_object_unref (pixbuf); +} diff --git a/clutter-gtk/gtk-clutter-util.h b/clutter-gtk/gtk-clutter-util.h index 0c79b07..539b1f7 100644 --- a/clutter-gtk/gtk-clutter-util.h +++ b/clutter-gtk/gtk-clutter-util.h @@ -1,3 +1,24 @@ +/* gtk-clutter-util.h: GTK+ integration utilities + * + * Copyright (C) 2008 OpenedHand + * + * 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 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 see . + * + * Authors: + * Emmanuele Bassi + */ + #ifndef __GTK_CLUTTER_UTIL_H__ #define __GTK_CLUTTER_UTIL_H__ @@ -6,26 +27,36 @@ G_BEGIN_DECLS -void gtk_clutter_get_fg_color (GtkWidget *widget, - GtkStateType state, - ClutterColor *color); -void gtk_clutter_get_bg_color (GtkWidget *widget, - GtkStateType state, - ClutterColor *color); -void gtk_clutter_get_text_color (GtkWidget *widget, - GtkStateType state, - ClutterColor *color); -void gtk_clutter_get_base_color (GtkWidget *widget, - GtkStateType state, - ClutterColor *color); +void gtk_clutter_get_fg_color (GtkWidget *widget, + GtkStateType state, + ClutterColor *color); +void gtk_clutter_get_bg_color (GtkWidget *widget, + GtkStateType state, + ClutterColor *color); +void gtk_clutter_get_text_color (GtkWidget *widget, + GtkStateType state, + ClutterColor *color); +void gtk_clutter_get_base_color (GtkWidget *widget, + GtkStateType state, + ClutterColor *color); -ClutterActor *gtk_clutter_texture_new_from_pixbuf (GdkPixbuf *pixbuf); -ClutterActor *gtk_clutter_texture_new_from_stock (GtkWidget *widget, - const gchar *stock_id, - GtkIconSize size); -ClutterActor *gtk_clutter_texture_new_from_icon_name (GtkWidget *widget, - const gchar *icon_name, - GtkIconSize size); +ClutterActor *gtk_clutter_texture_new_from_pixbuf (GdkPixbuf *pixbuf); +ClutterActor *gtk_clutter_texture_new_from_stock (GtkWidget *widget, + const gchar *stock_id, + GtkIconSize size); +ClutterActor *gtk_clutter_texture_new_from_icon_name (GtkWidget *widget, + const gchar *icon_name, + GtkIconSize size); +void gtk_clutter_texture_set_from_pixbuf (ClutterTexture *texture, + GdkPixbuf *pixbuf); +void gtk_clutter_texture_set_from_stock (ClutterTexture *texture, + GtkWidget *widget, + const gchar *stock_id, + GtkIconSize size); +void gtk_clutter_texture_set_from_icon_name (ClutterTexture *texture, + GtkWidget *widget, + const gchar *icon_name, + GtkIconSize size); G_END_DECLS diff --git a/configure.ac b/configure.ac index 8a53670..9c5d463 100644 --- a/configure.ac +++ b/configure.ac @@ -90,6 +90,7 @@ case $cluttergtkflavour in *) AC_MSG_ERROR([Invalid flavour for Clutter-GTK: use x11 or win32]) ;; + esac AC_SUBST(CLUTTER_CFLAGS) diff --git a/examples/gtk-clutter-test.c b/examples/gtk-clutter-test.c index 937e716..975572f 100644 --- a/examples/gtk-clutter-test.c +++ b/examples/gtk-clutter-test.c @@ -197,7 +197,7 @@ main (int argc, char *argv[]) } /* Add the group to the stage */ - clutter_container_add_actor (CLUTTER_CONTAINER (clutter), + clutter_container_add_actor (CLUTTER_CONTAINER (stage), CLUTTER_ACTOR (oh->group)); g_signal_connect (stage, "button-press-event", -- 1.7.9.5