diff --git a/HACKING b/HACKING
index a647d9f890..a50c179e35 100644
--- a/HACKING
+++ b/HACKING
@@ -144,16 +144,16 @@ And then simply apply it like so::
GTK versions & API documentation
--------------------------------
-Geany requires GTK >= 2.12 and GLib >= 2.16. API symbols from newer
+Geany requires GTK >= 2.16 and GLib >= 2.20. API symbols from newer
GTK/GLib versions should be avoided or made optional to keep the source
code building on older systems.
-The official GTK 2.12 API documentation may not be available online
+The official GTK 2.16 API documentation may not be available online
anymore, so we put it on http://www.geany.org/manual/gtk/. There
is also a tarball with all available files for download and use with
devhelp.
-Using the 2.12 API documentation of the GTK libs (including GLib, GDK
+Using the 2.16 API documentation of the GTK libs (including GLib, GDK
and Pango) has the advantages that you don't get confused by any
newer API additions and you don't have to take care about whether
you can use them or not.
@@ -164,8 +164,8 @@ Coding
them down into smaller static functions where possible. This makes code
much easier to read and maintain.
* Use GLib types and functions - gint not int, g_free() not free().
-* Your code should build against GLib 2.16 and GTK 2.12. At least for the
- moment, we want to keep the minimum requirement for GTK at 2.12 (of
+* Your code should build against GLib 2.20 and GTK 2.16. At least for the
+ moment, we want to keep the minimum requirement for GTK at 2.16 (of
course, you can use the GTK_CHECK_VERSION macro to protect code using
later versions).
* Variables should be declared before statements. You can use
diff --git a/README b/README
index 0e72fcb91e..6e23243d59 100644
--- a/README
+++ b/README
@@ -28,7 +28,7 @@ The basic features of Geany are:
Requirements
------------
-For compiling Geany yourself, you will need the GTK (>= 2.12.0)
+For compiling Geany yourself, you will need the GTK (>= 2.16.0)
libraries and header files. You will also need its dependency libraries
and header files, such as Pango, Glib and ATK. All these files are
available at http://www.gtk.org.
diff --git a/configure.ac b/configure.ac
index de39934e87..6b7178d10f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,7 +57,7 @@ GEANY_CHECK_REVISION([dnl force debug mode for a SVN working copy
# GTK/GLib/GIO checks
-gtk_modules="gtk+-2.0 >= 2.12 glib-2.0 >= 2.16 gio-2.0 >= 2.16"
+gtk_modules="gtk+-2.0 >= 2.16 glib-2.0 >= 2.20 gio-2.0 >= 2.20"
PKG_CHECK_MODULES([GTK], [$gtk_modules])
AC_SUBST([GTK_CFLAGS])
AC_SUBST([GTK_LIBS])
diff --git a/doc/geany.html b/doc/geany.html
index 1721f77d82..bacc94f5d2 100644
--- a/doc/geany.html
+++ b/doc/geany.html
@@ -571,7 +571,7 @@
-
You will need the GTK (>= 2.12.0) libraries and their dependencies
+
You will need the GTK (>= 2.16.0) libraries and their dependencies
(Pango, GLib and ATK). Your distro should provide packages for these,
usually installed by default. For Windows, you can download an installer
from the website which bundles these libraries.
@@ -584,7 +584,7 @@
Compiling Geany is quite easy.
-To do so, you need the GTK (>= 2.12.0) libraries and header files.
+To do so, you need the GTK (>= 2.16.0) libraries and header files.
You also need the Pango, GLib and ATK libraries and header files.
All these files are available at http://www.gtk.org, but very often
your distro will provide development packages to save the trouble of
@@ -6700,7 +6700,7 @@
View document source.
-Generated on: 2011-10-23 14:12 UTC.
+Generated on: 2011-10-28 17:11 UTC.
Generated by
Docutils from
reStructuredText source.
diff --git a/doc/geany.txt b/doc/geany.txt
index c7a59a7dd3..2fa4a5502c 100644
--- a/doc/geany.txt
+++ b/doc/geany.txt
@@ -101,7 +101,7 @@ Installation
Requirements
------------
-You will need the GTK (>= 2.12.0) libraries and their dependencies
+You will need the GTK (>= 2.16.0) libraries and their dependencies
(Pango, GLib and ATK). Your distro should provide packages for these,
usually installed by default. For Windows, you can download an installer
from the website which bundles these libraries.
@@ -118,7 +118,7 @@ Source compilation
------------------
Compiling Geany is quite easy.
-To do so, you need the GTK (>= 2.12.0) libraries and header files.
+To do so, you need the GTK (>= 2.16.0) libraries and header files.
You also need the Pango, GLib and ATK libraries and header files.
All these files are available at http://www.gtk.org, but very often
your distro will provide development packages to save the trouble of
diff --git a/geany.pc.in b/geany.pc.in
index 655211215a..0844bfe78e 100644
--- a/geany.pc.in
+++ b/geany.pc.in
@@ -8,7 +8,7 @@ localedir=@localedir@
Name: Geany
Description: A fast and lightweight IDE using GTK2
-Requires: gtk+-2.0 >= 2.12.0
+Requires: gtk+-2.0 >= 2.16.0
Version: @VERSION@
Libs: -L${libdir}
Cflags: -DGTK -I${includedir}/geany -I${includedir}/geany/tagmanager -I${includedir}/geany/scintilla
diff --git a/plugins/filebrowser.c b/plugins/filebrowser.c
index c18c07cac1..0f543ddb72 100644
--- a/plugins/filebrowser.c
+++ b/plugins/filebrowser.c
@@ -886,16 +886,6 @@ static GtkWidget *make_toolbar(void)
g_signal_connect(wid, "clicked", G_CALLBACK(on_current_path), NULL);
gtk_container_add(GTK_CONTAINER(toolbar), wid);
- if (gtk_check_version(2, 15, 2) != NULL)
- {
- wid = GTK_WIDGET(gtk_separator_tool_item_new());
- gtk_container_add(GTK_CONTAINER(toolbar), wid);
-
- wid = GTK_WIDGET(gtk_tool_button_new_from_stock(GTK_STOCK_CLEAR));
- gtk_widget_set_tooltip_text(wid, _("Clear the filter"));
- g_signal_connect(wid, "clicked", G_CALLBACK(on_clear_filter), NULL);
- gtk_container_add(GTK_CONTAINER(toolbar), wid);
- }
return toolbar;
}
@@ -911,11 +901,9 @@ static GtkWidget *make_filterbar(void)
filter_combo = gtk_combo_box_entry_new_text();
filter_entry = gtk_bin_get_child(GTK_BIN(filter_combo));
- if (gtk_check_version(2, 15, 2) == NULL)
- {
- ui_entry_add_clear_icon(GTK_ENTRY(filter_entry));
- g_signal_connect(filter_entry, "icon-release", G_CALLBACK(on_filter_clear), NULL);
- }
+ ui_entry_add_clear_icon(GTK_ENTRY(filter_entry));
+ g_signal_connect(filter_entry, "icon-release", G_CALLBACK(on_filter_clear), NULL);
+
gtk_widget_set_tooltip_text(filter_entry,
_("Filter your files with the usual wildcards. Separate multiple patterns with a space."));
g_signal_connect(filter_entry, "activate", G_CALLBACK(on_filter_activate), NULL);
diff --git a/src/callbacks.c b/src/callbacks.c
index 114146e267..dac39da8b0 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -1428,14 +1428,12 @@ void on_menu_show_sidebar1_toggled(GtkCheckMenuItem *checkmenuitem, gpointer use
interface_prefs.sidebar_symbol_visible = TRUE;
}
-#if GTK_CHECK_VERSION(2, 14, 0)
/* if window has input focus, set it back to the editor before toggling off */
if (! ui_prefs.sidebar_visible &&
gtk_container_get_focus_child(GTK_CONTAINER(main_widgets.sidebar_notebook)) != NULL)
{
keybindings_send_command(GEANY_KEY_GROUP_FOCUS, GEANY_KEYS_FOCUS_EDITOR);
}
-#endif
ui_sidebar_show_hide();
}
diff --git a/src/dialogs.c b/src/dialogs.c
index 7b39411360..fff4bf0444 100644
--- a/src/dialogs.c
+++ b/src/dialogs.c
@@ -378,8 +378,7 @@ static GtkWidget *create_open_file_dialog(void)
gtk_window_set_type_hint(GTK_WINDOW(dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(main_widgets.window));
gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), TRUE);
- if (gtk_check_version(2, 14, 0) == NULL)
- gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), FALSE);
+ gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), FALSE);
/* add checkboxes and filename entry */
gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(dialog), add_file_open_extra_widget(dialog));
@@ -605,8 +604,7 @@ static GtkWidget *create_save_file_dialog(void)
gtk_widget_show_all(vbox);
gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(dialog), vbox);
gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dialog), TRUE);
- if (gtk_check_version(2, 14, 0) == NULL)
- gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), FALSE);
+ gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), FALSE);
/* set the folder by default to the project base dir or the global pref for opening files */
initdir = utils_get_default_dir_utf8();
diff --git a/src/ui_utils.c b/src/ui_utils.c
index 5866a711a7..e4f1b0142f 100644
--- a/src/ui_utils.c
+++ b/src/ui_utils.c
@@ -1117,7 +1117,7 @@ static void add_recent_file(const gchar *utf8_filename, GeanyRecentFiles *grf)
{
if (g_queue_find_custom(grf->recent_queue, utf8_filename, (GCompareFunc) strcmp) == NULL)
{
-#if GTK_CHECK_VERSION(2, 10, 0)
+
if (grf->type == RECENT_FILE_FILE)
{
GtkRecentManager *manager = gtk_recent_manager_get_default();
@@ -1128,7 +1128,7 @@ static void add_recent_file(const gchar *utf8_filename, GeanyRecentFiles *grf)
g_free(uri);
}
}
-#endif
+
g_queue_push_head(grf->recent_queue, g_strdup(utf8_filename));
if (g_queue_get_length(grf->recent_queue) > file_prefs.mru_length)
{
@@ -1421,21 +1421,14 @@ static void entry_clear_icon_release_cb(GtkEntry *entry, gint icon_pos,
/** Adds a small clear icon to the right end of the passed @a entry.
* A callback to clear the contents of the GtkEntry is automatically added.
*
- * This feature is only available with GTK 2.16 but implemented as a runtime check,
- * so it is safe to just use this function, if the code is ran with older versions,
- * nothing happens. If ran with GTK 2.16 or newer, the icon is displayed.
- *
* @param entry The GtkEntry object to which the icon should be attached.
*
* @since 0.16
*/
void ui_entry_add_clear_icon(GtkEntry *entry)
{
- if (gtk_check_version(2, 15, 2) == NULL)
- {
- g_object_set(entry, "secondary-icon-stock", "gtk-clear", NULL);
- g_signal_connect(entry, "icon-release", G_CALLBACK(entry_clear_icon_release_cb), NULL);
- }
+ g_object_set(entry, "secondary-icon-stock", "gtk-clear", NULL);
+ g_signal_connect(entry, "icon-release", G_CALLBACK(entry_clear_icon_release_cb), NULL);
}
@@ -2532,7 +2525,6 @@ void ui_editable_insert_text_callback(GtkEditable *editable, gchar *new_text,
GdkPixbuf *ui_get_mime_icon(const gchar *mime_type, GtkIconSize size)
{
GdkPixbuf *icon = NULL;
-#if GTK_CHECK_VERSION(2, 14, 0)
gchar *ctype;
GIcon *gicon;
GtkIconInfo *info;
@@ -2558,7 +2550,7 @@ GdkPixbuf *ui_get_mime_icon(const gchar *mime_type, GtkIconSize size)
gtk_icon_info_free(info);
}
}
-#endif
+
/* fallback for builds with GIO < 2.18 or if icon lookup failed, like it might happen on Windows */
if (icon == NULL)
{
diff --git a/src/utils.c b/src/utils.c
index eaf1475488..9b9a71a4f7 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -1871,23 +1871,21 @@ gboolean utils_is_remote_path(const gchar *path)
return TRUE;
#ifndef G_OS_WIN32
- if (glib_check_version(2, 16, 0) == NULL) /* no need to check for this with GLib < 2.16 */
- {
- static gchar *fuse_path = NULL;
- static gsize len = 0;
+ static gchar *fuse_path = NULL;
+ static gsize len = 0;
- if (G_UNLIKELY(fuse_path == NULL))
- {
- fuse_path = g_build_filename(g_get_home_dir(), ".gvfs", NULL);
- len = strlen(fuse_path);
- }
- /* Comparing the file path against a hardcoded path is not the most elegant solution
- * but for now it is better than nothing. Ideally, g_file_new_for_path() should create
- * proper GFile objects for Fuse paths, but it only does in future GVFS
- * versions (gvfs 1.1.1). */
- return (strncmp(path, fuse_path, len) == 0);
+ if (G_UNLIKELY(fuse_path == NULL))
+ {
+ fuse_path = g_build_filename(g_get_home_dir(), ".gvfs", NULL);
+ len = strlen(fuse_path);
}
+ /* Comparing the file path against a hardcoded path is not the most elegant solution
+ * but for now it is better than nothing. Ideally, g_file_new_for_path() should create
+ * proper GFile objects for Fuse paths, but it only does in future GVFS
+ * versions (gvfs 1.1.1). */
+ return (strncmp(path, fuse_path, len) == 0);
#endif
+
return FALSE;
}
diff --git a/wscript b/wscript
index 0913ee9acd..bcc23a8ca5 100644
--- a/wscript
+++ b/wscript
@@ -138,9 +138,9 @@ def configure(conf):
_load_intltool_if_available(conf)
# GTK / GIO version check
- conf.check_cfg(package='gtk+-2.0', atleast_version='2.12.0', uselib_store='GTK',
+ conf.check_cfg(package='gtk+-2.0', atleast_version='2.16.0', uselib_store='GTK',
mandatory=True, args='--cflags --libs')
- conf.check_cfg(package='glib-2.0', atleast_version='2.16.0', uselib_store='GLIB',
+ conf.check_cfg(package='glib-2.0', atleast_version='2.20.0', uselib_store='GLIB',
mandatory=True, args='--cflags --libs')
conf.check_cfg(package='gio-2.0', uselib_store='GIO', args='--cflags --libs', mandatory=True)
gtk_version = conf.check_cfg(modversion='gtk+-2.0', uselib_store='GTK') or 'Unknown'