4 * Copyright (c) Tuomo Valkonen 1999-2009.
6 * See the included file LICENSE for details.
9 #ifndef ION_MOD_MENU_MENU_H
10 #define ION_MOD_MENU_MENU_H
12 #include <ioncore/common.h>
13 #include <ioncore/window.h>
14 #include <ioncore/gr.h>
15 #include <ioncore/rectangle.h>
16 #include <ioncore/binding.h>
19 INTRSTRUCT(WMenuEntry
);
21 #define WMENUENTRY_SUBMENU 0x0001
23 DECLSTRUCT(WMenuEntry
){
38 int n_entries
, selected_entry
;
39 int first_entry
, vis_entries
;
40 int max_entry_w
, entry_h
, entry_spacing
;
50 uint gm_kcb
, gm_state
;
52 /*WBindmap *cycle_bindmap;*/
56 INTRSTRUCT(WMenuCreateParams
);
58 DECLSTRUCT(WMenuCreateParams
){
69 extern WMenu
*create_menu(WWindow
*par
, const WFitParams
*fp
,
70 const WMenuCreateParams
*params
);
71 extern bool menu_init(WMenu
*menu
, WWindow
*par
, const WFitParams
*fp
,
72 const WMenuCreateParams
*params
);
73 extern void menu_deinit(WMenu
*menu
);
75 extern bool menu_fitrep(WMenu
*menu
, WWindow
*par
, const WFitParams
*fp
);
77 extern void menu_finish(WMenu
*menu
);
78 extern void menu_cancel(WMenu
*menu
);
79 extern bool menu_rqclose(WMenu
*menu
);
80 extern void menu_updategr(WMenu
*menu
);
82 extern int menu_entry_at_root(WMenu
*menu
, int root_x
, int root_y
);
83 extern void menu_release(WMenu
*menu
, XButtonEvent
*ev
);
84 extern void menu_motion(WMenu
*menu
, XMotionEvent
*ev
, int dx
, int dy
);
85 extern void menu_button(WMenu
*menu
, XButtonEvent
*ev
);
86 extern int menu_press(WMenu
*menu
, XButtonEvent
*ev
, WRegion
**reg_ret
);
88 extern void mod_menu_set_scroll_params(int delay
, int amount
);
90 extern void menu_typeahead_clear(WMenu
*menu
);
92 extern void menu_select_nth(WMenu
*menu
, int n
);
93 extern void menu_select_prev(WMenu
*menu
);
94 extern void menu_select_next(WMenu
*menu
);
96 #endif /* ION_MOD_MENU_MENU_H */