[evince] [shell] Fix build with GSEAL_ENABLE



commit 80aa207c49dda77a013f0df2a2e2a393062a96b6
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Wed Mar 31 21:09:00 2010 +0200

    [shell] Fix build with GSEAL_ENABLE

 shell/eggfindbar.c                  |    2 +-
 shell/ev-application.c              |   19 +++++++++++++++----
 shell/ev-convert-metadata.c         |    6 ++++--
 shell/ev-message-area.c             |    6 +++---
 shell/ev-navigation-action-widget.c |   26 +++++++++++++++-----------
 shell/ev-navigation-action.c        |    4 ++--
 shell/ev-password-view.c            |   13 ++++++++-----
 shell/ev-properties-dialog.c        |    9 ++++++---
 shell/ev-sidebar-links.c            |    2 +-
 shell/ev-sidebar-thumbnails.c       |   12 +++++++++---
 shell/ev-sidebar.c                  |   16 ++++++++++------
 shell/ev-utils.c                    |    8 +++++---
 shell/ev-window.c                   |    8 +++++---
 13 files changed, 84 insertions(+), 47 deletions(-)
---
diff --git a/shell/eggfindbar.c b/shell/eggfindbar.c
index 5b196ec..c9bba4b 100644
--- a/shell/eggfindbar.c
+++ b/shell/eggfindbar.c
@@ -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
diff --git a/shell/ev-application.c b/shell/ev-application.c
index b14a8a4..0623194 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -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
diff --git a/shell/ev-convert-metadata.c b/shell/ev-convert-metadata.c
index 9f24ed0..dc9fbe8 100644
--- a/shell/ev-convert-metadata.c
+++ b/shell/ev-convert-metadata.c
@@ -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);
diff --git a/shell/ev-message-area.c b/shell/ev-message-area.c
index a182303..6ff00f8 100644
--- a/shell/ev-message-area.c
+++ b/shell/ev-message-area.c
@@ -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);
diff --git a/shell/ev-navigation-action-widget.c b/shell/ev-navigation-action-widget.c
index a9a6023..465a474 100644
--- a/shell/ev-navigation-action-widget.c
+++ b/shell/ev-navigation-action-widget.c
@@ -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; 
 
diff --git a/shell/ev-navigation-action.c b/shell/ev-navigation-action.c
index a2dc636..8df22a9 100644
--- a/shell/ev-navigation-action.c
+++ b/shell/ev-navigation-action.c
@@ -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);
 
diff --git a/shell/ev-password-view.c b/shell/ev-password-view.c
index 4935b67..d123253 100644
--- a/shell/ev-password-view.c
+++ b/shell/ev-password-view.c
@@ -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,
diff --git a/shell/ev-properties-dialog.c b/shell/ev-properties-dialog.c
index c829b3c..7ac3012 100644
--- a/shell/ev-properties-dialog.c
+++ b/shell/ev-properties-dialog.c
@@ -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",
diff --git a/shell/ev-sidebar-links.c b/shell/ev-sidebar-links.c
index 569fdd5..1c3afff 100644
--- a/shell/ev-sidebar-links.c
+++ b/shell/ev-sidebar-links.c
@@ -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",
diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c
index ad2c09f..b60aa71 100644
--- a/shell/ev-sidebar-thumbnails.c
+++ b/shell/ev-sidebar-thumbnails.c
@@ -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,
diff --git a/shell/ev-sidebar.c b/shell/ev-sidebar.c
index 23d51f9..fd977e0 100644
--- a/shell/ev-sidebar.c
+++ b/shell/ev-sidebar.c
@@ -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,
diff --git a/shell/ev-utils.c b/shell/ev-utils.c
index 8c94f6e..916cc18 100644
--- a/shell/ev-utils.c
+++ b/shell/ev-utils.c
@@ -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);
diff --git a/shell/ev-window.c b/shell/ev-window.c
index bd4097a..a9a8736 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -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) {



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