[cheese] widget: Using ClutterTexture instead of DrawingArea
- From: Daniel G. Siegel <dgsiegel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese] widget: Using ClutterTexture instead of DrawingArea
- Date: Sun, 17 Oct 2010 09:41:34 +0000 (UTC)
commit cfcb381d05fedd8ba16e56cf6a01ad791567a19b
Author: Luciana Fujii Pontello <luciana fujii eti br>
Date: Sun Oct 17 02:06:38 2010 -0200
widget: Using ClutterTexture instead of DrawingArea
The method cheese_camera_new expects a ClutterTexture, but the widget
was trying to use a GtkDrawingArea. It now has a GtkClutterEmbed widget
that contains a ClutterTexture that will be used by cheese_camera_new.
libcheese/cheese-widget.c | 13 +++++++++++--
libcheese/cheese-widget.h | 2 ++
2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/libcheese/cheese-widget.c b/libcheese/cheese-widget.c
index 99c22d8..2bee0f9 100644
--- a/libcheese/cheese-widget.c
+++ b/libcheese/cheese-widget.c
@@ -50,6 +50,7 @@ typedef struct
{
GtkWidget *spinner;
GtkWidget *screen;
+ ClutterActor *texture;
GtkWidget *problem;
CheeseGConf *gconf;
CheeseCamera *webcam;
@@ -187,6 +188,7 @@ cheese_widget_init (CheeseWidget *widget)
{
CheeseWidgetPrivate *priv = CHEESE_WIDGET_GET_PRIVATE (widget);
GtkWidget *box;
+ ClutterActor *stage;
priv->state = CHEESE_WIDGET_STATE_NONE;
priv->error = NULL;
@@ -207,8 +209,15 @@ cheese_widget_init (CheeseWidget *widget)
box, gtk_label_new ("spinner"));
/* Webcam page */
- priv->screen = gtk_drawing_area_new ();
+ priv->screen = gtk_clutter_embed_new ();
+ stage = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED (priv->screen));
+ priv->texture = clutter_texture_new ();
+
+ clutter_actor_set_size (priv->texture, 400, 300);
+ clutter_container_add_actor (CLUTTER_CONTAINER (stage), priv->texture);
+
gtk_widget_show (priv->screen);
+ clutter_actor_show (priv->texture);
gtk_notebook_append_page (GTK_NOTEBOOK (widget),
priv->screen, gtk_label_new ("webcam"));
@@ -314,7 +323,7 @@ setup_camera (CheeseWidget *widget)
NULL);
gdk_threads_enter ();
- priv->webcam = cheese_camera_new (priv->screen,
+ priv->webcam = cheese_camera_new (CLUTTER_TEXTURE (priv->texture),
webcam_device,
x_resolution,
y_resolution);
diff --git a/libcheese/cheese-widget.h b/libcheese/cheese-widget.h
index 62c2092..86dbc62 100644
--- a/libcheese/cheese-widget.h
+++ b/libcheese/cheese-widget.h
@@ -22,6 +22,8 @@
#include <glib-object.h>
#include <gtk/gtk.h>
+#include <clutter/clutter.h>
+#include <clutter-gtk/clutter-gtk.h>
G_BEGIN_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]