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);
166 void showPrebuiltDialog(PrebuiltDialogs type,
const Common::String &title =
"");
189 WindowReference _activeWinRef;
202 struct InventoryWindowData {
223 WindowReference _lassoWinRef;
226 bool _lassoBeingDrawn;
233 void assignObjReferences();
246 void drawCommandsWindow();
247 void drawDiplomaWindow();
248 void drawMainGameWindow();
249 void drawSelfWindow();
250 void drawInventories();
251 void drawExitsWindow();
252 void drawConsoleWindow();
254 void drawDraggedObjects();
263 Common::Point getGlobalScrolledSurfacePosition(WindowReference reference);
264 WindowData& findWindowData(WindowReference reference);
268 bool canBeSelected(ObjID obj,
const Common::Rect &clickRect, WindowReference ref);
269 bool isRectInsideObject(
Common::Rect target, ObjID obj);
270 void selectDraggable(ObjID child, WindowReference origin,
Common::Point startPos);
271 void handleDragRelease(
bool shiftPressed,
bool isDoubleClick);
274 void removeInventoryWindow(WindowReference ref);
276 void ensureAssetLoaded(ObjID obj);
311 bool canSelectDraggable();
315 void changeState(CursorInput input);
316 void executeStateIn();
317 void executeStateOut();
330 kConsoleLeftOffset = 2
339 _lines.push_back(
"");
354 if (wrappedLines.
empty())
355 _lines.push_back(
"");
358 _lines.push_back(*j);
368 _gui->createInnerSurface(composeSurface, target, borders);
369 composeSurface->
clear(kColorGreen);
373 for (uint i = _scrollPos; i != 0; i--) {
376 if (y < font->getFontHeight())
383 target->
transBlitFrom(*composeSurface, composePosition, kColorGreen);
384 delete composeSurface;
387 void updateScroll() {
388 _scrollPos = _lines.size() - 1;
392 if (_scrollPos < (
int)(_lines.size() - 1)) {
398 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:325
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:192
iterator end()
Definition: array.h:382
iterator begin()
Definition: array.h:377
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:933
Definition: macwindowmanager.h:147
Definition: macwindowborder.h:57
int16 & h
Definition: managed_surface.h:132
bool empty() const
Definition: array.h:354
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