summaryrefslogtreecommitdiff
path: root/openbox/menu.h
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-04-15 18:29:55 +0000
committerDana Jansens <danakj@orodu.net>2003-04-15 18:29:55 +0000
commit0e28a07e3d6677aa6af9ad97fbc55f8101f3fdf2 (patch)
treee180e7b7162d9d75e7e307bd236784730547cf74 /openbox/menu.h
parent1c3689d0c725202eba7191d32480aa2cc3addfea (diff)
start of showing/rendering menus. woot!
Diffstat (limited to 'openbox/menu.h')
-rw-r--r--openbox/menu.h41
1 files changed, 32 insertions, 9 deletions
diff --git a/openbox/menu.h b/openbox/menu.h
index b3e712c3..bbc9fe81 100644
--- a/openbox/menu.h
+++ b/openbox/menu.h
@@ -2,6 +2,8 @@
#define __menu_h
#include "action.h"
+#include "render/render.h"
+
#include <glib.h>
typedef struct Menu {
@@ -14,6 +16,7 @@ typedef struct Menu {
/* ? */
gboolean shown;
gboolean invalid;
+ gpointer render_data; /* where the engine can store anything it likes */
struct Menu *parent;
@@ -25,6 +28,16 @@ typedef struct Menu {
void (*selected)( /* some bummu */);
} Menu;
+typedef struct MenuRenderData {
+ Window frame;
+ Window title;
+ Appearance *a_title;
+ int title_min_w, title_h;
+ Window items;
+ Appearance *a_items;
+ int item_h;
+} MenuRenderData;
+
typedef enum MenuEntryRenderType {
MenuEntryRenderType_None = 0,
MenuEntryRenderType_Submenu = 1 << 0,
@@ -34,12 +47,11 @@ typedef enum MenuEntryRenderType {
MenuEntryRenderType_Other = 1 << 7
} MenuEntryRenderType;
-
typedef struct {
char *label;
Menu *parent;
- Action action;
+ Action *action;
MenuEntryRenderType render_type;
gboolean enabled;
@@ -49,17 +61,28 @@ typedef struct {
Menu *submenu;
} MenuEntry;
-Menu *menu_new(const char *label, const char *name, Menu *parent);
-void menu_free(const char *name);
+typedef struct MenuEntryRenderData {
+ Window item;
+ Appearance *a_item;
+ int min_w;
+} MenuEntryRenderData;
+
+void menu_startup();
+void menu_shutdown();
+
+Menu *menu_new(char *label, char *name, Menu *parent);
+void menu_free(char *name);
+
+void menu_show(char *name, int x, int y, Client *client);
-MenuEntry *menu_entry_new_full(const char *label, Action *action,
- const MenuEntryRenderType render_type,
- gpointer render_data, gpointer submenu);
+MenuEntry *menu_entry_new_full(char *label, Action *action,
+ MenuEntryRenderType render_type,
+ gpointer submenu);
#define menu_entry_new(label, action) \
- menu_entry_new(label, action, MenuEntryRenderType_None, NULL, NULL)
+ menu_entry_new_full(label, action, MenuEntryRenderType_None, NULL)
-void menu_entry_free(const MenuEntry *entry);
+void menu_entry_free(MenuEntry *entry);
void menu_entry_set_submenu(MenuEntry *entry, Menu *submenu);