]> git.saurik.com Git - wxWidgets.git/commitdiff
add more functions we will need
authorPaul Cornett <paulcor@bullseye.com>
Sun, 27 Mar 2011 18:41:07 +0000 (18:41 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Sun, 27 Mar 2011 18:41:07 +0000 (18:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67321 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/private/gtk2-compat.h

index 32e51e207f40f0cacb048525008d4defdf839d2d..051f9360d1d866f9edd930bb828815c07b43748b 100644 (file)
 //         functions even if GTK_CHECK_VERSION would indicate the function is
 //         already available in GTK+.
 
 //         functions even if GTK_CHECK_VERSION would indicate the function is
 //         already available in GTK+.
 
-#if !GTK_CHECK_VERSION(3,0,0) && !defined(GTK_DISABLE_DEPRECATED)
+#if !GTK_CHECK_VERSION(3,0,0) && !(defined(GTK_DISABLE_DEPRECATED) || defined(GSEAL_ENABLE))
+
+// ----------------------------------------------------------------------------
+// the following were introduced in GTK+ 2.8
+
+static inline GtkWidget* wx_gtk_scrolled_window_get_hscrollbar(GtkScrolledWindow* scrolled_window)
+{
+    return scrolled_window->hscrollbar;
+}
+#define gtk_scrolled_window_get_hscrollbar wx_gtk_scrolled_window_get_hscrollbar
+
+static inline GtkWidget* wx_gtk_scrolled_window_get_vscrollbar(GtkScrolledWindow* scrolled_window)
+{
+    return scrolled_window->vscrollbar;
+}
+#define gtk_scrolled_window_get_vscrollbar wx_gtk_scrolled_window_get_vscrollbar
+
+// ----------------------------------------------------------------------------
+// the following were introduced in GLib 2.10
+
+static inline gpointer wx_g_object_ref_sink(gpointer object)
+{
+    g_object_ref(object);
+    gtk_object_sink(GTK_OBJECT(object));
+    return object;
+}
+#define g_object_ref_sink wx_g_object_ref_sink
+
+// ----------------------------------------------------------------------------
+// the following were introduced in GTK+ 2.14
+
+static inline gdouble wx_gtk_adjustment_get_lower(GtkAdjustment* adjustment)
+{
+    return adjustment->lower;
+}
+#define gtk_adjustment_get_lower wx_gtk_adjustment_get_lower
+
+static inline gdouble wx_gtk_adjustment_get_page_increment(GtkAdjustment* adjustment)
+{
+    return adjustment->page_increment;
+}
+#define gtk_adjustment_get_page_increment wx_gtk_adjustment_get_page_increment
+
+static inline gdouble wx_gtk_adjustment_get_page_size(GtkAdjustment* adjustment)
+{
+    return adjustment->page_size;
+}
+#define gtk_adjustment_get_page_size wx_gtk_adjustment_get_page_size
+
+static inline gdouble wx_gtk_adjustment_get_step_increment(GtkAdjustment* adjustment)
+{
+    return adjustment->step_increment;
+}
+#define gtk_adjustment_get_step_increment wx_gtk_adjustment_get_step_increment
+
+static inline gdouble wx_gtk_adjustment_get_upper(GtkAdjustment* adjustment)
+{
+    return adjustment->upper;
+}
+#define gtk_adjustment_get_upper wx_gtk_adjustment_get_upper
+
+static inline GtkWidget* wx_gtk_color_selection_dialog_get_color_selection(GtkColorSelectionDialog* csd)
+{
+    return csd->colorsel;
+}
+#define gtk_color_selection_dialog_get_color_selection wx_gtk_color_selection_dialog_get_color_selection
+
+static inline GtkWidget* wx_gtk_dialog_get_content_area(GtkDialog* dialog)
+{
+    return dialog->vbox;
+}
+#define gtk_dialog_get_content_area wx_gtk_dialog_get_content_area
+
+static inline GtkWidget* wx_gtk_dialog_get_action_area(GtkDialog* dialog)
+{
+    return dialog->action_area;
+}
+#define gtk_dialog_get_action_area wx_gtk_dialog_get_action_area
+
+static inline GtkWidget* wx_gtk_font_selection_dialog_get_cancel_button(GtkFontSelectionDialog* fsd)
+{
+    return fsd->cancel_button;
+}
+#define gtk_font_selection_dialog_get_cancel_button wx_gtk_font_selection_dialog_get_cancel_button
+
+static inline GtkWidget* wx_gtk_font_selection_dialog_get_ok_button(GtkFontSelectionDialog* fsd)
+{
+    return fsd->ok_button;
+}
+#define gtk_font_selection_dialog_get_ok_button wx_gtk_font_selection_dialog_get_ok_button
+
+static inline GdkAtom wx_gtk_selection_data_get_data_type(GtkSelectionData* selection_data)
+{
+    return selection_data->type;
+}
+#define gtk_selection_data_get_data_type wx_gtk_selection_data_get_data_type
+
+static inline gint wx_gtk_selection_data_get_format(GtkSelectionData* selection_data)
+{
+    return selection_data->format;
+}
+#define gtk_selection_data_get_format wx_gtk_selection_data_get_format
+
+static inline gint wx_gtk_selection_data_get_length(GtkSelectionData* selection_data)
+{
+    return selection_data->length;
+}
+#define gtk_selection_data_get_length wx_gtk_selection_data_get_length
+
+static inline GdkAtom wx_gtk_selection_data_get_target(GtkSelectionData* selection_data)
+{
+    return selection_data->target;
+}
+#define gtk_selection_data_get_target wx_gtk_selection_data_get_target
+
+static inline GdkWindow* wx_gtk_widget_get_window(GtkWidget* widget)
+{
+    return widget->window;
+}
+#define gtk_widget_get_window wx_gtk_widget_get_window
+
+// ----------------------------------------------------------------------------
+// the following were introduced in GTK+ 2.16
+
+static inline GdkAtom wx_gtk_selection_data_get_selection(GtkSelectionData* selection_data)
+{
+    return selection_data->selection;
+}
+#define gtk_selection_data_get_selection wx_gtk_selection_data_get_selection
+
+// ----------------------------------------------------------------------------
+// the following were introduced in GTK+ 2.18
+
+static inline void wx_gtk_widget_get_allocation(GtkWidget* widget, GtkAllocation* allocation)
+{
+    *allocation = widget->allocation;
+}
+#define gtk_widget_get_allocation wx_gtk_widget_get_allocation
 
 inline gboolean wx_gtk_widget_get_has_window(GtkWidget *widget)
 {
 
 inline gboolean wx_gtk_widget_get_has_window(GtkWidget *widget)
 {
@@ -115,6 +252,20 @@ inline gboolean wx_gtk_widget_get_double_buffered(GtkWidget *widget)
 }
 #define gtk_widget_get_double_buffered wx_gtk_widget_get_double_buffered
 
 }
 #define gtk_widget_get_double_buffered wx_gtk_widget_get_double_buffered
 
+static inline gboolean wx_gtk_widget_has_grab(GtkWidget* widget)
+{
+    return GTK_WIDGET_HAS_GRAB(widget);
+}
+#define gtk_widget_has_grab wx_gtk_widget_has_grab
+
+static inline void wx_gtk_widget_set_allocation(GtkWidget* widget, const GtkAllocation* allocation)
+{
+    widget->allocation = *allocation;
+}
+#define gtk_widget_set_allocation wx_gtk_widget_set_allocation
+
+// ----------------------------------------------------------------------------
+// the following were introduced in GTK+ 2.20
 
 inline gboolean wx_gtk_widget_get_realized(GtkWidget *widget)
 {
 
 inline gboolean wx_gtk_widget_get_realized(GtkWidget *widget)
 {
@@ -129,6 +280,12 @@ inline gboolean wx_gtk_widget_get_mapped(GtkWidget *widget)
 }
 #define gtk_widget_get_mapped wx_gtk_widget_get_mapped
 
 }
 #define gtk_widget_get_mapped wx_gtk_widget_get_mapped
 
+static inline GdkWindow* wx_gtk_entry_get_text_window(GtkEntry* entry)
+{
+    return entry->text_area;
+}
+#define gtk_entry_get_text_window wx_gtk_entry_get_text_window
+
 #endif // !GTK_CHECK_VERSION(3,0,0) && !defined(GTK_DISABLE_DEPRECATED)
 
 
 #endif // !GTK_CHECK_VERSION(3,0,0) && !defined(GTK_DISABLE_DEPRECATED)