Fri, 30 Aug 2019 02:17:50 -0400
Add compat functions for gtk_popover_pop*.
|
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 | |
|
38707
6f4d3ab2f2ed
Use gtk_menu_popup_at_pointer instead of gtk_menu_popup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
36 | #if !GTK_CHECK_VERSION(3,22,0) |
|
6f4d3ab2f2ed
Use gtk_menu_popup_at_pointer instead of gtk_menu_popup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
37 | |
|
6f4d3ab2f2ed
Use gtk_menu_popup_at_pointer instead of gtk_menu_popup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
38 | static inline void |
|
6f4d3ab2f2ed
Use gtk_menu_popup_at_pointer instead of gtk_menu_popup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
39 | gtk_menu_popup_at_pointer(GtkMenu *menu, const GdkEvent *trigger_event) |
|
6f4d3ab2f2ed
Use gtk_menu_popup_at_pointer instead of gtk_menu_popup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
40 | { |
|
6f4d3ab2f2ed
Use gtk_menu_popup_at_pointer instead of gtk_menu_popup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
41 | const GdkEventButton *event = (const GdkEventButton *)trigger_event; |
|
6f4d3ab2f2ed
Use gtk_menu_popup_at_pointer instead of gtk_menu_popup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
42 | gtk_menu_popup(menu, NULL, NULL, NULL, NULL, |
|
6f4d3ab2f2ed
Use gtk_menu_popup_at_pointer instead of gtk_menu_popup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
43 | event ? event->button : 0, gdk_event_get_time(event)); |
|
6f4d3ab2f2ed
Use gtk_menu_popup_at_pointer instead of gtk_menu_popup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
44 | } |
|
6f4d3ab2f2ed
Use gtk_menu_popup_at_pointer instead of gtk_menu_popup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
45 | |
|
39806
3b6df2e69797
Add compat functions for gtk_popover_pop*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39673
diff
changeset
|
46 | static inline void |
|
3b6df2e69797
Add compat functions for gtk_popover_pop*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39673
diff
changeset
|
47 | gtk_popover_popup(GtkPopover *popover) |
|
3b6df2e69797
Add compat functions for gtk_popover_pop*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39673
diff
changeset
|
48 | { |
|
3b6df2e69797
Add compat functions for gtk_popover_pop*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39673
diff
changeset
|
49 | gtk_widget_show(GTK_WIDGET(popover)); |
|
3b6df2e69797
Add compat functions for gtk_popover_pop*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39673
diff
changeset
|
50 | } |
|
3b6df2e69797
Add compat functions for gtk_popover_pop*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39673
diff
changeset
|
51 | |
|
3b6df2e69797
Add compat functions for gtk_popover_pop*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39673
diff
changeset
|
52 | static inline void |
|
3b6df2e69797
Add compat functions for gtk_popover_pop*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39673
diff
changeset
|
53 | gtk_popover_popdown(GtkPopover *popover) |
|
3b6df2e69797
Add compat functions for gtk_popover_pop*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39673
diff
changeset
|
54 | { |
|
3b6df2e69797
Add compat functions for gtk_popover_pop*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39673
diff
changeset
|
55 | gtk_widget_hide(GTK_WIDGET(popover)); |
|
3b6df2e69797
Add compat functions for gtk_popover_pop*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39673
diff
changeset
|
56 | } |
|
3b6df2e69797
Add compat functions for gtk_popover_pop*.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39673
diff
changeset
|
57 | |
|
38707
6f4d3ab2f2ed
Use gtk_menu_popup_at_pointer instead of gtk_menu_popup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
58 | #endif /* 3.22.0 */ |
|
6f4d3ab2f2ed
Use gtk_menu_popup_at_pointer instead of gtk_menu_popup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38007
diff
changeset
|
59 | |
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
60 | #endif /* _PIDGINGTK3COMPAT_H_ */ |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff
changeset
|
61 |