gtk: We're targeting gtk3.10 so clean up all the gtk version checks and go with that
This commit is contained in:
@@ -114,11 +114,7 @@ xed_file_browser_view_finalize (GObject * object)
|
||||
XedFileBrowserView *obj = XED_FILE_BROWSER_VIEW(object);
|
||||
|
||||
if (obj->priv->hand_cursor)
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
g_object_unref (obj->priv->hand_cursor);
|
||||
#else
|
||||
gdk_cursor_unref (obj->priv->hand_cursor);
|
||||
#endif
|
||||
|
||||
if (obj->priv->hover_path)
|
||||
gtk_tree_path_free (obj->priv->hover_path);
|
||||
@@ -129,11 +125,7 @@ xed_file_browser_view_finalize (GObject * object)
|
||||
obj->priv->expand_state = NULL;
|
||||
}
|
||||
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
g_object_unref (obj->priv->busy_cursor);
|
||||
#else
|
||||
gdk_cursor_unref (obj->priv->busy_cursor);
|
||||
#endif
|
||||
|
||||
G_OBJECT_CLASS (xed_file_browser_view_parent_class)->
|
||||
finalize (object);
|
||||
@@ -316,12 +308,7 @@ set_click_policy_property (XedFileBrowserView *obj,
|
||||
|
||||
if (click_policy == XED_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE) {
|
||||
if (obj->priv->hand_cursor == NULL)
|
||||
#if GTK_CHECK_VERSION (3, 16, 0)
|
||||
display = gtk_widget_get_display (GTK_WIDGET (obj));
|
||||
obj->priv->hand_cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
|
||||
#else
|
||||
obj->priv->hand_cursor = gdk_cursor_new(GDK_HAND2);
|
||||
#endif
|
||||
} else if (click_policy == XED_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE) {
|
||||
if (obj->priv->hover_path != NULL) {
|
||||
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (obj->priv->model),
|
||||
@@ -344,11 +331,7 @@ set_click_policy_property (XedFileBrowserView *obj,
|
||||
}
|
||||
|
||||
if (obj->priv->hand_cursor) {
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
g_object_unref (obj->priv->hand_cursor);
|
||||
#else
|
||||
gdk_cursor_unref (obj->priv->hand_cursor);
|
||||
#endif
|
||||
obj->priv->hand_cursor = NULL;
|
||||
}
|
||||
}
|
||||
@@ -962,9 +945,6 @@ cell_data_cb (GtkTreeViewColumn * tree_column, GtkCellRenderer * cell,
|
||||
static void
|
||||
xed_file_browser_view_init (XedFileBrowserView * obj)
|
||||
{
|
||||
#if GTK_CHECK_VERSION (3, 16, 0)
|
||||
GdkDisplay *display;
|
||||
#endif
|
||||
obj->priv = XED_FILE_BROWSER_VIEW_GET_PRIVATE (obj);
|
||||
|
||||
obj->priv->column = gtk_tree_view_column_new ();
|
||||
@@ -999,12 +979,7 @@ xed_file_browser_view_init (XedFileBrowserView * obj)
|
||||
G_N_ELEMENTS (drag_source_targets),
|
||||
GDK_ACTION_COPY);
|
||||
|
||||
#if GTK_CHECK_VERSION (3, 16, 0)
|
||||
display = gtk_widget_get_display (GTK_WIDGET (obj));
|
||||
obj->priv->busy_cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
|
||||
#else
|
||||
obj->priv->busy_cursor = gdk_cursor_new (GDK_WATCH);
|
||||
#endif
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@@ -50,10 +50,6 @@
|
||||
#define XML_UI_FILE "xed-file-browser-widget-ui.xml"
|
||||
#define LOCATION_DATA_KEY "xed-file-browser-widget-location"
|
||||
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
BOOKMARKS_ID,
|
||||
@@ -240,13 +236,8 @@ static void on_action_filter_binary (GtkAction * action,
|
||||
static void on_action_bookmark_open (GtkAction * action,
|
||||
XedFileBrowserWidget * obj);
|
||||
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
XED_PLUGIN_DEFINE_TYPE (XedFileBrowserWidget, xed_file_browser_widget,
|
||||
GTK_TYPE_BOX)
|
||||
#else
|
||||
XED_PLUGIN_DEFINE_TYPE (XedFileBrowserWidget, xed_file_browser_widget,
|
||||
GTK_TYPE_VBOX)
|
||||
#endif
|
||||
|
||||
static void
|
||||
free_name_icon (gpointer data)
|
||||
@@ -369,11 +360,7 @@ xed_file_browser_widget_finalize (GObject * object)
|
||||
|
||||
cancel_async_operation (obj);
|
||||
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
g_object_unref (obj->priv->busy_cursor);
|
||||
#else
|
||||
gdk_cursor_unref (obj->priv->busy_cursor);
|
||||
#endif
|
||||
|
||||
G_OBJECT_CLASS (xed_file_browser_widget_parent_class)->finalize (object);
|
||||
}
|
||||
@@ -1237,7 +1224,7 @@ create_filter (XedFileBrowserWidget * obj)
|
||||
gtk_widget_show (expander);
|
||||
gtk_box_pack_start (GTK_BOX (obj), expander, FALSE, FALSE, 0);
|
||||
|
||||
vbox = gtk_vbox_new (FALSE, 3);
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
obj->priv->filter_expander = expander;
|
||||
@@ -1261,9 +1248,6 @@ create_filter (XedFileBrowserWidget * obj)
|
||||
static void
|
||||
xed_file_browser_widget_init (XedFileBrowserWidget * obj)
|
||||
{
|
||||
#if GTK_CHECK_VERSION (3, 16, 0)
|
||||
GdkDisplay *display;
|
||||
#endif
|
||||
obj->priv = XED_FILE_BROWSER_WIDGET_GET_PRIVATE (obj);
|
||||
|
||||
obj->priv->bookmarks_hash = g_hash_table_new_full (g_file_hash,
|
||||
@@ -1272,17 +1256,10 @@ xed_file_browser_widget_init (XedFileBrowserWidget * obj)
|
||||
free_name_icon);
|
||||
|
||||
gtk_box_set_spacing (GTK_BOX (obj), 3);
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
gtk_orientable_set_orientation (GTK_ORIENTABLE (obj),
|
||||
GTK_ORIENTATION_VERTICAL);
|
||||
#endif
|
||||
|
||||
#if GTK_CHECK_VERSION (3, 16, 0)
|
||||
display = gtk_widget_get_display (GTK_WIDGET (obj));
|
||||
obj->priv->busy_cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
|
||||
#else
|
||||
obj->priv->busy_cursor = gdk_cursor_new (GDK_WATCH);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Private */
|
||||
@@ -2122,23 +2099,11 @@ set_busy (XedFileBrowserWidget *obj, gboolean busy)
|
||||
|
||||
if (busy)
|
||||
{
|
||||
#if GTK_CHECK_VERSION (3, 16, 0)
|
||||
GdkDisplay *display;
|
||||
GdkCursor *cursor;
|
||||
|
||||
display = gtk_widget_get_display (GTK_WIDGET (obj));
|
||||
cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
|
||||
#else
|
||||
GdkCursor *cursor;
|
||||
|
||||
cursor = gdk_cursor_new (GDK_WATCH);
|
||||
#endif
|
||||
gdk_window_set_cursor (window, cursor);
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
g_object_unref (obj->priv->busy_cursor);
|
||||
#else
|
||||
gdk_cursor_unref (cursor);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -48,22 +48,14 @@ gboolean (*XedFileBrowserWidgetFilterFunc) (XedFileBrowserWidget * obj,
|
||||
|
||||
struct _XedFileBrowserWidget
|
||||
{
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
GtkBox parent;
|
||||
#else
|
||||
GtkVBox parent;
|
||||
#endif
|
||||
|
||||
XedFileBrowserWidgetPrivate *priv;
|
||||
};
|
||||
|
||||
struct _XedFileBrowserWidgetClass
|
||||
{
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
GtkBoxClass parent_class;
|
||||
#else
|
||||
GtkVBoxClass parent_class;
|
||||
#endif
|
||||
|
||||
/* Signals */
|
||||
void (*uri_activated) (XedFileBrowserWidget * widget,
|
||||
|
@@ -23,9 +23,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <gtk/gtk.h>
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
#include <gtksourceview/gtksource.h>
|
||||
#endif
|
||||
#include <xed/xed-language-manager.h>
|
||||
#include <xed/xed-prefs-manager.h>
|
||||
#include <xed/xed-debug.h>
|
||||
|
@@ -454,11 +454,7 @@ build_suggestion_menu (XedAutomaticSpellChecker *spell, const gchar *word)
|
||||
|
||||
label = gtk_label_new (label_text);
|
||||
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
|
||||
#if GTK_CHECK_VERSION (3, 16, 0)
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
|
||||
#else
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
||||
#endif
|
||||
|
||||
mi = gtk_menu_item_new ();
|
||||
gtk_container_add (GTK_CONTAINER(mi), label);
|
||||
|
@@ -69,11 +69,7 @@ struct _XedTaglistPluginPanelPrivate
|
||||
gchar *data_dir;
|
||||
};
|
||||
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
XED_PLUGIN_DEFINE_TYPE (XedTaglistPluginPanel, xed_taglist_plugin_panel, GTK_TYPE_BOX)
|
||||
#else
|
||||
XED_PLUGIN_DEFINE_TYPE (XedTaglistPluginPanel, xed_taglist_plugin_panel, GTK_TYPE_VBOX)
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -581,13 +577,8 @@ tags_list_query_tooltip_cb (GtkWidget *widget,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
draw_event_cb (GtkWidget *panel,
|
||||
cairo_t *cr,
|
||||
#else
|
||||
expose_event_cb (GtkWidget *panel,
|
||||
GdkEventExpose *event,
|
||||
#endif
|
||||
gpointer user_data)
|
||||
{
|
||||
XedTaglistPluginPanel *ppanel = XED_TAGLIST_PLUGIN_PANEL (panel);
|
||||
@@ -601,13 +592,8 @@ expose_event_cb (GtkWidget *panel,
|
||||
/* And populate combo box */
|
||||
populate_tag_groups_combo (XED_TAGLIST_PLUGIN_PANEL (panel));
|
||||
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
/* We need to manage only the first draw -> disconnect */
|
||||
g_signal_handlers_disconnect_by_func (panel, draw_event_cb, NULL);
|
||||
#else
|
||||
/* We need to manage only the first expose event -> disconnect */
|
||||
g_signal_handlers_disconnect_by_func (panel, expose_event_cb, NULL);
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -685,10 +671,8 @@ xed_taglist_plugin_panel_init (XedTaglistPluginPanel *panel)
|
||||
panel->priv = XED_TAGLIST_PLUGIN_PANEL_GET_PRIVATE (panel);
|
||||
panel->priv->data_dir = NULL;
|
||||
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
gtk_orientable_set_orientation (GTK_ORIENTABLE (panel),
|
||||
GTK_ORIENTATION_VERTICAL);
|
||||
#endif
|
||||
|
||||
/* Build the window content */
|
||||
panel->priv->tag_groups_combo = gtk_combo_box_text_new ();
|
||||
@@ -781,13 +765,8 @@ xed_taglist_plugin_panel_init (XedTaglistPluginPanel *panel)
|
||||
G_CALLBACK (selected_group_changed),
|
||||
panel);
|
||||
g_signal_connect (panel,
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
"draw",
|
||||
G_CALLBACK (draw_event_cb),
|
||||
#else
|
||||
"expose-event",
|
||||
G_CALLBACK (expose_event_cb),
|
||||
#endif
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
@@ -58,11 +58,7 @@ typedef struct _XedTaglistPluginPanel XedTaglistPluginPanel;
|
||||
|
||||
struct _XedTaglistPluginPanel
|
||||
{
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
GtkBox vbox;
|
||||
#else
|
||||
GtkVBox vbox;
|
||||
#endif
|
||||
|
||||
/*< private > */
|
||||
XedTaglistPluginPanelPrivate *priv;
|
||||
@@ -75,11 +71,7 @@ typedef struct _XedTaglistPluginPanelClass XedTaglistPluginPanelClass;
|
||||
|
||||
struct _XedTaglistPluginPanelClass
|
||||
{
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
GtkBoxClass parent_class;
|
||||
#else
|
||||
GtkVBoxClass parent_class;
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user