ScummVM API documentation
bubble_box.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 ACCESS_BUBBLE_BOX_H
23 #define ACCESS_BUBBLE_BOX_H
24 
25 #include "common/scummsys.h"
26 #include "common/array.h"
27 #include "common/rect.h"
28 #include "common/str-array.h"
29 #include "common/stream.h"
30 #include "common/types.h"
31 #include "graphics/surface.h"
32 #include "access/data.h"
33 
34 namespace Access {
35 
36 class AccessEngine;
37 
38 enum BoxType {
39  TYPE_0 = 0,
40  TYPE_1 = 1,
41  TYPE_2 = 2,
42  TYPE_3 = 3,
43  kBoxTypeFileDialog = 4,
44  kTextBoxNoctPlain = 1,
45  kTextBoxNoctCaption = 2,
46  kTextBoxNoctCenter = 4,
47 };
48 
49 class BubbleBox : public Manager {
50 private:
51  int _startItem, _startBox;
52  int _charCol, _rowOff;
53  Common::Point _fileStart;
54  Common::Point _fileOff;
55  int _boxStartX, _boxStartY;
56  int _boxEndX, _boxEndY;
57  int _bIconStartX, _bIconStartY;
58  int _boxPStartX, _boxPStartY;
59 
60  void displayBoxData();
61  void drawSelectBox();
65  void printBubble_v1(const Common::String &msg);
66  void printBubble_v2(const Common::String &msg);
67  void printBubble_v3(const Common::String &msg);
68 
69 public:
70  BoxType _type;
71  Common::Rect _bounds;
72  Common::StringArray _nameIndex;
73  Common::String _bubbleTitle; // the active default "script" title
74  Common::String _bubbleDisplStr; // the title that will be drawn on the next bubble
75  Common::String _tempList[60];
76  int _tempListIdx[60];
77  int _btnId1;
78  int _btnX1;
79  int _btnId2;
80  int _btnX2;
81  int _btnId3;
82  int _btnX3;
83  Common::Rect _btnUpPos;
84  Common::Rect _btnDownPos;
86 public:
87  BubbleBox(AccessEngine *vm, Access::BoxType type, int x, int y, int w, int h, int val1, int val2, int val3, int val4, const char *title);
88 
89  void load(Common::SeekableReadStream *stream);
90 
91  void clearBubbles();
92 
93  void placeBubble(const Common::String &msg);
94  void placeBubble1(const Common::String &msg);
95 
99  void calcBubble(const Common::String &msg);
100 
104  //void calcBubble_v3(const Common::String &msg);
105 
109  void printBubble(const Common::String &msg);
110 
111  /*
112  * Draws the background for a text bubble
113  * @param index Index of bounds in _bubbles array
114  */
115  void drawBubble(int index);
116 
117  void doBox_v2(int item, int box);
118  void doBox_v3(int item, int box);
119 
120  int doBox_v1(int item, int box, int &btnSelected);
121  void getList(const char *const data[], const byte *flags);
122  void setCursorPos(int posX, int posY);
123  void printString(Common::String msg);
124 };
125 
126 } // End of namespace Access
127 
128 #endif /* ACCESS_BUBBLE_BOX_H */
Definition: str.h:59
Definition: data.h:37
Definition: access.h:141
Definition: rect.h:524
Definition: stream.h:745
void printBubble(const Common::String &msg)
Definition: rect.h:144
Definition: access.h:62
void calcBubble(const Common::String &msg)
Definition: bubble_box.h:49