ScummVM API documentation
controls16.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 SCI_GRAPHICS_CONTROLS16_H
23#define SCI_GRAPHICS_CONTROLS16_H
24
25namespace Sci {
26
32};
33
34// Control types and flags
35enum {
36 SCI_CONTROLS_TYPE_BUTTON = 1,
37 SCI_CONTROLS_TYPE_TEXT = 2,
38 SCI_CONTROLS_TYPE_TEXTEDIT = 3,
39 SCI_CONTROLS_TYPE_ICON = 4,
40 SCI_CONTROLS_TYPE_LIST = 6,
41 SCI_CONTROLS_TYPE_LIST_ALIAS = 7,
42 SCI_CONTROLS_TYPE_DUMMY = 10
43};
44
45class GfxPorts;
46class GfxPaint16;
47class Font;
48class GfxText16;
49class GfxScreen;
54public:
55 GfxControls16(SegManager *segMan, GfxPorts *ports, GfxPaint16 *paint16, GfxText16 *text16, GfxScreen *screen);
57
58 void kernelDrawButton(Common::Rect rect, reg_t obj, const char *text, uint16 languageSplitter, int16 fontId, int16 style, bool hilite);
59 void kernelDrawText(Common::Rect rect, reg_t obj, const char *text, uint16 languageSplitter, int16 fontId, TextAlignment alignment, int16 style, bool hilite);
60 void kernelDrawTextEdit(Common::Rect rect, reg_t obj, const char *text, uint16 languageSplitter, int16 fontId, int16 mode, int16 style, int16 cursorPos, int16 maxChars, bool hilite);
61 void kernelDrawIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, int16 loopNo, int16 celNo, int16 priority, int16 style, bool hilite);
62 void kernelDrawList(Common::Rect rect, reg_t obj, int16 maxChars, int16 count, const Common::String *entries, GuiResourceId fontId, int16 style, int16 upperPos, int16 cursorPos, bool isAlias, bool hilite);
63 void kernelTexteditChange(reg_t controlObject, reg_t eventObject);
64
65private:
66 void texteditSetBlinkTime();
67
68 void drawListControl(Common::Rect rect, reg_t obj, int16 maxChars, int16 count, const Common::String *entries, GuiResourceId fontId, int16 upperPos, int16 cursorPos, bool isAlias);
69 void texteditCursorDraw(Common::Rect rect, const char *text, uint16 curPos);
70 void texteditCursorErase();
71 int getPicNotValid();
72
73 SegManager *_segMan;
74 GfxPorts *_ports;
75 GfxPaint16 *_paint16;
76 GfxText16 *_text16;
77 GfxScreen *_screen;
78
79 // Textedit-Control related
80 Common::Rect _texteditCursorRect;
81 bool _texteditCursorVisible;
82 uint32 _texteditBlinkTime;
83};
84
85} // End of namespace Sci
86
87#endif // SCI_GRAPHICS_CONTROLS16_H
Definition: str.h:59
Definition: controls16.h:53
Definition: paint16.h:37
Definition: ports.h:52
Definition: screen.h:70
Definition: text16.h:45
Definition: seg_manager.h:48
Definition: console.h:28
controlStateFlags
Definition: controls16.h:27
@ SCI_CONTROLS_STYLE_MAC_INVERTED
control is inverted (mac-only for hi-res fonts)
Definition: controls16.h:31
@ SCI_CONTROLS_STYLE_ENABLED
enabled buttons
Definition: controls16.h:28
@ SCI_CONTROLS_STYLE_SELECTED
widgets surrounded by a frame
Definition: controls16.h:30
@ SCI_CONTROLS_STYLE_DISABLED
grayed out buttons
Definition: controls16.h:29
Definition: rect.h:536
Definition: vm_types.h:39