neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
object_type.hpp
Go to the documentation of this file.
1// object_type.hpp
2/*
3 neogfx C++ App/Game Engine
4 Copyright (c) 2018, 2020 Leigh Johnston. All Rights Reserved.
5
6 This program is free software: you can redistribute it and / or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
23
24namespace neogfx
25{
26 enum class object_type : uint64_t
27 {
28 Invalid = 0x0000000000000000,
29 None = 0x0000000000000000,
30
31 MASK_RESERVED = 0xFF0FF0FF0000FFFF,
32 MASK_USER = 0xFFFFFFFFFFFF0000,
33
34 MASK_TYPE = 0x00000000FFFFFFFF,
35 MASK_TRAITS = 0x00000FFF00000000,
36 MASK_CATEGORY = 0x00FFF00000000000,
39 MASK_CONTEXT = 0xF000000000000000,
40
46
47 HasGeometry = 0x0000000100000000,
48 HasAlignment = 0x0000000200000000,
49 LayoutItem = 0x0000000400000000 | HasGeometry,
50 HasActions = 0x0000000800000000,
51 HasText = 0x0000001000000000,
52 HasLabel = 0x0000002000000000,
53 HasImage = 0x0000004000000000,
54 HasColor = 0x0000008000000000,
55
56 Action = 0x0000100000000000,
57 Widget = 0x0000200000000000 | LayoutItem | HasColor,
58 Window = 0x0000400000000000 | Widget,
59 Layout = 0x0000800000000000 | HasAlignment | LayoutItem,
60 Menu = 0x0001000000000000 | HasActions,
61 Button = 0x0002000000000000 | Widget | HasText | HasLabel | HasImage,
62 Separator = 0x0004000000000000 | Widget,
63
64 App = 0x0000000000000001 | HasActions,
65 SurfaceWindow = 0x0000000000000002 | Window,
66 NestedWindow = 0x0000000000000003 | Window,
67 Dialog = 0x0000000000000004 | Window,
68 TextWidget = 0x0000000000000010 | Widget | HasAlignment | HasText,
69 ImageWidget = 0x0000000000000011 | Widget | HasImage,
70 MenuBar = 0x0000000000000020 | Widget | Menu,
71 Toolbar = 0x0000000000000021 | Widget | HasActions,
72 StatusBar = 0x0000000000000022 | Widget,
73 TabPageContainer = 0x0000000000000030 | Widget,
74 TabPage = 0x0000000000000031 | Widget,
75 GroupBox = 0x0000000000000040 | Widget | HasLabel,
76 Canvas = 0x0000000000000090 | Widget,
77 PushButton = 0x0000000000000100 | Button,
78 CheckBox = 0x0000000000000101 | Button,
79 RadioButton = 0x0000000000000102 | Button,
80 Label = 0x0000000000000110 | Widget | HasText | HasImage,
81 TextEdit = 0x0000000000000120 | Widget | HasAlignment | HasText,
82 LineEdit = 0x0000000000000121 | Widget | HasAlignment | HasText,
83 TextField = 0x0000000000000122 | Widget | HasText | HasLabel,
84 DropList = 0x0000000000000130 | Widget,
85 TableView = 0x0000000000000131 | Widget,
86 Slider = 0x0000000000000140 | Widget,
87 DoubleSlider = 0x0000000000000141 | Widget,
88 SpinBox = 0x0000000000000142 | Widget,
89 DoubleSpinBox = 0x0000000000000143 | Widget,
90 SliderBox = 0x0000000000000144 | Widget,
91 DoubleSliderBox = 0x0000000000000145 | Widget,
92 GradientWidget = 0x0000000000000800 | Widget,
93 VerticalLayout = 0x0000000000000900 | Layout,
94 HorizontalLayout = 0x0000000000000901 | Layout,
95 GridLayout = 0x0000000000000902 | Layout,
96 FlowLayout = 0x0000000000000903 | Layout,
97 StackLayout = 0x0000000000000904 | Layout,
98 BorderLayout = 0x0000000000000905 | Layout,
99 Spacer = 0x0000000000000920 | LayoutItem,
100 VerticalSpacer = 0x0000000000000921 | LayoutItem,
101 HorizontalSpacer = 0x0000000000000922 | LayoutItem,
102
103 Value = 0x0000000000000000,
104 Reference = 0x1000000000000000,
105 };
106
107 inline constexpr object_type operator|(object_type aLhs, object_type aRhs)
108 {
109 return static_cast<object_type>(static_cast<uint64_t>(aLhs) | static_cast<uint64_t>(aRhs));
110 }
111
112 inline constexpr object_type operator&(object_type aLhs, object_type aRhs)
113 {
114 return static_cast<object_type>(static_cast<uint64_t>(aLhs)& static_cast<uint64_t>(aRhs));
115 }
116
117 inline constexpr object_type category(object_type aType)
118 {
119 return aType & object_type::MASK_CATEGORY;
120 }
121}
constexpr style_aspect operator&(style_aspect aLhs, style_aspect aRhs)
Definition i_style.hpp:60
constexpr object_type category(object_type aType)
constexpr style_aspect operator|(style_aspect aLhs, style_aspect aRhs)
Definition i_style.hpp:55