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