[geany/geany] 4efcba: Include what you use

Matthew Brush git-noreply at xxxxx
Wed May 21 22:37:19 UTC 2014


Branch:      refs/heads/master
Author:      Matthew Brush <matt at geany.org>
Committer:   Matthew Brush <matt at geany.org>
Date:        Wed, 21 May 2014 22:37:19 UTC
Commit:      4efcbab33234d13a7c6d1dea2901535d9317e4e1
             https://github.com/geany/geany/commit/4efcbab33234d13a7c6d1dea2901535d9317e4e1

Log Message:
-----------
Include what you use

This is a mega-commit - because most of it had to be done in one go
otherwise some commits would fail to compile - that attempts to fix a
few problems with Geany's includes as well as various other related
cleanups. After this change it's easier to use includes and there's
little worry about which order things are included in or who includes
what.

Overview of changes:

* Include config.h at the start of each source file if HAVE_CONFIG_H
  is defined (and never in headers).
* Go through each source file and make the includes section generally
  like this:
  - Always config.h first as above
  - Then if the file has a header with the same name, include that
  - Then include in alphabetical order each other internal/geany header.
  - Then include standard headers
  - Then include non-standard system headers
  - Then include GLib/GTK+ related stuff
* Doing as above makes it easier to find implicit header include
  dependencies and it exposed quite a few weird problems with includes
  or forward declarations, fix those.
* Make geany.h contain not much besides some defines.
  - Add a little header file "app.h" for GeanyApp and move it there
  - Move "app" global to new "app.h" file
  - Move "ignore_callback" global to "callbacks.h"
  - Move "geany_object" global to "geanyobject.h"
* Add an include in "geany.h" for "app.h" since GeanyApp used to be
  defined there and some plugins included this header to access
  GeanyApp.
* Include "gtkcompat.h" everywhere instead of gtk/gtk.h so that
  everywhere sees the same definitions (not a problem in practice AFAIK
  so this could be changed back if better that way.
* Remove forward declarations from previous commits as some people
  apparently consider this bad style, despite that it reduces inter-
  header dependencies.

TODO:
* As always, to test on win32
* As always, to test with not Autotools
* Test plugins better, both builtin and geany-plugins, likely API/ABI bump
* Test with various defines/flags that may change what is included
* win32.[ch] not really touched since I couldn't test


Modified Paths:
--------------
    plugins/geanyplugin.h
    src/Makefile.am
    src/about.c
    src/app.h
    src/build.c
    src/build.h
    src/callbacks.c
    src/callbacks.h
    src/dialogs.c
    src/dialogs.h
    src/document.c
    src/document.h
    src/documentprivate.h
    src/editor.c
    src/editor.h
    src/encodings.c
    src/encodings.h
    src/filetypes.c
    src/filetypes.h
    src/filetypesprivate.h
    src/gb.c
    src/geany.h
    src/geanyentryaction.c
    src/geanyentryaction.h
    src/geanymenubuttonaction.c
    src/geanymenubuttonaction.h
    src/geanyobject.c
    src/geanyobject.h
    src/geanywraplabel.c
    src/geanywraplabel.h
    src/highlighting.c
    src/highlighting.h
    src/highlightingmappings.h
    src/keybindings.c
    src/keybindings.h
    src/keybindingsprivate.h
    src/keyfile.c
    src/log.c
    src/main.c
    src/msgwindow.c
    src/msgwindow.h
    src/navqueue.c
    src/navqueue.h
    src/notebook.c
    src/notebook.h
    src/plugindata.h
    src/pluginprivate.h
    src/plugins.c
    src/pluginutils.c
    src/pluginutils.h
    src/prefix.c
    src/prefs.c
    src/printing.c
    src/printing.h
    src/project.c
    src/projectprivate.h
    src/sciwrappers.c
    src/sciwrappers.h
    src/search.c
    src/search.h
    src/sidebar.c
    src/sidebar.h
    src/socket.c
    src/stash.c
    src/stash.h
    src/symbols.c
    src/symbols.h
    src/templates.c
    src/templates.h
    src/toolbar.c
    src/toolbar.h
    src/tools.c
    src/tools.h
    src/ui_utils.c
    src/ui_utils.h
    src/utils.c
    src/utils.h
    src/vte.c
    src/vte.h
    src/win32.c
    src/win32.h
    wscript

Modified: plugins/geanyplugin.h
6 lines changed, 3 insertions(+), 3 deletions(-)
===================================================================
@@ -28,17 +28,17 @@
 #ifndef GEANY_PLUGIN_H
 #define GEANY_PLUGIN_H 1
 
-#include "geany.h"
-#include "plugindata.h"
-
 /* Note: only include headers that define types or macros, not just functions */
+#include "app.h"
 #include "document.h"
 #include "editor.h"
 #include "encodings.h"
 #include "filetypes.h"
+#include "geany.h"
 #include "highlighting.h"
 #include "keybindings.h"
 #include "msgwindow.h"
+#include "plugindata.h"
 #include "prefs.h"
 #include "project.h"
 #include "search.h"


Modified: src/Makefile.am
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -16,6 +16,7 @@ bin_PROGRAMS = geany
 
 SRCS = \
 	about.c about.h \
+	app.h \
 	build.c build.h \
 	callbacks.c callbacks.h \
 	dialogs.c dialogs.h \
@@ -61,6 +62,7 @@ geany_includedir = $(includedir)/geany
 
 # only install headers that define types or macros, not just functions
 geany_include_HEADERS = \
+	app.h \
 	build.h \
 	document.h \
 	editor.h \


Modified: src/about.c
17 lines changed, 11 insertions(+), 6 deletions(-)
===================================================================
@@ -24,17 +24,22 @@
  * About dialog and credits.
  */
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include "about.h"
+
+#include "app.h"
+#include "gb.c"
 #include "geany.h"
-#include "utils.h"
-#include "ui_utils.h"
-#include "support.h"
 #include "geanywraplabel.h"
 #include "main.h"
-#include "templates.h"
-
-#include "gb.c"
+#include "support.h"
+#include "ui_utils.h"
+#include "utils.h"
 
+#include "gtkcompat.h"
 
 #define HEADER "<span size=\"larger\" weight=\"bold\">Geany %s</span>"
 #define INFO "<span size=\"larger\" weight=\"bold\">%s</span>"


Modified: src/app.h
60 lines changed, 60 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,60 @@
+/*
+ *      app.h - this file is part of Geany, a fast and lightweight IDE
+ *
+ *      Copyright 2005-2014 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
+ *      Copyright 2006-2014 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+ *      Copyright 2014 Matthew Brush <matt at geany.org>
+ *
+ *      This program is free software; you can redistribute it and/or modify
+ *      it under the terms of the GNU General Public License as published by
+ *      the Free Software Foundation; either version 2 of the License, or
+ *      (at your option) any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License along
+ *      with this program; if not, write to the Free Software Foundation, Inc.,
+ *      51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/**
+ * @file app.h
+ * Contains the GeanyApp.
+ */
+
+#ifndef GEANY_APP_H
+#define GEANY_APP_H 1
+
+#include "tm_tag.h" /* FIXME: should be included in tm_workspace.h */
+#include "tm_workspace.h"
+#include "project.h"
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+/** Important application fields. */
+typedef struct GeanyApp
+{
+	gboolean			debug_mode;		/**< @c TRUE if debug messages should be printed. */
+	/** User configuration directory, usually @c ~/.config/geany.
+	 * This is a full path read by @ref tm_get_real_path().
+	 * @note Plugin configuration files should be saved as:
+	 * @code g_build_path(G_DIR_SEPARATOR_S, geany->app->configdir, "plugins", "pluginname",
+	 * 	"file.conf", NULL); @endcode */
+	gchar				*configdir;
+	gchar				*datadir;
+	gchar				*docdir;
+	const TMWorkspace	*tm_workspace;	/**< TagManager workspace/session tags. */
+	struct GeanyProject	*project;		/**< Currently active project or @c NULL if none is open. */
+}
+GeanyApp;
+
+extern GeanyApp *app;
+
+G_END_DECLS
+
+#endif /* GEANY_APP_H */


Modified: src/build.c
38 lines changed, 21 insertions(+), 17 deletions(-)
===================================================================
@@ -28,8 +28,28 @@
  * Replace defines with enums.
  * Other TODOs in code. */
 
-#include "geany.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "app.h"
 #include "build.h"
+#include "dialogs.h"
+#include "document.h"
+#include "filetypesprivate.h"
+#include "geanymenubuttonaction.h"
+#include "geanyobject.h"
+#include "keybindingsprivate.h"
+#include "msgwindow.h"
+#include "prefs.h"
+#include "projectprivate.h"
+#include "support.h"
+#include "toolbar.h"
+#include "ui_utils.h"
+#include "utils.h"
+#include "vte.h"
+
+#include "gtkcompat.h"
 
 #include <stdlib.h>
 #include <string.h>
@@ -46,22 +66,6 @@
 # include <windows.h>
 #endif
 
-#include "prefs.h"
-#include "support.h"
-#include "document.h"
-#include "utils.h"
-#include "ui_utils.h"
-#include "dialogs.h"
-#include "msgwindow.h"
-#include "filetypesprivate.h"
-#include "keybindings.h"
-#include "vte.h"
-#include "projectprivate.h"
-#include "editor.h"
-#include "win32.h"
-#include "toolbar.h"
-#include "geanymenubuttonaction.h"
-#include "gtkcompat.h"
 
 /* g_spawn_async_with_pipes doesn't work on Windows */
 #ifdef G_OS_WIN32


Modified: src/build.h
17 lines changed, 8 insertions(+), 9 deletions(-)
===================================================================
@@ -24,13 +24,12 @@
 #ifndef GEANY_BUILD_H
 #define GEANY_BUILD_H 1
 
-#include <glib.h>
+#include "document.h"
+#include "filetypes.h"
 
-G_BEGIN_DECLS
+#include "gtkcompat.h"
 
-/* Forward-declared to avoid including their headers here */
-struct GeanyDocument;
-struct GeanyFiletype;
+G_BEGIN_DECLS
 
 /* Order is important (see GBO_TO_GBG, GBO_TO_CMD below) */
 /* * Geany Known Build Commands.
@@ -170,9 +169,9 @@ void build_init(void);
 void build_finalize(void);
 
 /* menu configuration dialog functions */
-GtkWidget *build_commands_table(struct GeanyDocument *doc, GeanyBuildSource dst, BuildTableData *data, struct GeanyFiletype *ft);
+GtkWidget *build_commands_table(GeanyDocument *doc, GeanyBuildSource dst, BuildTableData *data, GeanyFiletype *ft);
 
-void build_read_project(struct GeanyFiletype *ft, BuildTableData build_properties);
+void build_read_project(GeanyFiletype *ft, BuildTableData build_properties);
 
 void build_free_fields(BuildTableData data);
 
@@ -181,7 +180,7 @@ gboolean build_parse_make_dir(const gchar *string, gchar **prefix);
 
 /* build menu functions */
 
-void build_menu_update(struct GeanyDocument *doc);
+void build_menu_update(GeanyDocument *doc);
 
 void build_toolbutton_build_clicked(GtkAction *action, gpointer user_data);
 
@@ -208,7 +207,7 @@ void build_set_group_count(GeanyBuildGroup grp, gint count);
 
 guint build_get_group_count(const GeanyBuildGroup grp);
 
-gchar **build_get_regex(GeanyBuildGroup grp, struct GeanyFiletype *ft, guint *from);
+gchar **build_get_regex(GeanyBuildGroup grp, GeanyFiletype *ft, guint *from);
 
 G_END_DECLS
 


Modified: src/callbacks.c
71 lines changed, 33 insertions(+), 38 deletions(-)
===================================================================
@@ -24,58 +24,53 @@
  * main window. Callbacks not used by Glade should go elsewhere.
  */
 
-#include "geany.h"
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <gdk/gdkkeysyms.h>
-#include <glib/gstdio.h>
-#include <time.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include "callbacks.h"
-#include "support.h"
 
-#include "keyfile.h"
-#include "document.h"
-#include "documentprivate.h"
-#include "filetypes.h"
-#include "sciwrappers.h"
-#include "editor.h"
-#include "ui_utils.h"
-#include "utils.h"
-#include "dialogs.h"
 #include "about.h"
-#include "msgwindow.h"
+#include "app.h"
 #include "build.h"
-#include "prefs.h"
-#include "templates.h"
-#include "sidebar.h"
-#include "keybindings.h"
+#include "dialogs.h"
+#include "documentprivate.h"
 #include "encodings.h"
-#include "search.h"
+#include "filetypes.h"
+#include "geanyobject.h"
+#include "highlighting.h"
+#include "keybindings.h"
+#include "keyfile.h"
+#include "log.h"
 #include "main.h"
-#include "symbols.h"
-#include "tools.h"
-#include "project.h"
+#include "msgwindow.h"
 #include "navqueue.h"
-#include "printing.h"
 #include "plugins.h"
-#include "log.h"
-#include "toolbar.h"
-#include "highlighting.h"
 #include "pluginutils.h"
-#include "gtkcompat.h"
-
-
-#ifdef HAVE_VTE
-# include "vte.h"
-#endif
-
+#include "prefs.h"
+#include "printing.h"
+#include "sciwrappers.h"
+#include "sidebar.h"
 #ifdef HAVE_SOCKET
 # include "socket.h"
 #endif
+#include "support.h"
+#include "symbols.h"
+#include "templates.h"
+#include "toolbar.h"
+#include "tools.h"
+#include "ui_utils.h"
+#include "utils.h"
+#include "vte.h"
 
+#include "gtkcompat.h"
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <gdk/gdkkeysyms.h>
+#include <glib/gstdio.h>
+#include <time.h>
 
 
 /* flag to indicate that an insert callback was triggered from the file menu,


Modified: src/callbacks.h
5 lines changed, 3 insertions(+), 2 deletions(-)
===================================================================
@@ -22,11 +22,12 @@
 #ifndef GEANY_CALLBACKS_H
 #define GEANY_CALLBACKS_H 1
 
-#include <glib.h>
-#include "geany.h" /* necessary for interface.c */
+#include "gtkcompat.h"
 
 G_BEGIN_DECLS
 
+extern gboolean	ignore_callback;
+
 G_MODULE_EXPORT gboolean
 on_exit_clicked						(GtkWidget *widget, gpointer gdata);
 


Modified: src/dialogs.c
35 lines changed, 17 insertions(+), 18 deletions(-)
===================================================================
@@ -23,7 +23,23 @@
  * File related dialogs, miscellaneous dialogs, font dialog.
  */
 
-#include "geany.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "dialogs.h"
+
+#include "app.h"
+#include "build.h"
+#include "document.h"
+#include "encodings.h"
+#include "filetypes.h"
+#include "main.h"
+#include "support.h"
+#include "utils.h"
+#include "ui_utils.h"
+
+#include "gtkcompat.h"
 
 #include <gdk/gdkkeysyms.h>
 #include <string.h>
@@ -40,23 +56,6 @@
 /* gstdio.h also includes sys/stat.h */
 #include <glib/gstdio.h>
 
-#include "dialogs.h"
-
-#include "callbacks.h"
-#include "document.h"
-#include "filetypes.h"
-#include "win32.h"
-#include "sciwrappers.h"
-#include "support.h"
-#include "utils.h"
-#include "ui_utils.h"
-#include "keybindings.h"
-#include "encodings.h"
-#include "build.h"
-#include "main.h"
-#include "project.h"
-#include "gtkcompat.h"
-
 
 enum
 {


Modified: src/dialogs.h
11 lines changed, 5 insertions(+), 6 deletions(-)
===================================================================
@@ -28,12 +28,11 @@
 #ifndef GEANY_DIALOGS_H
 #define GEANY_DIALOGS_H 1
 
-#include <glib.h>
+#include "document.h"
 
-G_BEGIN_DECLS
+#include "gtkcompat.h"
 
-/* Forward-declared to avoid including document.h here */
-struct GeanyDocument;
+G_BEGIN_DECLS
 
 typedef void (*GeanyInputCallback)(const gchar *text);
 
@@ -42,7 +41,7 @@ void dialogs_show_open_file(void);
 
 gboolean dialogs_show_save_as(void);
 
-gboolean dialogs_show_unsaved_file(struct GeanyDocument *doc);
+gboolean dialogs_show_unsaved_file(GeanyDocument *doc);
 
 void dialogs_show_open_font(void);
 
@@ -62,7 +61,7 @@ GtkWidget *dialogs_show_input_persistent(const gchar *title, GtkWindow *parent,
 gboolean dialogs_show_input_numeric(const gchar *title, const gchar *label_text,
 	gdouble *value, gdouble min, gdouble max, gdouble step);
 
-void dialogs_show_file_properties(struct GeanyDocument *doc);
+void dialogs_show_file_properties(GeanyDocument *doc);
 
 gboolean dialogs_show_question(const gchar *text, ...) G_GNUC_PRINTF (1, 2);
 


Modified: src/document.c
56 lines changed, 28 insertions(+), 28 deletions(-)
===================================================================
@@ -24,7 +24,33 @@
  *  Also Scintilla search actions.
  */
 
-#include "geany.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "document.h"
+
+#include "app.h"
+#include "callbacks.h" /* for ignore_callback */
+#include "dialogs.h"
+#include "documentprivate.h"
+#include "encodings.h"
+#include "filetypesprivate.h"
+#include "geany.h" /* FIXME: why is this needed for DOC_FILENAME()? should come from documentprivate.h/document.h */
+#include "geanyobject.h"
+#include "highlighting.h"
+#include "main.h"
+#include "msgwindow.h"
+#include "navqueue.h"
+#include "notebook.h"
+#include "project.h"
+#include "sciwrappers.h"
+#include "sidebar.h"
+#include "support.h"
+#include "symbols.h"
+#include "ui_utils.h"
+#include "utils.h"
+#include "vte.h"
 
 #ifdef HAVE_SYS_TIME_H
 # include <sys/time.h>
@@ -48,36 +74,10 @@
 /*#define USE_GIO_FILEMON 1*/
 #include <gio/gio.h>
 
-#include "document.h"
-#include "documentprivate.h"
-#include "filetypes.h"
-#include "support.h"
-#include "sciwrappers.h"
-#include "editor.h"
-#include "dialogs.h"
-#include "msgwindow.h"
-#include "templates.h"
-#include "sidebar.h"
-#include "ui_utils.h"
-#include "utils.h"
-#include "encodings.h"
-#include "notebook.h"
-#include "main.h"
-#include "vte.h"
-#include "build.h"
-#include "symbols.h"
-#include "highlighting.h"
-#include "navqueue.h"
-#include "win32.h"
-#include "search.h"
-#include "filetypesprivate.h"
-#include "project.h"
-
-#include "SciLexer.h"
-
 
 GeanyFilePrefs file_prefs;
 
+
 /** Dynamic array of GeanyDocument pointers.
  * Once a pointer is added to this, it is never freed. This means you can keep a pointer
  * to a document over time, but it may represent a different


Modified: src/document.h
33 lines changed, 17 insertions(+), 16 deletions(-)
===================================================================
@@ -29,17 +29,19 @@
 #ifndef GEANY_DOCUMENT_H
 #define GEANY_DOCUMENT_H 1
 
-#include <glib.h>
-
-G_BEGIN_DECLS
-
-#include "Scintilla.h"
-#include "ScintillaWidget.h"
 #include "editor.h"
+#include "filetypes.h"
+#include "geany.h"
 #include "search.h"
 
-/* Forward-declared to avoid including filetypes.h here */
-struct GeanyFiletype;
+#include "gtkcompat.h" /* Needed by ScintillaWidget.h */
+#include "Scintilla.h" /* Needed by ScintillaWidget.h */
+#include "ScintillaWidget.h" /* For ScintillaObject */
+
+#include <glib.h>
+
+
+G_BEGIN_DECLS
 
 #if defined(G_OS_WIN32)
 # define GEANY_DEFAULT_EOL_CHARACTER SC_EOL_CRLF
@@ -98,10 +100,10 @@ typedef struct GeanyDocument
 	gchar 			*encoding;
 	/** Internally used flag to indicate whether the file of this document has a byte-order-mark. */
 	gboolean		 has_bom;
-	struct GeanyEditor *editor;	/**< The editor associated with the document. */
+	GeanyEditor *editor;	/**< The editor associated with the document. */
 	/** The filetype for this document, it's only a reference to one of the elements of the global
 	 *  filetypes array. */
-	struct GeanyFiletype	*file_type;
+	GeanyFiletype	*file_type;
 	/** TMWorkObject object for this document, or @c NULL. */
 	TMWorkObject	*tm_file;
 	/** Whether this document is read-only. */
@@ -173,10 +175,9 @@ extern GPtrArray *documents_array;
 	(G_LIKELY((doc)->file_name != NULL) ? ((doc)->file_name) : GEANY_STRING_UNTITLED)
 
 
-
 /* These functions will replace the older functions. For now they have a documents_ prefix. */
 
-GeanyDocument* document_new_file(const gchar *filename, struct GeanyFiletype *ft, const gchar *text);
+GeanyDocument* document_new_file(const gchar *filename, GeanyFiletype *ft, const gchar *text);
 
 GeanyDocument* document_new_file_if_non_open(void);
 
@@ -189,13 +190,13 @@ gboolean document_save_file(GeanyDocument *doc, gboolean force);
 gboolean document_save_file_as(GeanyDocument *doc, const gchar *utf8_fname);
 
 GeanyDocument* document_open_file(const gchar *locale_filename, gboolean readonly,
-		struct GeanyFiletype *ft, const gchar *forced_enc);
+		GeanyFiletype *ft, const gchar *forced_enc);
 
 gboolean document_reload_file(GeanyDocument *doc, const gchar *forced_enc);
 
 void document_set_text_changed(GeanyDocument *doc, gboolean changed);
 
-void document_set_filetype(GeanyDocument *doc, struct GeanyFiletype *type);
+void document_set_filetype(GeanyDocument *doc, GeanyFiletype *type);
 
 void document_reload_config(GeanyDocument *doc);
 
@@ -228,11 +229,11 @@ gboolean document_account_for_unsaved(void);
 gboolean document_close_all(void);
 
 GeanyDocument *document_open_file_full(GeanyDocument *doc, const gchar *filename, gint pos,
-		gboolean readonly, struct GeanyFiletype *ft, const gchar *forced_enc);
+		gboolean readonly, GeanyFiletype *ft, const gchar *forced_enc);
 
 void document_open_file_list(const gchar *data, gsize length);
 
-void document_open_files(const GSList *filenames, gboolean readonly, struct GeanyFiletype *ft,
+void document_open_files(const GSList *filenames, gboolean readonly, GeanyFiletype *ft,
 		const gchar *forced_enc);
 
 gboolean document_search_bar_find(GeanyDocument *doc, const gchar *text, gint flags, gboolean inc,


Modified: src/documentprivate.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -23,7 +23,7 @@
 #ifndef GEANY_DOCUMENT_PRIVATE_H
 #define GEANY_DOCUMENT_PRIVATE_H 1
 
-#include <glib.h>
+#include "gtkcompat.h"
 
 G_BEGIN_DECLS
 


Modified: src/editor.c
45 lines changed, 24 insertions(+), 21 deletions(-)
===================================================================
@@ -33,41 +33,44 @@
  * Also some general Scintilla-related functions.
  */
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include <ctype.h>
-#include <string.h>
-
-#include <gdk/gdkkeysyms.h>
-
-#include "SciLexer.h"
-#include "geany.h"
-
-#include "support.h"
 #include "editor.h"
-#include "document.h"
+
+#include "app.h"
+#include "callbacks.h"
+#include "dialogs.h"
 #include "documentprivate.h"
-#include "filetypes.h"
 #include "filetypesprivate.h"
+#include "geanyobject.h"
+#include "highlighting.h"
+#include "keybindings.h"
+#include "main.h"
+#include "prefs.h"
+#include "projectprivate.h"
 #include "sciwrappers.h"
-#include "ui_utils.h"
-#include "utils.h"
-#include "dialogs.h"
+#include "support.h"
 #include "symbols.h"
-#include "callbacks.h"
 #include "templates.h"
-#include "keybindings.h"
-#include "project.h"
-#include "projectprivate.h"
-#include "main.h"
-#include "highlighting.h"
+#include "ui_utils.h"
+#include "utils.h"
+
+#include "SciLexer.h"
+
 #include "gtkcompat.h"
 
+#include <ctype.h>
+#include <string.h>
+
+#include <gdk/gdkkeysyms.h>
+
 
 /* Note: use sciwrappers.h instead where possible.
  * Do not use SSM in files unrelated to scintilla. */
 #define SSM(s, m, w, l) scintilla_send_message(s, m, w, l)
 
-
 static GHashTable *snippet_hash = NULL;
 static GQueue *snippet_offsets = NULL;
 static gint snippet_cursor_insert_pos;


Modified: src/editor.h
11 lines changed, 8 insertions(+), 3 deletions(-)
===================================================================
@@ -23,13 +23,18 @@
 #ifndef GEANY_EDITOR_H
 #define GEANY_EDITOR_H 1
 
+#include "tm_tag.h" /* for TMTag */
+
+#include "gtkcompat.h" /* Needed by ScintillaWidget.h */
+#include "Scintilla.h" /* Needed by ScintillaWidget.h */
+#include "ScintillaWidget.h" /* for ScintillaObject */
+
 #include <glib.h>
-#include "Scintilla.h"
-#include "ScintillaWidget.h"
+
 
 G_BEGIN_DECLS
 
-/* Forward-declared to avoid including document.h here */
+/* Forward-declared to avoid including document.h since it includes this header */
 struct GeanyDocument;
 
 /** Default character set to define which characters should be treated as part of a word. */


Modified: src/encodings.c
18 lines changed, 11 insertions(+), 7 deletions(-)
===================================================================
@@ -30,17 +30,21 @@
  */
  /* Stolen from anjuta */
 
-#include <string.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include "geany.h"
-#include "utils.h"
-#include "support.h"
-#include "document.h"
-#include "documentprivate.h"
-#include "msgwindow.h"
 #include "encodings.h"
+
+#include "app.h"
 #include "callbacks.h"
+#include "documentprivate.h"
+#include "support.h"
 #include "ui_utils.h"
+#include "utils.h"
+
+#include <string.h>
+
 
 /* <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> */
 #define PATTERN_HTMLMETA "<meta\\s+http-equiv\\s*=\\s*\"?content-type\"?\\s+content\\s*=\\s*\"text/x?html;\\s*charset=([a-z0-9_-]+)\"\\s*/?>"


Modified: src/encodings.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -36,7 +36,7 @@
 #ifndef GEANY_ENCODINGS_H
 #define GEANY_ENCODINGS_H 1
 
-#include <glib.h>
+#include "gtkcompat.h"
 
 G_BEGIN_DECLS
 


Modified: src/filetypes.c
27 lines changed, 16 insertions(+), 11 deletions(-)
===================================================================
@@ -27,26 +27,31 @@
 /* Note: we use filetype_id for some function arguments, but GeanyFiletype is better; we should
  * only use GeanyFiletype for API functions. */
 
-#include <string.h>
-#include <glib/gstdio.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include "geany.h"
 #include "filetypes.h"
+
+#include "app.h"
+#include "callbacks.h" /* FIXME: for ignore_callback */
+#include "document.h"
 #include "filetypesprivate.h"
+#include "geany.h"
+#include "geanyobject.h"
 #include "highlighting.h"
-#include "support.h"
-#include "templates.h"
-#include "document.h"
-#include "editor.h"
-#include "msgwindow.h"
-#include "utils.h"
+#include "projectprivate.h"
 #include "sciwrappers.h"
-#include "ui_utils.h"
+#include "support.h"
 #include "symbols.h"
-
 #include "tm_parser.h"
+#include "utils.h"
+#include "ui_utils.h"
 
 #include <stdlib.h>
+#include <string.h>
+
+#include <glib/gstdio.h>
 
 #define GEANY_FILETYPE_SEARCH_LINES 2 /* lines of file to search for filetype */
 


Modified: src/filetypes.h
12 lines changed, 9 insertions(+), 3 deletions(-)
===================================================================
@@ -23,13 +23,19 @@
 #ifndef GEANY_FILETYPES_H
 #define GEANY_FILETYPES_H 1
 
+#include "geany.h" /* for GEANY() macro */
+#include "tm_source_file.h" /* for langType */
+
+#include "gtkcompat.h" /* Needed by ScintillaWidget.h */
+#include "Scintilla.h" /* Needed by ScintillaWidget.h */
+#include "ScintillaWidget.h" /* for ScintillaObject */
+
 #include <glib.h>
-#include "Scintilla.h"
-#include "ScintillaWidget.h"
+
 
 G_BEGIN_DECLS
 
-/* Forward-declared to avoid including document.h here */
+/* Forward-declared to avoid including document.h since it includes this header */
 struct GeanyDocument;
 
 /* Do not change the order, only append. */


Modified: src/filetypesprivate.h
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -23,10 +23,10 @@
 #ifndef GEANY_FILETYPES_PRIVATE_H
 #define GEANY_FILETYPES_PRIVATE_H 1
 
-#include <glib.h>
-#include "filetypes.h"
 #include "build.h"
 
+#include "gtkcompat.h"
+
 G_BEGIN_DECLS
 
 /* Private GeanyFiletype fields */


Modified: src/gb.c
5 lines changed, 4 insertions(+), 1 deletions(-)
===================================================================
@@ -23,13 +23,16 @@
  * GTK-Bandit.
  */
 
+#include "utils.h"
+
+#include "gtkcompat.h"
+
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
 #include <signal.h>
 #include <unistd.h>
 #include <gdk-pixbuf/gdk-pixdata.h>
-#include "gtkcompat.h"
 
 #define MAX_PICS 10
 #define LOOP_DELAY 200000	/* micro seconds */


Modified: src/geany.h
50 lines changed, 12 insertions(+), 38 deletions(-)
===================================================================
@@ -25,22 +25,16 @@
 #ifndef GEANY_H
 #define GEANY_H 1
 
-#include <gtk/gtk.h>
+/* This is included here for compatibility with when GeanyApp used to be
+ * defined in this header. Some plugins (ex. GeanyLua) include individual
+ * headers instead of geanyplugin.h for some reason so they wouldn't
+ * get the GeanyApp definition if this isn't here. */
+#include "app.h"
 
-G_BEGIN_DECLS
-
-#if defined(HAVE_CONFIG_H) && defined(GEANY_PRIVATE)
-#	include "config.h"
-#endif
+#include <glib.h>
 
-#include "tm_tagmanager.h"
 
-#ifndef PLAT_GTK
-#   define PLAT_GTK 1	/* needed when including ScintillaWidget.h */
-#endif
-
-/* Compatibility for sharing macros between API and core, overridden in plugindata.h */
-#define GEANY(symbol_name) symbol_name
+G_BEGIN_DECLS
 
 
 /* for detailed description look in the documentation, things are not
@@ -58,31 +52,6 @@ G_BEGIN_DECLS
 #define GEANY_WINDOW_DEFAULT_HEIGHT		600
 
 
-/** Important application fields. */
-typedef struct GeanyApp
-{
-	gboolean			debug_mode;		/**< @c TRUE if debug messages should be printed. */
-	/** User configuration directory, usually @c ~/.config/geany.
-	 * This is a full path read by @ref tm_get_real_path().
-	 * @note Plugin configuration files should be saved as:
-	 * @code g_build_path(G_DIR_SEPARATOR_S, geany->app->configdir, "plugins", "pluginname",
-	 * 	"file.conf", NULL); @endcode */
-	gchar				*configdir;
-	gchar				*datadir;
-	gchar				*docdir;
-	const TMWorkspace	*tm_workspace;	/**< TagManager workspace/session tags. */
-	struct GeanyProject	*project;		/**< Currently active project or @c NULL if none is open. */
-}
-GeanyApp;
-
-extern GeanyApp *app;
-
-extern GObject *geany_object;
-
-
-extern gboolean	ignore_callback;
-
-
 /* prototype is here so that all files can use it. */
 void geany_debug(gchar const *format, ...) G_GNUC_PRINTF (1, 2);
 
@@ -91,6 +60,11 @@ void geany_debug(gchar const *format, ...) G_GNUC_PRINTF (1, 2);
 #define G_GNUC_WARN_UNUSED_RESULT
 #endif
 
+/* Re-defined by plugindata.h as something else */
+#ifndef GEANY
+# define GEANY(symbol_name) symbol_name
+#endif
+
 G_END_DECLS
 
 #endif /* GEANY_H */


Modified: src/geanyentryaction.c
9 lines changed, 6 insertions(+), 3 deletions(-)
===================================================================
@@ -23,11 +23,14 @@
  * This class is missing the action_create_menu_item() function and so can't be
  * used for creating menu items. */
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include "geany.h"
-#include "support.h"
-#include "ui_utils.h"
 #include "geanyentryaction.h"
+
+#include "ui_utils.h"
+
 #include <ctype.h>
 
 


Modified: src/geanyentryaction.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -23,7 +23,7 @@
 #ifndef GEANY_ENTRY_ACTION_H
 #define GEANY_ENTRY_ACTION_H 1
 
-#include <gtk/gtk.h>
+#include "gtkcompat.h"
 
 G_BEGIN_DECLS
 


Modified: src/geanymenubuttonaction.c
7 lines changed, 4 insertions(+), 3 deletions(-)
===================================================================
@@ -23,12 +23,13 @@
  * This class is missing the action_create_menu_item() function and so can't be
  * used for creating menu items. */
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include "geany.h"
-#include "support.h"
-#include "utils.h"
 #include "geanymenubuttonaction.h"
 
+#include "utils.h"
 
 typedef struct _GeanyMenubuttonActionPrivate		GeanyMenubuttonActionPrivate;
 


Modified: src/geanymenubuttonaction.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -23,7 +23,7 @@
 #ifndef GEANY_MENU_BUTTON_ACTION_H
 #define GEANY_MENU_BUTTON_ACTION_H 1
 
-#include <gtk/gtk.h>
+#include "gtkcompat.h"
 
 G_BEGIN_DECLS
 


Modified: src/geanyobject.c
5 lines changed, 4 insertions(+), 1 deletions(-)
===================================================================
@@ -32,7 +32,10 @@
  * Emitted just after loading main keyfile settings.
  */
 
-#include "geany.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include "geanyobject.h"
 
 /* extern in geany.h */


Modified: src/geanyobject.h
36 lines changed, 19 insertions(+), 17 deletions(-)
===================================================================
@@ -23,14 +23,16 @@
 #ifndef GEANY_OBJECT_H
 #define GEANY_OBJECT_H 1
 
-#include <glib-object.h>
+#include "document.h"
+#include "editor.h"
+#include "filetypes.h"
 
-G_BEGIN_DECLS
+#include "Scintilla.h"
+
+#include "gtkcompat.h"
 
-/* Forward-declared to avoid including their headers here */
-struct GeanyDocument;
-struct GeanyEditor;
-struct GeanyFiletype;
+
+G_BEGIN_DECLS
 
 typedef enum
 {
@@ -78,28 +80,28 @@ struct _GeanyObject
 	/* add your public declarations here */
 };
 
-struct SCNotification;
+extern GObject *geany_object;
 
 struct _GeanyObjectClass
 {
 	GObjectClass parent_class;
 
-	void (*document_new)(struct GeanyDocument *doc);
-	void (*document_open)(struct GeanyDocument *doc);
-	void (*document_reload)(struct GeanyDocument *doc);
-	void (*document_before_save)(struct GeanyDocument *doc);
-	void (*document_save)(struct GeanyDocument *doc);
-	void (*document_filetype_set)(struct GeanyDocument *doc, struct GeanyFiletype *filetype_old);
-	void (*document_activate)(struct GeanyDocument *doc);
-	void (*document_close)(struct GeanyDocument *doc);
+	void (*document_new)(GeanyDocument *doc);
+	void (*document_open)(GeanyDocument *doc);
+	void (*document_reload)(GeanyDocument *doc);
+	void (*document_before_save)(GeanyDocument *doc);
+	void (*document_save)(GeanyDocument *doc);
+	void (*document_filetype_set)(GeanyDocument *doc, GeanyFiletype *filetype_old);
+	void (*document_activate)(GeanyDocument *doc);
+	void (*document_close)(GeanyDocument *doc);
 	void (*project_open)(GKeyFile *keyfile);
 	void (*project_save)(GKeyFile *keyfile);
 	void (*project_close)(void);
 	void (*project_dialog_open)(GtkWidget *notebook);
 	void (*project_dialog_confirmed)(GtkWidget *notebook);
 	void (*project_dialog_close)(GtkWidget *notebook);
-	void (*update_editor_menu)(const gchar *word, gint click_pos, struct GeanyDocument *doc);
-	gboolean (*editor_notify)(struct GeanyEditor *editor, gpointer scnt);
+	void (*update_editor_menu)(const gchar *word, gint click_pos, GeanyDocument *doc);
+	gboolean (*editor_notify)(GeanyEditor *editor, gpointer scnt);
 	void (*geany_startup_complete)(void);
 	void (*build_start)(void);
 	void (*save_settings)(GKeyFile *keyfile);


Modified: src/geanywraplabel.c
5 lines changed, 3 insertions(+), 2 deletions(-)
===================================================================
@@ -24,9 +24,10 @@
  * (inspired by libview's WrapLabel, http://view.sourceforge.net)
  */
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include "geany.h"
-#include "utils.h"
 #include "geanywraplabel.h"
 
 


Modified: src/geanywraplabel.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -22,7 +22,7 @@
 #ifndef GEANY_WRAP_LABEL_H
 #define GEANY_WRAP_LABEL_H 1
 
-#include <gtk/gtk.h>
+#include "gtkcompat.h"
 
 G_BEGIN_DECLS
 


Modified: src/highlighting.c
37 lines changed, 19 insertions(+), 18 deletions(-)
===================================================================
@@ -25,30 +25,31 @@
  * Syntax highlighting for the different filetypes, using the Scintilla lexers.
  */
 
-#include "geany.h"
-
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <glib.h>
-#include <glib/gprintf.h>
-
-#include "SciLexer.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+ 
 #include "highlighting.h"
+#include "highlightingmappings.h"
+
+#include "app.h"
+#include "dialogs.h"
+#include "document.h"
 #include "editor.h"
-#include "utils.h"
-#include "filetypes.h"
+#include "filetypesprivate.h"
+#include "sciwrappers.h"
+#include "support.h"
 #include "symbols.h"
 #include "ui_utils.h"
 #include "utils.h"
-#include "main.h"
-#include "support.h"
-#include "sciwrappers.h"
-#include "document.h"
-#include "dialogs.h"
-#include "filetypesprivate.h"
 
-#include "highlightingmappings.h"
+#include "SciLexer.h"
+
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <glib.h>
+#include <glib/gprintf.h>
 
 
 #define GEANY_COLORSCHEMES_SUBDIR "colorschemes"


Modified: src/highlighting.h
14 lines changed, 8 insertions(+), 6 deletions(-)
===================================================================
@@ -23,15 +23,17 @@
 #ifndef GEANY_HIGHLIGHTING_H
 #define GEANY_HIGHLIGHTING_H 1
 
+#include "filetypes.h"
+
+#include "gtkcompat.h" /* Needed by ScintillaWidget.h */
+#include "Scintilla.h" /* Needed by ScintillaWidget.h */
+#include "ScintillaWidget.h" /* for ScintillaObject */
+
+
 #include <glib.h>
-#include "Scintilla.h"
-#include "ScintillaWidget.h"
 
 G_BEGIN_DECLS
 
-/* Forward-declared to avoid including filetypes.h here */
-struct GeanyFiletype;
-
 /** Fields representing the different attributes of a Scintilla lexer style.
  * @see Scintilla messages @c SCI_STYLEGETFORE, etc, for use with scintilla_send_message(). */
 typedef struct GeanyLexerStyle
@@ -46,7 +48,7 @@ GeanyLexerStyle;
 
 void highlighting_init_styles(guint filetype_idx, GKeyFile *config, GKeyFile *configh);
 
-void highlighting_set_styles(ScintillaObject *sci, struct GeanyFiletype *ft);
+void highlighting_set_styles(ScintillaObject *sci, GeanyFiletype *ft);
 
 const GeanyLexerStyle *highlighting_get_style(gint ft_id, gint style_id);
 


Modified: src/highlightingmappings.h
5 lines changed, 4 insertions(+), 1 deletions(-)
===================================================================
@@ -24,8 +24,11 @@
 #ifndef GEANY_HIGHLIGHTING_MAPPINGS_H
 #define GEANY_HIGHLIGHTING_MAPPINGS_H 1
 
-#include <glib.h>
 #include "Scintilla.h"
+#include "SciLexer.h"
+
+#include <glib.h>
+
 
 G_BEGIN_DECLS
 


Modified: src/keybindings.c
45 lines changed, 21 insertions(+), 24 deletions(-)
===================================================================
@@ -27,39 +27,36 @@
  * @see plugin_set_key_group().
  **/
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include "geany.h"
+#include "keybindings.h"
 
-#include <gdk/gdkkeysyms.h>
-#include <string.h>
-
-#include "keybindingsprivate.h"
-#include "support.h"
-#include "utils.h"
-#include "ui_utils.h"
-#include "document.h"
+#include "app.h"
+#include "build.h"
+#include "callbacks.h"
 #include "documentprivate.h"
 #include "filetypes.h"
-#include "callbacks.h"
-#include "prefs.h"
+#include "keybindingsprivate.h"
 #include "msgwindow.h"
-#include "editor.h"
-#include "sciwrappers.h"
-#include "build.h"
-#include "tools.h"
 #include "navqueue.h"
+#include "notebook.h"
+#include "prefs.h"
+#include "sciwrappers.h"
+#include "sidebar.h"
+#include "support.h"
 #include "symbols.h"
-#include "vte.h"
 #include "toolbar.h"
-#include "sidebar.h"
-#include "notebook.h"
-#include "geanywraplabel.h"
-#include "main.h"
-#include "search.h"
+#include "tools.h"
+#include "ui_utils.h"
+#include "utils.h"
+#include "vte.h"
+
 #include "gtkcompat.h"
-#ifdef HAVE_VTE
-# include "vte.h"
-#endif
+
+#include <gdk/gdkkeysyms.h>
+#include <string.h>
 
 
 GPtrArray *keybinding_groups;	/* array of GeanyKeyGroup pointers, in visual order */


Modified: src/keybindings.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -22,7 +22,7 @@
 #ifndef GEANY_KEYBINDINGS_H
 #define GEANY_KEYBINDINGS_H 1
 
-#include <gtk/gtk.h>
+#include "gtkcompat.h"
 
 G_BEGIN_DECLS
 


Modified: src/keybindingsprivate.h
3 lines changed, 2 insertions(+), 1 deletions(-)
===================================================================
@@ -23,9 +23,10 @@
 #ifndef GEANY_KEYBINDINGS_PRIVATE_H
 #define GEANY_KEYBINDINGS_PRIVATE_H 1
 
-#include <glib.h>
 #include "keybindings.h"
 
+#include <glib.h>
+
 G_BEGIN_DECLS
 
 struct GeanyKeyGroup


Modified: src/keyfile.c
47 lines changed, 25 insertions(+), 22 deletions(-)
===================================================================
@@ -28,38 +28,41 @@
  * filename_xx=pos;filetype UID;read only;Eencoding;use_tabs;auto_indent;line_wrapping;filename
  */
 
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "geany.h"
-
-#ifdef HAVE_VTE
-#include <pwd.h>
-#include <sys/types.h>
-#include <unistd.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
 #endif
 
-#include "support.h"
 #include "keyfile.h"
-#include "prefs.h"
-#include "ui_utils.h"
-#include "utils.h"
+
+#include "app.h"
+#include "build.h"
 #include "document.h"
-#include "filetypes.h"
-#include "sciwrappers.h"
 #include "encodings.h"
-#include "vte.h"
+#include "filetypes.h"
+#include "geanyobject.h"
 #include "main.h"
 #include "msgwindow.h"
-#include "search.h"
-#include "project.h"
-#include "editor.h"
+#include "prefs.h"
 #include "printing.h"
+#include "project.h"
+#include "sciwrappers.h"
+#include "stash.h"
+#include "support.h"
 #include "templates.h"
 #include "toolbar.h"
-#include "stash.h"
-#include "build.h"
+#include "ui_utils.h"
+#include "utils.h"
+#include "vte.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+#ifdef HAVE_VTE
+#include <pwd.h>
+#include <sys/types.h>
+#include <unistd.h>
+#endif
 
 
 /* some default settings which are used at the very first start of Geany to fill


Modified: src/log.c
13 lines changed, 9 insertions(+), 4 deletions(-)
===================================================================
@@ -23,17 +23,22 @@
  * Logging functions and the debug messages window.
  */
 
-#include "geany.h"
-
-#ifdef HAVE_LOCALE_H
-# include <locale.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
 #endif
 
 #include "log.h"
+
+#include "app.h"
 #include "support.h"
 #include "utils.h"
 #include "ui_utils.h"
 
+#include "gtkcompat.h"
+
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#endif
 
 static GString *log_buffer = NULL;
 static GtkTextBuffer *dialog_textbuffer = NULL;


Modified: src/main.c
76 lines changed, 35 insertions(+), 41 deletions(-)
===================================================================
@@ -25,63 +25,57 @@
  * Handles program initialization and cleanup.
  */
 
-#include <signal.h>
-#include <time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "geany.h"
-#include <glib/gstdio.h>
-
-#ifdef HAVE_LOCALE_H
-# include <locale.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
 #endif
 
 #include "main.h"
-#include "prefix.h"
-#include "prefs.h"
-#include "support.h"
+
+#include "app.h"
+#include "build.h"
 #include "callbacks.h"
-#include "log.h"
-#include "ui_utils.h"
-#include "utils.h"
+#include "dialogs.h"
 #include "document.h"
+#include "encodings.h"
 #include "filetypes.h"
+#include "geanyobject.h"
+#include "highlighting.h"
+#include "keybindings.h"
 #include "keyfile.h"
-#include "win32.h"
+#include "log.h"
 #include "msgwindow.h"
-#include "dialogs.h"
-#include "templates.h"
-#include "encodings.h"
-#include "sidebar.h"
-#include "notebook.h"
-#include "keybindings.h"
-#include "editor.h"
-#include "search.h"
-#include "build.h"
-#include "highlighting.h"
-#include "symbols.h"
-#include "project.h"
-#include "tools.h"
 #include "navqueue.h"
+#include "notebook.h"
 #include "plugins.h"
+#include "prefs.h"
 #include "printing.h"
-#include "toolbar.h"
-#include "geanyobject.h"
-
+#include "sidebar.h"
 #ifdef HAVE_SOCKET
 # include "socket.h"
 #endif
+#include "support.h"
+#include "symbols.h"
+#include "templates.h"
+#include "toolbar.h"
+#include "tools.h"
+#include "ui_utils.h"
+#include "utils.h"
+#include "vte.h"
 
-#ifdef HAVE_VTE
-# include "vte.h"
-#endif
+#include "gtkcompat.h"
 
-#ifndef N_
-# define N_(String) (String)
+#include <signal.h>
+#include <time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <glib/gstdio.h>
+
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
 #endif
 
 


Modified: src/msgwindow.c
24 lines changed, 13 insertions(+), 11 deletions(-)
===================================================================
@@ -27,22 +27,24 @@
  * @see GeanyMainWidgets::message_window_notebook to append a new notebook page.
  **/
 
-#include "geany.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include "support.h"
-#include "prefs.h"
-#include "callbacks.h"
-#include "ui_utils.h"
-#include "utils.h"
+#include "msgwindow.h"
+
+#include "build.h"
 #include "document.h"
+#include "callbacks.h"
 #include "filetypes.h"
-#include "build.h"
+#include "keybindings.h"
 #include "main.h"
-#include "vte.h"
 #include "navqueue.h"
-#include "editor.h"
-#include "msgwindow.h"
-#include "keybindings.h"
+#include "prefs.h"
+#include "support.h"
+#include "ui_utils.h"
+#include "utils.h"
+#include "vte.h"
 
 #include <string.h>
 #include <stdlib.h>


Modified: src/msgwindow.h
5 lines changed, 4 insertions(+), 1 deletions(-)
===================================================================
@@ -22,7 +22,10 @@
 #ifndef GEANY_MSGWINDOW_H
 #define GEANY_MSGWINDOW_H 1
 
-#include <gtk/gtk.h>
+#include "document.h"
+
+#include "gtkcompat.h"
+
 
 G_BEGIN_DECLS
 


Modified: src/navqueue.c
17 lines changed, 10 insertions(+), 7 deletions(-)
===================================================================
@@ -24,16 +24,19 @@
  * Simple code navigation
  */
 
-#include "geany.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include "sciwrappers.h"
-#include "document.h"
-#include "utils.h"
-#include "support.h"
-#include "ui_utils.h"
-#include "editor.h"
 #include "navqueue.h"
+
+#include "document.h"
+#include "geanyobject.h"
+#include "sciwrappers.h"
 #include "toolbar.h"
+#include "utils.h"
+
+#include "gtkcompat.h"
 
 
 /* for the navigation history queue */


Modified: src/navqueue.h
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -29,6 +29,8 @@
 #ifndef GEANY_NAVQUEUE_H
 #define GEANY_NAVQUEUE_H 1
 
+#include "document.h"
+
 #include <glib.h>
 
 G_BEGIN_DECLS


Modified: src/notebook.c
23 lines changed, 13 insertions(+), 10 deletions(-)
===================================================================
@@ -23,23 +23,26 @@
  * Notebook tab Drag 'n' Drop reordering and tab management.
  */
 
-#include "geany.h"
-
-#include <gdk/gdkkeysyms.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include "notebook.h"
-#include "document.h"
-#include "editor.h"
-#include "documentprivate.h"
-#include "ui_utils.h"
-#include "sidebar.h"
-#include "support.h"
+
 #include "callbacks.h"
-#include "utils.h"
+#include "documentprivate.h"
+#include "geanyobject.h"
 #include "keybindings.h"
 #include "main.h"
+#include "support.h"
+#include "ui_utils.h"
+#include "utils.h"
+
 #include "gtkcompat.h"
 
+#include <gdk/gdkkeysyms.h>
+
+
 #define GEANY_DND_NOTEBOOK_TAB_TYPE	"geany_dnd_notebook_tab"
 
 static const GtkTargetEntry drag_targets[] =


Modified: src/notebook.h
7 lines changed, 3 insertions(+), 4 deletions(-)
===================================================================
@@ -22,19 +22,18 @@
 #ifndef GEANY_NOTEBOOK_H
 #define GEANY_NOTEBOOK_H 1
 
+#include "document.h"
+
 #include <glib.h>
 
 G_BEGIN_DECLS
 
-/* Forward-declared to avoid including document.h here */
-struct GeanyDocument;
-
 void notebook_init(void);
 
 void notebook_free(void);
 
 /* Returns page number of notebook page, or -1 on error */
-gint notebook_new_tab(struct GeanyDocument *doc);
+gint notebook_new_tab(GeanyDocument *doc);
 
 /* Always use this instead of gtk_notebook_remove_page(). */
 void notebook_remove_page(gint page_num);


Modified: src/plugindata.h
3 lines changed, 1 insertions(+), 2 deletions(-)
===================================================================
@@ -32,11 +32,11 @@
 #ifndef GEANY_PLUGIN_DATA_H
 #define GEANY_PLUGIN_DATA_H 1
 
-#include <glib.h>
 #include "build.h"  /* GeanyBuildGroup, GeanyBuildSource, GeanyBuildCmdEntries enums */
 #include "document.h" /* GeanyDocument */
 #include "editor.h"	/* GeanyEditor, GeanyIndentType */
 #include "filetypes.h" /* GeanyFiletype */
+
 #include "gtkcompat.h"
 
 G_BEGIN_DECLS
@@ -295,7 +295,6 @@ GeanyFunctions;
 /* For more information about these functions, see the main source code.
  * E.g. for p_document->new_file(), see document_new_file() in document.c. */
 
-
 /* See document.h */
 typedef struct DocumentFuncs
 {


Modified: src/pluginprivate.h
4 lines changed, 3 insertions(+), 1 deletions(-)
===================================================================
@@ -23,11 +23,13 @@
 #ifndef GEANY_PLUGIN_PRIVATE_H
 #define GEANY_PLUGIN_PRIVATE_H 1
 
-#include <gtk/gtk.h>
 #include "plugindata.h"
 #include "ui_utils.h"	/* GeanyAutoSeparator */
 #include "keybindings.h"	/* GeanyKeyGroup */
 
+#include "gtkcompat.h"
+
+
 G_BEGIN_DECLS
 
 typedef struct SignalConnection


Modified: src/plugins.c
51 lines changed, 24 insertions(+), 27 deletions(-)
===================================================================
@@ -21,44 +21,41 @@
 
 /* Code to manage, load and unload plugins. */
 
-#include "geany.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #ifdef HAVE_PLUGINS
 
-#include <string.h>
-
-#include "Scintilla.h"
-#include "ScintillaWidget.h"
-
-#include "prefix.h"
 #include "plugins.h"
-#include "plugindata.h"
-#include "support.h"
-#include "utils.h"
-#include "document.h"
-#include "filetypes.h"
-#include "templates.h"
-#include "sciwrappers.h"
-#include "ui_utils.h"
-#include "editor.h"
+
+#include "app.h"
 #include "dialogs.h"
-#include "msgwindow.h"
-#include "prefs.h"
-#include "geanywraplabel.h"
-/* #include "build.h" included in plugindata.h so it can use enums */
 #include "encodings.h"
-#include "search.h"
+#include "geanyobject.h"
+#include "geanywraplabel.h"
 #include "highlighting.h"
 #include "keybindingsprivate.h"
-#include "navqueue.h"
+#include "keyfile.h"
 #include "main.h"
-#include "toolbar.h"
+#include "msgwindow.h"
+#include "navqueue.h"
+#include "plugindata.h"
+#include "pluginprivate.h"
+#include "pluginutils.h"
+#include "prefs.h"
+#include "sciwrappers.h"
 #include "stash.h"
+#include "support.h"
 #include "symbols.h"
-#include "keyfile.h"
-#include "win32.h"
-#include "pluginutils.h"
-#include "pluginprivate.h"
+#include "templates.h"
+#include "toolbar.h"
+#include "ui_utils.h"
+#include "utils.h"
+
+#include "gtkcompat.h"
+
+#include <string.h>
 
 
 GList *active_plugin_list = NULL; /* list of only actually loaded plugins, always valid */


Modified: src/pluginutils.c
15 lines changed, 10 insertions(+), 5 deletions(-)
===================================================================
@@ -23,18 +23,23 @@
  * Plugin utility functions.
  * These functions all take the @ref geany_plugin symbol as their first argument. */
 
-#include "geany.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #ifdef HAVE_PLUGINS
 
 #include "pluginutils.h"
-#include "pluginprivate.h"
 
-#include "ui_utils.h"
+#include "app.h"
+#include "geanyobject.h"
+#include "plugindata.h"
+#include "pluginprivate.h"
+#include "plugins.h"
+#include "support.h"
 #include "toolbar.h"
+#include "ui_utils.h"
 #include "utils.h"
-#include "support.h"
-#include "plugins.h"
 
 
 /** Inserts a toolbar item before the Quit button, or after the previous plugin toolbar item.


Modified: src/pluginutils.h
3 lines changed, 2 insertions(+), 1 deletions(-)
===================================================================
@@ -25,9 +25,10 @@
 
 #ifdef HAVE_PLUGINS
 
-#include <gtk/gtk.h>
 #include "keybindings.h"	/* GeanyKeyGroupCallback */
 
+#include "gtkcompat.h"
+
 G_BEGIN_DECLS
 
 /* avoid including plugindata.h otherwise this redefines the GEANY() macro */


Modified: src/prefix.c
2 lines changed, 0 insertions(+), 2 deletions(-)
===================================================================
@@ -11,12 +11,10 @@
  * to br_*", try renaming prefix.c to prefix.cpp
  */
 
-
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
 
-
 /*
  * enrico - all the code below is only compiled and used if ENABLE_BINRELOC is set in config.h,
  *          this only happens if configure option --enable-binreloc was used


Modified: src/prefs.c
49 lines changed, 23 insertions(+), 26 deletions(-)
===================================================================
@@ -29,42 +29,39 @@
  * New 'simple' prefs should use Stash code in keyfile.c - init_pref_groups().
  */
 
-#include <stdlib.h>
-#include <string.h>
-#include <gdk/gdkkeysyms.h>
-
-#include "geany.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include "prefs.h"
-#include "support.h"
+
+#include "app.h"
 #include "dialogs.h"
-#include "ui_utils.h"
-#include "utils.h"
-#include "sciwrappers.h"
-#include "document.h"
 #include "documentprivate.h"
-#include "msgwindow.h"
-#include "keyfile.h"
-#include "keybindingsprivate.h"
-#include "encodings.h"
-#include "project.h"
 #include "editor.h"
-#include "main.h"
-#include "sidebar.h"
-#include "printing.h"
+#include "encodings.h"
+#include "filetypes.h"
 #include "geanywraplabel.h"
+#include "keybindingsprivate.h"
+#include "keyfile.h"
+#include "msgwindow.h"
+#include "prefs.h"
+#include "printing.h"
+#include "sidebar.h"
+#include "stash.h"
+#include "support.h"
 #include "templates.h"
-#include "search.h"
 #include "toolbar.h"
 #include "tools.h"
-#include "stash.h"
-#include "keyfile.h"
-#include "filetypes.h"
-#include "win32.h"
+#include "ui_utils.h"
+#include "utils.h"
+#include "vte.h"
 
-#ifdef HAVE_VTE
-# include "vte.h"
-#endif
+#include "gtkcompat.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <gdk/gdkkeysyms.h>
 
 
 GeanyPrefs prefs;


Modified: src/printing.c
24 lines changed, 14 insertions(+), 10 deletions(-)
===================================================================
@@ -26,22 +26,26 @@
  * (basic code layout were adopted from Sylpheed's printing implementation, thanks)
  */
 
-#include <math.h>
-#include <time.h>
-#include <string.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include "geany.h"
 #include "printing.h"
+
+#include "app.h"
+#include "dialogs.h"
 #include "document.h"
+#include "geany.h"
+#include "highlighting.h"
+#include "msgwindow.h"
 #include "sciwrappers.h"
-#include "editor.h"
-#include "utils.h"
 #include "support.h"
-#include "dialogs.h"
+#include "utils.h"
 #include "ui_utils.h"
-#include "msgwindow.h"
-#include "highlighting.h"
-#include "Scintilla.h"
+
+#include <math.h>
+#include <time.h>
+#include <string.h>
 
 
 PrintingPrefs printing_prefs;


Modified: src/printing.h
7 lines changed, 3 insertions(+), 4 deletions(-)
===================================================================
@@ -23,13 +23,12 @@
 #ifndef GEANY_PRINTING_H
 #define GEANY_PRINTING_H 1
 
+#include "document.h"
+
 #include <glib.h>
 
 G_BEGIN_DECLS
 
-/* Forward-declared to avoid including document.h here */
-struct GeanyDocument;
-
 /* General printing preferences. */
 typedef struct PrintingPrefs
 {
@@ -47,7 +46,7 @@ extern PrintingPrefs printing_prefs;
 
 void printing_page_setup_gtk(void);
 
-void printing_print_doc(struct GeanyDocument *doc);
+void printing_print_doc(GeanyDocument *doc);
 
 G_END_DECLS
 


Modified: src/project.c
34 lines changed, 18 insertions(+), 16 deletions(-)
===================================================================
@@ -23,29 +23,31 @@
  * Project Management.
  */
 
-#include "geany.h"
-
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include "project.h"
-#include "projectprivate.h"
 
+#include "app.h"
+#include "build.h"
 #include "dialogs.h"
-#include "support.h"
-#include "utils.h"
-#include "ui_utils.h"
 #include "document.h"
-#include "msgwindow.h"
-#include "main.h"
-#include "keyfile.h"
-#include "win32.h"
-#include "build.h"
 #include "editor.h"
-#include "stash.h"
-#include "sidebar.h"
 #include "filetypesprivate.h"
+#include "geanyobject.h"
+#include "keyfile.h"
+#include "main.h"
+#include "projectprivate.h"
+#include "sidebar.h"
+#include "stash.h"
+#include "support.h"
+#include "ui_utils.h"
+#include "utils.h"
+
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
 
 
 ProjectPrefs project_prefs = { NULL, FALSE, FALSE };


Modified: src/projectprivate.h
3 lines changed, 2 insertions(+), 1 deletions(-)
===================================================================
@@ -23,9 +23,10 @@
 #ifndef GEANY_PROJECTPRIVATE_H
 #define GEANY_PROJECTPRIVATE_H 1
 
-#include <glib.h>
 #include "project.h"
 
+#include <glib.h>
+
 G_BEGIN_DECLS
 
 typedef struct GeanyProjectPrivate


Modified: src/sciwrappers.c
11 lines changed, 7 insertions(+), 4 deletions(-)
===================================================================
@@ -31,15 +31,18 @@
  * @see scintilla_send_message().
  */
 
-#include <string.h>
-
-#include "geany.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include "sciwrappers.h"
+
 #include "utils.h"
 
-#define SSM(s, m, w, l) scintilla_send_message(s, m, w, l)
+#include <string.h>
+
 
+#define SSM(s, m, w, l) scintilla_send_message(s, m, w, l)
 
 /* line numbers visibility */
 void sci_set_line_numbers(ScintillaObject *sci, gboolean set, gint extra_width)


Modified: src/sciwrappers.h
7 lines changed, 4 insertions(+), 3 deletions(-)
===================================================================
@@ -22,9 +22,10 @@
 #ifndef GEANY_SCI_WRAPPERS_H
 #define GEANY_SCI_WRAPPERS_H 1
 
-#include <gtk/gtk.h>
-#include "Scintilla.h"
-#include "ScintillaWidget.h"
+#include "gtkcompat.h" /* Needed by ScintillaWidget.h */
+#include "Scintilla.h" /* Needed by ScintillaWidget.h */
+#include "ScintillaWidget.h" /* for ScintillaObject */
+
 
 G_BEGIN_DECLS
 


Modified: src/search.c
23 lines changed, 13 insertions(+), 10 deletions(-)
===================================================================
@@ -24,23 +24,25 @@
  * Note that the basic text find functions are in document.c.
  */
 
-#include <gdk/gdkkeysyms.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include "geany.h"
 #include "search.h"
-#include "prefs.h"
-#include "support.h"
-#include "utils.h"
+
+#include "app.h"
 #include "document.h"
-#include "msgwindow.h"
-#include "sciwrappers.h"
-#include "ui_utils.h"
-#include "editor.h"
 #include "encodings.h"
-#include "project.h"
 #include "keyfile.h"
+#include "msgwindow.h"
+#include "prefs.h"
+#include "sciwrappers.h"
 #include "stash.h"
+#include "support.h"
 #include "toolbar.h"
+#include "ui_utils.h"
+#include "utils.h"
+
 #include "gtkcompat.h"
 
 #include <unistd.h>
@@ -52,6 +54,7 @@
 # include <sys/wait.h>
 #endif
 
+#include <gdk/gdkkeysyms.h>
 
 enum
 {


Modified: src/search.h
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -30,10 +30,10 @@
 
 #include <glib.h>
 
+
 G_BEGIN_DECLS
 
-/* Forward-declared to avoid including their headers here */
-struct GeanyDocument;
+struct GeanyDocument; /* document.h includes this header */
 struct _ScintillaObject;
 struct Sci_TextToFind;
 


Modified: src/sidebar.c
29 lines changed, 15 insertions(+), 14 deletions(-)
===================================================================
@@ -23,25 +23,26 @@
  * Sidebar related code for the Symbol list and Open files GtkTreeViews.
  */
 
-#include <string.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include "geany.h"
-#include "support.h"
-#include "callbacks.h"
 #include "sidebar.h"
-#include "document.h"
-#include "editor.h"
+
+#include "app.h"
+#include "callbacks.h" /* FIXME: for ignore_callback */
 #include "documentprivate.h"
-#include "filetypes.h"
-#include "utils.h"
-#include "ui_utils.h"
-#include "symbols.h"
+#include "filetypesprivate.h"
+#include "geanyobject.h"
+#include "keyfile.h"
 #include "navqueue.h"
-#include "project.h"
 #include "stash.h"
-#include "keyfile.h"
-#include "sciwrappers.h"
-#include "search.h"
+#include "support.h"
+#include "symbols.h"
+#include "ui_utils.h"
+#include "utils.h"
+
+#include <string.h>
 
 #include <gdk/gdkkeysyms.h>
 


Modified: src/sidebar.h
17 lines changed, 8 insertions(+), 9 deletions(-)
===================================================================
@@ -24,12 +24,11 @@
 #ifndef GEANY_SIDEBAR_H
 #define GEANY_SIDEBAR_H 1
 
-#include <gtk/gtk.h>
+#include "document.h"
 
-G_BEGIN_DECLS
+#include "gtkcompat.h"
 
-/* Forward-declared to avoid including document.h here */
-struct GeanyDocument;
+G_BEGIN_DECLS
 
 typedef struct SidebarTreeviews
 {
@@ -54,17 +53,17 @@ void sidebar_init(void);
 
 void sidebar_finalize(void);
 
-void sidebar_update_tag_list(struct GeanyDocument *doc, gboolean update);
+void sidebar_update_tag_list(GeanyDocument *doc, gboolean update);
 
-void sidebar_openfiles_add(struct GeanyDocument *doc);
+void sidebar_openfiles_add(GeanyDocument *doc);
 
-void sidebar_openfiles_update(struct GeanyDocument *doc);
+void sidebar_openfiles_update(GeanyDocument *doc);
 
 void sidebar_openfiles_update_all(void);
 
-void sidebar_select_openfiles_item(struct GeanyDocument *doc);
+void sidebar_select_openfiles_item(GeanyDocument *doc);
 
-void sidebar_remove_document(struct GeanyDocument *doc);
+void sidebar_remove_document(GeanyDocument *doc);
 
 void sidebar_add_common_menu_items(GtkMenu *menu);
 


Modified: src/socket.c
28 lines changed, 16 insertions(+), 12 deletions(-)
===================================================================
@@ -51,11 +51,25 @@
  *
  */
 
-
-#include "geany.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #ifdef HAVE_SOCKET
 
+#include "socket.h"
+
+#include "app.h"
+#include "dialogs.h"
+#include "document.h"
+#include "encodings.h"
+#include "main.h"
+#include "support.h"
+#include "utils.h"
+
+#include "gtkcompat.h"
+
+
 #ifndef G_OS_WIN32
 # include <sys/time.h>
 # include <sys/types.h>
@@ -78,16 +92,6 @@
 #include <gdk/gdkx.h>
 #endif
 
-#include "main.h"
-#include "socket.h"
-#include "document.h"
-#include "support.h"
-#include "ui_utils.h"
-#include "utils.h"
-#include "dialogs.h"
-#include "encodings.h"
-#include "project.h"
-
 
 #ifdef G_OS_WIN32
 #define REMOTE_CMD_PORT		49876


Modified: src/stash.c
9 lines changed, 4 insertions(+), 5 deletions(-)
===================================================================
@@ -76,13 +76,12 @@
  * should be efficient enough.
  */
 
+#include "stash.h"
 
-#include "geany.h"		/* necessary for utils.h, otherwise use gtk/gtk.h */
-#include <stdlib.h>		/* only for atoi() */
-#include "support.h"	/* only for _("text") */
-#include "utils.h"		/* only for foreach_*, utils_get_setting_*(). Stash should not depend on Geany. */
+#include "support.h" /* only for _("text") */
+#include "utils.h"   /* only for foreach_*, utils_get_setting_*(). Stash should not depend on Geany. */
 
-#include "stash.h"
+#include <stdlib.h> /* only for atoi() */
 
 
 /* GTK3 removed ComboBoxEntry, but we need a value to differentiate combo box with and


Modified: src/stash.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -22,7 +22,7 @@
 #ifndef GEANY_STASH_H
 #define GEANY_STASH_H 1
 
-#include <gtk/gtk.h>
+#include "gtkcompat.h"
 
 G_BEGIN_DECLS
 


Modified: src/symbols.c
41 lines changed, 23 insertions(+), 18 deletions(-)
===================================================================
@@ -32,30 +32,35 @@
  * matching filetype is first loaded.
  */
 
-#include "SciLexer.h"
-#include "geany.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include <ctype.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "prefix.h"
 #include "symbols.h"
-#include "utils.h"
-#include "filetypes.h"
-#include "encodings.h"
-#include "document.h"
+
+#include "app.h"
+#include "callbacks.h" /* FIXME: for ignore_callback */
 #include "documentprivate.h"
-#include "support.h"
-#include "msgwindow.h"
-#include "sidebar.h"
+#include "editor.h"
+#include "encodings.h"
+#include "filetypesprivate.h"
+#include "geanyobject.h"
 #include "main.h"
 #include "navqueue.h"
-#include "ui_utils.h"
-#include "editor.h"
 #include "sciwrappers.h"
-#include "filetypesprivate.h"
-#include "search.h"
+#include "sidebar.h"
+#include "support.h"
+#include "tm_tag.h"
+#include "ui_utils.h"
+#include "utils.h"
+
+#include "SciLexer.h"
+
+#include "gtkcompat.h"
+
+#include <ctype.h>
+#include <string.h>
+#include <stdlib.h>
 
 
 const guint TM_GLOBAL_TYPE_MASK =


Modified: src/symbols.h
13 lines changed, 6 insertions(+), 7 deletions(-)
===================================================================
@@ -23,13 +23,12 @@
 #ifndef GEANY_SYMBOLS_H
 #define GEANY_SYMBOLS_H 1
 
+#include "document.h"
+
 #include <glib.h>
 
 G_BEGIN_DECLS
 
-/* Forward-declared to avoid including document.h here */
-struct GeanyDocument;
-
 extern const guint TM_GLOBAL_TYPE_MASK;
 
 enum
@@ -52,13 +51,13 @@ GString *symbols_find_tags_as_string(GPtrArray *tags_array, guint tag_types, gin
 
 const gchar *symbols_get_context_separator(gint ft_id);
 
-const GList *symbols_get_tag_list(struct GeanyDocument *doc, guint tag_types);
+const GList *symbols_get_tag_list(GeanyDocument *doc, guint tag_types);
 
 GString *symbols_get_macro_list(gint lang);
 
 const gchar **symbols_get_html_entities(void);
 
-gboolean symbols_recreate_tag_list(struct GeanyDocument *doc, gint sort_mode);
+gboolean symbols_recreate_tag_list(GeanyDocument *doc, gint sort_mode);
 
 gint symbols_generate_global_tags(gint argc, gchar **argv, gboolean want_preprocess);
 
@@ -66,9 +65,9 @@ void symbols_show_load_tags_dialog(void);
 
 gboolean symbols_goto_tag(const gchar *name, gboolean definition);
 
-gint symbols_get_current_function(struct GeanyDocument *doc, const gchar **tagname);
+gint symbols_get_current_function(GeanyDocument *doc, const gchar **tagname);
 
-gint symbols_get_current_scope(struct GeanyDocument *doc, const gchar **tagname);
+gint symbols_get_current_scope(GeanyDocument *doc, const gchar **tagname);
 
 G_END_DECLS
 


Modified: src/templates.c
26 lines changed, 16 insertions(+), 10 deletions(-)
===================================================================
@@ -24,22 +24,28 @@
  * document from.
  */
 
-#include <time.h>
-#include <string.h>
-
-#include "geany.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include "templates.h"
-#include "support.h"
-#include "utils.h"
+
+#include "app.h"
 #include "document.h"
 #include "encodings.h"
-#include "editor.h"
 #include "filetypes.h"
-#include "ui_utils.h"
-#include "toolbar.h"
+#include "geany.h"
 #include "geanymenubuttonaction.h"
-#include "project.h"
+#include "geanyobject.h"
+#include "support.h"
+#include "toolbar.h"
+#include "ui_utils.h"
+#include "utils.h"
+
+#include "gtkcompat.h"
+
+#include <time.h>
+#include <string.h>
 
 
 GeanyTemplatePrefs template_prefs;


Modified: src/templates.h
17 lines changed, 8 insertions(+), 9 deletions(-)
===================================================================
@@ -28,13 +28,14 @@
 #ifndef GEANY_TEMPLATES_H
 #define GEANY_TEMPLATES_H 1
 
+#include "document.h"
+#include "filetypes.h"
+
 #include <glib.h>
 
 G_BEGIN_DECLS
 
-/* Forward-declared to avoid including their headers here */
-struct GeanyDocument;
-struct GeanyFiletype;
+struct filetype;
 
 #define GEANY_TEMPLATES_INDENT 3
 #define GEANY_TEMPLATES_FORMAT_YEAR              C_("DefaultYear", "%Y")
@@ -69,20 +70,18 @@ GeanyTemplatePrefs;
 extern GeanyTemplatePrefs template_prefs;
 
 
-struct filetype;
-
 void templates_init(void);
 
 gchar *templates_get_template_fileheader(gint filetype_idx, const gchar *fname);
 
-gchar *templates_get_template_changelog(struct GeanyDocument *doc);
+gchar *templates_get_template_changelog(GeanyDocument *doc);
 
-gchar *templates_get_template_function(struct GeanyDocument *doc, const gchar *func_name);
+gchar *templates_get_template_function(GeanyDocument *doc, const gchar *func_name);
 
-gchar *templates_get_template_licence(struct GeanyDocument *doc, gint licence_type);
+gchar *templates_get_template_licence(GeanyDocument *doc, gint licence_type);
 
 void templates_replace_common(GString *tmpl, const gchar *fname,
-	struct GeanyFiletype *ft, const gchar *func_name);
+	GeanyFiletype *ft, const gchar *func_name);
 
 void templates_replace_valist(GString *text,
 	const gchar *first_wildcard, ...) G_GNUC_NULL_TERMINATED;


Modified: src/toolbar.c
20 lines changed, 12 insertions(+), 8 deletions(-)
===================================================================
@@ -25,18 +25,22 @@
  */
 /* Utility functions to create the toolbar */
 
-#include "geany.h"
-#include "support.h"
-#include "ui_utils.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include "toolbar.h"
+
+#include "app.h"
+#include "build.h"
 #include "callbacks.h"
-#include "utils.h"
-#include "dialogs.h"
 #include "document.h"
-#include "build.h"
-#include "main.h"
-#include "geanymenubuttonaction.h"
 #include "geanyentryaction.h"
+#include "geanymenubuttonaction.h"
+#include "main.h"
+#include "support.h"
+#include "ui_utils.h"
+#include "utils.h"
 
 #include <string.h>
 #include <glib/gstdio.h>


Modified: src/toolbar.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -22,7 +22,7 @@
 #ifndef GEANY_TOOLBAR_H
 #define GEANY_TOOLBAR_H 1
 
-#include <gtk/gtk.h>
+#include "gtkcompat.h"
 
 G_BEGIN_DECLS
 


Modified: src/tools.c
28 lines changed, 14 insertions(+), 14 deletions(-)
===================================================================
@@ -24,7 +24,20 @@
  * For Plugins code see plugins.c.
  */
 
-#include "geany.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "tools.h"
+
+#include "document.h"
+#include "keybindings.h"
+#include "sciwrappers.h"
+#include "support.h"
+#include "ui_utils.h"
+#include "utils.h"
+
+#include "gtkcompat.h"
 
 #include <stdlib.h>
 #include <unistd.h>
@@ -37,19 +50,6 @@
 # include <signal.h>
 #endif
 
-#include "tools.h"
-#include "support.h"
-#include "document.h"
-#include "editor.h"
-#include "sciwrappers.h"
-#include "utils.h"
-#include "ui_utils.h"
-#include "msgwindow.h"
-#include "keybindings.h"
-#include "templates.h"
-#include "win32.h"
-#include "dialogs.h"
-
 
 enum
 {


Modified: src/tools.h
7 lines changed, 3 insertions(+), 4 deletions(-)
===================================================================
@@ -23,16 +23,15 @@
 #ifndef GEANY_TOOLS_H
 #define GEANY_TOOLS_H 1
 
+#include "document.h"
+
 #include <glib.h>
 
 G_BEGIN_DECLS
 
-/* Forward-declared to avoid including document.h here */
-struct GeanyDocument;
-
 void tools_create_insert_custom_command_menu_items(void);
 
-void tools_execute_custom_command(struct GeanyDocument *doc, const gchar *command);
+void tools_execute_custom_command(GeanyDocument *doc, const gchar *command);
 
 void tools_word_count(void);
 


Modified: src/ui_utils.c
43 lines changed, 21 insertions(+), 22 deletions(-)
===================================================================
@@ -24,39 +24,38 @@
  * User Interface general utility functions.
  */
 
-#include "geany.h"
-
-#include "support.h"
-
-#include <string.h>
-#include <ctype.h>
-#include <gdk/gdkkeysyms.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include "ui_utils.h"
+
+#include "app.h"
+#include "callbacks.h"
 #include "dialogs.h"
-#include "prefs.h"
-#include "sciwrappers.h"
-#include "document.h"
 #include "documentprivate.h"
+#include "encodings.h"
 #include "filetypes.h"
-#include "support.h"
+#include "geanymenubuttonaction.h"
+#include "keyfile.h"
+#include "main.h"
 #include "msgwindow.h"
-#include "utils.h"
-#include "callbacks.h"
-#include "encodings.h"
-#include "sidebar.h"
-#include "win32.h"
+#include "prefs.h"
 #include "project.h"
-#include "editor.h"
-#include "plugins.h"
+#include "sciwrappers.h"
+#include "sidebar.h"
+#include "stash.h"
+#include "support.h"
 #include "symbols.h"
 #include "toolbar.h"
-#include "geanymenubuttonaction.h"
-#include "main.h"
-#include "stash.h"
-#include "keyfile.h"
+#include "utils.h"
+
 #include "gtkcompat.h"
 
+#include <string.h>
+#include <ctype.h>
+#include <gdk/gdkkeysyms.h>
+
 
 #define DEFAULT_STATUSBAR_TEMPLATE N_(\
 	"line: %l / %L\t "   \


Modified: src/ui_utils.h
27 lines changed, 13 insertions(+), 14 deletions(-)
===================================================================
@@ -22,14 +22,13 @@
 #ifndef GEANY_UI_UTILS_H
 #define GEANY_UI_UTILS_H 1
 
+#include "document.h"
+
 #include <stdarg.h>
 #include "gtkcompat.h"
 
 G_BEGIN_DECLS
 
-/* Forward-declared to avoid including document.h here */
-struct GeanyDocument;
-
 /** Sets a name to lookup @a widget from @a owner.
  * @param owner Usually a window, dialog or popup menu.
  * @param widget Widget.
@@ -255,34 +254,34 @@ void ui_init_stock_items(void);
 void ui_add_config_file_menu_item(const gchar *real_path, const gchar *label,
 		GtkContainer *parent);
 
-void ui_menu_add_document_items(GtkMenu *menu, struct GeanyDocument *active, GCallback callback);
+void ui_menu_add_document_items(GtkMenu *menu, GeanyDocument *active, GCallback callback);
 
-void ui_menu_add_document_items_sorted(GtkMenu *menu, struct GeanyDocument *active,
+void ui_menu_add_document_items_sorted(GtkMenu *menu, GeanyDocument *active,
 		GCallback callback, GCompareFunc sort_func);
 
 void ui_set_statusbar(gboolean log, const gchar *format, ...) G_GNUC_PRINTF (2, 3);
 
-void ui_update_statusbar(struct GeanyDocument *doc, gint pos);
+void ui_update_statusbar(GeanyDocument *doc, gint pos);
 
 
 /* This sets the window title according to the current filename. */
-void ui_set_window_title(struct GeanyDocument *doc);
+void ui_set_window_title(GeanyDocument *doc);
 
 void ui_set_editor_font(const gchar *font_name);
 
 void ui_set_fullscreen(void);
 
 
-void ui_update_popup_reundo_items(struct GeanyDocument *doc);
+void ui_update_popup_reundo_items(GeanyDocument *doc);
 
-void ui_update_popup_copy_items(struct GeanyDocument *doc);
+void ui_update_popup_copy_items(GeanyDocument *doc);
 
 void ui_update_popup_goto_items(gboolean enable);
 
 
-void ui_update_menu_copy_items(struct GeanyDocument *doc);
+void ui_update_menu_copy_items(GeanyDocument *doc);
 
-void ui_update_insert_include_item(struct GeanyDocument *doc, gint item);
+void ui_update_insert_include_item(GeanyDocument *doc, gint item);
 
 void ui_update_fold_items(void);
 
@@ -299,19 +298,19 @@ void ui_document_buttons_update(void);
 
 void ui_sidebar_show_hide(void);
 
-void ui_document_show_hide(struct GeanyDocument *doc);
+void ui_document_show_hide(GeanyDocument *doc);
 
 void ui_set_search_entry_background(GtkWidget *widget, gboolean success);
 
 
 void ui_create_recent_menus(void);
 
-void ui_add_recent_document(struct GeanyDocument *doc);
+void ui_add_recent_document(GeanyDocument *doc);
 
 void ui_add_recent_project_file(const gchar *utf8_filename);
 
 
-void ui_update_tab_status(struct GeanyDocument *doc);
+void ui_update_tab_status(GeanyDocument *doc);
 
 
 typedef gboolean TVMatchCallback(gboolean);


Modified: src/utils.c
28 lines changed, 14 insertions(+), 14 deletions(-)
===================================================================
@@ -23,7 +23,20 @@
  * General utility functions, non-GTK related.
  */
 
-#include "geany.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "utils.h"
+
+#include "app.h"
+#include "dialogs.h"
+#include "document.h"
+#include "prefs.h"
+#include "sciwrappers.h"
+#include "support.h"
+#include "templates.h"
+#include "ui_utils.h"
 
 #include <stdlib.h>
 #include <ctype.h>
@@ -41,21 +54,8 @@
 #endif
 
 #include <glib/gstdio.h>
-
 #include <gio/gio.h>
 
-#include "prefs.h"
-#include "support.h"
-#include "document.h"
-#include "filetypes.h"
-#include "dialogs.h"
-#include "win32.h"
-#include "project.h"
-#include "ui_utils.h"
-#include "templates.h"
-
-#include "utils.h"
-
 
 /**
  *  Tries to open the given URI in a browser.


Modified: src/utils.h
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -28,6 +28,7 @@
 #define GEANY_UTILS_H 1
 
 #include <glib.h>
+#include <gdk/gdk.h> /* for GdkColor */
 #include <time.h>
 
 G_BEGIN_DECLS


Modified: src/vte.c
30 lines changed, 16 insertions(+), 14 deletions(-)
===================================================================
@@ -23,10 +23,25 @@
  * Virtual Terminal Emulation setup and handling code, using the libvte plugin library.
  */
 
-#include "geany.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #ifdef HAVE_VTE
 
+#include "vte.h"
+
+#include "callbacks.h"
+#include "document.h"
+#include "msgwindow.h"
+#include "prefs.h"
+#include "sciwrappers.h"
+#include "support.h"
+#include "ui_utils.h"
+#include "utils.h"
+
+#include "gtkcompat.h"
+
 /* include stdlib.h AND unistd.h, because on GNU/Linux pid_t seems to be
  * in stdlib.h, on FreeBSD in unistd.h, sys/types.h is needed for C89 */
 #include <stdlib.h>
@@ -38,19 +53,6 @@
 #include <string.h>
 #include <errno.h>
 
-#include "vte.h"
-#include "support.h"
-#include "prefs.h"
-#include "ui_utils.h"
-#include "utils.h"
-#include "document.h"
-#include "msgwindow.h"
-#include "callbacks.h"
-#include "geanywraplabel.h"
-#include "editor.h"
-#include "sciwrappers.h"
-#include "gtkcompat.h"
-
 
 VteInfo vte_info;
 VteConfig *vc;


Modified: src/vte.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -25,7 +25,7 @@
 
 #ifdef HAVE_VTE
 
-#include <gtk/gtk.h>
+#include "gtkcompat.h"
 
 G_BEGIN_DECLS
 


Modified: src/win32.c
3 lines changed, 2 insertions(+), 1 deletions(-)
===================================================================
@@ -23,10 +23,11 @@
  * Special functions for the win32 platform, to provide native dialogs.
  */
 
-#include "geany.h"
 
 #ifdef G_OS_WIN32
 
+#include "geany.h"
+
 #define VC_EXTRALEAN
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>


Modified: src/win32.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -24,7 +24,7 @@
 
 #ifdef G_OS_WIN32
 
-#include <gtk/gtk.h>
+#include "gtkcompat.h"
 
 G_BEGIN_DECLS
 


Modified: wscript
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -513,7 +513,7 @@ def build(bld):
     ###
     # Headers
     bld.install_files('${PREFIX}/include/geany', '''
-        src/document.h src/editor.h src/encodings.h src/filetypes.h src/geany.h
+        src/app.h src/document.h src/editor.h src/encodings.h src/filetypes.h src/geany.h
         src/highlighting.h src/keybindings.h src/msgwindow.h src/plugindata.h
         src/prefs.h src/project.h src/search.h src/stash.h src/support.h
         src/templates.h src/toolbar.h src/ui_utils.h src/utils.h src/build.h src/gtkcompat.h



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list