| |
1 /* pidgin |
| |
2 * |
| |
3 * Pidgin is the legal property of its developers, whose names are too numerous |
| |
4 * to list here. Please refer to the COPYRIGHT file distributed with this |
| |
5 * source distribution. |
| |
6 * |
| |
7 * This program is free software; you can redistribute it and/or modify |
| |
8 * it under the terms of the GNU General Public License as published by |
| |
9 * the Free Software Foundation; either version 2 of the License, or |
| |
10 * (at your option) any later version. |
| |
11 * |
| |
12 * This program is distributed in the hope that it will be useful, |
| |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| |
15 * GNU General Public License for more details. |
| |
16 * |
| |
17 * You should have received a copy of the GNU General Public License |
| |
18 * along with this program; if not, write to the Free Software |
| |
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| |
20 */ |
| |
21 #ifndef _PIDGINGTK3COMPAT_H_ |
| |
22 #define _PIDGINGTK3COMPAT_H_ |
| |
23 |
| |
24 /* This file is internal to Pidgin. Do not use! |
| |
25 * Also, any public API should not depend on this file. |
| |
26 */ |
| |
27 |
| |
28 #if !GTK_CHECK_VERSION(3,0,0) |
| |
29 |
| |
30 #define gdk_x11_window_get_xid GDK_WINDOW_XWINDOW |
| |
31 |
| |
32 #if !GTK_CHECK_VERSION(2,24,0) |
| |
33 |
| |
34 #define gdk_x11_set_sm_client_id gdk_set_sm_client_id |
| |
35 #define gdk_window_get_display gdk_drawable_get_display |
| |
36 #define GtkComboBoxText GtkComboBox |
| |
37 #define GTK_COMBO_BOX_TEXT GTK_COMBO_BOX |
| |
38 #define gtk_combo_box_text_new gtk_combo_box_new_text |
| |
39 #define gtk_combo_box_text_append_text gtk_combo_box_append_text |
| |
40 #define gtk_combo_box_text_get_active_text gtk_combo_box_get_active_text |
| |
41 #define gtk_combo_box_text_remove gtk_combo_box_remove_text |
| |
42 |
| |
43 gint inline gdk_window_get_width(GdkWindow *x) |
| |
44 { |
| |
45 gint w; |
| |
46 gdk_drawable_get_size(GDK_DRAWABLE(x), &w, NULL); |
| |
47 return w; |
| |
48 } |
| |
49 |
| |
50 gint inline gdk_window_get_height(GdkWindow *x) |
| |
51 { |
| |
52 gint h; |
| |
53 gdk_drawable_get_size(GDK_DRAWABLE(x), NULL, &h); |
| |
54 return h; |
| |
55 } |
| |
56 |
| |
57 #if !GTK_CHECK_VERSION(2,22,0) |
| |
58 |
| |
59 #define gdk_drag_context_get_actions(x) (x)->action |
| |
60 #define gdk_drag_context_get_suggested_action(x) (x)->suggested_action |
| |
61 #define gtk_text_view_get_vadjustment(x) (x)->vadjustment |
| |
62 #define gtk_font_selection_dialog_get_font_selection(x) (x)->fontsel |
| |
63 |
| |
64 #if !GTK_CHECK_VERSION(2,20,0) |
| |
65 |
| |
66 #define gtk_widget_get_mapped GTK_WIDGET_MAPPED |
| |
67 #define gtk_widget_set_mapped(x,y) do { \ |
| |
68 if (y) \ |
| |
69 GTK_WIDGET_SET_FLAGS(x, GTK_MAPPED); \ |
| |
70 else \ |
| |
71 GTK_WIDGET_UNSET_FLAGS(x, GTK_MAPPED); \ |
| |
72 } while(0) |
| |
73 #define gtk_widget_get_realized GTK_WIDGET_REALIZED |
| |
74 #define gtk_widget_set_realized(x,y) do { \ |
| |
75 if (y) \ |
| |
76 GTK_WIDGET_SET_FLAGS(x, GTK_REALIZED); \ |
| |
77 else \ |
| |
78 GTK_WIDGET_UNSET_FLAGS(x, GTK_REALIZED); \ |
| |
79 } while(0) |
| |
80 |
| |
81 #if !GTK_CHECK_VERSION(2,18,0) |
| |
82 |
| |
83 #define gtk_widget_get_state GTK_WIDGET_STATE |
| |
84 #define gtk_widget_is_drawable GTK_WIDGET_DRAWABLE |
| |
85 #define gtk_widget_get_visible GTK_WIDGET_VISIBLE |
| |
86 #define gtk_widget_has_focus GTK_WIDGET_HAS_FOCUS |
| |
87 #define gtk_widget_is_sensitive GTK_WIDGET_IS_SENSITIVE |
| |
88 #define gtk_widget_get_has_window(x) !GTK_WIDGET_NO_WINDOW(x) |
| |
89 #define gtk_widget_set_has_window(x,y) do { \ |
| |
90 if (!y) \ |
| |
91 GTK_WIDGET_SET_FLAGS(x, GTK_NO_WINDOW); \ |
| |
92 else \ |
| |
93 GTK_WIDGET_UNSET_FLAGS(x, GTK_NO_WINDOW); \ |
| |
94 } while(0) |
| |
95 #define gtk_widget_get_allocation(x,y) *(y) = (x)->allocation |
| |
96 #define gtk_widget_set_allocation(x,y) (x)->allocation = *(y) |
| |
97 #define gtk_widget_set_window(x,y) ((x)->window = (y)) |
| |
98 #define gtk_widget_set_can_default(w,y) do { \ |
| |
99 if (y) \ |
| |
100 GTK_WIDGET_SET_FLAGS((w), GTK_CAN_DEFAULT); \ |
| |
101 else \ |
| |
102 GTK_WIDGET_UNSET_FLAGS((w), GTK_CAN_DEFAULT); \ |
| |
103 } while (0) |
| |
104 #define gtk_widget_set_can_focus(x,y) do {\ |
| |
105 if (y) \ |
| |
106 GTK_WIDGET_SET_FLAGS(x, GTK_CAN_FOCUS); \ |
| |
107 else \ |
| |
108 GTK_WIDGET_UNSET_FLAGS(x, GTK_CAN_FOCUS); \ |
| |
109 } while(0) |
| |
110 #define gtk_cell_renderer_set_padding(x,y,z) do { \ |
| |
111 (x)->xpad = (y); \ |
| |
112 (x)->ypad = (z); \ |
| |
113 } while (0) |
| |
114 #define gtk_cell_renderer_get_padding(x,y,z) do { \ |
| |
115 *(y) = (x)->xpad; \ |
| |
116 *(z) = (x)->ypad; \ |
| |
117 } while (0) |
| |
118 #define gtk_cell_renderer_get_alignment(x,y,z) do { \ |
| |
119 *(y) = (x)->xalign; \ |
| |
120 *(z) = (x)->yalign; \ |
| |
121 } while (0) |
| |
122 |
| |
123 #if !GTK_CHECK_VERSION(2,16,0) |
| |
124 |
| |
125 #define gtk_status_icon_set_tooltip_text gtk_status_icon_set_tooltip |
| |
126 |
| |
127 #if !GTK_CHECK_VERSION(2,14,0) |
| |
128 |
| |
129 #define gtk_widget_get_window(x) (x)->window |
| |
130 #define gtk_widget_set_style(x,y) (x)->style = (y) |
| |
131 #define gtk_selection_data_get_data(x) (x)->data |
| |
132 #define gtk_selection_data_get_length(x) (x)->length |
| |
133 #define gtk_selection_data_get_format(x) (x)->format |
| |
134 #define gtk_selection_data_get_target(x) (x)->target |
| |
135 #define gtk_dialog_get_content_area(x) GTK_DIALOG(x)->vbox |
| |
136 #define gtk_dialog_get_action_area(x) GTK_DIALOG(x)->action_area |
| |
137 #define gtk_adjustment_get_page_size(x) (x)->page_size |
| |
138 #define gtk_adjustment_get_lower(x) (x)->lower |
| |
139 #define gtk_adjustment_get_upper(x) (x)->upper |
| |
140 #define gtk_font_selection_get_size_entry (x)->size_entry |
| |
141 #define gtk_font_selection_get_family_list (x)->family_list |
| |
142 #define gtk_font_selection_dialog_get_ok_button(x) (x)->ok_button |
| |
143 #define gtk_font_selection_dialog_get_cancel_button(x) (x)->cancel_button |
| |
144 #define gtk_color_selection_dialog_get_color_selection(x) (x)->colorsel |
| |
145 #define gtk_menu_item_get_accel_path(x) (x)->accel_path |
| |
146 |
| |
147 #if !GTK_CHECK_VERSION(2,12,0) |
| |
148 |
| |
149 #ifdef GTK_TOOLTIPS_VAR |
| |
150 #define gtk_widget_set_tooltip_text(w, t) gtk_tooltips_set_tip(GTK_TOOLTIPS_VAR, (w), (t), NULL) |
| |
151 #else |
| |
152 #define gtk_widget_set_tooltip_text(w, t) gtk_tooltips_set_tip(tooltips, (w), (t), NULL) |
| |
153 #endif |
| |
154 |
| |
155 #endif /* 2.12.0 */ |
| |
156 |
| |
157 #endif /* 2.14.0 */ |
| |
158 |
| |
159 #endif /* 2.16.0 */ |
| |
160 |
| |
161 #endif /* 2.18.0 */ |
| |
162 |
| |
163 #endif /* 2.20.0 */ |
| |
164 |
| |
165 #endif /* 2.22.0 */ |
| |
166 |
| |
167 #endif /* 2.24.0 */ |
| |
168 |
| |
169 #endif /* 3.0.0 */ |
| |
170 |
| |
171 #endif /* _PIDGINGTK3COMPAT_H_ */ |
| |
172 |