ScummVM API documentation
windows.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 /*
23  * Based on
24  * WebVenture (c) 2010, Sean Kasun
25  * https://github.com/mrkite/webventure, http://seancode.com/webventure/
26  *
27  * Used with explicit permission from the author
28  */
29 
30 #ifndef MACVENTURE_WINDOWS_H
31 #define MACVENTURE_WINDOWS_H
32 
33 #include "common/rect.h"
34 #include "common/str.h"
35 #include "common/array.h"
36 
37 namespace MacVenture {
38 // massive HACK
39 typedef uint32 ObjID;
40 
41 enum WindowReference {
42  kNoWindow = 0,
43  kInventoryStart = 1,
44  kCommandsWindow = 0x80,
45  kMainGameWindow = 0x81,
46  kOutConsoleWindow = 0x82,
47  kSelfWindow = 0x83,
48  kExitsWindow = 0x84,
49  kDiplomaWindow = 0x85
50 };
51 
52 enum MVWindowType {
53  kDocument = 0x00,
54  kDBox = 0x01,
55  kPlainDBox = 0x02,
56  kAltBox = 0x03,
57  kNoGrowDoc = 0x04,
58  kMovableDBox = 0x05,
59  kZoomDoc = 0x08,
60  kZoomNoGrow = 0x0c,
61  // WebVenture assigns arbitrary kinds post-loading
62  kInvWindow = 0x0e,
63  kRDoc16 = 0x10,
64  kRDoc4 = 0x12,
65  kRDoc6 = 0x14,
66  kRDoc10 = 0x16,
67  kNoType = 0xFF
68 };
69 
71  ObjID obj;
72  byte mode;
73  DrawableObject(ObjID id, byte md) {
74  obj = id;
75  mode = md;
76  }
77 };
78 
79 enum {
80  kScrollAmount = 10
81 };
82 
83 struct WindowData {
84  Common::Rect bounds;
85  MVWindowType type;
86  ObjID objRef;
87  uint16 visible;
88  uint16 hasCloseBox;
89  WindowReference refcon;
90  uint8 titleLength;
91  Common::String title;
93  bool updateScroll;
94  Common::Point scrollPos;
95 };
96 
97 struct BorderBounds {
98  uint16 leftOffset;
99  uint16 topOffset;
100  uint16 rightOffset;
101  uint16 bottomOffset;
102  uint16 rightScrollbarWidth;
103  uint16 bottomScrollbarHeight;
104 
105  BorderBounds(uint16 l, uint16 t, uint16 r, uint16 b) :
106  leftOffset(l), topOffset(t), rightOffset(r), bottomOffset(b), rightScrollbarWidth(0), bottomScrollbarHeight(0) {}
107 
108  BorderBounds(uint16 l, uint16 t, uint16 r, uint16 b, uint16 rs, uint16 bs) :
109  leftOffset(l), topOffset(t), rightOffset(r), bottomOffset(b), rightScrollbarWidth(rs), bottomScrollbarHeight(bs) {}
110 
111 };
112 }
113 #endif
Definition: str.h:59
Definition: array.h:52
Definition: windows.h:83
Definition: rect.h:144
Definition: windows.h:97
Definition: windows.h:70
Definition: rect.h:45
Definition: container.h:38