Skip to content

Commit

Permalink
Improve header include dependencies a little bit
Browse files Browse the repository at this point in the history
Instead of having everything included in a single header at the start
of each file, we have each file include what it uses. This makes it
easier to include other files and get the includes you need and reason
about the dependencies each file has.
  • Loading branch information
codebrainz committed Jul 14, 2014
1 parent da54cc9 commit 7b203d8
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 11 deletions.
2 changes: 2 additions & 0 deletions mousepad/mousepad-application.h
Expand Up @@ -17,6 +17,8 @@
#ifndef __MOUSEPAD_APPLICATION_H__
#define __MOUSEPAD_APPLICATION_H__

#include <gtk/gtk.h>

G_BEGIN_DECLS

typedef struct _MousepadApplicationClass MousepadApplicationClass;
Expand Down
3 changes: 3 additions & 0 deletions mousepad/mousepad-dialogs.c
Expand Up @@ -22,6 +22,9 @@
#include <mousepad/mousepad-dialogs.h>
#include <mousepad/mousepad-util.h>

#include <gtksourceview/gtksourcestylescheme.h>
#include <gtksourceview/gtksourcestyleschememanager.h>



void
Expand Down
2 changes: 2 additions & 0 deletions mousepad/mousepad-dialogs.h
Expand Up @@ -17,6 +17,8 @@
#ifndef __MOUSEPAD_DIALOGS_H__
#define __MOUSEPAD_DIALOGS_H__

#include <gtk/gtk.h>

G_BEGIN_DECLS

/* dialog responses */
Expand Down
2 changes: 2 additions & 0 deletions mousepad/mousepad-document.c
Expand Up @@ -36,6 +36,8 @@
#include <mousepad/mousepad-view.h>
#include <mousepad/mousepad-window.h>

#include <gtksourceview/gtksourcebuffer.h>



#define MOUSEPAD_DOCUMENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), MOUSEPAD_TYPE_DOCUMENT, MousepadDocumentPrivate))
Expand Down
1 change: 1 addition & 0 deletions mousepad/mousepad-encoding-dialog.c
Expand Up @@ -30,6 +30,7 @@

#include <glib.h>
#include <glib/gstdio.h>
#include <gtksourceview/gtksourceview.h>



Expand Down
4 changes: 3 additions & 1 deletion mousepad/mousepad-file.c
Expand Up @@ -40,8 +40,10 @@
#include <mousepad/mousepad-private.h>
#include <mousepad/mousepad-file.h>

#include <glib.h>
#include <glib/gstdio.h>
#include <gtksourceview/gtksourcebuffer.h>
#include <gtksourceview/gtksourcelanguage.h>
#include <gtksourceview/gtksourcelanguagemanager.h>



Expand Down
2 changes: 2 additions & 0 deletions mousepad/mousepad-file.h
Expand Up @@ -21,6 +21,8 @@ G_BEGIN_DECLS

#include <mousepad/mousepad-encoding.h>

#include <gtksourceview/gtksourcelanguage.h>

typedef struct _MousepadFileClass MousepadFileClass;
typedef struct _MousepadFile MousepadFile;

Expand Down
3 changes: 3 additions & 0 deletions mousepad/mousepad-prefs-dialog.c
Expand Up @@ -23,6 +23,9 @@
#include <mousepad/mousepad-prefs-dialog-ui.h>
#include <mousepad/mousepad-settings.h>

#include <gtksourceview/gtksourcestylescheme.h>
#include <gtksourceview/gtksourcestyleschememanager.h>



#define WID_NOTEBOOK "/prefs/main-notebook"
Expand Down
1 change: 1 addition & 0 deletions mousepad/mousepad-print.c
Expand Up @@ -25,6 +25,7 @@

#include <pango/pango.h>
#include <cairo.h>
#include <gtksourceview/gtksourceprintcompositor.h>

#define DOCUMENT_SPACING (10)

Expand Down
15 changes: 5 additions & 10 deletions mousepad/mousepad-private.h
Expand Up @@ -18,21 +18,16 @@
#define __MOUSEPAD_PRIVATE_H__

#ifdef NDEBUG
#define G_DISABLE_CHECKS
#define G_DISABLE_ASSERT
# define G_DISABLE_CHECKS
# define G_DISABLE_ASSERT
#endif

/* These are the only three headers that can be assumed to always be included
* since they are so core to the basic and advanced type system that GLib
* provides us and for all the various i18n includes and macros we need. */
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <gtksourceview/gtksourceview.h>
#include <gtksourceview/gtksourcestylescheme.h>
#include <gtksourceview/gtksourcestyleschememanager.h>
#include <gtksourceview/gtksourcelanguage.h>
#include <gtksourceview/gtksourcelanguagemanager.h>
#include <gtksourceview/gtksourceprintcompositor.h>

G_BEGIN_DECLS

Expand Down
3 changes: 3 additions & 0 deletions mousepad/mousepad-statusbar.h
Expand Up @@ -17,6 +17,9 @@
#ifndef __MOUSEPAD_STATUSBAR_H__
#define __MOUSEPAD_STATUSBAR_H__

#include <gtk/gtk.h>
#include <gtksourceview/gtksourcelanguage.h>

G_BEGIN_DECLS

#define MOUSEPAD_TYPE_STATUSBAR (mousepad_statusbar_get_type ())
Expand Down
2 changes: 2 additions & 0 deletions mousepad/mousepad-util.h
Expand Up @@ -17,6 +17,8 @@
#ifndef __MOUSEPAD_UTIL_H__
#define __MOUSEPAD_UTIL_H__

#include <gtk/gtk.h>

G_BEGIN_DECLS

#define MOUSEPAD_TYPE_SEARCH_FLAGS (mousepad_util_search_flags_get_type ())
Expand Down
3 changes: 3 additions & 0 deletions mousepad/mousepad-view.c
Expand Up @@ -28,6 +28,9 @@
#include <mousepad/mousepad-view.h>

#include <gdk/gdkkeysyms.h>
#include <gtksourceview/gtksourceview.h>
#include <gtksourceview/gtksourcestylescheme.h>
#include <gtksourceview/gtksourcestyleschememanager.h>



Expand Down
3 changes: 3 additions & 0 deletions mousepad/mousepad-window.c
Expand Up @@ -47,6 +47,9 @@
#include <mousepad/mousepad-window-ui.h>

#include <glib/gstdio.h>
#include <gtksourceview/gtksourcelanguage.h>
#include <gtksourceview/gtksourcelanguagemanager.h>
#include <gtksourceview/gtksourcebuffer.h>



Expand Down

0 comments on commit 7b203d8

Please sign in to comment.