1 /*
2 Musical Spectrum plugin for the DeaDBeeF audio player
3
4 Copyright (C) 2015 Christian Boxdörfer <christian.boxdoerfer@posteo.de>
5
6 Based on DeaDBeeFs stock spectrum.
7 Copyright (c) 2009-2015 Alexey Yakovenko <waker@users.sourceforge.net>
8 Copyright (c) 2011 William Pitcock <nenolod@dereferenced.org>
9
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License
12 as published by the Free Software Foundation; either version 2
13 of the License, or (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 */
24
25 #include <gtk/gtk.h>
26
27 #include "support.h"
28
29 #if !GTK_CHECK_VERSION(2,24,0)
30 #define GTK_COMBO_BOX_TEXT GTK_COMBO_BOX
31 GtkWidget *
gtk_combo_box_text_new()32 gtk_combo_box_text_new () {
33 return gtk_combo_box_new_text ();
34 }
35
36 GtkWidget *
gtk_combo_box_text_new_with_entry(void)37 gtk_combo_box_text_new_with_entry (void) {
38 return gtk_combo_box_entry_new ();
39 }
40
41 void
gtk_combo_box_text_append_text(GtkComboBoxText * combo_box,const gchar * text)42 gtk_combo_box_text_append_text (GtkComboBoxText *combo_box, const gchar *text) {
43 gtk_combo_box_append_text (combo_box, text);
44 }
45
46 void
gtk_combo_box_text_insert_text(GtkComboBoxText * combo_box,gint position,const gchar * text)47 gtk_combo_box_text_insert_text (GtkComboBoxText *combo_box, gint position, const gchar *text) {
48 gtk_combo_box_insert_text (combo_box, position, text);
49 }
50
51 void
gtk_combo_box_text_prepend_text(GtkComboBoxText * combo_box,const gchar * text)52 gtk_combo_box_text_prepend_text (GtkComboBoxText *combo_box, const gchar *text) {
53 gtk_combo_box_prepend_text (combo_box, text);
54 }
55 gchar *
gtk_combo_box_text_get_active_text(GtkComboBoxText * combo_box)56 gtk_combo_box_text_get_active_text (GtkComboBoxText *combo_box) {
57 return gtk_combo_box_get_active_text (combo_box);
58 }
59
60 #endif
61 #if !GTK_CHECK_VERSION(2,18,0)
62 void
gtk_widget_get_allocation(GtkWidget * widget,GtkAllocation * allocation)63 gtk_widget_get_allocation (GtkWidget *widget, GtkAllocation *allocation) {
64 (allocation)->x = widget->allocation.x;
65 (allocation)->y = widget->allocation.y;
66 (allocation)->width = widget->allocation.width;
67 (allocation)->height = widget->allocation.height;
68 }
69 #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);}
70 #endif
71
72