Bump GTK+ version to 2.16
This commit is contained in:
parent
c4980f8c1e
commit
a23e999b7b
10
HACKING
10
HACKING
@ -144,16 +144,16 @@ And then simply apply it like so::
|
|||||||
|
|
||||||
GTK versions & API documentation
|
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
|
GTK/GLib versions should be avoided or made optional to keep the source
|
||||||
code building on older systems.
|
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
|
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
|
is also a tarball with all available files for download and use with
|
||||||
devhelp.
|
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
|
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
|
newer API additions and you don't have to take care about whether
|
||||||
you can use them or not.
|
you can use them or not.
|
||||||
@ -164,8 +164,8 @@ Coding
|
|||||||
them down into smaller static functions where possible. This makes code
|
them down into smaller static functions where possible. This makes code
|
||||||
much easier to read and maintain.
|
much easier to read and maintain.
|
||||||
* Use GLib types and functions - gint not int, g_free() not free().
|
* 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
|
* 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.12 (of
|
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
|
course, you can use the GTK_CHECK_VERSION macro to protect code using
|
||||||
later versions).
|
later versions).
|
||||||
* Variables should be declared before statements. You can use
|
* Variables should be declared before statements. You can use
|
||||||
|
2
README
2
README
@ -28,7 +28,7 @@ The basic features of Geany are:
|
|||||||
|
|
||||||
Requirements
|
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
|
libraries and header files. You will also need its dependency libraries
|
||||||
and header files, such as Pango, Glib and ATK. All these files are
|
and header files, such as Pango, Glib and ATK. All these files are
|
||||||
available at http://www.gtk.org.
|
available at http://www.gtk.org.
|
||||||
|
@ -57,7 +57,7 @@ GEANY_CHECK_REVISION([dnl force debug mode for a SVN working copy
|
|||||||
|
|
||||||
|
|
||||||
# GTK/GLib/GIO checks
|
# 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])
|
PKG_CHECK_MODULES([GTK], [$gtk_modules])
|
||||||
AC_SUBST([GTK_CFLAGS])
|
AC_SUBST([GTK_CFLAGS])
|
||||||
AC_SUBST([GTK_LIBS])
|
AC_SUBST([GTK_LIBS])
|
||||||
|
@ -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>
|
<h1><a class="toc-backref" href="#id12">Installation</a></h1>
|
||||||
<div class="section" id="requirements">
|
<div class="section" id="requirements">
|
||||||
<h2><a class="toc-backref" href="#id13">Requirements</a></h2>
|
<h2><a class="toc-backref" href="#id13">Requirements</a></h2>
|
||||||
<p>You will need the GTK (>= 2.12.0) libraries and their dependencies
|
<p>You will need the GTK (>= 2.16.0) libraries and their dependencies
|
||||||
(Pango, GLib and ATK). Your distro should provide packages for these,
|
(Pango, GLib and ATK). Your distro should provide packages for these,
|
||||||
usually installed by default. For Windows, you can download an installer
|
usually installed by default. For Windows, you can download an installer
|
||||||
from the website which bundles these libraries.</p>
|
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">
|
<div class="section" id="source-compilation">
|
||||||
<h2><a class="toc-backref" href="#id15">Source compilation</a></h2>
|
<h2><a class="toc-backref" href="#id15">Source compilation</a></h2>
|
||||||
<p>Compiling Geany is quite easy.
|
<p>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.
|
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
|
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
|
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">
|
<div class="footer">
|
||||||
<hr class="footer" />
|
<hr class="footer" />
|
||||||
<a class="reference external" href="geany.txt">View document source</a>.
|
<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.
|
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>
|
</div>
|
||||||
|
@ -101,7 +101,7 @@ Installation
|
|||||||
Requirements
|
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,
|
(Pango, GLib and ATK). Your distro should provide packages for these,
|
||||||
usually installed by default. For Windows, you can download an installer
|
usually installed by default. For Windows, you can download an installer
|
||||||
from the website which bundles these libraries.
|
from the website which bundles these libraries.
|
||||||
@ -118,7 +118,7 @@ Source compilation
|
|||||||
------------------
|
------------------
|
||||||
|
|
||||||
Compiling Geany is quite easy.
|
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.
|
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
|
All these files are available at http://www.gtk.org, but very often
|
||||||
your distro will provide development packages to save the trouble of
|
your distro will provide development packages to save the trouble of
|
||||||
|
@ -8,7 +8,7 @@ localedir=@localedir@
|
|||||||
|
|
||||||
Name: Geany
|
Name: Geany
|
||||||
Description: A fast and lightweight IDE using GTK2
|
Description: A fast and lightweight IDE using GTK2
|
||||||
Requires: gtk+-2.0 >= 2.12.0
|
Requires: gtk+-2.0 >= 2.16.0
|
||||||
Version: @VERSION@
|
Version: @VERSION@
|
||||||
Libs: -L${libdir}
|
Libs: -L${libdir}
|
||||||
Cflags: -DGTK -I${includedir}/geany -I${includedir}/geany/tagmanager -I${includedir}/geany/scintilla
|
Cflags: -DGTK -I${includedir}/geany -I${includedir}/geany/tagmanager -I${includedir}/geany/scintilla
|
||||||
|
@ -886,16 +886,6 @@ static GtkWidget *make_toolbar(void)
|
|||||||
g_signal_connect(wid, "clicked", G_CALLBACK(on_current_path), NULL);
|
g_signal_connect(wid, "clicked", G_CALLBACK(on_current_path), NULL);
|
||||||
gtk_container_add(GTK_CONTAINER(toolbar), wid);
|
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;
|
return toolbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -911,11 +901,9 @@ static GtkWidget *make_filterbar(void)
|
|||||||
filter_combo = gtk_combo_box_entry_new_text();
|
filter_combo = gtk_combo_box_entry_new_text();
|
||||||
filter_entry = gtk_bin_get_child(GTK_BIN(filter_combo));
|
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,
|
gtk_widget_set_tooltip_text(filter_entry,
|
||||||
_("Filter your files with the usual wildcards. Separate multiple patterns with a space."));
|
_("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);
|
g_signal_connect(filter_entry, "activate", G_CALLBACK(on_filter_activate), NULL);
|
||||||
|
@ -1428,14 +1428,12 @@ void on_menu_show_sidebar1_toggled(GtkCheckMenuItem *checkmenuitem, gpointer use
|
|||||||
interface_prefs.sidebar_symbol_visible = TRUE;
|
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 window has input focus, set it back to the editor before toggling off */
|
||||||
if (! ui_prefs.sidebar_visible &&
|
if (! ui_prefs.sidebar_visible &&
|
||||||
gtk_container_get_focus_child(GTK_CONTAINER(main_widgets.sidebar_notebook)) != NULL)
|
gtk_container_get_focus_child(GTK_CONTAINER(main_widgets.sidebar_notebook)) != NULL)
|
||||||
{
|
{
|
||||||
keybindings_send_command(GEANY_KEY_GROUP_FOCUS, GEANY_KEYS_FOCUS_EDITOR);
|
keybindings_send_command(GEANY_KEY_GROUP_FOCUS, GEANY_KEYS_FOCUS_EDITOR);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
ui_sidebar_show_hide();
|
ui_sidebar_show_hide();
|
||||||
}
|
}
|
||||||
|
@ -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_type_hint(GTK_WINDOW(dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
|
||||||
gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(main_widgets.window));
|
gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(main_widgets.window));
|
||||||
gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), TRUE);
|
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 */
|
/* add checkboxes and filename entry */
|
||||||
gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(dialog), add_file_open_extra_widget(dialog));
|
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_widget_show_all(vbox);
|
||||||
gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(dialog), vbox);
|
gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(dialog), vbox);
|
||||||
gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dialog), TRUE);
|
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 */
|
/* set the folder by default to the project base dir or the global pref for opening files */
|
||||||
initdir = utils_get_default_dir_utf8();
|
initdir = utils_get_default_dir_utf8();
|
||||||
|
@ -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 (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)
|
if (grf->type == RECENT_FILE_FILE)
|
||||||
{
|
{
|
||||||
GtkRecentManager *manager = gtk_recent_manager_get_default();
|
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);
|
g_free(uri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
g_queue_push_head(grf->recent_queue, g_strdup(utf8_filename));
|
g_queue_push_head(grf->recent_queue, g_strdup(utf8_filename));
|
||||||
if (g_queue_get_length(grf->recent_queue) > file_prefs.mru_length)
|
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.
|
/** 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.
|
* 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.
|
* @param entry The GtkEntry object to which the icon should be attached.
|
||||||
*
|
*
|
||||||
* @since 0.16
|
* @since 0.16
|
||||||
*/
|
*/
|
||||||
void ui_entry_add_clear_icon(GtkEntry *entry)
|
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 *ui_get_mime_icon(const gchar *mime_type, GtkIconSize size)
|
||||||
{
|
{
|
||||||
GdkPixbuf *icon = NULL;
|
GdkPixbuf *icon = NULL;
|
||||||
#if GTK_CHECK_VERSION(2, 14, 0)
|
|
||||||
gchar *ctype;
|
gchar *ctype;
|
||||||
GIcon *gicon;
|
GIcon *gicon;
|
||||||
GtkIconInfo *info;
|
GtkIconInfo *info;
|
||||||
@ -2558,7 +2550,7 @@ GdkPixbuf *ui_get_mime_icon(const gchar *mime_type, GtkIconSize size)
|
|||||||
gtk_icon_info_free(info);
|
gtk_icon_info_free(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
/* fallback for builds with GIO < 2.18 or if icon lookup failed, like it might happen on Windows */
|
/* fallback for builds with GIO < 2.18 or if icon lookup failed, like it might happen on Windows */
|
||||||
if (icon == NULL)
|
if (icon == NULL)
|
||||||
{
|
{
|
||||||
|
26
src/utils.c
26
src/utils.c
@ -1871,23 +1871,21 @@ gboolean utils_is_remote_path(const gchar *path)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
#ifndef G_OS_WIN32
|
#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))
|
if (G_UNLIKELY(fuse_path == NULL))
|
||||||
{
|
{
|
||||||
fuse_path = g_build_filename(g_get_home_dir(), ".gvfs", NULL);
|
fuse_path = g_build_filename(g_get_home_dir(), ".gvfs", NULL);
|
||||||
len = strlen(fuse_path);
|
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);
|
|
||||||
}
|
}
|
||||||
|
/* 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
|
#endif
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
wscript
4
wscript
@ -138,9 +138,9 @@ def configure(conf):
|
|||||||
_load_intltool_if_available(conf)
|
_load_intltool_if_available(conf)
|
||||||
|
|
||||||
# GTK / GIO version check
|
# 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')
|
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')
|
mandatory=True, args='--cflags --libs')
|
||||||
conf.check_cfg(package='gio-2.0', uselib_store='GIO', args='--cflags --libs', mandatory=True)
|
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'
|
gtk_version = conf.check_cfg(modversion='gtk+-2.0', uselib_store='GTK') or 'Unknown'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user