xref: /haiku/src/system/boot/platform/efi/menu.cpp (revision 5e7964b0a929555415798dea3373db9ac4611caa)
1 /*
2  * Copyright 2016 Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include <boot/menu.h>
8 #include <boot/platform/generic/text_menu.h>
9 
10 #include "efi_platform.h"
11 #include "video.h"
12 
13 
14 void
15 platform_add_menus(Menu *menu)
16 {
17 	MenuItem *item;
18 
19 	switch (menu->Type()) {
20 		case MAIN_MENU:
21 			item = new(std::nothrow)MenuItem("Select video mode", video_mode_menu());
22 			if (item != NULL) {
23 				menu->AddItem(item);
24 				item->SetTarget(video_mode_hook);
25 				item->SetShortcut('v');
26 			}
27 
28 			break;
29 		default:
30 			break;
31 	}
32 }
33 
34 
35 void
36 platform_update_menu_item(Menu *menu, MenuItem *item)
37 {
38 	platform_generic_update_text_menu_item(menu, item);
39 }
40 
41 
42 void
43 platform_run_menu(Menu *menu)
44 {
45 	platform_generic_run_text_menu(menu);
46 }
47 
48 
49 size_t
50 platform_get_user_input_text(Menu *menu, MenuItem *item, char *buffer,
51 	size_t bufferSize)
52 {
53 	return platform_generic_get_user_input_text(menu, item, buffer,
54 		bufferSize);
55 }
56