From: Václav Slavík <vslavik@fastmail.fm>
Date: Sun, 6 Mar 2011 18:22:28 +0000 (+0000)
Subject: Don't directly include GTK+ semi-public headers.
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/adc620811a415e8a715c6eac14bdc8fa096ca408

Don't directly include GTK+ semi-public headers.

Only the main headers (e.g. gtk/gtk.h) should be included and GTK+ 3 is strict about this. Enable compile-time checks for this that work with GTK+ 2.24.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67137 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/configure b/configure
index 3ccf8165e4..fb401de5bd 100755
--- a/configure
+++ b/configure
@@ -30954,6 +30954,9 @@ done
 
                 TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE -DG_DISABLE_CAST_CHECKS"
 
+                GTK_CHECKS_FLAGS="-DGTK_DISABLE_SINGLE_INCLUDES"
+        TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE $GTK_CHECKS_FLAGS"
+
         AFMINSTALL=afminstall
         TOOLKIT=GTK
         GUIDIST=GTK_DIST
diff --git a/configure.in b/configure.in
index 8fd0b7a0e1..141d4e8305 100644
--- a/configure.in
+++ b/configure.in
@@ -3101,6 +3101,10 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
         dnl disable GTK runtime type checks
         TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE -DG_DISABLE_CAST_CHECKS"
 
+        dnl enable useful GTK+ compile-time checks to ease transition to GTK+ 3:
+        GTK_CHECKS_FLAGS="-DGTK_DISABLE_SINGLE_INCLUDES"
+        TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE $GTK_CHECKS_FLAGS"
+
         AFMINSTALL=afminstall
         TOOLKIT=GTK
         GUIDIST=GTK_DIST
diff --git a/include/wx/gtk/assertdlg_gtk.h b/include/wx/gtk/assertdlg_gtk.h
index ffd8b7885c..07d1b0f816 100644
--- a/include/wx/gtk/assertdlg_gtk.h
+++ b/include/wx/gtk/assertdlg_gtk.h
@@ -14,8 +14,7 @@
 extern "C" {
 #endif /* __cplusplus */
 
-#include <gtk/gtkdialog.h>
-#include <gtk/gtklabel.h>
+#include <gtk/gtk.h>
 
 #define GTK_TYPE_ASSERT_DIALOG            (gtk_assert_dialog_get_type ())
 #define GTK_ASSERT_DIALOG(object)         (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_ASSERT_DIALOG, GtkAssertDialog))
diff --git a/include/wx/gtk/private/messagetype.h b/include/wx/gtk/private/messagetype.h
index e532b22be7..a2db2f29ff 100644
--- a/include/wx/gtk/private/messagetype.h
+++ b/include/wx/gtk/private/messagetype.h
@@ -11,7 +11,7 @@
 #ifndef _GTK_PRIVATE_MSGTYPE_H_
 #define _GTK_PRIVATE_MSGTYPE_H_
 
-#include <gtk/gtkmessagedialog.h>
+#include <gtk/gtk.h>
 
 namespace wxGTKImpl
 {
diff --git a/include/wx/gtk/private/win_gtk.h b/include/wx/gtk/private/win_gtk.h
index 153632b1e5..db1ddc06f0 100644
--- a/include/wx/gtk/private/win_gtk.h
+++ b/include/wx/gtk/private/win_gtk.h
@@ -10,7 +10,7 @@
 #ifndef _WX_GTK_PIZZA_H_
 #define _WX_GTK_PIZZA_H_
 
-#include <gtk/gtkfixed.h>
+#include <gtk/gtk.h>
 
 #define WX_PIZZA(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, wxPizza::type(), wxPizza)
 #define WX_IS_PIZZA(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, wxPizza::type())
diff --git a/src/gtk/assertdlg_gtk.c b/src/gtk/assertdlg_gtk.c
index 5684000a2d..b1de25f36a 100644
--- a/src/gtk/assertdlg_gtk.c
+++ b/src/gtk/assertdlg_gtk.c
@@ -23,8 +23,6 @@ extern "C" {
 /* For FILE */
 #include <stdio.h>
 
-#include <gtk/gtkexpander.h>
-
 
 /* ----------------------------------------------------------------------------
    Constants
diff --git a/src/gtk/eggtrayicon.c b/src/gtk/eggtrayicon.c
index 33cad3d058..bd048ae634 100644
--- a/src/gtk/eggtrayicon.c
+++ b/src/gtk/eggtrayicon.c
@@ -109,7 +109,7 @@ Anders
 
 #if wxUSE_TASKBARICON
 
-#include <gtk/gtkversion.h>
+#include <gtk/gtk.h>
 #if GTK_CHECK_VERSION(2, 1, 0)
 
 #include <string.h>
diff --git a/src/gtk/eggtrayicon.h b/src/gtk/eggtrayicon.h
index 2596b82340..aee0346af4 100644
--- a/src/gtk/eggtrayicon.h
+++ b/src/gtk/eggtrayicon.h
@@ -26,7 +26,7 @@
 #ifndef __EGG_TRAY_ICON_H__
 #define __EGG_TRAY_ICON_H__
 
-#include <gtk/gtkplug.h>
+#include <gtk/gtk.h>
 #ifdef GDK_WINDOWING_X11
 #include <gdk/gdkx.h>
 #endif
diff --git a/src/gtk/print.cpp b/src/gtk/print.cpp
index 18835a2d39..aefd2c2073 100644
--- a/src/gtk/print.cpp
+++ b/src/gtk/print.cpp
@@ -36,7 +36,7 @@
 #include "wx/paper.h"
 
 #include <gtk/gtk.h>
-#include <gtk/gtkpagesetupunixdialog.h>
+#include <gtk/gtkunixprint.h>
 
 #if wxUSE_GRAPHICS_CONTEXT
 #include "wx/graphics.h"