]> www.fi.muni.cz Git - evince.git/commitdiff
Removed shell/ev-view-private.h
authorCarlos Garcia Campos <carlosgc@gnome.org>
Fri, 31 Oct 2008 17:40:28 +0000 (17:40 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Fri, 31 Oct 2008 17:40:28 +0000 (17:40 +0000)
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.

svn path=/trunk/; revision=3242

14 files changed:
ChangeLog
backend/pdf/ev-poppler.cc
configure.ac
properties/ev-properties-view.c
shell/Makefile.am
shell/eggfindbar.c
shell/ev-application.c
shell/ev-open-recent-action.c
shell/ev-sidebar-thumbnails.c
shell/ev-tooltip.c [deleted file]
shell/ev-tooltip.h [deleted file]
shell/ev-view-private.h
shell/ev-view.c
shell/ev-window.c

index e75ae94d7a1058ae4155403476ec1897bea2637c..31b92dd77b505a01b58dcb7990176e1ec161188a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+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.
+       
 2008-10-27 Christian Persch <chpe@gnome.org>
 
         * backend/djvu/djvu-document.c
index 218e587ff88a882bb5b9f49b36d17270247b3036..a765cb4cd2d56e1cf62c3ec7a5bd5384c8c09031 100644 (file)
@@ -1664,11 +1664,9 @@ pdf_document_file_exporter_get_capabilities (EvFileExporter *exporter)
                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
index 189408b7fabe7fa0ee8738c501d28463171d042e..f131a511fe07dbef0d8ea5951492e3bf8c08386a 100644 (file)
@@ -45,7 +45,7 @@ dnl Check dependencies
 # 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
 
index 6a1eb413962436765c28e1648b30ad63fcba6a9b..e4bdd3f25252da824d74863b97ed1dcc46d13c0b 100644 (file)
@@ -192,7 +192,6 @@ set_property (GladeXML *xml, Property property, const char *text)
        g_free (valid_text);
 }
 
-#if GTK_CHECK_VERSION (2, 11, 0)
 static GtkUnit
 get_default_user_units (void)
 {
@@ -297,141 +296,6 @@ ev_regular_paper_size (const EvDocumentInfo *info)
        
        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)
index 16eeaf1a7d63a1c603a4159581739ad4be2dbea6..3dc7e15465a6a7da2e95438875c87e07cd52f38e 100644 (file)
@@ -91,8 +91,6 @@ evince_SOURCES=                               \
        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
index 8b8ba262f59ef70673f928e245fa98055dae9335..9bfaeb49daad2d4d5c5cb77e229746447507eba7 100644 (file)
@@ -328,27 +328,15 @@ egg_find_bar_init (EggFindBar *find_bar)
   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 @@ egg_find_bar_init (EggFindBar *find_bar)
   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);
index e852561f3009de2b4c202d9d3e1812a0367c7f9c..49d10f4bbbdf5636167dcd9d41d818e70642160b 100644 (file)
@@ -69,9 +69,7 @@ struct _EvApplication {
 #endif /* ENABLE_DBUS */
 
        GtkPrintSettings *print_settings;
-#if GTK_CHECK_VERSION (2, 11, 0)
        gchar            *print_settings_file;
-#endif
 };
 
 struct _EvApplicationClass {
@@ -696,7 +694,6 @@ ev_application_shutdown (EvApplication *application)
                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 @@ ev_application_shutdown (EvApplication *application)
                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 @@ ev_application_get_print_settings (EvApplication *application)
        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 @@ ev_application_get_print_settings (EvApplication *application)
                        return application->print_settings;
                }
        }
-#endif /* GTK 2.11.0 */
        
        application->print_settings = gtk_print_settings_new ();
 
index 1c6c9ced687cc049421808e459488abd632b7cd0..17a1745ad66729e397e53339fb401a557c5719c0 100644 (file)
@@ -68,10 +68,8 @@ ev_open_recent_action_create_tool_item (GtkAction *action)
        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;
index 9c0e21728d7ec3abc5390c92059dac50cba23691..cc4fbfcae80cfaf5f320f25944ed9a3908a37428 100644 (file)
@@ -371,22 +371,12 @@ adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails)
                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);
diff --git a/shell/ev-tooltip.c b/shell/ev-tooltip.c
deleted file mode 100644 (file)
index b23a6c9..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-/* this file is part of evince, a gnome document viewer
- *
- *  Copyright (C) 2004 Red Hat, Inc.
- *
- *  Author:
- *    Marco Pesenti Gritti <marco@gnome.org>
- *
- * Evince is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Evince is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <gtk/gtk.h>
-
-#include "ev-tooltip.h"
-
-#define DEFAULT_DELAY 500
-#define STICKY_DELAY 500
-#define STICKY_REVERT_DELAY 1000
-#define SPACE_FROM_CURSOR 10
-
-struct _EvTooltipPrivate {
-       GtkWidget *label;
-       GTimeVal last_deactivate;
-       int timer_tag;
-       gboolean active;
-};
-
-G_DEFINE_TYPE (EvTooltip, ev_tooltip, GTK_TYPE_WINDOW)
-
-#define EV_TOOLTIP_GET_PRIVATE(object) \
-               (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_TOOLTIP, EvTooltipPrivate))
-
-static gboolean
-ev_tooltip_expose_event (GtkWidget      *widget,
-                        GdkEventExpose *event)
-{
-       gtk_paint_flat_box (widget->style, widget->window,
-                           GTK_STATE_NORMAL, GTK_SHADOW_OUT,
-                           NULL, widget, "tooltip", 0, 0,
-                           widget->allocation.width, widget->allocation.height);
-
-       return GTK_WIDGET_CLASS (ev_tooltip_parent_class)->expose_event (widget, event);
-}
-
-static void
-ev_tooltip_dispose (GObject *object)
-{
-       EvTooltip *tooltip = EV_TOOLTIP (object);
-
-       if (tooltip->priv->timer_tag) {
-               g_source_remove (tooltip->priv->timer_tag);
-               tooltip->priv->timer_tag = 0;
-       }
-
-       G_OBJECT_CLASS (ev_tooltip_parent_class)->dispose (object);
-}
-
-static void
-ev_tooltip_class_init (EvTooltipClass *class)
-{
-       GObjectClass *g_object_class = G_OBJECT_CLASS (class);
-       GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
-
-       g_object_class->dispose = ev_tooltip_dispose;
-       widget_class->expose_event = ev_tooltip_expose_event;
-
-       g_type_class_add_private (g_object_class, sizeof (EvTooltipPrivate));
-}
-
-static void
-ev_tooltip_init (EvTooltip *tooltip)
-{
-       GtkWidget *window = GTK_WIDGET (tooltip);
-       GtkWidget *label;
-
-       tooltip->priv = EV_TOOLTIP_GET_PRIVATE (tooltip);
-
-       gtk_widget_set_app_paintable (GTK_WIDGET (tooltip), TRUE);
-       gtk_window_set_resizable (GTK_WINDOW (tooltip), FALSE);
-       gtk_widget_set_name (window, "gtk-tooltips");
-
-       label = gtk_label_new (NULL);
-       gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-       gtk_container_add (GTK_CONTAINER (window), label);
-       gtk_container_set_border_width (GTK_CONTAINER (window), 3);
-       tooltip->priv->label = label;
-
-       gtk_widget_show (label);
-}
-
-/* Public functions */
-
-GtkWidget *
-ev_tooltip_new (GtkWidget *parent)
-{
-       GtkWidget *tooltip;
-       GtkWidget *toplevel;
-
-       tooltip = g_object_new (EV_TYPE_TOOLTIP, NULL);
-
-       GTK_WINDOW (tooltip)->type = GTK_WINDOW_POPUP;
-       EV_TOOLTIP (tooltip)->parent = parent;
-
-       toplevel = gtk_widget_get_toplevel (parent);
-       gtk_window_set_transient_for (GTK_WINDOW (tooltip), GTK_WINDOW (toplevel));
-
-       return tooltip;
-}
-
-void
-ev_tooltip_set_text (EvTooltip *tooltip, const char *text)
-{
-       gtk_label_set_text (GTK_LABEL (tooltip->priv->label), text);
-}
-
-void
-ev_tooltip_set_position (EvTooltip *tooltip, int x, int y)
-{
-       int root_x, root_y;
-
-       if (tooltip->parent != NULL) {
-               gdk_window_get_origin (tooltip->parent->window, &root_x, &root_y);
-       }
-
-       gtk_window_move (GTK_WINDOW (tooltip),
-                        x + root_x + SPACE_FROM_CURSOR,
-                        y + root_y + SPACE_FROM_CURSOR);
-}
-
-static gboolean
-ev_tooltip_recently_shown (EvTooltip *tooltip)
-{
-       GTimeVal now;
-       glong msec;
-  
-       g_get_current_time (&now);
-
-       msec = (now.tv_sec  - tooltip->priv->last_deactivate.tv_sec) * 1000 +
-              (now.tv_usec - tooltip->priv->last_deactivate.tv_usec) / 1000;
-
-       return (msec < STICKY_REVERT_DELAY);
-}
-
-static gint
-ev_tooltip_timeout (gpointer data)
-{
-       GtkWidget *tooltip = GTK_WIDGET (data);
-
-       gtk_widget_show (tooltip);
-
-       return FALSE;
-}
-
-void
-ev_tooltip_activate (EvTooltip *tooltip)
-{
-       int delay;
-
-       if (tooltip->priv->active) {
-               return;
-       } else {
-               tooltip->priv->active = TRUE;
-       }
-
-       if (ev_tooltip_recently_shown (tooltip)) {
-               delay = STICKY_DELAY;
-       } else {
-               delay = DEFAULT_DELAY;
-       }
-
-       tooltip->priv->timer_tag = g_timeout_add (delay, ev_tooltip_timeout,
-                                                 (gpointer)tooltip);
-}
-
-void
-ev_tooltip_deactivate (EvTooltip *tooltip)
-{
-       if (!tooltip->priv->active) {
-               return;
-       } else {
-               tooltip->priv->active = FALSE;
-       }
-
-       if (tooltip->priv->timer_tag) {
-               g_source_remove (tooltip->priv->timer_tag);
-               tooltip->priv->timer_tag = 0;
-       }
-
-       gtk_widget_hide (GTK_WIDGET (tooltip));
-
-       g_get_current_time (&tooltip->priv->last_deactivate);
-}
diff --git a/shell/ev-tooltip.h b/shell/ev-tooltip.h
deleted file mode 100644 (file)
index 7f37c9a..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ev-sidebar.h
- *  this file is part of evince, a gnome document viewer
- * 
- * Copyright (C) 2005 Red Hat, Inc.
- *
- * Author:
- *   Marco Pesenti Gritti <mpg@redhat.com>
- *
- * Evince is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Evince is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __EV_TOOLTIP_H__
-#define __EV_TOOLTIP_H__
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-typedef struct _EvTooltip EvTooltip;
-typedef struct _EvTooltipClass EvTooltipClass;
-typedef struct _EvTooltipPrivate EvTooltipPrivate;
-
-#define EV_TYPE_TOOLTIP                     (ev_tooltip_get_type())
-#define EV_TOOLTIP(object)          (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_TOOLTIP, EvTooltip))
-#define EV_TOOLTIP_CLASS(klass)             (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_TOOLTIP, EvTooltipClass))
-#define EV_IS_TOOLTIP(object)       (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_TOOLTIP))
-#define EV_IS_TOOLTIP_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), EV_TYPE_TOOLTIP))
-#define EV_TOOLTIP_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_TOOLTIP, EvTooltipClass))
-
-struct _EvTooltip {
-       GtkWindow base_instance;
-
-       GtkWidget *parent;
-
-       EvTooltipPrivate *priv;
-};
-
-struct _EvTooltipClass {
-       GtkWindowClass base_class;
-};
-
-GType      ev_tooltip_get_type     (void);
-GtkWidget *ev_tooltip_new          (GtkWidget *parent);
-void       ev_tooltip_set_text    (EvTooltip  *tooltip,
-                                   const char *text);
-void       ev_tooltip_set_position (EvTooltip  *tooltip,
-                                   int         x,
-                                   int         y);
-void       ev_tooltip_activate     (EvTooltip  *tooltip);
-void       ev_tooltip_deactivate   (EvTooltip  *tooltip);
-
-G_END_DECLS
-
-#endif /* __EV_TOOLTIP_H__ */
-
-
index 0643fa876a26a981c6f4f09a869b02d709b21189..c89444038f7f977bef73a3e7aae3086591f7998d 100644 (file)
@@ -169,12 +169,6 @@ struct _EvView {
        /* 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;
index 1659302e21daab775fc88eb19a4b56fcfc475b00..41efa337be8426d89b608865e8631595f01fe2cb 100644 (file)
 #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 @@ ev_view_handle_cursor_over_xy (EvView *view, gint x, gint y)
        }
        
        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 @@ ev_view_popup_menu (GtkWidget *widget)
        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 @@ ev_view_query_tooltip (GtkWidget         *widget,
 
        return TRUE;
 }
-#endif /* GTK_CHECK_VERSION (2, 11, 7) */
 
 static void
 start_selection_for_event (EvView         *view,
@@ -3528,13 +3497,6 @@ ev_view_leave_notify_event (GtkWidget *widget, GdkEventCrossing   *event)
        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 @@ ev_view_destroy (GtkObject *object)
                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 @@ ev_view_class_init (EvViewClass *class)
        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;
 
index 0205bc45b5e43faae3612d31f251d5e976e27559..60ea87c15dbd81983121706f40ea5cbc6d826015 100644 (file)
@@ -2301,10 +2301,9 @@ ev_window_print_send (EvWindow    *window,
                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 @@ ev_window_run_preview (EvWindow *window)
        
        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 @@ ev_window_cmd_preview_print (GtkAction *action, EvWindow *window)
 {
        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 @@ ev_window_cmd_preview_print (GtkAction *action, EvWindow *window)
                        }
                }
        }
-#endif /* GTK 2.11.0 */
        
        if (!print_settings)
                print_settings = gtk_print_settings_new ();
@@ -5422,13 +5415,7 @@ ev_window_init (EvWindow *ev_window)
                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,