b=794285 restore support for building against GTK+ 2.10 r=glandium
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 27 Sep 2012 12:23:00 +1200
changeset 108332 e1f8821deab43752978bfd46f056ab7f9d2f0f83
parent 108331 b8fa6f780f38f3208719ec7e810ad5d59f05e2ea
child 108333 d1dec9463a6210b8836fd1b00d7886f93abed37c
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersglandium
bugs794285
milestone18.0a1
b=794285 restore support for building against GTK+ 2.10 r=glandium
configure.in
widget/gtk2/compat/gdk/gdkwindow.h
widget/gtk2/compat/gtk/gtkdialog.h
widget/gtk2/compat/gtk/gtkplug.h
widget/gtk2/compat/gtk/gtkselection.h
widget/gtk2/compat/gtk/gtkwidget.h
--- a/configure.in
+++ b/configure.in
@@ -60,17 +60,17 @@ NSS_VERSION=3
 dnl Set the minimum version of toolkit libs used by mozilla
 dnl ========================================================
 GLIB_VERSION=1.2.0
 PERL_VERSION=5.006
 PYTHON_VERSION_MAJOR=2
 PYTHON_VERSION_MINOR=5
 CAIRO_VERSION=1.10
 PANGO_VERSION=1.14.0
-GTK2_VERSION=2.18.0
+GTK2_VERSION=2.10.0
 WINDRES_VERSION=2.14.90
 W32API_VERSION=3.14
 GNOMEVFS_VERSION=2.0
 GNOMEUI_VERSION=2.2.0
 GCONF_VERSION=1.2.1
 GIO_VERSION=2.18
 STARTUP_NOTIFICATION_VERSION=0.8
 DBUS_VERSION=0.60
--- a/widget/gtk2/compat/gdk/gdkwindow.h
+++ b/widget/gtk2/compat/gdk/gdkwindow.h
@@ -17,9 +17,17 @@ gdk_window_get_display(GdkWindow *window
   return gdk_drawable_get_display(GDK_DRAWABLE(window));
 }
 
 static inline GdkScreen*
 gdk_window_get_screen(GdkWindow *window)
 {
   return gdk_drawable_get_screen (window);
 }
+
+#if GDK_PIXBUF_MAJOR == 2 && GDK_PIXBUF_MINOR < 18
+static inline gboolean
+gdk_window_is_destroyed(GdkWindow *window)
+{
+  return GDK_WINDOW_OBJECT(window)->destroyed;
+}
+#endif
 #endif /* GDKWINDOW_WRAPPER_H */
new file mode 100644
--- /dev/null
+++ b/widget/gtk2/compat/gtk/gtkdialog.h
@@ -0,0 +1,15 @@
+#ifndef GTKDIALOG_WRAPPER_H
+#define GTKDIALOG_WRAPPER_H
+
+#include_next <gtk/gtkdialog.h>
+#include <gtk/gtkversion.h>
+
+#if !GTK_CHECK_VERSION(2, 14, 0)
+static inline GtkWidget *
+gtk_dialog_get_content_area(GtkDialog *dialog)
+{
+  return dialog->vbox;
+}
+#endif
+
+#endif /* GTKDIALOG_WRAPPER_H */
new file mode 100644
--- /dev/null
+++ b/widget/gtk2/compat/gtk/gtkplug.h
@@ -0,0 +1,15 @@
+#ifndef GTKPLUG_WRAPPER_H
+#define GTKPLUG_WRAPPER_H
+
+#include_next <gtk/gtkplug.h>
+#include <gtk/gtkversion.h>
+
+#if !GTK_CHECK_VERSION(2, 14, 0)
+static inline GdkWindow *
+gtk_plug_get_socket_window(GtkPlug *plug)
+{
+  return plug->socket_window;
+}
+#endif
+
+#endif /* GTKPLUG_WRAPPER_H */
new file mode 100644
--- /dev/null
+++ b/widget/gtk2/compat/gtk/gtkselection.h
@@ -0,0 +1,35 @@
+#ifndef GTKSELECTION_WRAPPER_H
+#define GTKSELECTION_WRAPPER_H
+
+#include_next <gtk/gtkselection.h>
+#include <gtk/gtkversion.h>
+
+#if !GTK_CHECK_VERSION(2, 16, 0)
+static inline GdkAtom
+gtk_selection_data_get_selection(GtkSelectionData *selection_data)
+{
+  return selection_data->selection;
+}
+#endif
+
+#if !GTK_CHECK_VERSION(2, 14, 0)
+static inline const guchar *
+gtk_selection_data_get_data(GtkSelectionData *selection_data)
+{
+  return selection_data->data;
+}
+
+static inline gint
+gtk_selection_data_get_length(GtkSelectionData *selection_data)
+{
+  return selection_data->length;
+}
+
+static inline GdkAtom
+gtk_selection_data_get_target(GtkSelectionData *selection_data)
+{
+  return selection_data->target;
+}
+#endif
+
+#endif /* GTKSELECTION_WRAPPER_H */
--- a/widget/gtk2/compat/gtk/gtkwidget.h
+++ b/widget/gtk2/compat/gtk/gtkwidget.h
@@ -10,16 +10,18 @@
 #define gtk_widget_set_realized gtk_widget_set_realized_
 #define gtk_widget_get_realized gtk_widget_get_realized_
 #include_next <gtk/gtkwidget.h>
 #undef gtk_widget_set_mapped
 #undef gtk_widget_get_mapped
 #undef gtk_widget_set_realized
 #undef gtk_widget_get_realized
 
+#include <gtk/gtkversion.h>
+
 static inline void
 gtk_widget_set_mapped(GtkWidget *widget, gboolean mapped)
 {
   if (mapped)
     GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
   else
     GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
 }
@@ -39,9 +41,71 @@ gtk_widget_set_realized(GtkWidget *widge
     GTK_WIDGET_UNSET_FLAGS(widget, GTK_REALIZED);
 }
 
 static inline gboolean
 gtk_widget_get_realized(GtkWidget *widget)
 {
   return GTK_WIDGET_REALIZED (widget);
 }
+
+#if !GTK_CHECK_VERSION(2, 18, 0)
+static inline gboolean
+gtk_widget_get_visible(GtkWidget *widget)
+{
+  return GTK_WIDGET_VISIBLE(widget);
+}
+
+static inline gboolean
+gtk_widget_has_focus(GtkWidget *widget)
+{
+  return GTK_WIDGET_HAS_FOCUS(widget);
+}
+
+static inline gboolean
+gtk_widget_has_grab(GtkWidget *widget)
+{
+  return GTK_WIDGET_HAS_GRAB(widget);
+}
+
+static inline void
+gtk_widget_get_allocation(GtkWidget *widget, GtkAllocation *allocation)
+{
+  *allocation = widget->allocation;
+}
+
+static inline void
+gtk_widget_set_allocation(GtkWidget *widget, const GtkAllocation *allocation)
+{
+  widget->allocation = *allocation;
+}
+
+static inline void
+gtk_widget_set_can_focus(GtkWidget *widget, gboolean can_focus)
+{
+  if (can_focus)
+    GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
+  else
+    GTK_WIDGET_UNSET_FLAGS (widget, GTK_CAN_FOCUS);
+}
+
+static inline void
+gtk_widget_set_window(GtkWidget *widget, GdkWindow *window)
+{
+  widget->window = window;
+}
+
+static inline gboolean
+gtk_widget_is_toplevel(GtkWidget *widget)
+{
+  return GTK_WIDGET_TOPLEVEL(widget);
+}
+#endif
+
+#if !GTK_CHECK_VERSION(2, 14, 0)
+static inline GdkWindow*
+gtk_widget_get_window(GtkWidget *widget)
+{
+  return widget->window;
+}
+#endif
+
 #endif /* GTKWIDGET_WRAPPER_H */