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;
83 void runAboutDialog()
override;
84 bool runOpenDialog(
int &saveSlotToHandle)
override;
85 bool runSaveDialog(
int &saveSlotToHandle,
Common::String &saveName)
override;
86 bool runOptionsDialog()
override;
87 bool runIqPointsDialog();
93 bool _visible =
false;
95 bool _leftButtonIsPressed =
false;
101 bool updateVerbs(
int delta);
102 void updateMouseHeldTimer(
int delta);
107 int getInventoryScrollOffset()
const;
108 void setInventoryScrollOffset(
int n)
const;
119 Widget(
int x,
int y,
int width,
int height);
122 void setEnabled(
bool enabled) {
123 if (enabled != _enabled)
130 void setTimer(
int t) { _timer = t; }
131 void clearTimer() { _timer = 0; }
132 bool hasTimer()
const {
return _timer > 0; }
134 virtual void setRedraw(
bool redraw) { _redraw = redraw; }
136 virtual void reset();
140 virtual void updateTimer(
int delta);
141 virtual void timeOut() {}
144 virtual void undraw();
146 byte translateChar(byte c)
const;
150 void drawBitmap(
Common::Rect r,
const uint16 *bitmap, byte color)
const;
152 void drawShadowFrame(
Common::Rect r, byte shadowColor, byte fillColor);
157 class VerbWidget :
public Widget {
164 VerbWidget(
int x,
int y,
int width,
int height) : Widget(x, y, width, height) {}
166 void setVerbid(
int n) { _verbid = n; }
167 bool hasVerb()
const {
return _verbslot != -1; }
168 void threaten() { _kill =
true; }
169 bool isDying()
const {
return _kill; }
173 virtual void updateVerb(
int verbslot);
179 class Button :
public VerbWidget {
184 Button(
int x,
int y,
int width,
int height);
190 void updateVerb(
int verbslot);
195 class Inventory :
public VerbWidget {
197 class ScrollBar :
public Widget {
203 ScrollBar(
int x,
int y,
int width,
int height);
205 void setInventoryParameters(
int invCount,
int invOffset);
206 void scroll(ScrollDirection dir);
207 int getHandlePosition();
216 class ScrollButton :
public Widget {
218 ScrollDirection _direction;
220 ScrollButton(
int x,
int y,
int width,
int height, ScrollDirection direction);
229 class Slot :
public Widget {
236 Slot(
int slot,
int x,
int y,
int width,
int height);
238 void clearName() { _name.
clear(); }
239 bool hasName()
const {
return !_name.empty(); }
242 void setObject(
int n);
243 int getObject()
const {
return _obj; }
254 ScrollBar *_scrollBar;
255 ScrollButton *_scrollButtons[2];
257 static const uint16 _upArrow[16];
258 static const uint16 _downArrow[16];
261 Inventory(
int x,
int y,
int width,
int height);
264 void setRedraw(
bool redraw);
270 void updateTimer(
int delta);
271 void updateVerb(
int verbslot);
279 bool isVerbGuiAllowed()
const;
287 void copyDirtyRectsToScreen();
Definition: macgui_impl.h:55
int16 h
Definition: surface.h:76
Definition: macgui_indy3.h:37
Definition: macgui_impl.h:582
Definition: macgui_impl.h:239
int16 w
Definition: surface.h:71
void fillRect(Common::Rect r, uint32 color)