1/* GTK - The GIMP Toolkit
2 * Copyright © 2013 Carlos Garnacho <[email protected]>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __GTK_POPOVER_H__
19#define __GTK_POPOVER_H__
20
21#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
22#error "Only <gtk/gtk.h> can be included directly."
23#endif
24
25#include <gtk/gtkwindow.h>
26
27G_BEGIN_DECLS
28
29#define GTK_TYPE_POPOVER (gtk_popover_get_type ())
30#define GTK_POPOVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_POPOVER, GtkPopover))
31#define GTK_POPOVER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GTK_TYPE_POPOVER, GtkPopoverClass))
32#define GTK_IS_POPOVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_POPOVER))
33#define GTK_IS_POPOVER_CLASS(o) (G_TYPE_CHECK_CLASS_TYPE ((o), GTK_TYPE_POPOVER))
34#define GTK_POPOVER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_POPOVER, GtkPopoverClass))
35
36typedef struct _GtkPopover GtkPopover;
37typedef struct _GtkPopoverClass GtkPopoverClass;
38typedef struct _GtkPopoverPrivate GtkPopoverPrivate;
39
40struct _GtkPopover
41{
42 GtkBin parent_instance;
43
44 /*< private >*/
45
46 GtkPopoverPrivate *priv;
47};
48
49struct _GtkPopoverClass
50{
51 GtkBinClass parent_class;
52
53 void (* closed) (GtkPopover *popover);
54
55 /*< private >*/
56
57 /* Padding for future expansion */
58 gpointer reserved[10];
59};
60
61GDK_AVAILABLE_IN_3_12
62GType gtk_popover_get_type (void) G_GNUC_CONST;
63
64GDK_AVAILABLE_IN_3_12
65GtkWidget * gtk_popover_new (GtkWidget *relative_to);
66
67GDK_AVAILABLE_IN_3_12
68GtkWidget * gtk_popover_new_from_model (GtkWidget *relative_to,
69 GMenuModel *model);
70
71GDK_AVAILABLE_IN_3_12
72void gtk_popover_set_relative_to (GtkPopover *popover,
73 GtkWidget *relative_to);
74GDK_AVAILABLE_IN_3_12
75GtkWidget * gtk_popover_get_relative_to (GtkPopover *popover);
76
77GDK_AVAILABLE_IN_3_12
78void gtk_popover_set_pointing_to (GtkPopover *popover,
79 const GdkRectangle *rect);
80GDK_AVAILABLE_IN_3_12
81gboolean gtk_popover_get_pointing_to (GtkPopover *popover,
82 GdkRectangle *rect);
83GDK_AVAILABLE_IN_3_12
84void gtk_popover_set_position (GtkPopover *popover,
85 GtkPositionType position);
86GDK_AVAILABLE_IN_3_12
87GtkPositionType gtk_popover_get_position (GtkPopover *popover);
88
89GDK_AVAILABLE_IN_3_12
90void gtk_popover_set_modal (GtkPopover *popover,
91 gboolean modal);
92GDK_AVAILABLE_IN_3_12
93gboolean gtk_popover_get_modal (GtkPopover *popover);
94
95GDK_AVAILABLE_IN_3_12
96void gtk_popover_bind_model (GtkPopover *popover,
97 GMenuModel *model,
98 const gchar *action_namespace);
99
100GDK_DEPRECATED_IN_3_22
101void gtk_popover_set_transitions_enabled (GtkPopover *popover,
102 gboolean transitions_enabled);
103GDK_DEPRECATED_IN_3_22
104gboolean gtk_popover_get_transitions_enabled (GtkPopover *popover);
105
106GDK_AVAILABLE_IN_3_18
107void gtk_popover_set_default_widget (GtkPopover *popover,
108 GtkWidget *widget);
109GDK_AVAILABLE_IN_3_18
110GtkWidget * gtk_popover_get_default_widget (GtkPopover *popover);
111
112GDK_AVAILABLE_IN_3_20
113void gtk_popover_set_constrain_to (GtkPopover *popover,
114 GtkPopoverConstraint constraint);
115
116GDK_AVAILABLE_IN_3_20
117GtkPopoverConstraint gtk_popover_get_constrain_to (GtkPopover *popover);
118
119GDK_AVAILABLE_IN_3_22
120void gtk_popover_popup (GtkPopover *popover);
121
122GDK_AVAILABLE_IN_3_22
123void gtk_popover_popdown (GtkPopover *popover);
124
125
126G_END_DECLS
127
128#endif /* __GTK_POPOVER_H__ */
129