diff options
author | waker <wakeroid@gmail.com> | 2012-04-05 20:13:19 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-04-05 20:13:19 +0200 |
commit | e9ba53567e803341c14ed502b2e1934fb25e5296 (patch) | |
tree | af6ed398a48c365eb12d7e276a9af9e60253a987 /plugins/converter | |
parent | 39f51393caee8408c4f1972dc539c9f361a30e1b (diff) |
gtk-2.12 compatibility fixes
Diffstat (limited to 'plugins/converter')
-rw-r--r-- | plugins/converter/support.c | 35 | ||||
-rw-r--r-- | plugins/converter/support.h | 66 |
2 files changed, 97 insertions, 4 deletions
diff --git a/plugins/converter/support.c b/plugins/converter/support.c index 06482131..1eef6efc 100644 --- a/plugins/converter/support.c +++ b/plugins/converter/support.c @@ -147,11 +147,23 @@ GtkWidget * gtk_combo_box_entry_new_text(void) { GtkWidget *w = gtk_combo_box_text_new_with_entry (); } + void gtk_dialog_set_has_separator (GtkDialog *dlg, gboolean has) { } #endif +#if !GTK_CHECK_VERSION(2,22,0) +GdkDragAction +gdk_drag_context_get_selected_action (GdkDragContext *context) { + return context->action; +} +GList * +gdk_drag_context_list_targets (GdkDragContext *context) { + return context->targets; +} +#endif + #if !GTK_CHECK_VERSION(2,24,0) #define GTK_COMBO_BOX_TEXT GTK_COMBO_BOX GtkWidget * @@ -184,3 +196,26 @@ gtk_combo_box_text_get_active_text (GtkComboBoxText *combo_box) { } #endif + +#if !GTK_CHECK_VERSION(2,18,0) || defined(ULTRA_COMPATIBLE) +void +gtk_widget_set_allocation (GtkWidget *widget, const GtkAllocation *allocation) { + widget->allocation.x = (allocation)->x; + widget->allocation.y = (allocation)->y; + widget->allocation.width = (allocation)->width; + widget->allocation.height = (allocation)->height; +} + +void +gtk_widget_get_allocation (GtkWidget *widget, GtkAllocation *allocation) { + (allocation)->x = widget->allocation.x; + (allocation)->y = widget->allocation.y; + (allocation)->width = widget->allocation.width; + (allocation)->height = widget->allocation.height; +} + +void +gtk_widget_set_window(GtkWidget *widget, GdkWindow *window) { + widget->window = window; +} +#endif diff --git a/plugins/converter/support.h b/plugins/converter/support.h index 84d6a665..00e31c0f 100644 --- a/plugins/converter/support.h +++ b/plugins/converter/support.h @@ -1,12 +1,16 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ +#ifndef __GTKUI_SUPPORT_H +#define __GTKUI_SUPPORT_H #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <gtk/gtk.h> +#if GTK_CHECK_VERSION(3,0,0) +#include <gdk/gdkkeysyms-compat.h> +#else +#include <gdk/gdkkeysyms.h> +#endif /* * Standard gettext macros. @@ -27,7 +31,9 @@ # define dgettext(Domain,Message) (Message) # define dcgettext(Domain,Message,Type) (Message) # define bindtextdomain(Domain,Directory) (Domain) +#ifndef _ # define _(String) (String) +#endif # define Q_(String) g_strip_context ((String), (String)) # define N_(String) (String) #endif @@ -67,7 +73,6 @@ void glade_set_atk_action_description (AtkAction *action, const gchar *action_name, const gchar *description); - #if GTK_CHECK_VERSION(3,0,0) GtkWidget * gtk_combo_box_entry_new_text(void); @@ -76,6 +81,18 @@ void gtk_dialog_set_has_separator (GtkDialog *dlg, gboolean has); #endif +#if !GTK_CHECK_VERSION(2,20,0) +#define gtk_widget_set_realized(widget, realized) {if (realized) GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); else GTK_WIDGET_UNSET_FLAGS(widget, GTK_REALIZED);} +#define gtk_widget_get_realized(widget) (GTK_WIDGET_REALIZED (widget)) +#endif + +#if !GTK_CHECK_VERSION(2,22,0) +GdkDragAction +gdk_drag_context_get_selected_action (GdkDragContext *context); +GList * +gdk_drag_context_list_targets (GdkDragContext *context); +#endif + #if !GTK_CHECK_VERSION(2,24,0) #define GTK_COMBO_BOX_TEXT GTK_COMBO_BOX typedef GtkComboBox GtkComboBoxText; @@ -86,3 +103,44 @@ void gtk_combo_box_text_insert_text (GtkComboBoxText *combo_box, gint position, void gtk_combo_box_text_prepend_text (GtkComboBoxText *combo_box, const gchar *text); gchar *gtk_combo_box_text_get_active_text (GtkComboBoxText *combo_box); #endif + +#if !GTK_CHECK_VERSION(2,14,0) || defined(ULTRA_COMPATIBLE) +#define gtk_widget_get_window(widget) ((widget)->window) +#define gtk_selection_data_get_target(data) (data->target) +#define gtk_dialog_get_content_area(dialog) (dialog->vbox) +#define gtk_dialog_get_action_area(dialog) (dialog->action_area) +#define gtk_selection_data_get_data(data) (data->data) +#define gtk_selection_data_get_length(data) (data->length) +#define gtk_selection_data_get_format(data) (data->format) +#define gtk_adjustment_get_lower(adj) (adj->lower) +#define gtk_adjustment_get_upper(adj) (adj->upper) +#endif + +#if !GTK_CHECK_VERSION(2,18,0) || defined(ULTRA_COMPATIBLE) +#define gtk_widget_set_has_window(widget, has_window) \ + if (has_window) GTK_WIDGET_UNSET_FLAGS (widget, GTK_NO_WINDOW); \ + else GTK_WIDGET_SET_FLAGS (widget, GTK_NO_WINDOW); + +#define gtk_widget_get_visible(widget) (GTK_WIDGET_VISIBLE(widget)) +#define gtk_widget_get_has_window(widget) (!GTK_WIDGET_NO_WINDOW(widget)) +void gtk_widget_set_window(GtkWidget *widget, GdkWindow *window); +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) || defined(ULTRA_COMPATIBLE) +void gtk_widget_set_allocation (GtkWidget *widget, + const GtkAllocation *allocation); + +void gtk_widget_get_allocation (GtkWidget *widget, + GtkAllocation *allocation); + +#define gtk_widget_set_can_focus(widget, canfocus) {if (canfocus) GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS); else GTK_WIDGET_UNSET_FLAGS(widget, GTK_CAN_FOCUS);} + +#define gtk_widget_get_can_focus(widget) (GTK_WIDGET_CAN_FOCUS (widget)); + +#define gtk_widget_set_can_default(widget, candefault) {if (candefault) GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_DEFAULT); else GTK_WIDGET_UNSET_FLAGS(widget, GTK_CAN_DEFAULT);} + +#define gtk_widget_get_can_default(widget) (GTK_WIDGET_CAN_DEFAULT (widget)); +#endif + +#endif |