GTK3 Port - Remove single header inclusion



Hi there!
I'm trying to compile GtkDatabox againts GTK3 and patching it to be at least buildable. Here is the first patch on top of latest git master branch.

Hope it helps.
>From e8bd9c8fd3542081aaadafbca5997e2d8ed9bf36 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joaqu=C3=ADn=20Ignacio=20Aramend=C3=ADa?= <samsagax gmail com>
Date: Wed, 31 Oct 2012 23:09:02 -0300
Subject: [PATCH] Remove individual widgets header inclusion
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Only some header files are allowed to be included directly due to
problems with missing definitions in GTK3[1]. The allowed header files to
be included directly are:
    gtk/gtk.h
    gtk/gktx.h
    gtk/gtkunixprint.h
    gdk/gdk.h
    gdk/gdkx.h
    gdk/gdkwin32.h

Tested with command:
 $ make CFLAGS+="-DGTK_DISABLE_SINGLE_INCLUDES"

[1]http://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html#idp93076688

Signed-off-by: Joaquín Ignacio Aramendía <samsagax gmail com>
---
 examples/colors.c      |  2 --
 gtk/gtkdatabox.c       |  6 +-----
 gtk/gtkdatabox.h       |  3 +--
 gtk/gtkdatabox_graph.c |  3 +--
 gtk/gtkdatabox_graph.h | 16 ++++++++--------
 gtk/gtkdatabox_ruler.h |  2 +-
 6 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/examples/colors.c b/examples/colors.c
index ceb5020..6f141ae 100644
--- a/examples/colors.c
+++ b/examples/colors.c
@@ -19,8 +19,6 @@
  */
 #include <stdio.h>
 #include <gtk/gtk.h>
-#include <gtk/gtkcolorsel.h>
-#include <gtk/gtkitemfactory.h>
 #include <gtkdatabox.h>
 #include <gtkdatabox_points.h>
 #include <math.h>
diff --git a/gtk/gtkdatabox.c b/gtk/gtkdatabox.c
index 1e4eca0..5fe2957 100644
--- a/gtk/gtkdatabox.c
+++ b/gtk/gtkdatabox.c
@@ -19,11 +19,7 @@
 
 #include <gtkdatabox.h>
 #include <gtkdatabox_marshal.h>
-#include <gtk/gtkhscrollbar.h>
-#include <gtk/gtkvscrollbar.h>
-#include <gtkdatabox_ruler.h>
-#include <gtk/gtktable.h>
-#include <gtk/gtkgc.h>
+#include <gtk/gtk.h>
 #include <math.h>
 
 
diff --git a/gtk/gtkdatabox.h b/gtk/gtkdatabox.h
index ccc9d5c..6171df1 100644
--- a/gtk/gtkdatabox.h
+++ b/gtk/gtkdatabox.h
@@ -23,8 +23,7 @@
 #include <gtkdatabox_typedefs.h>
 #include <gtkdatabox_graph.h>
 #include <gtkdatabox_ruler.h>
-#include <gtk/gtkwidget.h>
-#include <gtk/gtkadjustment.h>
+#include <gtk/gtk.h>
 
 /**
  * SECTION:gtkdatabox
diff --git a/gtk/gtkdatabox_graph.c b/gtk/gtkdatabox_graph.c
index 7131b5b..c879b3c 100644
--- a/gtk/gtkdatabox_graph.c
+++ b/gtk/gtkdatabox_graph.c
@@ -18,8 +18,7 @@
  */
 
 #include <gtkdatabox_graph.h>
-#include <gtk/gtkstyle.h>
-#include <gtk/gtkgc.h>
+#include <gtk/gtk.h>
 
 static void gtk_databox_graph_real_draw (GtkDataboxGraph * graph,
     GtkDatabox * draw);
diff --git a/gtk/gtkdatabox_graph.h b/gtk/gtkdatabox_graph.h
index d39c0b9..8dac102 100644
--- a/gtk/gtkdatabox_graph.h
+++ b/gtk/gtkdatabox_graph.h
@@ -6,12 +6,12 @@
  * modify it under the terms of the GNU Lesser General Public License
  * as published by the Free Software Foundation; either version 2.1
  * 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 Lesser 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
@@ -25,16 +25,16 @@
  *
  * GtkDataboxGraphs can display data or other things in a #GtkDatabox widget.
  *
- * This class is just the basic interface. Other graph classes are derived from this 
+ * This class is just the basic interface. Other graph classes are derived from this
  * class and implement some real things.
- * 
+ *
  */
 
 
 #ifndef __GTK_DATABOX_GRAPH_H__
 #define __GTK_DATABOX_GRAPH_H__
 
-#include <gtk/gtkstyle.h>
+#include <gtk/gtk.h>
 #include <gdk/gdk.h>
 #include <pango/pango.h>
 #include <gtkdatabox.h>
@@ -61,14 +61,14 @@ G_BEGIN_DECLS
     * GtkDataboxGraphPrivate
     *
     * A private data structure used by the #GtkDataboxGraph. It shields all internal things
-    * from developers who are just using the object. 
+    * from developers who are just using the object.
     *
     **/
    typedef struct _GtkDataboxGraphPrivate GtkDataboxGraphPrivate;
 
    /**
     * _GtkDataboxGraph
-    * @parent: The parent object 
+    * @parent: The parent object
     * @priv: A private structure containing internal data.
     *
     * Implementation of #GtkDataboxGraph
@@ -87,7 +87,7 @@ G_BEGIN_DECLS
       GObjectClass parent_class;
 
       /*
-       * public virtual drawing function 
+       * public virtual drawing function
        */
       void (*draw) (GtkDataboxGraph * graph, GtkDatabox * box);
 
diff --git a/gtk/gtkdatabox_ruler.h b/gtk/gtkdatabox_ruler.h
index 01c76ae..d3b3264 100644
--- a/gtk/gtkdatabox_ruler.h
+++ b/gtk/gtkdatabox_ruler.h
@@ -66,7 +66,7 @@
 #endif
 
 #include <gdk/gdk.h>
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
 #include <gtkdatabox_scale.h>
 
 G_BEGIN_DECLS
-- 
1.8.0



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