]> www.fi.muni.cz Git - evince.git/commitdiff
[shell] Fix build with GSEAL_ENABLE
authorCarlos Garcia Campos <carlosgc@gnome.org>
Wed, 31 Mar 2010 19:09:00 +0000 (21:09 +0200)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Wed, 31 Mar 2010 19:09:00 +0000 (21:09 +0200)
13 files changed:
shell/eggfindbar.c
shell/ev-application.c
shell/ev-convert-metadata.c
shell/ev-message-area.c
shell/ev-navigation-action-widget.c
shell/ev-navigation-action.c
shell/ev-password-view.c
shell/ev-properties-dialog.c
shell/ev-sidebar-links.c
shell/ev-sidebar-thumbnails.c
shell/ev-sidebar.c
shell/ev-utils.c
shell/ev-window.c

index 5b196ec1299f56ecad2cf943a530301352c7ee31..c9bba4b15f11eaae71522a6f6659b422953e5d0e 100644 (file)
@@ -280,7 +280,7 @@ set_focus_cb (GtkWidget *window,
 
   while (widget != NULL && widget != wbar)
     {
-      widget = widget->parent;
+      widget = gtk_widget_get_parent (widget);
     }
 
   /* if widget == bar, the new focus widget is in the bar, so we
index b14a8a403869a02cbd5a593e305cd3065dad00af..062319435c1d2b0974e293c56923f47d742b0a07 100644 (file)
@@ -610,6 +610,10 @@ ev_application_open_uri_in_window (EvApplication  *application,
                                   const gchar    *search_string,
                                   guint           timestamp)
 {
+#ifdef GDK_WINDOWING_X11
+       GdkWindow *gdk_window;
+#endif
+
        if (screen) {
                ev_stock_icons_set_screen (screen);
                gtk_window_set_screen (GTK_WINDOW (ev_window), screen);
@@ -623,9 +627,11 @@ ev_application_open_uri_in_window (EvApplication  *application,
                gtk_widget_realize (GTK_WIDGET (ev_window));
 
 #ifdef GDK_WINDOWING_X11
+       gdk_window = gtk_widget_get_window (GTK_WIDGET (ev_window));
+
        if (timestamp <= 0)
-               timestamp = gdk_x11_get_server_time (GTK_WIDGET (ev_window)->window);
-       gdk_x11_window_set_user_time (GTK_WIDGET (ev_window)->window, timestamp);
+               timestamp = gdk_x11_get_server_time (gdk_window);
+       gdk_x11_window_set_user_time (gdk_window, timestamp);
 
        ev_document_fc_mutex_lock ();
        gtk_window_present (GTK_WINDOW (ev_window));
@@ -703,6 +709,9 @@ ev_application_open_window (EvApplication *application,
                            guint32        timestamp)
 {
        GtkWidget *new_window = ev_window_new ();
+#ifdef GDK_WINDOWING_X11
+       GdkWindow *gdk_window;
+#endif
 
        if (screen) {
                ev_stock_icons_set_screen (screen);
@@ -713,9 +722,11 @@ ev_application_open_window (EvApplication *application,
                gtk_widget_realize (new_window);
 
 #ifdef GDK_WINDOWING_X11
+       gdk_window = gtk_widget_get_window (GTK_WIDGET (new_window));
+
        if (timestamp <= 0)
-               timestamp = gdk_x11_get_server_time (new_window->window);
-       gdk_x11_window_set_user_time (new_window->window, timestamp);
+               timestamp = gdk_x11_get_server_time (gdk_window);
+       gdk_x11_window_set_user_time (gdk_window, timestamp);
 
        gtk_window_present (GTK_WINDOW (new_window));
 #else
index 9f24ed01a47cbd19c64d016f6f822a2160adae5d..dc9fbe8adf028f9e70025f76cc1aa6424690af8c 100644 (file)
@@ -156,6 +156,7 @@ static void
 show_progress_dialog (ConvertData *data)
 {
        GtkWidget *dialog;
+       GtkWidget *action_area;
        GtkWidget *vbox, *pbox;
        GtkWidget *label;
        GtkWidget *progress;
@@ -166,9 +167,10 @@ show_progress_dialog (ConvertData *data)
                                              GTK_DIALOG_NO_SEPARATOR,
                                              GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                                              NULL);
+       action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
        gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
-       gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5);
-       gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6);
+       gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+       gtk_box_set_spacing (GTK_BOX (action_area), 6);
 
        vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
        gtk_box_set_spacing (GTK_BOX (vbox), 12);
index a182303ad40320459075f0d816c90d08958fb4a7..6ff00f807aae6f1936c122d9ffbdaae568f89a0f 100644 (file)
@@ -106,7 +106,7 @@ ev_message_area_init (EvMessageArea *area)
        gtk_label_set_line_wrap (GTK_LABEL (area->priv->label), TRUE);
        gtk_label_set_selectable (GTK_LABEL (area->priv->label), TRUE);
        gtk_misc_set_alignment (GTK_MISC (area->priv->label), 0.0, 0.5);
-       GTK_WIDGET_SET_FLAGS (area->priv->label, GTK_CAN_FOCUS);
+       gtk_widget_set_can_focus (area->priv->label, TRUE);
        gtk_box_pack_start (GTK_BOX (vbox), area->priv->label, TRUE, TRUE, 0);
        gtk_widget_show (area->priv->label);
 
@@ -115,7 +115,7 @@ ev_message_area_init (EvMessageArea *area)
        gtk_label_set_line_wrap (GTK_LABEL (area->priv->secondary_label), TRUE);
        gtk_label_set_selectable (GTK_LABEL (area->priv->secondary_label), TRUE);
        gtk_misc_set_alignment (GTK_MISC (area->priv->secondary_label), 0.0, 0.5);
-       GTK_WIDGET_SET_FLAGS (area->priv->secondary_label, GTK_CAN_FOCUS);
+       gtk_widget_set_can_focus (area->priv->secondary_label, TRUE);
        gtk_box_pack_start (GTK_BOX (vbox), area->priv->secondary_label, TRUE, TRUE, 0);
 
        area->priv->image = gtk_image_new_from_stock (NULL, GTK_ICON_SIZE_DIALOG);
@@ -291,7 +291,7 @@ ev_message_area_set_image (EvMessageArea *area,
 
        area->priv->message_type = GTK_MESSAGE_OTHER;
 
-       parent = area->priv->image->parent;
+       parent = gtk_widget_get_parent (area->priv->image);
        gtk_container_add (GTK_CONTAINER (parent), image);
        gtk_container_remove (GTK_CONTAINER (parent), area->priv->image);
        gtk_box_reorder_child (GTK_BOX (parent), image, 0);
index a9a602336625eee506b3fba793dd992fccaf9aee..465a474fe071597d1b63e2b17a0f1c88f3992cac 100644 (file)
@@ -127,7 +127,9 @@ menu_position_func (GtkMenu           *menu,
 {
        GtkWidget *widget = GTK_WIDGET (button);
        GtkRequisition menu_req;
+       GtkAllocation  allocation;
        GtkTextDirection direction;
+       GdkWindow *gdk_window;
        GdkRectangle monitor;
        gint monitor_num;
        GdkScreen *screen;
@@ -136,26 +138,28 @@ menu_position_func (GtkMenu           *menu,
        direction = gtk_widget_get_direction (widget);
        screen = gtk_widget_get_screen (GTK_WIDGET (menu));
 
-       monitor_num = gdk_screen_get_monitor_at_window (screen, widget->window);
+       gdk_window = gtk_widget_get_window (widget);
+       monitor_num = gdk_screen_get_monitor_at_window (screen, gdk_window);
        if (monitor_num < 0)
                monitor_num = 0;
        gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
 
-       gdk_window_get_origin (widget->window, x, y);
-       *x += widget->allocation.x;
-       *y += widget->allocation.y;
+       gdk_window_get_origin (gdk_window, x, y);
+       gtk_widget_get_allocation (widget, &allocation);
+       *x += allocation.x;
+       *y += allocation.y;
 
        if (direction == GTK_TEXT_DIR_LTR)
-               *x += MAX (widget->allocation.width - menu_req.width, 0);
-       else if (menu_req.width > widget->allocation.width)
-               *x -= menu_req.width - widget->allocation.width;
+               *x += MAX (allocation.width - menu_req.width, 0);
+       else if (menu_req.width > allocation.width)
+               *x -= menu_req.width - allocation.width;
 
-       if ((*y + widget->allocation.height + menu_req.height) <= monitor.y + monitor.height)
-               *y += widget->allocation.height;
+       if ((*y + allocation.height + menu_req.height) <= monitor.y + monitor.height)
+               *y += allocation.height;
        else if ((*y - menu_req.height) >= monitor.y)
                *y -= menu_req.height;
-       else if (monitor.y + monitor.height - (*y + widget->allocation.height) > *y)
-               *y += widget->allocation.height;
+       else if (monitor.y + monitor.height - (*y + allocation.height) > *y)
+               *y += allocation.height;
        else
                *y -= menu_req.height; 
 
index a2dc6364088159c91a2337aa9bb779eee92d872f..8df22a9dfb945156c212d489d026ff835fd89f0e 100644 (file)
@@ -102,11 +102,11 @@ new_history_menu_item (EvNavigationAction *action,
 
        title = ev_link_get_title (link);
        item = gtk_image_menu_item_new_with_label (title);
-       gtk_label_set_use_markup (GTK_LABEL (gtk_bin_get_child (GTK_BIN (item))), TRUE);
+       label = GTK_LABEL (gtk_bin_get_child (GTK_BIN (item)));
+       gtk_label_set_use_markup (label, TRUE);
        g_object_set_data (G_OBJECT (item), "index",
                           GINT_TO_POINTER (index));
 
-       label = GTK_LABEL (GTK_BIN (item)->child);
        gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_END);
        gtk_label_set_max_width_chars (label, MAX_LABEL_LENGTH);
 
index 4935b67b6db3b01c633e62ac8cb241b1b60c7df0..d12325300e2a2b52b706ec98835ec303df9e8ca7 100644 (file)
@@ -241,6 +241,7 @@ void
 ev_password_view_ask_password (EvPasswordView *password_view)
 {
        GtkDialog *dialog;
+       GtkWidget *content_area, *action_area;
        GtkWidget *entry_container;
        GtkWidget *hbox, *main_vbox, *vbox, *icon;
        GtkWidget *table;
@@ -250,13 +251,15 @@ ev_password_view_ask_password (EvPasswordView *password_view)
        gtk_widget_set_sensitive (GTK_WIDGET (password_view), FALSE);
        
        dialog = GTK_DIALOG (gtk_dialog_new ());
-       
+       content_area = gtk_dialog_get_content_area (dialog);
+       action_area = gtk_dialog_get_action_area (dialog);
+
        /* Set the dialog up with HIG properties */
        gtk_dialog_set_has_separator (dialog, FALSE);
        gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
-       gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
-       gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5);
-       gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
+       gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
+       gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+       gtk_box_set_spacing (GTK_BOX (action_area), 6);
 
        gtk_window_set_title (GTK_WINDOW (dialog), _("Enter password"));
        gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
@@ -279,7 +282,7 @@ ev_password_view_ask_password (EvPasswordView *password_view)
        /* Build contents */
        hbox = gtk_hbox_new (FALSE, 12);
        gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
-       gtk_box_pack_start (GTK_BOX (dialog->vbox), hbox, TRUE, TRUE, 0);
+       gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE, 0);
        gtk_widget_show (hbox);
 
        icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION,
index c829b3c6a4718803cd3657245d8484d018067f1b..7ac3012ca574fde87fad0ca5c0ae268c356ff813 100644 (file)
@@ -55,11 +55,15 @@ ev_properties_dialog_class_init (EvPropertiesDialogClass *properties_class)
 static void
 ev_properties_dialog_init (EvPropertiesDialog *properties)
 {
+       GtkBox *content_area;
+
+       content_area = GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (properties)));
+
        gtk_window_set_title (GTK_WINDOW (properties), _("Properties"));
        gtk_window_set_destroy_with_parent (GTK_WINDOW (properties), TRUE);
        gtk_dialog_set_has_separator (GTK_DIALOG (properties), FALSE);
        gtk_container_set_border_width (GTK_CONTAINER (properties), 5);
-       gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (properties)->vbox), 2);
+       gtk_box_set_spacing (content_area, 2);
 
        gtk_dialog_add_button (GTK_DIALOG (properties), GTK_STOCK_CLOSE,
                               GTK_RESPONSE_CANCEL);
@@ -68,8 +72,7 @@ ev_properties_dialog_init (EvPropertiesDialog *properties)
 
        properties->notebook = gtk_notebook_new ();
        gtk_container_set_border_width (GTK_CONTAINER (properties->notebook), 5);
-       gtk_box_pack_start (GTK_BOX (GTK_DIALOG (properties)->vbox),
-                           properties->notebook, TRUE, TRUE, 0);
+       gtk_box_pack_start (content_area, properties->notebook, TRUE, TRUE, 0);
        gtk_widget_show (properties->notebook);
 
        g_signal_connect (properties, "response",
index 569fdd5161541eb5ec7010199645b31abb113eb7..1c3afff06137a1a20f3a6147b44992cd39d06d6e 100644 (file)
@@ -332,7 +332,7 @@ build_popup_menu (EvSidebarLinks *sidebar)
 
        menu = gtk_menu_new ();
        item = gtk_image_menu_item_new_from_stock (GTK_STOCK_PRINT, NULL);
-       gtk_label_set_label (GTK_LABEL (GTK_BIN (item)->child), _("Print…"));
+       gtk_label_set_label (GTK_LABEL (gtk_bin_get_child (GTK_BIN (item))), _("Print…"));
        gtk_widget_show (item);
        gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
        g_signal_connect (item, "activate",
index ad2c09f2a1c8f46827c85586dd92f3877485bfc5..b60aa71970cce7c5a97a247d53ab80bfb193cf72 100644 (file)
@@ -499,6 +499,8 @@ adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails)
        EvSidebarThumbnailsPrivate *priv = sidebar_thumbnails->priv;
        GtkTreePath *path = NULL;
        GtkTreePath *path2 = NULL;
+       gdouble page_size;
+       gdouble value;
        gint wy1;
        gint wy2;
 
@@ -506,18 +508,22 @@ adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails)
        if (!gtk_widget_get_mapped (GTK_WIDGET (sidebar_thumbnails)))
                return;
 
-       if (priv->vadjustment->page_size == 0)
+       page_size = gtk_adjustment_get_page_size (priv->vadjustment);
+
+       if (page_size == 0)
                return;
+
+       value = gtk_adjustment_get_value (priv->vadjustment);
        
        if (priv->tree_view) {
                if (! gtk_widget_get_realized (priv->tree_view))
                        return;
 
                gtk_tree_view_convert_tree_to_bin_window_coords (GTK_TREE_VIEW (priv->tree_view),
-                                                                0, (int) priv->vadjustment->value,
+                                                                0, (int) value,
                                                                 NULL, &wy1);
                gtk_tree_view_convert_tree_to_bin_window_coords (GTK_TREE_VIEW (priv->tree_view),
-                                                                0, (int) (priv->vadjustment->value + priv->vadjustment->page_size),
+                                                                0, (int) (value + page_size),
                                                                 NULL, &wy2);
                gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (priv->tree_view),
                                               1, wy1 + 1, &path,
index 23d51f99b2e3fb704c12f43096f71d06509a8be4..fd977e0656f819e9575595a2de68d32a5ae5b3a0 100644 (file)
@@ -205,17 +205,19 @@ ev_sidebar_menu_position_under (GtkMenu  *menu,
                                gboolean *push_in,
                                gpointer  user_data)
 {
-       GtkWidget *widget;
+       GtkWidget    *widget;
+       GtkAllocation allocation;
 
        g_return_if_fail (GTK_IS_BUTTON (user_data));
        g_return_if_fail (!gtk_widget_get_has_window (GTK_WIDGET (user_data)));
 
        widget = GTK_WIDGET (user_data);
           
-       gdk_window_get_origin (widget->window, x, y);
+       gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
+       gtk_widget_get_allocation (widget, &allocation);
           
-       *x += widget->allocation.x;
-       *y += widget->allocation.y + widget->allocation.height;
+       *x += allocation.x;
+       *y += allocation.y + allocation.height;
           
        *push_in = FALSE;
 }
@@ -229,9 +231,11 @@ ev_sidebar_select_button_press_cb (GtkWidget      *widget,
 
        if (event->button == 1) {
                GtkRequisition requisition;
+               GtkAllocation allocation;
                gint width;
-               
-               width = widget->allocation.width;
+
+               gtk_widget_get_allocation (widget, &allocation);
+               width = allocation.width;
                gtk_widget_set_size_request (ev_sidebar->priv->menu, -1, -1);
                gtk_widget_size_request (ev_sidebar->priv->menu, &requisition);
                gtk_widget_set_size_request (ev_sidebar->priv->menu,
index 8c94f6e1180a89c316d8769520a902fea5a24fbc..916cc18bb7cc3e3df744c703a360c30457c82920 100644 (file)
@@ -247,16 +247,18 @@ ev_gui_menu_position_tree_selection (GtkMenu   *menu,
        GtkTreeView *tree_view = GTK_TREE_VIEW (user_data);
        GtkWidget *widget = GTK_WIDGET (user_data);
        GtkRequisition req;
+       GtkAllocation allocation;
        GdkRectangle visible;
 
        gtk_widget_size_request (GTK_WIDGET (menu), &req);
-       gdk_window_get_origin (widget->window, x, y);
+       gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
+       gtk_widget_get_allocation (widget, &allocation);
 
-       *x += (widget->allocation.width - req.width) / 2;
+       *x += (allocation.width - req.width) / 2;
 
        /* Add on height for the treeview title */
        gtk_tree_view_get_visible_rect (tree_view, &visible);
-       *y += widget->allocation.height - visible.height;
+       *y += allocation.height - visible.height;
 
        selection = gtk_tree_view_get_selection (tree_view);
        selected_rows = gtk_tree_selection_get_selected_rows (selection, &model);
index bd4097ae7918f9a8f0d9a69c303c890746e8acf3..a9a8736c6f4dcfb06b7924e37164f0b986c49021 100644 (file)
@@ -3813,6 +3813,7 @@ ev_window_cmd_edit_toolbar (GtkAction *action, EvWindow *ev_window)
 {
        GtkWidget          *dialog;
        GtkWidget          *editor;
+       GtkWidget          *content_area;
        EggEditableToolbar *toolbar;
 
        dialog = gtk_dialog_new_with_buttons (_("Toolbar Editor"),
@@ -3821,9 +3822,10 @@ ev_window_cmd_edit_toolbar (GtkAction *action, EvWindow *ev_window)
                                              GTK_STOCK_CLOSE,
                                              GTK_RESPONSE_CLOSE,
                                              NULL);
+       content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
        gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
        gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)), 5);
-       gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2);
+       gtk_box_set_spacing (GTK_BOX (content_area), 2);
        gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
        gtk_window_set_default_size (GTK_WINDOW (dialog), 500, 400);
 
@@ -3834,7 +3836,7 @@ ev_window_cmd_edit_toolbar (GtkAction *action, EvWindow *ev_window)
        gtk_container_set_border_width (GTK_CONTAINER (editor), 5);
        gtk_box_set_spacing (GTK_BOX (EGG_TOOLBAR_EDITOR (editor)), 5);
 
-       gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), editor);
+       gtk_container_add (GTK_CONTAINER (content_area), editor);
 
        egg_editable_toolbar_set_edit_mode (toolbar, TRUE);
 
@@ -5410,7 +5412,7 @@ window_configure_event_cb (EvWindow *window, GdkEventConfigure *event, gpointer
        if (!window->priv->metadata)
                return FALSE;
 
-       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_FULLSCREEN)) {
                if (!ev_window_is_empty (window) && window->priv->document) {