diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-09-12 06:00:17 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-09-12 06:00:17 +0000 |
| commit | 4be58bf13719fd22cb08a7f016eaf757640ccd05 (patch) | |
| tree | 8b87853b47d7084f2751f9f3c5aca02103512807 /openbox/popup.h | |
| parent | 5d658c98e2ce6aa00f0236b3dedfc6ff0c2041ca (diff) | |
new popups with subclasses, added an ObIconPopup for popups with icons, and ObPagerPopup, for a popup with a pager on it.
better logic also for the desktop layout code figuring out how many rows and columns there are.
Diffstat (limited to 'openbox/popup.h')
| -rw-r--r-- | openbox/popup.h | 87 |
1 files changed, 77 insertions, 10 deletions
diff --git a/openbox/popup.h b/openbox/popup.h index e06217ea..31bca5b6 100644 --- a/openbox/popup.h +++ b/openbox/popup.h @@ -1,33 +1,100 @@ #ifndef __popup_h #define __popup_h -#include <glib.h> +#include "window.h" #include "render/render.h" +#include <glib.h> struct _ObClientIcon; #define POPUP_WIDTH 320 #define POPUP_HEIGHT 48 -typedef struct _ObPopup Popup; +typedef struct _ObPopup ObPopup; +typedef struct _ObIconPopup ObIconPopup; +typedef struct _ObPagerPopup ObPagerPopup; + +struct _ObPopup +{ + ObWindow obwin; + Window bg; + + Window text; + + gboolean hasicon; + RrAppearance *a_bg; + RrAppearance *a_text; + gint gravity; + gint x; + gint y; + gint w; + gint h; + gboolean mapped; + + void (*draw_icon)(gint x, gint y, gint w, gint h, gpointer data); + gpointer draw_icon_data; +}; + +struct _ObIconPopup +{ + ObPopup *popup; + + Window icon; + RrAppearance *a_icon; +}; + +struct _ObPagerPopup +{ + ObPopup *popup; -Popup *popup_new(gboolean hasicon); -void popup_free(Popup *self); + guint desks; + guint curdesk; + Window *wins; + RrAppearance *hilight; + RrAppearance *unhilight; +}; + +ObPopup *popup_new(gboolean hasicon); +void popup_free(ObPopup *self); /*! Position the popup. The gravity rules are not the same X uses for windows, instead of the position being the top-left of the window, the gravity specifies which corner of the popup will be placed at the given coords. Static and Forget gravity are equivilent to NorthWest. */ -void popup_position(Popup *self, gint gravity, gint x, gint y); +void popup_position(ObPopup *self, gint gravity, gint x, gint y); /*! Set the sizes for the popup. When set to 0, the size will be based on the text size. */ -void popup_size(Popup *self, gint w, gint h); -void popup_size_to_string(Popup *self, gchar *text); +void popup_size(ObPopup *self, gint w, gint h); +void popup_size_to_string(ObPopup *self, gchar *text); + +void popup_set_text_align(ObPopup *self, RrJustify align); + +void popup_show(ObPopup *self, gchar *text); +void popup_hide(ObPopup *self); + +RrAppearance *popup_icon_appearance(ObPopup *self); + + +ObIconPopup *icon_popup_new(); +void icon_popup_free(ObIconPopup *self); + +void icon_popup_show(ObIconPopup *self, + gchar *text, struct _ObClientIcon *icon); +#define icon_popup_hide(p) popup_hide((p)->popup) +#define icon_popup_position(p, g, x, y) popup_position((p)->popup,(g),(x),(y)) +#define icon_popup_size(p, w, h) popup_size((p)->popup,(w),(h)) +#define icon_popup_size_to_string(p, s) popup_size_to_string((p)->popup,(s)) +#define icon_popup_set_text_align(p, j) popup_set_text_align((p)->popup,(j)) -void popup_set_text_align(Popup *self, RrJustify align); +ObPagerPopup *pager_popup_new(); +void pager_popup_free(ObPagerPopup *self); -void popup_show(Popup *self, gchar *text, struct _ObClientIcon *icon); -void popup_hide(Popup *self); +void pager_popup_show(ObPagerPopup *self, gchar *text, guint desk); +#define pager_popup_hide(p) popup_hide((p)->popup) +#define pager_popup_position(p, g, x, y) popup_position((p)->popup,(g),(x),(y)) +#define pager_popup_size(p, w, h) popup_size((p)->popup,(w),(h)) +#define pager_popup_size_to_string(p, s) popup_size_to_string((p)->popup,(s)) +#define pager_popup_set_text_align(p, j) popup_set_text_align((p)->popup,(j)) #endif |
