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();
104 void clearControls();
106 void handleMenuAction(MenuAction action);
107 void updateWindow(WindowReference winID,
bool containerOpen);
108 void invertWindowColors(WindowReference winID);
110 WindowReference createInventoryWindow(ObjID objRef);
111 bool tryCloseWindow(WindowReference winID);
115 WindowReference getObjWindow(ObjID objID);
116 WindowReference findObjWindow(ObjID objID);
119 bool processCommandEvents(WindowClick click,
Common::Event &event);
120 bool processMainGameEvents(WindowClick click,
Common::Event &event);
121 bool processOutConsoleEvents(WindowClick click,
Common::Event &event);
122 bool processSelfEvents(WindowClick click,
Common::Event &event);
123 bool processExitsEvents(WindowClick click,
Common::Event &event);
124 bool processDiplomaEvents(WindowClick click,
Common::Event &event);
125 bool processInventoryEvents(WindowClick click,
Common::Event &event);
127 const WindowData& getWindowData(WindowReference reference);
133 void handleSingleClick();
134 void handleDoubleClick();
137 void bringToFront(WindowReference window);
138 void setWindowTitle(WindowReference winID,
const Common::String &
string);
140 void ensureInventoryOpen(WindowReference reference, ObjID
id);
142 void addChild(WindowReference target, ObjID child);
143 void removeChild(WindowReference target, ObjID child);
146 void unselectExits();
147 void updateExit(ObjID
id);
152 void showPrebuiltDialog(PrebuiltDialogs type);
155 void getTextFromUser();
204 void assignObjReferences();
217 void drawCommandsWindow();
218 void drawMainGameWindow();
219 void drawSelfWindow();
220 void drawInventories();
221 void drawExitsWindow();
222 void drawConsoleWindow();
224 void drawDraggedObject();
233 Common::Point getGlobalScrolledSurfacePosition(WindowReference reference);
234 WindowData& findWindowData(WindowReference reference);
239 bool canBeSelected(ObjID obj,
const Common::Rect &clickRect, WindowReference ref);
240 bool isRectInsideObject(
Common::Rect target, ObjID obj);
241 void selectDraggable(ObjID child, WindowReference origin,
Common::Point startPos);
242 void handleDragRelease(
bool shiftPressed,
bool isDoubleClick);
245 void removeInventoryWindow(WindowReference ref);
247 void ensureAssetLoaded(ObjID obj);
277 bool canSelectDraggable();
281 void changeState(CursorInput input);
282 void executeStateIn();
283 void executeStateOut();
296 kConsoleLeftOffset = 2
305 _lines.push_back(
"");
320 if (wrappedLines.
empty())
321 _lines.push_back(
"");
324 _lines.push_back(*j);
334 _gui->createInnerSurface(composeSurface, target, borders);
335 composeSurface->
clear(kColorGreen);
339 for (uint i = _scrollPos; i != 0; i--) {
342 if (y < font->getFontHeight())
349 target->
transBlitFrom(*composeSurface, composePosition, kColorGreen);
350 delete composeSurface;
353 void updateScroll() {
354 _scrollPos = _lines.size() - 1;
358 if (_scrollPos < (
int)(_lines.size() - 1)) {
364 if (_scrollPos > 0) {
void clear(uint32 color=0)
Definition: managed_surface.h:51
Definition: macresman.h:125
const Common::Rect getBounds() const
Definition: managed_surface.h:326
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:379
iterator begin()
Definition: array.h:374
Definition: macwindowmanager.h:45
void transBlitFrom(const Surface &src, uint32 transColor=0, bool flipped=false, uint32 overrideColor=0, uint32 srcAlpha=0xff, const Palette *srcPalette=nullptr)
int getStringWidth(const Common::String &str) const
Definition: macwindowmanager.h:149
Definition: macwindowborder.h:57
int16 & h
Definition: managed_surface.h:118
bool empty() const
Definition: array.h:351
Definition: container.h:48
Definition: atari-cursor.h:38
Definition: macventure.h:185
Definition: container.h:38
void fillRect(Common::Rect r, uint32 color)
Definition: managed_surface.h:754
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