4 * Copyright (c) Tuomo Valkonen 1999-2006.
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>
21 INTRSTRUCT(WMenuEntry);
23 #define WMENUENTRY_SUBMENU 0x0001
25 DECLSTRUCT(WMenuEntry){
39 int n_entries, selected_entry;
40 int first_entry, vis_entries;
41 int max_entry_w, entry_h, entry_spacing;
51 uint gm_kcb, gm_state;
55 INTRSTRUCT(WMenuCreateParams);
57 DECLSTRUCT(WMenuCreateParams){
68 extern WMenu *create_menu(WWindow *par, const WFitParams *fp,
69 const WMenuCreateParams *params);
70 extern bool menu_init(WMenu *menu, WWindow *par, const WFitParams *fp,
71 const WMenuCreateParams *params);
72 extern void menu_deinit(WMenu *menu);
74 extern bool menu_fitrep(WMenu *menu, WWindow *par, const WFitParams *fp);
76 extern void menu_finish(WMenu *menu);
77 extern void menu_cancel(WMenu *menu);
78 extern bool menu_rqclose(WMenu *menu);
79 extern void menu_updategr(WMenu *menu);
81 extern int menu_entry_at_root(WMenu *menu, int root_x, int root_y);
82 extern void menu_release(WMenu *menu, XButtonEvent *ev);
83 extern void menu_motion(WMenu *menu, XMotionEvent *ev, int dx, int dy);
84 extern void menu_button(WMenu *menu, XButtonEvent *ev);
85 extern int menu_press(WMenu *menu, XButtonEvent *ev, WRegion **reg_ret);
87 extern void mod_menu_set_scroll_params(int delay, int amount);
89 extern void menu_typeahead_clear(WMenu *menu);
91 extern void menu_select_nth(WMenu *menu, int n);
92 extern void menu_select_prev(WMenu *menu);
93 extern void menu_select_next(WMenu *menu);
95 #endif /* ION_MOD_MENU_MENU_H */