]> granicus.if.org Git - handbrake/commitdiff
LinGui: Remove use of private member "window" of GtkWidget
authorjstebbins <jstebbins.hb@gmail.com>
Tue, 22 Mar 2011 01:22:52 +0000 (01:22 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Tue, 22 Mar 2011 01:22:52 +0000 (01:22 +0000)
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

gtk/src/callbacks.c
gtk/src/ghbcompositor.c
gtk/src/preview.c

index 3fccd80ea1b2e58406b607cc652730c05ad9cb2c..93d8db7289b31fcf0626e3f20b33d4c224312cb5 100644 (file)
@@ -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))
        {
index 8bc455b9ef6e6adcfff5876db38f286cfdddf062..2da37c6da9e5b84e5ca1a421bf0982b6d53cc1e4 100644 (file)
@@ -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 */
index d81ab2cff3174ffdee68c117c68db38a30060905..e0cc6382d3a41c34005965899e86da0b807cf5f5 100644 (file)
@@ -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;
 }