diff options
author | monsta <[email protected]> | 2016-11-06 14:43:26 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-11-06 14:43:26 +0300 |
commit | 4c06cb5cd0859067769dac1317682d430b18cc78 (patch) | |
tree | 0c363ee71311366fb2016df9858858ef5ef2d25d | |
parent | 65371f53dbb06180b750dad7c19e7bcf0f8651d6 (diff) | |
download | pluma-4c06cb5cd0859067769dac1317682d430b18cc78.tar.bz2 pluma-4c06cb5cd0859067769dac1317682d430b18cc78.tar.xz |
move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build option
56 files changed, 176 insertions, 1328 deletions
diff --git a/Makefile.am b/Makefile.am index 329e7712..d472aea3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -55,8 +55,7 @@ MAINTAINERCLEANFILES = \ DISTCHECK_CONFIGURE_FLAGS = \ --enable-gtk-doc \ - --disable-tests \ - --with-gtk=$(GTK_API_VERSION) + --disable-tests # Build ChangeLog from GIT history ChangeLog: @@ -1,3 +1,6 @@ +pluma 1.17.0 +============ + pluma 1.16.0 ============ @@ -55,7 +55,7 @@ You can download the latest pluma tarball from: Installation ============ -pluma requires GTK+-2.16.x, GtkSourceView 2.4.x and MateConf libraries. +pluma requires GTK+-3.14.x and GtkSourceView 3.0.x. Simple install procedure: diff --git a/configure.ac b/configure.ac index 112fdd3c..4fd1c5f4 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.63.2) m4_define(pluma_major_version, 1) -m4_define(pluma_minor_version, 16) +m4_define(pluma_minor_version, 17) m4_define(pluma_micro_version, 0) m4_define(pluma_version, pluma_major_version.pluma_minor_version.pluma_micro_version) @@ -149,29 +149,8 @@ fi AM_CONDITIONAL(ENABLE_ENCHANT, test x"$enable_enchant" = "xyes") -dnl ================================================================ -dnl Start of pkg-config checks -dnl ================================================================ - -AC_MSG_CHECKING([which gtk+ version to compile against]) -AC_ARG_WITH([gtk], - [AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 2.0)])], - [case "$with_gtk" in - 2.0|3.0) ;; - *) AC_MSG_ERROR([invalid gtk version specified]) ;; - esac], - [with_gtk=2.0]) -AC_MSG_RESULT([$with_gtk]) - -case "$with_gtk" in - 2.0) GTK_API_VERSION=2.0 - GTK_REQUIRED=2.24.0 - ;; - 3.0) GTK_API_VERSION=3.0 - GTK_REQUIRED=3.0.0 - ;; -esac -AC_SUBST(GTK_API_VERSION) +GTK_REQUIRED=3.14.0 +GTKSOURCEVIEW_REQUIRED=3.0.0 PKG_CHECK_MODULES(GMODULE,gmodule-2.0,[GMODULE_ADD="gmodule-2.0"],[GMODULE_ADD=""]) PKG_CHECK_MODULES(PLUMA, [ @@ -180,8 +159,8 @@ PKG_CHECK_MODULES(PLUMA, [ $GMODULE_ADD gthread-2.0 >= 2.13.0 gio-2.0 >= 2.26.0 - gtk+-$GTK_API_VERSION >= $GTK_REQUIRED - gtksourceview-$GTK_API_VERSION >= 2.9.7 + gtk+-3.0 >= $GTK_REQUIRED + gtksourceview-3.0 >= $GTKSOURCEVIEW_REQUIRED ]) PKG_CHECK_MODULES(X11, [x11]) @@ -288,7 +267,6 @@ Configuration: Source code location: ${srcdir} Compiler: ${CC} - GTK API version: $GTK_API_VERSION Spell Plugin enabled: $enable_enchant Gvfs metadata enabled: $enable_gvfs_metadata Tests enabled: $enable_tests diff --git a/data/pluma-bugreport.sh.in b/data/pluma-bugreport.sh.in index 4d97a6ae..9fab78bf 100644 --- a/data/pluma-bugreport.sh.in +++ b/data/pluma-bugreport.sh.in @@ -1,7 +1,6 @@ #!/bin/sh -PKG_CONFIG_MODULES="glib-2.0 gtk+-2.0 gtksourceview-2.0 \ - enchant iso-codes" +PKG_CONFIG_MODULES="glib-2.0 gtk+-3.0 gtksourceview-3.0 enchant iso-codes" echo_padded () { diff --git a/data/pluma.pc.in b/data/pluma.pc.in index 9028e4af..b79400c7 100644 --- a/data/pluma.pc.in +++ b/data/pluma.pc.in @@ -6,7 +6,7 @@ pluginsdir=@libdir@/pluma/plugins Name: pluma Description: pluma -Requires: gtksourceview-@GTK_API_VERSION@ +Requires: gtksourceview-3.0 Version: @VERSION@ Cflags: -I${includedir}/pluma Libs: -L${libdir} diff --git a/plugins/filebrowser/pluma-file-browser-utils.c b/plugins/filebrowser/pluma-file-browser-utils.c index 8ffabfbe..3a232f8d 100644 --- a/plugins/filebrowser/pluma-file-browser-utils.c +++ b/plugins/filebrowser/pluma-file-browser-utils.c @@ -94,12 +94,8 @@ pluma_file_browser_utils_pixbuf_from_icon (GIcon * icon, return NULL; ret = gtk_icon_info_load_icon (info, NULL); -#if GTK_CHECK_VERSION (3, 0, 0) g_object_unref (info); -#else - gtk_icon_info_free (info); -#endif - + return ret; } diff --git a/plugins/filebrowser/pluma-file-browser-view.c b/plugins/filebrowser/pluma-file-browser-view.c index 847743b3..65728b0f 100644 --- a/plugins/filebrowser/pluma-file-browser-view.c +++ b/plugins/filebrowser/pluma-file-browser-view.c @@ -114,11 +114,7 @@ pluma_file_browser_view_finalize (GObject * object) PlumaFileBrowserView *obj = PLUMA_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 @@ pluma_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 (pluma_file_browser_view_parent_class)-> finalize (object); @@ -316,12 +308,8 @@ set_click_policy_property (PlumaFileBrowserView *obj, if (click_policy == PLUMA_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 == PLUMA_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 +332,7 @@ set_click_policy_property (PlumaFileBrowserView *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 +946,8 @@ cell_data_cb (GtkTreeViewColumn * tree_column, GtkCellRenderer * cell, static void pluma_file_browser_view_init (PlumaFileBrowserView * obj) { -#if GTK_CHECK_VERSION (3, 16, 0) GdkDisplay *display; -#endif + obj->priv = PLUMA_FILE_BROWSER_VIEW_GET_PRIVATE (obj); obj->priv->column = gtk_tree_view_column_new (); @@ -999,12 +982,8 @@ pluma_file_browser_view_init (PlumaFileBrowserView * 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 diff --git a/plugins/filebrowser/pluma-file-browser-widget.c b/plugins/filebrowser/pluma-file-browser-widget.c index 7cef34cc..535ecbc4 100644 --- a/plugins/filebrowser/pluma-file-browser-widget.c +++ b/plugins/filebrowser/pluma-file-browser-widget.c @@ -50,10 +50,6 @@ #define XML_UI_FILE "pluma-file-browser-widget-ui.xml" #define LOCATION_DATA_KEY "pluma-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, PlumaFileBrowserWidget * obj); -#if GTK_CHECK_VERSION (3, 0, 0) PLUMA_PLUGIN_DEFINE_TYPE (PlumaFileBrowserWidget, pluma_file_browser_widget, GTK_TYPE_BOX) -#else -PLUMA_PLUGIN_DEFINE_TYPE (PlumaFileBrowserWidget, pluma_file_browser_widget, - GTK_TYPE_VBOX) -#endif static void free_name_icon (gpointer data) @@ -369,11 +360,7 @@ pluma_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 (pluma_file_browser_widget_parent_class)->finalize (object); } @@ -1237,7 +1224,7 @@ create_filter (PlumaFileBrowserWidget * 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,8 @@ create_filter (PlumaFileBrowserWidget * obj) static void pluma_file_browser_widget_init (PlumaFileBrowserWidget * obj) { -#if GTK_CHECK_VERSION (3, 16, 0) GdkDisplay *display; -#endif + obj->priv = PLUMA_FILE_BROWSER_WIDGET_GET_PRIVATE (obj); obj->priv->bookmarks_hash = g_hash_table_new_full (g_file_hash, @@ -1272,17 +1258,11 @@ pluma_file_browser_widget_init (PlumaFileBrowserWidget * 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 +2102,13 @@ set_busy (PlumaFileBrowserWidget *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 { diff --git a/plugins/filebrowser/pluma-file-browser-widget.h b/plugins/filebrowser/pluma-file-browser-widget.h index d7be9e4d..47b0d74e 100644 --- a/plugins/filebrowser/pluma-file-browser-widget.h +++ b/plugins/filebrowser/pluma-file-browser-widget.h @@ -48,22 +48,14 @@ gboolean (*PlumaFileBrowserWidgetFilterFunc) (PlumaFileBrowserWidget * obj, struct _PlumaFileBrowserWidget { -#if GTK_CHECK_VERSION (3, 0, 0) GtkBox parent; -#else - GtkVBox parent; -#endif PlumaFileBrowserWidgetPrivate *priv; }; struct _PlumaFileBrowserWidgetClass { -#if GTK_CHECK_VERSION (3, 0, 0) GtkBoxClass parent_class; -#else - GtkVBoxClass parent_class; -#endif /* Signals */ void (*uri_activated) (PlumaFileBrowserWidget * widget, diff --git a/plugins/modelines/modeline-parser.c b/plugins/modelines/modeline-parser.c index c1d96140..f816f957 100644 --- a/plugins/modelines/modeline-parser.c +++ b/plugins/modelines/modeline-parser.c @@ -23,9 +23,6 @@ #include <stdlib.h> #include <stdio.h> #include <gtk/gtk.h> -#if GTK_CHECK_VERSION (3, 0, 0) -#include <gtksourceview/gtksource.h> -#endif #include <pluma/pluma-language-manager.h> #include <pluma/pluma-prefs-manager.h> #include <pluma/pluma-debug.h> diff --git a/plugins/modelines/modeline-parser.h b/plugins/modelines/modeline-parser.h index ab8eaa34..72a1071f 100644 --- a/plugins/modelines/modeline-parser.h +++ b/plugins/modelines/modeline-parser.h @@ -23,7 +23,7 @@ #define __MODELINE_PARSER_H__ #include <glib.h> -#include <gtksourceview/gtksourceview.h> +#include <gtksourceview/gtksource.h> G_BEGIN_DECLS diff --git a/plugins/spell/pluma-spell-utils.c b/plugins/spell/pluma-spell-utils.c index 504cf042..24a211c8 100644 --- a/plugins/spell/pluma-spell-utils.c +++ b/plugins/spell/pluma-spell-utils.c @@ -23,7 +23,7 @@ #include <string.h> #include "pluma-spell-utils.h" -#include <gtksourceview/gtksourcebuffer.h> +#include <gtksourceview/gtksource.h> gboolean pluma_spell_utils_is_digit (const char *text, gssize length) diff --git a/plugins/taglist/pluma-taglist-plugin-panel.c b/plugins/taglist/pluma-taglist-plugin-panel.c index 3a8bdae8..8e5fd458 100644 --- a/plugins/taglist/pluma-taglist-plugin-panel.c +++ b/plugins/taglist/pluma-taglist-plugin-panel.c @@ -69,11 +69,7 @@ struct _PlumaTaglistPluginPanelPrivate gchar *data_dir; }; -#if GTK_CHECK_VERSION (3, 0, 0) PLUMA_PLUGIN_DEFINE_TYPE (PlumaTaglistPluginPanel, pluma_taglist_plugin_panel, GTK_TYPE_BOX) -#else -PLUMA_PLUGIN_DEFINE_TYPE (PlumaTaglistPluginPanel, pluma_taglist_plugin_panel, GTK_TYPE_VBOX) -#endif enum { @@ -581,14 +577,9 @@ 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) + gpointer user_data) { PlumaTaglistPluginPanel *ppanel = PLUMA_TAGLIST_PLUGIN_PANEL (panel); @@ -601,13 +592,8 @@ expose_event_cb (GtkWidget *panel, /* And populate combo box */ populate_tag_groups_combo (PLUMA_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; } @@ -645,17 +631,12 @@ add_preview_widget (PlumaTaglistPluginPanel *panel) gtk_label_set_line_wrap (GTK_LABEL (panel->priv->preview), TRUE); gtk_label_set_use_markup (GTK_LABEL (panel->priv->preview), TRUE); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_halign (panel->priv->preview, GTK_ALIGN_START); gtk_widget_set_valign (panel->priv->preview, GTK_ALIGN_START); gtk_widget_set_margin_start (panel->priv->preview, 6); gtk_widget_set_margin_end (panel->priv->preview, 6); gtk_widget_set_margin_top (panel->priv->preview, 6); gtk_widget_set_margin_bottom (panel->priv->preview, 6); -#else - gtk_misc_set_alignment (GTK_MISC (panel->priv->preview), 0, 0); - gtk_misc_set_padding (GTK_MISC (panel->priv->preview), 6, 6); -#endif gtk_label_set_selectable (GTK_LABEL (panel->priv->preview), TRUE); gtk_label_set_selectable (GTK_LABEL (panel->priv->preview), TRUE); gtk_label_set_ellipsize (GTK_LABEL (panel->priv->preview), @@ -688,10 +669,8 @@ pluma_taglist_plugin_panel_init (PlumaTaglistPluginPanel *panel) panel->priv = PLUMA_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 (); @@ -731,9 +710,6 @@ pluma_taglist_plugin_panel_init (PlumaTaglistPluginPanel *panel) panel->priv->tag_groups_combo, ATK_RELATION_CONTROLLED_BY); -#if !GTK_CHECK_VERSION(3, 0, 0) - gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (panel->priv->tags_list), FALSE); -#endif gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (panel->priv->tags_list), FALSE); g_object_set (panel->priv->tags_list, "has-tooltip", TRUE, NULL); @@ -786,13 +762,8 @@ pluma_taglist_plugin_panel_init (PlumaTaglistPluginPanel *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); } diff --git a/plugins/taglist/pluma-taglist-plugin-panel.h b/plugins/taglist/pluma-taglist-plugin-panel.h index 03738835..ab001b17 100644 --- a/plugins/taglist/pluma-taglist-plugin-panel.h +++ b/plugins/taglist/pluma-taglist-plugin-panel.h @@ -58,11 +58,7 @@ typedef struct _PlumaTaglistPluginPanel PlumaTaglistPluginPanel; struct _PlumaTaglistPluginPanel { -#if GTK_CHECK_VERSION (3, 0, 0) GtkBox vbox; -#else - GtkVBox vbox; -#endif /*< private > */ PlumaTaglistPluginPanelPrivate *priv; @@ -75,11 +71,7 @@ typedef struct _PlumaTaglistPluginPanelClass PlumaTaglistPluginPanelClass; struct _PlumaTaglistPluginPanelClass { -#if GTK_CHECK_VERSION (3, 0, 0) GtkBoxClass parent_class; -#else - GtkVBoxClass parent_class; -#endif }; /* diff --git a/pluma/dialogs/Makefile.am b/pluma/dialogs/Makefile.am index bdeb4cec..19a5c18e 100755 --- a/pluma/dialogs/Makefile.am +++ b/pluma/dialogs/Makefile.am @@ -24,7 +24,6 @@ libdialogs_la_SOURCES = \ ui_DATA = \ pluma-encodings-dialog.ui \ pluma-preferences-dialog.ui \ - pluma-search-dialog-gtk3.ui \ pluma-search-dialog.ui EXTRA_DIST = $(ui_DATA) diff --git a/pluma/dialogs/pluma-close-confirmation-dialog.c b/pluma/dialogs/pluma-close-confirmation-dialog.c index 14b75f76..a0b860f6 100755 --- a/pluma/dialogs/pluma-close-confirmation-dialog.c +++ b/pluma/dialogs/pluma-close-confirmation-dialog.c @@ -85,11 +85,6 @@ struct _PlumaCloseConfirmationDialogPrivate (priv->unsaved_documents->next == NULL)) ? \ SINGLE_DOC_MODE : MULTIPLE_DOCS_MODE) -#if GTK_CHECK_VERSION (3, 0, 0) -#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 - G_DEFINE_TYPE(PlumaCloseConfirmationDialog, pluma_close_confirmation_dialog, GTK_TYPE_DIALOG) static void set_unsaved_document (PlumaCloseConfirmationDialog *dlg, @@ -502,19 +497,10 @@ build_single_doc_dialog (PlumaCloseConfirmationDialog *dlg) doc = PLUMA_DOCUMENT (dlg->priv->unsaved_documents->data); /* Image */ -#if GTK_CHECK_VERSION (3, 10, 0) image = gtk_image_new_from_icon_name ("dialog-warning", GTK_ICON_SIZE_DIALOG); -#else - image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, - GTK_ICON_SIZE_DIALOG); -#endif -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_halign (image, GTK_ALIGN_START); gtk_widget_set_valign (image, GTK_ALIGN_END); -#else - gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0); -#endif /* Primary label */ primary_label = gtk_label_new (NULL); @@ -565,12 +551,12 @@ build_single_doc_dialog (PlumaCloseConfirmationDialog *dlg) gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE); gtk_widget_set_can_focus (GTK_WIDGET (secondary_label), FALSE); - hbox = gtk_hbox_new (FALSE, 12); + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); - vbox = gtk_vbox_new (FALSE, 12); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0); @@ -699,28 +685,19 @@ build_multiple_docs_dialog (PlumaCloseConfirmationDialog *dlg) priv = dlg->priv; - hbox = gtk_hbox_new (FALSE, 12); + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), hbox, TRUE, TRUE, 0); /* Image */ -#if GTK_CHECK_VERSION (3, 10, 0) image = gtk_image_new_from_icon_name ("dialog-warning", GTK_ICON_SIZE_DIALOG); -#else - image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, - GTK_ICON_SIZE_DIALOG); -#endif -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_halign (image, GTK_ALIGN_CENTER); gtk_widget_set_valign (image, GTK_ALIGN_START); -#else - gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0); -#endif gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); - vbox = gtk_vbox_new (FALSE, 12); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0); /* Primary label */ @@ -756,7 +733,7 @@ build_multiple_docs_dialog (PlumaCloseConfirmationDialog *dlg) g_free (markup_str); gtk_box_pack_start (GTK_BOX (vbox), primary_label, FALSE, FALSE, 0); - vbox2 = gtk_vbox_new (FALSE, 8); + vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0); if (priv->disable_save_to_disk) diff --git a/pluma/dialogs/pluma-preferences-dialog.c b/pluma/dialogs/pluma-preferences-dialog.c index 46822ca4..3bacd273 100755 --- a/pluma/dialogs/pluma-preferences-dialog.c +++ b/pluma/dialogs/pluma-preferences-dialog.c @@ -38,9 +38,7 @@ #include <glib/gi18n.h> #include <gtk/gtk.h> -#if GTK_CHECK_VERSION (3, 0, 0) #include <gtksourceview/gtksource.h> -#endif #include <pluma/pluma-prefs-manager.h> diff --git a/pluma/dialogs/pluma-search-dialog-gtk3.ui b/pluma/dialogs/pluma-search-dialog-gtk3.ui deleted file mode 100644 index a1a37b5d..00000000 --- a/pluma/dialogs/pluma-search-dialog-gtk3.ui +++ /dev/null @@ -1,272 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.0 - -pluma - search-dialog -Copyright (C) MATE Developer - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -Author: Wolfgang Ulbrich - ---> -<!--*- mode: xml -*--> -<interface> - <requires lib="gtk+" version="3.14"/> - <!-- interface-license-type gplv2 --> - <!-- interface-name pluma --> - <!-- interface-description search-dialog --> - <!-- interface-copyright MATE Developer --> - <!-- interface-authors Wolfgang Ulbrich --> - <object class="GtkDialog" id="dialog"> - <property name="can_focus">False</property> - <property name="title" translatable="yes">Replace</property> - <property name="resizable">False</property> - <property name="type_hint">dialog</property> - <child internal-child="vbox"> - <object class="GtkBox" id="dialog-vbox1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="orientation">vertical</property> - <property name="spacing">8</property> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="layout_style"/> - <child> - <object class="GtkButton" id="close_button"> - <property name="label">gtk-close</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="replace_all_button"> - <property name="label" translatable="yes">Replace All</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkButton" id="replace_button"> - <property name="label" translatable="yes">Replace</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - <property name="use_underline">True</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkButton" id="find_next_button"> - <property name="label">gtk-find</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="receives_default">False</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">3</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="pack_type">end</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkBox" id="search_dialog_content"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="border_width">5</property> - <property name="orientation">vertical</property> - <property name="spacing">18</property> - <child> - <object class="GtkGrid" id="grid"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">12</property> - <property name="column_spacing">12</property> - <child> - <object class="GtkLabel" id="search_label"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">start</property> - <property name="label" translatable="yes">_Search for: </property> - <property name="use_underline">True</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="replace_with_label"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Replace _with: </property> - <property name="use_underline">True</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkBox" id="vbox3"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="orientation">vertical</property> - <property name="spacing">12</property> - <child> - <object class="GtkCheckButton" id="match_case_checkbutton"> - <property name="label" translatable="yes">_Match case</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="halign">start</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="entire_word_checkbutton"> - <property name="label" translatable="yes">Match _entire word only</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="halign">start</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="search_backwards_checkbutton"> - <property name="label" translatable="yes">Search _backwards</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="halign">start</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">2</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="wrap_around_checkbutton"> - <property name="label" translatable="yes">_Wrap around</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="halign">start</property> - <property name="use_underline">True</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">3</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="parse_escapes_checkbutton"> - <property name="label" translatable="yes">_Parse escape sequences (e.g. \n)</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="halign">start</property> - <property name="use_underline">True</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">False</property> - <property name="position">4</property> - </packing> - </child> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - </child> - <action-widgets> - <action-widget response="0">close_button</action-widget> - <action-widget response="0">replace_all_button</action-widget> - <action-widget response="0">replace_button</action-widget> - <action-widget response="0">find_next_button</action-widget> - </action-widgets> - </object> -</interface> diff --git a/pluma/dialogs/pluma-search-dialog.c b/pluma/dialogs/pluma-search-dialog.c index 8f846e25..329e1721 100755 --- a/pluma/dialogs/pluma-search-dialog.c +++ b/pluma/dialogs/pluma-search-dialog.c @@ -60,11 +60,7 @@ struct _PlumaSearchDialogPrivate { gboolean show_replace; -#if GTK_CHECK_VERSION (3, 0, 0) GtkWidget *grid; -#else - GtkWidget *table; -#endif GtkWidget *search_label; GtkWidget *search_entry; GtkWidget *search_text_entry; @@ -301,10 +297,6 @@ show_replace_widgets (PlumaSearchDialog *dlg, gtk_widget_show (dlg->priv->replace_all_button); gtk_widget_show (dlg->priv->replace_button); -#if !GTK_CHECK_VERSION (3, 0, 0) - gtk_table_set_row_spacings (GTK_TABLE (dlg->priv->table), 12); -#endif - gtk_window_set_title (GTK_WINDOW (dlg), _("Replace")); } else @@ -314,10 +306,6 @@ show_replace_widgets (PlumaSearchDialog *dlg, gtk_widget_hide (dlg->priv->replace_all_button); gtk_widget_hide (dlg->priv->replace_button); -#if !GTK_CHECK_VERSION (3, 0, 0) - gtk_table_set_row_spacings (GTK_TABLE (dlg->priv->table), 0); -#endif - gtk_window_set_title (GTK_WINDOW (dlg), _("Find")); } @@ -354,20 +342,13 @@ pluma_search_dialog_init (PlumaSearchDialog *dlg) gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dlg))), 6); -#if GTK_CHECK_VERSION (3, 0, 0) - file = pluma_dirs_get_ui_file ("pluma-search-dialog-gtk3.ui"); -#else file = pluma_dirs_get_ui_file ("pluma-search-dialog.ui"); -#endif + ret = pluma_utils_get_ui_objects (file, root_objects, &error_widget, "search_dialog_content", &content, -#if GTK_CHECK_VERSION (3, 0, 0) "grid", &dlg->priv->grid, -#else - "table", &dlg->priv->table, -#endif "search_label", &dlg->priv->search_label, "replace_with_label", &dlg->priv->replace_label, "match_case_checkbutton", &dlg->priv->match_case_checkbutton, @@ -400,24 +381,16 @@ pluma_search_dialog_init (PlumaSearchDialog *dlg) (PLUMA_HISTORY_ENTRY (dlg->priv->search_entry), (PlumaHistoryEntryEscapeFunc) pluma_utils_escape_search_text); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_hexpand (GTK_WIDGET (dlg->priv->search_entry), TRUE); -#endif dlg->priv->search_text_entry = pluma_history_entry_get_entry (PLUMA_HISTORY_ENTRY (dlg->priv->search_entry)); gtk_entry_set_activates_default (GTK_ENTRY (dlg->priv->search_text_entry), TRUE); gtk_widget_show (dlg->priv->search_entry); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_grid_attach_next_to (GTK_GRID (dlg->priv->grid), dlg->priv->search_entry, dlg->priv->search_label, GTK_POS_RIGHT, 1, 1); -#else - gtk_table_attach_defaults (GTK_TABLE (dlg->priv->table), - dlg->priv->search_entry, - 1, 2, 0, 1); -#endif dlg->priv->replace_entry = pluma_history_entry_new ("history-replace-with", TRUE); @@ -425,24 +398,16 @@ pluma_search_dialog_init (PlumaSearchDialog *dlg) (PLUMA_HISTORY_ENTRY (dlg->priv->replace_entry), (PlumaHistoryEntryEscapeFunc) pluma_utils_escape_search_text); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_hexpand (GTK_WIDGET (dlg->priv->replace_entry), TRUE); -#endif dlg->priv->replace_text_entry = pluma_history_entry_get_entry (PLUMA_HISTORY_ENTRY (dlg->priv->replace_entry)); gtk_entry_set_activates_default (GTK_ENTRY (dlg->priv->replace_text_entry), TRUE); gtk_widget_show (dlg->priv->replace_entry); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_grid_attach_next_to (GTK_GRID (dlg->priv->grid), dlg->priv->replace_entry, dlg->priv->replace_label, GTK_POS_RIGHT, 1, 1); -#else - gtk_table_attach_defaults (GTK_TABLE (dlg->priv->table), - dlg->priv->replace_entry, - 1, 2, 1, 2); -#endif gtk_label_set_mnemonic_widget (GTK_LABEL (dlg->priv->search_label), dlg->priv->search_entry); diff --git a/pluma/dialogs/pluma-search-dialog.ui b/pluma/dialogs/pluma-search-dialog.ui index 73f64552..a1a37b5d 100644 --- a/pluma/dialogs/pluma-search-dialog.ui +++ b/pluma/dialogs/pluma-search-dialog.ui @@ -1,263 +1,263 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.20.0 + +pluma - search-dialog +Copyright (C) MATE Developer + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +Author: Wolfgang Ulbrich + +--> <!--*- mode: xml -*--> <interface> + <requires lib="gtk+" version="3.14"/> + <!-- interface-license-type gplv2 --> + <!-- interface-name pluma --> + <!-- interface-description search-dialog --> + <!-- interface-copyright MATE Developer --> + <!-- interface-authors Wolfgang Ulbrich --> <object class="GtkDialog" id="dialog"> + <property name="can_focus">False</property> <property name="title" translatable="yes">Replace</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> <property name="resizable">False</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - <property name="focus_on_map">True</property> - <property name="urgency_hint">False</property> + <property name="type_hint">dialog</property> <child internal-child="vbox"> - <object class="GtkVBox" id="dialog-vbox1"> + <object class="GtkBox" id="dialog-vbox1"> <property name="visible">True</property> - <property name="homogeneous">False</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> <property name="spacing">8</property> <child internal-child="action_area"> - <object class="GtkHButtonBox" id="dialog-action_area1"> + <object class="GtkButtonBox" id="dialog-action_area1"> <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_DEFAULT_STYLE</property> + <property name="can_focus">False</property> + <property name="layout_style"/> <child> <object class="GtkButton" id="close_button"> + <property name="label">gtk-close</property> <property name="visible">True</property> - <property name="can_default">True</property> <property name="can_focus">True</property> - <property name="label">gtk-close</property> + <property name="can_default">True</property> + <property name="receives_default">False</property> <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> </child> <child> <object class="GtkButton" id="replace_all_button"> + <property name="label" translatable="yes">Replace All</property> <property name="visible">True</property> - <property name="can_default">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Replace All</property> + <property name="can_default">True</property> + <property name="receives_default">False</property> <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> </child> <child> <object class="GtkButton" id="replace_button"> + <property name="label" translatable="yes">Replace</property> <property name="visible">True</property> - <property name="can_default">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Replace</property> + <property name="can_default">True</property> + <property name="receives_default">False</property> <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> </child> <child> <object class="GtkButton" id="find_next_button"> + <property name="label">gtk-find</property> <property name="visible">True</property> - <property name="can_default">True</property> <property name="can_focus">True</property> - <property name="label">gtk-find</property> + <property name="can_default">True</property> + <property name="receives_default">False</property> <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> </child> </object> <packing> - <property name="padding">0</property> <property name="expand">False</property> <property name="fill">False</property> - <property name="pack_type">GTK_PACK_END</property> + <property name="pack_type">end</property> + <property name="position">0</property> </packing> </child> <child> - <object class="GtkVBox" id="search_dialog_content"> - <property name="border_width">5</property> + <object class="GtkBox" id="search_dialog_content"> <property name="visible">True</property> - <property name="homogeneous">False</property> + <property name="can_focus">False</property> + <property name="border_width">5</property> + <property name="orientation">vertical</property> <property name="spacing">18</property> <child> - <object class="GtkTable" id="table"> + <object class="GtkGrid" id="grid"> <property name="visible">True</property> - <property name="n_rows">2</property> - <property name="n_columns">2</property> - <property name="homogeneous">False</property> + <property name="can_focus">False</property> <property name="row_spacing">12</property> <property name="column_spacing">12</property> <child> <object class="GtkLabel" id="search_label"> <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> <property name="label" translatable="yes">_Search for: </property> <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> </object> <packing> <property name="left_attach">0</property> - <property name="right_attach">1</property> <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"/> </packing> </child> <child> <object class="GtkLabel" id="replace_with_label"> <property name="visible">True</property> + <property name="can_focus">False</property> <property name="label" translatable="yes">Replace _with: </property> <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> </object> <packing> <property name="left_attach">0</property> - <property name="right_attach">1</property> <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"/> </packing> </child> </object> <packing> - <property name="padding">0</property> <property name="expand">True</property> <property name="fill">True</property> + <property name="position">0</property> </packing> </child> <child> - <object class="GtkVBox" id="vbox3"> + <object class="GtkBox" id="vbox3"> <property name="visible">True</property> - <property name="homogeneous">False</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> <property name="spacing">12</property> <child> <object class="GtkCheckButton" id="match_case_checkbutton"> + <property name="label" translatable="yes">_Match case</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">_Match case</property> + <property name="receives_default">False</property> + <property name="halign">start</property> <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> <property name="draw_indicator">True</property> </object> <packing> - <property name="padding">0</property> <property name="expand">False</property> <property name="fill">False</property> + <property name="position">0</property> </packing> </child> <child> <object class="GtkCheckButton" id="entire_word_checkbutton"> + <property name="label" translatable="yes">Match _entire word only</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Match _entire word only</property> + <property name="receives_default">False</property> + <property name="halign">start</property> <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> <property name="draw_indicator">True</property> </object> <packing> - <property name="padding">0</property> <property name="expand">False</property> <property name="fill">False</property> + <property name="position">1</property> </packing> </child> <child> <object class="GtkCheckButton" id="search_backwards_checkbutton"> + <property name="label" translatable="yes">Search _backwards</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Search _backwards</property> + <property name="receives_default">False</property> + <property name="halign">start</property> <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> <property name="draw_indicator">True</property> </object> <packing> - <property name="padding">0</property> <property name="expand">False</property> <property name="fill">False</property> + <property name="position">2</property> </packing> </child> <child> <object class="GtkCheckButton" id="wrap_around_checkbutton"> + <property name="label" translatable="yes">_Wrap around</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">_Wrap around</property> + <property name="receives_default">False</property> + <property name="halign">start</property> <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> <property name="active">True</property> - <property name="inconsistent">False</property> <property name="draw_indicator">True</property> </object> <packing> - <property name="padding">0</property> <property name="expand">False</property> <property name="fill">False</property> + <property name="position">3</property> </packing> </child> <child> <object class="GtkCheckButton" id="parse_escapes_checkbutton"> + <property name="label" translatable="yes">_Parse escape sequences (e.g. \n)</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">_Parse escape sequences (e.g. \n)</property> + <property name="receives_default">False</property> + <property name="halign">start</property> <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> <property name="active">True</property> - <property name="inconsistent">False</property> <property name="draw_indicator">True</property> </object> <packing> - <property name="padding">0</property> <property name="expand">False</property> <property name="fill">False</property> + <property name="position">4</property> </packing> </child> </object> <packing> - <property name="padding">0</property> <property name="expand">True</property> <property name="fill">True</property> + <property name="position">1</property> </packing> </child> </object> <packing> - <property name="padding">0</property> <property name="expand">True</property> <property name="fill">True</property> + <property name="position">1</property> </packing> </child> </object> diff --git a/pluma/pluma-close-button.c b/pluma/pluma-close-button.c index 3fab3e35..b3bf036b 100644 --- a/pluma/pluma-close-button.c +++ b/pluma/pluma-close-button.c @@ -25,7 +25,6 @@ G_DEFINE_TYPE (PlumaCloseButton, pluma_close_button, GTK_TYPE_BUTTON) static void -#if GTK_CHECK_VERSION (3, 0, 0) pluma_close_button_class_init (PlumaCloseButtonClass *klass) { } @@ -72,67 +71,13 @@ pluma_close_button_init (PlumaCloseButton *button) g_error_free (error); } } -#else -pluma_close_button_style_set (GtkWidget *button, - GtkStyle *previous_style) -{ - gint h, w; - - gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (button), - GTK_ICON_SIZE_MENU, &w, &h); - - gtk_widget_set_size_request (button, w + 2, h + 2); - - GTK_WIDGET_CLASS (pluma_close_button_parent_class)->style_set (button, previous_style); -} -#endif - -#if !GTK_CHECK_VERSION (3, 0, 0) -static void -pluma_close_button_class_init (PlumaCloseButtonClass *klass) -{ - GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); - - widget_class->style_set = pluma_close_button_style_set; -} - -static void -pluma_close_button_init (PlumaCloseButton *button) -{ - GtkRcStyle *rcstyle; - GtkWidget *image; - - /* make it as small as possible */ - rcstyle = gtk_rc_style_new (); - rcstyle->xthickness = rcstyle->ythickness = 0; - gtk_widget_modify_style (GTK_WIDGET (button), rcstyle); - g_object_unref (rcstyle); - - image = gtk_image_new_from_stock (GTK_STOCK_CLOSE, - GTK_ICON_SIZE_MENU); - gtk_widget_show (image); - - gtk_container_add (GTK_CONTAINER (button), image); -} -#endif GtkWidget * pluma_close_button_new () { -#if GTK_CHECK_VERSION (3, 0, 0) return GTK_WIDGET (g_object_new (PLUMA_TYPE_CLOSE_BUTTON, "relief", GTK_RELIEF_NONE, "focus-on-click", FALSE, NULL)); -#else - PlumaCloseButton *button; - - button = g_object_new (PLUMA_TYPE_CLOSE_BUTTON, - "relief", GTK_RELIEF_NONE, - "focus-on-click", FALSE, - NULL); - - return GTK_WIDGET (button); -#endif } diff --git a/pluma/pluma-commands-search.c b/pluma/pluma-commands-search.c index 214e84ad..1a75dbca 100644 --- a/pluma/pluma-commands-search.c +++ b/pluma/pluma-commands-search.c @@ -38,9 +38,6 @@ #include <glib/gi18n.h> #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> -#if GTK_CHECK_VERSION (3, 0, 0) -#define GTK_OBJECT G_OBJECT -#endif #include "pluma-commands.h" #include "pluma-debug.h" @@ -763,7 +760,7 @@ _pluma_cmd_search_goto_line (GtkAction *action, /* goto line is builtin in PlumaView, just activate * the corrisponding binding. */ - gtk_bindings_activate (GTK_OBJECT (active_view), + gtk_bindings_activate (G_OBJECT (active_view), GDK_KEY_i, GDK_CONTROL_MASK); } @@ -787,7 +784,7 @@ _pluma_cmd_search_incremental_search (GtkAction *action, /* incremental search is builtin in PlumaView, just activate * the corrisponding binding. */ - gtk_bindings_activate (GTK_OBJECT (active_view), + gtk_bindings_activate (G_OBJECT (active_view), GDK_KEY_k, GDK_CONTROL_MASK); } diff --git a/pluma/pluma-document.c b/pluma/pluma-document.c index 61e31906..85890566 100644 --- a/pluma/pluma-document.c +++ b/pluma/pluma-document.c @@ -39,11 +39,6 @@ #include <glib/gi18n.h> #include <gtk/gtk.h> -#if GTK_CHECK_VERSION (3, 0, 0) -#include <gtksourceview/gtksource.h> -#else -#include <gtksourceview/gtksourceiter.h> -#endif #include "pluma-prefs-manager-app.h" #include "pluma-document.h" @@ -178,11 +173,7 @@ enum { static guint document_signals[LAST_SIGNAL] = { 0 }; -#if GTK_CHECK_VERSION (3, 0, 0) G_DEFINE_TYPE(PlumaDocument, pluma_document, GTK_SOURCE_TYPE_BUFFER) -#else -G_DEFINE_TYPE(PlumaDocument, pluma_document, GTK_TYPE_SOURCE_BUFFER) -#endif GQuark pluma_document_error_quark (void) @@ -1895,11 +1886,7 @@ pluma_document_search_forward (PlumaDocument *doc, GtkTextIter *match_end) { GtkTextIter iter; -#if GTK_CHECK_VERSION (3, 0, 0) GtkTextSearchFlags search_flags; -#else - GtkSourceSearchFlags search_flags; -#endif gboolean found = FALSE; GtkTextIter m_start; GtkTextIter m_end; @@ -1923,28 +1910,16 @@ pluma_document_search_forward (PlumaDocument *doc, else iter = *start; -#if GTK_CHECK_VERSION (3, 0, 0) search_flags = GTK_TEXT_SEARCH_VISIBLE_ONLY | GTK_TEXT_SEARCH_TEXT_ONLY; -#else - search_flags = GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_TEXT_ONLY; -#endif if (!PLUMA_SEARCH_IS_CASE_SENSITIVE (doc->priv->search_flags)) { -#if GTK_CHECK_VERSION (3, 0, 0) search_flags = search_flags | GTK_TEXT_SEARCH_CASE_INSENSITIVE; -#else - search_flags = search_flags | GTK_SOURCE_SEARCH_CASE_INSENSITIVE; -#endif } while (!found) { -#if GTK_CHECK_VERSION (3, 0, 0) found = gtk_text_iter_forward_search (&iter, -#else - found = gtk_source_iter_forward_search (&iter, -#endif doc->priv->search_text, search_flags, &m_start, @@ -1988,11 +1963,7 @@ pluma_document_search_backward (PlumaDocument *doc, GtkTextIter *match_end) { GtkTextIter iter; -#if GTK_CHECK_VERSION (3, 0, 0) GtkTextSearchFlags search_flags; -#else - GtkSourceSearchFlags search_flags; -#endif gboolean found = FALSE; GtkTextIter m_start; GtkTextIter m_end; @@ -2016,28 +1987,16 @@ pluma_document_search_backward (PlumaDocument *doc, else iter = *end; -#if GTK_CHECK_VERSION (3, 0, 0) search_flags = GTK_TEXT_SEARCH_VISIBLE_ONLY | GTK_TEXT_SEARCH_TEXT_ONLY; -#else - search_flags = GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_TEXT_ONLY; -#endif if (!PLUMA_SEARCH_IS_CASE_SENSITIVE (doc->priv->search_flags)) { -#if GTK_CHECK_VERSION (3, 0, 0) search_flags = search_flags | GTK_TEXT_SEARCH_CASE_INSENSITIVE; -#else - search_flags = search_flags | GTK_SOURCE_SEARCH_CASE_INSENSITIVE; -#endif } while (!found) { -#if GTK_CHECK_VERSION (3, 0, 0) found = gtk_text_iter_backward_search (&iter, -#else - found = gtk_source_iter_backward_search (&iter, -#endif doc->priv->search_text, search_flags, &m_start, @@ -2075,11 +2034,7 @@ pluma_document_replace_all (PlumaDocument *doc, GtkTextIter iter; GtkTextIter m_start; GtkTextIter m_end; -#if GTK_CHECK_VERSION (3, 0, 0) GtkTextSearchFlags search_flags = 0; -#else - GtkSourceSearchFlags search_flags = 0; -#endif gboolean found = TRUE; gint cont = 0; gchar *search_text; @@ -2104,19 +2059,11 @@ pluma_document_replace_all (PlumaDocument *doc, gtk_text_buffer_get_start_iter (buffer, &iter); -#if GTK_CHECK_VERSION (3, 0, 0) search_flags = GTK_TEXT_SEARCH_VISIBLE_ONLY | GTK_TEXT_SEARCH_TEXT_ONLY; -#else - search_flags = GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_TEXT_ONLY; -#endif if (!PLUMA_SEARCH_IS_CASE_SENSITIVE (flags)) { -#if GTK_CHECK_VERSION (3, 0, 0) search_flags = search_flags | GTK_TEXT_SEARCH_CASE_INSENSITIVE; -#else - search_flags = search_flags | GTK_SOURCE_SEARCH_CASE_INSENSITIVE; -#endif } replace_text_len = strlen (replace_text); @@ -2139,11 +2086,7 @@ pluma_document_replace_all (PlumaDocument *doc, do { -#if GTK_CHECK_VERSION (3, 0, 0) found = gtk_text_iter_forward_search (&iter, -#else - found = gtk_source_iter_forward_search (&iter, -#endif search_text, search_flags, &m_start, @@ -2246,15 +2189,9 @@ _pluma_document_get_seconds_since_last_save_or_load (PlumaDocument *doc) static void get_search_match_colors (PlumaDocument *doc, gboolean *foreground_set, -#if GTK_CHECK_VERSION (3, 14, 0) GdkRGBA *foreground, gboolean *background_set, GdkRGBA *background) -#else - GdkColor *foreground, - gboolean *background_set, - GdkColor *background) -#endif { GtkSourceStyleScheme *style_scheme; GtkSourceStyle *style; @@ -2279,7 +2216,6 @@ get_search_match_colors (PlumaDocument *doc, if (*foreground_set) { -#if GTK_CHECK_VERSION (3, 14, 0) if (fg == NULL || !gdk_rgba_parse (foreground, fg)) { @@ -2293,21 +2229,6 @@ get_search_match_colors (PlumaDocument *doc, !gdk_rgba_parse (background, bg)) { *background_set = FALSE; -#else - if (fg == NULL || - !gdk_color_parse (fg, foreground)) - { - *foreground_set = FALSE; - } - } - - if (*background_set) - { - if (bg == NULL || - !gdk_color_parse (bg, background)) - { - *background_set = FALSE; -#endif } } @@ -2321,11 +2242,7 @@ get_search_match_colors (PlumaDocument *doc, "Falling back to hard-coded colors " "for the \"found\" text tag."); -#if GTK_CHECK_VERSION (3, 14, 0) gdk_rgba_parse (background, "#FFFF78"); -#else - gdk_color_parse ("#FFFF78", background); -#endif *background_set = TRUE; *foreground_set = FALSE; @@ -2337,13 +2254,8 @@ sync_found_tag (PlumaDocument *doc, GParamSpec *pspec, gpointer data) { -#if GTK_CHECK_VERSION (3, 14, 0) GdkRGBA fg; GdkRGBA bg; -#else - GdkColor fg; - GdkColor bg; -#endif gboolean fg_set; gboolean bg_set; @@ -2356,17 +2268,10 @@ sync_found_tag (PlumaDocument *doc, &bg_set, &bg); g_object_set (doc->priv->found_tag, -#if GTK_CHECK_VERSION (3, 14, 0) "foreground-rgba", fg_set ? &fg : NULL, NULL); g_object_set (doc->priv->found_tag, "background-rgba", bg_set ? &bg : NULL, -#else - "foreground-gdk", fg_set ? &fg : NULL, - NULL); - g_object_set (doc->priv->found_tag, - "background-gdk", bg_set ? &bg : NULL, -#endif NULL); } @@ -2390,11 +2295,7 @@ search_region (PlumaDocument *doc, GtkTextIter iter; GtkTextIter m_start; GtkTextIter m_end; -#if GTK_CHECK_VERSION (3, 0, 0) GtkTextSearchFlags search_flags = 0; -#else - GtkSourceSearchFlags search_flags = 0; -#endif gboolean found = TRUE; GtkTextBuffer *buffer; @@ -2458,19 +2359,11 @@ search_region (PlumaDocument *doc, iter = *start; -#if GTK_CHECK_VERSION (3, 0, 0) search_flags = GTK_TEXT_SEARCH_VISIBLE_ONLY | GTK_TEXT_SEARCH_TEXT_ONLY; -#else - search_flags = GTK_SOURCE_SEARCH_VISIBLE_ONLY | GTK_SOURCE_SEARCH_TEXT_ONLY; -#endif if (!PLUMA_SEARCH_IS_CASE_SENSITIVE (doc->priv->search_flags)) { -#if GTK_CHECK_VERSION (3, 0, 0) search_flags = search_flags | GTK_TEXT_SEARCH_CASE_INSENSITIVE; -#else - search_flags = search_flags | GTK_SOURCE_SEARCH_CASE_INSENSITIVE; -#endif } do @@ -2478,11 +2371,7 @@ search_region (PlumaDocument *doc, if ((end != NULL) && gtk_text_iter_is_end (end)) end = NULL; -#if GTK_CHECK_VERSION (3, 0, 0) found = gtk_text_iter_forward_search (&iter, -#else - found = gtk_source_iter_forward_search (&iter, -#endif doc->priv->search_text, search_flags, &m_start, diff --git a/pluma/pluma-document.h b/pluma/pluma-document.h index 80b66780..6d90323e 100644 --- a/pluma/pluma-document.h +++ b/pluma/pluma-document.h @@ -35,7 +35,7 @@ #include <gio/gio.h> #include <gtk/gtk.h> -#include <gtksourceview/gtksourcebuffer.h> +#include <gtksourceview/gtksource.h> #include <pluma/pluma-encodings.h> diff --git a/pluma/pluma-documents-panel.c b/pluma/pluma-documents-panel.c index 97308efe..68a6a5d6 100644 --- a/pluma/pluma-documents-panel.c +++ b/pluma/pluma-documents-panel.c @@ -53,11 +53,7 @@ struct _PlumaDocumentsPanelPrivate guint is_reodering : 1; }; -#if GTK_CHECK_VERSION (3, 0, 0) G_DEFINE_TYPE(PlumaDocumentsPanel, pluma_documents_panel, GTK_TYPE_BOX) -#else -G_DEFINE_TYPE(PlumaDocumentsPanel, pluma_documents_panel, GTK_TYPE_VBOX) -#endif enum { @@ -540,11 +536,7 @@ menu_position (GtkMenu *menu, gdk_window_get_origin (gtk_widget_get_window (w), x, y); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &requisition); -#else - gtk_widget_size_request (GTK_WIDGET (menu), &requisition); -#endif if (gtk_widget_get_direction (w) == GTK_TEXT_DIR_RTL) { @@ -758,10 +750,8 @@ pluma_documents_panel_init (PlumaDocumentsPanel *panel) panel->priv->adding_tab = FALSE; panel->priv->is_reodering = FALSE; -#if GTK_CHECK_VERSION (3, 0, 0) gtk_orientable_set_orientation (GTK_ORIENTABLE (panel), GTK_ORIENTATION_VERTICAL); -#endif /* Create the scrolled window */ sw = gtk_scrolled_window_new (NULL, NULL); diff --git a/pluma/pluma-documents-panel.h b/pluma/pluma-documents-panel.h index 4c546f81..f1c5bc12 100644 --- a/pluma/pluma-documents-panel.h +++ b/pluma/pluma-documents-panel.h @@ -57,11 +57,7 @@ typedef struct _PlumaDocumentsPanel PlumaDocumentsPanel; struct _PlumaDocumentsPanel { -#if GTK_CHECK_VERSION (3, 0, 0) GtkBox vbox; -#else - GtkVBox vbox; -#endif /*< private > */ PlumaDocumentsPanelPrivate *priv; @@ -74,11 +70,7 @@ typedef struct _PlumaDocumentsPanelClass PlumaDocumentsPanelClass; struct _PlumaDocumentsPanelClass { -#if GTK_CHECK_VERSION (3, 0, 0) GtkBoxClass parent_class; -#else - GtkVBoxClass parent_class; -#endif }; /* diff --git a/pluma/pluma-file-chooser-dialog.c b/pluma/pluma-file-chooser-dialog.c index c480cc4e..f23a4c0a 100644 --- a/pluma/pluma-file-chooser-dialog.c +++ b/pluma/pluma-file-chooser-dialog.c @@ -39,9 +39,7 @@ #include <glib/gi18n.h> #include <gtk/gtk.h> -#if GTK_CHECK_VERSION (3, 0, 0) #include <gtksourceview/gtksource.h> -#endif #include "pluma-file-chooser-dialog.h" #include "pluma-encodings-combo-box.h" @@ -55,10 +53,6 @@ #define ALL_FILES _("All Files") #define ALL_TEXT_FILES _("All Text Files") -#if GTK_CHECK_VERSION (3, 0, 0) -#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y) -#endif - struct _PlumaFileChooserDialogPrivate { GtkWidget *option_menu; @@ -216,7 +210,7 @@ create_newline_combo (PlumaFileChooserDialog *dialog) static void create_extra_widget (PlumaFileChooserDialog *dialog) { - dialog->priv->extra_widget = gtk_hbox_new (FALSE, 6); + dialog->priv->extra_widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); gtk_widget_show (dialog->priv->extra_widget); @@ -309,11 +303,7 @@ all_text_files_filter (const GtkFileFilterInfo *filter_info, GtkSourceLanguage *lang; lang = gtk_source_language_manager_get_language (lm, *languages); -#if GTK_CHECK_VERSION (3, 0, 0) g_return_val_if_fail (GTK_SOURCE_IS_LANGUAGE (lang), FALSE); -#else - g_return_val_if_fail (GTK_IS_SOURCE_LANGUAGE (lang), FALSE); -#endif ++languages; mime_types = gtk_source_language_get_mime_types (lang); @@ -392,9 +382,6 @@ pluma_file_chooser_dialog_new_valist (const gchar *title, result = g_object_new (PLUMA_TYPE_FILE_CHOOSER_DIALOG, "title", title, -#if !GTK_CHECK_VERSION (3, 0, 0) - "file-system-backend", NULL, -#endif "local-only", FALSE, "action", action, "select-multiple", action == GTK_FILE_CHOOSER_ACTION_OPEN, @@ -421,9 +408,7 @@ pluma_file_chooser_dialog_new_valist (const gchar *title, gtk_file_filter_set_name (filter, ALL_FILES); gtk_file_filter_add_pattern (filter, "*"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (result), filter); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_file_chooser_set_action (GTK_FILE_CHOOSER (result), action); -#endif if (active_filter != 1) { diff --git a/pluma/pluma-io-error-message-area.c b/pluma/pluma-io-error-message-area.c index 4c9d7753..a85af3d5 100644 --- a/pluma/pluma-io-error-message-area.c +++ b/pluma/pluma-io-error-message-area.c @@ -50,11 +50,6 @@ #define MAX_URI_IN_DIALOG_LENGTH 50 -#if GTK_CHECK_VERSION (3, 0, 0) -#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 - static gboolean is_recoverable_error (const GError *error) { @@ -122,18 +117,14 @@ set_message_area_text_and_icon (GtkWidget *message_area, GtkWidget *primary_label; GtkWidget *secondary_label; - hbox_content = gtk_hbox_new (FALSE, 8); + hbox_content = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); image = gtk_image_new_from_stock (icon_stock_id, GTK_ICON_SIZE_DIALOG); gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_halign (image, GTK_ALIGN_CENTER); gtk_widget_set_valign (image, GTK_ALIGN_START); -#else - gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0); -#endif - vbox = gtk_vbox_new (FALSE, 6); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0); primary_markup = g_strdup_printf ("<b>%s</b>", primary_text); @@ -449,7 +440,7 @@ create_combo_box (GtkWidget *message_area, GtkWidget *vbox) GtkWidget *menu; gchar *label_markup; - hbox = gtk_hbox_new (FALSE, 6); + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); label_markup = g_strdup_printf ("<small>%s</small>", _("Ch_aracter Encoding:")); @@ -523,18 +514,14 @@ create_conversion_error_message_area (const gchar *primary_text, GTK_MESSAGE_ERROR); } - hbox_content = gtk_hbox_new (FALSE, 8); + hbox_content = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); image = gtk_image_new_from_stock ("gtk-dialog-error", GTK_ICON_SIZE_DIALOG); gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_halign (image, GTK_ALIGN_CENTER); gtk_widget_set_valign (image, GTK_ALIGN_START); -#else - gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0); -#endif - vbox = gtk_vbox_new (FALSE, 6); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0); primary_markup = g_strdup_printf ("<b>%s</b>", primary_text); @@ -801,18 +788,14 @@ pluma_file_already_open_warning_message_area_new (const gchar *uri) gtk_info_bar_set_message_type (GTK_INFO_BAR (message_area), GTK_MESSAGE_WARNING); - hbox_content = gtk_hbox_new (FALSE, 8); + hbox_content = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); image = gtk_image_new_from_stock ("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG); gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_halign (image, GTK_ALIGN_CENTER); gtk_widget_set_valign (image, GTK_ALIGN_START); -#else - gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0); -#endif - vbox = gtk_vbox_new (FALSE, 6); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0); primary_text = g_strdup_printf (_("This file (%s) is already open in another pluma window."), uri_for_display); @@ -905,18 +888,14 @@ pluma_externally_modified_saving_error_message_area_new ( gtk_info_bar_set_message_type (GTK_INFO_BAR (message_area), GTK_MESSAGE_WARNING); - hbox_content = gtk_hbox_new (FALSE, 8); + hbox_content = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); image = gtk_image_new_from_stock ("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG); gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_halign (image, GTK_ALIGN_CENTER); gtk_widget_set_valign (image, GTK_ALIGN_START); -#else - gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0); -#endif - vbox = gtk_vbox_new (FALSE, 6); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0); // FIXME: review this message, it's not clear since for the user the "modification" @@ -1013,18 +992,14 @@ pluma_no_backup_saving_error_message_area_new (const gchar *uri, gtk_info_bar_set_message_type (GTK_INFO_BAR (message_area), GTK_MESSAGE_WARNING); - hbox_content = gtk_hbox_new (FALSE, 8); + hbox_content = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); image = gtk_image_new_from_stock ("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG); gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_halign (image, GTK_ALIGN_CENTER); gtk_widget_set_valign (image, GTK_ALIGN_START); -#else - gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0); -#endif - vbox = gtk_vbox_new (FALSE, 6); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0); // FIXME: review this messages diff --git a/pluma/pluma-language-manager.c b/pluma/pluma-language-manager.c index 85c954b7..47841d9f 100644 --- a/pluma/pluma-language-manager.c +++ b/pluma/pluma-language-manager.c @@ -31,9 +31,6 @@ #include <string.h> #include <gtk/gtk.h> -#if GTK_CHECK_VERSION (3, 0, 0) -#include <gtksourceview/gtksource.h> -#endif #include "pluma-language-manager.h" #include "pluma-prefs-manager.h" #include "pluma-utils.h" @@ -79,11 +76,7 @@ pluma_language_manager_list_languages_sorted (GtkSourceLanguageManager *lm, GtkSourceLanguage *lang; lang = gtk_source_language_manager_get_language (lm, *ids); -#if GTK_CHECK_VERSION (3, 0, 0) g_return_val_if_fail (GTK_SOURCE_IS_LANGUAGE (lang), NULL); -#else - g_return_val_if_fail (GTK_IS_SOURCE_LANGUAGE (lang), NULL); -#endif ++ids; if (include_hidden || !gtk_source_language_get_hidden (lang)) diff --git a/pluma/pluma-language-manager.h b/pluma/pluma-language-manager.h index 0970b7cf..7f27a49e 100644 --- a/pluma/pluma-language-manager.h +++ b/pluma/pluma-language-manager.h @@ -33,7 +33,7 @@ #define __PLUMA_LANGUAGES_MANAGER_H__ #include <glib-object.h> -#include <gtksourceview/gtksourcelanguagemanager.h> +#include <gtksourceview/gtksource.h> G_BEGIN_DECLS diff --git a/pluma/pluma-panel.c b/pluma/pluma-panel.c index 0fa999b0..d163a92d 100644 --- a/pluma/pluma-panel.c +++ b/pluma/pluma-panel.c @@ -43,11 +43,6 @@ #define PLUMA_PANEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), PLUMA_TYPE_PANEL, PlumaPanelPrivate)) -#if GTK_CHECK_VERSION (3, 0, 0) -#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 - struct _PlumaPanelPrivate { GtkOrientation orientation; @@ -90,11 +85,7 @@ static GObject *pluma_panel_constructor (GType type, GObjectConstructParam *construct_properties); -#if GTK_CHECK_VERSION (3, 0, 0) G_DEFINE_TYPE(PlumaPanel, pluma_panel, GTK_TYPE_BOX) -#else -G_DEFINE_TYPE(PlumaPanel, pluma_panel, GTK_TYPE_VBOX) -#endif static void pluma_panel_finalize (GObject *obj) @@ -195,13 +186,8 @@ pluma_panel_class_init (PlumaPanelClass *klass) g_object_class_install_property (object_class, PROP_ORIENTATION, -#if GTK_CHECK_VERSION (3, 0, 0) g_param_spec_enum ("panel-orientation", "Panel Orientation", -#else - g_param_spec_enum ("orientation", - "Orientation", -#endif "The panel's orientation", GTK_TYPE_ORIENTATION, GTK_ORIENTATION_VERTICAL, @@ -281,26 +267,6 @@ set_gtk_image_from_gtk_image (GtkImage *image, case GTK_IMAGE_EMPTY: gtk_image_clear (image); break; -#if !GTK_CHECK_VERSION (3, 0, 0) - case GTK_IMAGE_PIXMAP: - { - GdkPixmap *pm; - GdkBitmap *bm; - - gtk_image_get_pixmap (source, &pm, &bm); - gtk_image_set_from_pixmap (image, pm, bm); - } - break; - case GTK_IMAGE_IMAGE: - { - GdkImage *i; - GdkBitmap *bm; - - gtk_image_get_image (source, &i, &bm); - gtk_image_set_from_image (image, i, bm); - } - break; -#endif case GTK_IMAGE_PIXBUF: { GdkPixbuf *pb; @@ -416,10 +382,8 @@ pluma_panel_init (PlumaPanel *panel) { panel->priv = PLUMA_PANEL_GET_PRIVATE (panel); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_orientable_set_orientation (GTK_ORIENTABLE (panel), GTK_ORIENTATION_VERTICAL); -#endif } static void @@ -473,7 +437,7 @@ build_horizontal_panel (PlumaPanel *panel) GtkWidget *sidebar; GtkWidget *close_button; - box = gtk_hbox_new(FALSE, 0); + box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (GTK_BOX (box), panel->priv->notebook, @@ -482,7 +446,7 @@ build_horizontal_panel (PlumaPanel *panel) 0); /* Toolbar, close button and first separator */ - sidebar = gtk_vbox_new(FALSE, 6); + sidebar = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_container_set_border_width (GTK_CONTAINER (sidebar), 4); gtk_box_pack_start (GTK_BOX (box), @@ -517,12 +481,12 @@ build_vertical_panel (PlumaPanel *panel) GtkWidget *dummy_label; /* Create title hbox */ - title_hbox = gtk_hbox_new (FALSE, 6); + title_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); gtk_container_set_border_width (GTK_CONTAINER (title_hbox), 5); gtk_box_pack_start (GTK_BOX (panel), title_hbox, FALSE, FALSE, 0); - icon_name_hbox = gtk_hbox_new (FALSE, 0); + icon_name_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (GTK_BOX (title_hbox), icon_name_hbox, TRUE, @@ -635,13 +599,13 @@ build_tab_label (PlumaPanel *panel, /* set hbox spacing and label padding (see below) so that there's an * equal amount of space around the label */ - hbox = gtk_hbox_new (FALSE, 4); + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); label_ebox = gtk_event_box_new (); gtk_event_box_set_visible_window (GTK_EVENT_BOX (label_ebox), FALSE); gtk_box_pack_start (GTK_BOX (hbox), label_ebox, TRUE, TRUE, 0); - label_hbox = gtk_hbox_new (FALSE, 4); + label_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); gtk_container_add (GTK_CONTAINER (label_ebox), label_hbox); /* setup icon */ @@ -654,14 +618,10 @@ build_tab_label (PlumaPanel *panel, #else gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); #endif -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_margin_start (label, 0); gtk_widget_set_margin_end (label, 0); gtk_widget_set_margin_top (label, 0); gtk_widget_set_margin_bottom (label, 0); -#else - gtk_misc_set_padding (GTK_MISC (label), 0, 0); -#endif gtk_box_pack_start (GTK_BOX (label_hbox), label, TRUE, TRUE, 0); gtk_widget_set_tooltip_text (label_ebox, name); diff --git a/pluma/pluma-panel.h b/pluma/pluma-panel.h index 1e3b3059..68de84c0 100644 --- a/pluma/pluma-panel.h +++ b/pluma/pluma-panel.h @@ -55,11 +55,7 @@ typedef struct _PlumaPanel PlumaPanel; struct _PlumaPanel { -#if GTK_CHECK_VERSION (3, 0, 0) GtkBox vbox; -#else - GtkVBox vbox; -#endif /*< private > */ PlumaPanelPrivate *priv; @@ -72,11 +68,7 @@ typedef struct _PlumaPanelClass PlumaPanelClass; struct _PlumaPanelClass { -#if GTK_CHECK_VERSION (3, 0, 0) GtkBoxClass parent_class; -#else - GtkVBoxClass parent_class; -#endif void (* item_added) (PlumaPanel *panel, GtkWidget *item); diff --git a/pluma/pluma-plugin-manager.c b/pluma/pluma-plugin-manager.c index 9526ce5f..ce3e73c6 100644 --- a/pluma/pluma-plugin-manager.c +++ b/pluma/pluma-plugin-manager.c @@ -70,11 +70,7 @@ struct _PlumaPluginManagerPrivate GtkWidget *popup_menu; }; -#if GTK_CHECK_VERSION (3, 0, 0) G_DEFINE_TYPE(PlumaPluginManager, pluma_plugin_manager, GTK_TYPE_BOX) -#else -G_DEFINE_TYPE(PlumaPluginManager, pluma_plugin_manager, GTK_TYPE_VBOX) -#endif static PlumaPluginInfo *plugin_manager_get_selected_plugin (PlumaPluginManager *pm); static void plugin_manager_toggle_active (PlumaPluginManager *pm, GtkTreeIter *iter, GtkTreeModel *model); @@ -659,9 +655,6 @@ plugin_manager_construct_tree (PlumaPluginManager *pm) GTK_TREE_MODEL (model)); g_object_unref (model); -#if !GTK_CHECK_VERSION (3, 0, 0) - gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (pm->priv->tree), TRUE); -#endif gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (pm->priv->tree), FALSE); /* first column */ @@ -796,10 +789,8 @@ pluma_plugin_manager_init (PlumaPluginManager *pm) pm->priv = PLUMA_PLUGIN_MANAGER_GET_PRIVATE (pm); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_orientable_set_orientation (GTK_ORIENTABLE (pm), GTK_ORIENTATION_VERTICAL); -#endif /* * Always we create the manager, firstly we rescan the plugins directory @@ -832,11 +823,7 @@ pluma_plugin_manager_init (PlumaPluginManager *pm) gtk_label_set_mnemonic_widget (GTK_LABEL (label), pm->priv->tree); -#if GTK_CHECK_VERSION (3, 0, 0) hbuttonbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL); -#else - hbuttonbox = gtk_hbutton_box_new (); -#endif gtk_box_pack_start (GTK_BOX (pm), hbuttonbox, FALSE, FALSE, 0); gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox), GTK_BUTTONBOX_END); gtk_box_set_spacing (GTK_BOX (hbuttonbox), 8); diff --git a/pluma/pluma-plugin-manager.h b/pluma/pluma-plugin-manager.h index be8a6dc8..abdab625 100644 --- a/pluma/pluma-plugin-manager.h +++ b/pluma/pluma-plugin-manager.h @@ -55,11 +55,7 @@ typedef struct _PlumaPluginManager PlumaPluginManager; struct _PlumaPluginManager { -#if GTK_CHECK_VERSION (3, 0, 0) GtkBox vbox; -#else - GtkVBox vbox; -#endif /*< private > */ PlumaPluginManagerPrivate *priv; @@ -72,11 +68,7 @@ typedef struct _PlumaPluginManagerClass PlumaPluginManagerClass; struct _PlumaPluginManagerClass { -#if GTK_CHECK_VERSION (3, 0, 0) GtkBoxClass parent_class; -#else - GtkVBoxClass parent_class; -#endif }; /* diff --git a/pluma/pluma-prefs-manager-app.c b/pluma/pluma-prefs-manager-app.c index 8d74d45b..34a666eb 100644 --- a/pluma/pluma-prefs-manager-app.c +++ b/pluma/pluma-prefs-manager-app.c @@ -1207,11 +1207,7 @@ pluma_prefs_manager_syntax_hl_enable_changed (GSettings *settings, while (l != NULL) { -#if GTK_CHECK_VERSION (3, 0, 0) g_return_if_fail (GTK_SOURCE_IS_BUFFER (l->data)); -#else - g_return_if_fail (GTK_IS_SOURCE_BUFFER (l->data)); -#endif gtk_source_buffer_set_highlight_syntax (GTK_SOURCE_BUFFER (l->data), enable); @@ -1317,11 +1313,7 @@ pluma_prefs_manager_source_style_scheme_changed (GSettings *settings, docs = pluma_app_get_documents (pluma_app_get_default ()); for (l = docs; l != NULL; l = l->next) { -#if GTK_CHECK_VERSION (3, 0, 0) g_return_if_fail (GTK_SOURCE_IS_BUFFER (l->data)); -#else - g_return_if_fail (GTK_IS_SOURCE_BUFFER (l->data)); -#endif gtk_source_buffer_set_style_scheme (GTK_SOURCE_BUFFER (l->data), style); diff --git a/pluma/pluma-prefs-manager.h b/pluma/pluma-prefs-manager.h index f5822c9f..f5b9aa36 100644 --- a/pluma/pluma-prefs-manager.h +++ b/pluma/pluma-prefs-manager.h @@ -32,7 +32,7 @@ #include <gtk/gtk.h> #include <glib.h> -#include <gtksourceview/gtksourceview.h> +#include <gtksourceview/gtksource.h> #include "pluma-app.h" #define PLUMA_SCHEMA "org.mate.pluma" diff --git a/pluma/pluma-print-job.c b/pluma/pluma-print-job.c index e1f9f7f8..d26c7364 100644 --- a/pluma/pluma-print-job.c +++ b/pluma/pluma-print-job.c @@ -34,7 +34,7 @@ #endif #include <glib/gi18n.h> -#include <gtksourceview/gtksourceprintcompositor.h> +#include <gtksourceview/gtksource.h> #include "pluma-print-job.h" #include "pluma-debug.h" @@ -517,11 +517,7 @@ create_compositor (PlumaPrintJob *job) print_font_numbers = pluma_prefs_manager_get_print_font_numbers (); job->priv->compositor = GTK_SOURCE_PRINT_COMPOSITOR ( -#if GTK_CHECK_VERSION (3, 0, 0) g_object_new (GTK_SOURCE_TYPE_PRINT_COMPOSITOR, -#else - g_object_new (GTK_TYPE_SOURCE_PRINT_COMPOSITOR, -#endif "buffer", GTK_SOURCE_BUFFER (job->priv->doc), "tab-width", gtk_source_view_get_tab_width (GTK_SOURCE_VIEW (job->priv->view)), "highlight-syntax", gtk_source_buffer_get_highlight_syntax (GTK_SOURCE_BUFFER (job->priv->doc)) && diff --git a/pluma/pluma-print-preview.c b/pluma/pluma-print-preview.c index e76ab6e0..22a98bae 100644 --- a/pluma/pluma-print-preview.c +++ b/pluma/pluma-print-preview.c @@ -42,10 +42,6 @@ #define PRINTER_DPI (72.) -#if GTK_CHECK_VERSION (3, 0, 0) -#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y) -#endif - struct _PlumaPrintPreviewPrivate { GtkPrintOperation *operation; @@ -87,11 +83,7 @@ struct _PlumaPrintPreviewPrivate guint cur_page; }; -#if GTK_CHECK_VERSION (3, 0, 0) G_DEFINE_TYPE (PlumaPrintPreview, pluma_print_preview, GTK_TYPE_BOX) -#else -G_DEFINE_TYPE (PlumaPrintPreview, pluma_print_preview, GTK_TYPE_VBOX) -#endif static void pluma_print_preview_get_property (GObject *object, @@ -262,18 +254,10 @@ set_zoom_fit_to_size (PlumaPrintPreview *preview) priv = preview->priv; -#if GTK_CHECK_VERSION (3, 0, 0) g_object_get (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (priv->layout)), -#else - g_object_get (gtk_layout_get_hadjustment (GTK_LAYOUT (priv->layout)), -#endif "page-size", &width, NULL); -#if GTK_CHECK_VERSION (3, 0, 0) g_object_get (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (priv->layout)), -#else - g_object_get (gtk_layout_get_vadjustment (GTK_LAYOUT (priv->layout)), -#endif "page-size", &height, NULL); @@ -573,12 +557,8 @@ create_bar (PlumaPrintPreview *preview) toolbar, FALSE, FALSE, 0); -#if GTK_CHECK_VERSION (3, 0, 0) priv->prev = gtk_tool_button_new (NULL, NULL); gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (priv->prev), "go-previous"); -#else - priv->prev = gtk_tool_button_new_from_stock (GTK_STOCK_GO_BACK); -#endif gtk_tool_button_set_label (GTK_TOOL_BUTTON (priv->prev), "P_revious Page"); gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (priv->prev), TRUE); @@ -590,12 +570,8 @@ create_bar (PlumaPrintPreview *preview) preview); gtk_widget_show (GTK_WIDGET (priv->prev)); -#if GTK_CHECK_VERSION (3, 0, 0) priv->next = gtk_tool_button_new (NULL, NULL); gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (priv->next), "go-next"); -#else - priv->next = gtk_tool_button_new_from_stock (GTK_STOCK_GO_FORWARD); -#endif gtk_tool_button_set_label (GTK_TOOL_BUTTON (priv->next), "_Next Page"); gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (priv->next), TRUE); @@ -611,7 +587,7 @@ create_bar (PlumaPrintPreview *preview) gtk_widget_show (GTK_WIDGET (i)); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), i, -1); - status = gtk_hbox_new (FALSE, 4); + status = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); priv->page_entry = gtk_entry_new (); gtk_entry_set_width_chars (GTK_ENTRY (priv->page_entry), 3); gtk_entry_set_max_length (GTK_ENTRY (priv->page_entry), 6); @@ -660,12 +636,8 @@ create_bar (PlumaPrintPreview *preview) gtk_widget_show (GTK_WIDGET (i)); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), i, -1); -#if GTK_CHECK_VERSION (3, 0, 0) priv->multi = gtk_tool_button_new (NULL, NULL); gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (priv->multi), "dnd-multiple"); -#else - priv->multi = gtk_tool_button_new_from_stock (GTK_STOCK_DND_MULTIPLE); -#endif gtk_tool_button_set_label (GTK_TOOL_BUTTON (priv->multi), "_Show Multiple Pages"); gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (priv->multi), TRUE); @@ -681,12 +653,8 @@ create_bar (PlumaPrintPreview *preview) gtk_widget_show (GTK_WIDGET (i)); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), i, -1); -#if GTK_CHECK_VERSION (3, 0, 0) priv->zoom_one = gtk_tool_button_new (NULL, NULL); gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (priv->zoom_one), "zoom-original"); -#else - priv->zoom_one = gtk_tool_button_new_from_stock (GTK_STOCK_ZOOM_100); -#endif gtk_tool_item_set_tooltip_text (priv->zoom_one, _("Zoom 1:1")); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->zoom_one, -1); g_signal_connect (priv->zoom_one, @@ -695,12 +663,8 @@ create_bar (PlumaPrintPreview *preview) preview); gtk_widget_show (GTK_WIDGET (priv->zoom_one)); -#if GTK_CHECK_VERSION (3, 0, 0) priv->zoom_fit = gtk_tool_button_new (NULL, NULL); gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (priv->zoom_fit), "zoom-fit-best"); -#else - priv->zoom_fit = gtk_tool_button_new_from_stock (GTK_STOCK_ZOOM_FIT); -#endif gtk_tool_item_set_tooltip_text (priv->zoom_fit, _("Zoom to fit the whole page")); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->zoom_fit, -1); g_signal_connect (priv->zoom_fit, @@ -709,12 +673,8 @@ create_bar (PlumaPrintPreview *preview) preview); gtk_widget_show (GTK_WIDGET (priv->zoom_fit)); -#if GTK_CHECK_VERSION (3, 0, 0) priv->zoom_in = gtk_tool_button_new (NULL, NULL); gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (priv->zoom_in), "zoom-in"); -#else - priv->zoom_in = gtk_tool_button_new_from_stock (GTK_STOCK_ZOOM_IN); -#endif gtk_tool_item_set_tooltip_text (priv->zoom_in, _("Zoom the page in")); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->zoom_in, -1); g_signal_connect (priv->zoom_in, @@ -723,12 +683,8 @@ create_bar (PlumaPrintPreview *preview) preview); gtk_widget_show (GTK_WIDGET (priv->zoom_in)); -#if GTK_CHECK_VERSION (3, 0, 0) priv->zoom_out = gtk_tool_button_new (NULL, NULL); gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (priv->zoom_out), "zoom-out"); -#else - priv->zoom_out = gtk_tool_button_new_from_stock (GTK_STOCK_ZOOM_OUT); -#endif gtk_tool_item_set_tooltip_text (priv->zoom_out, _("Zoom the page out")); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), priv->zoom_out, -1); g_signal_connect (priv->zoom_out, @@ -776,13 +732,8 @@ get_page_at_coords (PlumaPrintPreview *preview, if (priv->tile_h <= 0 || priv->tile_h <= 0) return -1; -#if GTK_CHECK_VERSION (3, 0, 0) hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (priv->layout)); vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (priv->layout)); -#else - hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (priv->layout)); - vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (priv->layout)); -#endif x += gtk_adjustment_get_value (hadj); y += gtk_adjustment_get_value (vadj); @@ -843,13 +794,8 @@ preview_layout_key_press (GtkWidget *widget, priv = preview->priv; -#if GTK_CHECK_VERSION (3, 0, 0) hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (priv->layout)); vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (priv->layout)); -#else - hadj = gtk_layout_get_hadjustment (GTK_LAYOUT (priv->layout)); - vadj = gtk_layout_get_vadjustment (GTK_LAYOUT (priv->layout)); -#endif x = gtk_adjustment_get_value (hadj); y = gtk_adjustment_get_value (vadj); @@ -988,11 +934,6 @@ preview_layout_key_press (GtkWidget *widget, { gtk_adjustment_set_value (hadj, x); gtk_adjustment_set_value (vadj, y); - -#if !GTK_CHECK_VERSION (3, 0, 0) - gtk_adjustment_value_changed (hadj); - gtk_adjustment_value_changed (vadj); -#endif } return ret; @@ -1060,14 +1001,12 @@ pluma_print_preview_init (PlumaPrintPreview *preview) priv->context = NULL; priv->gtk_preview = NULL; -#if GTK_CHECK_VERSION (3, 0, 0) - GtkStyleContext *context; + GtkStyleContext *context; - context = gtk_widget_get_style_context (GTK_WIDGET (preview)); - gtk_style_context_add_class (context, "pluma-print-preview"); + context = gtk_widget_get_style_context (GTK_WIDGET (preview)); + gtk_style_context_add_class (context, "pluma-print-preview"); gtk_orientable_set_orientation (GTK_ORIENTABLE (preview), GTK_ORIENTATION_VERTICAL); -#endif create_bar (preview); create_preview_layout (preview); @@ -1175,13 +1114,8 @@ draw_page (cairo_t *cr, } static gboolean -#if GTK_CHECK_VERSION (3, 0, 0) preview_draw (GtkWidget *widget, cairo_t *cr, -#else -preview_expose (GtkWidget *widget, - GdkEventExpose *event, -#endif PlumaPrintPreview *preview) { PlumaPrintPreviewPrivate *priv; @@ -1193,22 +1127,12 @@ preview_expose (GtkWidget *widget, bin_window = gtk_layout_get_bin_window (GTK_LAYOUT (priv->layout)); -#if GTK_CHECK_VERSION (3, 0, 0) if (!gtk_cairo_should_draw_window (cr, bin_window)) return TRUE; cairo_save (cr); gtk_cairo_transform_to_window (cr, widget, bin_window); -#else - if (event->window != bin_window) - return FALSE; - - cairo_t *cr = gdk_cairo_create (bin_window); - - gdk_cairo_rectangle (cr, &event->area); - cairo_clip (cr); -#endif /* get the first page to display */ pg = get_first_page_displayed (preview); @@ -1236,11 +1160,7 @@ preview_expose (GtkWidget *widget, } } -#if GTK_CHECK_VERSION (3, 0, 0) cairo_restore (cr); -#else - cairo_destroy (cr); -#endif return TRUE; } @@ -1296,13 +1216,8 @@ preview_ready (GtkPrintOperationPreview *gtk_preview, /* let the default gtklayout handler clear the background */ g_signal_connect_after (preview->priv->layout, -#if GTK_CHECK_VERSION (3, 0, 0) "draw", G_CALLBACK (preview_draw), -#else - "expose-event", - G_CALLBACK (preview_expose), -#endif preview); gtk_widget_queue_draw (preview->priv->layout); diff --git a/pluma/pluma-print-preview.h b/pluma/pluma-print-preview.h index f0a1de99..147d57a3 100644 --- a/pluma/pluma-print-preview.h +++ b/pluma/pluma-print-preview.h @@ -48,21 +48,14 @@ typedef struct _PlumaPrintPreviewClass PlumaPrintPreviewClass; struct _PlumaPrintPreview { -#if GTK_CHECK_VERSION (3, 0, 0) GtkBox parent; -#else - GtkVBox parent; -#endif + PlumaPrintPreviewPrivate *priv; }; struct _PlumaPrintPreviewClass { -#if GTK_CHECK_VERSION (3, 0, 0) GtkBoxClass parent_class; -#else - GtkVBoxClass parent_class; -#endif void (* close) (PlumaPrintPreview *preview); }; diff --git a/pluma/pluma-progress-message-area.c b/pluma/pluma-progress-message-area.c index 3be702e3..b1284edc 100644 --- a/pluma/pluma-progress-message-area.c +++ b/pluma/pluma-progress-message-area.c @@ -48,11 +48,6 @@ enum { #define PLUMA_PROGRESS_MESSAGE_AREA_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), PLUMA_TYPE_PROGRESS_MESSAGE_AREA, PlumaProgressMessageAreaPrivate)) -#if GTK_CHECK_VERSION (3, 0, 0) -#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 - struct _PlumaProgressMessageAreaPrivate { GtkWidget *image; @@ -139,22 +134,18 @@ pluma_progress_message_area_init (PlumaProgressMessageArea *area) area->priv = PLUMA_PROGRESS_MESSAGE_AREA_GET_PRIVATE (area); - vbox = gtk_vbox_new (FALSE, 6); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_widget_show (vbox); - hbox = gtk_hbox_new (FALSE, 4); + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); gtk_widget_show (hbox); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); area->priv->image = gtk_image_new_from_icon_name (GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_widget_show (area->priv->image); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_halign (area->priv->image, GTK_ALIGN_CENTER); gtk_widget_set_valign (area->priv->image, GTK_ALIGN_CENTER); -#else - gtk_misc_set_alignment (GTK_MISC (area->priv->image), 0.5, 0.5); -#endif gtk_box_pack_start (GTK_BOX (hbox), area->priv->image, FALSE, FALSE, 4); area->priv->label = gtk_label_new (""); diff --git a/pluma/pluma-status-combo-box.c b/pluma/pluma-status-combo-box.c index 91973ca6..e446b371 100644 --- a/pluma/pluma-status-combo-box.c +++ b/pluma/pluma-status-combo-box.c @@ -26,10 +26,6 @@ #define PLUMA_STATUS_COMBO_BOX_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), PLUMA_TYPE_STATUS_COMBO_BOX, PlumaStatusComboBoxPrivate)) -#if GTK_CHECK_VERSION (3, 0, 0) -#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y) -#endif - struct _PlumaStatusComboBoxPrivate { GtkWidget *frame; @@ -106,7 +102,6 @@ pluma_status_combo_box_set_property (GObject *object, } } -#if GTK_CHECK_VERSION (3, 0, 0) static void pluma_status_combo_box_constructed (GObject *object) { @@ -137,7 +132,6 @@ pluma_status_combo_box_constructed (GObject *object) GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); g_object_unref (css); } -#endif static void pluma_status_combo_box_changed (PlumaStatusComboBox *combo, @@ -162,9 +156,7 @@ pluma_status_combo_box_class_init (PlumaStatusComboBoxClass *klass) object_class->finalize = pluma_status_combo_box_finalize; object_class->get_property = pluma_status_combo_box_get_property; object_class->set_property = pluma_status_combo_box_set_property; -#if GTK_CHECK_VERSION (3, 0, 0) object_class->constructed = pluma_status_combo_box_constructed; -#endif klass->changed = pluma_status_combo_box_changed; @@ -184,19 +176,6 @@ pluma_status_combo_box_class_init (PlumaStatusComboBoxClass *klass) NULL, G_PARAM_READWRITE)); -#if !GTK_CHECK_VERSION (3, 0, 0) - /* Set up a style for the button to decrease spacing. */ - gtk_rc_parse_string ( - "style \"pluma-status-combo-button-style\"\n" - "{\n" - " GtkWidget::focus-padding = 0\n" - " GtkWidget::focus-line-width = 0\n" - " xthickness = 0\n" - " ythickness = 0\n" - "}\n" - "widget \"*.pluma-status-combo-button\" style \"pluma-status-combo-button-style\""); -#endif - g_type_class_add_private (object_class, sizeof(PlumaStatusComboBoxPrivate)); } @@ -219,11 +198,7 @@ menu_position_func (GtkMenu *menu, *push_in = FALSE; -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_get_preferred_size (gtk_widget_get_toplevel (GTK_WIDGET (menu)), NULL, &request); -#else - gtk_widget_size_request (gtk_widget_get_toplevel (GTK_WIDGET (menu)), &request); -#endif /* get the origin... */ gdk_window_get_origin (gtk_widget_get_window (GTK_WIDGET (combo)), x, y); @@ -248,11 +223,7 @@ button_press_event (GtkWidget *widget, GtkAllocation allocation; gint max_height; -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_get_preferred_size (combo->priv->menu, NULL, &request); -#else - gtk_widget_size_request (combo->priv->menu, &request); -#endif gtk_widget_get_allocation (GTK_WIDGET (combo), &allocation); /* do something relative to our own height here, maybe we can do better */ @@ -284,7 +255,6 @@ button_press_event (GtkWidget *widget, static void set_shadow_type (PlumaStatusComboBox *combo) { -#if GTK_CHECK_VERSION (3, 0, 0) GtkStyleContext *context; GtkShadowType shadow_type; GtkWidget *statusbar; @@ -294,16 +264,6 @@ set_shadow_type (PlumaStatusComboBox *combo) context = gtk_widget_get_style_context (statusbar); gtk_style_context_get_style (context, "shadow-type", &shadow_type, NULL); -#else - GtkShadowType shadow_type; - GtkWidget *statusbar; - - /* This is a hack needed to use the shadow type of a statusbar */ - statusbar = gtk_statusbar_new (); - gtk_widget_ensure_style (statusbar); - - gtk_widget_style_get (statusbar, "shadow-type", &shadow_type, NULL); -#endif gtk_frame_set_shadow_type (GTK_FRAME (combo->priv->frame), shadow_type); gtk_widget_destroy (statusbar); @@ -326,7 +286,7 @@ pluma_status_combo_box_init (PlumaStatusComboBox *self) set_shadow_type (self); - self->priv->hbox = gtk_hbox_new (FALSE, 3); + self->priv->hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3); gtk_widget_show (self->priv->hbox); gtk_container_add (GTK_CONTAINER (self), self->priv->frame); @@ -349,26 +309,14 @@ pluma_status_combo_box_init (PlumaStatusComboBox *self) gtk_widget_show (self->priv->item); gtk_label_set_single_line_mode (GTK_LABEL (self->priv->item), TRUE); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_halign (self->priv->item, GTK_ALIGN_START); -#else - gtk_misc_set_alignment (GTK_MISC (self->priv->item), 0, 0.5); -#endif gtk_box_pack_start (GTK_BOX (self->priv->hbox), self->priv->item, TRUE, TRUE, 0); -#if GTK_CHECK_VERSION (3, 0, 0) self->priv->arrow = gtk_image_new_from_icon_name ("pan-down-symbolic", GTK_ICON_SIZE_BUTTON); -#else - self->priv->arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE); -#endif gtk_widget_show (self->priv->arrow); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_halign (self->priv->arrow, GTK_ALIGN_CENTER); gtk_widget_set_valign (self->priv->arrow, GTK_ALIGN_CENTER); -#else - gtk_misc_set_alignment (GTK_MISC (self->priv->arrow), 0.5, 0.5); -#endif gtk_box_pack_start (GTK_BOX (self->priv->hbox), self->priv->arrow, FALSE, TRUE, 0); diff --git a/pluma/pluma-statusbar.c b/pluma/pluma-statusbar.c index 7854fd8b..e67990f9 100644 --- a/pluma/pluma-statusbar.c +++ b/pluma/pluma-statusbar.c @@ -42,10 +42,6 @@ PLUMA_TYPE_STATUSBAR,\ PlumaStatusbarPrivate)) -#if GTK_CHECK_VERSION (3, 0, 0) -#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y) -#endif - struct _PlumaStatusbarPrivate { GtkWidget *overwrite_mode_label; @@ -114,10 +110,8 @@ pluma_statusbar_init (PlumaStatusbar *statusbar) statusbar->priv = PLUMA_STATUSBAR_GET_PRIVATE (statusbar); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_margin_top (GTK_WIDGET (statusbar), 0); gtk_widget_set_margin_bottom (GTK_WIDGET (statusbar), 0); -#endif statusbar->priv->overwrite_mode_label = gtk_label_new (NULL); gtk_label_set_width_chars (GTK_LABEL (statusbar->priv->overwrite_mode_label), @@ -139,7 +133,7 @@ pluma_statusbar_init (PlumaStatusbar *statusbar) gtk_frame_set_shadow_type (GTK_FRAME (statusbar->priv->state_frame), GTK_SHADOW_IN); - hbox = gtk_hbox_new (FALSE, 0); + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_container_add (GTK_CONTAINER (statusbar->priv->state_frame), hbox); statusbar->priv->load_image = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU); @@ -165,20 +159,11 @@ pluma_statusbar_init (PlumaStatusbar *statusbar) statusbar->priv->error_frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (statusbar->priv->error_frame), GTK_SHADOW_IN); -#if GTK_CHECK_VERSION (3, 10, 0) error_image = gtk_image_new_from_icon_name ("dialog-error", GTK_ICON_SIZE_MENU); -#else - error_image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_ERROR, GTK_ICON_SIZE_MENU); -#endif -#if GTK_CHECK_VERSION (3, 14, 0) gtk_widget_set_margin_start (error_image, 4); gtk_widget_set_margin_end (error_image, 4); gtk_widget_set_margin_top (error_image, 0); gtk_widget_set_margin_bottom (error_image, 0); -#else - gtk_misc_set_padding (GTK_MISC (error_image), 4, 0); - gtk_widget_show (error_image); -#endif statusbar->priv->error_event_box = gtk_event_box_new (); gtk_event_box_set_visible_window (GTK_EVENT_BOX (statusbar->priv->error_event_box), diff --git a/pluma/pluma-style-scheme-manager.c b/pluma/pluma-style-scheme-manager.c index c43d6ffc..5d898551 100644 --- a/pluma/pluma-style-scheme-manager.c +++ b/pluma/pluma-style-scheme-manager.c @@ -39,9 +39,6 @@ #include <glib/gstdio.h> #include <gtk/gtk.h> -#if GTK_CHECK_VERSION (3, 0, 0) -#include <gtksourceview/gtksource.h> -#endif #include "pluma-style-scheme-manager.h" #include "pluma-prefs-manager.h" @@ -112,11 +109,7 @@ pluma_style_scheme_manager_list_schemes_sorted (GtkSourceStyleSchemeManager *man const gchar * const * scheme_ids; GSList *schemes = NULL; -#if GTK_CHECK_VERSION (3, 0, 0) g_return_val_if_fail (GTK_SOURCE_IS_STYLE_SCHEME_MANAGER (manager), NULL); -#else - g_return_val_if_fail (GTK_IS_SOURCE_STYLE_SCHEME_MANAGER (manager), NULL); -#endif scheme_ids = gtk_source_style_scheme_manager_get_scheme_ids (manager); @@ -267,11 +260,7 @@ _pluma_style_scheme_manager_install_scheme (GtkSourceStyleSchemeManager *manager const gchar* const *ids; -#if GTK_CHECK_VERSION (3, 0, 0) g_return_val_if_fail (GTK_SOURCE_IS_STYLE_SCHEME_MANAGER (manager), NULL); -#else - g_return_val_if_fail (GTK_IS_SOURCE_STYLE_SCHEME_MANAGER (manager), NULL); -#endif g_return_val_if_fail (fname != NULL, NULL); dirname = g_path_get_dirname (fname); @@ -362,11 +351,7 @@ _pluma_style_scheme_manager_uninstall_scheme (GtkSourceStyleSchemeManager *manag GtkSourceStyleScheme *scheme; const gchar *filename; -#if GTK_CHECK_VERSION (3, 0, 0) g_return_val_if_fail (GTK_SOURCE_IS_STYLE_SCHEME_MANAGER (manager), FALSE); -#else - g_return_val_if_fail (GTK_IS_SOURCE_STYLE_SCHEME_MANAGER (manager), FALSE); -#endif g_return_val_if_fail (id != NULL, FALSE); scheme = gtk_source_style_scheme_manager_get_scheme (manager, id); diff --git a/pluma/pluma-style-scheme-manager.h b/pluma/pluma-style-scheme-manager.h index d88de7a9..8b0071a9 100644 --- a/pluma/pluma-style-scheme-manager.h +++ b/pluma/pluma-style-scheme-manager.h @@ -25,7 +25,7 @@ #ifndef __PLUMA_STYLE_SCHEME_MANAGER_H__ #define __PLUMA_STYLE_SCHEME_MANAGER_H__ -#include <gtksourceview/gtksourcestyleschememanager.h> +#include <gtksourceview/gtksource.h> G_BEGIN_DECLS diff --git a/pluma/pluma-tab-label.c b/pluma/pluma-tab-label.c index 1e72ec19..d3a07674 100644 --- a/pluma/pluma-tab-label.c +++ b/pluma/pluma-tab-label.c @@ -31,10 +31,6 @@ #define PLUMA_TAB_LABEL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE((object), PLUMA_TYPE_TAB_LABEL, PlumaTabLabelPrivate)) -#if GTK_CHECK_VERSION (3, 0, 0) -#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y) -#endif - /* Signals */ enum { @@ -63,11 +59,7 @@ struct _PlumaTabLabelPrivate static guint signals[LAST_SIGNAL] = { 0 }; -#if GTK_CHECK_VERSION (3, 0, 0) G_DEFINE_TYPE (PlumaTabLabel, pluma_tab_label, GTK_TYPE_BOX) -#else -G_DEFINE_TYPE (PlumaTabLabel, pluma_tab_label, GTK_TYPE_HBOX) -#endif static void pluma_tab_label_finalize (GObject *object) @@ -269,16 +261,15 @@ pluma_tab_label_init (PlumaTabLabel *tab_label) tab_label->priv->close_button_sensitive = TRUE; -#if GTK_CHECK_VERSION (3, 0, 0) gtk_orientable_set_orientation (GTK_ORIENTABLE (tab_label), GTK_ORIENTATION_HORIZONTAL); -#endif + ebox = gtk_event_box_new (); gtk_event_box_set_visible_window (GTK_EVENT_BOX (ebox), FALSE); gtk_box_pack_start (GTK_BOX (tab_label), ebox, TRUE, TRUE, 0); tab_label->priv->ebox = ebox; - hbox = gtk_hbox_new (FALSE, 4); + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); gtk_container_add (GTK_CONTAINER (ebox), hbox); close_button = pluma_close_button_new (); @@ -306,14 +297,10 @@ pluma_tab_label_init (PlumaTabLabel *tab_label) #else gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); #endif -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_margin_start (label, 0); gtk_widget_set_margin_end (label, 0); gtk_widget_set_margin_top (label, 0); gtk_widget_set_margin_bottom (label, 0); -#else - gtk_misc_set_padding (GTK_MISC (label), 0, 0); -#endif gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); tab_label->priv->label = label; diff --git a/pluma/pluma-tab-label.h b/pluma/pluma-tab-label.h index 172ff766..e29fad23 100644 --- a/pluma/pluma-tab-label.h +++ b/pluma/pluma-tab-label.h @@ -41,21 +41,13 @@ typedef struct _PlumaTabLabelClass PlumaTabLabelClass; typedef struct _PlumaTabLabelPrivate PlumaTabLabelPrivate; struct _PlumaTabLabel { -#if GTK_CHECK_VERSION (3, 0, 0) GtkBox parent; -#else - GtkHBox parent; -#endif PlumaTabLabelPrivate *priv; }; struct _PlumaTabLabelClass { -#if GTK_CHECK_VERSION (3, 0, 0) GtkBoxClass parent_class; -#else - GtkHBoxClass parent_class; -#endif void (* close_clicked) (PlumaTabLabel *tab_label); }; diff --git a/pluma/pluma-tab.c b/pluma/pluma-tab.c index 1be3e6c8..02fc2582 100644 --- a/pluma/pluma-tab.c +++ b/pluma/pluma-tab.c @@ -49,10 +49,6 @@ #define PLUMA_TAB_KEY "PLUMA_TAB_KEY" -#if GTK_CHECK_VERSION (3, 0, 0) -#define gdk_cursor_unref(cursor) g_object_unref (cursor) -#endif - struct _PlumaTabPrivate { PlumaTabState state; @@ -88,11 +84,7 @@ struct _PlumaTabPrivate guint idle_scroll; }; -#if GTK_CHECK_VERSION (3, 0, 0) G_DEFINE_TYPE(PlumaTab, pluma_tab, GTK_TYPE_BOX) -#else -G_DEFINE_TYPE(PlumaTab, pluma_tab, GTK_TYPE_VBOX) -#endif enum { @@ -346,7 +338,7 @@ set_cursor_according_to_state (GtkTextView *view, if (left_window != NULL) gdk_window_set_cursor (left_window, cursor); - gdk_cursor_unref (cursor); + g_object_unref (cursor); } else { @@ -359,7 +351,7 @@ set_cursor_according_to_state (GtkTextView *view, if (left_window != NULL) gdk_window_set_cursor (left_window, NULL); - gdk_cursor_unref (cursor); + g_object_unref (cursor); } } @@ -1512,10 +1504,8 @@ pluma_tab_init (PlumaTab *tab) tab->priv->ask_if_externally_modified = TRUE; -#if GTK_CHECK_VERSION (3, 0, 0) gtk_orientable_set_orientation (GTK_ORIENTABLE (tab), GTK_ORIENTATION_VERTICAL); -#endif /* Create the scrolled window */ sw = gtk_scrolled_window_new (NULL, NULL); @@ -1869,11 +1859,7 @@ get_icon (GtkIconTheme *theme, return get_stock_icon (theme, GTK_STOCK_FILE, size); pixbuf = gtk_icon_info_load_icon (icon_info, NULL); -#if GTK_CHECK_VERSION (3, 0, 0) g_object_unref (icon_info); -#else - gtk_icon_info_free (icon_info); -#endif if (pixbuf == NULL) return get_stock_icon (theme, GTK_STOCK_FILE, size); @@ -1898,14 +1884,7 @@ _pluma_tab_get_icon (PlumaTab *tab) theme = gtk_icon_theme_get_for_screen (screen); g_return_val_if_fail (theme != NULL, NULL); -#if GTK_CHECK_VERSION (3, 10, 0) gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, NULL, &icon_size); -#else - gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (GTK_WIDGET (tab)), - GTK_ICON_SIZE_MENU, - NULL, - &icon_size); -#endif switch (tab->priv->state) { diff --git a/pluma/pluma-tab.h b/pluma/pluma-tab.h index 62d46521..55c820b1 100644 --- a/pluma/pluma-tab.h +++ b/pluma/pluma-tab.h @@ -77,11 +77,7 @@ typedef struct _PlumaTab PlumaTab; struct _PlumaTab { -#if GTK_CHECK_VERSION (3, 0, 0) GtkBox vbox; -#else - GtkVBox vbox; -#endif /*< private > */ PlumaTabPrivate *priv; @@ -94,11 +90,7 @@ typedef struct _PlumaTabClass PlumaTabClass; struct _PlumaTabClass { -#if GTK_CHECK_VERSION (3, 0, 0) GtkBoxClass parent_class; -#else - GtkVBoxClass parent_class; -#endif }; /* diff --git a/pluma/pluma-utils.c b/pluma/pluma-utils.c index 19405ebf..887e9ff5 100644 --- a/pluma/pluma-utils.c +++ b/pluma/pluma-utils.c @@ -134,11 +134,7 @@ pluma_utils_menu_position_under_widget (GtkMenu *menu, widget = GTK_WIDGET (user_data); widget_get_origin (widget, x, y); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &requisition); -#else - gtk_widget_size_request (GTK_WIDGET (menu), &requisition); -#endif gtk_widget_get_allocation (widget, &allocation); @@ -193,11 +189,7 @@ pluma_utils_menu_position_under_tree_view (GtkMenu *menu, if (gtk_widget_get_direction (GTK_WIDGET (tree)) == GTK_TEXT_DIR_RTL) { GtkRequisition requisition; -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &requisition); -#else - gtk_widget_size_request (GTK_WIDGET (menu), &requisition); -#endif *x += rect.width - requisition.width; } } @@ -1105,14 +1097,10 @@ handle_builder_error (const gchar *message, ...) g_free (msg_plain); g_free (msg); -#if GTK_CHECK_VERSION (3, 14, 0) gtk_widget_set_margin_start (label, 5); gtk_widget_set_margin_end (label, 5); gtk_widget_set_margin_top (label, 5); gtk_widget_set_margin_bottom (label, 5); -#else - gtk_misc_set_padding (GTK_MISC (label), 5, 5); -#endif return label; } diff --git a/pluma/pluma-view.c b/pluma/pluma-view.c index e7d34ebe..b73315e6 100644 --- a/pluma/pluma-view.c +++ b/pluma/pluma-view.c @@ -56,10 +56,6 @@ #define PLUMA_VIEW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), PLUMA_TYPE_VIEW, PlumaViewPrivate)) -#if GTK_CHECK_VERSION (3, 0, 0) -#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y) -#endif - typedef enum { GOTO_LINE, @@ -135,13 +131,8 @@ static gboolean reset_searched_text (PlumaView *view); static void hide_search_window (PlumaView *view, gboolean cancel); -#if GTK_CHECK_VERSION (3, 0, 0) static gboolean pluma_view_draw (GtkWidget *widget, cairo_t *cr); -#else -static gint pluma_view_expose (GtkWidget *widget, - GdkEventExpose *event); -#endif static void search_highlight_updated_cb (PlumaDocument *doc, GtkTextIter *start, GtkTextIter *end, @@ -151,11 +142,7 @@ static void pluma_view_delete_from_cursor (GtkTextView *text_view, GtkDeleteType type, gint count); -#if GTK_CHECK_VERSION (3, 0, 0) G_DEFINE_TYPE(PlumaView, pluma_view, GTK_SOURCE_TYPE_VIEW) -#else -G_DEFINE_TYPE(PlumaView, pluma_view, GTK_TYPE_SOURCE_VIEW) -#endif /* Signals */ enum @@ -199,11 +186,7 @@ pluma_view_class_init (PlumaViewClass *klass) object_class->finalize = pluma_view_finalize; widget_class->focus_out_event = pluma_view_focus_out; -#if GTK_CHECK_VERSION (3, 0, 0) widget_class->draw = pluma_view_draw; -#else - widget_class->expose_event = pluma_view_expose; -#endif /* * Override the gtk_text_view_drag_motion and drag_drop @@ -691,11 +674,7 @@ pluma_view_set_font (PlumaView *view, g_return_if_fail (font_desc != NULL); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_override_font (GTK_WIDGET (view), font_desc); -#else - gtk_widget_modify_font (GTK_WIDGET (view), font_desc); -#endif pango_font_description_free (font_desc); } @@ -767,43 +746,15 @@ static void set_entry_state (GtkWidget *entry, PlumaSearchEntryState state) { -#if GTK_CHECK_VERSION (3, 0 ,0) GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET (entry)); -#endif if (state == PLUMA_SEARCH_ENTRY_NOT_FOUND) { -#if GTK_CHECK_VERSION (3, 0 ,0) gtk_style_context_add_class (context, GTK_STYLE_CLASS_ERROR); -#else - GdkColor red; - GdkColor white; - - /* FIXME: a11y and theme */ - - gdk_color_parse ("#FF6666", &red); - gdk_color_parse ("white", &white); - - gtk_widget_modify_base (entry, - GTK_STATE_NORMAL, - &red); - gtk_widget_modify_text (entry, - GTK_STATE_NORMAL, - &white); -#endif } else /* reset */ { -#if GTK_CHECK_VERSION (3, 0 ,0) gtk_style_context_remove_class (context, GTK_STYLE_CLASS_ERROR); -#else - gtk_widget_modify_base (entry, - GTK_STATE_NORMAL, - NULL); - gtk_widget_modify_text (entry, - GTK_STATE_NORMAL, - NULL); -#endif } } @@ -986,17 +937,9 @@ hide_search_window (PlumaView *view, gboolean cancel) static gboolean search_entry_flush_timeout (PlumaView *view) { -#if !GTK_CHECK_VERSION (3, 0, 0) - GDK_THREADS_ENTER (); -#endif - view->priv->typeselect_flush_timeout = 0; hide_search_window (view, FALSE); -#if !GTK_CHECK_VERSION (3, 0, 0) - GDK_THREADS_LEAVE (); -#endif - return FALSE; } @@ -1209,16 +1152,8 @@ real_search_enable_popdown (gpointer data) { PlumaView *view = (PlumaView *)data; -#if !GTK_CHECK_VERSION (3, 0, 0) - GDK_THREADS_ENTER (); -#endif - view->priv->disable_popdown = FALSE; -#if !GTK_CHECK_VERSION (3, 0, 0) - GDK_THREADS_LEAVE (); -#endif - return FALSE; } @@ -1529,7 +1464,7 @@ ensure_search_window (PlumaView *view) gtk_widget_show (frame); gtk_container_add (GTK_CONTAINER (view->priv->search_window), frame); - vbox = gtk_vbox_new (FALSE, 0); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox); gtk_container_add (GTK_CONTAINER (frame), vbox); gtk_container_set_border_width (GTK_CONTAINER (vbox), 3); @@ -1868,31 +1803,19 @@ start_interactive_goto_line (PlumaView *view) return start_interactive_search_real (view); } -#if GTK_CHECK_VERSION (3, 0, 0) static gboolean pluma_view_draw (GtkWidget *widget, cairo_t *cr) -#else -static gint -pluma_view_expose (GtkWidget *widget, - GdkEventExpose *event) -#endif { GtkTextView *text_view; PlumaDocument *doc; -#if GTK_CHECK_VERSION (3, 0, 0) GdkWindow *window; -#endif text_view = GTK_TEXT_VIEW (widget); doc = PLUMA_DOCUMENT (gtk_text_view_get_buffer (text_view)); -#if GTK_CHECK_VERSION (3, 0, 0) window = gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_TEXT); if (gtk_cairo_should_draw_window (cr, window) && -#else - if ((event->window == gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_TEXT)) && -#endif pluma_document_get_enable_search_highlighting (doc)) { GdkRectangle visible_rect; @@ -1911,11 +1834,7 @@ pluma_view_expose (GtkWidget *widget, &iter2); } -#if GTK_CHECK_VERSION (3, 0, 0) return GTK_WIDGET_CLASS (pluma_view_parent_class)->draw (widget, cr); -#else - return (* GTK_WIDGET_CLASS (pluma_view_parent_class)->expose_event)(widget, event); -#endif } static GdkAtom diff --git a/pluma/pluma-view.h b/pluma/pluma-view.h index 6588cf54..7cb0094c 100644 --- a/pluma/pluma-view.h +++ b/pluma/pluma-view.h @@ -34,7 +34,7 @@ #include <gtk/gtk.h> #include <pluma/pluma-document.h> -#include <gtksourceview/gtksourceview.h> +#include <gtksourceview/gtksource.h> G_BEGIN_DECLS diff --git a/pluma/pluma-window.c b/pluma/pluma-window.c index 15bba5e0..2432aeaf 100644 --- a/pluma/pluma-window.c +++ b/pluma/pluma-window.c @@ -39,9 +39,7 @@ #include <glib/gi18n.h> #include <gio/gio.h> #include <gtk/gtk.h> -#if GTK_CHECK_VERSION (3, 0, 0) #include <gtksourceview/gtksource.h> -#endif #include "pluma-ui.h" #include "pluma-window.h" @@ -71,10 +69,6 @@ PLUMA_TYPE_WINDOW, \ PlumaWindowPrivate)) -#if GTK_CHECK_VERSION (3, 0, 0) -#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y) -#endif - /* Signals */ enum { @@ -1557,10 +1551,8 @@ create_menu_bar_and_toolbar (PlumaWindow *window, 0); window->priv->toolbar = gtk_ui_manager_get_widget (manager, "/ToolBar"); -#if GTK_CHECK_VERSION(3, 0, 0) gtk_style_context_add_class (gtk_widget_get_style_context (window->priv->toolbar), GTK_STYLE_CLASS_PRIMARY_TOOLBAR); -#endif gtk_box_pack_start (GTK_BOX (main_box), window->priv->toolbar, FALSE, @@ -2915,7 +2907,6 @@ on_fullscreen_controls_leave_notify_event (GtkWidget *widget, GdkEventCrossing *event, PlumaWindow *window) { -#if GTK_CHECK_VERSION (3, 0, 0) GdkDevice *device; gint w, h; gint x, y; @@ -2924,18 +2915,6 @@ on_fullscreen_controls_leave_notify_event (GtkWidget *widget, gtk_window_get_size (GTK_WINDOW (window->priv->fullscreen_controls), &w, &h); gdk_device_get_position (device, NULL, &x, &y); -#else - GdkDisplay *display; - GdkScreen *screen; - gint w, h; - gint x, y; - - display = gdk_display_get_default (); - screen = gtk_window_get_screen (GTK_WINDOW (window)); - - gtk_window_get_size (GTK_WINDOW (window->priv->fullscreen_controls), &w, &h); - gdk_display_get_pointer (display, &screen, &x, &y, NULL); -#endif /* gtk seems to emit leave notify when clicking on tool items, * work around it by checking the coordinates @@ -3854,14 +3833,12 @@ pluma_window_init (PlumaWindow *window) window->priv->window_group = gtk_window_group_new (); gtk_window_group_add_window (window->priv->window_group, GTK_WINDOW (window)); -#if GTK_CHECK_VERSION(3, 0, 0) - GtkStyleContext *context; + GtkStyleContext *context; - context = gtk_widget_get_style_context (GTK_WIDGET (window)); - gtk_style_context_add_class (context, "pluma-window"); -#endif + context = gtk_widget_get_style_context (GTK_WIDGET (window)); + gtk_style_context_add_class (context, "pluma-window"); - main_box = gtk_vbox_new (FALSE, 0); + main_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (window), main_box); gtk_widget_show (main_box); @@ -3873,22 +3850,14 @@ pluma_window_init (PlumaWindow *window) /* Add the main area */ pluma_debug_message (DEBUG_WINDOW, "Add main area"); -#if GTK_CHECK_VERSION(3, 0, 0) window->priv->hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); -#else - window->priv->hpaned = gtk_hpaned_new (); -#endif gtk_box_pack_start (GTK_BOX (main_box), window->priv->hpaned, TRUE, TRUE, 0); -#if GTK_CHECK_VERSION(3, 0, 0) window->priv->vpaned = gtk_paned_new (GTK_ORIENTATION_VERTICAL); -#else - window->priv->vpaned = gtk_vpaned_new (); -#endif gtk_paned_pack2 (GTK_PANED (window->priv->hpaned), window->priv->vpaned, TRUE, diff --git a/pluma/smclient/eggsmclient-private.h b/pluma/smclient/eggsmclient-private.h index 071eb8f0..9a63555f 100644 --- a/pluma/smclient/eggsmclient-private.h +++ b/pluma/smclient/eggsmclient-private.h @@ -21,9 +21,6 @@ #define __EGG_SM_CLIENT_PRIVATE_H__ #include <gtk/gtk.h> -#if !GTK_CHECK_VERSION (3, 0, 0) -#include <gdkconfig.h> -#endif #include "eggsmclient.h" G_BEGIN_DECLS diff --git a/pluma/smclient/eggsmclient-xsmp.c b/pluma/smclient/eggsmclient-xsmp.c index a1a69594..3c9b309d 100644 --- a/pluma/smclient/eggsmclient-xsmp.c +++ b/pluma/smclient/eggsmclient-xsmp.c @@ -367,13 +367,7 @@ sm_client_xsmp_startup (EggSMClient *client, xsmp->client_id = g_strdup (ret_client_id); free (ret_client_id); -#if !GTK_CHECK_VERSION (3, 0, 0) - gdk_threads_enter (); -#endif gdk_x11_set_sm_client_id (xsmp->client_id); -#if !GTK_CHECK_VERSION (3, 0, 0) - gdk_threads_leave (); -#endif g_debug ("Got client ID \"%s\"", xsmp->client_id); } @@ -541,10 +535,6 @@ idle_do_pending_events (gpointer data) EggSMClientXSMP *xsmp = data; EggSMClient *client = data; -#if !GTK_CHECK_VERSION (3, 0, 0) - gdk_threads_enter (); -#endif - xsmp->idle = 0; if (xsmp->waiting_to_emit_quit) @@ -567,10 +557,7 @@ idle_do_pending_events (gpointer data) do_save_yourself (xsmp); } - out: -#if !GTK_CHECK_VERSION (3, 0, 0) - gdk_threads_leave (); -#endif +out: return FALSE; } @@ -1292,13 +1279,7 @@ process_ice_messages (IceConn ice_conn) { IceProcessMessagesStatus status; -#if !GTK_CHECK_VERSION (3, 0, 0) - gdk_threads_enter (); -#endif status = IceProcessMessages (ice_conn, NULL, NULL); -#if !GTK_CHECK_VERSION (3, 0, 0) - gdk_threads_leave (); -#endif switch (status) { diff --git a/po/POTFILES.in b/po/POTFILES.in index a2239f23..d579b0b0 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -11,7 +11,6 @@ pluma/dialogs/pluma-preferences-dialog.c [type: gettext/glade]pluma/dialogs/pluma-preferences-dialog.ui pluma/dialogs/pluma-search-dialog.c [type: gettext/glade]pluma/dialogs/pluma-search-dialog.ui -[type: gettext/glade]pluma/dialogs/pluma-search-dialog-gtk3.ui pluma/pluma.c pluma/pluma-app.c pluma/pluma-commands-file.c |