ScummVM API documentation
widget.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef GUI_WIDGET_H
23 #define GUI_WIDGET_H
24 
25 #include "common/scummsys.h"
26 #include "common/array.h"
27 #include "common/str.h"
28 #include "common/keyboard.h"
29 #include "graphics/font.h"
30 #include "graphics/managed_surface.h"
31 #include "gui/object.h"
32 #include "gui/ThemeEngine.h"
33 #include "common/text-to-speech.h"
34 #include "common/system.h"
35 #include "common/config-manager.h"
36 #include "common/events.h"
37 
38 namespace GUI {
39 
40 class ScrollContainerWidget;
41 
42 enum {
43  WIDGET_ENABLED = 1 << 0,
44  WIDGET_INVISIBLE = 1 << 1,
45  WIDGET_HILITED = 1 << 2,
46  WIDGET_BORDER = 1 << 3,
47  WIDGET_PRESSED = 1 << 4,
48  //WIDGET_INV_BORDER = 1 << 4,
49  WIDGET_CLEARBG = 1 << 5,
50  WIDGET_WANT_TICKLE = 1 << 7,
51  WIDGET_TRACK_MOUSE = 1 << 8,
52  // Retain focus on mouse up. By default widgets lose focus on mouseup,
53  // but some widgets might want to retain it - widgets where you enter
54  // text, for instance
55  WIDGET_RETAIN_FOCUS = 1 << 9,
56  // Usually widgets would lock mouse input when the user pressed the
57  // left mouse button till the user releases it.
58  // The PopUpWidget for example does not want this behavior, since the
59  // mouse down will open up a new dialog which silently eats the mouse
60  // up event for its own purposes.
61  WIDGET_IGNORE_DRAG = 1 << 10,
62  WIDGET_DYN_TOOLTIP = 1 << 11, // Widgets updates tooltip by coordinates
63 };
64 
65 enum {
66  kStaticTextWidget = 'TEXT',
67  kEditTextWidget = 'EDIT',
68  kButtonWidget = 'BTTN',
69  kCheckboxWidget = 'CHKB',
70  kRadiobuttonWidget = 'RDBT',
71  kSliderWidget = 'SLDE',
72  kListWidget = 'LIST',
73  kScrollBarWidget = 'SCRB',
74  kPopUpWidget = 'POPU',
75  kTabWidget = 'TABW',
76  kGraphicsWidget = 'GFXW',
77  kContainerWidget = 'CTNR',
78  kScrollContainerWidget = 'SCTR',
79  kRichTextWidget = 'RTXT',
80  kEEWidget = 'EEGG',
81 };
82 
83 enum {
84  kCaretBlinkTime = 300
85 };
86 
87 enum {
88  kPressedButtonTime = 200
89 };
90 
91 enum {
92  kPicButtonStateEnabled = 0,
93  kPicButtonHighlight = 1,
94  kPicButtonStateDisabled = 2,
95  kPicButtonStatePressed = 3,
96 
97  kPicButtonStateMax = 3
98 };
99 
100 /* Widget */
101 class Widget : public GuiObject {
102  friend class Dialog;
103 protected:
104  uint32 _type;
105  GuiObject *_boss;
106  Widget *_next;
107  bool _hasFocus;
109  Common::U32String _tooltip;
110 
111 private:
112  uint16 _flags;
113  bool _needsRedraw;
114 
115 public:
116  static Widget *findWidgetInChain(Widget *start, int x, int y);
117  static Widget *findWidgetInChain(Widget *start, const char *name);
118  static bool containsWidgetInChain(Widget *start, Widget *search);
119 
120 public:
121  Widget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &tooltip = Common::U32String());
122  Widget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip = Common::U32String());
123  Widget(GuiObject *boss, const Common::String &name, const Common::U32String &tooltip = Common::U32String());
124  ~Widget() override;
125 
126  void init();
127 
128  void setNext(Widget *w) { _next = w; }
129  void setBoss(GuiObject *newBoss) { _boss = newBoss; }
130  Widget *next() { return _next; }
131 
132  int16 getAbsX() const override { return _x + _boss->getChildX(); }
133  int16 getAbsY() const override { return _y + _boss->getChildY(); }
134 
135  virtual void setPos(int x, int y) { _x = x; _y = y; }
136  virtual void setSize(int w, int h) { _w = w; _h = h; }
137 
139  virtual void getMinSize(int &minWidth, int &minHeight) { minHeight = -1; minWidth = -1; }
140 
141  virtual void handleMouseDown(int x, int y, int button, int clickCount) {}
142  virtual void handleMouseUp(int x, int y, int button, int clickCount) {}
143  virtual void handleMouseEntered(int button) {}
144  virtual void handleMouseLeft(int button) {}
145  virtual void handleMouseMoved(int x, int y, int button) {}
146  void handleMouseWheel(int x, int y, int direction) override { assert(_boss); _boss->handleMouseWheel(x, y, direction); }
147  virtual bool handleKeyDown(Common::KeyState state) { return false; } // Return true if the event was handled
148  virtual bool handleKeyUp(Common::KeyState state) { return false; } // Return true if the event was handled
149  virtual void handleOtherEvent(const Common::Event &evt) {}
150  virtual void handleTickle() {}
151 
153  virtual void markAsDirty();
154 
156  virtual void draw();
157 
158  void receivedFocus() { _hasFocus = true; receivedFocusWidget(); }
159  void lostFocus() { _hasFocus = false; lostFocusWidget(); }
160  virtual bool wantsFocus() { return false; }
161 
162  uint32 getType() const { return _type; }
163 
164  void setFlags(int flags);
165  void clearFlags(int flags);
166  int getFlags() const { return _flags; }
167 
168  void setEnabled(bool e);
169  bool isEnabled() const;
170 
171  void setVisible(bool e);
172  bool isVisible() const override;
173 
174  bool useRTL() const;
175 
176  uint8 parseHotkey(const Common::U32String &label);
177  Common::U32String cleanupHotkey(const Common::U32String &label);
178 
179  bool hasTooltip() const { return !_tooltip.empty(); }
180  const Common::U32String &getTooltip() const { return _tooltip; }
181  void setTooltip(const Common::U32String &tooltip) { _tooltip = tooltip; }
182  void setTooltip(const Common::String &tooltip) { _tooltip = Common::U32String(tooltip); }
183 
184  virtual bool containsWidget(Widget *) const { return false; }
185 
186  void read(const Common::U32String &str);
187 
188 protected:
189  void updateState(int oldFlags, int newFlags);
190 
191  virtual void drawWidget() = 0;
192 
193  virtual void receivedFocusWidget() {}
194  virtual void lostFocusWidget() {}
195 
196  virtual Widget *findWidget(int x, int y) { return this; }
197 
198  void releaseFocus() override { assert(_boss); _boss->releaseFocus(); }
199 
200  // By default, delegate unhandled commands to the boss
201  void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override { assert(_boss); _boss->handleCommand(sender, cmd, data); }
202 };
203 
204 /* StaticTextWidget */
205 class StaticTextWidget : public Widget {
206 protected:
207  Common::U32String _label;
208  Graphics::TextAlign _align;
210  ThemeEngine::FontColor _fontColor;
211  bool _useEllipsis;
212 
213 public:
214  StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &text, Graphics::TextAlign align, const Common::U32String &tooltip = Common::U32String(), ThemeEngine::FontStyle font = ThemeEngine::kFontStyleBold, Common::Language lang = Common::UNK_LANG, bool useEllipsis = true);
215  StaticTextWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &text, Graphics::TextAlign align, const Common::U32String &tooltip = Common::U32String(), ThemeEngine::FontStyle font = ThemeEngine::kFontStyleBold, Common::Language lang = Common::UNK_LANG, bool useEllipsis = true);
216  StaticTextWidget(GuiObject *boss, const Common::String &name, const Common::U32String &text, const Common::U32String &tooltip = Common::U32String(), ThemeEngine::FontStyle font = ThemeEngine::kFontStyleBold, Common::Language lang = Common::UNK_LANG, bool useEllipsis = true);
217  void setValue(int value);
218  void setLabel(const Common::U32String &label);
219  void handleMouseEntered(int button) override { readLabel(); }
220  const Common::U32String &getLabel() const { return _label; }
221  void setAlign(Graphics::TextAlign align);
222  Graphics::TextAlign getAlign() const { return _align; }
223  void readLabel() { read(_label); }
224  void setFontColor(ThemeEngine::FontColor color);
225 
226 protected:
227  void reflowLayout() override;
228  void drawWidget() override;
229  void setFont(ThemeEngine::FontStyle font, Common::Language lang);
230 };
231 
232 /* ButtonWidget */
234  friend class Dialog; // Needed for the hotkey handling
235 protected:
236  uint32 _cmd;
237  uint8 _hotkey;
238  uint8 _highresHotkey;
239  uint8 _lowresHotkey;
240  Common::U32String _lowresLabel;
241 public:
242  ButtonWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0, const Common::U32String &lowresLabel = Common::U32String());
243  ButtonWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0, const Common::U32String &lowresLabel = Common::U32String());
244  ButtonWidget(GuiObject *boss, const Common::String &name, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0, const Common::U32String &lowresLabel = Common::U32String());
245 
246  void getMinSize(int &minWidth, int &minHeight) override;
247 
248  void setCmd(uint32 cmd) { _cmd = cmd; }
249  uint32 getCmd() const { return _cmd; }
250 
251  void setLabel(const Common::U32String &label);
252  void setLabel(const Common::String &label);
253  void setLowresLabel(const Common::U32String &label);
254  const Common::U32String &getLabel();
255 
256  void handleMouseUp(int x, int y, int button, int clickCount) override;
257  void handleMouseDown(int x, int y, int button, int clickCount) override;
258  void handleMouseEntered(int button) override { readLabel(); if (_duringPress) { setFlags(WIDGET_PRESSED); } else { setFlags(WIDGET_HILITED); } markAsDirty(); }
259  void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED | WIDGET_PRESSED); markAsDirty(); }
260 
261  void setHighLighted(bool enable);
262  void setPressedState();
263  void setUnpressedState();
264 protected:
265  void drawWidget() override;
266  bool _duringPress;
267 };
268 
269 /* DropdownButtonWidget */
271 public:
272  DropdownButtonWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0, const Common::U32String &lowresLabel = Common::U32String());
273  DropdownButtonWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0, const Common::U32String &lowresLabel = Common::U32String());
274  DropdownButtonWidget(GuiObject *boss, const Common::String &name, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0, const Common::U32String &lowresLabel = Common::U32String());
275 
276  void handleMouseMoved(int x, int y, int button) override;
277  void handleMouseUp(int x, int y, int button, int clickCount) override;
278  void reflowLayout() override;
279  void getMinSize(int &minWidth, int &minHeight) override;
280 
281 
282  void appendEntry(const Common::U32String &label, uint32 cmd);
283  void clearEntries();
284 
285 protected:
286  struct Entry {
287  Common::U32String label;
288  uint32 cmd;
289  };
291 
292  // Widget API
293  void drawWidget() override;
294 
295  void reset();
296  bool isInDropDown(int x, int y) const;
297 
298  EntryList _entries;
299 
300  uint32 _dropdownWidth;
301  bool _inDropdown;
302  bool _inButton;
303 };
304 
305 /* PicButtonWidget */
307 public:
308  PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
309  PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
310  PicButtonWidget(GuiObject *boss, const Common::String &name, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
311  ~PicButtonWidget() override;
312 
313  void setGfx(const Graphics::ManagedSurface *gfx, int statenum = kPicButtonStateEnabled, bool scale = true);
314  void setGfx(const Graphics::Surface *gfx, int statenum = kPicButtonStateEnabled, bool scale = true);
315  void setGfxFromTheme(const char *name, int statenum = kPicButtonStateEnabled, bool scale = true);
316  void setGfx(int w, int h, int r, int g, int b, int statenum = kPicButtonStateEnabled);
317 
318  void setButtonDisplay(bool enable) {_showButton = enable; }
319 
320 protected:
321  void drawWidget() override;
322 
323  Graphics::ManagedSurface _gfx[kPicButtonStateMax + 1];
324  Graphics::AlphaType _alphaType[kPicButtonStateMax + 1];
325  bool _showButton;
326 };
327 
328 /* CheckboxWidget */
329 class CheckboxWidget : public ButtonWidget {
330 protected:
331  bool _state;
332  bool _overrideText;
333  int _spacing;
334 public:
335  CheckboxWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
336  CheckboxWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
337  CheckboxWidget(GuiObject *boss, const Common::String &name, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
338 
339  void handleMouseUp(int x, int y, int button, int clickCount) override;
340  void handleMouseEntered(int button) override { readLabel(); setFlags(WIDGET_HILITED); markAsDirty(); }
341  void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED); markAsDirty(); }
342 
343  void setState(bool state);
344  void toggleState() { setState(!_state); }
345  bool getState() const { return _state; }
346 
347  void setOverride(bool enable);
348 
349 protected:
350  void drawWidget() override;
351 };
352 
353 class RadiobuttonWidget;
354 
356 public:
357  RadiobuttonGroup(GuiObject *boss, uint32 cmd = 0);
358  ~RadiobuttonGroup() override {}
359 
360  void addButton(RadiobuttonWidget *button) { _buttons.push_back(button); }
361  Common::Array<RadiobuttonWidget *> getButtonList() const { return _buttons; }
362 
363  void setValue(int state);
364  int getValue() const { return _value; }
365 
366  void setEnabled(bool ena);
367 
368  void setCmd(uint32 cmd) { _cmd = cmd; }
369  uint32 getCmd() const { return _cmd; }
370 
371 protected:
373  int _value;
374  uint32 _cmd;
375 };
376 
377 /* RadiobuttonWidget */
379 protected:
380  bool _state;
381  int _spacing;
382  int _value;
383 
384 public:
385  RadiobuttonWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, RadiobuttonGroup *group, int value, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint8 hotkey = 0);
386  RadiobuttonWidget(GuiObject *boss, int x, int y, int w, int h, RadiobuttonGroup *group, int value, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint8 hotkey = 0);
387  RadiobuttonWidget(GuiObject *boss, const Common::String &name, RadiobuttonGroup *group, int value, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint8 hotkey = 0);
388 
389  void handleMouseUp(int x, int y, int button, int clickCount) override;
390  void handleMouseEntered(int button) override { readLabel(); setFlags(WIDGET_HILITED); markAsDirty(); }
391  void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED); markAsDirty(); }
392 
393  void setState(bool state, bool setGroup = true);
394  void toggleState() { setState(!_state); }
395  bool getState() const { return _state; }
396  int getValue() const { return _value; }
397 
398 protected:
399  void drawWidget() override;
400 
401  RadiobuttonGroup *_group;
402 };
403 
404 /* SliderWidget */
405 class SliderWidget : public Widget, public CommandSender {
406 protected:
407  uint32 _cmd;
408  int _value, _oldValue;
409  int _valueMin, _valueMax;
410  bool _isDragging;
411  uint _labelWidth;
412 public:
413  SliderWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0);
414  SliderWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0);
415  SliderWidget(GuiObject *boss, const Common::String &name, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0);
416 
417  void setCmd(uint32 cmd) { _cmd = cmd; }
418  uint32 getCmd() const { return _cmd; }
419 
420  void setValue(int value) { _value = value; }
421  int getValue() const { return _value; }
422 
423  void setMinValue(int value) { _valueMin = value; }
424  int getMinValue() const { return _valueMin; }
425  void setMaxValue(int value) { _valueMax = value; }
426  int getMaxValue() const { return _valueMax; }
427 
428  void handleMouseMoved(int x, int y, int button) override;
429  void handleMouseDown(int x, int y, int button, int clickCount) override;
430  void handleMouseUp(int x, int y, int button, int clickCount) override;
431  void handleMouseEntered(int button) override { setFlags(WIDGET_HILITED); markAsDirty(); }
432  void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED); markAsDirty(); }
433  void handleMouseWheel(int x, int y, int direction) override;
434 
435 protected:
436  void drawWidget() override;
437 
438  int valueToPos(int value);
439  int posToValue(int pos);
440  int valueToBarWidth(int value);
441 };
442 
443 /* GraphicsWidget */
444 class GraphicsWidget : public Widget {
445 public:
446  GraphicsWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &tooltip = Common::U32String());
447  GraphicsWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip = Common::U32String());
448  GraphicsWidget(GuiObject *boss, const Common::String &name, const Common::U32String &tooltip = Common::U32String());
449  ~GraphicsWidget() override;
450 
451  void setGfx(const Graphics::ManagedSurface *gfx, bool scale = false);
452  void setGfx(const Graphics::Surface *gfx, bool scale = false);
453  void setGfx(int w, int h, int r, int g, int b);
454  void setGfxFromTheme(const char *name);
455 
456 protected:
457  void drawWidget() override;
458 
460  Graphics::AlphaType _alphaType;
461 };
462 
463 class PathWidget : public StaticTextWidget {
464 public:
465  PathWidget(GuiObject *boss, int x, int y, int w, int h, bool scale,
466  const Common::Path &path, Graphics::TextAlign align,
467  const Common::U32String &placeholder = Common::U32String(),
468  const Common::U32String &tooltip = Common::U32String(),
470  bool useEllipsis = true) :
471  StaticTextWidget(boss, x, y, w, h, scale,
472  path.empty() ? placeholder : Common::U32String(path.toString(Common::Path::kNativeSeparator)),
473  align, tooltip, font, Common::UNK_LANG, useEllipsis),
474  _path(path),
475  _placeholder(placeholder) { }
476  PathWidget(GuiObject *boss, int x, int y, int w, int h,
477  const Common::Path &path, Graphics::TextAlign align,
478  const Common::U32String &placeholder = Common::U32String(),
479  const Common::U32String &tooltip = Common::U32String(),
481  bool useEllipsis = true) :
482  StaticTextWidget(boss, x, y, w, h,
483  path.empty() ? placeholder : Common::U32String(path.toString(Common::Path::kNativeSeparator)),
484  align, tooltip, font, Common::UNK_LANG, useEllipsis),
485  _path(path),
486  _placeholder(placeholder) {}
487  PathWidget(GuiObject *boss, const Common::String &name,
488  const Common::Path &path,
489  const Common::U32String &placeholder = Common::U32String(),
490  const Common::U32String &tooltip = Common::U32String(),
492  bool useEllipsis = true) :
493  StaticTextWidget(boss, name,
494  path.empty() ? placeholder : Common::U32String(path.toString(Common::Path::kNativeSeparator)),
495  tooltip, font, Common::UNK_LANG, useEllipsis),
496  _path(path),
497  _placeholder(placeholder) {}
498  void setLabel(const Common::Path &path) {
499  _path = path;
500  if (path.empty()) {
501  StaticTextWidget::setLabel(_placeholder);
502  } else {
503  StaticTextWidget::setLabel(path.toString(Common::Path::kNativeSeparator));
504  }
505  }
506  const Common::Path &getLabel() const { return _path; }
507  void setEmptyPlaceHolder(const Common::U32String &placeholder) { _placeholder = placeholder; }
508 protected:
509  Common::Path _path;
510  Common::U32String _placeholder;
511 };
512 
513 /* ContainerWidget */
514 class ContainerWidget : public Widget {
515 public:
516  ContainerWidget(GuiObject *boss, int x, int y, int w, int h, bool scale = false);
517  ContainerWidget(GuiObject *boss, const Common::String &name);
518  ~ContainerWidget() override;
519 
520  bool containsWidget(Widget *) const override;
521  Widget *findWidget(int x, int y) override;
522  void removeWidget(Widget *widget) override;
523 
524  void setBackgroundType(ThemeEngine::WidgetBackground backgroundType);
525 protected:
526  void drawWidget() override;
527 
528  ThemeEngine::WidgetBackground _backgroundType;
529 };
530 
531 /* OptionsContainerWidget */
533 public:
541  OptionsContainerWidget(GuiObject *boss, const Common::String &name, const Common::String &dialogLayout,
542  const Common::String &domain);
543  ~OptionsContainerWidget() override;
544 
546  virtual void load() = 0;
547 
553  virtual bool save() = 0;
554 
559  virtual bool hasKeys() { return true; }
560 
562  virtual void setEnabled(bool e) {}
563 
564  void setParentDialog(Dialog *parentDialog) { _parentDialog = parentDialog; }
565  void setDomain(const Common::String &domain) { _domain = domain; }
566 
567 protected:
568  // Widget API
569  void reflowLayout() override;
570  void drawWidget() override {}
571  bool containsWidget(Widget *widget) const override;
572  Widget *findWidget(int x, int y) override;
573  void removeWidget(Widget *widget) override;
574 
576  GuiObject *widgetsBoss() { return this; }
577 
583  virtual void defineLayout(ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const {}
584 
585  Common::String _domain;
586  const Common::String _dialogLayout;
587 
588  Dialog *_parentDialog;
589 };
590 
591 ButtonWidget *addClearButton(GuiObject *boss, const Common::String &name, uint32 cmd, int x=0, int y=0, int w=0, int h=0, bool scale = false);
592 const Graphics::ManagedSurface *scaleGfx(const Graphics::ManagedSurface *gfx, int w, int h, bool filtering = false);
593 
594 } // End of namespace GUI
595 
596 #endif
Definition: managed_surface.h:51
Definition: str.h:59
FontColor
Font color selector.
Definition: ThemeEngine.h:288
TextAlign
Definition: font.h:48
Definition: surface.h:67
Definition: widget.h:355
Definition: widget.h:444
WidgetBackground
Widget background type.
Definition: ThemeEngine.h:226
Definition: widget.h:306
Definition: path.h:52
virtual void draw()
Definition: widget.h:329
Definition: widget.h:205
virtual void defineLayout(ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const
Definition: widget.h:583
Definition: widget.h:405
Definition: widget.h:378
Definition: ThemeEval.h:37
Definition: system.h:46
static const char kNativeSeparator
Definition: path.h:195
Definition: object.h:60
Definition: widget.h:532
Definition: widget.h:463
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
bool empty() const
Definition: path.h:353
Definition: ustr.h:57
virtual bool hasKeys()
Definition: widget.h:559
virtual void markAsDirty()
Definition: events.h:199
FontStyle
Font style selector.
Definition: ThemeEngine.h:274
virtual void getMinSize(int &minWidth, int &minHeight)
Definition: widget.h:139
String toString(char separator='/') const
GuiObject * widgetsBoss()
Definition: widget.h:576
Definition: dialog.h:49
A bold font. This is also the default font.
Definition: ThemeEngine.h:275
Definition: widget.h:270
State
State of the widget to be drawn.
Definition: ThemeEngine.h:249
Definition: widget.h:101
Definition: keyboard.h:294
virtual void setEnabled(bool e)
Definition: widget.h:562
Definition: widget.h:286
Definition: widget.h:514
Definition: widget.h:233
Definition: object.h:40
Language
Definition: language.h:45