[gdm] Path to fix GDM so it better compiles with -DGSEAL_ENABLED. Fixes doo bug



commit 5de7c10b3bdae5d4b2415ceb4932488aa3be187c
Author: Brian Cameron <Brian Cameron sun com>
Date:   Mon May 3 15:53:29 2010 -0500

    Path to fix GDM so it better compiles with -DGSEAL_ENABLED.  Fixes doo bug

 gui/simple-chooser/gdm-host-chooser-dialog.c       |    2 +-
 gui/simple-greeter/gdm-cell-renderer-timer.c       |   20 +++--
 gui/simple-greeter/gdm-chooser-widget.c            |   29 ++++--
 gui/simple-greeter/gdm-clock-widget.c              |    2 +-
 gui/simple-greeter/gdm-greeter-login-window.c      |   28 +++--
 gui/simple-greeter/gdm-greeter-panel.c             |   35 +++---
 gui/simple-greeter/gdm-language-chooser-dialog.c   |    8 +-
 gui/simple-greeter/gdm-layout-chooser-dialog.c     |    8 +-
 gui/simple-greeter/gdm-remote-login-window.c       |    2 +-
 gui/simple-greeter/gdm-scrollable-widget.c         |  115 +++++++++++---------
 gui/simple-greeter/gdm-user-chooser-dialog.c       |    2 +-
 gui/simple-greeter/gdm-user-chooser-widget.c       |    2 +-
 gui/simple-greeter/libnotificationarea/fixedtip.c  |    8 +-
 .../libnotificationarea/na-tray-child.c            |   55 +++++-----
 .../libnotificationarea/na-tray-manager.c          |   32 +++---
 gui/simple-greeter/libnotificationarea/na-tray.c   |   13 ++-
 gui/simple-greeter/libnotificationarea/testtray.c  |    4 +-
 gui/user-switch-applet/applet.c                    |   19 ++--
 gui/user-switch-applet/gdm-entry-menu-item.c       |   20 ++--
 19 files changed, 223 insertions(+), 181 deletions(-)
---
diff --git a/gui/simple-chooser/gdm-host-chooser-dialog.c b/gui/simple-chooser/gdm-host-chooser-dialog.c
index 90cb9ad..7680fb5 100644
--- a/gui/simple-chooser/gdm-host-chooser-dialog.c
+++ b/gui/simple-chooser/gdm-host-chooser-dialog.c
@@ -133,7 +133,7 @@ gdm_host_chooser_dialog_constructor (GType                  type,
 
 
         dialog->priv->chooser_widget = gdm_host_chooser_widget_new (dialog->priv->kind_mask);
-        gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog->priv->chooser_widget);
+        gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), dialog->priv->chooser_widget);
         gtk_container_set_border_width (GTK_CONTAINER (dialog->priv->chooser_widget), 5);
 
         gtk_dialog_add_buttons (GTK_DIALOG (dialog),
diff --git a/gui/simple-greeter/gdm-cell-renderer-timer.c b/gui/simple-greeter/gdm-cell-renderer-timer.c
index 41580f4..bbe0233 100644
--- a/gui/simple-greeter/gdm-cell-renderer-timer.c
+++ b/gui/simple-greeter/gdm-cell-renderer-timer.c
@@ -107,12 +107,15 @@ gdm_cell_renderer_timer_get_size (GtkCellRenderer *cell,
                 }
         }
 
+	gfloat xpad, ypad;
+	gtk_cell_renderer_get_alignment (cell, &xpad, &ypad);
+
         if (width != NULL) {
-                *width = cell->xpad * 2 + 24;
+                *width = xpad * 2 + 24;
         }
 
         if (height != NULL) {
-                *height = cell->ypad * 2 + 24;
+                *height = ypad * 2 + 24;
         }
 }
 
@@ -201,13 +204,16 @@ gdm_cell_renderer_timer_render (GtkCellRenderer      *cell,
                 cairo_clip (context);
         }
 
+	gfloat xpad, ypad;
+	gtk_cell_renderer_get_alignment (cell, &xpad, &ypad);
+
         cairo_translate (context,
-                         cell_area->x + cell->xpad,
-                         cell_area->y + cell->ypad);
+                         cell_area->x + xpad,
+                         cell_area->y + ypad);
 
         widget_state = GTK_STATE_NORMAL;
         if (renderer_state & GTK_CELL_RENDERER_SELECTED) {
-                if (GTK_WIDGET_HAS_FOCUS (widget)) {
+                if (gtk_widget_has_focus (widget)) {
                         widget_state = GTK_STATE_SELECTED;
                 } else {
                         widget_state = GTK_STATE_ACTIVE;
@@ -219,8 +225,8 @@ gdm_cell_renderer_timer_render (GtkCellRenderer      *cell,
         }
 
         draw_timer (renderer, context,
-                    &widget->style->text_aa[widget_state],
-                    &widget->style->base[widget_state],
+                    &gtk_widget_get_style (widget)->text_aa[widget_state],
+                    &gtk_widget_get_style (widget)->base[widget_state],
                     cell_area->width, cell_area->height);
 
         cairo_destroy (context);
diff --git a/gui/simple-greeter/gdm-chooser-widget.c b/gui/simple-greeter/gdm-chooser-widget.c
index 0f6859a..85ebe83 100644
--- a/gui/simple-greeter/gdm-chooser-widget.c
+++ b/gui/simple-greeter/gdm-chooser-widget.c
@@ -699,6 +699,9 @@ get_normalized_position_of_row_at_path (GdmChooserWidget *widget,
 {
         GdkRectangle area_of_row_at_path;
         GdkRectangle area_of_visible_rows;
+        GtkAllocation items_view_allocation;
+
+        gtk_widget_get_allocation (widget->priv->items_view, &items_view_allocation);
 
         gtk_tree_view_get_background_area (GTK_TREE_VIEW (widget->priv->items_view),
                                            path, NULL, &area_of_row_at_path);
@@ -708,7 +711,7 @@ get_normalized_position_of_row_at_path (GdmChooserWidget *widget,
                                                      area_of_visible_rows.y,
                                                      &area_of_visible_rows.x,
                                                      &area_of_visible_rows.y);
-        return CLAMP (((double) area_of_row_at_path.y) / widget->priv->items_view->allocation.height, 0.0, 1.0);
+        return CLAMP (((double) area_of_row_at_path.y) / items_view_allocation.height, 0.0, 1.0);
 }
 
 static void
@@ -787,12 +790,12 @@ _grab_focus (GtkWidget *widget)
 
         foc_widget = GDM_CHOOSER_WIDGET (widget)->priv->items_view;
         g_debug ("GdmChooserWidget: grabbing focus");
-        if (! GTK_WIDGET_REALIZED (foc_widget)) {
+        if (! gtk_widget_get_realized (foc_widget)) {
                 g_debug ("GdmChooserWidget: not grabbing focus - not realized");
                 return;
         }
 
-        if (GTK_WIDGET_HAS_FOCUS (foc_widget)) {
+        if (gtk_widget_has_focus (foc_widget)) {
                 g_debug ("GdmChooserWidget: not grabbing focus - already has it");
                 return;
         }
@@ -848,16 +851,22 @@ on_grow_animation_step (GdmScrollableWidget *scrollable_widget,
         number_of_visible_rows = gtk_tree_model_iter_n_children (GTK_TREE_MODEL (widget->priv->model_sorter), NULL);
         number_of_on_screen_rows = get_number_of_on_screen_rows (widget);
 
-        *new_height = GTK_BIN (scrollable_widget)->child->requisition.height;
+        GtkRequisition scrollable_widget_req;
+        gtk_widget_get_requisition (gtk_bin_get_child (GTK_BIN (scrollable_widget)), &scrollable_widget_req);
+        *new_height = scrollable_widget_req.height;
 }
 
 static void
 start_grow_animation (GdmChooserWidget *widget)
 {
+        GtkRequisition scrollable_widget_req;
+        gtk_widget_get_requisition (gtk_bin_get_child (GTK_BIN (widget->priv->scrollable_widget)),
+                                    &scrollable_widget_req);
+
         set_inactive_items_visible (widget, TRUE);
 
         gdm_scrollable_widget_slide_to_height (GDM_SCROLLABLE_WIDGET (widget->priv->scrollable_widget),
-                                               GTK_BIN (widget->priv->scrollable_widget)->child->requisition.height,
+                                               scrollable_widget_req.height,
                                                (GdmScrollableWidgetSlideStepFunc)
                                                on_grow_animation_step, widget,
                                                (GdmScrollableWidgetSlideDoneFunc)
@@ -893,7 +902,7 @@ gdm_chooser_widget_grow (GdmChooserWidget *widget)
 
         widget->priv->state = GDM_CHOOSER_WIDGET_STATE_GROWING;
 
-        if (GTK_WIDGET_VISIBLE (widget)) {
+        if (gtk_widget_get_visible (GTK_WIDGET (widget))) {
                 start_grow_animation (widget);
         } else {
                 skip_resize_animation (widget);
@@ -956,7 +965,7 @@ gdm_chooser_widget_shrink (GdmChooserWidget *widget)
 
         widget->priv->state = GDM_CHOOSER_WIDGET_STATE_SHRINKING;
 
-        if (GTK_WIDGET_VISIBLE (widget)) {
+        if (gtk_widget_get_visible (GTK_WIDGET (widget))) {
                 start_shrink_animation (widget);
         } else {
                 skip_resize_animation (widget);
@@ -1125,7 +1134,7 @@ gdm_chooser_widget_get_property (GObject        *object,
                 g_value_set_string (value, self->priv->active_text);
                 break;
         case PROP_LIST_VISIBLE:
-                g_value_set_boolean (value, GTK_WIDGET_VISIBLE (self->priv->scrollable_widget));
+                g_value_set_boolean (value, gtk_widget_get_visible (self->priv->scrollable_widget));
                 break;
         default:
                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -1207,7 +1216,7 @@ gdm_chooser_widget_focus (GtkWidget        *widget,
          *    that focus.
          *    2) if it doesn't already have focus, then grab it
          */
-        if (GTK_CONTAINER (widget)->focus_child != NULL) {
+        if (gtk_container_get_focus_child (GTK_CONTAINER (widget)) != NULL) {
                 g_debug ("GdmChooserWidget: not focusing - focus child not null");
                 return FALSE;
         }
@@ -1775,7 +1784,7 @@ gdm_chooser_widget_init (GdmChooserWidget *widget)
          * works on us.  We then override grab_focus requests to
          * be redirected our internal tree view
          */
-        GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
+        gtk_widget_set_can_focus (GTK_WIDGET (widget), TRUE);
 
         gtk_alignment_set_padding (GTK_ALIGNMENT (widget), 0, 0, 0, 0);
 
diff --git a/gui/simple-greeter/gdm-clock-widget.c b/gui/simple-greeter/gdm-clock-widget.c
index a382c36..7b09c12 100644
--- a/gui/simple-greeter/gdm-clock-widget.c
+++ b/gui/simple-greeter/gdm-clock-widget.c
@@ -212,7 +212,7 @@ gdm_clock_widget_size_request (GtkWidget      *widget,
         gtk_widget_ensure_style (widget);
         context = gtk_widget_get_pango_context (widget);
         metrics = pango_context_get_metrics (context,
-                                             widget->style->font_desc,
+                                             gtk_widget_get_style (widget)->font_desc,
                                              pango_context_get_language (context));
 
         ascent = pango_font_metrics_get_ascent (metrics);
diff --git a/gui/simple-greeter/gdm-greeter-login-window.c b/gui/simple-greeter/gdm-greeter-login-window.c
index 891f2c7..01d26fa 100644
--- a/gui/simple-greeter/gdm-greeter-login-window.c
+++ b/gui/simple-greeter/gdm-greeter-login-window.c
@@ -164,14 +164,14 @@ set_busy (GdmGreeterLoginWindow *login_window)
         GdkCursor *cursor;
 
         cursor = gdk_cursor_new (GDK_WATCH);
-        gdk_window_set_cursor (GTK_WIDGET (login_window)->window, cursor);
+        gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (login_window)), cursor);
         gdk_cursor_unref (cursor);
 }
 
 static void
 set_ready (GdmGreeterLoginWindow *login_window)
 {
-        gdk_window_set_cursor (GTK_WIDGET (login_window)->window, NULL);
+        gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (login_window)), NULL);
 }
 
 static void
@@ -196,11 +196,11 @@ set_focus (GdmGreeterLoginWindow *login_window)
 
         entry = GTK_WIDGET (gtk_builder_get_object (GDM_GREETER_LOGIN_WINDOW (login_window)->priv->builder, "auth-prompt-entry"));
 
-        gdk_window_focus (GTK_WIDGET (login_window)->window, GDK_CURRENT_TIME);
+        gdk_window_focus (gtk_widget_get_window (GTK_WIDGET (login_window)), GDK_CURRENT_TIME);
 
-        if (GTK_WIDGET_REALIZED (entry) && ! GTK_WIDGET_HAS_FOCUS (entry)) {
+        if (gtk_widget_get_realized (entry) && ! gtk_widget_has_focus (entry)) {
                 gtk_widget_grab_focus (entry);
-        } else if (GTK_WIDGET_REALIZED (login_window->priv->user_chooser) && ! GTK_WIDGET_HAS_FOCUS (login_window->priv->user_chooser)) {
+        } else if (gtk_widget_get_realized (login_window->priv->user_chooser) && ! gtk_widget_has_focus (login_window->priv->user_chooser)) {
                 gtk_widget_grab_focus (login_window->priv->user_chooser);
         }
 }
@@ -645,7 +645,7 @@ gdm_greeter_login_window_problem (GdmGreeterLoginWindow *login_window,
         g_debug ("GdmGreeterLoginWindow: problem: %s", text);
 
         set_message (GDM_GREETER_LOGIN_WINDOW (login_window), text);
-        gdk_window_beep (GTK_WIDGET (login_window)->window);
+        gdk_window_beep (gtk_widget_get_window (GTK_WIDGET (login_window)));
 
         return TRUE;
 }
@@ -1232,19 +1232,20 @@ gdm_greeter_login_window_size_request (GtkWidget      *widget,
                 GTK_WIDGET_CLASS (gdm_greeter_login_window_parent_class)->size_request (widget, requisition);
         }
 
-        if (!GTK_WIDGET_REALIZED (widget)) {
+        if (!gtk_widget_get_realized (widget)) {
                 return;
         }
 
         screen = gtk_widget_get_screen (widget);
-        monitor = gdk_screen_get_monitor_at_window (screen, widget->window);
+        monitor = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (widget));
         gdk_screen_get_monitor_geometry (screen, monitor, &area);
 
-        gtk_widget_get_child_requisition (GTK_BIN (widget)->child, &child_requisition);
+        gtk_widget_get_child_requisition (gtk_bin_get_child (GTK_BIN (widget)), &child_requisition);
         *requisition = child_requisition;
 
-        requisition->width += 2 * GTK_CONTAINER (widget)->border_width;
-        requisition->height += 2 * GTK_CONTAINER (widget)->border_width;
+        guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
+        requisition->width += 2 * border_width;
+        requisition->height += 2 * border_width;
 
         /* Make width be at least 33% screen width
          * and height be at most 80% of screen height
@@ -1254,7 +1255,10 @@ gdm_greeter_login_window_size_request (GtkWidget      *widget,
 
        /* Don't ever shrink window width
         */
-       requisition->width = MAX (requisition->width, widget->allocation.width);
+        GtkAllocation widget_allocation;
+        gtk_widget_get_allocation (widget, &widget_allocation);
+
+        requisition->width = MAX (requisition->width, widget_allocation.width);
 }
 
 static void
diff --git a/gui/simple-greeter/gdm-greeter-panel.c b/gui/simple-greeter/gdm-greeter-panel.c
index caade7a..8452fe3 100644
--- a/gui/simple-greeter/gdm-greeter-panel.c
+++ b/gui/simple-greeter/gdm-greeter-panel.c
@@ -220,20 +220,20 @@ gdm_greeter_panel_move_resize_window (GdmGreeterPanel *panel,
 
         widget = GTK_WIDGET (panel);
 
-        g_assert (GTK_WIDGET_REALIZED (widget));
+        g_assert (gtk_widget_get_realized (widget));
 
         if (move && resize) {
-                gdk_window_move_resize (widget->window,
+                gdk_window_move_resize (gtk_widget_get_window (widget),
                                         panel->priv->geometry.x,
                                         panel->priv->geometry.y,
                                         panel->priv->geometry.width,
                                         panel->priv->geometry.height);
         } else if (move) {
-                gdk_window_move (widget->window,
+                gdk_window_move (gtk_widget_get_window (widget),
                                  panel->priv->geometry.x,
                                  panel->priv->geometry.y);
         } else if (resize) {
-                gdk_window_resize (widget->window,
+                gdk_window_resize (gtk_widget_get_window (widget),
                                    panel->priv->geometry.width,
                                    panel->priv->geometry.height);
         }
@@ -309,7 +309,7 @@ set_struts (GdmGreeterPanel *panel,
 
         gdk_error_trap_push ();
 
-        gdk_property_change (GTK_WIDGET (panel)->window,
+        gdk_property_change (gtk_widget_get_window (GTK_WIDGET (panel)),
                              gdk_atom_intern ("_NET_WM_STRUT_PARTIAL", FALSE),
                              gdk_atom_intern ("CARDINAL", FALSE),
                              32,
@@ -317,7 +317,7 @@ set_struts (GdmGreeterPanel *panel,
                              (guchar *) &data,
                              12);
 
-        gdk_property_change (GTK_WIDGET (panel)->window,
+        gdk_property_change (gtk_widget_get_window (GTK_WIDGET (panel)),
                              gdk_atom_intern ("_NET_WM_STRUT", FALSE),
                              gdk_atom_intern ("CARDINAL", FALSE),
                              32,
@@ -333,7 +333,7 @@ update_struts (GdmGreeterPanel *panel)
 {
         GdkRectangle geometry;
 
-        gdk_screen_get_monitor_geometry (GTK_WINDOW (panel)->screen,
+        gdk_screen_get_monitor_geometry (gtk_window_get_screen (GTK_WINDOW (panel)),
                                          panel->priv->monitor,
                                          &geometry);
 
@@ -351,12 +351,12 @@ update_geometry (GdmGreeterPanel *panel,
 {
         GdkRectangle geometry;
 
-        gdk_screen_get_monitor_geometry (GTK_WINDOW (panel)->screen,
+        gdk_screen_get_monitor_geometry (gtk_window_get_screen (GTK_WINDOW (panel)),
                                          panel->priv->monitor,
                                          &geometry);
 
         panel->priv->geometry.width = geometry.width;
-        panel->priv->geometry.height = requisition->height + 2 * GTK_CONTAINER (panel)->border_width;
+        panel->priv->geometry.height = requisition->height + 2 * gtk_container_get_border_width (GTK_CONTAINER (panel));
 
         panel->priv->geometry.x = geometry.x;
         panel->priv->geometry.y = geometry.y + geometry.height - panel->priv->geometry.height + (1.0 - panel->priv->progress) * panel->priv->geometry.height;
@@ -385,8 +385,8 @@ gdm_greeter_panel_real_size_request (GtkWidget      *widget,
         panel = GDM_GREETER_PANEL (widget);
         bin = GTK_BIN (widget);
 
-        if (bin->child && GTK_WIDGET_VISIBLE (bin->child)) {
-                gtk_widget_size_request (bin->child, requisition);
+        if (gtk_bin_get_child (bin) && gtk_widget_get_visible (gtk_bin_get_child (bin))) {
+                gtk_widget_size_request (gtk_bin_get_child (bin), requisition);
         }
 
         old_geometry = panel->priv->geometry;
@@ -396,7 +396,7 @@ gdm_greeter_panel_real_size_request (GtkWidget      *widget,
         requisition->width  = panel->priv->geometry.width;
         requisition->height = panel->priv->geometry.height;
 
-        if (! GTK_WIDGET_REALIZED (widget)) {
+        if (! gtk_widget_get_realized (widget)) {
                 return;
         }
 
@@ -792,17 +792,18 @@ position_shutdown_menu (GtkMenu         *menu,
         GtkRequisition menu_requisition;
         GdkScreen *screen;
         int monitor;
-
+        GtkAllocation shutdown_button_allocation;
+        gtk_widget_get_allocation (panel->priv->shutdown_button, &shutdown_button_allocation);
         *push_in = TRUE;
 
         screen = gtk_widget_get_screen (GTK_WIDGET (panel));
-        monitor = gdk_screen_get_monitor_at_window (screen, GTK_WIDGET (panel)->window);
+        monitor = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (GTK_WIDGET (panel)));
         gtk_menu_set_monitor (menu, monitor);
 
         gtk_widget_translate_coordinates (GTK_WIDGET (panel->priv->shutdown_button),
                                           GTK_WIDGET (panel),
-                                          panel->priv->shutdown_button->allocation.x,
-                                          panel->priv->shutdown_button->allocation.y,
+                                          shutdown_button_allocation.x,
+                                          shutdown_button_allocation.y,
                                           x, y);
 
         gtk_window_get_position (GTK_WINDOW (panel), NULL, y);
@@ -842,7 +843,7 @@ gdm_greeter_panel_init (GdmGreeterPanel *panel)
 
         panel->priv = GDM_GREETER_PANEL_GET_PRIVATE (panel);
 
-        GTK_WIDGET_SET_FLAGS (GTK_WIDGET (panel), GTK_CAN_FOCUS);
+        gtk_widget_set_can_focus (GTK_WIDGET (panel), TRUE);
 
         panel->priv->geometry.x      = -1;
         panel->priv->geometry.y      = -1;
diff --git a/gui/simple-greeter/gdm-language-chooser-dialog.c b/gui/simple-greeter/gdm-language-chooser-dialog.c
index 199659a..d03d6c8 100644
--- a/gui/simple-greeter/gdm-language-chooser-dialog.c
+++ b/gui/simple-greeter/gdm-language-chooser-dialog.c
@@ -86,11 +86,11 @@ gdm_language_chooser_dialog_size_request (GtkWidget      *widget,
         screen_w = gdk_screen_get_width (gtk_widget_get_screen (widget));
         screen_h = gdk_screen_get_height (gtk_widget_get_screen (widget));
 
-        gtk_widget_get_child_requisition (GTK_BIN (widget)->child, &child_requisition);
+        gtk_widget_get_child_requisition (gtk_bin_get_child (GTK_BIN (widget)), &child_requisition);
         *requisition = child_requisition;
 
-        requisition->width += 2 * GTK_CONTAINER (widget)->border_width;
-        requisition->height += 2 * GTK_CONTAINER (widget)->border_width;
+        requisition->width += 2 * gtk_container_get_border_width (GTK_CONTAINER (widget));
+        requisition->height += 2 * gtk_container_get_border_width (GTK_CONTAINER (widget));
 
         requisition->width = MIN (requisition->width, .50 * screen_w);
         requisition->height = MIN (requisition->height, .80 * screen_h);
@@ -157,7 +157,7 @@ gdm_language_chooser_dialog_init (GdmLanguageChooserDialog *dialog)
 
         gdm_language_chooser_widget_set_current_language_name (GDM_LANGUAGE_CHOOSER_WIDGET (dialog->priv->chooser_widget),
                                                                setlocale (LC_MESSAGES, NULL));
-        gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog->priv->chooser_widget);
+        gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), dialog->priv->chooser_widget);
 
         g_signal_connect_swapped (G_OBJECT (dialog->priv->chooser_widget),
                                   "activated", G_CALLBACK (queue_response),
diff --git a/gui/simple-greeter/gdm-layout-chooser-dialog.c b/gui/simple-greeter/gdm-layout-chooser-dialog.c
index 16c39bb..eb5bdc6 100644
--- a/gui/simple-greeter/gdm-layout-chooser-dialog.c
+++ b/gui/simple-greeter/gdm-layout-chooser-dialog.c
@@ -86,11 +86,11 @@ gdm_layout_chooser_dialog_size_request (GtkWidget      *widget,
         screen_w = gdk_screen_get_width (gtk_widget_get_screen (widget));
         screen_h = gdk_screen_get_height (gtk_widget_get_screen (widget));
 
-        gtk_widget_get_child_requisition (GTK_BIN (widget)->child, &child_requisition);
+        gtk_widget_get_child_requisition (gtk_bin_get_child (GTK_BIN (widget)), &child_requisition);
         *requisition = child_requisition;
 
-        requisition->width += 2 * GTK_CONTAINER (widget)->border_width;
-        requisition->height += 2 * GTK_CONTAINER (widget)->border_width;
+        requisition->width += 2 * gtk_container_get_border_width (GTK_CONTAINER (widget));
+        requisition->height += 2 * gtk_container_get_border_width (GTK_CONTAINER (widget));
 
         requisition->width = MIN (requisition->width, .50 * screen_w);
         requisition->height = MIN (requisition->height, .80 * screen_h);
@@ -147,7 +147,7 @@ gdm_layout_chooser_dialog_init (GdmLayoutChooserDialog *dialog)
 
         gdm_layout_chooser_widget_set_current_layout_name (GDM_LAYOUT_CHOOSER_WIDGET (dialog->priv->chooser_widget),
                                                                setlocale (LC_MESSAGES, NULL));
-        gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog->priv->chooser_widget);
+        gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), dialog->priv->chooser_widget);
 
         g_signal_connect_swapped (G_OBJECT (dialog->priv->chooser_widget),
                                   "activated", G_CALLBACK (queue_response),
diff --git a/gui/simple-greeter/gdm-remote-login-window.c b/gui/simple-greeter/gdm-remote-login-window.c
index 7cb2eb3..932571f 100644
--- a/gui/simple-greeter/gdm-remote-login-window.c
+++ b/gui/simple-greeter/gdm-remote-login-window.c
@@ -100,7 +100,7 @@ start_xephyr (GdmRemoteLoginWindow *login_window)
 
         command = g_strdup_printf ("Xephyr -query %s -parent 0x%x -br -once %s",
                                    login_window->priv->hostname,
-                                   (unsigned int)GDK_WINDOW_XID (GTK_WIDGET (login_window)->window),
+                                   (unsigned int)GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (login_window))),
                                    login_window->priv->display);
         g_debug ("GdmRemoteLoginWindow: Running: %s", command);
 
diff --git a/gui/simple-greeter/gdm-scrollable-widget.c b/gui/simple-greeter/gdm-scrollable-widget.c
index d55013d..3ff1c7d 100644
--- a/gui/simple-greeter/gdm-scrollable-widget.c
+++ b/gui/simple-greeter/gdm-scrollable-widget.c
@@ -136,8 +136,8 @@ on_animation_tick (GdmScrollableWidgetAnimation *animation,
 
                 height = animation->desired_height;
 
-                height -= animation->widget->style->ythickness * 2;
-                height -= GTK_CONTAINER (animation->widget)->border_width * 2;
+                height -= gtk_widget_get_style (animation->widget)->ythickness * 2;
+                height -= gtk_container_get_border_width (GTK_CONTAINER (animation->widget)) * 2;
 
                 timer = g_object_ref (animation->timer);
                 animation->step_func (GDM_SCROLLABLE_WIDGET (animation->widget),
@@ -146,8 +146,8 @@ on_animation_tick (GdmScrollableWidgetAnimation *animation,
                                       animation->step_func_user_data);
 
                 if (gdm_timer_is_started (timer)) {
-                        height += animation->widget->style->ythickness * 2;
-                        height += GTK_CONTAINER (animation->widget)->border_width * 2;
+                        height += gtk_widget_get_style (animation->widget)->ythickness * 2;
+                        height += gtk_container_get_border_width (GTK_CONTAINER (animation->widget)) * 2;
 
                         animation->desired_height = height;
                 }
@@ -169,13 +169,13 @@ gdm_scrollable_redirect_input_to_event_sink (GdmScrollableWidget *scrollable_wid
 {
         GdkGrabStatus status;
 
-        status = gdk_pointer_grab (scrollable_widget->priv->invisible_event_sink->window,
+        status = gdk_pointer_grab (gtk_widget_get_window (scrollable_widget->priv->invisible_event_sink),
                           FALSE, 0, NULL, NULL, GDK_CURRENT_TIME);
         if (status != GDK_GRAB_SUCCESS) {
                 return FALSE;
         }
 
-        status = gdk_keyboard_grab (scrollable_widget->priv->invisible_event_sink->window,
+        status = gdk_keyboard_grab (gtk_widget_get_window (scrollable_widget->priv->invisible_event_sink),
                            FALSE, GDK_CURRENT_TIME);
         if (status != GDK_GRAB_SUCCESS) {
                 gdk_pointer_ungrab (GDK_CURRENT_TIME);
@@ -266,13 +266,16 @@ gdm_scrollable_widget_needs_scrollbar (GdmScrollableWidget *widget)
                 return FALSE;
         }
 
-        if (GTK_BIN (widget)->child != NULL) {
+        if (gtk_bin_get_child (GTK_BIN (widget)) != NULL) {
                 GtkRequisition child_requisition;
+                GtkAllocation widget_allocation;
                 int available_height;
 
-                gtk_widget_get_child_requisition (GTK_BIN (widget)->child,
+                gtk_widget_get_allocation (GTK_WIDGET (widget), &widget_allocation);
+
+                gtk_widget_get_child_requisition (gtk_bin_get_child (GTK_BIN (widget)),
                                                   &child_requisition);
-                available_height = GTK_WIDGET (widget)->allocation.height;
+                available_height = widget_allocation.height;
                 needs_scrollbar = child_requisition.height > available_height;
         } else {
                 needs_scrollbar = FALSE;
@@ -291,21 +294,23 @@ gdm_scrollable_widget_size_request (GtkWidget      *widget,
 
         scrollable_widget = GDM_SCROLLABLE_WIDGET (widget);
 
-        requisition->width = 2 * GTK_CONTAINER (widget)->border_width;
-        requisition->height = 2 * GTK_CONTAINER (widget)->border_width;
+        requisition->width = 2 * gtk_container_get_border_width (GTK_CONTAINER (widget));
+        requisition->height = 2 * gtk_container_get_border_width (GTK_CONTAINER (widget));
 
-        requisition->width += 2 * widget->style->xthickness;
-        requisition->height += 2 * widget->style->ythickness;
+        requisition->width += 2 * gtk_widget_get_style (widget)->xthickness;
+        requisition->height += 2 * gtk_widget_get_style (widget)->ythickness;
 
         child_adjustments_stale = FALSE;
-        if (GTK_BIN (widget)->child && GTK_WIDGET_VISIBLE (GTK_BIN (widget)->child)) {
+        GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
+
+         if (child && gtk_widget_get_visible (child)) {
 
                 int old_child_height;
-                gtk_widget_get_child_requisition (GTK_BIN (widget)->child,
+                gtk_widget_get_child_requisition (child,
                                                   &child_requisition);
                 old_child_height = child_requisition.height;
 
-                gtk_widget_size_request (GTK_BIN (widget)->child,
+                gtk_widget_size_request (child,
                                          &child_requisition);
 
                 requisition->width += child_requisition.width;
@@ -345,9 +350,11 @@ gdm_scrollable_widget_size_allocate (GtkWidget     *widget,
 
         scrollable_widget = GDM_SCROLLABLE_WIDGET (widget);
 
-        widget->allocation = *allocation;
+        gtk_widget_set_allocation (widget, allocation);
+
+        GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
 
-        has_child = GTK_BIN (widget)->child && GTK_WIDGET_VISIBLE (GTK_BIN (widget)->child);
+        has_child = child && gtk_widget_get_visible (child);
         needs_scrollbar = gdm_scrollable_widget_needs_scrollbar (scrollable_widget);
         is_flipped = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
 
@@ -361,18 +368,18 @@ gdm_scrollable_widget_size_allocate (GtkWidget     *widget,
 
                 if (!is_flipped) {
                         scrollbar_allocation.x = allocation->x + allocation->width;
-                        scrollbar_allocation.x -= GTK_CONTAINER (widget)->border_width;
+                        scrollbar_allocation.x -= gtk_container_get_border_width (GTK_CONTAINER (widget));
                         scrollbar_allocation.x -= scrollbar_allocation.width;
                 } else {
                         scrollbar_allocation.x = allocation->x;
-                        scrollbar_allocation.x += GTK_CONTAINER (widget)->border_width;
+                        scrollbar_allocation.x += gtk_container_get_border_width (GTK_CONTAINER (widget));
                 }
 
                 scrollbar_allocation.height = allocation->height;
-                scrollbar_allocation.height -= 2 * GTK_CONTAINER (widget)->border_width;
+                scrollbar_allocation.height -= 2 * gtk_container_get_border_width (GTK_CONTAINER (widget));
 
                 scrollbar_allocation.y = allocation->y;
-                scrollbar_allocation.y += GTK_CONTAINER (widget)->border_width;
+                scrollbar_allocation.y += gtk_container_get_border_width (GTK_CONTAINER (widget));
 
                 gtk_widget_size_allocate (scrollable_widget->priv->scrollbar,
                                           &scrollbar_allocation);
@@ -380,8 +387,8 @@ gdm_scrollable_widget_size_allocate (GtkWidget     *widget,
 
         if (has_child) {
                 child_allocation.width = allocation->width;
-                child_allocation.width -= 2 * GTK_CONTAINER (widget)->border_width;
-                child_allocation.width -= 2 * widget->style->xthickness;
+                child_allocation.width -= 2 * gtk_container_get_border_width (GTK_CONTAINER (widget));
+                child_allocation.width -= 2 * gtk_widget_get_style (widget)->xthickness;
 
                 if (needs_scrollbar) {
                         child_allocation.width -= scrollbar_allocation.width;
@@ -389,24 +396,24 @@ gdm_scrollable_widget_size_allocate (GtkWidget     *widget,
 
                 if (!is_flipped) {
                         child_allocation.x = allocation->x;
-                        child_allocation.x += GTK_CONTAINER (widget)->border_width;
-                        child_allocation.x += widget->style->xthickness;
+                        child_allocation.x += gtk_container_get_border_width (GTK_CONTAINER (widget));
+                        child_allocation.x += gtk_widget_get_style (widget)->xthickness;
                 } else {
                         child_allocation.x = allocation->x + allocation->width;
-                        child_allocation.x -= GTK_CONTAINER (widget)->border_width;
+                        child_allocation.x -= gtk_container_get_border_width (GTK_CONTAINER (widget));
                         child_allocation.x -= child_allocation.width;
-                        child_allocation.x -= widget->style->xthickness;
+                        child_allocation.x -= gtk_widget_get_style (widget)->xthickness;
                 }
 
                 child_allocation.height = allocation->height;
-                child_allocation.height -= 2 * GTK_CONTAINER (widget)->border_width;
-                child_allocation.height -= 2 * widget->style->ythickness;
+                child_allocation.height -= 2 * gtk_container_get_border_width (GTK_CONTAINER (widget));
+                child_allocation.height -= 2 * gtk_widget_get_style (widget)->ythickness;
 
                 child_allocation.y = allocation->y;
-                child_allocation.y += GTK_CONTAINER (widget)->border_width;
-                child_allocation.y += widget->style->ythickness;
+                child_allocation.y += gtk_container_get_border_width (GTK_CONTAINER (widget));
+                child_allocation.y += gtk_widget_get_style (widget)->ythickness;
 
-                gtk_widget_size_allocate (GTK_BIN (widget)->child,
+                gtk_widget_size_allocate (child,
                                           &child_allocation);
                 scrollable_widget->priv->child_adjustments_stale = FALSE;
         }
@@ -498,37 +505,42 @@ gdm_scrollable_widget_expose_event (GtkWidget      *widget,
         int                  width;
         int                  height;
         gboolean             is_flipped;
+        GtkAllocation widget_allocation;
+
+        gtk_widget_get_allocation (widget, &widget_allocation);
 
         scrollable_widget = GDM_SCROLLABLE_WIDGET (widget);
 
-        if (!GTK_WIDGET_DRAWABLE (widget)) {
+        if (!gtk_widget_is_drawable (widget)) {
                 return FALSE;
         }
 
         is_flipped = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
 
-        x = widget->allocation.x;
-        x += 2 * GTK_CONTAINER (widget)->border_width;
+        x = widget_allocation.x;
+        x += 2 * gtk_container_get_border_width (GTK_CONTAINER (widget));
 
-        width = widget->allocation.width;
-        width -= 2 * GTK_CONTAINER (widget)->border_width;
+        width = widget_allocation.width;
+        width -= 2 * gtk_container_get_border_width (GTK_CONTAINER (widget));
 
         if (gdm_scrollable_widget_needs_scrollbar (scrollable_widget)) {
-                width -= scrollable_widget->priv->scrollbar->allocation.width;
+                GtkAllocation scrollbar_allocation;
+                gtk_widget_get_allocation (scrollable_widget->priv->scrollbar, &scrollbar_allocation);
+                width -= scrollbar_allocation.width;
 
                 if (is_flipped) {
-                        x += scrollable_widget->priv->scrollbar->allocation.width;
+                        x += scrollbar_allocation.width;
                 }
         }
 
-        y = widget->allocation.y;
-        y += 2 * GTK_CONTAINER (widget)->border_width;
+        y = widget_allocation.y;
+        y += 2 * gtk_container_get_border_width (GTK_CONTAINER (widget));
 
-        height = widget->allocation.height;
-        height -= 2 * GTK_CONTAINER (widget)->border_width;
+        height = widget_allocation.height;
+        height -= 2 * gtk_container_get_border_width (GTK_CONTAINER (widget));
 
-        gtk_paint_shadow (widget->style, widget->window,
-                          GTK_WIDGET_STATE (widget), GTK_SHADOW_IN,
+        gtk_paint_shadow (gtk_widget_get_style (widget), gtk_widget_get_window (widget),
+                          gtk_widget_get_state (widget), GTK_SHADOW_IN,
                           &event->area, widget, "scrolled_window",
                           x, y, width, height);
 
@@ -543,7 +555,7 @@ gdm_scrollable_widget_scroll_event (GtkWidget      *widget,
                 return FALSE;
         }
 
-        if (!GTK_WIDGET_VISIBLE (GTK_WIDGET (widget))) {
+        if (!gtk_widget_get_visible (GTK_WIDGET (widget))) {
                 return FALSE;
         }
 
@@ -749,12 +761,15 @@ gdm_scrollable_widget_slide_to_height (GdmScrollableWidget *scrollable_widget,
                 return;
         }
 
-        height += widget->style->ythickness * 2;
-        height += GTK_CONTAINER (widget)->border_width * 2;
+        height += gtk_widget_get_style (widget)->ythickness * 2;
+        height += gtk_container_get_border_width (GTK_CONTAINER (widget)) * 2;
+
+        GtkAllocation widget_allocation;
+        gtk_widget_get_allocation (widget, &widget_allocation);
 
         scrollable_widget->priv->animation =
             gdm_scrollable_widget_animation_new (widget,
-                                                 widget->allocation.height,
+                                                 widget_allocation.height,
                                                  height, step_func, step_user_data,
                                                  done_func, done_user_data);
 
diff --git a/gui/simple-greeter/gdm-user-chooser-dialog.c b/gui/simple-greeter/gdm-user-chooser-dialog.c
index 4667a68..374c603 100644
--- a/gui/simple-greeter/gdm-user-chooser-dialog.c
+++ b/gui/simple-greeter/gdm-user-chooser-dialog.c
@@ -167,7 +167,7 @@ gdm_user_chooser_dialog_init (GdmUserChooserDialog *dialog)
 
         dialog->priv->chooser_widget = gdm_user_chooser_widget_new ();
 
-        gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog->priv->chooser_widget);
+        gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), dialog->priv->chooser_widget);
 
         gtk_dialog_add_buttons (GTK_DIALOG (dialog),
                                 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
diff --git a/gui/simple-greeter/gdm-user-chooser-widget.c b/gui/simple-greeter/gdm-user-chooser-widget.c
index 77e06a7..c43b0cb 100644
--- a/gui/simple-greeter/gdm-user-chooser-widget.c
+++ b/gui/simple-greeter/gdm-user-chooser-widget.c
@@ -100,7 +100,7 @@ get_font_height_for_widget (GtkWidget *widget)
         gtk_widget_ensure_style (widget);
         context = gtk_widget_get_pango_context (widget);
         metrics = pango_context_get_metrics (context,
-                                             widget->style->font_desc,
+                                             gtk_widget_get_style (widget)->font_desc,
                                              pango_context_get_language (context));
 
         ascent = pango_font_metrics_get_ascent (metrics);
diff --git a/gui/simple-greeter/libnotificationarea/fixedtip.c b/gui/simple-greeter/libnotificationarea/fixedtip.c
index 53ac923..ca36bca 100644
--- a/gui/simple-greeter/libnotificationarea/fixedtip.c
+++ b/gui/simple-greeter/libnotificationarea/fixedtip.c
@@ -58,7 +58,7 @@ expose_handler (GtkWidget *fixedtip)
 
   gtk_widget_size_request (fixedtip, &req);
 
-  gtk_paint_flat_box (fixedtip->style, fixedtip->window,
+  gtk_paint_flat_box (gtk_widget_get_style (fixedtip), gtk_widget_get_window (fixedtip),
                       GTK_STATE_NORMAL, GTK_SHADOW_OUT, 
                       NULL, fixedtip, "tooltip",
                       0, 0, req.width, req.height);
@@ -133,8 +133,8 @@ na_fixed_tip_position (NaFixedTip *fixedtip)
 
   gtk_widget_size_request (GTK_WIDGET (fixedtip), &req);
 
-  gdk_window_get_origin (fixedtip->priv->parent->window, &root_x, &root_y);
-  gdk_drawable_get_size (GDK_DRAWABLE (fixedtip->priv->parent->window),
+  gdk_window_get_origin (gtk_widget_get_window (fixedtip->priv->parent), &root_x, &root_y);
+  gdk_drawable_get_size (GDK_DRAWABLE (gtk_widget_get_window (fixedtip->priv->parent)),
                          &parent_width, &parent_height);
 
   screen_width = gdk_screen_get_width (screen);
@@ -195,7 +195,7 @@ na_fixed_tip_new (GtkWidget      *parent,
   fixedtip = g_object_new (NA_TYPE_FIXED_TIP, NULL);
 
   /* It doesn't work if we do this in na_fixed_tip_init(), so do it here */
-  GTK_WINDOW (fixedtip)->type = GTK_WINDOW_POPUP;
+  gtk_window_set_type_hint (GTK_WINDOW (fixedtip), GTK_WINDOW_POPUP);
 
   fixedtip->priv->parent = parent;
 
diff --git a/gui/simple-greeter/libnotificationarea/na-tray-child.c b/gui/simple-greeter/libnotificationarea/na-tray-child.c
index 98769bd..4f4a334 100644
--- a/gui/simple-greeter/libnotificationarea/na-tray-child.c
+++ b/gui/simple-greeter/libnotificationarea/na-tray-child.c
@@ -52,16 +52,16 @@ na_tray_child_realize (GtkWidget *widget)
 
       /* Set a transparent background */
       GdkColor transparent = { 0, 0, 0, 0 }; /* only pixel=0 matters */
-      gdk_window_set_background (widget->window, &transparent);
-      gdk_window_set_composited (widget->window, TRUE);
+      gdk_window_set_background (gtk_widget_get_window (widget), &transparent);
+      gdk_window_set_composited (gtk_widget_get_window (widget), TRUE);
 
       child->parent_relative_bg = FALSE;
     }
-  else if (visual == gdk_drawable_get_visual (GDK_DRAWABLE (gdk_window_get_parent (widget->window))))
+  else if (visual == gdk_drawable_get_visual (GDK_DRAWABLE (gdk_window_get_parent (gtk_widget_get_window (widget)))))
     {
       /* Otherwise, if the visual matches the visual of the parent window, we
        * can use a parent-relative background and fake transparency. */
-      gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
+      gdk_window_set_back_pixmap (gtk_widget_get_window (widget), NULL, TRUE);
 
       child->parent_relative_bg = TRUE;
     }
@@ -71,7 +71,7 @@ na_tray_child_realize (GtkWidget *widget)
       child->parent_relative_bg = FALSE;
     }
 
-  gdk_window_set_composited (widget->window, child->composited);
+  gdk_window_set_composited (gtk_widget_get_window (widget), child->composited);
 
   gtk_widget_set_app_paintable (GTK_WIDGET (child),
                                 child->parent_relative_bg || child->has_alpha);
@@ -129,10 +129,12 @@ na_tray_child_size_allocate (GtkWidget      *widget,
 {
   NaTrayChild *child = NA_TRAY_CHILD (widget);
 
-  gboolean moved = allocation->x != widget->allocation.x ||
-                   allocation->y != widget->allocation.y;
-  gboolean resized = allocation->width != widget->allocation.width ||
-                     allocation->height != widget->allocation.height;
+  GtkAllocation widget_allocation;
+  gtk_widget_get_allocation (widget, &widget_allocation);
+  gboolean moved = allocation->x != widget_allocation.x ||
+                   allocation->y != widget_allocation.y;
+  gboolean resized = allocation->width != widget_allocation.width ||
+                     allocation->height != widget_allocation.height;
 
   /* When we are allocating the widget while mapped we need special handling
    * for both real and fake transparency.
@@ -144,21 +146,21 @@ na_tray_child_size_allocate (GtkWidget      *widget,
    * Fake transparency: if the widget moved, we need to force the contents to
    *   be redrawn with the new offset for the parent-relative background.
    */
-  if ((moved || resized) && GTK_WIDGET_MAPPED (widget))
+  if ((moved || resized) && gtk_widget_get_mapped (widget))
     {
       if (na_tray_child_has_alpha (child))
-        gdk_window_invalidate_rect (gdk_window_get_parent (widget->window),
-                                    &widget->allocation, FALSE);
+        gdk_window_invalidate_rect (gdk_window_get_parent (gtk_widget_get_window (widget)),
+                                    &widget_allocation, FALSE);
     }
 
   GTK_WIDGET_CLASS (na_tray_child_parent_class)->size_allocate (widget,
                                                                 allocation);
 
-  if ((moved || resized) && GTK_WIDGET_MAPPED (widget))
+  if ((moved || resized) && gtk_widget_get_mapped (widget))
     {
       if (na_tray_child_has_alpha (NA_TRAY_CHILD (widget)))
-        gdk_window_invalidate_rect (gdk_window_get_parent (widget->window),
-                                    &widget->allocation, FALSE);
+        gdk_window_invalidate_rect (gdk_window_get_parent (gtk_widget_get_window (widget)),
+                                    &widget_allocation, FALSE);
       else if (moved && child->parent_relative_bg)
         na_tray_child_force_redraw (child);
     }
@@ -177,7 +179,7 @@ na_tray_child_expose_event (GtkWidget      *widget,
   if (na_tray_child_has_alpha (child))
     {
       /* Clear to transparent */
-      cairo_t *cr = gdk_cairo_create (widget->window);
+      cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (widget));
       cairo_set_source_rgba (cr, 0, 0, 0, 0);
       cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
       gdk_cairo_region (cr, event->region);
@@ -187,7 +189,7 @@ na_tray_child_expose_event (GtkWidget      *widget,
   else if (child->parent_relative_bg)
     {
       /* Clear to parent-relative pixmap */
-      gdk_window_clear_area (widget->window,
+      gdk_window_clear_area (gtk_widget_get_window (widget),
                              event->area.x, event->area.y,
                              event->area.width, event->area.height);
     }
@@ -378,8 +380,8 @@ na_tray_child_set_composited (NaTrayChild *child,
     return;
 
   child->composited = composited;
-  if (GTK_WIDGET_REALIZED (child))
-    gdk_window_set_composited (GTK_WIDGET (child)->window, composited);
+  if (gtk_widget_get_realized (GTK_WIDGET (child)))
+    gdk_window_set_composited (gtk_widget_get_window (GTK_WIDGET (child)), composited);
 }
 
 /* If we are faking transparency with a window-relative background, force a
@@ -391,7 +393,7 @@ na_tray_child_force_redraw (NaTrayChild *child)
 {
   GtkWidget *widget = GTK_WIDGET (child);
 
-  if (GTK_WIDGET_MAPPED (child) && child->parent_relative_bg)
+  if (gtk_widget_get_mapped (child) && child->parent_relative_bg)
     {
 #if 1
       /* Sending an ExposeEvent might cause redraw problems if the
@@ -401,12 +403,15 @@ na_tray_child_force_redraw (NaTrayChild *child)
       Display *xdisplay = GDK_DISPLAY_XDISPLAY (gtk_widget_get_display (widget));
       XEvent xev;
 
+      GtkAllocation widget_allocation;
+      gtk_widget_get_allocation (widget, &widget_allocation);
+
       xev.xexpose.type = Expose;
-      xev.xexpose.window = GDK_WINDOW_XWINDOW (GTK_SOCKET (child)->plug_window);
+      xev.xexpose.window = GDK_WINDOW_XWINDOW (gtk_socket_get_plug_window (GTK_SOCKET (child)));
       xev.xexpose.x = 0;
       xev.xexpose.y = 0;
-      xev.xexpose.width = widget->allocation.width;
-      xev.xexpose.height = widget->allocation.height;
+      xev.xexpose.width = widget_allocation.width;
+      xev.xexpose.height = widget_allocation.height;
       xev.xexpose.count = 0;
 
       gdk_error_trap_push ();
@@ -423,8 +428,8 @@ na_tray_child_force_redraw (NaTrayChild *child)
       /* Hiding and showing is the safe way to do it, but can result in more
        * flickering.
        */
-      gdk_window_hide (widget->window);
-      gdk_window_show (widget->window);
+      gdk_window_hide (gtk_widget_get_window (widget));
+      gdk_window_show (gtk_widget_get_window (widget));
 #endif
     }
 }
diff --git a/gui/simple-greeter/libnotificationarea/na-tray-manager.c b/gui/simple-greeter/libnotificationarea/na-tray-manager.c
index d49c646..9618253 100644
--- a/gui/simple-greeter/libnotificationarea/na-tray-manager.c
+++ b/gui/simple-greeter/libnotificationarea/na-tray-manager.c
@@ -296,7 +296,7 @@ na_tray_manager_handle_dock_request (NaTrayManager       *manager,
 
   gtk_socket_add_id (GTK_SOCKET (child), icon_window);
 
-  if (!GTK_SOCKET (child)->plug_window)
+  if (!gtk_socket_get_plug_window (GTK_SOCKET (child)))
     {
       /* Embedding failed, we won't get a plug-removed signal */
       g_signal_emit (manager, manager_signals[TRAY_ICON_REMOVED], 0, child);
@@ -545,15 +545,15 @@ na_tray_manager_unmanage (NaTrayManager *manager)
 
   invisible = manager->invisible;
   g_assert (GTK_IS_INVISIBLE (invisible));
-  g_assert (GTK_WIDGET_REALIZED (invisible));
-  g_assert (GDK_IS_WINDOW (invisible->window));
+  g_assert (gtk_widget_get_realized (invisible));
+  g_assert (GDK_IS_WINDOW (gtk_widget_get_window (invisible)));
   
   display = gtk_widget_get_display (invisible);
   
   if (gdk_selection_owner_get_for_display (display, manager->selection_atom) ==
-      invisible->window)
+      gtk_widget_get_window (invisible))
     {
-      timestamp = gdk_x11_get_server_time (invisible->window);      
+      timestamp = gdk_x11_get_server_time (gtk_widget_get_window (invisible));
       gdk_selection_owner_set_for_display (display,
                                            NULL,
                                            manager->selection_atom,
@@ -564,7 +564,7 @@ na_tray_manager_unmanage (NaTrayManager *manager)
   //FIXME: we should also use gdk_remove_client_message_filter when it's
   //available
   // See bug #351254
-  gdk_window_remove_filter (invisible->window,
+  gdk_window_remove_filter (gtk_widget_get_window (invisible),
                             na_tray_manager_window_filter, manager);  
 
   manager->invisible = NULL; /* prior to destroy for reentrancy paranoia */
@@ -581,7 +581,7 @@ na_tray_manager_set_orientation_property (NaTrayManager *manager)
   Atom        orientation_atom;
   gulong      data[1];
 
-  if (!manager->invisible || !manager->invisible->window)
+  if (!manager->invisible || !gtk_widget_get_window (manager->invisible))
     return;
 
   display = gtk_widget_get_display (manager->invisible);
@@ -593,7 +593,7 @@ na_tray_manager_set_orientation_property (NaTrayManager *manager)
 		SYSTEM_TRAY_ORIENTATION_VERT;
 
   XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
-		   GDK_WINDOW_XWINDOW (manager->invisible->window),
+		   GDK_WINDOW_XWINDOW (gtk_widget_get_window (manager->invisible)),
                    orientation_atom,
 		   XA_CARDINAL, 32,
 		   PropModeReplace,
@@ -610,7 +610,7 @@ na_tray_manager_set_visual_property (NaTrayManager *manager)
   Atom        visual_atom;
   gulong      data[1];
 
-  if (!manager->invisible || !manager->invisible->window)
+  if (!manager->invisible || !gtk_widget_get_window (manager->invisible))
     return;
 
   /* The visual property is a hint to the tray icons as to what visual they
@@ -645,7 +645,7 @@ na_tray_manager_set_visual_property (NaTrayManager *manager)
   data[0] = XVisualIDFromVisual (xvisual);
 
   XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
-                   GDK_WINDOW_XWINDOW (manager->invisible->window),
+                   GDK_WINDOW_XWINDOW (gtk_widget_get_window (manager->invisible)),
                    visual_atom,
                    XA_VISUALID, 32,
                    PropModeReplace,
@@ -661,7 +661,7 @@ na_tray_manager_set_padding_property (NaTrayManager *manager)
   Atom        orientation_atom;
   gulong      data[1];
 
-  if (!manager->invisible || !manager->invisible->window)
+  if (!manager->invisible || !gtk_widget_get_window (manager->invisible))
     return;
 
   display = gtk_widget_get_display (manager->invisible);
@@ -671,7 +671,7 @@ na_tray_manager_set_padding_property (NaTrayManager *manager)
   data[0] = manager->padding;
 
   XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
-		   GDK_WINDOW_XWINDOW (manager->invisible->window),
+		   GDK_WINDOW_XWINDOW (gtk_widget_get_window (manager->invisible)),
                    orientation_atom,
 		   XA_CARDINAL, 32,
 		   PropModeReplace,
@@ -725,11 +725,11 @@ na_tray_manager_manage_screen_x11 (NaTrayManager *manager,
   na_tray_manager_set_visual_property (manager);
   na_tray_manager_set_padding_property (manager);
   
-  timestamp = gdk_x11_get_server_time (invisible->window);
+  timestamp = gdk_x11_get_server_time (gtk_widget_get_window(invisible));
 
   /* Check if we could set the selection owner successfully */
   if (gdk_selection_owner_set_for_display (display,
-                                           invisible->window,
+                                           gtk_widget_get_window(invisible),
                                            manager->selection_atom,
                                            timestamp,
                                            TRUE))
@@ -747,7 +747,7 @@ na_tray_manager_manage_screen_x11 (NaTrayManager *manager,
       xev.data.l[0] = timestamp;
       xev.data.l[1] = gdk_x11_atom_to_xatom_for_display (display,
                                                          manager->selection_atom);
-      xev.data.l[2] = GDK_WINDOW_XWINDOW (invisible->window);
+      xev.data.l[2] = GDK_WINDOW_XWINDOW (gtk_widget_get_window(invisible));
       xev.data.l[3] = 0;	/* manager specific data */
       xev.data.l[4] = 0;	/* manager specific data */
 
@@ -770,7 +770,7 @@ na_tray_manager_manage_screen_x11 (NaTrayManager *manager,
                         manager);
 #endif
       /* This is for SYSTEM_TRAY_REQUEST_DOCK and SelectionClear */
-      gdk_window_add_filter (invisible->window,
+      gdk_window_add_filter (gtk_widget_get_window(invisible),
                              na_tray_manager_window_filter, manager);
       /* This is for SYSTEM_TRAY_BEGIN_MESSAGE and SYSTEM_TRAY_CANCEL_MESSAGE */
       gdk_display_add_client_message_filter (display, opcode_atom,
diff --git a/gui/simple-greeter/libnotificationarea/na-tray.c b/gui/simple-greeter/libnotificationarea/na-tray.c
index 40845c1..f8f40b0 100644
--- a/gui/simple-greeter/libnotificationarea/na-tray.c
+++ b/gui/simple-greeter/libnotificationarea/na-tray.c
@@ -343,7 +343,7 @@ icon_tip_show_next (IconTip *icontip)
 
   na_fixed_tip_set_markup (icontip->fixedtip, buffer->text);
 
-  if (!GTK_WIDGET_MAPPED (icontip->fixedtip))
+  if (!gtk_widget_get_mapped (icontip->fixedtip))
     gtk_widget_show (icontip->fixedtip);
 
   icontip->id = buffer->id;
@@ -515,9 +515,12 @@ na_tray_expose_icon (GtkWidget *widget,
 
   if (na_tray_child_has_alpha (NA_TRAY_CHILD (widget)))
     {
-      gdk_cairo_set_source_pixmap (cr, widget->window,
-				   widget->allocation.x,
-				   widget->allocation.y);
+      GtkAllocation widget_allocation;
+      gtk_widget_get_allocation (widget, &widget_allocation);
+
+      gdk_cairo_set_source_pixmap (cr, gtk_widget_get_window (widget),
+				   widget_allocation.x,
+				   widget_allocation.y);
       cairo_paint (cr);
     }
 }
@@ -526,7 +529,7 @@ static void
 na_tray_expose_box (GtkWidget      *box,
 		    GdkEventExpose *event)
 {
-  cairo_t *cr = gdk_cairo_create (box->window);
+  cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (box));
 
   gdk_cairo_region (cr, event->region);
   cairo_clip (cr);
diff --git a/gui/simple-greeter/libnotificationarea/testtray.c b/gui/simple-greeter/libnotificationarea/testtray.c
index c0300b6..11449fa 100644
--- a/gui/simple-greeter/libnotificationarea/testtray.c
+++ b/gui/simple-greeter/libnotificationarea/testtray.c
@@ -53,7 +53,7 @@ update_child_count (TrayData *data)
   guint n_children = 0;
   char text[64];
 
-  if (!GTK_WIDGET_REALIZED (data->window))
+  if (!gtk_widget_get_realized (GTK_WIDGET (data)))
     return;
 
   gtk_container_foreach (GTK_CONTAINER (data->box), (GtkCallback) do_add, &n_children);
@@ -177,7 +177,7 @@ create_tray_on_screen (GdkScreen *screen,
   data->tray = na_tray_new_for_screen (screen, GTK_ORIENTATION_HORIZONTAL);
   gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (data->tray), TRUE, TRUE, 0);
 
-  data->box = GTK_BIN (GTK_BIN (data->tray)->child)->child;
+  data->box = gtk_bin_get_child (GTK_BIN (gtk_bin_get_child (GTK_BIN (data->tray))));
   g_signal_connect_after (data->box, "add", G_CALLBACK (tray_added_cb), data);
   g_signal_connect_after (data->box, "remove", G_CALLBACK (tray_removed_cb), data);
 
diff --git a/gui/user-switch-applet/applet.c b/gui/user-switch-applet/applet.c
index 5d73283..c240479 100644
--- a/gui/user-switch-applet/applet.c
+++ b/gui/user-switch-applet/applet.c
@@ -22,6 +22,7 @@
 
 #include <string.h>
 #include <unistd.h>
+#include <stdlib.h>
 #include <sys/types.h>
 
 #include <glib/gi18n.h>
@@ -329,7 +330,7 @@ applet_change_background_cb (PanelApplet               *applet,
                 gtk_widget_modify_bg (adata->menubar, GTK_STATE_NORMAL, color);
                 break;
         case PANEL_PIXMAP_BACKGROUND:
-                style = gtk_style_copy (adata->menubar->style);
+                style = gtk_style_copy (gtk_widget_get_style (adata->menubar));
                 if (style->bg_pixmap[GTK_STATE_NORMAL]) {
                         g_object_unref (style->bg_pixmap[GTK_STATE_NORMAL]);
                 }
@@ -393,7 +394,7 @@ set_item_text_angle_and_alignment (GtkWidget *item,
 {
         GtkWidget *label;
 
-        label = GTK_BIN (item)->child;
+        label = gtk_bin_get_child (GTK_BIN (item));
 
         gtk_label_set_angle (GTK_LABEL (label), text_angle);
 
@@ -436,11 +437,11 @@ applet_size_allocate_cb (GtkWidget     *widget,
         case PANEL_APPLET_ORIENT_UP:
         case PANEL_APPLET_ORIENT_DOWN:
                 gtk_widget_set_size_request (top_item, -1, allocation->height);
-                pixel_size = allocation->height - top_item->style->ythickness * 2;
+                pixel_size = allocation->height - gtk_widget_get_style (top_item)->ythickness * 2;
                 break;
         case PANEL_APPLET_ORIENT_LEFT:
                 gtk_widget_set_size_request (top_item, allocation->width, -1);
-                pixel_size = allocation->width - top_item->style->xthickness * 2;
+                pixel_size = allocation->width - gtk_widget_get_style (top_item)->xthickness * 2;
                 pack_direction = GTK_PACK_DIRECTION_TTB;
                 text_angle = 270.0;
                 text_xalign = 0.5;
@@ -448,7 +449,7 @@ applet_size_allocate_cb (GtkWidget     *widget,
                 break;
         case PANEL_APPLET_ORIENT_RIGHT:
                 gtk_widget_set_size_request (top_item, allocation->width, -1);
-                pixel_size = allocation->width - top_item->style->xthickness * 2;
+                pixel_size = allocation->width - gtk_widget_get_style (top_item)->xthickness * 2;
                 pack_direction = GTK_PACK_DIRECTION_BTT;
                 text_angle = 90.0;
                 text_xalign = 0.5;
@@ -512,8 +513,10 @@ menubar_expose_event_cb (GtkWidget      *widget,
                          GdkEventExpose *event,
                          GdmAppletData  *adata)
 {
-        if (GTK_WIDGET_HAS_FOCUS (adata->applet))
-                gtk_paint_focus (widget->style, widget->window, GTK_WIDGET_STATE (widget),
+        if (gtk_widget_has_focus (GTK_WIDGET (adata->applet)))
+                gtk_paint_focus (gtk_widget_get_style (widget),
+                                 gtk_widget_get_window (widget),
+                                 gtk_widget_get_state (widget),
                                  NULL, widget, "menu-applet", 0, 0, -1, -1);
 
         return FALSE;
@@ -1309,7 +1312,7 @@ setup_current_user (GdmAppletData *adata)
         gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (adata->menuitem),
                                        gtk_image_new ());
 #endif
-        label = GTK_BIN (adata->menuitem)->child;
+        label = gtk_bin_get_child (GTK_BIN (adata->menuitem));
         gtk_menu_shell_append (GTK_MENU_SHELL (adata->menubar), adata->menuitem);
         gtk_widget_show (adata->menuitem);
 
diff --git a/gui/user-switch-applet/gdm-entry-menu-item.c b/gui/user-switch-applet/gdm-entry-menu-item.c
index 7a87a5a..d657e7a 100644
--- a/gui/user-switch-applet/gdm-entry-menu-item.c
+++ b/gui/user-switch-applet/gdm-entry-menu-item.c
@@ -110,14 +110,10 @@ send_focus_change (GtkWidget *widget,
 
         g_object_ref (widget);
 
-        if (in) {
-                GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
-        } else {
-                GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
-        }
+        gtk_widget_set_can_focus (widget, in);
 
         fevent->focus_change.type = GDK_FOCUS_CHANGE;
-        fevent->focus_change.window = g_object_ref (widget->window);
+        fevent->focus_change.window = g_object_ref (gtk_widget_get_window (widget));
         fevent->focus_change.in = in;
 
         gtk_widget_event (widget, fevent);
@@ -136,11 +132,11 @@ gdm_entry_menu_item_button_press (GtkWidget      *widget,
 
         entry = GDM_ENTRY_MENU_ITEM (widget)->entry;
 
-        if (entry->window != NULL) {
-                gdk_window_raise (entry->window);
+        if (gtk_widget_get_window (entry) != NULL) {
+                gdk_window_raise (gtk_widget_get_window (entry));
         }
 
-        if (!GTK_WIDGET_HAS_FOCUS (entry)) {
+        if (!gtk_widget_has_focus (entry)) {
                 gtk_widget_grab_focus (entry);
         }
 
@@ -201,8 +197,8 @@ static void
 on_entry_show (GtkWidget        *widget,
                GdmEntryMenuItem *item)
 {
-        if (widget->window != NULL) {
-                gdk_window_raise (widget->window);
+        if (gtk_widget_get_window (widget) != NULL) {
+                gdk_window_raise (gtk_widget_get_window (widget));
         }
         send_focus_change (widget, TRUE);
 }
@@ -215,7 +211,7 @@ on_text_buffer_changed (GtkTextBuffer    *buffer,
 
         len = gtk_text_buffer_get_char_count (buffer);
         if (len > TEXT_BUFFER_MAX_CHARS) {
-                gdk_window_beep (GTK_WIDGET (item)->window);
+                gdk_window_beep (gtk_widget_get_window (GTK_WIDGET (item)));
         }
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]