From e848d1df6e406f71dd867889392da089816846b8 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Mon, 20 Oct 2008 00:41:52 +0200 Subject: [PATCH] Require Gtk 2.10 and don't treat GIO specially anymore --- README | 4 ++-- configure.in | 8 +------- midori/Makefile.am | 6 ++---- midori/compat.c | 2 +- midori/compat.h | 9 +++++---- midori/gtkiconentry.c | 14 +++++++------- midori/gtkiconentry.h | 6 +++--- midori/main.c | 7 ------- midori/midori-addons.c | 10 +++++----- midori/midori-browser.c | 2 -- midori/midori-locationentry.c | 2 +- midori/midori-stock.h | 10 ---------- midori/midori-view.c | 4 ++-- midori/wscript_build | 2 +- wscript | 18 +----------------- 15 files changed, 31 insertions(+), 73 deletions(-) diff --git a/README b/README index 97360c91..63d716d5 100644 --- a/README +++ b/README @@ -12,9 +12,9 @@ Midori is a lightweight web browser. * Extensible via Javascript. * Custom context menu actions. -Requirements: GTK+ 2.6, WebkitGtk, libXML2 +Requirements: GTK+ 2.10, WebkitGtk, libXML2 -Optional: Glib 2.16, GtkSourceView 2.0, Unique 0.9, sqlite 3.0, xdg-open +Optional: Unique 0.9, libsoup 2.4, sqlite 3.0, xdg-open For installation instructions read INSTALL. diff --git a/configure.in b/configure.in index b8b93241..67480fca 100644 --- a/configure.in +++ b/configure.in @@ -45,14 +45,8 @@ AC_SUBST(UNIQUE_CFLAGS) AC_SUBST(UNIQUE_LIBS) AC_DEFINE_UNQUOTED(HAVE_UNIQUE,$have_unique, [Whether Unique is available]) -# Checks for GIO2 -PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.16, have_gio=1, have_gio=0) -AC_SUBST(GIO_CFLAGS) -AC_SUBST(GIO_LIBS) -AC_DEFINE_UNQUOTED(HAVE_GIO,$have_gio, [Whether GIO is available]) - # Checks for Gtk+2 -PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6, have_gtk=1, have_gtk=0) +PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.10, have_gtk=1, have_gtk=0) if test "x${have_gtk}" = "xfalse" ; then AC_MSG_ERROR([No Gtk+2 package information found]) fi diff --git a/midori/Makefile.am b/midori/Makefile.am index 6219a8ea..b92bf83e 100644 --- a/midori/Makefile.am +++ b/midori/Makefile.am @@ -2,9 +2,8 @@ INCLUDES = \ $(UNIQUE_CFLAGS) \ - $(GIO_CFLAGS) \ + $(SQLITE3_CFLAGS) \ $(GTK_CFLAGS) \ - $(GTKSOURCEVIEW_CFLAGS) \ $(WEBKIT_CFLAGS) \ -I../katze @@ -12,9 +11,8 @@ AM_CFLAGS = -DMIDORI_LOCALEDIR=\""$(localedir)"\" LDADD = \ $(UNIQUE_LIBS) \ - $(GIO_LIBS) \ + $(SQLITE3_LIBS) \ $(GTK_LIBS) \ - $(GTKSOURCEVIEW_LIBS)\ $(WEBKIT_LIBS) \ $(INTLLIBS) \ ../katze/libkatze.la diff --git a/midori/compat.c b/midori/compat.c index cd6243d5..e51fc095 100644 --- a/midori/compat.c +++ b/midori/compat.c @@ -31,7 +31,7 @@ g_strcmp0 (const gchar* string1, #if !GTK_CHECK_VERSION(2, 14, 0) -#if HAVE_GIO +#if GLIB_CHECK_VERSION (2, 16, 0) /* GTK+/ GdkPixbuf internal helper function Copyright (C) 2008 Matthias Clasen diff --git a/midori/compat.h b/midori/compat.h index 49cb3e60..423b2236 100644 --- a/midori/compat.h +++ b/midori/compat.h @@ -16,14 +16,15 @@ #include #endif -#if HAVE_GIO +#include +#if GLIB_CHECK_VERSION (2, 16, 0) #include #endif #include G_BEGIN_DECLS -#if !GLIB_CHECK_VERSION(2, 16, 0) +#if !GLIB_CHECK_VERSION (2, 16, 0) gint g_strcmp0 (const gchar* string1, @@ -31,9 +32,9 @@ g_strcmp0 (const gchar* string1, #endif -#if !GTK_CHECK_VERSION(2, 14, 0) +#if !GTK_CHECK_VERSION (2, 14, 0) -#if HAVE_GIO +#if GLIB_CHECK_VERSION (2, 16, 0) GdkPixbuf* gdk_pixbuf_new_from_stream (GInputStream* stream, diff --git a/midori/gtkiconentry.c b/midori/gtkiconentry.c index 33d4308f..6faa9845 100644 --- a/midori/gtkiconentry.c +++ b/midori/gtkiconentry.c @@ -61,7 +61,7 @@ typedef struct GdkCursorType cursor_type; gboolean custom_cursor; GtkImageType storage_type; - #if HAVE_GIO + #if GLIB_CHECK_VERSION (2, 16, 0) GIcon *gicon; #endif gchar *icon_name; @@ -274,7 +274,7 @@ gtk_icon_entry_class_init (GtkIconEntryClass *klass) NULL, GTK_PARAM_WRITABLE)); - #if HAVE_GIO + #if GLIB_CHECK_VERSION (2, 16, 0) g_object_class_install_property (gobject_class, PROP_GICON_PRIMARY, g_param_spec_object ("gicon-primary", @@ -433,7 +433,7 @@ gtk_icon_entry_set_property (GObject *object, g_value_get_string (value)); break; - #if HAVE_GIO + #if GLIB_CHECK_VERSION (2, 16, 0) case PROP_GICON_PRIMARY: gtk_icon_entry_set_icon_from_gicon (entry, GTK_ICON_ENTRY_PRIMARY, @@ -471,7 +471,7 @@ gtk_icon_entry_get_property (GObject *object, GTK_ICON_ENTRY_SECONDARY)); break; - #if HAVE_GIO + #if GLIB_CHECK_VERSION (2, 16, 0) case PROP_GICON_PRIMARY: g_value_set_object (value, gtk_icon_entry_get_gicon (entry, @@ -1104,7 +1104,7 @@ icon_theme_changed (GtkIconEntry *entry) gtk_icon_entry_set_icon_from_icon_name (entry, i, priv->icons[i].icon_name); } - #if HAVE_GIO + #if GLIB_CHECK_VERSION (2, 16, 0) else if (priv->icons[i].storage_type == _GTK_IMAGE_GICON) { g_object_unref (priv->icons[i].pixbuf); @@ -1339,7 +1339,7 @@ gtk_icon_entry_set_icon_from_icon_name (GtkIconEntry *entry, * appropriately. */ -#if HAVE_GIO +#if GLIB_CHECK_VERSION (2, 16, 0) void gtk_icon_entry_set_icon_from_gicon (const GtkIconEntry *entry, GtkIconEntryPosition icon_pos, @@ -1493,7 +1493,7 @@ gtk_icon_entry_get_pixbuf (const GtkIconEntry *entry, */ -#if HAVE_GIO +#if GLIB_CHECK_VERSION (2, 16, 0) GIcon * gtk_icon_entry_get_gicon (const GtkIconEntry *entry, GtkIconEntryPosition icon_pos) diff --git a/midori/gtkiconentry.h b/midori/gtkiconentry.h index c7fe063b..82015339 100644 --- a/midori/gtkiconentry.h +++ b/midori/gtkiconentry.h @@ -26,7 +26,7 @@ #endif #include -#if HAVE_GIO +#if GLIB_CHECK_VERSION (2, 16, 0) #include #endif #include @@ -86,14 +86,14 @@ void gtk_icon_entry_set_icon_from_icon_name (GtkIconEntry *entry, GtkIconEntryPosition icon_pos, const gchar *icon_name); -#if HAVE_GIO +#if GLIB_CHECK_VERSION (2, 16, 0) void gtk_icon_entry_set_icon_from_gicon (const GtkIconEntry *entry, GtkIconEntryPosition icon_pos, GIcon *icon); #endif GdkPixbuf* gtk_icon_entry_get_pixbuf (const GtkIconEntry *entry, GtkIconEntryPosition icon_pos); -#if HAVE_GIO +#if GLIB_CHECK_VERSION (2, 16, 0) GIcon* gtk_icon_entry_get_gicon (const GtkIconEntry *entry, GtkIconEntryPosition icon_pos); #endif diff --git a/midori/main.c b/midori/main.c index df4478cc..fd4de3d0 100644 --- a/midori/main.c +++ b/midori/main.c @@ -84,13 +84,6 @@ stock_items_init (void) { STOCK_TRANSFERS, N_("_Transfers"), 0, 0, GTK_STOCK_SAVE }, { STOCK_USER_TRASH, N_("_Closed Tabs and Windows"), 0, 0, "gtk-undo-ltr" }, { STOCK_WINDOW_NEW, N_("New _Window"), 0, 0, GTK_STOCK_ADD }, - #if !GTK_CHECK_VERSION(2, 10, 0) - { GTK_STOCK_SELECT_ALL, N_("Select _All"), 0, 0, NULL }, - #endif - #if !GTK_CHECK_VERSION(2, 8, 0) - { GTK_STOCK_FULLSCREEN, N_("_Fullscreen"), 0, 0, NULL }, - { GTK_STOCK_LEAVE_FULLSCREEN, N_("_Leave Fullscreen"), 0, 0, NULL }, - #endif }; GtkIconSource* icon_source; diff --git a/midori/midori-addons.c b/midori/midori-addons.c index 8415215d..b41e5b0a 100644 --- a/midori/midori-addons.c +++ b/midori/midori-addons.c @@ -24,7 +24,7 @@ #include #include #include -#if HAVE_GIO +#if GLIB_CHECK_VERSION (2, 16, 0) #include #endif @@ -313,7 +313,7 @@ _addons_toggle_disable_button (MidoriAddons* addons, gtk_widget_set_sensitive (GTK_WIDGET (button), sensitive); } -#if HAVE_GIO +#if GLIB_CHECK_VERSION (2, 16, 0) static void midori_addons_directory_monitor_changed (GFileMonitor* monitor, GFile* child, @@ -398,7 +398,7 @@ midori_addons_button_add_clicked_cb (GtkToolItem* toolitem, _addons_get_folder (addons)); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); - #if !HAVE_GIO + #if GLIB_CHECK_VERSION (2, 16, 0) /* FIXME: Without GIO clicking this button is the only way to update the list */ midori_addons_update_elements (addons); @@ -890,7 +890,7 @@ midori_addons_new (GtkWidget* web_widget, MidoriAddonKind kind) { MidoriAddons* addons; - #if HAVE_GIO + #if GLIB_CHECK_VERSION (2, 16, 0) GSList* directories; GSList* list; GFile* directory; @@ -907,7 +907,7 @@ midori_addons_new (GtkWidget* web_widget, midori_addons_set_kind (addons, kind); midori_addons_update_elements (addons); - #if HAVE_GIO + #if GLIB_CHECK_VERSION (2, 16, 0) directories = _addons_get_directories (addons); list = directories; while (directories) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index c37bfcd2..b6d0878e 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -807,12 +807,10 @@ _midori_browser_add_tab (MidoriBrowser* browser, gtk_notebook_append_page (GTK_NOTEBOOK (browser->notebook), view, tab_label); - #if GTK_CHECK_VERSION(2, 10, 0) gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (browser->notebook), view, TRUE); gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (browser->notebook), view, TRUE); - #endif /* We want the tab to be removed if the widget is destroyed */ g_signal_connect (view, "destroy", diff --git a/midori/midori-locationentry.c b/midori/midori-locationentry.c index 432a6bed..2f684631 100644 --- a/midori/midori-locationentry.c +++ b/midori/midori-locationentry.c @@ -70,7 +70,7 @@ midori_location_entry_class_init (MidoriLocationEntryClass* class) G_TYPE_INT); } -#define HAVE_ENTRY_PROGRESS GTK_CHECK_VERSION (2, 10, 0) +#define HAVE_ENTRY_PROGRESS 1 #ifdef HAVE_ENTRY_PROGRESS diff --git a/midori/midori-stock.h b/midori/midori-stock.h index caa467b7..6bcf3d21 100644 --- a/midori/midori-stock.h +++ b/midori/midori-stock.h @@ -47,14 +47,4 @@ #define STOCK_USER_TRASH "gnome-stock-trash" #define STOCK_WINDOW_NEW "stock_new-window" -/* For backwards compatibility */ - -#if !GTK_CHECK_VERSION(2, 10, 0) -#define GTK_STOCK_SELECT_ALL "gtk-select-all" -#endif -#if !GTK_CHECK_VERSION(2, 8, 0) -#define GTK_STOCK_FULLSCREEN "gtk-fullscreen" -#define GTK_STOCK_LEAVE_FULLSCREEN "gtk-leave-fullscreen" -#endif - #endif /* !__MIDORI_STOCK_H__ */ diff --git a/midori/midori-view.c b/midori/midori-view.c index 2a978a08..f4b06382 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -641,7 +641,7 @@ gjs_value_links_foreach_cb (GjsValue* link, MidoriView* view) { const gchar* type; -#if HAVE_GIO +#if GLIB_CHECK_VERSION (2, 16, 0) const gchar* rel; GFile* icon_file; GIcon* icon; @@ -663,7 +663,7 @@ gjs_value_links_foreach_cb (GjsValue* link, ? gjs_value_get_attribute_string (link, "title") : NULL); } } -#if HAVE_GIO +#if GLIB_CHECK_VERSION (2, 16, 0) if (gjs_value_has_attribute (link, "rel")) { rel = gjs_value_get_attribute_string (link, "rel"); diff --git a/midori/wscript_build b/midori/wscript_build index a5ae6932..f5cfe69d 100644 --- a/midori/wscript_build +++ b/midori/wscript_build @@ -6,5 +6,5 @@ obj = bld.create_obj ('cc', 'program') obj.target = 'midori' obj.includes = '. ..' obj.find_sources_in_dirs ('.') -obj.uselib = 'UNIQUE LIBSOUP GIO GTK GTKSOURCEVIEW SQLITE WEBKIT LIBXML' +obj.uselib = 'UNIQUE LIBSOUP GTK GTKSOURCEVIEW SQLITE WEBKIT LIBXML' obj.uselib_local = 'katze' diff --git a/wscript b/wscript index d683eb07..9178d9cd 100644 --- a/wscript +++ b/wscript @@ -102,20 +102,6 @@ def configure (conf): libsoup = 'no' conf.check_message_custom ('libsoup', 'support', libsoup) - if not Params.g_options.disable_gio: - conf.check_pkg ('gio-2.0', destvar='GIO', vnum='2.16.0', mandatory=False) - gio = ['not available','yes'][conf.env['HAVE_GIO'] == 1] - else: - gio = 'no' - conf.check_message_custom ('GIO', 'support', gio) - - if gio == 'yes': - if platform.system () != 'Windows': - if not conf.find_program ('gvfs-open'): - print '\tNote: There doesn\'t seem to be GVfs installed.' - print '\t The HTTP backend of GVfs is recommended for' - print '\t viewing source code and loading favicons.' - if not Params.g_options.disable_sqlite: conf.check_pkg ('sqlite3', destvar='SQLITE', vnum='3.0', mandatory=False) sqlite = ['not available','yes'][conf.env['HAVE_SQLITE'] == 1] @@ -125,7 +111,7 @@ def configure (conf): sqlite = 'no' conf.check_message_custom ('history database', 'support', sqlite) - conf.check_pkg ('gtk+-2.0', destvar='GTK', vnum='2.6.0', mandatory=True) + conf.check_pkg ('gtk+-2.0', destvar='GTK', vnum='2.10.0', mandatory=True) conf.check_pkg ('webkit-1.0', destvar='WEBKIT', vnum='0.1', mandatory=True) conf.check_pkg ('libxml-2.0', destvar='LIBXML', vnum='2.6', mandatory=True) @@ -160,8 +146,6 @@ def set_options (opt): help='Disables Unique support', dest='disable_unique') opt.add_option ('--disable-libsoup', action='store_true', default=False, help='Disables libsoup support', dest='disable_libsoup') - opt.add_option ('--disable-gio', action='store_true', default=False, - help='Disables GIO support', dest='disable_gio') opt.add_option ('--disable-sqlite', action='store_true', default=False, help='Disables sqlite support', dest='disable_sqlite')