summaryrefslogtreecommitdiff
path: root/libview
diff options
context:
space:
mode:
authormonsta <[email protected]>2018-01-29 22:22:48 +0300
committerraveit65 <[email protected]>2018-01-31 09:55:09 +0100
commit45cbbd09a196d3143e25db3fe0ae7103388aae10 (patch)
tree2d8e302296e4b3d292db479f24f92d9f7065788b /libview
parent32575e23107333add227eaa0501ae3cfe6d4fd8a (diff)
downloadatril-45cbbd09a196d3143e25db3fe0ae7103388aae10.tar.bz2
atril-45cbbd09a196d3143e25db3fe0ae7103388aae10.tar.xz
require GTK+ 3.22 and GLib 2.50
Diffstat (limited to 'libview')
-rw-r--r--libview/ev-annotation-window.c9
-rw-r--r--libview/ev-view-presentation.c12
-rw-r--r--libview/ev-view.c22
3 files changed, 2 insertions, 41 deletions
diff --git a/libview/ev-annotation-window.c b/libview/ev-annotation-window.c
index e3c3783a..86ec6488 100644
--- a/libview/ev-annotation-window.c
+++ b/libview/ev-annotation-window.c
@@ -97,20 +97,13 @@ static gdouble
get_screen_dpi (EvAnnotationWindow *window)
{
GdkScreen *screen;
-#if GTK_CHECK_VERSION (3, 22, 0)
GdkMonitor *monitor;
GdkDisplay *display;
-#else
- gint monitor;
-#endif
screen = gtk_window_get_screen (GTK_WINDOW (window));
-#if GTK_CHECK_VERSION (3, 22, 0)
display = gdk_screen_get_display (screen);
monitor = gdk_display_get_primary_monitor (display);
-#else
- monitor = gdk_screen_get_primary_monitor (screen);
-#endif
+
return ev_document_misc_get_screen_dpi (screen, monitor);
}
diff --git a/libview/ev-view-presentation.c b/libview/ev-view-presentation.c
index f52dff8b..72df922d 100644
--- a/libview/ev-view-presentation.c
+++ b/libview/ev-view-presentation.c
@@ -1210,23 +1210,13 @@ static gboolean
init_presentation (GtkWidget *widget)
{
EvViewPresentation *pview = EV_VIEW_PRESENTATION (widget);
-#if GTK_CHECK_VERSION (3, 22, 0)
GdkDisplay *display = gtk_widget_get_display (widget);
GdkRectangle monitor;
GdkMonitor *monitor_num;
-#else
- GdkScreen *screen = gtk_widget_get_screen (widget);
- GdkRectangle monitor;
- gint monitor_num;
-#endif
-#if GTK_CHECK_VERSION (3, 22, 0)
monitor_num = gdk_display_get_monitor_at_window (display, gtk_widget_get_window (widget));
gdk_monitor_get_geometry (monitor_num, &monitor);
-#else
- monitor_num = gdk_screen_get_monitor_at_window (screen, gtk_widget_get_window (widget));
- gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
-#endif
+
pview->monitor_width = monitor.width;
pview->monitor_height = monitor.height;
diff --git a/libview/ev-view.c b/libview/ev-view.c
index befef632..545942e3 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -497,24 +497,16 @@ is_dual_page (EvView *view,
switch (view->page_layout) {
case EV_PAGE_LAYOUT_AUTOMATIC: {
GdkScreen *screen;
-#if GTK_CHECK_VERSION (3, 22, 0)
GdkMonitor *monitor;
GdkDisplay *display;
-#else
- gint monitor;
-#endif
double scale;
double doc_width;
double doc_height;
GtkAllocation allocation;
screen = gtk_widget_get_screen (GTK_WIDGET (view));
-#if GTK_CHECK_VERSION (3, 22, 0)
display = gdk_screen_get_display (screen);
monitor = gdk_display_get_primary_monitor (display);
-#else
- monitor = gdk_screen_get_primary_monitor (screen);
-#endif
scale = ev_document_misc_get_screen_dpi (screen, monitor) / 72.0;
ev_document_get_max_page_size (view->document, &doc_width, &doc_height);
@@ -693,10 +685,6 @@ view_set_adjustment_values (EvView *view,
gtk_adjustment_set_value (adjustment, (int)new_value);
break;
}
-
-#if !GTK_CHECK_VERSION (3,18,0)
- gtk_adjustment_changed (adjustment);
-#endif
}
static void
@@ -6306,9 +6294,7 @@ ev_view_class_init (EvViewClass *class)
object_class->dispose = ev_view_dispose;
-#if GTK_CHECK_VERSION (3, 20, 0)
gtk_widget_class_set_css_name (widget_class, "evview");
-#endif
container_class->remove = ev_view_remove;
container_class->forall = ev_view_forall;
@@ -7142,12 +7128,8 @@ zoom_for_size_automatic (GdkScreen *screen,
int target_width,
int target_height)
{
-#if GTK_CHECK_VERSION (3, 22, 0)
GdkMonitor *monitor;
GdkDisplay *display;
-#else
- gint monitor;
-#endif
double fit_width_scale;
double scale;
@@ -7161,12 +7143,8 @@ zoom_for_size_automatic (GdkScreen *screen,
} else {
double actual_scale;
-#if GTK_CHECK_VERSION (3, 22, 0)
display = gdk_screen_get_display (screen);
monitor = gdk_display_get_primary_monitor (display);
-#else
- monitor = gdk_screen_get_primary_monitor (screen);
-#endif
actual_scale = ev_document_misc_get_screen_dpi (screen, monitor) / 72.0;
scale = MIN (fit_width_scale, actual_scale);
}