[gtk+] shortcuts: Don't include gtk.h



commit 7437d34eb95a4b44499a5f6464f8e81e3865ecf9
Author: Benjamin Otte <otte redhat com>
Date:   Thu Feb 8 06:15:10 2018 +0100

    shortcuts: Don't include gtk.h
    
    Clean up all shortcuts includes to only include the necessary files
    while we're at it.

 gtk/gtksearchbar.c                |    8 ++++----
 gtk/gtksearchbar.h                |    3 ++-
 gtk/gtkshortcutsgroup.c           |    7 ++++---
 gtk/gtkshortcutsgroup.h           |    6 +++++-
 gtk/gtkshortcutssection.h         |    7 +++++--
 gtk/gtkshortcutsshortcut.c        |    8 ++++++--
 gtk/gtkshortcutsshortcut.h        |    6 +++++-
 gtk/gtkshortcutsshortcutprivate.h |    2 ++
 gtk/gtkshortcutswindow.c          |   21 +++++++++++++++++----
 gtk/gtkshortcutswindow.h          |    4 ++++
 10 files changed, 54 insertions(+), 18 deletions(-)
---
diff --git a/gtk/gtksearchbar.c b/gtk/gtksearchbar.c
index ef1b982..690caca 100644
--- a/gtk/gtksearchbar.c
+++ b/gtk/gtksearchbar.c
@@ -27,14 +27,14 @@
 
 #include "config.h"
 
-#include "gtkentry.h"
-#include "gtkbox.h"
-#include "gtkcenterbox.h"
+#include "gtksearchbar.h"
+
 #include "gtkbutton.h"
+#include "gtkcenterbox.h"
 #include "gtkentryprivate.h"
 #include "gtkintl.h"
 #include "gtkprivate.h"
-#include "gtksearchbar.h"
+#include "gtkrevealer.h"
 #include "gtksearchentryprivate.h"
 #include "gtksnapshot.h"
 
diff --git a/gtk/gtksearchbar.h b/gtk/gtksearchbar.h
index 68f8542..5f94b37 100644
--- a/gtk/gtksearchbar.h
+++ b/gtk/gtksearchbar.h
@@ -32,7 +32,8 @@
 #error "Only <gtk/gtk.h> can be included directly."
 #endif
 
-#include <gtk/gtkrevealer.h>
+#include <gtk/gtkbin.h>
+#include <gtk/gtkentry.h>
 
 G_BEGIN_DECLS
 
diff --git a/gtk/gtkshortcutsgroup.c b/gtk/gtkshortcutsgroup.c
index 8e37665..60fa410 100644
--- a/gtk/gtkshortcutsgroup.c
+++ b/gtk/gtkshortcutsgroup.c
@@ -20,12 +20,13 @@
 
 #include "gtkshortcutsgroup.h"
 
-#include "gtkshortcutsshortcut.h"
+#include "gtkbox.h"
+#include "gtkintl.h"
 #include "gtklabel.h"
 #include "gtkorientable.h"
-#include "gtksizegroup.h"
 #include "gtkprivate.h"
-#include "gtkintl.h"
+#include "gtkshortcutsshortcut.h"
+#include "gtksizegroup.h"
 
 /**
  * SECTION:gtkshortcutsgroup
diff --git a/gtk/gtkshortcutsgroup.h b/gtk/gtkshortcutsgroup.h
index 88048e8..492b9ff 100644
--- a/gtk/gtkshortcutsgroup.h
+++ b/gtk/gtkshortcutsgroup.h
@@ -19,7 +19,11 @@
 #ifndef __GTK_SHORTCUTS_GROUP_H__
 #define __GTK_SHORTCUTS_GROUP_H__
 
-#include <gtk/gtkbox.h>
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
+#include <gdk/gdk.h>
 
 G_BEGIN_DECLS
 
diff --git a/gtk/gtkshortcutssection.h b/gtk/gtkshortcutssection.h
index 8b7c3bb..420a0de 100644
--- a/gtk/gtkshortcutssection.h
+++ b/gtk/gtkshortcutssection.h
@@ -19,8 +19,11 @@
 #ifndef __GTK_SHORTCUTS_SECTION_H__
 #define __GTK_SHORTCUTS_SECTION_H__
 
-#include <gtk/gtkbox.h>
-#include <gtk/gtkshortcutsgroup.h>
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
+#include <gdk/gdk.h>
 
 G_BEGIN_DECLS
 
diff --git a/gtk/gtkshortcutsshortcut.c b/gtk/gtkshortcutsshortcut.c
index 81db301..4a11d29 100644
--- a/gtk/gtkshortcutsshortcut.c
+++ b/gtk/gtkshortcutsshortcut.c
@@ -20,10 +20,14 @@
 
 #include "gtkshortcutsshortcutprivate.h"
 
+#include "gtkimage.h"
+#include "gtkintl.h"
+#include "gtklabel.h"
+#include "gtkprivate.h"
 #include "gtkshortcutlabel.h"
 #include "gtkshortcutswindowprivate.h"
-#include "gtkprivate.h"
-#include "gtkintl.h"
+#include "gtksizegroup.h"
+#include "gtktypebuiltins.h"
 
 /**
  * SECTION:gtkshortcutsshortcut
diff --git a/gtk/gtkshortcutsshortcut.h b/gtk/gtkshortcutsshortcut.h
index b8eeeca..dd9e7aa 100644
--- a/gtk/gtkshortcutsshortcut.h
+++ b/gtk/gtkshortcutsshortcut.h
@@ -19,7 +19,11 @@
 #ifndef GTK_SHORTCUTS_SHORTCUT_H
 #define GTK_SHORTCUTS_SHORTCUT_H
 
-#include <gtk/gtk.h>
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
+#include <gdk/gdk.h>
 
 G_BEGIN_DECLS
 
diff --git a/gtk/gtkshortcutsshortcutprivate.h b/gtk/gtkshortcutsshortcutprivate.h
index 5596100..a20706a 100644
--- a/gtk/gtkshortcutsshortcutprivate.h
+++ b/gtk/gtkshortcutsshortcutprivate.h
@@ -27,6 +27,8 @@
 
 #include "gtkshortcutsshortcut.h"
 
+#include "gtkwindow.h"
+
 G_BEGIN_DECLS
 
 void gtk_shortcuts_shortcut_update_accel (GtkShortcutsShortcut *self,
diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c
index 6499c04..a173512 100644
--- a/gtk/gtkshortcutswindow.c
+++ b/gtk/gtkshortcutswindow.c
@@ -19,15 +19,28 @@
 #include "config.h"
 
 #include "gtkshortcutswindowprivate.h"
+
+#include "gtkbindings.h"
+#include "gtkbox.h"
+#include "gtkgrid.h"
+#include "gtkheaderbar.h"
+#include "gtkintl.h"
+#include "gtklabel.h"
+#include "gtklistbox.h"
+#include "gtkmenubutton.h"
+#include "gtkpopover.h"
+#include "gtkprivate.h"
 #include "gtkscrolledwindow.h"
+#include "gtksearchbar.h"
+#include "gtksearchentry.h"
 #include "gtkshortcutssection.h"
 #include "gtkshortcutsgroup.h"
 #include "gtkshortcutsshortcutprivate.h"
-#include "gtksearchbar.h"
-#include "gtksearchentry.h"
+#include "gtksizegroup.h"
+#include "gtkstack.h"
+#include "gtktogglebutton.h"
+#include "gtktypebuiltins.h"
 #include "gtkwidgetprivate.h"
-#include "gtkprivate.h"
-#include "gtkintl.h"
 
 /**
  * SECTION:gtkshortcutswindow
diff --git a/gtk/gtkshortcutswindow.h b/gtk/gtkshortcutswindow.h
index f3f5ba4..ec30006 100644
--- a/gtk/gtkshortcutswindow.h
+++ b/gtk/gtkshortcutswindow.h
@@ -19,6 +19,10 @@
 #ifndef __GTK_SHORTCUTS_WINDOW_H__
 #define __GTK_SHORTCUTS_WINDOW_H__
 
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
 #include <gtk/gtkwindow.h>
 
 G_BEGIN_DECLS


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]