2 * Copyright (c) 2004 Massachusetts Institute of Technology
\r
4 * Permission is hereby granted, free of charge, to any person
\r
5 * obtaining a copy of this software and associated documentation
\r
6 * files (the "Software"), to deal in the Software without
\r
7 * restriction, including without limitation the rights to use, copy,
\r
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
\r
9 * of the Software, and to permit persons to whom the Software is
\r
10 * furnished to do so, subject to the following conditions:
\r
12 * The above copyright notice and this permission notice shall be
\r
13 * included in all copies or substantial portions of the Software.
\r
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
\r
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
\r
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
\r
27 #ifndef __KHIMAIRA_MAINMENU_H
\r
28 #define __KHIMAIRA_MAINMENU_H
\r
30 extern HWND khui_main_menu_toolbar;
\r
32 #define MENU_ACTIVATE_DEFAULT -1
\r
33 #define MENU_ACTIVATE_LEFT -2
\r
34 #define MENU_ACTIVATE_RIGHT -3
\r
35 #define MENU_ACTIVATE_NONE -4
\r
37 extern int mm_last_hot_item;
\r
38 extern BOOL mm_hot_track;
\r
40 void khm_menu_create_main(HWND rebar);
\r
41 LRESULT khm_menu_handle_select(WPARAM wParam, LPARAM lParam);
\r
42 LRESULT khm_menu_notify_main(LPNMHDR notice);
\r
43 LRESULT khm_menu_activate(int menu_id);
\r
44 void khm_menu_show_panel(int id, LONG x, LONG y);
\r
45 void khm_menu_track_current(void);
\r
46 LRESULT khm_menu_measure_item(WPARAM wParam, LPARAM lparam);
\r
47 LRESULT khm_menu_draw_item(WPARAM wParam, LPARAM lparam);
\r
49 static HMENU mm_create_menu_from_def(khui_menu_def * def);
\r
50 static void mm_show_panel_def(khui_menu_def * def, LONG x, LONG y);
\r
52 void khui_init_menu(void);
\r
53 void khui_exit_menu(void);
\r
55 #define MENU_SIZE_ICON_X 16
\r
56 #define MENU_SIZE_ICON_Y 16
\r