Bump GTK+ version to 2.16

This commit is contained in:
Matthew Brush 2011-10-28 10:25:58 -07:00
parent c4980f8c1e
commit a23e999b7b
12 changed files with 37 additions and 63 deletions

10
HACKING
View File

@ -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

2
README
View File

@ -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.

View File

@ -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])

View File

@ -571,7 +571,7 @@ The latest version can always be found at <a class="reference external" href="ht
<h1><a class="toc-backref" href="#id12">Installation</a></h1>
<div class="section" id="requirements">
<h2><a class="toc-backref" href="#id13">Requirements</a></h2>
<p>You will need the GTK (&gt;= 2.12.0) libraries and their dependencies
<p>You will need the GTK (&gt;= 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.</p>
@ -584,7 +584,7 @@ incomplete list see <a class="reference external" href="http://www.geany.org/Dow
<div class="section" id="source-compilation">
<h2><a class="toc-backref" href="#id15">Source compilation</a></h2>
<p>Compiling Geany is quite easy.
To do so, you need the GTK (&gt;= 2.12.0) libraries and header files.
To do so, you need the GTK (&gt;= 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 <a class="reference external" href="http://www.gtk.org">http://www.gtk.org</a>, but very often
your distro will provide development packages to save the trouble of
@ -6700,7 +6700,7 @@ USE OR PERFORMANCE OF THIS SOFTWARE.</p>
<div class="footer">
<hr class="footer" />
<a class="reference external" href="geany.txt">View document source</a>.
Generated on: 2011-10-23 14:12 UTC.
Generated on: 2011-10-28 17:11 UTC.
Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>

View File

@ -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

View File

@ -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

View File

@ -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);
}
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);

View File

@ -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();
}

View File

@ -378,7 +378,6 @@ 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);
/* add checkboxes and filename entry */
@ -605,7 +604,6 @@ 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);
/* set the folder by default to the project base dir or the global pref for opening files */

View File

@ -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);
}
}
@ -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)
{

View File

@ -1871,8 +1871,6 @@ 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;
@ -1886,8 +1884,8 @@ gboolean utils_is_remote_path(const gchar *path)
* 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;
}

View File

@ -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'