ScummVM API documentation
macgui_impl.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 SCUMM_MACGUI_MACGUI_IMPL_H
23 #define SCUMM_MACGUI_MACGUI_IMPL_H
24 
25 #define TEXT_END_MARKER { 0, 0, kStyleRegular, Graphics::kTextAlignLeft, nullptr }
26 
27 #include "common/events.h"
28 #include "common/hashmap.h"
29 #include "common/rect.h"
30 #include "common/str.h"
31 #include "common/str-array.h"
32 
33 #include "engines/engine.h"
34 
35 #include "graphics/font.h"
36 #include "graphics/surface.h"
37 
38 // Use negative values for these. Zero and upwards are reserved for widget IDs.
39 
40 #define kDialogQuit -1
41 #define kDialogWantsAttention -2
42 
43 class OSystem;
44 
45 namespace Graphics {
46 struct Surface;
47 class MacWindowManager;
48 }
49 
50 namespace Scumm {
51 
52 class ScummEngine;
53 class Actor;
54 
55 class MacGuiImpl {
56 public:
57  class MacDialogWindow;
58 
59  enum MacStringIds {
60  kMSISkip = -1,
61  kMSIAboutGameName = 1,
62  kMSIRoughCommandMsg,
63  kMSIAreYouSureYouWantToQuit,
64  kMSIAreYouSureYouWantToRestart,
65  kMSIGameName,
66  kMSIOpenGameFile,
67  kMSISaveGameFileAs,
68  kMSIGameFile,
69  kMSIAboutString1,
70  kMSIAboutString2,
71  kMSIAboutString3,
72  kMSIAboutString4,
73  kMSIAboutString5,
74  kMSIAboutString6,
75  kMSIAboutString7,
76  kMSIAboutString8,
77  kMSIAboutString9,
78  kMSIAboutString10,
79  kMSIAboutString11,
80  kMSIAboutString12,
81  kMSIAboutString13,
82  kMSIAboutString14,
83  kMSIAboutString15,
84  kMSIAboutString16,
85  kMSIAboutString17,
86  kMSIAboutString18,
87  kMSIAboutString19,
88  kMSIAboutString20,
89  kMSIAboutString21,
90  kMSIAboutString22,
91  kMSIAboutString23,
92  kMSIAboutString24,
93  kMSIAboutString25,
94  kMSIAboutString26,
95  kMSIAboutString27,
96  kMSIAboutString28,
97  kMSIAboutString29,
98  kMSIAboutString30,
99  kMSIAboutString31,
100  kMSIAboutString32,
101  kMSIAboutString33,
102  kMSIAboutString34,
103  kMSIAboutString35,
104  kMSIAboutString36,
105  kMSIAboutString37,
106  kMSIAboutString38,
107  kMSIAboutString39,
108  kMSIAboutString40
109  };
110 
111  enum ParsingMethod {
112  kStrC,
113  kStrPascal,
114  };
115 
117  MacStringIds strId;
118  ParsingMethod parsingMethod;
119  int numStrings;
120  };
121 
122  enum MacWidgetType {
123  kWidgetUnknown,
124  kWidgetButton,
125  kWidgetCheckbox,
126  kWidgetStaticText,
127  kWidgetEditText,
128  kWidgetPicture,
129  kWidgetSlider,
130  kWidgetListBox,
131  kWidgetPictureSlider
132  };
133 
134 protected:
135  ScummEngine *_vm = nullptr;
136  OSystem *_system = nullptr;
137 
138  Graphics::Surface *_surface = nullptr;
139  MacGuiImpl::MacDialogWindow *_bannerWindow = nullptr;
140 
141  Common::Path _resourceFile;
142 
143  bool _paletteDirty = false;
144 
145  bool _menuIsActive = false;
146  bool _cursorWasVisible = false;
147 
149  Common::Array<Common::String> _strsStrings;
150 
151  int _gameFontId = -1;
152 
153  byte _unicodeToMacRoman[96];
154 
155  enum DelayStatus {
156  kDelayDone = 0,
157  kDelayInterrupted = 1,
158  kDelayAborted
159  };
160 
161  enum FontId {
162  kSystemFont,
163 
164  kAboutFontRegular,
165  kAboutFontBold,
166  kAboutFontBold2,
167  kAboutFontExtraBold,
168  kAboutFontHeaderInside,
169  kAboutFontHeaderOutside,
170  kAboutFontHeader,
171  kAboutFontHeaderSimple1,
172  kAboutFontHeaderSimple2,
173 
174  kIndy3FontSmall,
175  kIndy3FontMedium,
176  kIndy3VerbFontRegular,
177  kIndy3VerbFontBold,
178  kIndy3VerbFontOutline,
179 
180  kLoomFontSmall,
181  kLoomFontMedium,
182  kLoomFontLarge
183  };
184 
185  enum TextStyle {
186  kStyleHeader1,
187  kStyleHeader2,
188  kStyleHeaderSimple1,
189  kStyleHeaderSimple2,
190  kStyleBold,
191  kStyleBold2,
192  kStyleExtraBold,
193  kStyleRegular
194  };
195 
196  struct TextLine {
197  int x;
198  int y;
199  TextStyle style;
200  Graphics::TextAlign align;
201  const char *str;
202  };
203 
204  enum MacDialogWindowStyle {
205  kWindowStyleNormal,
206  kWindowStyleRounded
207  };
208 
209  enum MacDialogMenuStyle {
210  kMenuStyleNone,
211  kMenuStyleDisabled,
212  kMenuStyleApple
213  };
214 
215  MacGuiImpl::DelayStatus delay(uint32 ms = 0);
216 
217  virtual bool getFontParams(FontId fontId, int &id, int &size, int &slant) const;
218 
219  Common::String getDialogString(Common::SeekableReadStream *res, int len);
220 
221  virtual bool handleMenu(int id, Common::String &name);
222 
223  virtual void runAboutDialog() = 0;
224  virtual bool runOpenDialog(int &saveSlotToHandle);
225  virtual bool runSaveDialog(int &saveSlotToHandle, Common::String &saveName);
226  virtual bool runOptionsDialog() = 0;
227  void prepareSaveLoad(Common::StringArray &savegameNames, bool *availSlots, int *slotIds, int size);
228 
229  bool runOkCancelDialog(Common::String text);
230 
231  bool readStrings();
232  void parseSTRSBlock(uint8 *strsData, const MacSTRSParsingEntry *parsingTable, int parsingTableSize);
233 
234  // These are non interactable, no point in having them as widgets for now...
235  void drawFakePathList(MacDialogWindow *window, Common::Rect r, const char *text);
236  void drawFakeDriveLabel(MacDialogWindow *window, Common::Rect r, const char *text);
237 
238 public:
239  class MacGuiObject {
240  protected:
241  Common::Rect _bounds;
242  bool _redraw = false;
243  bool _enabled = false;
244  bool _visible = true;
245 
246  public:
247  MacGuiObject(Common::Rect bounds, bool enabled) : _bounds(bounds), _enabled(enabled) {}
248  virtual ~MacGuiObject() {}
249 
250  Common::Rect getBounds() const { return _bounds; }
251  bool getRedraw() const { return _redraw; }
252  bool isEnabled() const { return _enabled; }
253  bool isVisible() const { return _visible; }
254  };
255 
256  class MacWidget : public MacGuiObject {
257  protected:
259  uint32 _black;
260  uint32 _white;
261 
262  int _id = -1;
263  MacWidgetType _type = kWidgetUnknown;
264 
265  bool _fullRedraw = false;
266 
267  Common::String _text;
268  int _value = 0;
269 
270  int drawText(Common::String text, int x, int y, int w, uint32 fg = 0, uint32 bg = 0, Graphics::TextAlign align = Graphics::kTextAlignLeft, bool wordWrap = false, int deltax = 0) const;
271  void drawBitmap(Common::Rect r, const uint16 *bitmap, uint32 color) const;
272 
273  public:
274  MacWidget(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, Common::String text, bool enabled);
275  virtual ~MacWidget() {};
276 
277  void setId(int id) { _id = id; }
278  int getId() const { return _id; }
279 
280  void setType(MacWidgetType type) { _type = type; }
281  MacWidgetType getType() { return _type; }
282 
283  // Visibility never changes after initialization, so it does
284  // not trigger a redraw.
285  void setVisible(bool visible) { _visible = visible; }
286 
287  virtual void getFocus() { setRedraw(); }
288  virtual void loseFocus() { setRedraw(); }
289 
290  virtual void setRedraw(bool fullRedraw = false);
291 
292  void setEnabled(bool enabled);
293 
294  virtual void setValue(int value);
295  int getValue() const { return _value; }
296 
297  Common::String getText() const;
298 
299  virtual bool useBeamCursor() { return false; }
300  virtual bool findWidget(int x, int y) const;
301  virtual bool shouldDeferAction() { return false; }
302 
303  virtual void draw(bool drawFocused = false) = 0;
304 
305  virtual void handleMouseDown(Common::Event &event) {}
306  virtual bool handleDoubleClick(Common::Event &event) { return false; }
307  virtual bool handleMouseUp(Common::Event &event) { return false; }
308  virtual void handleMouseMove(Common::Event &event) {}
309  virtual void handleMouseHeld() {}
310  virtual void handleWheelUp() {}
311  virtual void handleWheelDown() {}
312  virtual bool handleKeyDown(Common::Event &event) { return false; }
313  };
314 
315  class MacButton : public MacWidget {
316  private:
317  struct CornerLine {
318  int start;
319  int length;
320  };
321 
322  void hLine(int x0, int y0, int x1, bool enabled);
323  void vLine(int x0, int y0, int y1, bool enabled);
324  void drawCorners(Common::Rect r, CornerLine *corner, bool enabled);
325 
326  public:
327  MacButton(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, Common::String text, bool enabled) : MacWidget(window, bounds, text, enabled) {}
328 
329  void draw(bool drawFocused = false);
330 
331  bool handleMouseUp(Common::Event &event) { return true; }
332  };
333 
334  class MacCheckbox : public MacWidget {
335  private:
336  Common::Rect _hitBounds;
337 
338  public:
339  MacCheckbox(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, Common::String text, bool enabled);
340 
341  bool findWidget(int x, int y) const;
342  void draw(bool drawFocused = false);
343  bool handleMouseUp(Common::Event &event);
344  };
345 
346  // The dialogs add texts as disabled, but we don't want it to be drawn
347  // as disabled so we enable it and make it "disabled" by giving it a
348  // custom findWidget().
349 
350  class MacStaticText : public MacWidget {
351  private:
352  uint32 _fg;
353  uint32 _bg;
355  bool _wordWrap = false;
356 
357  public:
360  Common::Rect bounds, Common::String text,
361  bool enabled, Graphics::TextAlign alignment = Graphics::kTextAlignLeft) : MacWidget(window, bounds, text, true) {
362  _alignment = alignment;
363  _fg = _black;
364  _bg = _white;
365  }
366 
367  void getFocus() {}
368  void loseFocus() {}
369 
370  void setWordWrap(bool wordWrap) { _wordWrap = wordWrap; }
371 
372  void setText(Common::String text) {
373  if (text != _text) {
374  _text = text;
375  setRedraw();
376  }
377  }
378 
379  void setColor(uint32 fg, uint32 bg) {
380  if (fg != _fg || bg != _bg) {
381  _fg = fg;
382  _bg = bg;
383  setRedraw();
384  }
385  }
386 
387  void draw(bool drawFocused = false);
388  };
389 
390  class MacEditText : public MacWidget {
391  private:
392  // Max length of a SCUMM saved game name. We could make this
393  // configurable later, if needed.
394  uint _maxLength = 31;
395 
396  int _textPos = 1;
397  int _selectLen = 0;
398  int _caretPos = 0;
399  int _caretX = -1;
400 
401  uint32 _nextCaretBlink = 0;
402  bool _caretVisible = true;
403 
404  const Graphics::Font *_font;
405  Graphics::Surface _textSurface;
406 
407  int getTextPosFromMouse(int x, int y);
408 
409  void updateSelection(int x, int y);
410  void deleteSelection();
411 
412  public:
413  MacEditText(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, Common::String text, bool enabled);
414 
415  void getFocus() override {}
416  void loseFocus() override {}
417 
418  void selectAll();
419 
420  bool useBeamCursor() override { return true; }
421  bool findWidget(int x, int y) const override;
422  bool shouldDeferAction() override { return true; }
423 
424  void draw(bool drawFocused = false) override;
425 
426  void handleMouseDown(Common::Event &event) override;
427  bool handleDoubleClick(Common::Event &event) override;
428  bool handleKeyDown(Common::Event &event) override;
429  void handleMouseHeld() override;
430  void handleMouseMove(Common::Event &event) override;
431  };
432 
433  class MacPicture : public MacWidget {
434  private:
435  Graphics::Surface *_picture = nullptr;
436 
437  public:
438  MacPicture(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, int id, bool enabled);
439  ~MacPicture();
440 
441  Graphics::Surface *getPicture() const { return _picture; }
442 
443  void draw(bool drawFocused = false);
444  };
445 
446  class MacSliderBase : public MacWidget {
447  protected:
448  int _minValue;
449  int _maxValue;
450  int _minPos;
451  int _maxPos;
452  int _handlePos = -1;
453  int _grabOffset = -1;
454 
455  int calculateValueFromPos() const;
456  int calculatePosFromValue() const;
457 
458  public:
459  MacSliderBase(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, int minValue, int maxValue, int minPos, int maxPos, bool enabled)
460  : MacWidget(window, bounds, "SliderBase", enabled),
461  _minValue(minValue), _maxValue(maxValue),
462  _minPos(minPos), _maxPos(maxPos) {}
463 
464  void getFocus() {}
465  void loseFocus() {}
466 
467  void setValue(int value);
468  };
469 
470  class MacSlider : public MacSliderBase {
471  private:
472  Common::Point _clickPos;
473  uint32 _nextRepeat = 0;
474 
475  int _pageSize = 0;
476  int _paging = 0;
477 
478  bool _upArrowPressed = false;
479  bool _downArrowPressed = false;
480 
481  Common::Rect _boundsButtonUp;
482  Common::Rect _boundsButtonDown;
483  Common::Rect _boundsBody;
484 
485  Common::Rect getHandleRect(int value);
486 
487  void fill(Common::Rect r, bool inverted = false);
488 
489  void drawUpArrow(bool markAsDirty);
490  void drawDownArrow(bool markAsDirty);
491  void drawArrow(Common::Rect r, const uint16 *bitmap, bool markAsDirty);
492 
493  void eraseDragHandle();
494  void drawHandle(Common::Rect r);
495 
496  public:
497  MacSlider(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, int minValue, int maxValue, int pageSize, bool enabled);
498 
499  bool isScrollable() const { return (_maxValue - _minValue) > 0; }
500  int getPageSize() const { return _pageSize; }
501 
502  bool findWidget(int x, int y) const;
503  void draw(bool drawFocued = false);
504  void redrawHandle(int oldValue, int newValue);
505 
506  void handleMouseDown(Common::Event &event);
507  bool handleMouseUp(Common::Event &event);
508  void handleMouseMove(Common::Event &event);
509  void handleMouseHeld();
510  void handleWheelUp();
511  void handleWheelDown();
512  };
513 
515  private:
516  MacPicture *_background;
517  MacPicture *_handle;
518  int _minX;
519  int _maxX;
520 
521  void eraseHandle();
522  void drawHandle();
523 
524  public:
525  MacPictureSlider(MacGuiImpl::MacDialogWindow *window, MacPicture *background, MacPicture *handle, bool enabled, int minX, int maxX, int minValue, int maxValue, int leftMargin, int rightMargin)
526  : MacSliderBase(window, background->getBounds(), minValue, maxValue, minX + leftMargin, maxX - rightMargin, enabled),
527  _background(background), _handle(handle), _minX(minX),
528  _maxX(maxX) {}
529 
530  bool findWidget(int x, int y) const;
531  void draw(bool drawFocused = false);
532 
533  void handleMouseDown(Common::Event &event);
534  bool handleMouseUp(Common::Event &event);
535  void handleMouseMove(Common::Event &event);
536  void handleWheelUp();
537  void handleWheelDown();
538  };
539 
540  class MacListBox : public MacWidget {
541  private:
542  Common::StringArray _texts;
543  Common::Array<MacStaticText *> _textWidgets;
544  MacSlider *_slider;
545  bool _sliderFocused = false;
546 
547  void updateTexts();
548  void handleWheel(int distance);
549 
550  public:
551  MacListBox(MacGuiImpl::MacDialogWindow *window, Common::Rect bounds, Common::StringArray texts, bool enabled, bool contentUntouchable = true);
552  ~MacListBox();
553 
554  void getFocus() {}
555  void loseFocus() {}
556 
557  void setValue(int value) {
558  if (value != _value) {
559  _value = value;
560  updateTexts();
561  }
562  }
563 
564  int getValue() {
565  return _value;
566  }
567 
568  bool findWidget(int x, int y) const;
569  void setRedraw(bool fullRedraw = false);
570  void draw(bool drawFocused = false);
571 
572  void handleMouseDown(Common::Event &event);
573  bool handleDoubleClick(Common::Event &event);
574  bool handleMouseUp(Common::Event &event);
575  void handleMouseMove(Common::Event &event);
576  void handleMouseHeld();
577  void handleWheelUp();
578  void handleWheelDown();
579  bool handleKeyDown(Common::Event &event);
580  };
581 
583  private:
584  uint32 _black;
585  uint32 _white;
586 
587  bool _shakeWasEnabled;
588 
589  Common::Rect _bounds;
590  int _margin;
591 
592  bool _visible = false;
593 
594  uint32 _lastClickTime = 0;
595  Common::Point _lastClickPos;
596 
597  Graphics::Surface *_beamCursor = nullptr;
598  Common::Point _beamCursorPos;
599  bool _cursorWasVisible = false;
600  bool _beamCursorVisible = false;
601  const int _beamCursorHotspotX = 3;
602  const int _beamCursorHotspotY = 4;
603 
604  void drawBeamCursor();
605  void undrawBeamCursor();
606 
607  PauseToken _pauseToken;
608 
609  Graphics::Surface *_from = nullptr;
610  Graphics::Surface *_backup = nullptr;
611  Graphics::Surface _surface;
612  Graphics::Surface _innerSurface;
613 
615 
616  MacWidget *_defaultWidget = nullptr;
617 
618  MacWidget *_focusedWidget = nullptr;
619  Common::Point _focusClick;
620  Common::Point _oldMousePos;
621  Common::Point _mousePos;
622  Common::Point _realMousePos;
623 
624  Common::StringArray _substitutions;
625  Common::Array<Common::Rect> _dirtyRects;
626 
627  void copyToScreen(Graphics::Surface *s = nullptr) const;
628 
629  void addWidget(MacWidget *widget, MacWidgetType type);
630 
631  public:
632  OSystem *_system;
633  MacGuiImpl *_gui;
634 
635  MacDialogWindow(MacGuiImpl *gui, OSystem *system, Graphics::Surface *from, Common::Rect bounds, MacDialogWindowStyle windowStyle = kWindowStyleNormal, MacDialogMenuStyle menuStyle = kMenuStyleDisabled);
636  ~MacDialogWindow();
637 
638  Graphics::Surface *surface() { return &_surface; }
639  Graphics::Surface *innerSurface() { return &_innerSurface; }
640 
641  bool isVisible() const { return _visible; }
642 
643  void show();
644  int runDialog(Common::Array<int> &deferredActionIds);
645  void updateCursor();
646 
647  MacWidget *getWidget(MacWidgetType type, int nr = 0) const;
648 
649  void setDefaultWidget(MacWidget *widget) { _defaultWidget = widget; }
650  MacWidget *getDefaultWidget() const { return _defaultWidget; }
651 
652  void setFocusedWidget(int x, int y);
653  void clearFocusedWidget();
654  MacWidget *getFocusedWidget() const { return _focusedWidget; }
655  Common::Point getFocusClick() const { return _focusClick; }
656  Common::Point getMousePos() const { return _mousePos; }
657 
658  int findWidget(int x, int y) const;
659 
660  MacGuiImpl::MacButton *addButton(Common::Rect bounds, Common::String text, bool enabled);
661  MacGuiImpl::MacCheckbox *addCheckbox(Common::Rect bounds, Common::String text, bool enabled);
662  MacGuiImpl::MacStaticText *addStaticText(Common::Rect bounds, Common::String text, bool enabled, Graphics::TextAlign alignment = Graphics::kTextAlignLeft);
663  MacGuiImpl::MacEditText *addEditText(Common::Rect bounds, Common::String text, bool enabled);
664  MacGuiImpl::MacPicture *addPicture(Common::Rect bounds, int id, bool enabled);
665  MacGuiImpl::MacSlider *addSlider(int x, int y, int h, int minValue, int maxValue, int pageSize, bool enabled);
666  MacGuiImpl::MacPictureSlider *addPictureSlider(int backgroundId, int handleId, bool enabled, int minX, int maxX, int minValue, int maxValue, int leftMargin = 0, int rightMargin = 0);
667  MacGuiImpl::MacListBox *addListBox(Common::Rect bounds, Common::StringArray texts, bool enabled, bool contentUntouchable = false);
668 
669  void addSubstitution(Common::String text) { _substitutions.push_back(text); }
670  void replaceSubstitution(int nr, Common::String text) { _substitutions[nr] = text; }
671 
672  bool hasSubstitution(uint n) const { return n < _substitutions.size(); }
673  Common::String &getSubstitution(uint n) { return _substitutions[n]; }
674 
675  void markRectAsDirty(Common::Rect r);
676  void update(bool fullRedraw = false);
677 
678  static void plotPixel(int x, int y, int color, void *data);
679  static void plotPattern(int x, int y, int pattern, void *data);
680  static void plotPatternDarkenOnly(int x, int y, int pattern, void *data);
681 
682  void drawDottedHLine(int x0, int y, int x1);
683  void fillPattern(Common::Rect r, uint16 pattern, bool fillBlack = true, bool fillWhite = true);
684  void drawSprite(const Graphics::Surface *sprite, int x, int y);
685  void drawSprite(const Graphics::Surface *sprite, int x, int y, Common::Rect clipRect);
686  void drawTexts(Common::Rect r, const TextLine *lines, bool inverse = false);
687  void drawTextBox(Common::Rect r, const TextLine *lines, bool inverse = false, int arc = 9);
688  };
689 
690  MacGuiImpl(ScummEngine *vm, const Common::Path &resourceFile);
691  virtual ~MacGuiImpl();
692 
693  Graphics::MacWindowManager *_windowManager = nullptr;
694  bool _forceMenuClosed = false;
695 
696  virtual int getNumColors() const = 0;
697 
698  Graphics::Surface *surface() { return _surface; }
699  uint32 getBlack() const;
700  uint32 getWhite() const;
701 
702  virtual const Common::String name() const = 0;
703 
704  Common::String readCString(uint8 *&data);
705  Common::String readPascalString(uint8 *&data);
706 
707  int toMacRoman(int unicode) const;
708 
709  void setPaletteDirty();
710  void updatePalette();
711 
712  virtual bool handleEvent(Common::Event event);
713 
714  static void menuCallback(int id, Common::String &name, void *data);
715  virtual bool initialize();
716  void updateWindowManager();
717 
718  const Graphics::Font *getFont(FontId fontId);
719  virtual const Graphics::Font *getFontByScummId(int32 id) = 0;
720 
721  Graphics::Surface *loadPict(int id);
722 
723  virtual bool isVerbGuiActive() const { return false; }
724  virtual void reset() {}
725  virtual void resetAfterLoad() = 0;
726  virtual void update(int delta) = 0;
727 
728  bool runQuitDialog();
729  bool runRestartDialog();
730 
731  virtual void setupCursor(int &width, int &height, int &hotspotX, int &hotspotY, int &animate) = 0;
732 
733  virtual Graphics::Surface *textArea() { return nullptr; }
734  virtual void clearTextArea() {}
735  virtual void initTextAreaForActor(Actor *a, byte color) {}
736  virtual void printCharToTextArea(int chr, int x, int y, int color) {}
737 
738  MacDialogWindow *createWindow(Common::Rect bounds, MacDialogWindowStyle style = kWindowStyleNormal, MacDialogMenuStyle menuStyle = kMenuStyleDisabled);
739  MacDialogWindow *createDialog(int dialogId);
740  void drawBanner(char *message);
741  void undrawBanner();
742 
743  void drawBitmap(Graphics::Surface *s, Common::Rect r, const uint16 *bitmap, uint32 color) const;
744 };
745 
746 } // End of namespace Scumm
747 #endif
Definition: engine.h:103
Definition: macgui_impl.h:55
Definition: macgui_impl.h:470
Definition: str.h:59
Definition: font.h:83
TextAlign
Definition: font.h:48
Definition: surface.h:67
Definition: macgui_impl.h:350
Definition: macgui_impl.h:334
Align the text to the left.
Definition: font.h:51
Definition: rect.h:144
Definition: path.h:52
Definition: macgui_impl.h:390
Definition: stream.h:745
Definition: macwindowmanager.h:149
Definition: scumm.h:519
Definition: macgui_impl.h:514
Definition: macgui_impl.h:315
Definition: macgui_impl.h:540
void push_back(const T &element)
Definition: array.h:180
Definition: hashmap.h:85
Definition: events.h:199
Definition: macgui_impl.h:582
Definition: formatinfo.h:28
Definition: rect.h:45
size_type size() const
Definition: array.h:315
Definition: macgui_impl.h:239
Definition: actor.h:97
Definition: macgui_impl.h:433
signed char * fill(signed char *first, signed char *last, Value val)
Definition: algorithm.h:168
Definition: macgui_impl.h:116
Definition: system.h:161
Definition: macgui_impl.h:446
Definition: actor.h:30
Definition: macgui_impl.h:196
Definition: macgui_impl.h:256