22 #ifndef SCUMM_MACGUI_MACGUI_INDY3_H 23 #define SCUMM_MACGUI_MACGUI_INDY3_H 25 #include "common/events.h" 26 #include "common/rect.h" 27 #include "common/str.h" 29 #include "graphics/surface.h" 31 #include "scumm/macgui/macgui_colors.h" 39 enum ScrollDirection {
48 int getNumColors()
const override {
return 16; }
54 void setupCursor(
int &width,
int &height,
int &hotspotX,
int &hotspotY,
int &animate)
override;
58 void initTextAreaForActor(
Actor *a, byte color)
override;
59 void printCharToTextArea(
int chr,
int x,
int y,
int color)
override;
71 bool isVerbGuiActive()
const override;
73 void reset()
override;
74 void resetAfterLoad()
override;
75 void update(
int delta)
override;
79 bool getFontParams(FontId fontId,
int &
id,
int &size,
int &slant)
const override;
81 void updateMenus()
override;
84 void runAboutDialog()
override;
85 bool runOpenDialog(
int &saveSlotToHandle)
override;
86 bool runSaveDialog(
int &saveSlotToHandle,
Common::String &saveName)
override;
87 bool runOptionsDialog()
override;
88 bool runIqPointsDialog();
94 bool _visible =
false;
96 bool _leftButtonIsPressed =
false;
102 bool updateVerbs(
int delta);
103 void updateMouseHeldTimer(
int delta);
108 int getInventoryScrollOffset()
const;
109 void setInventoryScrollOffset(
int n)
const;
120 Widget(
int x,
int y,
int width,
int height);
123 void setEnabled(
bool enabled) {
124 if (enabled != _enabled)
131 void setTimer(
int t) { _timer = t; }
132 void clearTimer() { _timer = 0; }
133 bool hasTimer()
const {
return _timer > 0; }
135 virtual void setRedraw(
bool redraw) { _redraw = redraw; }
137 virtual void reset();
141 virtual void updateTimer(
int delta);
142 virtual void timeOut() {}
145 virtual void undraw();
147 byte translateChar(byte c)
const;
151 void drawBitmap(
Common::Rect r,
const uint16 *bitmap, byte color)
const;
153 void drawShadowFrame(
Common::Rect r, byte shadowColor, byte fillColor);
158 class VerbWidget :
public Widget {
165 VerbWidget(
int x,
int y,
int width,
int height) : Widget(x, y, width, height) {}
167 void setVerbid(
int n) { _verbid = n; }
168 bool hasVerb()
const {
return _verbslot != -1; }
169 void threaten() { _kill =
true; }
170 bool isDying()
const {
return _kill; }
172 void reset()
override;
174 virtual void updateVerb(
int verbslot);
176 void draw()
override;
177 void undraw()
override;
180 class Button :
public VerbWidget {
185 Button(
int x,
int y,
int width,
int height);
189 void reset()
override;
190 void timeOut()
override;
191 void updateVerb(
int verbslot)
override;
193 void draw()
override;
196 class Inventory :
public VerbWidget {
198 class ScrollBar :
public Widget {
204 ScrollBar(
int x,
int y,
int width,
int height);
206 void setInventoryParameters(
int invCount,
int invOffset);
207 void scroll(ScrollDirection dir);
208 int getHandlePosition();
210 void reset()
override;
214 void draw()
override;
217 class ScrollButton :
public Widget {
219 ScrollDirection _direction;
221 ScrollButton(
int x,
int y,
int width,
int height, ScrollDirection direction);
225 void timeOut()
override;
227 void draw()
override;
230 class Slot :
public Widget {
237 Slot(
int slot,
int x,
int y,
int width,
int height);
239 void clearName() { _name.
clear(); }
240 bool hasName()
const {
return !_name.empty(); }
243 void setObject(
int n);
244 int getObject()
const {
return _obj; }
246 void reset()
override;
249 void timeOut()
override;
251 void draw()
override;
255 ScrollBar *_scrollBar;
256 ScrollButton *_scrollButtons[2];
258 static const uint16 _upArrow[16];
259 static const uint16 _downArrow[16];
262 Inventory(
int x,
int y,
int width,
int height);
265 void setRedraw(
bool redraw)
override;
267 void reset()
override;
271 void updateTimer(
int delta)
override;
272 void updateVerb(
int verbslot)
override;
274 void draw()
override;
280 bool isVerbGuiAllowed()
const;
288 void copyDirtyRectsToScreen();
Definition: macgui_impl.h:52
int16 h
Definition: surface.h:76
Definition: macgui_indy3.h:37
Definition: macgui_impl.h:655
Definition: macgui_impl.h:249
int16 w
Definition: surface.h:71
void fillRect(Common::Rect r, uint32 color)