[gimp/metadata-browser] libgimpwidgets: add gimp3migration.[ch] to help the gtk3-port branch



commit 8a6bdc67063c162e9ad89d73b631af5178042805
Author: Michael Natterer <mitch gimp org>
Date:   Fri Sep 30 10:45:00 2011 +0200

    libgimpwidgets: add gimp3migration.[ch] to help the gtk3-port branch
    
    This is such a hack, but entirely safe when linking against GTK+ 2.x.
    Please ignore the uglyness.

 libgimpwidgets/Makefile.am      |    7 ++++-
 libgimpwidgets/gimp3migration.c |   39 ++++++++++++++++++++++++++++++++++++++
 libgimpwidgets/gimp3migration.h |   40 +++++++++++++++++++++++++++++++++++++++
 libgimpwidgets/gimpwidgets.def  |    1 +
 libgimpwidgets/gimpwidgets.h    |    1 +
 5 files changed, 86 insertions(+), 2 deletions(-)
---
diff --git a/libgimpwidgets/Makefile.am b/libgimpwidgets/Makefile.am
index a1aac9e..1f17b0b 100644
--- a/libgimpwidgets/Makefile.am
+++ b/libgimpwidgets/Makefile.am
@@ -176,7 +176,9 @@ libgimpwidgets_2_0_la_sources = \
 	gimpwidgetsenums.h		\
 	gimpwidgetstypes.h		\
 	gimpzoommodel.c			\
-	gimpzoommodel.h
+	gimpzoommodel.h			\
+	gimp3migration.c		\
+	gimp3migration.h
 
 libgimpwidgets_2_0_la_built_sources = \
 	gimp-wilber-pixbufs.h	\
@@ -247,7 +249,8 @@ libgimpwidgetsinclude_HEADERS = \
 	gimpwidgets.h			\
 	gimpwidgetsenums.h		\
 	gimpwidgetstypes.h		\
-	gimpzoommodel.h
+	gimpzoommodel.h			\
+	gimp3migration.h
 
 libgimpwidgets_2_0_la_LDFLAGS = \
 	-version-info $(LT_VERSION_INFO)\
diff --git a/libgimpwidgets/gimp3migration.c b/libgimpwidgets/gimp3migration.c
new file mode 100644
index 0000000..1e6c91a
--- /dev/null
+++ b/libgimpwidgets/gimp3migration.c
@@ -0,0 +1,39 @@
+/* LIBGIMP - The GIMP Library
+ * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
+ *
+ * gimp3migration.c
+ * Copyright (C) 2011 Michael Natterer <mitch gimp org>
+ *
+ * This library is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library 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 Lesser General Public
+ * License along with this library.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <gtk/gtk.h>
+
+#include "gimpwidgetstypes.h"
+
+#include "gimp3migration.h"
+
+
+GtkWidget *
+gtk_box_new (GtkOrientation  orientation,
+             gint            spacing)
+{
+  if (orientation == GTK_ORIENTATION_HORIZONTAL)
+    return gtk_hbox_new (FALSE, spacing);
+  else
+    return gtk_vbox_new (FALSE, spacing);
+}
diff --git a/libgimpwidgets/gimp3migration.h b/libgimpwidgets/gimp3migration.h
new file mode 100644
index 0000000..733e890
--- /dev/null
+++ b/libgimpwidgets/gimp3migration.h
@@ -0,0 +1,40 @@
+/* LIBGIMP - The GIMP Library
+ * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
+ *
+ * gimp3migration.h
+ * Copyright (C) 2011 Michael Natterer <mitch gimp org>
+ *
+ * This library is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library 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 Lesser General Public
+ * License along with this library.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+#if !defined (__GIMP_WIDGETS_H_INSIDE__) && !defined (GIMP_WIDGETS_COMPILATION)
+#error "Only <libgimpwidgets/gimpwidgets.h> can be included directly."
+#endif
+
+#ifndef __GIMP_3_MIGRATION_H__
+#define __GIMP_3_MIGRATION_H__
+
+
+/* This file is evil. Its purpose is to keep GIMP's gtk3-port branch
+ * managable, and contains functions that are only in GTK+ 3.x but
+ * are *not* in GTK+ 2.x. Please just ignore the uglyness and move
+ * along. This file will be removed in GIMP 3.
+ */
+
+GtkWidget * gtk_box_new (GtkOrientation  orientation,
+                         gint            spacing);
+
+
+#endif /* __GIMP_3_MIGRATION_H__ */
diff --git a/libgimpwidgets/gimpwidgets.def b/libgimpwidgets/gimpwidgets.def
index eeb39d2..c07eea1 100644
--- a/libgimpwidgets/gimpwidgets.def
+++ b/libgimpwidgets/gimpwidgets.def
@@ -389,3 +389,4 @@ EXPORTS
 	gimp_zoom_model_zoom
 	gimp_zoom_model_zoom_step
 	gimp_zoom_type_get_type
+	gtk_box_new
diff --git a/libgimpwidgets/gimpwidgets.h b/libgimpwidgets/gimpwidgets.h
index 9b0dac5..4316dfb 100644
--- a/libgimpwidgets/gimpwidgets.h
+++ b/libgimpwidgets/gimpwidgets.h
@@ -79,6 +79,7 @@
 #include <libgimpwidgets/gimpwidgets-error.h>
 #include <libgimpwidgets/gimpzoommodel.h>
 
+#include <libgimpwidgets/gimp3migration.h>
 #include <libgimpwidgets/gimpoldwidgets.h>
 
 #undef __GIMP_WIDGETS_H_INSIDE__



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