summaryrefslogtreecommitdiff
path: root/src/caja-zoom-control.c
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2016-11-22 15:02:51 -0500
committerlukefromdc <[email protected]>2016-11-22 15:02:51 -0500
commit276eb145ce96d5f75f8d3901daf6310f60ddbb81 (patch)
tree544f41e76c9a91973867065696fc2e414ca60170 /src/caja-zoom-control.c
parent969e4d021fe49654fe6e5ee7e88c920fec126505 (diff)
downloadcaja-276eb145ce96d5f75f8d3901daf6310f60ddbb81.tar.bz2
caja-276eb145ce96d5f75f8d3901daf6310f60ddbb81.tar.xz
move to GTK+3 (>= 3.14), drop libunique, GTK+2 code, and --with-gtk build option
*Remove GTK_VERSION_CHECK (3, 0, 0) and libunique selectors *Remove GTK2 and libunique specific code. *Leaves selector for specific GTK3 versions. *Remove #DEFINES for vbox/hbox previously required for GTK2 compatability *Keep vbox in caja-spatial-window.c, it is necessary for the desktop to work *spatial-window vbox issue at https://github.com/mate-desktop/caja/issues/591
Diffstat (limited to 'src/caja-zoom-control.c')
-rw-r--r--src/caja-zoom-control.c95
1 files changed, 4 insertions, 91 deletions
diff --git a/src/caja-zoom-control.c b/src/caja-zoom-control.c
index 5f0549f1..e11c2a39 100644
--- a/src/caja-zoom-control.c
+++ b/src/caja-zoom-control.c
@@ -37,9 +37,7 @@
#include <eel/eel-graphic-effects.h>
#include <eel/eel-gtk-extensions.h>
#include <gtk/gtk.h>
-#if GTK_CHECK_VERSION(3, 0, 0)
#include <gtk/gtk-a11y.h>
-#endif
#include <gdk/gdkkeysyms.h>
#include <libcaja-private/caja-file-utilities.h>
#include <libcaja-private/caja-global-preferences.h>
@@ -47,10 +45,6 @@
#include <stdlib.h>
#include <string.h>
-#if !GTK_CHECK_VERSION(3,0,0)
-#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
-#endif
-
enum
{
ZOOM_IN,
@@ -113,11 +107,7 @@ static GType caja_zoom_control_accessible_get_type (void);
#define NUM_ACTIONS ((int)G_N_ELEMENTS (caja_zoom_control_accessible_action_names))
-#if GTK_CHECK_VERSION (3, 0, 0)
G_DEFINE_TYPE (CajaZoomControl, caja_zoom_control, GTK_TYPE_BOX);
-#else
-G_DEFINE_TYPE (CajaZoomControl, caja_zoom_control, GTK_TYPE_HBOX);
-#endif
static void
caja_zoom_control_finalize (GObject *object)
@@ -292,11 +282,7 @@ set_label_size (CajaZoomControl *zoom_control)
static void
label_style_set_callback (GtkWidget *label,
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkStyleContext *style,
-#else
- GtkStyle *style,
-#endif
gpointer user_data)
{
set_label_size (CAJA_ZOOM_CONTROL (user_data));
@@ -337,9 +323,9 @@ caja_zoom_control_init (CajaZoomControl *zoom_control)
g_signal_connect (G_OBJECT (zoom_control->details->zoom_out),
"clicked", G_CALLBACK (zoom_out_clicked),
zoom_control);
-#if GTK_CHECK_VERSION (3, 0, 0)
+
gtk_orientable_set_orientation (GTK_ORIENTABLE (zoom_control), GTK_ORIENTATION_HORIZONTAL);
-#endif
+
gtk_container_add (GTK_CONTAINER (zoom_control->details->zoom_out), image);
gtk_box_pack_start (GTK_BOX (zoom_control),
zoom_control->details->zoom_out, FALSE, FALSE, 0);
@@ -532,26 +518,6 @@ create_zoom_menu (CajaZoomControl *zoom_control)
return menu;
}
-#if !GTK_CHECK_VERSION(3, 0, 0)
-static AtkObject *
-caja_zoom_control_get_accessible (GtkWidget *widget)
-{
- AtkObject *accessible;
-
- accessible = eel_accessibility_get_atk_object (widget);
-
- if (accessible)
- {
- return accessible;
- }
-
- accessible = g_object_new
- (caja_zoom_control_accessible_get_type (), NULL);
-
- return eel_accessibility_set_atk_object_return (widget, accessible);
-}
-#endif
-
static void
caja_zoom_control_change_value (CajaZoomControl *zoom_control,
GtkScrollType scroll)
@@ -694,12 +660,10 @@ caja_zoom_control_class_init (CajaZoomControlClass *class)
widget_class = GTK_WIDGET_CLASS (class);
-#if GTK_CHECK_VERSION(3, 0, 0)
+
gtk_widget_class_set_accessible_type (widget_class,
caja_zoom_control_accessible_get_type ());
-#else
- widget_class->get_accessible = caja_zoom_control_get_accessible;
-#endif
+
widget_class->scroll_event = caja_zoom_control_scroll_event;
class->change_value = caja_zoom_control_change_value;
@@ -978,7 +942,6 @@ caja_zoom_control_accessible_initialize (AtkObject *accessible,
atk_object_set_role (accessible, ATK_ROLE_DIAL);
}
-#if GTK_CHECK_VERSION(3, 0, 0)
typedef struct _CajaZoomControlAccessible CajaZoomControlAccessible;
typedef struct _CajaZoomControlAccessibleClass CajaZoomControlAccessibleClass;
@@ -1014,56 +977,6 @@ static void
caja_zoom_control_accessible_init (CajaZoomControlAccessible *accessible)
{
}
-#else
-static void
-caja_zoom_control_accessible_class_init (AtkObjectClass *klass)
-{
- accessible_parent_class = g_type_class_peek_parent (klass);
-
- klass->get_name = caja_zoom_control_accessible_get_name;
- klass->get_description = caja_zoom_control_accessible_get_description;
- klass->initialize = caja_zoom_control_accessible_initialize;
-}
-
-static GType
-caja_zoom_control_accessible_get_type (void)
-{
- static GType type = 0;
-
- if (!type)
- {
- static GInterfaceInfo atk_action_info =
- {
- (GInterfaceInitFunc)caja_zoom_control_accessible_action_interface_init,
- (GInterfaceFinalizeFunc)NULL,
- NULL
- };
-
- static GInterfaceInfo atk_value_info =
- {
- (GInterfaceInitFunc)caja_zoom_control_accessible_value_interface_init,
- (GInterfaceFinalizeFunc)NULL,
- NULL
- };
-
- type = eel_accessibility_create_derived_type
- ("CajaZoomControlAccessible",
-#if GTK_CHECK_VERSION (3, 0, 0)
- GTK_TYPE_BOX,
-#else
- GTK_TYPE_HBOX,
-#endif
- caja_zoom_control_accessible_class_init);
-
- g_type_add_interface_static (type, ATK_TYPE_ACTION,
- &atk_action_info);
- g_type_add_interface_static (type, ATK_TYPE_VALUE,
- &atk_value_info);
- }
-
- return type;
-}
-#endif
void
caja_zoom_control_set_active_appearance (CajaZoomControl *zoom_control, gboolean is_active)