[seahorse-plugins] Fix nearly everything to compile with -DGSEAL_ENABLE. See bug 612495.



commit 99a43608516ce12829070e2ef569d35d2ebc98c3
Author: Andre Klapper <a9016009 gmx de>
Date:   Tue Apr 13 19:27:57 2010 +0200

    Fix nearly everything to compile with -DGSEAL_ENABLE. See bug 612495.

 agent/seahorse-agent-prompt.c     |    6 +++---
 libseahorse/seahorse-passphrase.c |   12 ++++++------
 libseahorse/seahorse-util.c       |   10 ++++++----
 plugins/applet/seahorse-applet.c  |   16 +++++++++-------
 4 files changed, 24 insertions(+), 20 deletions(-)
---
diff --git a/agent/seahorse-agent-prompt.c b/agent/seahorse-agent-prompt.c
index b69b773..83b2696 100644
--- a/agent/seahorse-agent-prompt.c
+++ b/agent/seahorse-agent-prompt.c
@@ -275,7 +275,7 @@ create_auth_window (SeahorseAgentPassReq *pr)
     gtk_container_add (GTK_CONTAINER (bbox), w);
     g_signal_connect (G_OBJECT (w), "clicked", G_CALLBACK (auth_cancel_button), pr);
 
-    GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
+    gtk_widget_set_can_default (w, TRUE);
 
     w = gtk_button_new_from_stock (GTK_STOCK_OK);
     gtk_button_set_label (GTK_BUTTON (w), _("_Authorize"));
@@ -283,13 +283,13 @@ create_auth_window (SeahorseAgentPassReq *pr)
     gtk_container_add (GTK_CONTAINER (bbox), w);
 
     g_signal_connect (G_OBJECT (w), "clicked", G_CALLBACK (auth_ok_button), pr);
-    GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
+    gtk_widget_set_can_default (w, TRUE);
     gtk_widget_grab_default (w);
 
     gtk_window_set_position (GTK_WINDOW (win), GTK_WIN_POS_CENTER);
     gtk_window_set_keep_above(GTK_WINDOW (win), TRUE);
     gtk_widget_show_all (win);
-    gdk_window_focus (win->window, GDK_CURRENT_TIME);
+    gdk_window_focus (gtk_widget_get_window (win), GDK_CURRENT_TIME);
     return win;
 }
 
diff --git a/libseahorse/seahorse-passphrase.c b/libseahorse/seahorse-passphrase.c
index e2dcfc3..658d276 100644
--- a/libseahorse/seahorse-passphrase.c
+++ b/libseahorse/seahorse-passphrase.c
@@ -95,7 +95,7 @@ grab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data)
 #ifndef _DEBUG
 	GdkGrabStatus status;
 	if (!g_object_get_data (G_OBJECT (win), "keyboard-grabbed")) {
-		status = gdk_keyboard_grab (win->window, FALSE, gdk_event_get_time (event)); 
+		status = gdk_keyboard_grab (gtk_widget_get_window (win), FALSE, gdk_event_get_time (event)); 
 		if (status == GDK_GRAB_SUCCESS)
 			g_object_set_data (G_OBJECT (win), "keyboard-grabbed", GINT_TO_POINTER (TRUE));
 		else
@@ -149,7 +149,7 @@ entry_changed (GtkEditable *editable, GtkDialog *dialog)
 static gboolean
 window_state_changed (GtkWidget *win, GdkEventWindowState *event, gpointer data)
 {
-	GdkWindowState state = gdk_window_get_state (win->window);
+	GdkWindowState state = gdk_window_get_state (gtk_widget_get_window (win));
 	
 	if (state & GDK_WINDOW_STATE_WITHDRAWN ||
 	    state & GDK_WINDOW_STATE_ICONIFIED ||
@@ -213,7 +213,7 @@ seahorse_passphrase_prompt_show (const gchar *title, const gchar *description,
     g_signal_connect (G_OBJECT (dialog), "window-state-event", G_CALLBACK (window_state_changed), NULL); 
 
     wvbox = gtk_vbox_new (FALSE, HIG_LARGE * 2);
-    gtk_container_add (GTK_CONTAINER (dialog->vbox), wvbox);
+    gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (dialog)), wvbox);
     gtk_container_set_border_width (GTK_CONTAINER (wvbox), HIG_LARGE);
 
     chbox = gtk_hbox_new (FALSE, HIG_LARGE);
@@ -295,11 +295,11 @@ seahorse_passphrase_prompt_show (const gchar *title, const gchar *description,
     
     w = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
     gtk_dialog_add_action_widget (dialog, w, GTK_RESPONSE_REJECT);
-    GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
+    gtk_widget_set_can_default (w, TRUE);
 
     w = gtk_button_new_from_stock (GTK_STOCK_OK);
     gtk_dialog_add_action_widget (dialog, w, GTK_RESPONSE_ACCEPT);
-    GTK_WIDGET_SET_FLAGS (w, GTK_CAN_DEFAULT);
+    gtk_widget_set_can_default (w, TRUE);
     g_signal_connect_object (G_OBJECT (entry), "focus_in_event",
                              G_CALLBACK (gtk_widget_grab_default), G_OBJECT (w), 0);
     gtk_widget_grab_default (w);
@@ -311,7 +311,7 @@ seahorse_passphrase_prompt_show (const gchar *title, const gchar *description,
     gtk_window_set_type_hint (GTK_WINDOW (dialog), GDK_WINDOW_TYPE_HINT_NORMAL);
     gtk_window_set_keep_above (GTK_WINDOW (dialog), TRUE);
     gtk_widget_show_all (GTK_WIDGET (dialog));
-    gdk_window_focus (GTK_WIDGET (dialog)->window, GDK_CURRENT_TIME);
+    gdk_window_focus (gtk_widget_get_window (GTK_WIDGET (dialog)), GDK_CURRENT_TIME);
 
     if (confirm)
         entry_changed (NULL, dialog);
diff --git a/libseahorse/seahorse-util.c b/libseahorse/seahorse-util.c
index 20fddbc..4cb7e9a 100644
--- a/libseahorse/seahorse-util.c
+++ b/libseahorse/seahorse-util.c
@@ -1083,6 +1083,7 @@ seahorse_util_determine_popup_menu_position (GtkMenu *menu, int *x, int *y,
 {
         GtkWidget      *widget;
         GtkRequisition  requisition;
+        GtkAllocation   allocation;
         gint            menu_xpos;
         gint            menu_ypos;
 
@@ -1090,16 +1091,17 @@ seahorse_util_determine_popup_menu_position (GtkMenu *menu, int *x, int *y,
 
         gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
 
-        gdk_window_get_origin (widget->window, &menu_xpos, &menu_ypos);
+        gdk_window_get_origin (gtk_widget_get_window (widget), &menu_xpos, &menu_ypos);
 
-        menu_xpos += widget->allocation.x;
-        menu_ypos += widget->allocation.y;
+        gtk_widget_get_allocation (widget, &allocation);
+        menu_xpos += allocation.x;
+        menu_ypos += allocation.y;
 
 
         if (menu_ypos > gdk_screen_get_height (gtk_widget_get_screen (widget)) / 2)
                 menu_ypos -= requisition.height;
         else
-                menu_ypos += widget->allocation.height;
+                menu_ypos += allocation.height;
            
         *x = menu_xpos;
         *y = menu_ypos;
diff --git a/plugins/applet/seahorse-applet.c b/plugins/applet/seahorse-applet.c
index bde93b8..3e3e6a0 100644
--- a/plugins/applet/seahorse-applet.c
+++ b/plugins/applet/seahorse-applet.c
@@ -339,7 +339,7 @@ display_text (gchar *title, gchar *text, gboolean editable)
                               G_CALLBACK (gtk_widget_destroy), dialog);
 
     scrolled_window = gtk_scrolled_window_new (NULL, NULL);
-    gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), scrolled_window);
+    gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), scrolled_window);
 
     text_view = gtk_text_view_new ();
     gtk_text_view_set_editable (GTK_TEXT_VIEW (text_view), editable);
@@ -751,16 +751,18 @@ seahorse_popup_position_menu (GtkMenu *menu, int *x, int *y, gboolean *push_in,
 {
     GtkWidget *widget;
     GtkRequisition requisition;
+    GtkAllocation allocation;
     gint menu_xpos;
     gint menu_ypos;
 
     widget = GTK_WIDGET (gdata);
 
     gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
-    gdk_window_get_origin (widget->window, &menu_xpos, &menu_ypos);
+    gdk_window_get_origin (gtk_widget_get_window (widget), &menu_xpos, &menu_ypos);
 
-    menu_xpos += widget->allocation.x;
-    menu_ypos += widget->allocation.y;
+    gtk_widget_get_allocation (widget, &allocation);
+    menu_xpos += allocation.x;
+    menu_ypos += allocation.y;
 
     switch (panel_applet_get_orient (PANEL_APPLET (widget))) {
     case PANEL_APPLET_ORIENT_DOWN:
@@ -768,14 +770,14 @@ seahorse_popup_position_menu (GtkMenu *menu, int *x, int *y, gboolean *push_in,
         if (menu_ypos > gdk_screen_get_height (gtk_widget_get_screen (widget)) / 2)
             menu_ypos -= requisition.height;
         else
-            menu_ypos += widget->allocation.height;
+            menu_ypos += allocation.height;
         break;
     case PANEL_APPLET_ORIENT_RIGHT:
     case PANEL_APPLET_ORIENT_LEFT:
         if (menu_xpos > gdk_screen_get_width (gtk_widget_get_screen (widget)) / 2)
             menu_xpos -= requisition.width;
         else
-            menu_xpos += widget->allocation.width;
+            menu_xpos += allocation.width;
         break;
     default:
         g_assert_not_reached ();
@@ -926,7 +928,7 @@ seahorse_applet_change_background (PanelApplet *applet, PanelAppletBackgroundTyp
         gtk_widget_modify_bg (GTK_WIDGET (applet), GTK_STATE_NORMAL, colour);
         break;
     case PANEL_PIXMAP_BACKGROUND:
-        style = gtk_style_copy (GTK_WIDGET (applet)->style);
+        style = gtk_style_copy (gtk_widget_get_style (GTK_WIDGET (applet)));
 
         if (style->bg_pixmap[GTK_STATE_NORMAL])
             g_object_unref (style->bg_pixmap[GTK_STATE_NORMAL]);



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