summaryrefslogtreecommitdiff
path: root/navit/menu.h
diff options
context:
space:
mode:
Diffstat (limited to 'navit/menu.h')
-rw-r--r--navit/menu.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/navit/menu.h b/navit/menu.h
new file mode 100644
index 000000000..a3841943f
--- /dev/null
+++ b/navit/menu.h
@@ -0,0 +1,30 @@
+#ifndef NAVIT_MENU_H
+#define NAVIT_MENU_H
+
+enum menu_type {
+ menu_type_submenu,
+ menu_type_menu,
+ menu_type_toggle,
+};
+
+struct container;
+struct menu;
+struct callback;
+
+struct menu_methods {
+ struct menu_priv *(*add)(struct menu_priv *menu, struct menu_methods *meth, char *name, enum menu_type type, struct callback *cb);
+ void (*set_toggle)(struct menu_priv *menu, int active);
+ int (*get_toggle)(struct menu_priv *menu);
+ void (*popup)(struct menu_priv *menu);
+};
+
+struct menu {
+ struct menu_priv *priv;
+ struct menu_methods meth;
+};
+
+/* prototypes */
+struct menu *menu_add(struct menu *menu, char *name, enum menu_type type, struct callback *cb);
+void menu_popup(struct menu *menu);
+/* end of prototypes */
+#endif