30 #ifndef MACVENTURE_GUI_H 31 #define MACVENTURE_GUI_H 33 #include "graphics/macgui/macwindowmanager.h" 34 #include "graphics/macgui/macwindow.h" 35 #include "graphics/macgui/macmenu.h" 37 #include "graphics/font.h" 39 #include "common/timer.h" 41 #include "macventure/macventure.h" 42 #include "macventure/container.h" 43 #include "macventure/image.h" 44 #include "macventure/prebuilt_dialogs.h" 45 #include "macventure/dialog.h" 46 #include "macventure/controls.h" 47 #include "macventure/windows.h" 53 class MacVentureEngine;
62 BorderBounds borderBounds(MVWindowType type);
88 WindowReference startWin;
98 void reloadInternals();
106 void clearControls();
108 void handleMenuAction(MenuAction action);
109 void updateWindow(WindowReference winID,
bool containerOpen);
110 void invertWindowColors(WindowReference winID);
112 WindowReference createInventoryWindow(ObjID objRef);
113 bool tryCloseWindow(WindowReference winID);
114 bool tryCloseWindowRec(WindowReference winID,
bool runControl =
false);
116 void closeAllWindows();
118 void highlightExitButton(ObjID objID);
122 WindowReference getObjWindow(ObjID objID);
123 WindowReference findObjWindow(ObjID objID);
126 bool processCommandEvents(WindowClick click,
Common::Event &event);
127 bool processMainGameEvents(WindowClick click,
Common::Event &event);
128 bool processOutConsoleEvents(WindowClick click,
Common::Event &event);
129 bool processSelfEvents(WindowClick click,
Common::Event &event);
130 bool processExitsEvents(WindowClick click,
Common::Event &event);
131 bool processDiplomaEvents(WindowClick click,
Common::Event &event);
132 bool processInventoryEvents(WindowReference ref, WindowClick click,
Common::Event &event);
134 const WindowData& getWindowData(WindowReference reference);
141 void select(
Common::Point cursorPosition,
bool shiftPressed,
bool isDoubleClick);
142 void handleSingleClick();
143 void handleDoubleClick();
146 void bringToFront(WindowReference window);
147 void setWindowTitle(WindowReference winID,
const Common::String &
string);
149 void ensureInventoryOpen(WindowReference reference, ObjID
id);
151 void addChild(WindowReference target, ObjID child);
152 void removeChild(WindowReference target, ObjID child);
154 void clearDraggedObjects();
157 void unselectExits();
158 void updateExit(ObjID
id);
159 void resetExitBackgroundPattern();
167 void showPrebuiltDialog(PrebuiltDialogs type,
const Common::String &title =
"");
182 bool decodeStartupScreen();
183 bool decodeTitleScreen();
184 bool displayTitleScreenAndWait(uint32 ms);
194 WindowReference _activeWinRef;
207 struct InventoryWindowData {
228 WindowReference _lassoWinRef;
231 bool _lassoBeingDrawn;
238 void assignObjReferences();
251 void drawCommandsWindow();
252 void drawDiplomaWindow();
253 void drawMainGameWindow();
254 void drawSelfWindow();
255 void drawInventories();
256 void drawExitsWindow();
257 void drawConsoleWindow();
259 void drawDraggedObjects();
268 Common::Point getGlobalScrolledSurfacePosition(WindowReference reference);
269 WindowData& findWindowData(WindowReference reference);
273 bool canBeSelected(ObjID obj,
const Common::Rect &clickRect, WindowReference ref);
274 bool isRectInsideObject(
Common::Rect target, ObjID obj);
275 void selectDraggable(ObjID child, WindowReference origin,
Common::Point startPos);
276 void handleDragRelease(
bool shiftPressed,
bool isDoubleClick);
279 void removeInventoryWindow(WindowReference ref);
281 void ensureAssetLoaded(ObjID obj);
316 bool canSelectDraggable();
320 void changeState(CursorInput input);
321 void executeStateIn();
322 void executeStateOut();
335 kConsoleLeftOffset = 2
344 _lines.push_back(
"");
359 if (wrappedLines.
empty())
360 _lines.push_back(
"");
363 _lines.push_back(*j);
373 _gui->createInnerSurface(composeSurface, target, borders);
374 composeSurface->
clear(kColorGreen);
378 for (uint i = _scrollPos; i != 0; i--) {
381 if (y < font->getFontHeight())
388 target->
transBlitFrom(*composeSurface, composePosition, kColorGreen);
389 delete composeSurface;
392 void updateScroll() {
393 _scrollPos = _lines.size() - 1;
397 if (_scrollPos < (
int)(_lines.size() - 1)) {
403 if (_scrollPos > 0) {
void clear(uint32 color=0)
Definition: managed_surface.h:51
Definition: macresman.h:126
const Common::Rect getBounds() const
Definition: managed_surface.h:328
Definition: macwindow.h:40
int wordWrapText(const Common::String &str, int maxWidth, Common::Array< Common::String > &lines, int initWidth=0, uint32 mode=kWordWrapOnExplicitNewLines) const
Definition: macwindow.h:203
iterator end()
Definition: array.h:380
iterator begin()
Definition: array.h:375
Definition: mactextwindow.h:30
Definition: macwindowmanager.h:45
int getStringWidth(const Common::String &str) const
void fillRect(const Common::Rect &r, uint32 color)
Definition: managed_surface.h:954
Definition: macwindowmanager.h:147
Definition: macwindowborder.h:57
int16 & h
Definition: managed_surface.h:135
bool empty() const
Definition: array.h:352
Definition: container.h:48
Definition: atari-cursor.h:35
Definition: macventure.h:218
Definition: container.h:38
void transBlitFrom(const Surface &src, uint32 transColor=0, bool flipped=false, uint32 srcAlpha=0xff, const Palette *srcPalette=nullptr)
virtual int getFontHeight() const =0
void drawString(Surface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align=kTextAlignLeft, int deltax=0, bool useEllipsis=false) const