22 #ifndef GRAPHICS_MACGUI_MACWINDOWMANAGER_H 23 #define GRAPHICS_MACGUI_MACWINDOWMANAGER_H 25 #include "common/hashmap.h" 26 #include "common/list.h" 27 #include "common/mutex.h" 28 #include "common/stack.h" 29 #include "common/events.h" 31 #include "graphics/font.h" 32 #include "graphics/fontman.h" 33 #include "graphics/palette.h" 34 #include "graphics/macgui/macwindow.h" 35 #include "graphics/macgui/macmenu.h" 37 #include "engines/engine.h" 45 namespace MacGUIConstants {
65 kPatternCheckers2 = 4,
66 kPatternLightGray = 5,
82 kWMModeNoDesktop = (1 << 0),
83 kWMModeAutohideMenu = (1 << 1),
84 kWMModalMenuMode = (1 << 2),
85 kWMModeForceBuiltinFonts = (1 << 3),
86 kWMModeUnicode = (1 << 4),
87 kWMModeManualDrawWidgets = (1 << 5),
88 kWMModeFullscreen = (1 << 6),
89 kWMModeButtonDialogStyle = (1 << 7),
90 kWMMode32bpp = (1 << 8),
91 kWMNoScummVMWallpaper = (1 << 9),
92 kWMModeWin95 = (1 << 10),
93 kWMModeForceMacFontsInWin95 = (1 << 11),
94 kWMModeNoCursorOverride = (1 << 12),
95 kWMModeForceMacBorder = (1 << 13),
96 kWMModeForceMacFonts = (1 << 14),
97 kWMModeNoSystemRedraw = (1 << 15),
101 using namespace MacGUIConstants;
105 class ManagedSurface;
114 class MacFontManager;
121 MacPatterns *patterns;
130 surface(s), mask(m), patterns(p), fillType(f), fillOriginX(fx), fillOriginY(fy), thickness(t), bgColor(bg), invert(inv) {
153 Primitives &getDrawPrimitives()
const {
return *_macDrawPrimitives; }
168 void setScreen(
int w,
int h);
182 MacWindow *addWindow(
bool scrollable,
bool resizable,
bool editable);
185 void resizeScreen(
int w,
int h);
192 void addWindowInitialized(
MacWindow *macwindow);
210 void addMenu(
int id,
MacMenu *menu);
215 void activateScreenCopy();
216 void disableScreenCopy();
219 void setDesktopMode(uint32 mode);
235 void setActiveWindow(
int id);
237 int getActiveWindow() {
return _activeWindow; }
244 MacWindow *findWindowAtPoint(int16 x, int16 y);
287 if (
id >= 0 &&
id < (
int)_windows.size())
318 void setBackgroundWindow(
MacWindow *window);
320 MacPatterns &getBuiltinPatterns() {
return _builtinPatterns; }
322 MacWidget *getActiveWidget() {
return _activeWidget; }
323 MacWidget *getLockedWidget() {
return _lockedWidget; }
325 Common::Rect getScreenBounds() {
return _screen ? _screen->getBounds() : _screenDims; }
329 void printWMMode(
int debuglevel = 0);
332 void replaceCursorType(MacCursorType type);
335 MacCursorType getCursorType()
const;
336 static bool getBuiltInCursorData(MacCursorType type,
const byte *&data,
const byte *&palette,
337 const byte *&mask,
int &w,
int &h,
int &hotspotX,
int &hotspotY,
int &transColor);
339 void pushCursor(MacCursorType type,
Cursor *cursor =
nullptr);
340 void replaceCursor(MacCursorType type,
Cursor *cursor =
nullptr);
342 void pushCustomCursor(
const byte *data,
int w,
int h,
int hx,
int hy,
int transcolor);
343 void replaceCustomCursor(
const byte *data,
int w,
int h,
int hx,
int hy,
int transcolor);
349 void setMode(uint32 mode);
351 void setEngine(
Engine *engine);
352 void setEngineRedrawCallback(
void *engine,
void (*redrawCallback)(
void *engine));
353 void setEngineActivateMenuCallback(
void *engine,
void (*redrawCallback)(
void *engine));
355 void passPalette(
const byte *palette, uint size);
356 template <
typename T>
void decomposeColor(uint32 color, byte &r, byte &g, byte &b);
357 uint32 findBestColor(byte cr, byte cg, byte cb);
358 uint32 findBestColor(uint32 color);
359 void setDesktopColor(byte, byte, byte);
361 byte inverter(byte src);
363 const byte *getPalette() {
return _palette; }
364 uint getPaletteSize() {
return _paletteSize; }
366 void renderZoomBox(
bool redraw =
false);
371 void loadDataBundle();
372 void cleanupDataBundle();
373 void cleanupDesktopBmp();
392 void clearHandlingWidgets();
394 void setMenuItemCheckMark(
MacMenuItem *menuItem,
bool checkMark);
395 void setMenuItemEnabled(
MacMenuItem *menuItem,
bool enabled);
397 void setMenuItemAction(
MacMenuItem *menuItem,
int actionId);
407 void setTTSEnabled(
bool enabled);
421 uint32 _colorBlack, _colorGray80, _colorGray88, _colorGrayEE, _colorWhite, _colorGreen, _colorGreen2;
427 bool _hilitingWidget;
437 bool haveZoomBox() {
return !_zoomBoxes.empty(); }
463 bool _inEditableArea;
468 MacPatterns _patterns;
469 MacPatterns _builtinPatterns;
478 void (*_redrawEngineCallback)(
void *engine);
480 void (*_activateMenuCallback)(
void *engine);
482 MacCursorType _tempType = kMacCursorArrow;
484 Cursor *_cursor =
nullptr;
503 const Common::U32String::value_type *readHex(uint16 *res,
const Common::U32String::value_type *s,
int len);
Definition: managed_surface.h:51
TextAlign
Definition: font.h:48
BaseMacWindow * getWindow(int id)
Definition: macwindowmanager.h:286
Definition: macfontmanager.h:152
Definition: macwindow.h:205
Definition: mactextwindow.h:30
Definition: macwindowmanager.h:134
MacPatterns & getPatterns()
Definition: macwindowmanager.h:296
Definition: palette.h:195
void setMenuHotzone(const Common::Rect &rect)
Definition: macwindowmanager.h:224
Definition: macwindowmanager.h:148
int getNextId()
Definition: macwindowmanager.h:202
Definition: archive.h:141
Definition: macwindowborder.h:57
Definition: primitives.h:29
Definition: atari-cursor.h:35
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: macwindowmanager.h:118
Definition: macfontmanager.h:110
int getLastId()
Definition: macwindowmanager.h:197
Definition: macwindow.h:80
void setMenuDelay(int delay)
Definition: macwindowmanager.h:229
Language
Definition: language.h:45
void setFullRefresh(bool redraw)
Definition: macwindowmanager.h:262