ScummVM API documentation
gui_defines.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef AGS_SHARED_GUI_GUI_DEFINES_H
23 #define AGS_SHARED_GUI_GUI_DEFINES_H
24 
25 namespace AGS3 {
26 
27 #define GUIMAGIC 0xcafebeef
28 #define MAX_GUIOBJ_EVENTS 10
29 #define TEXTWINDOW_PADDING_DEFAULT 3
30 
31 // TODO: find out more about gui version history
32 //=============================================================================
33 // GUI Version history
34 //-----------------------------------------------------------------------------
35 //
36 // 2.1.4..... (100): Introduced Slider gui control. Gui count is now serialized
37 // in game file.
38 // 2.2.2..... (101): Introduced TextBox gui control.
39 // 2.3.0..... (102): Introduced ListBox gui control.
40 // 2.6.0..... (105): GUI custom Z-order support.
41 // 2.7.0..... (110): Added GUI OnClick handler.
42 // 2.7.2.???? (111): Added text alignment property to buttons.
43 // 2.7.2.???? (112): Added text alignment property to list boxes.
44 // 2.7.2.???? (113): Increased permitted length of GUI label text from 200 to
45 // 2048 characters.
46 // 2.7.2.???? (114): Obsoleted savegameindex[] array, and added
47 // ListBox.SaveGameSlots[] array instead.
48 // 2.7.2.???? (115): Added GUI Control z-order support.
49 //
50 // 3.3.0.1132 (116): Added kGUICtrl_Translated flag.
51 // 3.3.1.???? (117): Added padding variable for text window GUIs.
52 // 3.4.0 (118): Removed GUI limits
53 // 3.5.0 (119): Game data contains GUI properties that previously
54 // could be set only at runtime.
55 //
56 //=============================================================================
57 
58 enum GuiVersion {
59  // TODO: find out all corresponding engine version numbers
60  kGuiVersion_Initial = 0,
61  kGuiVersion_214 = 100,
62  kGuiVersion_222 = 101,
63  kGuiVersion_230 = 102,
64  kGuiVersion_unkn_103 = 103,
65  kGuiVersion_unkn_104 = 104,
66  kGuiVersion_260 = 105,
67  kGuiVersion_unkn_106 = 106,
68  kGuiVersion_unkn_107 = 107,
69  kGuiVersion_unkn_108 = 108,
70  kGuiVersion_unkn_109 = 109,
71  kGuiVersion_270 = 110,
72  kGuiVersion_272a = 111,
73  kGuiVersion_272b = 112,
74  kGuiVersion_272c = 113,
75  kGuiVersion_272d = 114,
76  kGuiVersion_272e = 115,
77 
78  kGuiVersion_330 = 116,
79  kGuiVersion_331 = 117,
80  kGuiVersion_340 = 118,
81  kGuiVersion_350 = 119,
82  kGuiVersion_Current = kGuiVersion_350,
83 };
84 
85 namespace AGS {
86 namespace Shared {
87 
88 // GUIMain's style and behavior flags
89 enum GUIMainFlags {
90  kGUIMain_Clickable = 0x0001,
91  kGUIMain_TextWindow = 0x0002,
92  kGUIMain_Visible = 0x0004,
93  kGUIMain_Concealed = 0x0008,
94 
95  // NOTE: currently default state is Visible to keep this backwards compatible;
96  // check later if this is still a wanted behavior
97  kGUIMain_DefFlags = kGUIMain_Clickable | kGUIMain_Visible,
98  // flags that had inverse meaning in old formats
99  kGUIMain_OldFmtXorMask = kGUIMain_Clickable
100 };
101 
102 // GUIMain's legacy flags, now converted to GUIMainFlags on load
103 enum GUIMainLegacyFlags {
104  kGUIMain_LegacyTextWindow = 5
105 };
106 
107 // GUIMain's style of getting displayed on screen
108 enum GUIPopupStyle {
109  // Normal GUI
110  kGUIPopupNormal = 0,
111  // Shown when the mouse cursor moves to the top of the screen
112  kGUIPopupMouseY = 1,
113  // Same as Normal, but pauses the game when shown
114  kGUIPopupModal = 2,
115  // Same as Normal, but is not removed when interface is off
116  kGUIPopupNoAutoRemove = 3,
117  // (legacy option) Normal GUI, initially off
118  // converts to kGUIPopupNormal with Visible = false
119  kGUIPopupLegacyNormalOff = 4
120 };
121 
122 // The type of GUIControl
123 enum GUIControlType {
124  kGUIControlUndefined = -1,
125  kGUIButton = 1,
126  kGUILabel = 2,
127  kGUIInvWindow = 3,
128  kGUISlider = 4,
129  kGUITextBox = 5,
130  kGUIListBox = 6
131 };
132 
133 // GUIControl general style and behavior flags
134 enum GUIControlFlags {
135  kGUICtrl_Default = 0x0001, // only button
136  kGUICtrl_Cancel = 0x0002, // unused
137  kGUICtrl_Enabled = 0x0004,
138  kGUICtrl_TabStop = 0x0008, // unused
139  kGUICtrl_Visible = 0x0010,
140  kGUICtrl_Clip = 0x0020, // only button
141  kGUICtrl_Clickable = 0x0040,
142  kGUICtrl_Translated = 0x0080, // 3.3.0.1132
143  kGUICtrl_Deleted = 0x8000, // unused (probably remains from the old editor?)
144 
145  kGUICtrl_DefFlags = kGUICtrl_Enabled | kGUICtrl_Visible | kGUICtrl_Clickable,
146  // flags that had inverse meaning in old formats
147  kGUICtrl_OldFmtXorMask = kGUICtrl_Enabled | kGUICtrl_Visible | kGUICtrl_Clickable
148 };
149 
150 // Label macro flags, define which macros are present in the Label's Text
151 enum GUILabelMacro {
152  kLabelMacro_None = 0,
153  kLabelMacro_Gamename = 0x01,
154  kLabelMacro_Overhotspot = 0x02,
155  kLabelMacro_Score = 0x04,
156  kLabelMacro_ScoreText = 0x08,
157  kLabelMacro_TotalScore = 0x10,
158 
159  kLabelMacro_AllScore = kLabelMacro_Score | kLabelMacro_ScoreText,
160  kLabelMacro_All = 0xFFFF
161 };
162 
163 // GUIListBox style and behavior flags
164 enum GUIListBoxFlags {
165  kListBox_ShowBorder = 0x01,
166  kListBox_ShowArrows = 0x02,
167  kListBox_SvgIndex = 0x04,
168 
169  kListBox_DefFlags = kListBox_ShowBorder | kListBox_ShowArrows,
170  // flags that had inverse meaning in old formats
171  kListBox_OldFmtXorMask = kListBox_ShowBorder | kListBox_ShowArrows
172 };
173 
174 // GUITextBox style and behavior flags
175 enum GUITextBoxFlags {
176  kTextBox_ShowBorder = 0x0001,
177 
178  kTextBox_DefFlags = kTextBox_ShowBorder,
179  // flags that had inverse meaning in old formats
180  kTextBox_OldFmtXorMask = kTextBox_ShowBorder
181 };
182 
183 // Savegame data format
184 // TODO: move to the engine code
185 enum GuiSvgVersion {
186  kGuiSvgVersion_Initial = 0,
187  kGuiSvgVersion_350,
188  kGuiSvgVersion_36020,
189  kGuiSvgVersion_36023,
190  kGuiSvgVersion_36025
191 };
192 
193 // Style of GUI drawing in disabled state
194 enum GuiDisableStyle {
195  kGuiDis_Undefined = -1, // this is for marking not-disabled state
196  kGuiDis_Greyout = 0, // paint "gisabled" effect over controls
197  kGuiDis_Blackout = 1, // invisible controls (but guis are shown
198  kGuiDis_Unchanged = 2, // no change, display normally
199  kGuiDis_Off = 3 // fully invisible guis
200 };
201 
202 // Global GUI options
203 struct GuiOptions {
204  // Clip GUI control's contents to the control's rectangle
205  bool ClipControls = true;
206  // How the GUI controls are drawn when the interface is disabled
207  GuiDisableStyle DisabledStyle = kGuiDis_Unchanged;
208  // Whether to graphically outline GUI controls
209  bool OutlineControls = false;
210 };
211 
212 } // namespace Shared
213 } // namespace AGS
214 } // namespace AGS3
215 
216 #endif
Definition: achievements_tables.h:27
Definition: gui_defines.h:203
Definition: ags.h:40