]> Dogcows Code - chaz/openbox/blob - openbox/popup.h
remove blank line
[chaz/openbox] / openbox / popup.h
1 #ifndef __popup_h
2 #define __popup_h
3
4 #include "window.h"
5 #include "render/render.h"
6 #include <glib.h>
7
8 struct _ObClientIcon;
9
10 #define POPUP_WIDTH 320
11 #define POPUP_HEIGHT 48
12
13 typedef struct _ObPopup ObPopup;
14 typedef struct _ObIconPopup ObIconPopup;
15 typedef struct _ObPagerPopup ObPagerPopup;
16
17 struct _ObPopup
18 {
19 ObWindow obwin;
20 Window bg;
21
22 Window text;
23
24 gboolean hasicon;
25 RrAppearance *a_bg;
26 RrAppearance *a_text;
27 gint gravity;
28 gint x;
29 gint y;
30 gint w;
31 gint h;
32 gboolean mapped;
33
34 void (*draw_icon)(gint x, gint y, gint w, gint h, gpointer data);
35 gpointer draw_icon_data;
36 };
37
38 struct _ObIconPopup
39 {
40 ObPopup *popup;
41
42 Window icon;
43 RrAppearance *a_icon;
44 };
45
46 struct _ObPagerPopup
47 {
48 ObPopup *popup;
49
50 guint desks;
51 guint curdesk;
52 Window *wins;
53 RrAppearance *hilight;
54 RrAppearance *unhilight;
55 };
56
57 ObPopup *popup_new(gboolean hasicon);
58 void popup_free(ObPopup *self);
59
60 /*! Position the popup. The gravity rules are not the same X uses for windows,
61 instead of the position being the top-left of the window, the gravity
62 specifies which corner of the popup will be placed at the given coords.
63 Static and Forget gravity are equivilent to NorthWest.
64 */
65 void popup_position(ObPopup *self, gint gravity, gint x, gint y);
66 /*! Set the sizes for the popup. When set to 0, the size will be based on
67 the text size. */
68 void popup_size(ObPopup *self, gint w, gint h);
69 void popup_size_to_string(ObPopup *self, gchar *text);
70
71 void popup_set_text_align(ObPopup *self, RrJustify align);
72
73 void popup_show(ObPopup *self, gchar *text);
74 void popup_hide(ObPopup *self);
75
76 RrAppearance *popup_icon_appearance(ObPopup *self);
77
78
79 ObIconPopup *icon_popup_new();
80 void icon_popup_free(ObIconPopup *self);
81
82 void icon_popup_show(ObIconPopup *self,
83 gchar *text, struct _ObClientIcon *icon);
84 #define icon_popup_hide(p) popup_hide((p)->popup)
85 #define icon_popup_position(p, g, x, y) popup_position((p)->popup,(g),(x),(y))
86 #define icon_popup_size(p, w, h) popup_size((p)->popup,(w),(h))
87 #define icon_popup_size_to_string(p, s) popup_size_to_string((p)->popup,(s))
88 #define icon_popup_set_text_align(p, j) popup_set_text_align((p)->popup,(j))
89
90 ObPagerPopup *pager_popup_new();
91 void pager_popup_free(ObPagerPopup *self);
92
93 void pager_popup_show(ObPagerPopup *self, gchar *text, guint desk);
94 #define pager_popup_hide(p) popup_hide((p)->popup)
95 #define pager_popup_position(p, g, x, y) popup_position((p)->popup,(g),(x),(y))
96 #define pager_popup_size(p, w, h) popup_size((p)->popup,(w),(h))
97 #define pager_popup_size_to_string(p, s) popup_size_to_string((p)->popup,(s))
98 #define pager_popup_set_text_align(p, j) popup_set_text_align((p)->popup,(j))
99
100 #endif
This page took 0.040308 seconds and 4 git commands to generate.