evince r3242 - in trunk: . backend/pdf properties shell



Author: carlosgc
Date: Fri Oct 31 17:40:28 2008
New Revision: 3242
URL: http://svn.gnome.org/viewvc/evince?rev=3242&view=rev

Log:
2008-10-31  Carlos Garcia Campos  <carlosgc gnome org>

	* configure.ac:
	* backend/pdf/ev-poppler.cc:
	* properties/ev-properties-view.c:
	* shell/Makefile.am:
	* shell/ev-tooltip.[ch]: Removed
	* shell/ev-view-private.h
	* shell/eggfindbar.c:
	* shell/ev-application.c:
	* shell/ev-open-recent-action.c:
	* shell/ev-sidebar-thumbnails.c:
	* shell/ev-view.c:
	* shell/ev-window.c:

	Bump GTK+ requirement to 2.12.

Removed:
   trunk/shell/ev-tooltip.c
   trunk/shell/ev-tooltip.h
Modified:
   trunk/ChangeLog
   trunk/backend/pdf/ev-poppler.cc
   trunk/configure.ac
   trunk/properties/ev-properties-view.c
   trunk/shell/Makefile.am
   trunk/shell/eggfindbar.c
   trunk/shell/ev-application.c
   trunk/shell/ev-open-recent-action.c
   trunk/shell/ev-sidebar-thumbnails.c
   trunk/shell/ev-view-private.h
   trunk/shell/ev-view.c
   trunk/shell/ev-window.c

Modified: trunk/backend/pdf/ev-poppler.cc
==============================================================================
--- trunk/backend/pdf/ev-poppler.cc	(original)
+++ trunk/backend/pdf/ev-poppler.cc	Fri Oct 31 17:40:28 2008
@@ -1664,11 +1664,9 @@
 		EV_FILE_EXPORTER_CAN_SCALE |
 #ifdef HAVE_CAIRO_PRINT
 #ifdef HAVE_POPPLER_PAGE_RENDER
-#if GTK_CHECK_VERSION (2, 11, 1)
 		EV_FILE_EXPORTER_CAN_NUMBER_UP |
 #endif
 #endif
-#endif
 		
 #ifdef HAVE_CAIRO_PDF
 #ifdef HAVE_POPPLER_PAGE_RENDER

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Fri Oct 31 17:40:28 2008
@@ -45,7 +45,7 @@
 # SHELL_LIBS
 
 DBUS_GLIB_REQUIRED=0.70
-GTK_REQUIRED=2.10.0
+GTK_REQUIRED=2.12.0
 GLIB_REQUIRED=2.15.6
 KEYRING_REQUIRED=0.4.0
 

Modified: trunk/properties/ev-properties-view.c
==============================================================================
--- trunk/properties/ev-properties-view.c	(original)
+++ trunk/properties/ev-properties-view.c	Fri Oct 31 17:40:28 2008
@@ -192,7 +192,6 @@
 	g_free (valid_text);
 }
 
-#if GTK_CHECK_VERSION (2, 11, 0)
 static GtkUnit
 get_default_user_units (void)
 {
@@ -297,141 +296,6 @@
 	
 	return exact_size;
 }
-#else /* ! GTK 2.11.0 */
-/*
- * All values are in mm. 
- * Source: http://en.wikipedia.org/wiki/Paper_size
- */
-struct regular_paper_size {
-	double width;
-	double height;
-	double width_tolerance;
-	double height_tolerance;
-	const char *description;
-} const regular_paper_sizes[] = {
-	// ISO 216 paper sizes
-	{  841.0f, 1189.0f, 3.0f, 3.0f, "A0"  },
-	{  594.0f,  841.0f, 2.0f, 3.0f, "A1"  },
-	{  420.0f,  594.0f, 2.0f, 2.0f, "A2"  },
-	{  297.0f,  420.0f, 2.0f, 2.0f, "A3"  },
-	{  210.0f,  297.0f, 2.0f, 2.0f, "A4"  },
-	{  148.0f,  210.0f, 1.5f, 2.0f, "A5"  },
-	{  105.0f,  148.0f, 1.5f, 1.5f, "A6"  },
-	{   74.0f,  105.0f, 1.5f, 1.5f, "A7"  },
-	{   52.0f,   74.0f, 1.5f, 1.5f, "A8"  },
-	{   37.0f,   52.0f, 1.5f, 1.5f, "A9"  },
-	{   26.0f,   37.0f, 1.5f, 1.5f, "A10" },
-	{ 1000.0f, 1414.0f, 3.0f, 3.0f, "B0"  },
-	{  707.0f, 1000.0f, 3.0f, 3.0f, "B1"  },
-	{  500.0f,  707.0f, 2.0f, 3.0f, "B2"  },
-	{  353.0f,  500.0f, 2.0f, 2.0f, "B3"  },
-	{  250.0f,  353.0f, 2.0f, 2.0f, "B4"  },
-	{  176.0f,  250.0f, 2.0f, 2.0f, "B5"  },
-	{  125.0f,  176.0f, 1.5f, 2.0f, "B6"  },
-	{   88.0f,  125.0f, 1.5f, 1.5f, "B7"  },
-	{   62.0f,   88.0f, 1.5f, 1.5f, "B8"  },
-	{   44.0f,   62.0f, 1.5f, 1.5f, "B9"  },
-	{   31.0f,   44.0f, 1.5f, 1.5f, "B10" },
-	{  917.0f, 1297.0f, 3.0f, 3.0f, "C0"  },
-	{  648.0f,  917.0f, 3.0f, 3.0f, "C1"  },
-	{  458.0f,  648.0f, 2.0f, 3.0f, "C2"  },
-	{  324.0f,  458.0f, 2.0f, 2.0f, "C3"  },
-	{  229.0f,  324.0f, 2.0f, 2.0f, "C4"  },
-	{  162.0f,  229.0f, 2.0f, 2.0f, "C5"  },
-	{  114.0f,  162.0f, 1.5f, 2.0f, "C6"  },
-	{   81.0f,  114.0f, 1.5f, 1.5f, "C7"  },
-	{   57.0f,   81.0f, 1.5f, 1.5f, "C8"  },
-	{   40.0f,   57.0f, 1.5f, 1.5f, "C9"  },
-	{   28.0f,   40.0f, 1.5f, 1.5f, "C10" },
-
-	// US paper sizes
-	{  279.0f,  216.0f, 3.0f, 3.0f, "Letter" },
-	{  356.0f,  216.0f, 3.0f, 3.0f, "Legal"  },
-	{  432.0f,  279.0f, 3.0f, 3.0f, "Ledger" }
-};
-
-typedef enum {
-  EV_UNIT_INCH,
-  EV_UNIT_MM
-} EvUnit; 
-
-static EvUnit
-ev_get_default_user_units (void)
-{
-  /* Translate to the default units to use for presenting
-   * lengths to the user. Translate to default:inch if you
-   * want inches, otherwise translate to default:mm.
-   * Do *not* translate it to "predefinito:mm", if it
-   * it isn't default:mm or default:inch it will not work
-   */
-  gchar *e = _("default:mm");
-
-#ifdef HAVE__NL_MEASUREMENT_MEASUREMENT
-  gchar *imperial = NULL;
-
-  imperial = nl_langinfo (_NL_MEASUREMENT_MEASUREMENT);
-  if (imperial && imperial[0] == 2 )
-    return EV_UNIT_INCH;  /* imperial */
-  if (imperial && imperial[0] == 1 )
-    return EV_UNIT_MM;  /* metric */
-#endif
-
-  if (strcmp (e, "default:inch")==0)
-    return EV_UNIT_INCH;
-  else if (strcmp (e, "default:mm"))
-    g_warning ("Whoever translated default:mm did so wrongly.\n");
-  return EV_UNIT_MM;
-}
-
-static char *
-ev_regular_paper_size (const EvDocumentInfo *info)
-{
-	const struct regular_paper_size *size;   
-	EvUnit unit;
-	char *exact_size = NULL;
-	char *str = NULL;
-	int i;
-
-	unit = ev_get_default_user_units ();	
-
-	if (unit == EV_UNIT_INCH)
-		/* Imperial measurement (inches) */
-		exact_size = g_strdup_printf( _("%.2f x %.2f in"),
-					      info->paper_width  / 25.4f,
-					      info->paper_height / 25.4f );
-	else
-		/* Metric measurement (millimeters) */
-		exact_size = g_strdup_printf( _("%.0f x %.0f mm"),
-					      info->paper_width,
-					      info->paper_height );
-	
-	for (i = G_N_ELEMENTS ( regular_paper_sizes ) - 1; i >= 0; i--) {
-		size = &regular_paper_sizes[i];
-
-		if ( ABS( info->paper_height - size->height ) <= size->height_tolerance &&
-		     ABS( info->paper_width  - size->width  ) <= size->width_tolerance ) {
-			/* Note to translators: first placeholder is the paper name (eg.
-			 * A4), second placeholder is the paper size (eg. 297x210 mm) */
-			str = g_strdup_printf ( _("%s, Portrait (%s)"),
-						size->description,
-						exact_size );
-		} else if ( ABS( info->paper_width  - size->height ) <= size->height_tolerance &&
-			    ABS( info->paper_height - size->width  ) <= size->width_tolerance ) {
-			/* Note to translators: first placeholder is the paper name (eg.
-			 * A4), second placeholder is the paper size (eg. 297x210 mm) */
-			str = g_strdup_printf ( _("%s, Landscape (%s)"),
-						size->description,
-						exact_size );
-		}
-	}
-
-	if (str != NULL) {
-		g_free (exact_size);
-		return str;
-	} else
-		return exact_size;
-}
-#endif /* GTK 2.11.0 */
 
 void
 ev_properties_view_set_info (EvPropertiesView *properties, const EvDocumentInfo *info)

Modified: trunk/shell/Makefile.am
==============================================================================
--- trunk/shell/Makefile.am	(original)
+++ trunk/shell/Makefile.am	Fri Oct 31 17:40:28 2008
@@ -91,8 +91,6 @@
 	ev-stock-icons.h		\
 	ev-timeline.c			\
 	ev-timeline.h			\
-	ev-tooltip.c			\
-	ev-tooltip.h			\
 	ev-transition-animation.c	\
 	ev-transition-animation.h	\
 	main.c

Modified: trunk/shell/eggfindbar.c
==============================================================================
--- trunk/shell/eggfindbar.c	(original)
+++ trunk/shell/eggfindbar.c	Fri Oct 31 17:40:28 2008
@@ -328,27 +328,15 @@
   arrow = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE);
   priv->previous_button = gtk_tool_button_new (arrow, Q_("Find Previous"));
   gtk_tool_item_set_is_important (priv->previous_button, TRUE);
-#if GTK_CHECK_VERSION (2, 11, 5)
   gtk_widget_set_tooltip_text (GTK_WIDGET (priv->previous_button),
 			       _("Find previous occurrence of the search string"));
-#else
-  gtk_tool_item_set_tooltip (priv->previous_button, GTK_TOOLBAR (find_bar)->tooltips,
-		             _("Find previous occurrence of the search string"),
-		             NULL);
-#endif
 
   /* Next */
   arrow = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
   priv->next_button = gtk_tool_button_new (arrow, Q_("Find Next"));
   gtk_tool_item_set_is_important (priv->next_button, TRUE);
-#if GTK_CHECK_VERSION (2, 11, 5)
   gtk_widget_set_tooltip_text (GTK_WIDGET (priv->next_button),
 			       _("Find next occurrence of the search string"));
-#else
-  gtk_tool_item_set_tooltip (priv->next_button, GTK_TOOLBAR (find_bar)->tooltips,
-		             _("Find next occurrence of the search string"),
-		             NULL);
-#endif
 
   /* Separator*/
   priv->status_separator = gtk_separator_tool_item_new();
@@ -357,14 +345,9 @@
   priv->case_button = gtk_toggle_tool_button_new ();
   g_object_set (G_OBJECT (priv->case_button), "label", _("C_ase Sensitive"), NULL);
   gtk_tool_item_set_is_important (priv->case_button, TRUE);
-#if GTK_CHECK_VERSION (2, 11, 5)
   gtk_widget_set_tooltip_text (GTK_WIDGET (priv->case_button),
 			       _("Toggle case sensitive search"));
-#else  
-  gtk_tool_item_set_tooltip (priv->case_button, GTK_TOOLBAR (find_bar)->tooltips,
-		             _("Toggle case sensitive search"),
-		             NULL);
-#endif
+
   /* Status */
   priv->status_item = gtk_tool_item_new();
   gtk_tool_item_set_expand (priv->status_item, TRUE);

Modified: trunk/shell/ev-application.c
==============================================================================
--- trunk/shell/ev-application.c	(original)
+++ trunk/shell/ev-application.c	Fri Oct 31 17:40:28 2008
@@ -69,9 +69,7 @@
 #endif /* ENABLE_DBUS */
 
 	GtkPrintSettings *print_settings;
-#if GTK_CHECK_VERSION (2, 11, 0)
 	gchar            *print_settings_file;
-#endif
 };
 
 struct _EvApplicationClass {
@@ -696,7 +694,6 @@
 		application->toolbars_file = NULL;
 	}
 
-#if GTK_CHECK_VERSION (2, 11, 0)
 	if (application->print_settings_file) {
 		if (application->print_settings) {
 			GError *error = NULL;
@@ -716,12 +713,6 @@
 		g_free (application->print_settings_file);
 		application->print_settings_file = NULL;
 	}
-#else /* ! GTK 2.11.0 */
-	if (application->print_settings) {
-		g_object_unref (application->print_settings);
-		application->print_settings = NULL;
-	}
-#endif /* GTK 2.11.0 */
 
 #ifdef ENABLE_DBUS
 	if (application->keys) {
@@ -888,7 +879,6 @@
 	if (application->print_settings)
 		return application->print_settings;
 	
-#if GTK_CHECK_VERSION (2, 11, 0)
 	if (!application->print_settings_file) {
 		application->print_settings_file =
 			g_build_filename (ev_dot_dir (), "print-settings", NULL);
@@ -907,7 +897,6 @@
 			return application->print_settings;
 		}
 	}
-#endif /* GTK 2.11.0 */
 	
 	application->print_settings = gtk_print_settings_new ();
 

Modified: trunk/shell/ev-open-recent-action.c
==============================================================================
--- trunk/shell/ev-open-recent-action.c	(original)
+++ trunk/shell/ev-open-recent-action.c	Fri Oct 31 17:40:28 2008
@@ -68,10 +68,8 @@
 	gtk_recent_chooser_set_filter (GTK_RECENT_CHOOSER (toolbar_recent_menu), filter);
 
 	tool_item = GTK_WIDGET (gtk_menu_tool_button_new_from_stock (GTK_STOCK_OPEN));
-#if GTK_CHECK_VERSION(2,11,6)
 	gtk_menu_tool_button_set_arrow_tooltip_text (GTK_MENU_TOOL_BUTTON (tool_item),
 						     _("Open a recently used document"));
-#endif
 	gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (tool_item),
 				       GTK_WIDGET (toolbar_recent_menu));
 	return tool_item;

Modified: trunk/shell/ev-sidebar-thumbnails.c
==============================================================================
--- trunk/shell/ev-sidebar-thumbnails.c	(original)
+++ trunk/shell/ev-sidebar-thumbnails.c	Fri Oct 31 17:40:28 2008
@@ -371,22 +371,12 @@
 		if (! GTK_WIDGET_REALIZED (priv->tree_view))
 			return;
 
-#if GTK_CHECK_VERSION (2, 11, 3)
 		gtk_tree_view_convert_tree_to_bin_window_coords (GTK_TREE_VIEW (priv->tree_view),
 								 0, (int) priv->vadjustment->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),
 								 NULL, &wy2);
-#else
-		gtk_tree_view_tree_to_widget_coords (GTK_TREE_VIEW (priv->tree_view),
-						     0, (int) priv->vadjustment->value,
-						     NULL, &wy1);
-		gtk_tree_view_tree_to_widget_coords (GTK_TREE_VIEW (priv->tree_view),
-						     0, (int) (priv->vadjustment->value + priv->vadjustment->page_size),
-						     NULL, &wy2);
-#endif /* GTK_CHECK_VERSION (2, 11, 3) */
-
 		gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (priv->tree_view),
 					       1, wy1 + 1, &path,
 					       NULL, NULL, NULL);

Modified: trunk/shell/ev-view-private.h
==============================================================================
--- trunk/shell/ev-view-private.h	(original)
+++ trunk/shell/ev-view-private.h	Fri Oct 31 17:40:28 2008
@@ -169,12 +169,6 @@
 	/* Image DND */
 	ImageDNDInfo image_dnd_info;
 
-#if !GTK_CHECK_VERSION (2, 11, 7)
-	/* Links */
-	GtkWidget *link_tooltip;
-	EvLink *hovered_link;
-#endif
-
 	/* Goto Popup */
 	GtkWidget *goto_window;
 	GtkWidget *goto_entry;

Modified: trunk/shell/ev-view.c
==============================================================================
--- trunk/shell/ev-view.c	(original)
+++ trunk/shell/ev-view.c	Fri Oct 31 17:40:28 2008
@@ -42,10 +42,6 @@
 #include "ev-view.h"
 #include "ev-view-private.h"
 
-#if !GTK_CHECK_VERSION (2, 11, 7)
-#include "ev-tooltip.h"
-#endif
-
 #define EV_VIEW_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), EV_TYPE_VIEW, EvViewClass))
 #define EV_IS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EV_TYPE_VIEW))
 #define EV_VIEW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), EV_TYPE_VIEW, EvViewClass))
@@ -1526,33 +1522,8 @@
 	}
 	
 	link = ev_view_get_link_at_location (view, x, y);
-	
-#if !GTK_CHECK_VERSION (2, 11, 7)
-	if (view->link_tooltip == NULL) {
-		view->link_tooltip = ev_tooltip_new (GTK_WIDGET (view));
-	}
-
-	if (view->hovered_link != link) {
-		view->hovered_link = link;
-		ev_tooltip_deactivate (EV_TOOLTIP (view->link_tooltip));
-	}
-#endif
-
         if (link) {
-#if GTK_CHECK_VERSION (2, 11, 7)
 		g_object_set (view, "has-tooltip", TRUE, NULL);
-#else
-		char *msg = tip_from_link (view, link);
-
-		if (msg && g_utf8_validate (msg, -1, NULL)) {
-			EvTooltip *tooltip = EV_TOOLTIP (view->link_tooltip);
-
-			ev_tooltip_set_position (tooltip, x, y);
-			ev_tooltip_set_text (tooltip, msg);
-			ev_tooltip_activate (tooltip);
-		}
-		g_free (msg);
-#endif
 		ev_view_set_cursor (view, EV_VIEW_CURSOR_LINK);
 	} else if ((field = ev_view_get_form_field_at_location (view, x, y))) {
 		if (field->is_read_only) {
@@ -2589,7 +2560,6 @@
 	return ev_view_do_popup_menu (EV_VIEW (widget), x, y);
 }
 
-#if GTK_CHECK_VERSION (2, 11, 7)
 static void
 get_link_area (EvView       *view,
 	       gint          x,
@@ -2641,7 +2611,6 @@
 
 	return TRUE;
 }
-#endif /* GTK_CHECK_VERSION (2, 11, 7) */
 
 static void
 start_selection_for_event (EvView         *view,
@@ -3528,13 +3497,6 @@
 	if (view->cursor != EV_VIEW_CURSOR_NORMAL)
 		ev_view_set_cursor (view, EV_VIEW_CURSOR_NORMAL);
 
-#if !GTK_CHECK_VERSION (2, 11, 7)
-	if (view->link_tooltip) {
-		view->hovered_link = NULL;
-		ev_tooltip_deactivate (EV_TOOLTIP (view->link_tooltip));
-	}
-#endif
-	
 	return FALSE;
 }
 
@@ -3846,12 +3808,6 @@
 		view->pixbuf_cache = NULL;
 	}
 
-#if !GTK_CHECK_VERSION (2, 11, 7)
-	if (view->link_tooltip) {
-		gtk_widget_destroy (view->link_tooltip);
-		view->link_tooltip = NULL;
-	}
-#endif
 	if (view->goto_window) {
 		gtk_widget_destroy (view->goto_window);
 		view->goto_window = NULL;
@@ -4032,9 +3988,7 @@
 	widget_class->drag_motion = ev_view_drag_motion;
 	widget_class->drag_data_received = ev_view_drag_data_received;
 	widget_class->popup_menu = ev_view_popup_menu;
-#if GTK_CHECK_VERSION (2, 11, 7)
 	widget_class->query_tooltip = ev_view_query_tooltip;
-#endif
 
 	gtk_object_class->destroy = ev_view_destroy;
 

Modified: trunk/shell/ev-window.c
==============================================================================
--- trunk/shell/ev-window.c	(original)
+++ trunk/shell/ev-window.c	Fri Oct 31 17:40:28 2008
@@ -2301,10 +2301,9 @@
 		ev_application_set_print_settings (EV_APP,
 						   window->priv->print_settings);
 		
-#if GTK_CHECK_VERSION (2, 11, 0)
 		print_settings_file = ev_tmp_filename ("print-settings");
 		gtk_print_settings_to_file (settings, print_settings_file, NULL);
-#endif
+
 		uri = g_filename_to_uri (filename, NULL, NULL);
 		ev_application_open_uri_at_dest (EV_APP,
 						 uri, 
@@ -3083,11 +3082,7 @@
 	
 	action = gtk_action_group_get_action (window->priv->action_group,
 					      "PreviewPrint");
-#if GTK_CHECK_VERSION (2, 11, 0)
 	gtk_action_set_visible (action, TRUE);
-#else
-	gtk_action_set_visible (action, FALSE);
-#endif
 
 	update_chrome_visibility (window);
 }
@@ -3480,7 +3475,6 @@
 {
 	EvWindowPrivate *priv = window->priv;
 	GtkPrintSettings *print_settings = NULL;
-#if GTK_CHECK_VERSION (2, 11, 0)
 	const gchar      *print_settings_file = priv->print_settings_file;
 
 	if (print_settings_file) {
@@ -3497,7 +3491,6 @@
 			}
 		}
 	}
-#endif /* GTK 2.11.0 */
 	
 	if (!print_settings)
 		print_settings = gtk_print_settings_new ();
@@ -5422,13 +5415,7 @@
 		g_error_free (error);
 	}
 	
-#if GTK_CHECK_VERSION(2,11,4)
 	ev_window->priv->recent_manager = gtk_recent_manager_get_default ();
-#else
-	/* It's fine to just use the one of the default screen here */
-	ev_window->priv->recent_manager = gtk_recent_manager_get_for_screen (
-		gdk_screen_get_default ());
-#endif
 	ev_window->priv->recent_action_group = NULL;
 	ev_window->priv->recent_ui_id = 0;
 	g_signal_connect_swapped (ev_window->priv->recent_manager,



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