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"
45namespace 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 kWMNoScummVMWallpaper = (1 << 8),
91 kWMModeWin95 = (1 << 9),
92 kWMModeForceMacFontsInWin95 = (1 << 10),
93 kWMModeNoCursorOverride = (1 << 11),
94 kWMModeForceMacBorder = (1 << 12),
95 kWMModeForceMacFonts = (1 << 13),
96 kWMModeNoSystemRedraw = (1 << 14),
100using namespace MacGUIConstants;
128 MacPlotData() : surface(
nullptr), mask(
nullptr), patterns(
nullptr), fillType(0), fillOriginX(0), fillOriginY(0), thickness(1, 1), bgColor(0), invert(
false) {}
131 surface(s), mask(m), patterns(p), fillType(f), fillOriginX(fx), fillOriginY(fy), thickness(t), bgColor(bg), invert(inv) {
155 Primitives &getDrawPrimitives()
const {
return *_macDrawPrimitives; }
187 void resizeScreen(
int w,
int h);
217 void activateScreenCopy();
218 void disableScreenCopy();
221 void setDesktopMode(uint32 mode);
239 int getActiveWindow() {
return _activeWindow; }
289 if (
id >= 0 &&
id < (
int)_windows.size())
322 MacPatterns &getBuiltinPatterns() {
return _builtinPatterns; }
324 MacWidget *getActiveWidget() {
return _activeWidget; }
325 MacWidget *getLockedWidget() {
return _lockedWidget; }
329 void clearWidgetRefs(MacWidget *widget);
331 void printWMMode(
int debuglevel = 0);
334 void replaceCursorType(MacCursorType type);
337 MacCursorType getCursorType()
const;
338 static bool getBuiltInCursorData(MacCursorType type,
const byte *&data,
const byte *&palette,
339 const byte *&mask,
int &w,
int &h,
int &hotspotX,
int &hotspotY,
int &transColor);
341 void pushCursor(MacCursorType type,
Cursor *cursor =
nullptr);
342 void replaceCursor(MacCursorType type,
Cursor *cursor =
nullptr);
344 void pushCustomCursor(
const byte *data,
int w,
int h,
int hx,
int hy,
int transcolor);
345 void replaceCustomCursor(
const byte *data,
int w,
int h,
int hx,
int hy,
int transcolor);
351 void setMode(uint32 mode);
353 void setEngine(
Engine *engine);
354 void setEngineRedrawCallback(
void *engine,
void (*redrawCallback)(
void *engine));
355 void setEngineActivateMenuCallback(
void *engine,
void (*redrawCallback)(
void *engine));
357 void passPalette(
const byte *palette, uint size);
358 void getPaletteEntry(uint32 color,
byte &r,
byte &g,
byte &b);
359 uint32 findBestColor(
byte cr,
byte cg,
byte cb);
360 void setDesktopColor(
byte,
byte,
byte);
362 byte inverter(
byte src);
364 const byte *getPalette() {
return _palette; }
365 uint getPaletteSize() {
return _paletteSize; }
367 void renderZoomBox(
bool redraw =
false);
368 void addZoomBox(ZoomBox *box);
372 void loadDataBundle();
373 void cleanupDataBundle();
374 void cleanupDesktopBmp();
376 const BorderOffsets &getBorderOffsets(uint32 windowType);
395 void setMenuItemCheckMark(
MacMenuItem *menuItem,
bool checkMark);
396 void setMenuItemEnabled(
MacMenuItem *menuItem,
bool enabled);
398 void setMenuItemAction(
MacMenuItem *menuItem,
int actionId);
408 void setTTSEnabled(
bool enabled);
422 uint32 _colorBlack, _colorGray80, _colorGray88, _colorGrayEE, _colorWhite, _colorGreen, _colorGreen2;
428 bool _hilitingWidget;
438 bool haveZoomBox() {
return !_zoomBoxes.empty(); }
464 bool _inEditableArea;
479 void (*_redrawEngineCallback)(
void *engine);
481 void (*_activateMenuCallback)(
void *engine);
483 MacCursorType _tempType = kMacCursorArrow;
485 Cursor *_cursor =
nullptr;
504const Common::U32String::value_type *readHex(uint16 *res,
const Common::U32String::value_type *s,
int len);
Definition: archive.h:141
Definition: macwindow.h:80
Definition: macfontmanager.h:110
Definition: macfontmanager.h:152
Definition: mactextwindow.h:30
Definition: macwindow.h:205
Definition: macwindowmanager.h:149
void setMenuHotzone(const Common::Rect &rect)
Definition: macwindowmanager.h:226
MacWindow * findWindowAtPoint(Common::Point point)
MacWindow * findWindowAtPoint(int16 x, int16 y)
Common::U32String getTextFromClipboard(const Common::U32String &format=Common::U32String(), int *size=nullptr)
bool processEvent(Common::Event &event)
void setScreen(ManagedSurface *screen)
void setMenuDelay(int delay)
Definition: macwindowmanager.h:231
BaseMacWindow * getWindow(int id)
Definition: macwindowmanager.h:288
void addWindowInitialized(MacWindow *macwindow)
MacPatterns & getPatterns()
Definition: macwindowmanager.h:298
int getLastId()
Definition: macwindowmanager.h:199
int getNextId()
Definition: macwindowmanager.h:204
void setActiveWidget(MacWidget *widget)
void setScreen(int w, int h)
void clearHandlingWidgets()
void removeWindow(MacWindow *target)
MacWindow * addWindow(bool scrollable, bool resizable, bool editable)
void setBackgroundWindow(MacWindow *window)
void setActiveWindow(int id)
void setFullRefresh(bool redraw)
Definition: macwindowmanager.h:264
void setLockedWidget(MacWidget *widget)
Definition: managed_surface.h:51
const Common::Rect getBounds() const
Definition: managed_surface.h:328
Definition: palette.h:195
Definition: primitives.h:29
Language
Definition: language.h:45
TextAlign
Definition: font.h:48
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: atari-cursor.h:35
Definition: macwindowmanager.h:117
Definition: macwindowmanager.h:135