28 #ifndef GOB_HOTSPOTS_H 29 #define GOB_HOTSPOTS_H 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);
82 void remove(uint16 id);
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);
125 uint16 l, uint16 t, uint16 r, uint16 b, uint16 f, uint16 k,
126 uint16 enter, uint16 leave, uint16 pos);
130 Type getType ()
const;
131 MouseButtons getButton()
const;
132 uint16 getWindow()
const;
133 uint8 getCursor()
const;
134 uint8 getState ()
const;
139 bool isInput ()
const;
140 bool isActiveInput()
const;
141 bool isInputLeave ()
const;
143 bool isFilled ()
const;
144 bool isFilledEnabled()
const;
145 bool isFilledNew ()
const;
146 bool isDisabled ()
const;
149 bool isIn(uint16 x, uint16 y)
const;
151 bool buttonMatch(MouseButtons button)
const;
153 static uint8 getState(uint16
id);
186 uint16 _currentIndex;
192 uint16
add(
const Hotspot &hotspot);
198 void recalculate(
bool force);
201 bool isValid(uint16 key, uint16
id, uint16 index)
const;
204 void call(uint16 offset);
206 void enter(uint16 index);
208 void leave(uint16 index);
211 int16 windowCursor(int16 &dx, int16 &dy)
const;
214 uint16 checkMouse(Type type, uint16 &
id, uint16 &index)
const;
217 bool checkHotspotChanged();
220 uint16 updateInput(uint16 xPos, uint16 yPos, uint16 width, uint16 height,
221 uint16 backColor, uint16 frontColor,
char *str, uint16 fontIndex,
222 Type type, int16 &duration, uint16 &
id, uint16 &index);
225 uint16 handleInputs(int16 time, uint16 inputCount, uint16 &curInput,
226 InputDesc *inputs, uint16 &
id, uint16 &index);
229 void evaluateNew(uint16 i, uint16 *ids, InputDesc *inputs,
230 uint16 &inputId,
bool &hasInput, uint16 &inputCount);
232 bool evaluateFind(uint16 key, int16 timeVal,
const uint16 *ids,
233 uint16 leaveWindowIndex, uint16 hotspotIndex1, uint16 hotspotIndex2,
234 uint16 endIndex, int16 &duration, uint16 &
id, uint16 &index,
bool &finished);
238 uint16 inputToHotspot(uint16 input)
const;
240 uint16 hotspotToInput(uint16 hotspot)
const;
242 uint16 findClickedInput(uint16 index)
const;
244 bool findFirstInputLeave(uint16 &
id, uint16 &inputId, uint16 &index)
const;
246 bool findKey(uint16 key, uint16 &
id, uint16 &index)
const;
248 bool findKeyCaseInsensitive(uint16 key, uint16 &
id, uint16 &index)
const;
250 bool findNthPlain(uint16 n, uint16 startIndex, uint16 &
id, uint16 &index)
const;
253 bool leaveNthPlain(uint16 n, uint16 startIndex, int16 timeVal,
const uint16 *ids,
254 uint16 &
id, uint16 &index, int16 &duration);
257 void setCurrentHotspot(
const uint16 *ids, uint16
id)
const;
258 uint32 getCurrentHotspot()
const;
261 void cleanFloatString(
const Hotspot &spot)
const;
262 void checkStringMatch(
const Hotspot &spot,
const InputDesc &input,
263 uint16 inputPos)
const;
264 void matchInputStrings(
const InputDesc *inputs)
const;
266 uint16 convertSpecialKey(uint16 key)
const;
269 void getTextCursorPos(
const Font &font,
const char *str,
270 uint32 pos, uint16 x, uint16 y, uint16 width, uint16 height,
271 uint16 &cursorX, uint16 &cursorY, uint16 &cursorWidth, uint16 &cursorHeight)
const;
274 void fillRect(uint16 x, uint16 y, uint16 width, uint16 height, uint16 color)
const;
276 void printText(uint16 x, uint16 y,
const char *str, uint16 fontIndex, uint16 color)
const;
279 void updateAllTexts(
const InputDesc *inputs)
const;
284 #endif // GOB_HOTSPOTS_H void removeState(uint8 state)
uint16 add(uint16 id, uint16 left, uint16 top, uint16 right, uint16 bottom, uint16 flags, uint16 key, uint16 funcEnter, uint16 funcLeave, uint16 funcPos)
void push(uint8 all, bool force=false)
int16 findCursor(uint16 x, uint16 y) const
uint16 check(uint8 handleMouse, int16 delay, uint16 &id, uint16 &index)
Definition: hotspots.h:40