4 * Copyright (c) Tuomo Valkonen 1999-2007.
6 * Ion is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
12 #ifndef ION_MOD_MENU_MENU_H
13 #define ION_MOD_MENU_MENU_H
15 #include <ioncore/common.h>
16 #include <ioncore/window.h>
17 #include <ioncore/gr.h>
18 #include <ioncore/rectangle.h>
19 #include <ioncore/binding.h>
22 INTRSTRUCT(WMenuEntry);
24 #define WMENUENTRY_SUBMENU 0x0001
26 DECLSTRUCT(WMenuEntry){
41 int n_entries, selected_entry;
42 int first_entry, vis_entries;
43 int max_entry_w, entry_h, entry_spacing;
53 uint gm_kcb, gm_state;
55 /*WBindmap *cycle_bindmap;*/
59 INTRSTRUCT(WMenuCreateParams);
61 DECLSTRUCT(WMenuCreateParams){
72 extern WMenu *create_menu(WWindow *par, const WFitParams *fp,
73 const WMenuCreateParams *params);
74 extern bool menu_init(WMenu *menu, WWindow *par, const WFitParams *fp,
75 const WMenuCreateParams *params);
76 extern void menu_deinit(WMenu *menu);
78 extern bool menu_fitrep(WMenu *menu, WWindow *par, const WFitParams *fp);
80 extern void menu_finish(WMenu *menu);
81 extern void menu_cancel(WMenu *menu);
82 extern bool menu_rqclose(WMenu *menu);
83 extern void menu_updategr(WMenu *menu);
85 extern int menu_entry_at_root(WMenu *menu, int root_x, int root_y);
86 extern void menu_release(WMenu *menu, XButtonEvent *ev);
87 extern void menu_motion(WMenu *menu, XMotionEvent *ev, int dx, int dy);
88 extern void menu_button(WMenu *menu, XButtonEvent *ev);
89 extern int menu_press(WMenu *menu, XButtonEvent *ev, WRegion **reg_ret);
91 extern void mod_menu_set_scroll_params(int delay, int amount);
93 extern void menu_typeahead_clear(WMenu *menu);
95 extern void menu_select_nth(WMenu *menu, int n);
96 extern void menu_select_prev(WMenu *menu);
97 extern void menu_select_next(WMenu *menu);
99 #endif /* ION_MOD_MENU_MENU_H */