summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-04-05 20:13:19 +0200
committerGravatar waker <wakeroid@gmail.com>2012-04-05 20:13:19 +0200
commite9ba53567e803341c14ed502b2e1934fb25e5296 (patch)
treeaf6ed398a48c365eb12d7e276a9af9e60253a987
parent39f51393caee8408c4f1972dc539c9f361a30e1b (diff)
gtk-2.12 compatibility fixes
-rw-r--r--plugins/converter/support.c35
-rw-r--r--plugins/converter/support.h66
-rw-r--r--plugins/gtkui/ddbequalizer.c5
-rw-r--r--plugins/gtkui/ddbseekbar.c5
-rw-r--r--plugins/gtkui/wingeom.c1
5 files changed, 100 insertions, 12 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
diff --git a/plugins/gtkui/ddbequalizer.c b/plugins/gtkui/ddbequalizer.c
index 05491f9b..05f42547 100644
--- a/plugins/gtkui/ddbequalizer.c
+++ b/plugins/gtkui/ddbequalizer.c
@@ -1,6 +1,3 @@
-/* ddbequalizer.c generated by valac 0.14.0, the Vala compiler
- * generated from ddbequalizer.vala, do not modify */
-
/*
SuperEQ GTK Widget for for DeaDBeeF
Copyright (C) 2010 Viktor Semykin <thesame.ml@gmail.com>
@@ -33,7 +30,7 @@
#include <cairo.h>
#include <pango/pangocairo.h>
#include <pango/pango.h>
-
+#include "support.h"
#define DDB_TYPE_EQUALIZER (ddb_equalizer_get_type ())
#define DDB_EQUALIZER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DDB_TYPE_EQUALIZER, DdbEqualizer))
diff --git a/plugins/gtkui/ddbseekbar.c b/plugins/gtkui/ddbseekbar.c
index ffbb0cd1..bcb8b7fe 100644
--- a/plugins/gtkui/ddbseekbar.c
+++ b/plugins/gtkui/ddbseekbar.c
@@ -1,6 +1,3 @@
-/* ddbseekbar.c generated by valac 0.14.0, the Vala compiler
- * generated from ddbseekbar.vala, do not modify */
-
/*
DeaDBeeF - ultimate music player for GNU/Linux systems with X11
Copyright (C) 2009-2010 Alexey Yakovenko <waker@users.sourceforge.net>
@@ -26,7 +23,7 @@
#include <gdk/gdk.h>
#include <drawing.h>
#include <gtkui.h>
-
+#include "support.h"
#define DDB_TYPE_SEEKBAR (ddb_seekbar_get_type ())
#define DDB_SEEKBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DDB_TYPE_SEEKBAR, DdbSeekbar))
diff --git a/plugins/gtkui/wingeom.c b/plugins/gtkui/wingeom.c
index 49e1c9b5..cefd885c 100644
--- a/plugins/gtkui/wingeom.c
+++ b/plugins/gtkui/wingeom.c
@@ -23,6 +23,7 @@
#include "wingeom.h"
#include "../../deadbeef.h"
#include "gtkui.h"
+#include "support.h"
void
wingeom_save (GtkWidget *widget, const char *name) {