]> Pileus Git - ~andy/gtk/blob - gtk/gtkbubblewindow.h
Use gdk_threads_add_timeout to popup the selection window
[~andy/gtk] / gtk / gtkbubblewindow.h
1 /* GTK - The GIMP Toolkit
2  * Copyright © 2013 Carlos Garnacho <carlosg@gnome.org>
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_BUBBLE_WINDOW_H__
19 #define __GTK_BUBBLE_WINDOW_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
27 G_BEGIN_DECLS
28
29 #define GTK_TYPE_BUBBLE_WINDOW           (gtk_bubble_window_get_type ())
30 #define GTK_BUBBLE_WINDOW(o)             (G_TYPE_CHECK_INSTANCE_CAST ((o), GTK_TYPE_BUBBLE_WINDOW, GtkBubbleWindow))
31 #define GTK_BUBBLE_WINDOW_CLASS(c)       (G_TYPE_CHECK_CLASS_CAST ((c), GTK_TYPE_BUBBLE_WINDOW, GtkBubbleWindowClass))
32 #define GTK_IS_BUBBLE_WINDOW(o)          (G_TYPE_CHECK_INSTANCE_TYPE ((o), GTK_TYPE_BUBBLE_WINDOW))
33 #define GTK_IS_BUBBLE_WINDOW_CLASS(o)    (G_TYPE_CHECK_CLASS_TYPE ((o), GTK_TYPE_BUBBLE_WINDOW))
34 #define GTK_BUBBLE_WINDOW_GET_CLASS(o)   (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_BUBBLE_WINDOW, GtkBubbleWindowClass))
35
36 typedef struct _GtkBubbleWindow GtkBubbleWindow;
37 typedef struct _GtkBubbleWindowClass GtkBubbleWindowClass;
38
39 struct _GtkBubbleWindow
40 {
41   GtkWindow parent_instance;
42
43   /*< private >*/
44   gpointer _priv;
45 };
46
47 struct _GtkBubbleWindowClass
48 {
49   GtkWindowClass parent_class;
50 };
51
52 GType       gtk_bubble_window_get_type       (void) G_GNUC_CONST;
53
54 GtkWidget * gtk_bubble_window_new            (void);
55
56 void        gtk_bubble_window_set_relative_to (GtkBubbleWindow *window,
57                                                GdkWindow       *relative_to);
58 GdkWindow * gtk_bubble_window_get_relative_to (GtkBubbleWindow *window);
59
60 void        gtk_bubble_window_set_pointing_to (GtkBubbleWindow       *window,
61                                                cairo_rectangle_int_t *rect);
62 gboolean    gtk_bubble_window_get_pointing_to (GtkBubbleWindow       *window,
63                                                cairo_rectangle_int_t *rect);
64 void        gtk_bubble_window_set_position    (GtkBubbleWindow       *window,
65                                                GtkPositionType        position);
66
67 GtkPositionType
68             gtk_bubble_window_get_position    (GtkBubbleWindow       *window);
69
70 void        gtk_bubble_window_popup           (GtkBubbleWindow       *window,
71                                                GdkWindow             *relative_to,
72                                                cairo_rectangle_int_t *pointing_to,
73                                                GtkPositionType        position);
74
75 void        gtk_bubble_window_popdown         (GtkBubbleWindow       *window);
76
77 gboolean    gtk_bubble_window_grab            (GtkBubbleWindow       *window,
78                                                GdkDevice             *device,
79                                                guint32                activate_time);
80
81 void        gtk_bubble_window_ungrab          (GtkBubbleWindow       *window);
82
83 G_END_DECLS
84
85 #endif /* __GTK_BUBBLE_POPUP_H__ */