System call sys_getchar () was improved; stdin is correspond with 0. fd and stdout...
[ZeXOS.git] / apps / wm / menu.h
blob350820488088bf5489e963773ceebb39682a6995
1 /*
2 * ZeX/OS
3 * Copyright (C) 2007 Tomas 'ZeXx86' Jedrzejek (zexx86@gmail.com)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _MENU_H
21 #define _MENU_H
23 #define MENU_FLAG_SHOW 0x1
24 #define MENU_FLAG_DISABLED 0x2
26 #define MENUITEM_FLAG_MOUSE 0x1
27 #define MENUITEM_FLAG_CLICKED 0x2
29 typedef unsigned (wmmenu_handler) ();
31 typedef struct wmmenuitem_context {
32 struct wmmenuitem_context *next, *prev;
34 wmmenu_handler *handler;
35 unsigned char flags;
36 char *caption;
37 } wmmenuitem;
39 typedef struct wmmenu_context {
40 struct wmmenu_context *next, *prev;
42 wmmenuitem item_list;
43 unsigned x;
44 unsigned y;
45 unsigned size_x;
46 unsigned size_y;
47 unsigned char flags;
48 char *caption;
49 } wmmenu;
51 /* externs */
52 extern wmmenu *menu_create (unsigned x, unsigned y, const char *caption);
53 extern wmmenuitem *menu_additem (wmmenu *menu, const char *caption, wmmenu_handler *handler);
54 extern unsigned char menuitem_flags (wmmenuitem *item);
55 extern unsigned menu_draw_all ();
56 extern unsigned menu_show (wmmenu *menu);
57 extern unsigned init_menu ();
59 #endif