summaryrefslogtreecommitdiff
path: root/libdocument
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-11-23 18:15:54 +0300
committermonsta <[email protected]>2016-11-23 18:15:54 +0300
commitae5f4711a21508a70d7123dbc0efb610af1289a2 (patch)
tree54d4a9de3b092aa772ed8799fcf30e11e19ff93f /libdocument
parent7884bbe50fe8b8c26e68b8077c18047861c2dd0c (diff)
downloadatril-ae5f4711a21508a70d7123dbc0efb610af1289a2.tar.bz2
atril-ae5f4711a21508a70d7123dbc0efb610af1289a2.tar.xz
move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build option
and require caja >= 1.17.1
Diffstat (limited to 'libdocument')
-rw-r--r--libdocument/Makefile.am4
-rw-r--r--libdocument/ev-attachment.c18
-rw-r--r--libdocument/ev-document-misc.c14
-rw-r--r--libdocument/ev-document-misc.h2
4 files changed, 3 insertions, 35 deletions
diff --git a/libdocument/Makefile.am b/libdocument/Makefile.am
index bb6fc597..e4f22cc8 100644
--- a/libdocument/Makefile.am
+++ b/libdocument/Makefile.am
@@ -159,9 +159,9 @@ AtrilDocument-$(EV_API_VERSION).gir: libatrildocument.la Makefile $(INST_H_FILES
--nsversion=$(EV_API_VERSION) \
--include=GLib-2.0 \
--include=Gio-2.0 \
- --include=Gdk-$(GTK_API_VERSION) \
+ --include=Gdk-3.0 \
--include=GdkPixbuf-2.0 \
- --include=Gtk-$(GTK_API_VERSION) \
+ --include=Gtk-3.0 \
--library=atrildocument \
--libtool="$(LIBTOOL)" \
--output $@ \
diff --git a/libdocument/ev-attachment.c b/libdocument/ev-attachment.c
index 59af21ab..ec8bd35a 100644
--- a/libdocument/ev-attachment.c
+++ b/libdocument/ev-attachment.c
@@ -20,7 +20,7 @@
#include <config.h>
#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>
-#include <gtk/gtk.h>
+#include <gdk/gdk.h>
#include "ev-file-helpers.h"
#include "ev-attachment.h"
@@ -347,12 +347,8 @@ ev_attachment_launch_app (EvAttachment *attachment,
{
gboolean result;
GList *files = NULL;
-#if GTK_CHECK_VERSION (3, 0, 0)
GdkAppLaunchContext *context;
GdkDisplay *display;
-#else
- GAppLaunchContext *context = NULL;
-#endif
GError *ioerror = NULL;
g_assert (G_IS_FILE (attachment->priv->tmp_file));
@@ -360,7 +356,6 @@ ev_attachment_launch_app (EvAttachment *attachment,
files = g_list_prepend (files, attachment->priv->tmp_file);
-#if GTK_CHECK_VERSION (3, 0, 0)
display = screen ? gdk_screen_get_display (screen) : gdk_display_get_default ();
context = gdk_display_get_app_launch_context (display);
gdk_app_launch_context_set_screen (context, screen);
@@ -370,17 +365,6 @@ ev_attachment_launch_app (EvAttachment *attachment,
G_APP_LAUNCH_CONTEXT (context),
&ioerror);
g_object_unref (context);
-#else
- context = G_APP_LAUNCH_CONTEXT (gdk_app_launch_context_new ());
- gdk_app_launch_context_set_screen (GDK_APP_LAUNCH_CONTEXT (context), screen);
- gdk_app_launch_context_set_timestamp (GDK_APP_LAUNCH_CONTEXT (context), timestamp);
-
- result = g_app_info_launch (attachment->priv->app, files,
- context, &ioerror);
-
- if (context)
- g_object_unref (context);
-#endif
if (!result) {
g_set_error (error,
diff --git a/libdocument/ev-document-misc.c b/libdocument/ev-document-misc.c
index 6f760270..1afa1d77 100644
--- a/libdocument/ev-document-misc.c
+++ b/libdocument/ev-document-misc.c
@@ -140,7 +140,6 @@ ev_document_misc_paint_one_page (cairo_t *cr,
gboolean highlight,
gboolean inverted_colors)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStyleContext *context = gtk_widget_get_style_context (widget);
GtkStateFlags state = gtk_widget_get_state_flags (widget);
GdkRGBA fg, bg, shade_bg;
@@ -157,12 +156,6 @@ ev_document_misc_paint_one_page (cairo_t *cr,
gtk_symbolic_color_unref (c2);
gdk_cairo_set_source_rgba (cr, highlight ? &fg : &shade_bg);
-#else
- GtkStyle *style = gtk_widget_get_style (widget);
- GtkStateType state = gtk_widget_get_state (widget);
-
- gdk_cairo_set_source_color (cr, highlight ? &style->text[state] : &style->dark[state]);
-#endif
gdk_cairo_rectangle (cr, area);
cairo_fill (cr);
@@ -177,11 +170,7 @@ ev_document_misc_paint_one_page (cairo_t *cr,
area->height - (border->top + border->bottom));
cairo_fill (cr);
-#if GTK_CHECK_VERSION (3, 0, 0)
gdk_cairo_set_source_rgba (cr, &bg);
-#else
- gdk_cairo_set_source_color (cr, &style->mid[state]);
-#endif
cairo_rectangle (cr,
area->x,
area->y + area->height - (border->bottom - border->top),
@@ -426,7 +415,6 @@ ev_document_misc_format_date (GTime utime)
return g_locale_to_utf8 (s, -1, NULL, NULL, NULL);
}
-#if GTK_CHECK_VERSION(3, 0, 0)
void
ev_document_misc_get_pointer_position (GtkWidget *widget,
gint *x,
@@ -468,5 +456,3 @@ ev_document_misc_get_pointer_position (GtkWidget *widget,
if (y)
*y -= allocation.y;
}
-#endif
-
diff --git a/libdocument/ev-document-misc.h b/libdocument/ev-document-misc.h
index e6ddf02a..98c791ca 100644
--- a/libdocument/ev-document-misc.h
+++ b/libdocument/ev-document-misc.h
@@ -62,11 +62,9 @@ gdouble ev_document_misc_get_screen_dpi (GdkScreen *screen);
gchar *ev_document_misc_format_date (GTime utime);
-#if GTK_CHECK_VERSION(3, 0, 0)
void ev_document_misc_get_pointer_position (GtkWidget *widget,
gint *x,
gint *y);
-#endif
G_END_DECLS