pidgin/gtk3compat.h

Tue, 11 Feb 2014 12:41:25 +0100

author
Tomasz Wasilczyk <twasilczyk@pidgin.im>
date
Tue, 11 Feb 2014 12:41:25 +0100
changeset 35530
fdc05600d1fb
parent 35528
e04ba70092e9
child 35532
2c802bb77720
permissions
-rw-r--r--

Fix gtk2 build

33170
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
1 /* pidgin
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
2 *
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
3 * Pidgin is the legal property of its developers, whose names are too numerous
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
5 * source distribution.
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
6 *
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
10 * (at your option) any later version.
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
11 *
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
15 * GNU General Public License for more details.
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
16 *
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
20 */
35487
494f09f7f331 Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents: 35455
diff changeset
21
494f09f7f331 Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents: 35455
diff changeset
22 #ifndef _PIDGINGTK3COMPAT_H_
494f09f7f331 Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents: 35455
diff changeset
23 #define _PIDGINGTK3COMPAT_H_
35455
216a37403c5b Fix a bunch of gtk-doc warnings in pidgin
Ankit Vani <a@nevitus.org>
parents: 35451
diff changeset
24 /*
35451
206524351826 Add sections for finch and re-arrange its doc index
Ankit Vani <a@nevitus.org>
parents: 33892
diff changeset
25 * SECTION:gtk3compat
206524351826 Add sections for finch and re-arrange its doc index
Ankit Vani <a@nevitus.org>
parents: 33892
diff changeset
26 * @section_id: pidgin-gtk3compat
206524351826 Add sections for finch and re-arrange its doc index
Ankit Vani <a@nevitus.org>
parents: 33892
diff changeset
27 * @short_description: <filename>gtk3compat.h</filename>
206524351826 Add sections for finch and re-arrange its doc index
Ankit Vani <a@nevitus.org>
parents: 33892
diff changeset
28 * @title: GTK3 version-dependent definitions
206524351826 Add sections for finch and re-arrange its doc index
Ankit Vani <a@nevitus.org>
parents: 33892
diff changeset
29 *
206524351826 Add sections for finch and re-arrange its doc index
Ankit Vani <a@nevitus.org>
parents: 33892
diff changeset
30 * This file is internal to Pidgin. Do not use!
206524351826 Add sections for finch and re-arrange its doc index
Ankit Vani <a@nevitus.org>
parents: 33892
diff changeset
31 * Also, any public API should not depend on this file.
206524351826 Add sections for finch and re-arrange its doc index
Ankit Vani <a@nevitus.org>
parents: 33892
diff changeset
32 */
206524351826 Add sections for finch and re-arrange its doc index
Ankit Vani <a@nevitus.org>
parents: 33892
diff changeset
33
33275
8da9d2ec671d Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33268
diff changeset
34 #if !GTK_CHECK_VERSION(3,2,0)
8da9d2ec671d Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33268
diff changeset
35
8da9d2ec671d Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33268
diff changeset
36 #define GTK_FONT_CHOOSER GTK_FONT_SELECTION_DIALOG
8da9d2ec671d Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33268
diff changeset
37 #define gtk_font_chooser_get_font gtk_font_selection_dialog_get_font_name
8da9d2ec671d Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33268
diff changeset
38 #define gtk_font_chooser_set_font gtk_font_selection_dialog_set_font_name
8da9d2ec671d Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33268
diff changeset
39
33892
ef97228bc5f0 Fix most of warnings for gtk2 and linux
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33683
diff changeset
40 static inline GtkWidget * gtk_font_chooser_dialog_new(const gchar *title,
ef97228bc5f0 Fix most of warnings for gtk2 and linux
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33683
diff changeset
41 GtkWindow *parent)
ef97228bc5f0 Fix most of warnings for gtk2 and linux
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33683
diff changeset
42 {
ef97228bc5f0 Fix most of warnings for gtk2 and linux
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33683
diff changeset
43 return gtk_font_selection_dialog_new(title);
ef97228bc5f0 Fix most of warnings for gtk2 and linux
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33683
diff changeset
44 }
ef97228bc5f0 Fix most of warnings for gtk2 and linux
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33683
diff changeset
45
33170
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
46 #if !GTK_CHECK_VERSION(3,0,0)
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
47
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
48 #define gdk_x11_window_get_xid GDK_WINDOW_XWINDOW
33277
d6229108ce71 Remove deprecated gtk_widget_size_request calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33275
diff changeset
49 #define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,z)
33170
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
50
33523
fce9167b25c2 Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33277
diff changeset
51 #ifdef GDK_WINDOWING_X11
fce9167b25c2 Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33277
diff changeset
52 #define GDK_IS_X11_WINDOW(window) TRUE
fce9167b25c2 Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33277
diff changeset
53 #endif
fce9167b25c2 Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33277
diff changeset
54 #ifdef GDK_WINDOWING_WIN32
fce9167b25c2 Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33277
diff changeset
55 #define GDK_IS_WIN32_WINDOW(window) TRUE
fce9167b25c2 Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33277
diff changeset
56 #endif
fce9167b25c2 Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33277
diff changeset
57 #ifdef GDK_WINDOWING_QUARTZ
fce9167b25c2 Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33277
diff changeset
58 #define GDK_IS_QUARTZ_WINDOW(window) TRUE
fce9167b25c2 Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33277
diff changeset
59 #endif
fce9167b25c2 Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33277
diff changeset
60
35526
ed1be305c985 Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35487
diff changeset
61 static inline GtkWidget *
ed1be305c985 Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35487
diff changeset
62 gtk_box_new(GtkOrientation orientation, gint spacing)
ed1be305c985 Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35487
diff changeset
63 {
ed1be305c985 Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35487
diff changeset
64 g_return_val_if_fail(orientation == GTK_ORIENTATION_HORIZONTAL ||
ed1be305c985 Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35487
diff changeset
65 orientation == GTK_ORIENTATION_VERTICAL, NULL);
ed1be305c985 Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35487
diff changeset
66
ed1be305c985 Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35487
diff changeset
67 if (orientation == GTK_ORIENTATION_HORIZONTAL)
ed1be305c985 Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35487
diff changeset
68 return gtk_hbox_new(FALSE, spacing);
ed1be305c985 Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35487
diff changeset
69 else /* GTK_ORIENTATION_VERTICAL */
ed1be305c985 Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35487
diff changeset
70 return gtk_vbox_new(FALSE, spacing);
ed1be305c985 Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35487
diff changeset
71 }
ed1be305c985 Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35487
diff changeset
72
35528
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
73 static inline GtkWidget *
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
74 gtk_separator_new(GtkOrientation orientation)
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
75 {
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
76 g_return_val_if_fail(orientation == GTK_ORIENTATION_HORIZONTAL ||
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
77 orientation == GTK_ORIENTATION_VERTICAL, NULL);
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
78
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
79 if (orientation == GTK_ORIENTATION_HORIZONTAL)
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
80 return gtk_hseparator_new();
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
81 else /* GTK_ORIENTATION_VERTICAL */
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
82 return gtk_vseparator_new();
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
83 }
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
84
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
85 static inline GtkWidget *
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
86 gtk_button_box_new(GtkOrientation orientation)
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
87 {
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
88 g_return_val_if_fail(orientation == GTK_ORIENTATION_HORIZONTAL ||
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
89 orientation == GTK_ORIENTATION_VERTICAL, NULL);
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
90
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
91 if (orientation == GTK_ORIENTATION_HORIZONTAL)
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
92 return gtk_hbutton_box_new();
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
93 else /* GTK_ORIENTATION_VERTICAL */
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
94 return gtk_vbutton_box_new();
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
95 }
e04ba70092e9 Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35526
diff changeset
96
35530
fdc05600d1fb Fix gtk2 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35528
diff changeset
97 static inline GtkWidget *
fdc05600d1fb Fix gtk2 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35528
diff changeset
98 gtk_paned_new(GtkOrientation orientation)
fdc05600d1fb Fix gtk2 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35528
diff changeset
99 {
fdc05600d1fb Fix gtk2 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35528
diff changeset
100 g_return_val_if_fail(orientation == GTK_ORIENTATION_HORIZONTAL ||
fdc05600d1fb Fix gtk2 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35528
diff changeset
101 orientation == GTK_ORIENTATION_VERTICAL, NULL);
fdc05600d1fb Fix gtk2 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35528
diff changeset
102
fdc05600d1fb Fix gtk2 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35528
diff changeset
103 if (orientation == GTK_ORIENTATION_HORIZONTAL)
fdc05600d1fb Fix gtk2 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35528
diff changeset
104 return gtk_hpaned_new();
fdc05600d1fb Fix gtk2 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35528
diff changeset
105 else /* GTK_ORIENTATION_VERTICAL */
fdc05600d1fb Fix gtk2 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35528
diff changeset
106 return gtk_vpaned_new();
fdc05600d1fb Fix gtk2 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35528
diff changeset
107 }
fdc05600d1fb Fix gtk2 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35528
diff changeset
108
33170
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
109 #if !GTK_CHECK_VERSION(2,24,0)
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
110
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
111 #define gdk_x11_set_sm_client_id gdk_set_sm_client_id
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
112 #define gdk_window_get_display gdk_drawable_get_display
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
113 #define GtkComboBoxText GtkComboBox
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
114 #define GTK_COMBO_BOX_TEXT GTK_COMBO_BOX
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
115 #define gtk_combo_box_text_new gtk_combo_box_new_text
33268
a24713d9bbb3 Fix GTK+3 compile.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33185
diff changeset
116 #define gtk_combo_box_text_new_with_entry gtk_combo_box_entry_new_text
33170
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
117 #define gtk_combo_box_text_append_text gtk_combo_box_append_text
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
118 #define gtk_combo_box_text_get_active_text gtk_combo_box_get_active_text
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
119 #define gtk_combo_box_text_remove gtk_combo_box_remove_text
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
120
33179
49992d98f392 Fix fallback function inlining.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33170
diff changeset
121 static inline gint gdk_window_get_width(GdkWindow *x)
33170
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
122 {
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
123 gint w;
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
124 gdk_drawable_get_size(GDK_DRAWABLE(x), &w, NULL);
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
125 return w;
33185
6e5188b4f928 Remove some sneaky trailing whitespace.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33180
diff changeset
126 }
33170
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
127
33179
49992d98f392 Fix fallback function inlining.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33170
diff changeset
128 static inline gint gdk_window_get_height(GdkWindow *x)
33170
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
129 {
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
130 gint h;
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
131 gdk_drawable_get_size(GDK_DRAWABLE(x), NULL, &h);
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
132 return h;
33185
6e5188b4f928 Remove some sneaky trailing whitespace.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33180
diff changeset
133 }
33170
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
134
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
135 #if !GTK_CHECK_VERSION(2,22,0)
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
136
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
137 #define gdk_drag_context_get_actions(x) (x)->action
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
138 #define gdk_drag_context_get_suggested_action(x) (x)->suggested_action
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
139 #define gtk_text_view_get_vadjustment(x) (x)->vadjustment
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
140 #define gtk_font_selection_dialog_get_font_selection(x) (x)->fontsel
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
141
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
142 #if !GTK_CHECK_VERSION(2,20,0)
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
143
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
144 #define gtk_widget_get_mapped GTK_WIDGET_MAPPED
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
145 #define gtk_widget_set_mapped(x,y) do { \
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
146 if (y) \
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
147 GTK_WIDGET_SET_FLAGS(x, GTK_MAPPED); \
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
148 else \
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
149 GTK_WIDGET_UNSET_FLAGS(x, GTK_MAPPED); \
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
150 } while(0)
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
151 #define gtk_widget_get_realized GTK_WIDGET_REALIZED
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
152 #define gtk_widget_set_realized(x,y) do { \
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
153 if (y) \
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
154 GTK_WIDGET_SET_FLAGS(x, GTK_REALIZED); \
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
155 else \
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
156 GTK_WIDGET_UNSET_FLAGS(x, GTK_REALIZED); \
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
157 } while(0)
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
158
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
159 #endif /* 2.20.0 */
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
160
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
161 #endif /* 2.22.0 */
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
162
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
163 #endif /* 2.24.0 */
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
164
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
165 #endif /* 3.0.0 */
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
166
33275
8da9d2ec671d Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33268
diff changeset
167 #endif /* 3.2.0 */
8da9d2ec671d Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 33268
diff changeset
168
33170
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
169 #endif /* _PIDGINGTK3COMPAT_H_ */
ce4447562d64 Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
170

mercurial