Horizon
Loading...
Searching...
No Matches
action_catalog.hpp
1#pragma once
2#include "action.hpp"
3#include "common/lut.hpp"
4#include <map>
5
6namespace horizon {
8public:
9 enum Availability {
10 AVAILABLE_IN_SYMBOL = (1 << 0),
11 AVAILABLE_IN_SCHEMATIC = (1 << 1),
12 AVAILABLE_IN_PADSTACK = (1 << 2),
13 AVAILABLE_IN_PACKAGE = (1 << 3),
14 AVAILABLE_IN_BOARD = (1 << 4),
15 AVAILABLE_IN_FRAME = (1 << 5),
16 AVAILABLE_IN_DECAL = (1 << 6),
17 AVAILABLE_IN_3D = (1 << 8),
18 AVAILABLE_EVERYWHERE = 0xff,
19 AVAILABLE_EVERYWHERE_3D = 0x1ff,
20 AVAILABLE_LAYERED = AVAILABLE_IN_PACKAGE | AVAILABLE_IN_PADSTACK | AVAILABLE_IN_BOARD | AVAILABLE_IN_DECAL,
21 AVAILABLE_IN_PACKAGE_AND_BOARD = AVAILABLE_IN_PACKAGE | AVAILABLE_IN_BOARD,
22 AVAILABLE_IN_SCHEMATIC_AND_BOARD = AVAILABLE_IN_SCHEMATIC | AVAILABLE_IN_BOARD
23 };
24
25 enum Flags {
26 FLAGS_DEFAULT = 0,
27 FLAGS_IN_TOOL = (1 << 1),
28 FLAGS_NO_POPOVER = (1 << 2),
29 FLAGS_NO_MENU = (1 << 3),
30 FLAGS_SPECIFIC = (1 << 4),
31 FLAGS_NO_PREFERENCES = (1 << 5),
32 };
33
34 ActionCatalogItem(const std::string &n, ActionGroup gr, int av, int fl = FLAGS_DEFAULT)
35 : name(n), group(gr), flags(static_cast<Flags>(fl)), availability(static_cast<Availability>(av)){};
36
37 const std::string name;
38 ActionGroup group;
39 const Flags flags;
40 const Availability availability;
41};
42
43extern const std::map<ActionToolID, ActionCatalogItem> action_catalog;
44extern const LutEnumStr<ActionID> action_lut;
45extern const LutEnumStr<ToolID> tool_lut;
46
47extern const std::vector<std::pair<ActionGroup, std::string>> action_group_catalog;
48} // namespace horizon
Definition action_catalog.hpp:7
Definition lut.hpp:18