31#include "common/stack.h"
42 static const int kHotspotCount = 250;
48 kTypeInput1NoLeave = 3,
50 kTypeInput2NoLeave = 5,
52 kTypeInput3NoLeave = 7,
54 kTypeInputFloatNoLeave = 9,
55 kTypeInputFloatLeave = 10,
62 kStateFilledDisabled = 0xC,
77 uint16 left, uint16 top, uint16 right, uint16 bottom,
78 uint16 flags, uint16 key,
79 uint16 funcEnter, uint16 funcLeave, uint16 funcPos);
91 void push(uint8 all,
bool force =
false);
96 uint16
check(uint8 handleMouse, int16 delay, uint16 &
id, uint16 &index);
98 uint16
check(uint8 handleMouse, int16 delay);
110 bool hoveringOverHotspot()
const;
111 void addHotspotTTSText(
const Common::String &text, uint16 x1, uint16 y1, uint16 x2, uint16 y2, int16 surf);
112 void voiceUnassignedHotspots();
113 void voiceHotspotTTSText(int16 x, int16 y);
114 void clearHotspotTTSText();
115 void clearUnassignedHotspotTTSText();
116 void clearPreviousSaid();
117 void adjustHotspotTTSTextRect(int16 oldLeft, int16 oldTop, int16 oldRight, int16 oldBottom, int16 newX, int16 newY, int16 surf);
137 uint16 l, uint16 t, uint16 r, uint16 b, uint16 f, uint16 k,
138 uint16 enter, uint16 leave, uint16 pos);
142 Type getType ()
const;
143 MouseButtons getButton()
const;
144 uint16 getWindow()
const;
145 uint8 getCursor()
const;
146 uint8 getState ()
const;
151 bool isInput ()
const;
152 bool isActiveInput()
const;
153 bool isInputLeave ()
const;
155 bool isFilled ()
const;
156 bool isFilledEnabled()
const;
157 bool isFilledNew ()
const;
158 bool isDisabled ()
const;
161 bool isIn(uint16 x, uint16 y)
const;
163 bool buttonMatch(MouseButtons button)
const;
165 static uint8 getState(uint16
id);
172 struct HotspotTTSText {
208 uint16 _currentIndex;
215 bool _hotspotSpokenLast;
217 int16 _currentHotspotTTSTextIndex;
221 uint16
add(
const Hotspot &hotspot);
227 void recalculate(
bool force);
230 bool isValid(uint16 key, uint16
id, uint16 index)
const;
233 void call(uint16 offset);
235 void enter(uint16 index);
237 void leave(uint16 index);
240 int16 windowCursor(int16 &dx, int16 &dy)
const;
243 uint16 checkMouse(Type type, uint16 &
id, uint16 &index)
const;
246 bool checkHotspotChanged();
249 uint16 updateInput(uint16 xPos, uint16 yPos, uint16 width, uint16 height,
250 uint16 backColor, uint16 frontColor,
char *str, uint16 fontIndex,
251 Type type, int16 &duration, uint16 &
id, uint16 &index);
254 uint16 handleInputs(int16 time, uint16 inputCount, uint16 &curInput,
255 InputDesc *inputs, uint16 &
id, uint16 &index);
258 void evaluateNew(uint16 i, uint16 *ids, InputDesc *inputs,
259 uint16 &inputId,
bool &hasInput, uint16 &inputCount);
261 bool evaluateFind(uint16 key, int16 timeVal,
const uint16 *ids,
262 uint16 leaveWindowIndex, uint16 hotspotIndex1, uint16 hotspotIndex2,
263 uint16 endIndex, int16 &duration, uint16 &
id, uint16 &index,
bool &finished);
267 uint16 inputToHotspot(uint16 input)
const;
269 uint16 hotspotToInput(uint16 hotspot)
const;
271 uint16 findClickedInput(uint16 index)
const;
273 bool findFirstInputLeave(uint16 &
id, uint16 &inputId, uint16 &index)
const;
275 bool findKey(uint16 key, uint16 &
id, uint16 &index)
const;
277 bool findKeyCaseInsensitive(uint16 key, uint16 &
id, uint16 &index)
const;
279 bool findNthPlain(uint16 n, uint16 startIndex, uint16 &
id, uint16 &index)
const;
282 bool leaveNthPlain(uint16 n, uint16 startIndex, int16 timeVal,
const uint16 *ids,
283 uint16 &
id, uint16 &index, int16 &duration);
286 void setCurrentHotspot(
const uint16 *ids, uint16
id)
const;
287 uint32 getCurrentHotspot()
const;
290 void cleanFloatString(
const Hotspot &spot)
const;
291 void checkStringMatch(
const Hotspot &spot,
const InputDesc &input,
292 uint16 inputPos)
const;
293 void matchInputStrings(
const InputDesc *inputs)
const;
295 uint16 convertSpecialKey(uint16 key)
const;
298 void getTextCursorPos(
const Font &font,
const char *str,
299 uint32 pos, uint16 x, uint16 y, uint16 width, uint16 height,
300 uint16 &cursorX, uint16 &cursorY, uint16 &cursorWidth, uint16 &cursorHeight)
const;
303 void fillRect(uint16 x, uint16 y, uint16 width, uint16 height, uint16 color)
const;
305 void printText(uint16 x, uint16 y,
const char *str, uint16 fontIndex, uint16 color)
const;
308 void updateAllTexts(
const InputDesc *inputs)
const;
311 void expandHotspotTTSText(uint16 spotID);
312 void removeHotspotTTSText(uint16 spotID);
Definition: hotspots.h:40
void removeState(uint8 state)
uint16 check(uint8 handleMouse, int16 delay)
uint16 add(uint16 id, uint16 left, uint16 top, uint16 right, uint16 bottom, uint16 flags, uint16 key, uint16 funcEnter, uint16 funcLeave, uint16 funcPos)
int16 findCursor(uint16 x, uint16 y) const
uint16 check(uint8 handleMouse, int16 delay, uint16 &id, uint16 &index)
void push(uint8 all, bool force=false)