[evince] Remove gtk 2 support
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] Remove gtk 2 support
- Date: Sat, 9 Oct 2010 14:57:41 +0000 (UTC)
commit 8c225e626012b51f44a33af4be67755d9be47be0
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Sat Oct 9 16:43:14 2010 +0200
Remove gtk 2 support
configure.ac | 48 +++-------
.../gimpcellrenderertoggle.c | 62 ++------------
evince-document.pc.in | 2 +-
libdocument/Makefile.am | 4 +-
libview/Makefile.am | 4 +-
libview/ev-annotation-window.c | 6 --
libview/ev-loading-window.c | 16 +---
libview/ev-view-presentation.c | 70 +--------------
libview/ev-view.c | 95 +------------------
shell/ev-annotation-properties-dialog.c | 3 -
shell/ev-convert-metadata.c | 4 -
shell/ev-password-view.c | 3 -
shell/ev-properties-dialog.c | 3 -
shell/ev-window.c | 3 -
14 files changed, 34 insertions(+), 289 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 4378574..9652a07 100644
--- a/configure.ac
+++ b/configure.ac
@@ -121,35 +121,14 @@ fi
AM_CONDITIONAL([PLATFORM_HILDON],[test "$with_platform" = "hildon"])
AM_CONDITIONAL([PLATFORM_WIN32],[test "$with_platform" = "win32"])
-AC_MSG_CHECKING([which gtk+ version to compile against])
-AC_ARG_WITH([gtk],
- [AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 3.0)])],
- [case "$with_gtk" in
- 2.0|3.0) ;;
- *) AC_MSG_ERROR([invalid gtk version specified]) ;;
- esac],
- [with_gtk=3.0])
-AC_MSG_RESULT([$with_gtk])
-
dnl Specify required versions of dependencies
-CAIRO_REQUIRED=1.9.10
+CAIRO_REQUIRED=1.10.0
GLIB_REQUIRED=2.25.11
KEYRING_REQUIRED=2.22.0
-
-case "$with_gtk" in
- 2.0) GTK_API_VERSION=2.0
- GAIL_API_VERSION=
- GTK_REQUIRED=2.22.0
- ;;
- 3.0) GTK_API_VERSION=3.0
- GAIL_API_VERSION=-3.0
- GTK_REQUIRED=2.91.0
- ;;
-esac
+GTK_REQUIRED=2.91.0
AC_SUBST([GLIB_REQUIRED])
AC_SUBST([GTK_REQUIRED])
-AC_SUBST([GTK_API_VERSION])
GNOME_ICON_THEME_REQUIRED=2.17.1
LIBXML_REQUIRED=2.5.0
@@ -164,10 +143,10 @@ dnl Check dependencies
# SHELL_LIBS
-PKG_CHECK_MODULES(LIBDOCUMENT, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED)
-PKG_CHECK_MODULES(LIBVIEW, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED gail$GAIL_API_VERSION >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
-PKG_CHECK_MODULES(BACKEND, cairo >= $CAIRO_REQUIRED gtk+-$GTK_API_VERSION >= $GTK_REQUIRED)
-PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
+PKG_CHECK_MODULES(LIBDOCUMENT, gtk+-3.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED)
+PKG_CHECK_MODULES(LIBVIEW, gtk+-3.0 >= $GTK_REQUIRED gail-3.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
+PKG_CHECK_MODULES(BACKEND, cairo >= $CAIRO_REQUIRED gtk+-3.0 >= $GTK_REQUIRED)
+PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-3.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED)
SHELL_PLATFORM_PKGS=
case "$with_platform" in
@@ -193,13 +172,13 @@ case "$with_platform" in
;;
esac
-PKG_CHECK_MODULES([SHELL_CORE],[libxml-2.0 >= $LIBXML_REQUIRED gtk+-$GTK_API_VERSION >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED gthread-2.0 $SHELL_PLATFORM_PKGS])
+PKG_CHECK_MODULES([SHELL_CORE],[libxml-2.0 >= $LIBXML_REQUIRED gtk+-3.0 >= $GTK_REQUIRED gio-2.0 >= $GLIB_REQUIRED gthread-2.0 $SHELL_PLATFORM_PKGS])
# *********
# SM client
# *********
-GDK_TARGET="$($PKG_CONFIG --variable target gdk-$GTK_API_VERSION)"
+GDK_TARGET="$($PKG_CONFIG --variable target gdk-3.0)"
AC_MSG_CHECKING([which smclient backend to use])
AC_ARG_WITH([smclient],
@@ -225,7 +204,7 @@ if test "$with_smclient" != "no"; then
*) SMCLIENT_PKGS="" ;;
esac
- PKG_CHECK_MODULES([SMCLIENT],[gtk+-$GTK_API_VERSION gthread-2.0 $SMCLIENT_PKGS])
+ PKG_CHECK_MODULES([SMCLIENT],[gtk+-3.0 gthread-2.0 $SMCLIENT_PKGS])
AC_SUBST([SMCLIENT_CFLAGS])
AC_SUBST([SMCLIENT_LIBS])
fi
@@ -262,7 +241,7 @@ AC_ARG_WITH([gtk-unix-print],
AC_MSG_RESULT([$with_gtk_unix_print])
if test "$with_gtk_unix_print" = "yes"; then
- PKG_CHECK_MODULES(GTKUNIXPRINT, [gtk+-unix-print-$GTK_API_VERSION >= $GTK_REQUIRED])
+ PKG_CHECK_MODULES(GTKUNIXPRINT, [gtk+-unix-print-3.0 >= $GTK_REQUIRED])
AC_DEFINE([GTKUNIXPRINT_ENABLED], [1], [Define if gtk+-unix-print is enabled.])
fi
@@ -401,7 +380,7 @@ AC_ARG_ENABLE([nautilus],
esac])
if test "$enable_nautilus" = "yes" ; then
- PKG_CHECK_MODULES([NAUTILUS],[gtk+-x11-$GTK_API_VERSION $MM gthread-2.0 libnautilus-extension],
+ PKG_CHECK_MODULES([NAUTILUS],[gtk+-x11-3.0 $MM gthread-2.0 libnautilus-extension],
[],[AC_MSG_ERROR([libnautilus-extension not found; use --disable-nautilus to disable the nautilus extensions])])
NAUTILUS_EXTENSION_DIR=`$PKG_CONFIG --variable=extensiondir libnautilus-extension`
AC_SUBST([nautilusextensiondir],[$NAUTILUS_EXTENSION_DIR])
@@ -440,7 +419,7 @@ AC_ARG_ENABLE([previewer],
esac])
if test x$enable_previewer = "xyes" ; then
- PKG_CHECK_MODULES([PREVIEWER],[gtk+-$GTK_API_VERSION >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED])
+ PKG_CHECK_MODULES([PREVIEWER],[gtk+-3.0 >= $GTK_REQUIRED gthread-2.0 gio-2.0 >= $GLIB_REQUIRED])
fi
AM_CONDITIONAL([ENABLE_PREVIEWER],[test "$enable_previewer" = "yes"])
@@ -774,7 +753,7 @@ AM_CONDITIONAL(ENABLE_HELP, test "x$enable_help" = "xyes")
GTK_DOC_CHECK([1.13],[--flavour no-tmpl])
AC_SUBST([GLIB_PREFIX],[$($PKG_CONFIG --variable=prefix glib-2.0)])
-AC_SUBST([GTK_PREFIX],[$($PKG_CONFIG --variable=prefix gtk+-$GTK_API_VERSION)])
+AC_SUBST([GTK_PREFIX],[$($PKG_CONFIG --variable=prefix gtk+-3.0)])
# ******************
# Backends directory
@@ -875,7 +854,6 @@ AC_OUTPUT
echo "
Configure summary:
Platform...........: $with_platform
- GTK+ version.......: $with_gtk
GConf Support......: $with_gconf
GTK+ Unix Print....: $with_gtk_unix_print
Keyring Support....: $with_keyring
diff --git a/cut-n-paste/gimpcellrenderertoggle/gimpcellrenderertoggle.c b/cut-n-paste/gimpcellrenderertoggle/gimpcellrenderertoggle.c
index cb5b90f..bfe5d22 100644
--- a/cut-n-paste/gimpcellrenderertoggle/gimpcellrenderertoggle.c
+++ b/cut-n-paste/gimpcellrenderertoggle/gimpcellrenderertoggle.c
@@ -60,20 +60,10 @@ static void gimp_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
gint *width,
gint *height);
static void gimp_cell_renderer_toggle_render (GtkCellRenderer *cell,
-#if GTK_CHECK_VERSION (2, 90, 8)
cairo_t *cr,
-#else
- GdkWindow *window,
-#endif
GtkWidget *widget,
-#if GTK_CHECK_VERSION (2, 90, 8)
- const GdkRectangle *background_area,
- const GdkRectangle *cell_area,
-#else
- GdkRectangle *background_area,
- GdkRectangle *cell_area,
- GdkRectangle *expose_area,
-#endif
+ const GdkRectangle *background_area,
+ const GdkRectangle *cell_area,
GtkCellRendererState flags);
static gboolean gimp_cell_renderer_toggle_activate (GtkCellRenderer *cell,
GdkEvent *event,
@@ -285,20 +275,10 @@ gimp_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
static void
gimp_cell_renderer_toggle_render (GtkCellRenderer *cell,
-#if GTK_CHECK_VERSION (2, 90, 8)
- cairo_t *cr,
-#else
- GdkWindow *window,
-#endif
- GtkWidget *widget,
-#if GTK_CHECK_VERSION (2, 90, 8)
- const GdkRectangle *background_area,
- const GdkRectangle *cell_area,
-#else
- GdkRectangle *background_area,
- GdkRectangle *cell_area,
- GdkRectangle *expose_area,
-#endif
+ cairo_t *cr,
+ GtkWidget *widget,
+ const GdkRectangle *background_area,
+ const GdkRectangle *cell_area,
GtkCellRendererState flags)
{
GimpCellRendererToggle *toggle = GIMP_CELL_RENDERER_TOGGLE (cell);
@@ -313,17 +293,10 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer *cell,
if (! toggle->stock_id)
{
GTK_CELL_RENDERER_CLASS (parent_class)->render (cell,
-#if GTK_CHECK_VERSION (2, 90, 8)
cr,
-#else
- window,
-#endif
widget,
background_area,
cell_area,
-#if !GTK_CHECK_VERSION (2, 90, 8)
- expose_area,
-#endif
flags);
return;
}
@@ -365,19 +338,6 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer *cell,
state = GTK_STATE_INSENSITIVE;
}
-#if !GTK_CHECK_VERSION (2, 90, 8)
- if (gdk_rectangle_intersect (expose_area, cell_area, &draw_rect) &&
- (flags & GTK_CELL_RENDERER_PRELIT))
- gtk_paint_shadow (style,
- window,
- state,
- active ? GTK_SHADOW_IN : GTK_SHADOW_OUT,
- &draw_rect,
- widget, NULL,
- toggle_rect.x, toggle_rect.y,
- toggle_rect.width, toggle_rect.height);
-#endif
-
if (active)
{
GdkPixbuf *insensitive = NULL;
@@ -417,19 +377,9 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer *cell,
if (gdk_rectangle_intersect (&draw_rect, &toggle_rect, &draw_rect))
{
-#if !GTK_CHECK_VERSION (2, 90, 8)
- cairo_t *cr;
-
- cr = gdk_cairo_create (window);
-#endif
-
gdk_cairo_set_source_pixbuf (cr, pixbuf, toggle_rect.x, toggle_rect.y);
gdk_cairo_rectangle (cr, &draw_rect);
cairo_fill (cr);
-
-#if !GTK_CHECK_VERSION (2, 90, 8)
- cairo_destroy (cr);
-#endif
}
if (insensitive)
diff --git a/evince-document.pc.in b/evince-document.pc.in
index 6c8c0b7..337d45e 100644
--- a/evince-document.pc.in
+++ b/evince-document.pc.in
@@ -7,6 +7,6 @@ backenddir= libdir@/evince/@EV_BINARY_VERSION@/backends
Name: Evince Document
Description: GNOME document viewer backend library
Version: @VERSION@
-Requires: gio-2.0 >= @GLIB_REQUIRED@ gtk+- GTK_API_VERSION@ >= @GTK_REQUIRED@
+Requires: gio-2.0 >= @GLIB_REQUIRED@ gtk+-3 >= @GTK_REQUIRED@
Libs: -L${libdir} -levdocument3
Cflags: -I${includedir}
diff --git a/libdocument/Makefile.am b/libdocument/Makefile.am
index 43d0351..2b5604e 100644
--- a/libdocument/Makefile.am
+++ b/libdocument/Makefile.am
@@ -155,9 +155,9 @@ EvinceDocument-$(EV_API_VERSION).gir: libevdocument3.la Makefile $(INST_H_FILES)
--nsversion=$(EV_API_VERSION) \
--include=GLib-2.0 \
--include=Gio-2.0 \
- --include=Gdk-2.0 \
+ --include=Gdk-3.0 \
--include=GdkPixbuf-2.0 \
- --include=Gtk-2.0 \
+ --include=Gtk-3.0 \
--library=evdocument3 \
--libtool="$(SAVED_LIBTOOL)" \
--output $@ \
diff --git a/libview/Makefile.am b/libview/Makefile.am
index 37435b4..7766c4b 100644
--- a/libview/Makefile.am
+++ b/libview/Makefile.am
@@ -127,9 +127,9 @@ EvinceView-$(EV_API_VERSION).gir: libevview3.la Makefile $(INST_H_FILES) $(filte
--include=GLib-2.0 \
--include=GObject-2.0 \
--include=Gio-2.0 \
- --include=Gdk-2.0 \
+ --include=Gdk-3.0 \
--include=GdkPixbuf-2.0 \
- --include=Gtk-2.0 \
+ --include=Gtk-3.0 \
--include=EvinceDocument-$(EV_API_VERSION) \
--library=evview3 \
--libtool="$(LIBTOOL)" \
diff --git a/libview/ev-annotation-window.c b/libview/ev-annotation-window.c
index 6199660..aa7babd 100644
--- a/libview/ev-annotation-window.c
+++ b/libview/ev-annotation-window.c
@@ -139,12 +139,6 @@ ev_annotation_window_set_color (EvAnnotationWindow *window,
gcolor = *color;
-#if !GTK_CHECK_VERSION (2, 90, 8)
- /* Allocate these colors */
- gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (window)),
- &gcolor, FALSE, TRUE);
-#endif
-
/* Apply colors to style */
rc_style = gtk_widget_get_modifier_style (GTK_WIDGET (window));
rc_style->base[GTK_STATE_NORMAL] = gcolor;
diff --git a/libview/ev-loading-window.c b/libview/ev-loading-window.c
index a3dd3b3..4d5eaaf 100644
--- a/libview/ev-loading-window.c
+++ b/libview/ev-loading-window.c
@@ -177,12 +177,8 @@ ev_loading_window_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
EvLoadingWindow *window = EV_LOADING_WINDOW (widget);
-#if GTK_CHECK_VERSION (2, 90, 8)
cairo_surface_t *surface;
- cairo_region_t *shape;
-#else
- GdkPixmap *mask;
-#endif
+ cairo_region_t *shape;
cairo_t *cr;
double r;
@@ -194,15 +190,10 @@ ev_loading_window_size_allocate (GtkWidget *widget,
window->width = allocation->width;
window->height = allocation->height;
-#if GTK_CHECK_VERSION (2, 90, 8)
surface = cairo_image_surface_create (CAIRO_FORMAT_A8,
window->width,
window->height);
cr = cairo_create (surface);
-#else
- mask = gdk_pixmap_new (NULL, window->width, window->height, 1);
- cr = gdk_cairo_create (GDK_DRAWABLE (mask));
-#endif
cairo_save (cr);
cairo_rectangle (cr, 0, 0, window->width, window->height);
@@ -217,16 +208,11 @@ ev_loading_window_size_allocate (GtkWidget *widget,
cairo_destroy (cr);
-#if GTK_CHECK_VERSION (2, 90, 8)
shape = gdk_cairo_region_create_from_surface (surface);
cairo_surface_destroy (surface);
gtk_widget_shape_combine_region (widget, shape);
cairo_region_destroy (shape);
-#else
- gtk_widget_shape_combine_mask (widget, mask, 0, 0);
- g_object_unref (mask);
-#endif
}
static void
diff --git a/libview/ev-view-presentation.c b/libview/ev-view-presentation.c
index 2b39ca6..fa79f10 100644
--- a/libview/ev-view-presentation.c
+++ b/libview/ev-view-presentation.c
@@ -984,7 +984,6 @@ ev_view_presentation_draw_end_page (EvViewPresentation *pview,
area.width = allocation.width;
area.height = allocation.height;
-#if GTK_CHECK_VERSION (2, 90, 8)
gtk_paint_layout (gtk_widget_get_style (widget),
cr,
gtk_widget_get_state (widget),
@@ -994,50 +993,23 @@ ev_view_presentation_draw_end_page (EvViewPresentation *pview,
15,
15,
layout);
-#else
- gtk_paint_layout (gtk_widget_get_style (widget),
- gtk_widget_get_window (widget),
- gtk_widget_get_state (widget),
- FALSE,
- &area,
- widget,
- NULL,
- 15,
- 15,
- layout);
-#endif
pango_font_description_free (font_desc);
g_object_unref (layout);
}
-#if GTK_CHECK_VERSION (2, 90, 8)
static gboolean
ev_view_presentation_draw (GtkWidget *widget,
cairo_t *cr)
-#else
-static gboolean
-ev_view_presentation_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
-#endif
{
EvViewPresentation *pview = EV_VIEW_PRESENTATION (widget);
GdkRectangle page_area;
GdkRectangle overlap;
cairo_surface_t *surface;
-#if GTK_CHECK_VERSION (2, 90, 8)
- cairo_rectangle_int_t clip_rect;
- GdkRectangle *area = &clip_rect;
-#else
- GdkWindow *bin_window;
- cairo_t *cr = NULL;
- GdkRectangle *area = &event->area;
-#endif
-
-#if GTK_CHECK_VERSION (2, 90, 8)
+ GdkRectangle clip_rect;
+
if (!gdk_cairo_get_clip_rectangle (cr, &clip_rect))
return FALSE;
-#endif
switch (pview->state) {
case EV_PRESENTATION_END:
@@ -1054,11 +1026,7 @@ ev_view_presentation_expose_event (GtkWidget *widget,
if (ev_transition_animation_ready (pview->animation)) {
ev_view_presentation_get_page_area (pview, &page_area);
-#if GTK_CHECK_VERSION (2, 90, 8)
cairo_save (cr);
-#else
- cr = gdk_cairo_create (gtk_widget_get_window (widget));
-#endif
/* normalize to x=0, y=0 */
cairo_translate (cr, page_area.x, page_area.y);
@@ -1069,11 +1037,7 @@ ev_view_presentation_expose_event (GtkWidget *widget,
ev_transition_animation_paint (pview->animation, cr, page_area);
-#if GTK_CHECK_VERSION (2, 90, 8)
cairo_restore (cr);
-#else
- cairo_destroy (cr);
-#endif
}
return TRUE;
@@ -1089,12 +1053,8 @@ ev_view_presentation_expose_event (GtkWidget *widget,
}
ev_view_presentation_get_page_area (pview, &page_area);
- if (gdk_rectangle_intersect (&page_area, area, &overlap)) {
-#if GTK_CHECK_VERSION (2, 90, 8)
- cairo_save (cr);
-#else
- cr = gdk_cairo_create (gtk_widget_get_window (widget));
-#endif
+ if (gdk_rectangle_intersect (&page_area, &clip_rect, &overlap)) {
+ cairo_save (cr);
/* Try to fix rounding errors. See bug #438760 */
if (overlap.width == page_area.width)
@@ -1104,11 +1064,7 @@ ev_view_presentation_expose_event (GtkWidget *widget,
cairo_set_source_surface (cr, surface, page_area.x, page_area.y);
cairo_fill (cr);
-#if GTK_CHECK_VERSION (2, 90, 8)
cairo_restore (cr);
-#else
- cairo_destroy (cr);
-#endif
}
return FALSE;
@@ -1121,11 +1077,7 @@ ev_view_presentation_key_press_event (GtkWidget *widget,
EvViewPresentation *pview = EV_VIEW_PRESENTATION (widget);
if (pview->state == EV_PRESENTATION_END)
-#if GTK_CHECK_VERSION (2, 90, 8)
return gtk_bindings_activate_event (G_OBJECT (widget), event);
-#else
- return gtk_bindings_activate_event (GTK_OBJECT (widget), event);
-#endif
switch (event->keyval) {
case GDK_KEY_b:
@@ -1181,11 +1133,7 @@ ev_view_presentation_key_press_event (GtkWidget *widget,
return TRUE;
}
-#if GTK_CHECK_VERSION (2, 90, 8)
return gtk_bindings_activate_event (G_OBJECT (widget), event);
-#else
- return gtk_bindings_activate_event (GTK_OBJECT (widget), event);
-#endif
}
static gboolean
@@ -1279,9 +1227,6 @@ ev_view_presentation_realize (GtkWidget *widget)
attributes.window_type = GDK_WINDOW_CHILD;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
-#if !GTK_CHECK_VERSION (2, 90, 8)
- attributes.colormap = gtk_widget_get_colormap (widget);
-#endif
gtk_widget_get_allocation (widget, &allocation);
attributes.x = allocation.x;
@@ -1301,9 +1246,6 @@ ev_view_presentation_realize (GtkWidget *widget)
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes,
GDK_WA_X | GDK_WA_Y |
-#if !GTK_CHECK_VERSION (2, 90, 8)
- GDK_WA_COLORMAP |
-#endif
GDK_WA_VISUAL);
gdk_window_set_user_data (window, widget);
@@ -1435,11 +1377,7 @@ ev_view_presentation_class_init (EvViewPresentationClass *klass)
widget_class->size_request = ev_view_presentation_size_request;
widget_class->realize = ev_view_presentation_realize;
-#if GTK_CHECK_VERSION (2, 90, 8)
widget_class->draw = ev_view_presentation_draw;
-#else
- widget_class->expose_event = ev_view_presentation_expose_event;
-#endif
widget_class->key_press_event = ev_view_presentation_key_press_event;
widget_class->button_release_event = ev_view_presentation_button_release_event;
widget_class->focus_out_event = ev_view_presentation_focus_out;
diff --git a/libview/ev-view.c b/libview/ev-view.c
index d8f3c0d..892b501 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -157,13 +157,8 @@ static void ev_view_size_allocate (GtkWidget
static void ev_view_realize (GtkWidget *widget);
static gboolean ev_view_scroll_event (GtkWidget *widget,
GdkEventScroll *event);
-#if GTK_CHECK_VERSION (2, 90, 8)
static gboolean ev_view_draw (GtkWidget *widget,
cairo_t *cr);
-#else
-static gboolean ev_view_expose_event (GtkWidget *widget,
- GdkEventExpose *event);
-#endif
static gboolean ev_view_popup_menu (GtkWidget *widget);
static gboolean ev_view_button_press_event (GtkWidget *widget,
GdkEventButton *event);
@@ -3348,26 +3343,13 @@ find_selection_for_page (EvView *view,
return NULL;
}
-#if GTK_CHECK_VERSION (2, 90, 8)
static gboolean
ev_view_draw (GtkWidget *widget,
cairo_t *cr)
-#else
-static gboolean
-ev_view_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
-#endif
{
- EvView *view = EV_VIEW (widget);
- gint i;
-#if GTK_CHECK_VERSION (2, 90, 8)
- cairo_rectangle_int_t clip_rect;
- GdkRectangle *area = &clip_rect;
-#else
- GdkWindow *bin_window;
- cairo_t *cr;
- GdkRectangle *area = &event->area;
-#endif
+ EvView *view = EV_VIEW (widget);
+ gint i;
+ GdkRectangle clip_rect;
if (view->loading) {
show_loading_window (view);
@@ -3379,13 +3361,8 @@ ev_view_expose_event (GtkWidget *widget,
if (view->document == NULL)
return FALSE;
-#if GTK_CHECK_VERSION (2, 90, 8)
if (!gdk_cairo_get_clip_rectangle (cr, &clip_rect))
return FALSE;
-#else
- bin_window = gtk_layout_get_bin_window (GTK_LAYOUT (view));
- cr = gdk_cairo_create (bin_window);
-#endif
for (i = view->start_page; i >= 0 && i <= view->end_page; i++) {
GdkRectangle page_area;
@@ -3398,31 +3375,20 @@ ev_view_expose_event (GtkWidget *widget,
page_area.x -= view->scroll_x;
page_area.y -= view->scroll_y;
- draw_one_page (view, i, cr, &page_area, &border, area, &page_ready);
+ draw_one_page (view, i, cr, &page_area, &border, &clip_rect, &page_ready);
if (page_ready && view->find_pages && view->highlight_find_results)
highlight_find_results (view, cr, i);
if (page_ready && EV_IS_DOCUMENT_ANNOTATIONS (view->document))
show_annotation_windows (view, i);
if (page_ready && view->focus_annotation)
-#if GTK_CHECK_VERSION (2, 90, 8)
focus_annotation (view, cr, i, &clip_rect);
-#else
- focus_annotation (view, cr, i, &event->area);
-#endif
if (page_ready && view->synctex_result)
highlight_forward_search_results (view, cr, i);
}
-#if GTK_CHECK_VERSION (2, 90, 8)
if (GTK_WIDGET_CLASS (ev_view_parent_class)->draw)
GTK_WIDGET_CLASS (ev_view_parent_class)->draw (widget, cr);
-#else
- cairo_destroy (cr);
-
- if (GTK_WIDGET_CLASS (ev_view_parent_class)->expose_event)
- (* GTK_WIDGET_CLASS (ev_view_parent_class)->expose_event) (widget, event);
-#endif
return FALSE;
}
@@ -4177,11 +4143,7 @@ ev_view_key_press_event (GtkWidget *widget,
return FALSE;
}
-#if GTK_CHECK_VERSION (2, 90, 8)
return gtk_bindings_activate_event (G_OBJECT (widget), event);
-#else
- return gtk_bindings_activate_event (GTK_OBJECT (widget), event);
-#endif
}
static gint
@@ -4335,7 +4297,7 @@ focus_annotation (EvView *view,
return;
doc_rect_to_view_rect (view, page, &mapping->area, &rect);
-#if GTK_CHECK_VERSION (2, 90, 8)
+
gtk_paint_focus (gtk_widget_get_style (widget),
cr,
gtk_widget_get_state (widget),
@@ -4343,15 +4305,6 @@ focus_annotation (EvView *view,
rect.x - view->scroll_x,
rect.y - view->scroll_y,
rect.width + 1, rect.height + 1);
-#else
- gtk_paint_focus (gtk_widget_get_style (widget),
- gtk_layout_get_bin_window (GTK_LAYOUT (view)),
- gtk_widget_get_state (widget),
- NULL, widget, NULL,
- rect.x - view->scroll_x,
- rect.y - view->scroll_y,
- rect.width + 1, rect.height + 1);
-#endif
}
static void
@@ -4675,11 +4628,7 @@ ev_view_class_init (EvViewClass *class)
object_class->dispose = ev_view_dispose;
object_class->finalize = ev_view_finalize;
-#if GTK_CHECK_VERSION (2, 90, 8)
widget_class->draw = ev_view_draw;
-#else
- widget_class->expose_event = ev_view_expose_event;
-#endif
widget_class->button_press_event = ev_view_button_press_event;
widget_class->motion_notify_event = ev_view_motion_notify_event;
widget_class->button_release_event = ev_view_button_release_event;
@@ -4848,24 +4797,7 @@ job_finished_cb (EvPixbufCache *pixbuf_cache,
GdkWindow *bin_window;
bin_window = gtk_layout_get_bin_window (GTK_LAYOUT (view));
-#if GTK_CHECK_VERSION(2, 90, 5)
gdk_window_invalidate_region (bin_window, region, TRUE);
-#else
- {
- GdkRegion *gdk_region = gdk_region_new ();
- guint n_recs = cairo_region_num_rectangles (region);
- guint i;
-
- for (i = 0; i < n_recs; i++) {
- cairo_rectangle_int_t rect;
-
- cairo_region_get_rectangle (region, i, &rect);
- gdk_region_union_with_rect (gdk_region, (GdkRectangle *)&rect);
- }
- gdk_window_invalidate_region (bin_window, gdk_region, TRUE);
- gdk_region_destroy (gdk_region);
- }
-#endif
} else {
gtk_widget_queue_draw (GTK_WIDGET (view));
}
@@ -6019,24 +5951,7 @@ merge_selection_region (EvView *view,
cairo_region_translate (region,
page_area.x + border.left - view->scroll_x,
page_area.y + border.top - view->scroll_y);
-#if GTK_CHECK_VERSION(2, 90, 5)
gdk_window_invalidate_region (bin_window, region, TRUE);
-#else
- {
- GdkRegion *gdk_region = gdk_region_new ();
- guint n_recs = cairo_region_num_rectangles (region);
- guint i;
-
- for (i = 0; i < n_recs; i++) {
- cairo_rectangle_int_t rect;
-
- cairo_region_get_rectangle (region, i, &rect);
- gdk_region_union_with_rect (gdk_region, (GdkRectangle *)&rect);
- }
- gdk_window_invalidate_region (bin_window, gdk_region, TRUE);
- gdk_region_destroy (gdk_region);
- }
-#endif
cairo_region_destroy (region);
}
}
diff --git a/shell/ev-annotation-properties-dialog.c b/shell/ev-annotation-properties-dialog.c
index 68013f2..d1da940 100644
--- a/shell/ev-annotation-properties-dialog.c
+++ b/shell/ev-annotation-properties-dialog.c
@@ -139,9 +139,6 @@ ev_annotation_properties_dialog_init (EvAnnotationPropertiesDialog *annot_dialog
gtk_window_set_title (GTK_WINDOW (annot_dialog), _("Annotation Properties"));
gtk_window_set_destroy_with_parent (GTK_WINDOW (annot_dialog), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (annot_dialog), 5);
-#if !GTK_CHECK_VERSION (2, 90, 7)
- gtk_dialog_set_has_separator (dialog, FALSE);
-#endif
gtk_dialog_add_buttons (dialog,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
diff --git a/shell/ev-convert-metadata.c b/shell/ev-convert-metadata.c
index 5ee725c..44a71b7 100644
--- a/shell/ev-convert-metadata.c
+++ b/shell/ev-convert-metadata.c
@@ -164,11 +164,7 @@ show_progress_dialog (ConvertData *data)
dialog = gtk_dialog_new_with_buttons (_("Converting metadata"),
NULL,
-#if GTK_CHECK_VERSION (2, 90, 8)
0,
-#else
- GTK_DIALOG_NO_SEPARATOR,
-#endif
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
NULL);
action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
diff --git a/shell/ev-password-view.c b/shell/ev-password-view.c
index 6998b0b..ba5a633 100644
--- a/shell/ev-password-view.c
+++ b/shell/ev-password-view.c
@@ -255,9 +255,6 @@ ev_password_view_ask_password (EvPasswordView *password_view)
action_area = gtk_dialog_get_action_area (dialog);
/* Set the dialog up with HIG properties */
-#if !GTK_CHECK_VERSION (2, 90, 7)
- gtk_dialog_set_has_separator (dialog, FALSE);
-#endif
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
diff --git a/shell/ev-properties-dialog.c b/shell/ev-properties-dialog.c
index dac890b..e82f242 100644
--- a/shell/ev-properties-dialog.c
+++ b/shell/ev-properties-dialog.c
@@ -61,9 +61,6 @@ ev_properties_dialog_init (EvPropertiesDialog *properties)
gtk_window_set_title (GTK_WINDOW (properties), _("Properties"));
gtk_window_set_destroy_with_parent (GTK_WINDOW (properties), TRUE);
-#if !GTK_CHECK_VERSION (2, 90, 7)
- gtk_dialog_set_has_separator (GTK_DIALOG (properties), FALSE);
-#endif
gtk_container_set_border_width (GTK_CONTAINER (properties), 5);
gtk_box_set_spacing (content_area, 2);
diff --git a/shell/ev-window.c b/shell/ev-window.c
index b7c4bd2..e70e7ee 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -4211,9 +4211,6 @@ ev_window_cmd_edit_toolbar (GtkAction *action, EvWindow *ev_window)
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 (content_area), 2);
-#if !GTK_CHECK_VERSION (2, 90, 7)
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
-#endif
gtk_window_set_default_size (GTK_WINDOW (dialog), 500, 400);
toolbar = EGG_EDITABLE_TOOLBAR (ev_window->priv->toolbar);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]