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),
100 using namespace MacGUIConstants;
104 class ManagedSurface;
113 class MacFontManager;
120 MacPatterns *patterns;
129 surface(s), mask(m), patterns(p), fillType(f), fillOriginX(fx), fillOriginY(fy), thickness(t), bgColor(bg), invert(inv) {
143 typedef void (* MacDrawPixPtr)(int, int, int,
void *);
154 MacDrawPixPtr getDrawPixel();
155 MacDrawPixPtr getDrawInvertPixel();
169 void setScreen(
int w,
int h);
183 MacWindow *addWindow(
bool scrollable,
bool resizable,
bool editable);
186 void resizeScreen(
int w,
int h);
193 void addWindowInitialized(
MacWindow *macwindow);
211 void addMenu(
int id,
MacMenu *menu);
216 void activateScreenCopy();
217 void disableScreenCopy();
220 void setDesktopMode(uint32 mode);
236 void setActiveWindow(
int id);
243 MacWindow *findWindowAtPoint(int16 x, int16 y);
313 void setBackgroundWindow(
MacWindow *window);
315 MacPatterns &getBuiltinPatterns() {
return _builtinPatterns; }
317 MacWidget *getActiveWidget() {
return _activeWidget; }
318 MacWidget *getLockedWidget() {
return _lockedWidget; }
320 Common::Rect getScreenBounds() {
return _screen ? _screen->getBounds() : _screenDims; }
324 void printWMMode(
int debuglevel = 0);
327 void replaceCursorType(MacCursorType type);
330 MacCursorType getCursorType()
const;
332 void pushCursor(MacCursorType type,
Cursor *cursor =
nullptr);
333 void replaceCursor(MacCursorType type,
Cursor *cursor =
nullptr);
335 void pushCustomCursor(
const byte *data,
int w,
int h,
int hx,
int hy,
int transcolor);
336 void replaceCustomCursor(
const byte *data,
int w,
int h,
int hx,
int hy,
int transcolor);
342 void setMode(uint32 mode);
344 void setEngine(
Engine *engine);
345 void setEngineRedrawCallback(
void *engine,
void (*redrawCallback)(
void *engine));
347 void passPalette(
const byte *palette, uint size);
348 template <
typename T>
void decomposeColor(uint32 color, byte &r, byte &g, byte &b);
349 uint32 findBestColor(byte cr, byte cg, byte cb);
350 uint32 findBestColor(uint32 color);
351 void setDesktopColor(byte, byte, byte);
353 byte inverter(byte src);
355 const byte *getPalette() {
return _palette; }
356 uint getPaletteSize() {
return _paletteSize; }
358 void renderZoomBox(
bool redraw =
false);
363 void loadDataBundle();
364 void cleanupDataBundle();
365 void cleanupDesktopBmp();
384 void clearHandlingWidgets();
386 void setMenuItemCheckMark(
MacMenuItem *menuItem,
bool checkMark);
387 void setMenuItemEnabled(
MacMenuItem *menuItem,
bool enabled);
389 void setMenuItemAction(
MacMenuItem *menuItem,
int actionId);
410 uint32 _colorBlack, _colorGray80, _colorGray88, _colorGrayEE, _colorWhite, _colorGreen, _colorGreen2;
416 bool _hilitingWidget;
426 bool haveZoomBox() {
return !_zoomBoxes.empty(); }
452 bool _inEditableArea;
454 MacPatterns _patterns;
455 MacPatterns _builtinPatterns;
464 void (*_redrawEngineCallback)(
void *engine);
466 MacCursorType _tempType = kMacCursorArrow;
468 Cursor *_cursor =
nullptr;
485 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:285
Definition: macfontmanager.h:127
Definition: macwindow.h:192
Definition: mactextwindow.h:30
Definition: macwindowmanager.h:133
MacPatterns & getPatterns()
Definition: macwindowmanager.h:291
Definition: palette.h:153
void setMenuHotzone(const Common::Rect &rect)
Definition: macwindowmanager.h:225
Definition: macwindowmanager.h:149
int getNextId()
Definition: macwindowmanager.h:203
Definition: archive.h:141
Definition: macwindowborder.h:57
Definition: atari-cursor.h:38
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: macwindowmanager.h:117
Definition: macfontmanager.h:85
int getLastId()
Definition: macwindowmanager.h:198
Definition: macwindow.h:73
void setMenuDelay(int delay)
Definition: macwindowmanager.h:230
Language
Definition: language.h:45
void setFullRefresh(bool redraw)
Definition: macwindowmanager.h:261