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 
25 namespace Sci {
26 
32 };
33 
34 // Control types and flags
35 enum {
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 
45 class GfxPorts;
46 class GfxPaint16;
47 class Font;
48 class GfxText16;
49 class GfxScreen;
54 public:
55  GfxControls16(SegManager *segMan, GfxPorts *ports, GfxPaint16 *paint16, GfxText16 *text16, GfxScreen *screen);
56  ~GfxControls16();
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 
65 private:
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
widgets surrounded by a frame
Definition: controls16.h:30
Definition: paint16.h:37
control is inverted (mac-only for hi-res fonts)
Definition: controls16.h:31
Definition: ports.h:52
Definition: str.h:59
grayed out buttons
Definition: controls16.h:29
Definition: rect.h:144
Definition: console.h:28
enabled buttons
Definition: controls16.h:28
Definition: seg_manager.h:48
Definition: text16.h:45
Definition: controls16.h:53
Definition: screen.h:70
controlStateFlags
Definition: controls16.h:27
Definition: vm_types.h:39