summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2010-06-27 07:40:50 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2010-06-27 07:40:50 +0200
commit44b9b422d8432ac093b63bfe75b6a42204744133 (patch)
tree12ffcfd6c963436bba2b44d9c3a11d65581f147e
parentd13a122a56b0b5eb317ce09529437dd57f0a7fdd (diff)
downloadgstreamer-plugins-bad-44b9b422d8432ac093b63bfe75b6a42204744133.tar.gz
tests: Don't use deprecated GTK API to fix the build with GTK+ 3.0
-rw-r--r--tests/examples/camerabin/gst-camera.c12
-rw-r--r--tests/icles/metadata_editor.c12
2 files changed, 15 insertions, 9 deletions
diff --git a/tests/examples/camerabin/gst-camera.c b/tests/examples/camerabin/gst-camera.c
index d31699abe..b47e0cbf5 100644
--- a/tests/examples/camerabin/gst-camera.c
+++ b/tests/examples/camerabin/gst-camera.c
@@ -268,7 +268,7 @@ my_bus_sync_callback (GstBus * bus, GstMessage * message, gpointer data)
/* FIXME: make sure to get XID in main thread */
gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (message->src),
- GDK_WINDOW_XWINDOW (ui_drawing->window));
+ GDK_WINDOW_XWINDOW (gtk_widget_get_window (ui_drawing)));
gst_message_unref (message);
return GST_BUS_DROP;
@@ -838,7 +838,7 @@ void
on_drawingareaView_realize (GtkWidget * widget, gpointer data)
{
#if GTK_CHECK_VERSION (2, 18, 0)
- gdk_window_ensure_native (widget->window);
+ gdk_window_ensure_native (gtk_widget_get_window (widget));
#endif
}
@@ -846,9 +846,11 @@ gboolean
on_drawingareaView_configure_event (GtkWidget * widget,
GdkEventConfigure * event, gpointer data)
{
- gdk_window_move_resize (widget->window,
- widget->allocation.x, widget->allocation.y,
- widget->allocation.width, widget->allocation.height);
+ GtkAllocation a;
+
+ gtk_widget_get_allocation (widget, &a);
+ gdk_window_move_resize (gtk_widget_get_window (widget),
+ a.x, a.y, a.width, a.height);
gdk_display_sync (gtk_widget_get_display (widget));
return TRUE;
diff --git a/tests/icles/metadata_editor.c b/tests/icles/metadata_editor.c
index 343b31c4b..d17d50629 100644
--- a/tests/icles/metadata_editor.c
+++ b/tests/icles/metadata_editor.c
@@ -322,9 +322,11 @@ gboolean
on_drawingMain_expose_event (GtkWidget * widget, GdkEventExpose * event,
gpointer data)
{
- GtkAllocation a = widget->allocation;
+ GtkAllocation a;
gint w, h, x, y;
+ gtk_widget_get_allocation (widget, &a);
+
if (draw_pixbuf == NULL)
return FALSE;
@@ -341,7 +343,8 @@ on_drawingMain_expose_event (GtkWidget * widget, GdkEventExpose * event,
if (y < 0)
y = 0;
- gdk_draw_pixbuf (GDK_DRAWABLE (widget->window), widget->style->black_gc,
+ gdk_draw_pixbuf (GDK_DRAWABLE (gtk_widget_get_window (widget)),
+ gtk_widget_get_style (widget)->black_gc,
draw_pixbuf, 0, 0, x, y, w, h, GDK_RGB_DITHER_NONE, 0, 0);
return TRUE; /* handled expose event */
@@ -902,6 +905,7 @@ me_gst_bus_callback_view (GstBus * bus, GstMessage * message, gpointer data)
break;
case GST_MESSAGE_ELEMENT: {
const GValue *val;
+ GtkAllocation a;
/* only interested in element messages from our gdkpixbufsink */
if (message->src != GST_OBJECT_CAST (gst_video_sink))
@@ -925,8 +929,8 @@ me_gst_bus_callback_view (GstBus * bus, GstMessage * message, gpointer data)
g_print ("Got image pixbuf: %dx%d\n", gdk_pixbuf_get_width (last_pixbuf),
gdk_pixbuf_get_height (last_pixbuf));
- update_draw_pixbuf (GTK_WIDGET (ui_drawing)->allocation.width,
- GTK_WIDGET (ui_drawing)->allocation.height);
+ gtk_widget_get_allocation (GTK_WIDGET (ui_drawing), &a);
+ update_draw_pixbuf (a.width, a.height);
gtk_widget_queue_draw (ui_drawing);
break;