* Cleanup, no functional change.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36305 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2010-04-15 17:05:20 +00:00
parent 5c4e7641a7
commit 7af231d838
+18 -5
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2005, Axel Dörfler, [email protected]. All rights reserved.
* Copyright 2004-2010, Axel Dörfler, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef KERNEL_BOOT_MENU_H
@@ -15,6 +15,7 @@ class MenuItem;
typedef bool (*menu_item_hook)(Menu *, MenuItem *);
enum menu_item_type {
MENU_ITEM_STANDARD = 1,
MENU_ITEM_MARKABLE,
@@ -23,9 +24,11 @@ enum menu_item_type {
MENU_ITEM_SEPARATOR,
};
class MenuItem : public DoublyLinkedListLinkImpl<MenuItem> {
public:
MenuItem(const char *label = NULL, Menu *subMenu = NULL);
MenuItem(const char* label = NULL,
Menu* subMenu = NULL);
~MenuItem();
void SetTarget(menu_item_hook target);
@@ -56,20 +59,24 @@ class MenuItem : public DoublyLinkedListLinkImpl<MenuItem> {
friend class Menu;
void SetMenu(Menu* menu);
private:
const char* fLabel;
menu_item_hook fTarget;
bool fIsMarked;
bool fIsSelected;
bool fIsEnabled;
menu_item_type fType;
Menu *fMenu, *fSubMenu;
Menu* fMenu;
Menu* fSubMenu;
const void* fData;
const char* fHelpText;
};
typedef DoublyLinkedList<MenuItem> MenuItemList;
typedef MenuItemList::Iterator MenuItemIterator;
enum menu_type {
MAIN_MENU = 1,
SAFE_MODE_MENU,
@@ -77,6 +84,7 @@ enum menu_type {
CHOICE_MENU,
};
class Menu {
public:
Menu(menu_type type, const char* title = NULL);
@@ -104,11 +112,14 @@ class Menu {
void RemoveItem(MenuItem* item);
MenuItem* Superitem() const { return fSuperItem; }
Menu *Supermenu() const { return fSuperItem ? fSuperItem->fMenu : NULL; }
Menu* Supermenu() const
{ return fSuperItem
? fSuperItem->fMenu : NULL; }
const char* Title() const { return fTitle; }
void SetChoiceText(const char *text) { fChoiceText = text; }
void SetChoiceText(const char* text)
{ fChoiceText = text; }
const char* ChoiceText() const { return fChoiceText; }
void Run();
@@ -117,6 +128,7 @@ class Menu {
friend class MenuItem;
void Draw(MenuItem* item);
private:
const char* fTitle;
const char* fChoiceText;
int32 fCount;
@@ -126,4 +138,5 @@ class Menu {
MenuItem* fSuperItem;
};
#endif /* KERNEL_BOOT_MENU_H */