Require Gtk 2.10 and don't treat GIO specially anymore

This commit is contained in:
Christian Dywan 2008-10-20 00:41:52 +02:00
parent 7f8fc2b31d
commit e848d1df6e
15 changed files with 31 additions and 73 deletions

4
README
View file

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

View file

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

View file

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

View file

@ -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 <mclasen@redhat.com>

View file

@ -16,14 +16,15 @@
#include <config.h>
#endif
#if HAVE_GIO
#include <glib.h>
#if GLIB_CHECK_VERSION (2, 16, 0)
#include <gio/gio.h>
#endif
#include <webkit/webkit.h>
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,

View file

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

View file

@ -26,7 +26,7 @@
#endif
#include <glib.h>
#if HAVE_GIO
#if GLIB_CHECK_VERSION (2, 16, 0)
#include <gio/gio.h>
#endif
#include <gtk/gtk.h>
@ -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

View file

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

View file

@ -24,7 +24,7 @@
#include <JavaScriptCore/JavaScript.h>
#include <glib/gi18n.h>
#include <string.h>
#if HAVE_GIO
#if GLIB_CHECK_VERSION (2, 16, 0)
#include <gio/gio.h>
#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)

View file

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

View file

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

View file

@ -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__ */

View file

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

View file

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

18
wscript
View file

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