From 44b9b422d8432ac093b63bfe75b6a42204744133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 27 Jun 2010 07:40:50 +0200 Subject: [PATCH] tests: Don't use deprecated GTK API to fix the build with GTK+ 3.0 --- tests/examples/camerabin/gst-camera.c | 12 +++++++----- tests/icles/metadata_editor.c | 12 ++++++++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/tests/examples/camerabin/gst-camera.c b/tests/examples/camerabin/gst-camera.c index d31699abec..b47e0cbf55 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 343b31c4b4..d17d506297 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;