diff options
author | jstebbins <[email protected]> | 2011-03-22 01:22:52 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2011-03-22 01:22:52 +0000 |
commit | 49e48e0e8e43c927df53f06baea9d7ec61eae21e (patch) | |
tree | 84a252b42858f7673c4e0f4e7051bbe3d6a05b1d /gtk | |
parent | c26e59c7a0918291d2817a8178be4b9f72c1eeee (diff) |
LinGui: Remove use of private member "window" of GtkWidget
It doesn't exist in gtk+-3.0. Use gtk_widget_get_window() instead.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3864 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/src/callbacks.c | 4 | ||||
-rw-r--r-- | gtk/src/ghbcompositor.c | 26 | ||||
-rw-r--r-- | gtk/src/preview.c | 10 |
3 files changed, 22 insertions, 18 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index 3fccd80ea..93d8db728 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -4410,7 +4410,7 @@ ghb_inhibit_gsm(signal_user_data_t *ud) return; } widget = GHB_WIDGET(ud->builder, "hb_window"); - xid = GDK_DRAWABLE_XID(widget->window); + xid = GDK_DRAWABLE_XID(gtk_widget_get_window(widget)); res = dbus_g_proxy_call(proxy, "Inhibit", &error, G_TYPE_STRING, "ghb", G_TYPE_UINT, xid, @@ -4849,7 +4849,7 @@ status_activate_cb(GtkStatusIcon *si, signal_user_data_t *ud) GdkWindowState state; window = GTK_WINDOW(GHB_WIDGET(ud->builder, "hb_window")); - state = gdk_window_get_state(GTK_WIDGET(window)->window); + state = gdk_window_get_state(gtk_widget_get_window(GTK_WIDGET(window))); if ((state & GDK_WINDOW_STATE_ICONIFIED) || (ud->hb_visibility != GDK_VISIBILITY_UNOBSCURED)) { diff --git a/gtk/src/ghbcompositor.c b/gtk/src/ghbcompositor.c index 8bc455b9e..2da37c6da 100644 --- a/gtk/src/ghbcompositor.c +++ b/gtk/src/ghbcompositor.c @@ -382,7 +382,7 @@ ghb_compositor_zlist_insert ( for (link = cc->drawables; link != NULL; link = link->next) { gtk_widget_realize(GTK_WIDGET(link->data)); - gdk_window_set_composited(GTK_WIDGET(link->data)->window, TRUE); + gdk_window_set_composited(gtk_widget_get_window(GTK_WIDGET(link->data)), TRUE); } } } @@ -489,6 +489,8 @@ ghb_compositor_realize (GtkWidget *widget) | GDK_LEAVE_NOTIFY_MASK; visible_window = !GTK_WIDGET_NO_WINDOW (widget); + + GdkWindow *window; if (visible_window) { attributes.visual = gtk_widget_get_visual (widget); @@ -497,20 +499,22 @@ ghb_compositor_realize (GtkWidget *widget) attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; - widget->window = gdk_window_new(gtk_widget_get_parent_window (widget), - &attributes, attributes_mask); - gdk_window_set_user_data (widget->window, widget); + window = gdk_window_new(gtk_widget_get_parent_window (widget), + &attributes, attributes_mask); + gtk_widget_set_window(widget, window); + gdk_window_set_user_data(window, widget); } else { - widget->window = gtk_widget_get_parent_window (widget); - g_object_ref (widget->window); + window = gtk_widget_get_parent_window (widget); + gtk_widget_set_window(widget, window); + g_object_ref (window); } - widget->style = gtk_style_attach (widget->style, widget->window); + widget->style = gtk_style_attach (widget->style, window); if (visible_window) - gtk_style_set_background(widget->style, widget->window, + gtk_style_set_background(widget->style, window, GTK_STATE_NORMAL); } @@ -580,7 +584,7 @@ ghb_compositor_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { if (!GTK_WIDGET_NO_WINDOW (widget)) { - gdk_window_move_resize (widget->window, + gdk_window_move_resize (gtk_widget_get_window(widget), allocation->x + GTK_CONTAINER (widget)->border_width, allocation->y + GTK_CONTAINER (widget)->border_width, child_allocation.width, @@ -607,7 +611,7 @@ ghb_compositor_blend (GtkWidget *widget, GdkEventExpose *event) if (compositor->children == NULL) return; /* create a cairo context to draw to the window */ - cr = gdk_cairo_create (widget->window); + cr = gdk_cairo_create (gtk_widget_get_window(widget)); for (link = compositor->children; link != NULL; link = link->next) { @@ -622,7 +626,7 @@ ghb_compositor_blend (GtkWidget *widget, GdkEventExpose *event) continue; /* the source data is the (composited) event box */ - gdk_cairo_set_source_pixmap (cr, child->window, + gdk_cairo_set_source_pixmap (cr, gtk_widget_get_window(child), child->allocation.x, child->allocation.y); /* draw no more than our expose event intersects our child */ diff --git a/gtk/src/preview.c b/gtk/src/preview.c index d81ab2cff..e0cc6382d 100644 --- a/gtk/src/preview.c +++ b/gtk/src/preview.c @@ -165,7 +165,7 @@ ghb_preview_init(signal_user_data_t *ud) GstElement *xover; #if GTK_CHECK_VERSION(2,18,0) - if (!gdk_window_ensure_native(ud->preview->view->window)) + if (!gdk_window_ensure_native(gtk_widget_get_window(ud->preview->view))) { g_message("Couldn't create native window for GstXOverlay. Disabling live preview."); GtkWidget *widget = GHB_WIDGET(ud->builder, "live_preview_box"); @@ -177,9 +177,9 @@ ghb_preview_init(signal_user_data_t *ud) #endif #if !defined(_WIN32) - ud->preview->xid = GDK_DRAWABLE_XID(ud->preview->view->window); + ud->preview->xid = GDK_DRAWABLE_XID(gtk_widget_get_window(ud->preview->view)); #else - ud->preview->xid = GDK_WINDOW_HWND(ud->preview->view->window); + ud->preview->xid = GDK_WINDOW_HWND(gtk_widget_get_window(ud->preview->view)); #endif ud->preview->play = gst_element_factory_make("playbin", "play"); xover = gst_element_factory_make("gconfvideosink", "xover"); @@ -766,7 +766,7 @@ ghb_set_preview_image(signal_user_data_t *ud) ud->preview->width = preview_width; ud->preview->height = preview_height; } - _draw_pixbuf(widget->window, ud->preview->pix); + _draw_pixbuf(gtk_widget_get_window(widget), ud->preview->pix); gchar *text = g_strdup_printf("%d x %d", width, height); widget = GHB_WIDGET (ud->builder, "preview_dims"); @@ -856,7 +856,7 @@ preview_expose_cb( if (ud->preview->pix != NULL) { - _draw_pixbuf(widget->window, ud->preview->pix); + _draw_pixbuf(gtk_widget_get_window(widget), ud->preview->pix); } return TRUE; } |