Wed, 12 Feb 2014 21:05:42 -0500
Fix silly typo in GTK+2 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 | |
|
35534
8e72593def2c
Fix gtk_[hv]box_new gtk3 deprecation warnings in unity plugin
Ankit Vani <a@nevitus.org>
parents:
35532
diff
changeset
|
34 | #include <gtk/gtk.h> |
|
35547
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
35 | #include <math.h> |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
36 | |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
37 | #if !GTK_CHECK_VERSION(3,4,0) |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
38 | |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
39 | #define gtk_color_chooser_dialog_new(title, parent) \ |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
40 | gtk_color_selection_dialog_new(title) |
|
35550
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
41 | #define GTK_COLOR_CHOOSER(widget) (widget) |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
42 | #define gtk_color_chooser_set_use_alpha(widget, val) do { \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
43 | if (GTK_IS_COLOR_BUTTON(widget)) \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
44 | gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(widget), val); \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
45 | } while (0) |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
46 | #define pidgin_color_chooser_set_rgb(widget, color) do { \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
47 | if (GTK_IS_COLOR_SELECTION_DIALOG(widget)) \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
48 | gtk_color_selection_set_current_color( \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
49 | GTK_COLOR_SELECTION( \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
50 | gtk_color_selection_dialog_get_color_selection( \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
51 | GTK_COLOR_SELECTION_DIALOG(widget))), \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
52 | color); \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
53 | else \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
54 | gtk_color_button_set_color(GTK_COLOR_BUTTON(widget), color); \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
55 | } while (0) |
|
35551
7f2748e6a412
Fix silly typo in GTK+2 build.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35550
diff
changeset
|
56 | #define pidgin_color_chooser_get_rgb(widget, color) do { \ |
|
35550
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
57 | if (GTK_IS_COLOR_SELECTION_DIALOG(widget)) \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
58 | gtk_color_selection_get_current_color( \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
59 | GTK_COLOR_SELECTION( \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
60 | gtk_color_selection_dialog_get_color_selection( \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
61 | GTK_COLOR_SELECTION_DIALOG(widget))), \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
62 | color); \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
63 | else \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
64 | gtk_color_button_get_color(GTK_COLOR_BUTTON(widget), color); \ |
|
b18fa06ff063
Use GtkFontButton and GtkColorButton widgets.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35547
diff
changeset
|
65 | } while (0) |
|
35547
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
66 | |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
67 | #else |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
68 | |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
69 | static inline void |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
70 | pidgin_color_chooser_set_rgb(GtkColorChooser *chooser, const GdkColor *rgb) |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
71 | { |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
72 | GdkRGBA rgba; |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
73 | |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
74 | rgba.red = rgb->red / 65535.0; |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
75 | rgba.green = rgb->green / 65535.0; |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
76 | rgba.blue = rgb->blue / 65535.0; |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
77 | rgba.alpha = 1.0; |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
78 | |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
79 | gtk_color_chooser_set_rgba(chooser, &rgba); |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
80 | } |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
81 | |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
82 | static inline void |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
83 | pidgin_color_chooser_get_rgb(GtkColorChooser *chooser, GdkColor *rgb) |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
84 | { |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
85 | GdkRGBA rgba; |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
86 | |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
87 | gtk_color_chooser_get_rgba(chooser, &rgba); |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
88 | rgb->red = (int)round(rgba.red * 65535.0); |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
89 | rgb->green = (int)round(rgba.green * 65535.0); |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
90 | rgb->blue = (int)round(rgba.blue * 65535.0); |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
91 | } |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
92 | |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
93 | #endif /* 3.4.0 and gtk_color_chooser_ */ |
|
561418a41b08
Replace gtk_color_selection with gtk_color_chooser
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35542
diff
changeset
|
94 | |
|
35534
8e72593def2c
Fix gtk_[hv]box_new gtk3 deprecation warnings in unity plugin
Ankit Vani <a@nevitus.org>
parents:
35532
diff
changeset
|
95 | |
|
33275
8da9d2ec671d
Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33268
diff
changeset
|
96 | #if !GTK_CHECK_VERSION(3,2,0) |
|
8da9d2ec671d
Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33268
diff
changeset
|
97 | |
|
8da9d2ec671d
Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33268
diff
changeset
|
98 | #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
|
99 | #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
|
100 | #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
|
101 | |
|
33892
ef97228bc5f0
Fix most of warnings for gtk2 and linux
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33683
diff
changeset
|
102 | 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
|
103 | GtkWindow *parent) |
|
ef97228bc5f0
Fix most of warnings for gtk2 and linux
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33683
diff
changeset
|
104 | { |
|
ef97228bc5f0
Fix most of warnings for gtk2 and linux
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33683
diff
changeset
|
105 | 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
|
106 | } |
|
ef97228bc5f0
Fix most of warnings for gtk2 and linux
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33683
diff
changeset
|
107 | |
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
108 | #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
|
109 | |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
110 | #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
|
111 | #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
|
112 | |
|
33523
fce9167b25c2
Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33277
diff
changeset
|
113 | #ifdef GDK_WINDOWING_X11 |
|
fce9167b25c2
Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33277
diff
changeset
|
114 | #define GDK_IS_X11_WINDOW(window) TRUE |
|
fce9167b25c2
Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33277
diff
changeset
|
115 | #endif |
|
fce9167b25c2
Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33277
diff
changeset
|
116 | #ifdef GDK_WINDOWING_WIN32 |
|
fce9167b25c2
Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33277
diff
changeset
|
117 | #define GDK_IS_WIN32_WINDOW(window) TRUE |
|
fce9167b25c2
Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33277
diff
changeset
|
118 | #endif |
|
fce9167b25c2
Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33277
diff
changeset
|
119 | #ifdef GDK_WINDOWING_QUARTZ |
|
fce9167b25c2
Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33277
diff
changeset
|
120 | #define GDK_IS_QUARTZ_WINDOW(window) TRUE |
|
fce9167b25c2
Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33277
diff
changeset
|
121 | #endif |
|
fce9167b25c2
Fix compilation on GTK2
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33277
diff
changeset
|
122 | |
|
35542
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
123 | static inline GdkPixbuf * |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
124 | gdk_pixbuf_get_from_surface(cairo_surface_t *surface, gint src_x, gint src_y, |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
125 | gint width, gint height) |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
126 | { |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
127 | GdkPixmap *pixmap; |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
128 | GdkPixbuf *pixbuf; |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
129 | cairo_t *cr; |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
130 | |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
131 | pixmap = gdk_pixmap_new(NULL, width, height, 24); |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
132 | |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
133 | cr = gdk_cairo_create(pixmap); |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
134 | cairo_set_source_surface(cr, surface, -src_x, -src_y); |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
135 | cairo_paint(cr); |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
136 | cairo_destroy(cr); |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
137 | |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
138 | pixbuf = gdk_pixbuf_get_from_drawable(NULL, pixmap, |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
139 | gdk_drawable_get_colormap(pixmap), 0, 0, 0, 0, width, height); |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
140 | |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
141 | g_object_unref(pixmap); |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
142 | |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
143 | return pixbuf; |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
144 | } |
|
53d0fee7c971
Fix whiteboard to work on both gtk2 and gtk3
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35534
diff
changeset
|
145 | |
|
35526
ed1be305c985
Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
146 | static inline GtkWidget * |
|
ed1be305c985
Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
147 | 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
|
148 | { |
|
ed1be305c985
Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
149 | 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
|
150 | orientation == GTK_ORIENTATION_VERTICAL, NULL); |
|
ed1be305c985
Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
151 | |
|
ed1be305c985
Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
152 | if (orientation == GTK_ORIENTATION_HORIZONTAL) |
|
ed1be305c985
Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
153 | return gtk_hbox_new(FALSE, spacing); |
|
ed1be305c985
Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
154 | else /* GTK_ORIENTATION_VERTICAL */ |
|
ed1be305c985
Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
155 | return gtk_vbox_new(FALSE, spacing); |
|
ed1be305c985
Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
156 | } |
|
ed1be305c985
Fix gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35487
diff
changeset
|
157 | |
|
35528
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
158 | static inline GtkWidget * |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
159 | gtk_separator_new(GtkOrientation orientation) |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
160 | { |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
161 | 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
|
162 | orientation == GTK_ORIENTATION_VERTICAL, NULL); |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
163 | |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
164 | if (orientation == GTK_ORIENTATION_HORIZONTAL) |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
165 | return gtk_hseparator_new(); |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
166 | else /* GTK_ORIENTATION_VERTICAL */ |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
167 | return gtk_vseparator_new(); |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
168 | } |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
169 | |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
170 | static inline GtkWidget * |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
171 | gtk_button_box_new(GtkOrientation orientation) |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
172 | { |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
173 | 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
|
174 | orientation == GTK_ORIENTATION_VERTICAL, NULL); |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
175 | |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
176 | if (orientation == GTK_ORIENTATION_HORIZONTAL) |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
177 | return gtk_hbutton_box_new(); |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
178 | else /* GTK_ORIENTATION_VERTICAL */ |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
179 | return gtk_vbutton_box_new(); |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
180 | } |
|
e04ba70092e9
Fix the rest of [hv] gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35526
diff
changeset
|
181 | |
| 35530 | 182 | static inline GtkWidget * |
| 183 | gtk_paned_new(GtkOrientation orientation) | |
| 184 | { | |
| 185 | g_return_val_if_fail(orientation == GTK_ORIENTATION_HORIZONTAL || | |
| 186 | orientation == GTK_ORIENTATION_VERTICAL, NULL); | |
| 187 | ||
| 188 | if (orientation == GTK_ORIENTATION_HORIZONTAL) | |
| 189 | return gtk_hpaned_new(); | |
| 190 | else /* GTK_ORIENTATION_VERTICAL */ | |
| 191 | return gtk_vpaned_new(); | |
| 192 | } | |
| 193 | ||
|
35532
2c802bb77720
Fix most of warnings for gtk 3.4
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35530
diff
changeset
|
194 | static inline GtkWidget * |
|
2c802bb77720
Fix most of warnings for gtk 3.4
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35530
diff
changeset
|
195 | gtk_scale_new_with_range(GtkOrientation orientation, gdouble min, gdouble max, |
|
2c802bb77720
Fix most of warnings for gtk 3.4
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35530
diff
changeset
|
196 | gdouble step) |
|
2c802bb77720
Fix most of warnings for gtk 3.4
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35530
diff
changeset
|
197 | { |
|
2c802bb77720
Fix most of warnings for gtk 3.4
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35530
diff
changeset
|
198 | g_return_val_if_fail(orientation == GTK_ORIENTATION_HORIZONTAL || |
|
2c802bb77720
Fix most of warnings for gtk 3.4
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35530
diff
changeset
|
199 | orientation == GTK_ORIENTATION_VERTICAL, NULL); |
|
2c802bb77720
Fix most of warnings for gtk 3.4
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35530
diff
changeset
|
200 | |
|
2c802bb77720
Fix most of warnings for gtk 3.4
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35530
diff
changeset
|
201 | if (orientation == GTK_ORIENTATION_HORIZONTAL) |
|
2c802bb77720
Fix most of warnings for gtk 3.4
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35530
diff
changeset
|
202 | return gtk_hscale_new_with_range(min, max, step); |
|
2c802bb77720
Fix most of warnings for gtk 3.4
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35530
diff
changeset
|
203 | else /* GTK_ORIENTATION_VERTICAL */ |
|
2c802bb77720
Fix most of warnings for gtk 3.4
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35530
diff
changeset
|
204 | return gtk_vscale_new_with_range(min, max, step); |
|
2c802bb77720
Fix most of warnings for gtk 3.4
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35530
diff
changeset
|
205 | } |
|
2c802bb77720
Fix most of warnings for gtk 3.4
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35530
diff
changeset
|
206 | |
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
207 | #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
|
208 | |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
209 | #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
|
210 | #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
|
211 | #define GtkComboBoxText GtkComboBox |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
212 | #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
|
213 | #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
|
214 | #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
|
215 | #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
|
216 | #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
|
217 | #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
|
218 | |
|
33179
49992d98f392
Fix fallback function inlining.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
219 | 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
|
220 | { |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
221 | gint w; |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
222 | 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
|
223 | return w; |
|
33185
6e5188b4f928
Remove some sneaky trailing whitespace.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33180
diff
changeset
|
224 | } |
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
225 | |
|
33179
49992d98f392
Fix fallback function inlining.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
226 | 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
|
227 | { |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
228 | gint h; |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
229 | 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
|
230 | return h; |
|
33185
6e5188b4f928
Remove some sneaky trailing whitespace.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33180
diff
changeset
|
231 | } |
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
232 | |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
233 | #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
|
234 | |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
235 | #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
|
236 | #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
|
237 | #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
|
238 | #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
|
239 | |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
240 | #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
|
241 | |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
242 | #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
|
243 | #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
|
244 | if (y) \ |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
245 | 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
|
246 | else \ |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
247 | 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
|
248 | } while(0) |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
249 | #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
|
250 | #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
|
251 | if (y) \ |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
252 | 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
|
253 | else \ |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
254 | 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
|
255 | } while(0) |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
256 | |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
257 | #endif /* 2.20.0 */ |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
258 | |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
259 | #endif /* 2.22.0 */ |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
260 | |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
261 | #endif /* 2.24.0 */ |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
262 | |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
263 | #endif /* 3.0.0 */ |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
264 | |
|
33275
8da9d2ec671d
Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33268
diff
changeset
|
265 | #endif /* 3.2.0 */ |
|
8da9d2ec671d
Use new GtkFontChooser where available.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33268
diff
changeset
|
266 | |
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
267 | #endif /* _PIDGINGTK3COMPAT_H_ */ |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
268 |