3#include <Foundation/Basics.h>
4#include <GuiFoundation/Action/Action.h>
7#define PL_REGISTER_ACTION_0(ActionName, Scope, CategoryName, ShortCut, ActionClass) \
8 plActionManager::RegisterAction(plActionDescriptor(plActionType::Action, Scope, ActionName, CategoryName, ShortCut, \
9 [](const plActionContext& context) -> plAction* { return PL_DEFAULT_NEW(ActionClass, context, ActionName); }));
12#define PL_REGISTER_ACTION_1(ActionName, Scope, CategoryName, ShortCut, ActionClass, Param1) \
13 plActionManager::RegisterAction(plActionDescriptor(plActionType::Action, Scope, ActionName, CategoryName, ShortCut, \
14 [](const plActionContext& context) -> plAction* { return PL_DEFAULT_NEW(ActionClass, context, ActionName, Param1); }));
17#define PL_REGISTER_ACTION_2(ActionName, Scope, CategoryName, ShortCut, ActionClass, Param1, Param2) \
18 plActionManager::RegisterAction(plActionDescriptor(plActionType::Action, Scope, ActionName, CategoryName, ShortCut, \
19 [](const plActionContext& context) -> plAction* { return PL_DEFAULT_NEW(ActionClass, context, ActionName, Param1, Param2); }));
22#define PL_REGISTER_DYNAMIC_MENU(ActionName, ActionClass, IconPath) \
23 plActionManager::RegisterAction(plActionDescriptor(plActionType::Menu, plActionScope::Default, ActionName, "", "", \
24 [](const plActionContext& context) -> plAction* { return PL_DEFAULT_NEW(ActionClass, context, ActionName, IconPath); }));
27#define PL_REGISTER_ACTION_AND_DYNAMIC_MENU_1(ActionName, Scope, CategoryName, ShortCut, ActionClass, Param1) \
28 plActionManager::RegisterAction(plActionDescriptor(plActionType::ActionAndMenu, Scope, ActionName, CategoryName, ShortCut, \
29 [](const plActionContext& context) -> plAction* { return PL_DEFAULT_NEW(ActionClass, context, ActionName, Param1); }));
32#define PL_REGISTER_MENU(ActionName) \
33 plActionManager::RegisterAction(plActionDescriptor(plActionType::Menu, plActionScope::Default, ActionName, "", "", \
34 [](const plActionContext& context) -> plAction* { return PL_DEFAULT_NEW(plMenuAction, context, ActionName, ""); }));
37#define PL_REGISTER_MENU_WITH_ICON(ActionName, IconPath) \
38 plActionManager::RegisterAction(plActionDescriptor(plActionType::Menu, plActionScope::Default, ActionName, "", "", \
39 [](const plActionContext& context) -> plAction* { return PL_DEFAULT_NEW(plMenuAction, context, ActionName, IconPath); }));
42#define PL_REGISTER_CATEGORY(CategoryName) \
43 plActionManager::RegisterAction(plActionDescriptor(plActionType::Category, plActionScope::Default, CategoryName, "", "", \
44 [](const plActionContext& context) -> plAction* { return PL_DEFAULT_NEW(plCategoryAction, context); }));
69 static plString FindActionCategory(
const char* szActionName);
87 static void SaveShortcutAssignment();
88 static void LoadShortcutAssignment();
108 PL_MAKE_SUBSYSTEM_STARTUP_FRIEND(GuiFoundation, ActionManager);
110 static void Startup();
111 static void Shutdown();
Handle for a plAction.
Definition Action.h:27
Stores 'actions' (things that can be triggered from UI).
Definition ActionManager.h:60
Definition HashTable.h:333
Const iterator.
Definition IdTable.h:25
plVariant is a class that can store different types of variables, which is useful in situations where...
Definition Variant.h:44
Definition ActionManager.h:93
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54