summaryrefslogtreecommitdiff
path: root/libview/ev-annotation-window.c
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 /libview/ev-annotation-window.c
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 'libview/ev-annotation-window.c')
-rw-r--r--libview/ev-annotation-window.c44
1 files changed, 4 insertions, 40 deletions
diff --git a/libview/ev-annotation-window.c b/libview/ev-annotation-window.c
index 69278b3e..de5c8876 100644
--- a/libview/ev-annotation-window.c
+++ b/libview/ev-annotation-window.c
@@ -28,13 +28,6 @@
#include "ev-view-marshal.h"
#include "ev-document-misc.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gdk_cursor_unref g_object_unref
-#define gtk_widget_render_icon(A,B,C,D) gtk_widget_render_icon_pixbuf(A,B,C)
-#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y)
-#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
-#endif
-
enum {
PROP_0,
PROP_ANNOTATION,
@@ -141,7 +134,6 @@ static void
ev_annotation_window_set_color (EvAnnotationWindow *window,
GdkColor *color)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStyleProperties *properties;
GtkStyleProvider *provider;
GdkRGBA rgba;
@@ -167,34 +159,6 @@ ev_annotation_window_set_color (EvAnnotationWindow *window,
gtk_style_context_add_provider (gtk_widget_get_style_context (window->resize_sw),
provider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_unref (properties);
-#else
- GtkRcStyle *rc_style;
- GdkColor gcolor;
-
- gcolor = *color;
-
- /* Allocate these colors */
- gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (window)),
- &gcolor, FALSE, TRUE);
-
- /* Apply colors to style */
- rc_style = gtk_widget_get_modifier_style (GTK_WIDGET (window));
- rc_style->base[GTK_STATE_NORMAL] = gcolor;
- rc_style->bg[GTK_STATE_PRELIGHT] = gcolor;
- rc_style->bg[GTK_STATE_NORMAL] = gcolor;
- rc_style->bg[GTK_STATE_ACTIVE] = gcolor;
- rc_style->color_flags[GTK_STATE_PRELIGHT] = GTK_RC_BG;
- rc_style->color_flags[GTK_STATE_NORMAL] = GTK_RC_BG | GTK_RC_BASE;
- rc_style->color_flags[GTK_STATE_ACTIVE] = GTK_RC_BG;
-
- /* Apply the style to the widgets */
- g_object_ref (rc_style);
- gtk_widget_modify_style (GTK_WIDGET (window), rc_style);
- gtk_widget_modify_style (window->close_button, rc_style);
- gtk_widget_modify_style (window->resize_se, rc_style);
- gtk_widget_modify_style (window->resize_sw, rc_style);
- g_object_unref (rc_style);
-#endif
}
static void
@@ -289,7 +253,7 @@ ev_annotation_window_set_resize_cursor (GtkWidget *widget,
GDK_BOTTOM_LEFT_CORNER :
GDK_BOTTOM_RIGHT_CORNER);
gdk_window_set_cursor (gdk_window, cursor);
- gdk_cursor_unref (cursor);
+ g_object_unref (cursor);
} else {
gdk_window_set_cursor (gdk_window, NULL);
}
@@ -321,10 +285,10 @@ ev_annotation_window_init (EvAnnotationWindow *window)
gtk_widget_set_can_focus (GTK_WIDGET (window), TRUE);
- vbox = gtk_vbox_new (FALSE, 0);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
/* Title bar */
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
icon = gtk_image_new (); /* FIXME: use the annot icon */
gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, FALSE, 0);
@@ -367,7 +331,7 @@ ev_annotation_window_init (EvAnnotationWindow *window)
gtk_widget_show (swindow);
/* Resize bar */
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
window->resize_sw = gtk_event_box_new ();
gtk_widget_add_events (window->resize_sw, GDK_BUTTON_PRESS_MASK);