1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 popup.h for the Openbox window manager
4 Copyright (c) 2003 Ben Jansens
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 See the COPYING file for a copy of the GNU General Public License.
23 #include "render/render.h"
28 #define POPUP_WIDTH 320
29 #define POPUP_HEIGHT 48
31 typedef struct _ObPopup ObPopup
;
32 typedef struct _ObIconPopup ObIconPopup
;
33 typedef struct _ObPagerPopup ObPagerPopup
;
52 void (*draw_icon
)(gint x
, gint y
, gint w
, gint h
, gpointer data
);
53 gpointer draw_icon_data
;
71 RrAppearance
*hilight
;
72 RrAppearance
*unhilight
;
75 ObPopup
*popup_new(gboolean hasicon
);
76 void popup_free(ObPopup
*self
);
78 /*! Position the popup. The gravity rules are not the same X uses for windows,
79 instead of the position being the top-left of the window, the gravity
80 specifies which corner of the popup will be placed at the given coords.
81 Static and Forget gravity are equivilent to NorthWest.
83 void popup_position(ObPopup
*self
, gint gravity
, gint x
, gint y
);
84 /*! Set the sizes for the popup. When set to 0, the size will be based on
86 void popup_size(ObPopup
*self
, gint w
, gint h
);
87 void popup_size_to_string(ObPopup
*self
, gchar
*text
);
89 void popup_set_text_align(ObPopup
*self
, RrJustify align
);
91 void popup_show(ObPopup
*self
, gchar
*text
);
92 void popup_hide(ObPopup
*self
);
94 RrAppearance
*popup_icon_appearance(ObPopup
*self
);
97 ObIconPopup
*icon_popup_new();
98 void icon_popup_free(ObIconPopup
*self
);
100 void icon_popup_show(ObIconPopup
*self
,
101 gchar
*text
, struct _ObClientIcon
*icon
);
102 #define icon_popup_hide(p) popup_hide((p)->popup)
103 #define icon_popup_position(p, g, x, y) popup_position((p)->popup,(g),(x),(y))
104 #define icon_popup_size(p, w, h) popup_size((p)->popup,(w),(h))
105 #define icon_popup_size_to_string(p, s) popup_size_to_string((p)->popup,(s))
106 #define icon_popup_set_text_align(p, j) popup_set_text_align((p)->popup,(j))
108 ObPagerPopup
*pager_popup_new();
109 void pager_popup_free(ObPagerPopup
*self
);
111 void pager_popup_show(ObPagerPopup
*self
, gchar
*text
, guint desk
);
112 #define pager_popup_hide(p) popup_hide((p)->popup)
113 #define pager_popup_position(p, g, x, y) popup_position((p)->popup,(g),(x),(y))
114 #define pager_popup_size(p, w, h) popup_size((p)->popup,(w),(h))
115 #define pager_popup_size_to_string(p, s) popup_size_to_string((p)->popup,(s))
116 #define pager_popup_set_text_align(p, j) popup_set_text_align((p)->popup,(j))