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),
99 using namespace MacGUIConstants;
103 class ManagedSurface;
112 class MacFontManager;
119 MacPatterns *patterns;
128 surface(s), mask(m), patterns(p), fillType(f), fillOriginX(fx), fillOriginY(fy), thickness(t), bgColor(bg), invert(inv) {
142 typedef void (* MacDrawPixPtr)(int, int, int,
void *);
153 MacDrawPixPtr getDrawPixel();
154 MacDrawPixPtr getDrawInvertPixel();
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);
242 MacWindow *findWindowAtPoint(int16 x, int16 y);
312 void setBackgroundWindow(
MacWindow *window);
314 MacPatterns &getBuiltinPatterns() {
return _builtinPatterns; }
316 MacWidget *getActiveWidget() {
return _activeWidget; }
317 MacWidget *getLockedWidget() {
return _lockedWidget; }
319 Common::Rect getScreenBounds() {
return _screen ? _screen->getBounds() : _screenDims; }
323 void printWMMode(
int debuglevel = 0);
326 void replaceCursorType(MacCursorType type);
329 MacCursorType getCursorType()
const;
331 void pushCursor(MacCursorType type,
Cursor *cursor =
nullptr);
332 void replaceCursor(MacCursorType type,
Cursor *cursor =
nullptr);
334 void pushCustomCursor(
const byte *data,
int w,
int h,
int hx,
int hy,
int transcolor);
335 void replaceCustomCursor(
const byte *data,
int w,
int h,
int hx,
int hy,
int transcolor);
341 void setMode(uint32 mode);
343 void setEngine(
Engine *engine);
344 void setEngineRedrawCallback(
void *engine,
void (*redrawCallback)(
void *engine));
346 void passPalette(
const byte *palette, uint size);
347 template <
typename T>
void decomposeColor(uint32 color, byte &r, byte &g, byte &b);
348 uint32 findBestColor(byte cr, byte cg, byte cb);
349 uint32 findBestColor(uint32 color);
350 void setDesktopColor(byte, byte, byte);
352 byte inverter(byte src);
354 const byte *getPalette() {
return _palette; }
355 uint getPaletteSize() {
return _paletteSize; }
357 void renderZoomBox(
bool redraw =
false);
362 void loadDataBundle();
363 void cleanupDataBundle();
364 void cleanupDesktopBmp();
383 void clearHandlingWidgets();
385 void setMenuItemCheckMark(
MacMenuItem *menuItem,
bool checkMark);
386 void setMenuItemEnabled(
MacMenuItem *menuItem,
bool enabled);
388 void setMenuItemAction(
MacMenuItem *menuItem,
int actionId);
409 uint32 _colorBlack, _colorGray80, _colorGray88, _colorGrayEE, _colorWhite, _colorGreen, _colorGreen2;
415 bool _hilitingWidget;
425 bool haveZoomBox() {
return !_zoomBoxes.empty(); }
451 bool _inEditableArea;
453 MacPatterns _patterns;
454 MacPatterns _builtinPatterns;
463 void (*_redrawEngineCallback)(
void *engine);
465 MacCursorType _tempType = kMacCursorArrow;
467 Cursor *_cursor =
nullptr;
484 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:284
Definition: macfontmanager.h:127
Definition: macwindow.h:192
Definition: mactextwindow.h:30
Definition: macwindowmanager.h:132
MacPatterns & getPatterns()
Definition: macwindowmanager.h:290
Definition: palette.h:153
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: atari-cursor.h:38
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: macwindowmanager.h:116
Definition: macfontmanager.h:85
int getLastId()
Definition: macwindowmanager.h:197
Definition: macwindow.h:73
void setMenuDelay(int delay)
Definition: macwindowmanager.h:229
Language
Definition: language.h:45
void setFullRefresh(bool redraw)
Definition: macwindowmanager.h:260