From: Christian Dywan Date: Mon, 31 Oct 2011 21:10:39 +0000 (+0100) Subject: sokoke, gtk3-compat, gtkiconentry, stock join midori-platform.h X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fff7d8fd3bdb1f595555b809b7da1f0934ce40d;p=midori sokoke, gtk3-compat, gtkiconentry, stock join midori-platform.h Also introduce #define MIDORI_MODULE_PREFIX. Fixes: https://bugs.launchpad.net/midori/+bug/884395 --- diff --git a/extensions/adblock.c b/extensions/adblock.c index 803c197e..a72c5da5 100644 --- a/extensions/adblock.c +++ b/extensions/adblock.c @@ -11,11 +11,9 @@ */ #include +#include -#include #include "config.h" - -#include #if HAVE_UNISTD_H #include #endif diff --git a/extensions/addons.c b/extensions/addons.c index 2f82099b..7db7ab5f 100644 --- a/extensions/addons.c +++ b/extensions/addons.c @@ -14,11 +14,9 @@ /* This extensions add support for user addons: userscripts and userstyles */ #include -#include #include #include "config.h" - #if HAVE_UNISTD_H #include #endif diff --git a/extensions/cookie-manager/cookie-manager-page.c b/extensions/cookie-manager/cookie-manager-page.c index 70947dd4..16710dc4 100644 --- a/extensions/cookie-manager/cookie-manager-page.c +++ b/extensions/cookie-manager/cookie-manager-page.c @@ -9,12 +9,9 @@ See the file COPYING for the full license text. */ -#include #include #include -#include -#include "katze/gtk3-compat.h" #include #include diff --git a/extensions/copy-tabs.c b/extensions/copy-tabs.c index 60fe2dbc..55c4c315 100644 --- a/extensions/copy-tabs.c +++ b/extensions/copy-tabs.c @@ -10,7 +10,6 @@ */ #include -#include static void copy_tabs_apply_cb (GtkWidget* menuitem, diff --git a/extensions/feed-panel/feed-panel.c b/extensions/feed-panel/feed-panel.c index 576088ca..327237dc 100644 --- a/extensions/feed-panel/feed-panel.c +++ b/extensions/feed-panel/feed-panel.c @@ -12,13 +12,8 @@ #include "feed-panel.h" #include -#include #include -#if HAVE_CONFIG_H - #include -#endif - #define STOCK_FEED_PANEL "feed-panel" struct _FeedPanel diff --git a/extensions/formhistory.c b/extensions/formhistory.c index 04af872b..e5ea71f6 100644 --- a/extensions/formhistory.c +++ b/extensions/formhistory.c @@ -12,11 +12,9 @@ #define MINCHARS 2 #include +#include #include "config.h" -#include "midori/sokoke.h" - -#include #if HAVE_UNISTD_H #include #endif diff --git a/extensions/shortcuts.c b/extensions/shortcuts.c index f10ba985..85cb8085 100644 --- a/extensions/shortcuts.c +++ b/extensions/shortcuts.c @@ -11,7 +11,6 @@ #include -#include #include "config.h" static void diff --git a/extensions/statusbar-features.c b/extensions/statusbar-features.c index be47b9dd..2f0ee996 100644 --- a/extensions/statusbar-features.c +++ b/extensions/statusbar-features.c @@ -10,7 +10,6 @@ */ #include -#include typedef struct { diff --git a/extensions/tab-panel.c b/extensions/tab-panel.c index 0c2291a2..ce33af07 100644 --- a/extensions/tab-panel.c +++ b/extensions/tab-panel.c @@ -10,7 +10,6 @@ */ #include -#include #define STOCK_TAB_PANEL "tab-panel" diff --git a/extensions/tabs-minimized.c b/extensions/tabs-minimized.c index f5130ee3..feccfed5 100644 --- a/extensions/tabs-minimized.c +++ b/extensions/tabs-minimized.c @@ -10,7 +10,6 @@ */ #include -#include static void tabs_minimized_app_add_browser_cb (MidoriApp* app, diff --git a/extensions/web-cache.c b/extensions/web-cache.c index 1980d53d..a5ae6cdc 100644 --- a/extensions/web-cache.c +++ b/extensions/web-cache.c @@ -11,12 +11,10 @@ */ #include - -#include -#include "config.h" - #include #include + +#include "config.h" #if HAVE_UNISTD_H #include #endif diff --git a/midori/gtkiconentry.h b/midori/gtkiconentry.h index 3b566c8c..18ec4e10 100644 --- a/midori/gtkiconentry.h +++ b/midori/gtkiconentry.h @@ -21,10 +21,6 @@ #ifndef __GTK_ICON_ENTRY_H__ #define __GTK_ICON_ENTRY_H__ -#if HAVE_CONFIG_H - #include -#endif - #include #include diff --git a/midori/main.c b/midori/main.c index 7906c9d3..90b8e9a7 100644 --- a/midori/main.c +++ b/midori/main.c @@ -10,20 +10,19 @@ See the file COPYING for the full license text. */ -#if HAVE_CONFIG_H - #include -#endif - -#include "midori.h" +#include "midori-app.h" #include "midori-array.h" #include "midori-bookmarks.h" +#include "midori-extension.h" #include "midori-extensions.h" #include "midori-history.h" #include "midori-transfers.h" +#include "midori-panel.h" +#include "midori-platform.h" +#include "midori-preferences.h" #include -#include "sokoke.h" - +#include #if HAVE_UNISTD_H #include #endif @@ -32,6 +31,7 @@ #include #include #include +#include #include #include @@ -57,12 +57,6 @@ #include #endif -#ifdef G_OS_WIN32 - #define LIBPREFIX "" -#else - #define LIBPREFIX "lib" -#endif - static gchar* build_config_filename (const gchar* filename) { @@ -1805,7 +1799,7 @@ midori_clear_saved_logins_cb (void) g_unlink (path); /* Form History database, written by the extension */ katze_assign (path, g_build_filename (sokoke_set_config_dir (NULL), - "extensions", LIBPREFIX "formhistory." G_MODULE_SUFFIX, "forms.db", NULL)); + "extensions", MIDORI_MODULE_PREFIX "formhistory." G_MODULE_SUFFIX, "forms.db", NULL)); if (sqlite3_open (path, &db) == SQLITE_OK) { sqlite3_exec (db, "DELETE FROM forms", NULL, NULL, NULL); diff --git a/midori/midori-app.c b/midori/midori-app.c index 646038e4..772c13f1 100644 --- a/midori/midori-app.c +++ b/midori/midori-app.c @@ -14,8 +14,7 @@ #endif #include "midori-app.h" -#include "midori-stock.h" -#include "sokoke.h" +#include "midori-platform.h" #include #include diff --git a/midori/midori-browser.c b/midori/midori-browser.c index fee98075..dae48ad9 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -11,8 +11,6 @@ See the file COPYING for the full license text. */ -#include "gtk3-compat.h" - #include "midori-browser.h" #include "midori-array.h" @@ -21,21 +19,19 @@ #include "midori-panel.h" #include "midori-locationaction.h" #include "midori-searchaction.h" -#include "midori-stock.h" #include "midori-findbar.h" #include "midori-transferbar.h" #include "midori-platform.h" #include "midori-core.h" -#include "gtkiconentry.h" #include "marshal.h" -#include "sokoke.h" #include #include #include -#include #include + +#include #ifdef HAVE_UNISTD_H #include #endif @@ -58,10 +54,6 @@ #include -#if HAVE_CONFIG_H - #include -#endif - struct _MidoriBrowser { #if HAVE_HILDON diff --git a/midori/midori-extension.c b/midori/midori-extension.c index 634462cc..3a5cbd13 100644 --- a/midori/midori-extension.c +++ b/midori/midori-extension.c @@ -12,12 +12,8 @@ #include "midori-extension.h" -#if HAVE_CONFIG_H - #include -#endif - #include -#include "sokoke.h" +#include "midori-platform.h" #include G_DEFINE_TYPE (MidoriExtension, midori_extension, G_TYPE_OBJECT); @@ -295,8 +291,8 @@ midori_extension_activate_cb (MidoriExtension* extension, { gchar* filename = g_object_get_data (G_OBJECT (extension), "filename"); gchar* folder; - if (g_str_has_prefix (filename, "lib")) - filename = &filename[strlen ("len")]; + if (g_str_has_prefix (filename, MIDORI_MODULE_PREFIX)) + filename = &filename[strlen (MIDORI_MODULE_PREFIX)]; if (g_str_has_suffix (filename, G_MODULE_SUFFIX)) filename = g_strndup (filename, strlen (filename) - strlen ("." G_MODULE_SUFFIX)); diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index ee2d0d3b..682420c7 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -12,14 +12,13 @@ #include "midori-locationaction.h" -#include "gtkiconentry.h" #include "marshal.h" -#include "sokoke.h" #include "midori-browser.h" #include "midori-searchaction.h" #include "midori-platform.h" #include +#include "config.h" #include #include #include diff --git a/midori/midori-panel.c b/midori/midori-panel.c index 260a12ba..c1457790 100644 --- a/midori/midori-panel.c +++ b/midori/midori-panel.c @@ -11,17 +11,15 @@ #include "midori-panel.h" -#include "midori-view.h" - #include "midori-browser.h" +#include "midori-platform.h" +#include "midori-view.h" #include "marshal.h" -#include "sokoke.h" #include #include "config.h" - #ifdef HAVE_HILDON_2_2 #include #endif diff --git a/midori/midori-platform.h b/midori/midori-platform.h index 194bf57b..e974ed81 100644 --- a/midori/midori-platform.h +++ b/midori/midori-platform.h @@ -12,7 +12,10 @@ #ifndef __MIDORI_PLATFORM_H__ #define __MIDORI_PLATFORM_H__ 1 -#include +#include "midori/midori-stock.h" +#include "katze/gtk3-compat.h" +#include "midori/gtkiconentry.h" +#include "midori/sokoke.h" /* Common behavior modifiers */ #define MIDORI_MOD_NEW_WINDOW(state) (state & GDK_SHIFT_MASK) @@ -34,4 +37,11 @@ && MIDORI_MOD_NEW_TAB(((GdkEventButton*)evt)->state)) \ || (((GdkEventButton*)evt)->button == 2)) +#ifndef G_OS_WIN32 + #define MIDORI_MODULE_PREFIX "lib" +#else + #define MIDORI_MODULE_PREFIX "" +#endif + + #endif /* !__MIDORI_PLATFORM_H__ */ diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c index 1dc9f9e6..6bfe1218 100644 --- a/midori/midori-preferences.c +++ b/midori/midori-preferences.c @@ -11,12 +11,7 @@ #include "midori-preferences.h" -#if HAVE_CONFIG_H - #include -#endif - -#include "sokoke.h" -#include "midori-stock.h" +#include "midori-platform.h" #include #include @@ -27,6 +22,7 @@ #include #endif +#include #if HAVE_LIBNOTIFY #include #endif diff --git a/midori/midori-searchaction.c b/midori/midori-searchaction.c index 6c7acbcc..bb87bab8 100644 --- a/midori/midori-searchaction.c +++ b/midori/midori-searchaction.c @@ -11,13 +11,11 @@ #include "midori-searchaction.h" -#include "gtk3-compat.h" -#include "gtkiconentry.h" #include "marshal.h" -#include "sokoke.h" #include "midori-platform.h" #include "midori-core.h" +#include "config.h" #include #include #include diff --git a/midori/midori-stock.h b/midori/midori-stock.h index 991d2ecd..7fe9f127 100644 --- a/midori/midori-stock.h +++ b/midori/midori-stock.h @@ -12,8 +12,6 @@ #ifndef __MIDORI_STOCK_H__ #define __MIDORI_STOCK_H__ 1 -#include - /* Custom stock items We should distribute these diff --git a/midori/midori-view.c b/midori/midori-view.c index 9c537e65..d3837811 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -10,20 +10,13 @@ See the file COPYING for the full license text. */ -#if HAVE_CONFIG_H - #include -#endif - -#include "gtk3-compat.h" #include "midori-view.h" -#include "midori-stock.h" #include "midori-browser.h" #include "midori-searchaction.h" #include "midori-platform.h" #include "midori-core.h" #include "marshal.h" -#include "sokoke.h" #include #include @@ -33,10 +26,10 @@ #include #include +#include #if HAVE_UNISTD_H #include #endif - #ifndef G_OS_WIN32 #include #endif diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c index 9ef144ca..b6794a55 100644 --- a/midori/midori-websettings.c +++ b/midori/midori-websettings.c @@ -18,14 +18,10 @@ #include #include +#include #if HAVE_UNISTD_H #include #endif - -#if HAVE_CONFIG_H - #include -#endif - #if defined (G_OS_UNIX) #include #endif diff --git a/midori/midori.h b/midori/midori.h index f4e7a953..02af3671 100644 --- a/midori/midori.h +++ b/midori/midori.h @@ -20,7 +20,6 @@ #include "midori-panel.h" #include "midori-preferences.h" #include "midori-searchaction.h" -#include "midori-stock.h" #include "midori-view.h" #include "midori-viewable.h" #include "midori-websettings.h" diff --git a/midori/socket.h b/midori/socket.h index e7f175dc..45ae384e 100644 --- a/midori/socket.h +++ b/midori/socket.h @@ -12,11 +12,8 @@ #ifndef __SYLPH_SOCKET_H__ #define __SYLPH_SOCKET_H__ -#if HAVE_CONFIG_H -# include "config.h" -#endif - #include +#include "config.h" #if HAVE_NETDB_H # include #endif diff --git a/midori/sokoke.c b/midori/sokoke.c index 71c294da..63874917 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -13,13 +13,10 @@ #include "sokoke.h" -#if HAVE_CONFIG_H - #include -#endif - -#include "midori-stock.h" #include "midori-core.h" +#include "midori-platform.h" +#include #if HAVE_UNISTD_H #include #endif diff --git a/panels/midori-bookmarks.c b/panels/midori-bookmarks.c index dca50faa..8bf7e48b 100644 --- a/panels/midori-bookmarks.c +++ b/panels/midori-bookmarks.c @@ -10,18 +10,14 @@ */ #include "midori-bookmarks.h" -#include "gtk3-compat.h" #include "midori-array.h" #include "midori-app.h" #include "midori-browser.h" -#include "midori-stock.h" +#include "midori-platform.h" #include "midori-view.h" #include "midori-viewable.h" -#include "sokoke.h" -#include "gtkiconentry.h" - #include #include diff --git a/panels/midori-bookmarks.h b/panels/midori-bookmarks.h index 3dc260be..1be04121 100644 --- a/panels/midori-bookmarks.h +++ b/panels/midori-bookmarks.h @@ -12,8 +12,6 @@ #ifndef __MIDORI_BOOKMARKS_H__ #define __MIDORI_BOOKMARKS_H__ -#include "config.h" - #include #include #include diff --git a/panels/midori-extensions.c b/panels/midori-extensions.c index b55b6ba2..ad2de72f 100644 --- a/panels/midori-extensions.c +++ b/panels/midori-extensions.c @@ -13,11 +13,10 @@ #include "midori-app.h" #include "midori-extension.h" -#include "midori-stock.h" +#include "midori-platform.h" #include "midori-viewable.h" #include "midori-core.h" -#include "sokoke.h" #include struct _MidoriExtensions diff --git a/panels/midori-history.c b/panels/midori-history.c index 9dfa1400..0678df82 100644 --- a/panels/midori-history.c +++ b/panels/midori-history.c @@ -10,21 +10,16 @@ */ #include "midori-history.h" -#include "gtk3-compat.h" #include "midori-app.h" #include "midori-array.h" #include "midori-browser.h" -#include "midori-stock.h" +#include "midori-platform.h" #include "midori-view.h" #include "midori-viewable.h" -#include "sokoke.h" -#include "gtkiconentry.h" - #include #include - #include #define COMPLETION_DELAY 200 diff --git a/panels/midori-transfers.c b/panels/midori-transfers.c index 3309e6e0..83d070ba 100644 --- a/panels/midori-transfers.c +++ b/panels/midori-transfers.c @@ -13,10 +13,9 @@ #include "midori-app.h" #include "midori-browser.h" -#include "midori-stock.h" +#include "midori-platform.h" #include "midori-view.h" -#include "sokoke.h" #include struct _MidoriTransfers diff --git a/tests/browser.c b/tests/browser.c index 86629232..7cf359e9 100644 --- a/tests/browser.c +++ b/tests/browser.c @@ -9,13 +9,7 @@ See the file COPYING for the full license text. */ -#if HAVE_CONFIG_H - #include -#endif - #include "midori.h" -#include "midori-stock.h" -#include "sokoke.h" static void browser_create (void) diff --git a/tests/extensions.c b/tests/extensions.c index b471da2a..911ebf09 100644 --- a/tests/extensions.c +++ b/tests/extensions.c @@ -9,10 +9,6 @@ See the file COPYING for the full license text. */ -#if HAVE_CONFIG_H - #include -#endif - #include "midori.h" const gpointer magic = (gpointer)0xdeadbeef; diff --git a/tests/magic-uri.c b/tests/magic-uri.c index f9ce3b53..b9a211cc 100644 --- a/tests/magic-uri.c +++ b/tests/magic-uri.c @@ -10,11 +10,6 @@ See the file COPYING for the full license text. */ -#if HAVE_CONFIG_H - #include -#endif - -#include "sokoke.h" #include #define SM "http://www.searchmash.com/search/" diff --git a/tests/properties.c b/tests/properties.c index 2504b0f9..cd6b61cd 100644 --- a/tests/properties.c +++ b/tests/properties.c @@ -9,13 +9,8 @@ See the file COPYING for the full license text. */ -#if HAVE_CONFIG_H - #include -#endif - #include "midori.h" #include "midori-bookmarks.h" -#include "sokoke.h" typedef struct { diff --git a/toolbars/midori-findbar.c b/toolbars/midori-findbar.c index a639035d..c3296809 100644 --- a/toolbars/midori-findbar.c +++ b/toolbars/midori-findbar.c @@ -10,19 +10,15 @@ */ #include "midori-findbar.h" -#include "gtk3-compat.h" #include "midori-browser.h" -#include "gtkiconentry.h" -#include "sokoke.h" +#include "midori-platform.h" #include #include #include -#if HAVE_CONFIG_H - #include "config.h" -#endif +#include "config.h" struct _MidoriFindbar {