ScummVM API documentation
mac_menus.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 MADS_NEBULAR_MAC_MENUS_H
23#define MADS_NEBULAR_MAC_MENUS_H
24
25#include "common/rect.h"
26#include "common/scummsys.h"
27
28namespace Common {
29struct Event;
30class String;
31}
32
33namespace Graphics {
34class MacMenu;
35struct MacMenuItem;
36struct MacMenuSubMenu;
37class MacWindowManager;
38class ManagedSurface;
39}
40
41namespace MADS {
42namespace RexNebular {
43
44class MacResourceProvider;
45class RexNebularEngine;
46class MacNebularDialog;
47
49private:
50 RexNebularEngine &_engine;
51 MacResourceProvider &_resources;
53 Graphics::MacWindowManager *_windowManager = nullptr;
54 Graphics::MacMenu *_menu = nullptr;
55 MacNebularDialog *_activeDialog = nullptr;
56 byte _palette[256 * 3] = {};
57 bool _paletteValid = false;
58 bool _outerMenuActive = false;
59 bool _aboutRequested = false;
60 bool _preferencesRequested = false;
61 uint32 _windowManagerMode = 0;
62 int _pendingCommand = -1;
63
64 static void menuCallback(int commandId, Common::String &name, void *data);
65 bool initializeWindowManager();
66 bool loadMenuResource(uint16 resourceID,
67 Graphics::MacMenuSubMenu *parent = nullptr, int parentItem = -1);
68 Graphics::MacMenuItem *getMenuItem(int menu, int item) const;
69 Graphics::MacMenuItem *getSubMenuItem(int menu, int parentItem, int item) const;
70 void setItemState(Graphics::MacMenuItem *item, bool enabled, bool checked);
71 void updateState();
72 void dispatchCommand(int commandId);
73 void syncPalette();
74
75public:
79
80 bool initialize();
81 bool processEvent(Common::Event &event);
82 bool processDialogEvent(Common::Event &event);
83 void draw();
84 byte getBlackColor();
85 void getMenuColors(byte &menuBlack, byte &menuWhite);
86 void setMenuBarHidden(bool hidden);
87 bool takeAboutRequest();
88 void beginAboutPresentation(bool &cursorWasVisible, bool &cursorPushed);
89 void waitForAboutDismissal();
90 void endAboutPresentation(bool cursorWasVisible, bool cursorPushed);
91 bool takePreferencesRequest();
92 bool runPreferencesDialog(bool startup);
93 void runOpenDialog();
94 void runSaveDialog(bool saveAs);
95 int runPopupEditor(const Common::Rect &bounds, char *target,
96 int maxLength);
97 int runCopyProtectionDialog(const Common::String &title,
98 const Common::String &subtitle, const Common::String &prompt,
99 char *target, int maxLength);
100 bool runStoryPasswordDialog(bool leavingLocked);
101 void setOuterMenuActive(bool active) { _outerMenuActive = active; }
102 int runDifficultyDialog();
103 int selectResumeSlot();
104};
105
106void selectMacintoshDifficulty(MacNebularMenu *menus);
107void macintoshGameMenu();
108
109} // namespace RexNebular
110} // namespace MADS
111
112#endif
Definition: str.h:59
Definition: macmenu.h:95
Definition: macwindowmanager.h:149
Definition: managed_surface.h:51
Definition: mac_dialogs.h:50
Definition: mac_menus.h:48
Definition: mac_resources.h:43
Definition: nebular.h:44
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: events.h:218
Definition: rect.h:536
Definition: macmenu.h:59
Definition: macmenu.h:42