ScummVM API documentation
livingbooks.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 MOHAWK_LIVINGBOOKS_H
23 #define MOHAWK_LIVINGBOOKS_H
24 
25 #include "mohawk/mohawk.h"
26 #include "mohawk/console.h"
27 #include "mohawk/livingbooks_graphics.h"
28 #include "mohawk/sound.h"
29 #include "mohawk/video.h"
30 
31 #include "common/formats/ini-file.h"
32 #include "common/rect.h"
33 #include "common/queue.h"
34 #include "common/random.h"
35 
36 #include "livingbooks_code.h"
37 
38 namespace Common {
39  class SeekableReadStreamEndian;
40  class MemoryReadStreamEndian;
41 }
42 
43 namespace Mohawk {
44 
45 #define LBKEY_MOD_CTRL 1
46 #define LBKEY_MOD_ALT 2
47 #define LBKEY_MOD_SHIFT 4
48 
49 struct LBKey {
50  byte code;
51  byte modifiers;
52  byte char_;
53  byte repeats;
54 };
55 
56 enum NodeState {
57  kLBNodeDone = 0,
58  kLBNodeRunning = 1,
59  kLBNodeWaiting = 2
60 };
61 
62 enum LBMode {
63  kLBIntroMode = 1,
64  kLBControlMode = 2,
65  kLBCreditsMode = 3,
66  kLBPreviewMode = 4,
67  kLBReadMode = 5,
68  kLBPlayMode = 6
69 };
70 
71 enum {
72  kLBPhaseInit = 0x0,
73  kLBPhaseIntro = 0x1,
74  kLBPhaseMain = 0x2,
75  kLBPhaseNone = 0x7fff,
76  kLBPhaseLoad = 0xfffe,
77  kLBPhaseCreate = 0xffff
78 };
79 
80 // automatic modes used in _timingMode
81 enum {
82  kLBAutoNone = 0,
83  kLBAutoIntro = 1,
84  kLBAutoUserIdle = 2,
85  kLBAutoMain = 3,
86  kLBAutoSync = 4,
87  kLBAutoInit = 5,
88  kLBAutoCreate = 6,
89  kLBAutoLoad = 7
90 };
91 
92 // control modes used in _controlMode
93 enum {
94  kLBControlNone = 0,
95  kLBControlHideMouse = 1,
96  kLBControlPauseItems = 2
97 };
98 
99 enum {
100  kLBStaticTextItem = 0x1,
101  kLBPictureItem = 0x2,
102  kLBEditTextItem = 0x14,
103  kLBLiveTextItem = 0x15,
104  kLBAnimationItem = 0x40,
105  kLBSoundItem = 0x41,
106  kLBGroupItem = 0x42,
107  kLBMovieItem = 0x43,
108  kLBPaletteAItem = 0x44, // unused?
109  kLBPaletteItem = 0x45,
110  kLBProxyItem = 0x46,
111  kLBMiniGameItem = 666, // EVIL!!!!
112  kLBXDataFileItem = 0x3e9,
113  kLBDiscDectectorItem = 0xfa1
114 };
115 
116 enum {
117  // no 0x1?
118  kLBAnimOpNotify = 0x2,
119  kLBAnimOpSetTempo = 0x3,
120  // no 0x4?
121  kLBAnimOpMoveTo = 0x5,
122  kLBAnimOpWait = 0x6,
123  kLBAnimOpSetCel = 0x7,
124  kLBAnimOpSleepUntil = 0x8,
125  kLBAnimOpDrawMode = 0x9,
126  kLBAnimOpPlaySound = 0xa,
127  kLBAnimOpWaitForSound = 0xb,
128  kLBAnimOpReleaseSound = 0xc,
129  kLBAnimOpResetSound = 0xd,
130  kLBAnimOpSetTempoDiv = 0xe,
131  kLBAnimOpDelay = 0xf
132 };
133 
134 enum {
135  kLBEventPhaseInit = 0,
136  kLBEventPhaseIntro = 1,
137  kLBEventMouseDown = 2,
138  kLBEventStarted = 3,
139  kLBEventDone = 4,
140  kLBEventMouseUp = 5,
141  kLBEventPhaseMain = 6,
142  kLBEventNotified = 7,
143  kLBEventDragStart = 8,
144  kLBEventDragMove = 9,
145  kLBEventDragEnd = 0xa,
146  kLBEventRolloverBegin = 0xb,
147  kLBEventRolloverMove = 0xc,
148  kLBEventRolloverEnd = 0xd,
149  kLBEventMouseUpIn = 0xe,
150  kLBEventMouseUpOut = 0xf,
151  kLBEventMouseTrackIn = 0x10,
152  kLBEventMouseTrackMove = 0x11,
153  kLBEventMouseTrackMoveIn = 0x12,
154  kLBEventMouseTrackMoveOut = 0x13,
155  kLBEventMouseTrackOut = 0x14,
156  kLBEventFocusBegin = 0x15,
157  kLBEventFocusEnd = 0x16,
158  kLBEventInit = 0x17,
159  kLBEventLoad = 0x1a,
160  kLBEventListLoad = 0x1b,
161  kLBEventPhaseCreate = 0xff
162 };
163 
164 enum {
165  kLBGroupData = 0x64,
166  kLBLiveTextData = 0x65,
167  kLBMsgListScript = 0x66,
168  kLBNotifyScript = 0x67,
169  kLBSetPlayInfo = 0x68,
170  kLBSetRandomLoc = 0x69, // unused?
171  kLBSetDrag = 0x6a, // unused?
172  kLBSetDrawMode = 0x6b,
173  kLBSetFont = 0x6c, // unused?
174  kLBSetOneShot = 0x6d, // unused?
175  kLBSetPlayPhase = 0x6e,
176  // from here, 2.x+
177  kLBSetKeyNotify = 0x6f,
178  kLBCommand = 0x70,
179  kLBPaletteAData = 0x71, // unused?
180  kLBPaletteXData = 0x72,
181  kLBDisable = 0x73, // unused?
182  kLBEnable = 0x74, // unused?
183  kLBSetNotVisible = 0x75,
184  kLBSetVisible = 0x76, // unused?
185  kLBGlobalDisable = 0x77,
186  kLBGlobalEnable = 0x78, // unused?
187  kLBGlobalSetNotVisible = 0x79,
188  kLBGlobalSetVisible = 0x7a, // unused?
189  kLBSetAmbient = 0x7b,
190  kLBSetDragParams = 0x7c,
191  kLBSetKeyEvent = 0x7d,
192  kLBSetRolloverData = 0x7e,
193  kLBSetParent = 0x7f,
194  kLBSetHitTest = 0x80,
195  // from here, rugrats
196  kLBUnknown194 = 0x194
197 };
198 
199 enum {
200  kLBOpNone = 0x0,
201  kLBOpXShow = 0x1,
202  kLBOpTogglePlay = 0x2,
203  kLBOpSetNotVisible = 0x3,
204  kLBOpSetVisible = 0x4,
205  kLBOpDestroy = 0x5,
206  kLBOpRewind = 0x6,
207  kLBOpStop = 0x7,
208  kLBOpDisable = 0x8,
209  kLBOpEnable = 0x9,
210  // (no 0xa)
211  kLBOpGlobalSetNotVisible = 0xb,
212  kLBOpGlobalSetVisible = 0xc,
213  kLBOpGlobalDisable = 0xd,
214  kLBOpGlobalEnable = 0xe,
215  kLBOpSeekToEnd = 0xf,
216  // (no 0x10)
217  kLBOpMute = 0x11,
218  kLBOpUnmute = 0x12,
219  kLBOpLoad = 0x13,
220  kLBOpPreload = 0x14,
221  kLBOpUnload = 0x15,
222  kLBOpSeekToNext = 0x16,
223  kLBOpSeekToPrev = 0x17,
224  kLBOpDragBegin = 0x18,
225  kLBOpDragEnd = 0x19,
226  kLBOpScriptDisable = 0x1a,
227  kLBOpScriptEnable = 0x1b,
228  kLBOpUnknown1C = 0x1c,
229  kLBOpSendExpression = 0x1d,
230  kLBOpJumpUnlessExpression = 0xfffb,
231  kLBOpBreakExpression = 0xfffc,
232  kLBOpJumpToExpression = 0xfffd,
233  kLBOpRunSubentries = 0xfffe,
234  kLBOpRunData = 0xffff
235 };
236 
237 enum {
238  kLBNotifyGUIAction = 1,
239  kLBNotifyGoToControls = 2,
240  kLBNotifyChangePage = 3,
241  kLBNotifyGotoQuit = 4,
242  kLBNotifyIntroDone = 5,
243  kLBNotifyChangeMode = 6,
244  kLBNotifyCursorChange = 7,
245  kLBNotifyPrintPage = 0xc,
246  kLBNotifyQuit = 0xd
247 };
248 
249 enum {
250  kTargetTypeExpression = 0x3f3f,
251  kTargetTypeCode = 0xfffe,
252  kTargetTypeName = 0xffff
253 };
254 
256 class LBPage;
257 class LBGraphics;
258 class LBAnimation;
259 
261  LBScriptEntry();
262  ~LBScriptEntry();
263 
264  uint16 state;
265 
266  uint16 type;
267  uint16 event;
268  uint16 opcode;
269  uint16 param;
270 
271  uint16 argc;
272  uint16 *argvParam;
273  uint16 *argvTarget;
274 
275  uint16 targetingType;
277 
278  // kLBNotifyChangeMode
279  uint16 newUnknown;
280  uint16 newMode;
281  uint16 newPage;
282  uint16 newSubpage;
283  Common::String newCursor;
284 
285  // kLBEventNotified
286  uint16 matchFrom;
287  uint16 matchNotify;
288 
289  // kLBOpSendExpression
290  uint32 offset;
291  // kLBOpJumpUnlessExpression
292  uint16 target;
293 
294  uint16 dataType;
295  uint16 dataLen;
296  byte *data;
297 
300 };
301 
303  byte opcode;
304  byte size;
305  byte *data;
306 };
307 
309 public:
310  LBAnimationNode(MohawkEngine_LivingBooks *vm, LBAnimation *parent, uint16 scriptResourceId);
311  ~LBAnimationNode();
312 
313  void draw(const Common::Rect &_bounds);
314  void reset();
315  NodeState update(bool seeking = false);
316  bool transparentAt(int x, int y);
317 
318 protected:
320  LBAnimation *_parent;
321 
322  void loadScript(uint16 resourceId);
323  uint _currentEntry;
324  Common::Array<LBAnimScriptEntry> _scriptEntries;
325 
326  uint _currentCel;
327  int16 _xPos, _yPos;
328  uint32 _delay;
329 };
330 
331 class LBAnimationItem;
332 
333 class LBAnimation {
334 public:
335  LBAnimation(MohawkEngine_LivingBooks *vm, LBAnimationItem *parent, uint16 resourceId);
336  ~LBAnimation();
337 
338  void draw();
339  bool update();
340 
341  void start();
342  void seek(uint16 pos);
343  void seekToTime(uint32 time);
344  void stop();
345 
346  void playSound(uint16 resourceId);
347  bool soundPlaying(uint16 resourceId, const Common::String &cue);
348 
349  bool transparentAt(int x, int y);
350 
351  void setTempo(uint16 tempo);
352 
353  uint getNumResources() { return _shapeResources.size(); }
354  uint16 getResource(uint num) { return _shapeResources[num]; }
355  Common::Point getOffset(uint num) { return _shapeOffsets[num]; }
356 
357  uint32 getCurrentFrame() { return _currentFrame; }
358 
359  uint16 getParentId();
360 
361 protected:
363  LBAnimationItem *_parent;
364 
365  Common::Rect _bounds, _clip;
367 
368  uint16 _tempo;
369 
370  uint16 _currentSound;
371  CueList _cueList;
372 
373  uint32 _lastTime, _currentFrame;
374  bool _running;
375 
376  void loadShape(uint16 resourceId);
377  Common::Array<uint16> _shapeResources;
378  Common::Array<Common::Point> _shapeOffsets;
379 };
380 
381 class LBItem {
382  friend class LBCode;
383 
384 public:
386  virtual ~LBItem();
387 
388  void readFrom(Common::SeekableReadStreamEndian *stream);
389  void readData(uint16 type, uint16 size, byte *data);
390  virtual void readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream);
391 
392  virtual void destroySelf(); // 0x2
393  virtual void setEnabled(bool enabled); // 0x3
394  virtual void setGlobalEnabled(bool enabled);
395  virtual bool contains(Common::Point point); // 0x7
396  virtual void update(); // 0x8
397  virtual void draw() { } // 0x9
398  virtual void handleKeyChar(Common::Point pos) { } // 0xA
399  virtual void handleMouseDown(Common::Point pos); // 0xB
400  virtual void handleMouseMove(Common::Point pos); // 0xC
401  virtual void handleMouseUp(Common::Point pos); // 0xD
402  virtual bool togglePlaying(bool playing, bool restart = false); // 0xF
403  virtual void done(bool onlyNotify); // 0x10
404  virtual void init(); // 0x11
405  virtual void seek(uint16 pos) { } // 0x13
406  virtual void seekToTime(uint32 time) { }
407  virtual void setFocused(bool focused) { } // 0x14
408  virtual void setVisible(bool visible); // 0x17
409  virtual void setGlobalVisible(bool enabled);
410  virtual void startPhase(uint phase); // 0x18
411  virtual void stop(); // 0x19
412  virtual void notify(uint16 data, uint16 from); // 0x1A
413  virtual void load();
414  virtual void unload();
415  virtual void moveBy(const Common::Point &pos);
416  virtual void moveTo(const Common::Point &pos);
417 
418  LBItem *clone(uint16 newId, const Common::String &newName);
419 
420  uint16 getId() { return _itemId; }
421  const Common::String &getName() { return _desc; }
422  const Common::Rect &getRect() { return _rect; }
423  uint16 getSoundPriority() { return _soundMode; }
424  bool isLoaded() { return _loaded; }
425  bool isAmbient() { return _isAmbient; }
426 
428 
429  // TODO: make private
431 
432 protected:
434  LBPage *_page;
435 
436  void setNextTime(uint16 min, uint16 max);
437  void setNextTime(uint16 min, uint16 max, uint32 start);
438 
439  Common::Rect _rect;
440  Common::String _desc;
441  uint16 _resourceId;
442  uint16 _itemId;
443 
444  bool _loaded, _visible, _globalVisible, _playing, _enabled, _globalEnabled;
445 
446  uint32 _nextTime, _startTime;
447  uint16 _loops;
448 
449  uint16 _phase, _timingMode, _delayMin, _delayMax;
450  uint16 _loopMode, _periodMin, _periodMax;
451  uint16 _controlMode, _soundMode;
452  Common::Point _relocPoint;
453 
454  bool _isAmbient;
455  bool _doHitTest;
456 
457  virtual LBItem *createClone();
458 
459  Common::Array<LBScriptEntry *> _scriptEntries;
460  void runScript(uint event, uint16 data = 0, uint16 from = 0);
461  int runScriptEntry(LBScriptEntry *entry);
462 
463  void runCommand(const Common::String &command);
464  bool checkCondition(const Common::String &condition);
465 
466  LBScriptEntry *parseScriptEntry(uint16 type, uint16 &size, Common::MemoryReadStreamEndian *stream, bool isSubentry = false);
467 };
468 
469 class LBSoundItem : public LBItem {
470 public:
472  ~LBSoundItem() override;
473 
474  void update() override;
475  bool togglePlaying(bool playing, bool restart) override;
476  void stop() override;
477 
478 protected:
479  LBItem *createClone() override;
480 
481  bool _running;
482 };
483 
484 struct GroupEntry {
485  uint entryId;
486  uint entryType;
487 };
488 
489 class LBGroupItem : public LBItem {
490 public:
492 
493  void readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream) override;
494 
495  void destroySelf() override;
496  void setEnabled(bool enabled) override;
497  void setGlobalEnabled(bool enabled) override;
498  bool contains(Common::Point point) override;
499  bool togglePlaying(bool playing, bool restart) override;
500  // 0x12
501  void seek(uint16 pos) override;
502  void setVisible(bool visible) override;
503  void setGlobalVisible(bool visible) override;
504  void startPhase(uint phase) override;
505  void stop() override;
506  void load() override;
507  void unload() override;
508  void moveBy(const Common::Point &pos) override;
509  void moveTo(const Common::Point &pos) override;
510 
511 protected:
512  LBItem *createClone() override;
513 
514  bool _starting;
515 
516  Common::Array<GroupEntry> _groupEntries;
517 };
518 
519 class LBPaletteItem : public LBItem {
520 public:
522  ~LBPaletteItem() override;
523 
524  void readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream) override;
525 
526  bool togglePlaying(bool playing, bool restart) override;
527  void update() override;
528 
529 protected:
530  LBItem *createClone() override;
531 
532  uint16 _fadeInPeriod, _fadeInStep, _drawStart, _drawCount;
533  uint32 _fadeInStart, _fadeInCurrent;
534  byte *_palette;
535 };
536 
537 struct LiveTextWord {
538  Common::Rect bounds;
539  uint16 soundId;
540 
541  uint16 itemType;
542  uint16 itemId;
543 };
544 
546  uint16 wordStart, wordCount;
547  uint16 highlightStart, highlightEnd;
548  uint16 startId, endId;
549 };
550 
551 class LBLiveTextItem : public LBItem {
552 public:
554 
555  void readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream) override;
556 
557  bool contains(Common::Point point) override;
558  void update() override;
559  void draw() override;
560  void handleMouseDown(Common::Point pos) override;
561  bool togglePlaying(bool playing, bool restart) override;
562  void stop() override;
563  void notify(uint16 data, uint16 from) override;
564 
565 protected:
566  LBItem *createClone() override;
567 
568  void paletteUpdate(uint16 word, bool on);
569  void drawWord(uint word, uint yPos);
570 
571  uint16 _currentPhrase, _currentWord;
572 
573  byte _backgroundColor[4];
574  byte _foregroundColor[4];
575  byte _highlightColor[4];
576  uint16 _paletteIndex;
577 
580 };
581 
582 class LBPictureItem : public LBItem {
583 public:
585 
586  void readData(uint16 type, uint16 size, Common::MemoryReadStreamEndian *stream) override;
587 
588  bool contains(Common::Point point) override;
589  void draw() override;
590  void init() override;
591 
592 protected:
593  LBItem *createClone() override;
594 };
595 
596 class LBAnimationItem : public LBItem {
597 public:
599  ~LBAnimationItem() override;
600 
601  void setEnabled(bool enabled) override;
602  bool contains(Common::Point point) override;
603  void update() override;
604  void draw() override;
605  bool togglePlaying(bool playing, bool restart) override;
606  void done(bool onlyNotify) override;
607  void init() override;
608  void seek(uint16 pos) override;
609  void seekToTime(uint32 time) override;
610  void startPhase(uint phase) override;
611  void stop() override;
612 
613 protected:
614  LBItem *createClone() override;
615 
616  LBAnimation *_anim;
617  bool _running;
618 };
619 
620 class LBMovieItem : public LBItem {
621 public:
623  ~LBMovieItem() override;
624 
625  void update() override;
626  bool togglePlaying(bool playing, bool restart) override;
627 
628 protected:
629  LBItem *createClone() override;
630 };
631 
632 class LBMiniGameItem : public LBItem {
633 public:
635  ~LBMiniGameItem() override;
636 
637  bool togglePlaying(bool playing, bool restart) override;
638 
639 protected:
640  LBItem *createClone() override;
641 };
642 
643 class LBProxyItem : public LBItem {
644 public:
646  ~LBProxyItem() override;
647 
648  void load() override;
649  void unload() override;
650 
651 protected:
652  LBItem *createClone() override;
653 
654  class LBPage *_page;
655 };
656 
657 struct NotifyEvent {
658  NotifyEvent(uint t, uint p) : type(t), param(p), newUnknown(0), newMode(0), newPage(0), newSubpage(0) { }
659  uint type;
660  uint param;
661 
662  // kLBNotifyChangeMode
663  uint16 newUnknown;
664  uint16 newMode;
665  uint16 newPage;
666  uint16 newSubpage;
667  Common::String newCursor;
668 };
669 
670 enum DelayedEventType {
671  kLBDelayedEventDestroy = 0,
672  kLBDelayedEventSetNotVisible = 1,
673  kLBDelayedEventDone = 2
674 };
675 
676 struct DelayedEvent {
677  DelayedEvent(LBItem *i, DelayedEventType t) : item(i), type(t) { }
678  LBItem *item;
679  DelayedEventType type;
680 };
681 
682 class LBPage {
683 public:
685  ~LBPage();
686 
687  void open(Archive *mhk, uint16 baseId);
688  uint16 getResourceVersion();
689 
690  void addClonedItem(LBItem *item);
691  void itemDestroyed(LBItem *item);
692 
693  LBCode *_code;
694 
695 protected:
697 
698  Archive *_mhk;
700 
701  uint16 _baseId;
702  bool _cascade;
703 
704  void loadBITL(uint16 resourceId);
705 };
706 
708 protected:
709  Common::Error run() override;
710 
711 public:
713  ~MohawkEngine_LivingBooks() override;
714 
715  Common::RandomSource *_rnd;
716 
717  VideoManager *_video;
718  Sound *_sound;
719  LBGraphics *_gfx;
720  bool _needsRedraw, _needsUpdate;
721 
722  void addNotifyEvent(NotifyEvent event);
723 
724  Common::SeekableReadStreamEndian *wrapStreamEndian(uint32 tag, uint16 id);
725  Common::String readString(Common::ReadStream *stream);
726  Common::Rect readRect(Common::ReadStreamEndian *stream);
727 
728  void addArchive(Archive *archive);
729  void removeArchive(Archive *archive);
730  void addItem(LBItem *item);
731  void removeItems(const Common::Array<LBItem *> &items);
732 
733  LBItem *getItemById(uint16 id);
734  LBItem *getItemByName(Common::String name);
735 
736  void setFocus(LBItem *focus);
737  void setEnableForAll(bool enable, LBItem *except = 0);
738  void notifyAll(uint16 data, uint16 from);
739  void queueDelayedEvent(DelayedEvent event);
740 
741  bool playSound(LBItem *source, uint16 resourceId);
742  void lockSound(LBItem *owner, bool lock);
743 
744  bool isBigEndian() const { return getGameType() != GType_LIVINGBOOKSV1 || getPlatform() == Common::kPlatformMacintosh; }
745  bool isPreMohawk() const;
746 
747  LBMode getCurMode() { return _curMode; }
748 
749  bool tryLoadPageStart(LBMode mode, uint page);
750  bool loadPage(LBMode mode, uint page, uint subpage);
751  void prevPage();
752  void nextPage();
753 
754  // TODO: make private
756 
757  // helper functions, also used by LBProxyItem
758  Common::String getFileNameFromConfig(const Common::String &section, const Common::String &key, Common::String &leftover);
759  Archive *createArchive() const;
760 
761 private:
762  Common::INIFile _bookInfoFile;
763 
764  Common::Path getBookInfoFileName() const;
765  void loadBookInfo(const Common::Path &filename);
766 
767  Common::String stringForMode(LBMode mode);
768 
769  bool _readOnly, _introDone;
770  LBMode _curMode;
771  uint16 _curPage, _curSubPage;
772  uint16 _phase;
773  LBPage *_page;
775  Common::List<LBItem *> _orderedItems;
776  Common::Queue<DelayedEvent> _eventQueue;
777  LBItem *_focus;
778  void destroyPage();
779  void updatePage();
780 
781  uint16 _lastSoundOwner, _lastSoundId;
782  uint16 _lastSoundPriority;
783  uint16 _soundLockOwner;
784  uint16 _maxSoundPriority;
785 
786  void loadSHP(uint16 resourceId);
787 
788  bool tryDefaultPage();
789 
790  void handleUIMenuClick(uint controlId);
791  void handleUIPoetryMenuClick(uint controlId);
792  void handleUIQuitClick(uint controlId);
793  void handleUIOptionsClick(uint controlId);
794 
795  Common::Queue<NotifyEvent> _notifyEvents;
796  void handleNotify(NotifyEvent &event);
797 
798  uint16 _screenWidth;
799  uint16 _screenHeight;
800  uint16 _numLanguages;
801  uint16 _numPages;
802  Common::String _title;
803  Common::String _copyright;
804  bool _poetryMode;
805 
806  uint16 _curLanguage;
807  uint16 _curSelectedPage;
808  bool _alreadyShowedIntro;
809 
810  // String Manipulation Functions
811  Common::String removeQuotesFromString(const Common::String &string, Common::String &leftover);
812  Common::String convertMacFileName(const Common::String &string);
813  Common::String convertWinFileName(const Common::String &string);
814 
815  // Configuration File Functions
816  Common::String getStringFromConfig(const Common::String &section, const Common::String &key);
817  Common::String getStringFromConfig(const Common::String &section, const Common::String &key, Common::String &leftover);
818  int getIntFromConfig(const Common::String &section, const Common::String &key);
819 
820  void pauseEngineIntern(bool) override;
821 };
822 
823 } // End of namespace Mohawk
824 
825 #endif
Definition: livingbooks.h:545
Definition: stream.h:854
Definition: livingbooks.h:620
Definition: str.h:59
Definition: livingbooks.h:551
Definition: livingbooks_code.h:212
Definition: livingbooks.h:333
Definition: livingbooks.h:308
Definition: error.h:84
Definition: livingbooks.h:484
Definition: random.h:44
Definition: livingbooks_graphics.h:31
Definition: list.h:44
Definition: livingbooks.h:676
Definition: rect.h:144
Definition: path.h:52
Definition: resource.h:134
Definition: queue.h:42
Definition: memstream.h:103
Definition: video.h:244
Definition: livingbooks.h:381
Definition: livingbooks.h:643
Definition: sound.h:102
Definition: livingbooks.h:537
Definition: hashmap.h:85
Definition: livingbooks.h:657
Definition: livingbooks.h:302
Definition: sound.h:74
Definition: algorithm.h:29
Definition: rect.h:45
Definition: mohawk.h:54
Definition: livingbooks.h:469
Definition: livingbooks.h:49
Definition: livingbooks.h:260
Definition: livingbooks.h:489
Definition: ini-file.h:58
Definition: livingbooks.h:632
Definition: stream.h:944
Definition: stream.h:385
Definition: livingbooks.h:582
Definition: list_intern.h:51
Definition: system.h:161
Definition: livingbooks.h:682
Definition: livingbooks.h:596
Definition: bitmap.h:32
Definition: detection.h:65
Definition: livingbooks.h:519
Definition: livingbooks.h:707