ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 Widget *findWidgetInChain(Widget *w, uint32 type);
119  static bool containsWidgetInChain(Widget *start, Widget *search);
120 
121 public:
122  Widget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &tooltip = Common::U32String());
123  Widget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip = Common::U32String());
124  Widget(GuiObject *boss, const Common::String &name, const Common::U32String &tooltip = Common::U32String());
125  ~Widget() override;
126 
127  void init();
128 
129  void setNext(Widget *w) { _next = w; }
130  void setBoss(GuiObject *newBoss) { _boss = newBoss; }
131  Widget *next() { return _next; }
132 
133  int16 getAbsX() const override { return _x + _boss->getChildX(); }
134  int16 getAbsY() const override { return _y + _boss->getChildY(); }
135 
136  virtual void setPos(int x, int y) { _x = x; _y = y; }
137  virtual void setSize(int w, int h) { _w = w; _h = h; }
138 
140  virtual void getMinSize(int &minWidth, int &minHeight) { minHeight = -1; minWidth = -1; }
141 
142  virtual void handleMouseDown(int x, int y, int button, int clickCount) {}
143  virtual void handleMouseUp(int x, int y, int button, int clickCount) {}
144  virtual void handleMouseEntered(int button) {}
145  virtual void handleMouseLeft(int button) {}
146  virtual void handleMouseMoved(int x, int y, int button) {}
147  void handleMouseWheel(int x, int y, int direction) override { assert(_boss); _boss->handleMouseWheel(x, y, direction); }
148  virtual bool handleKeyDown(Common::KeyState state) { return false; } // Return true if the event was handled
149  virtual bool handleKeyUp(Common::KeyState state) { return false; } // Return true if the event was handled
150  virtual void handleOtherEvent(const Common::Event &evt) {}
151  virtual void handleTickle() {}
152 
154  virtual void markAsDirty();
155 
157  virtual void draw();
158 
159  void receivedFocus() { _hasFocus = true; receivedFocusWidget(); }
160  void lostFocus() { _hasFocus = false; lostFocusWidget(); }
161  virtual bool wantsFocus() { return false; }
162 
163  uint32 getType() const { return _type; }
164 
165  void setFlags(int flags);
166  void clearFlags(int flags);
167  int getFlags() const { return _flags; }
168 
169  void setEnabled(bool e);
170  bool isEnabled() const;
171 
172  void setVisible(bool e);
173  bool isVisible() const override;
174 
175  bool useRTL() const;
176 
177  uint8 parseHotkey(const Common::U32String &label);
178  Common::U32String cleanupHotkey(const Common::U32String &label);
179 
180  bool hasTooltip() const { return !_tooltip.empty(); }
181  const Common::U32String &getTooltip() const { return _tooltip; }
182  void setTooltip(const Common::U32String &tooltip) { _tooltip = tooltip; }
183  void setTooltip(const Common::String &tooltip) { _tooltip = Common::U32String(tooltip); }
184 
185  virtual bool containsWidget(Widget *) const { return false; }
186 
187  void read(const Common::U32String &str);
188 
189 protected:
190  void updateState(int oldFlags, int newFlags);
191 
192  virtual void drawWidget() = 0;
193 
194  virtual void receivedFocusWidget() {}
195  virtual void lostFocusWidget() {}
196 
197  virtual Widget *findWidget(int x, int y) { return this; }
198 
199  void releaseFocus() override { assert(_boss); _boss->releaseFocus(); }
200 
201  // By default, delegate unhandled commands to the boss
202  void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override { assert(_boss); _boss->handleCommand(sender, cmd, data); }
203 };
204 
205 /* StaticTextWidget */
206 class StaticTextWidget : public Widget {
207 protected:
208  Common::U32String _label;
209  Graphics::TextAlign _align;
211  ThemeEngine::FontColor _fontColor;
212  bool _useEllipsis;
213 
214 public:
215  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);
216  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);
217  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);
218  void setValue(int value);
219  void setLabel(const Common::U32String &label);
220  void handleMouseEntered(int button) override { readLabel(); }
221  const Common::U32String &getLabel() const { return _label; }
222  void setAlign(Graphics::TextAlign align);
223  Graphics::TextAlign getAlign() const { return _align; }
224  void readLabel() { read(_label); }
225  void setFontColor(ThemeEngine::FontColor color);
226 
227 protected:
228  void reflowLayout() override;
229  void drawWidget() override;
230  void setFont(ThemeEngine::FontStyle font, Common::Language lang);
231 };
232 
233 /* ButtonWidget */
235  friend class Dialog; // Needed for the hotkey handling
236 protected:
237  uint32 _cmd;
238  uint8 _hotkey;
239  uint8 _highresHotkey;
240  uint8 _lowresHotkey;
241  Common::U32String _lowresLabel;
242 public:
243  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());
244  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());
245  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());
246 
247  void getMinSize(int &minWidth, int &minHeight) override;
248 
249  void setCmd(uint32 cmd) { _cmd = cmd; }
250  uint32 getCmd() const { return _cmd; }
251 
252  void setLabel(const Common::U32String &label);
253  void setLabel(const Common::String &label);
254  void setLowresLabel(const Common::U32String &label);
255  const Common::U32String &getLabel();
256 
257  void handleMouseUp(int x, int y, int button, int clickCount) override;
258  void handleMouseDown(int x, int y, int button, int clickCount) override;
259  void handleMouseEntered(int button) override { readLabel(); if (_duringPress) { setFlags(WIDGET_PRESSED); } else { setFlags(WIDGET_HILITED); } markAsDirty(); }
260  void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED | WIDGET_PRESSED); markAsDirty(); }
261 
262  void setHighLighted(bool enable);
263  void setPressedState();
264  void setUnpressedState();
265 protected:
266  void drawWidget() override;
267  bool _duringPress;
268 };
269 
270 /* DropdownButtonWidget */
272 public:
273  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());
274  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());
275  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());
276 
277  void handleMouseMoved(int x, int y, int button) override;
278  void handleMouseUp(int x, int y, int button, int clickCount) override;
279  void reflowLayout() override;
280  void getMinSize(int &minWidth, int &minHeight) override;
281 
282 
283  void appendEntry(const Common::U32String &label, uint32 cmd);
284  void clearEntries();
285 
286 protected:
287  struct Entry {
288  Common::U32String label;
289  uint32 cmd;
290  };
292 
293  // Widget API
294  void drawWidget() override;
295 
296  void reset();
297  bool isInDropDown(int x, int y) const;
298 
299  EntryList _entries;
300 
301  uint32 _dropdownWidth;
302  bool _inDropdown;
303  bool _inButton;
304 };
305 
306 /* PicButtonWidget */
308 public:
309  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);
310  PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
311  PicButtonWidget(GuiObject *boss, const Common::String &name, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
312  ~PicButtonWidget() override;
313 
314  void setGfx(const Graphics::ManagedSurface *gfx, int statenum = kPicButtonStateEnabled, bool scale = true);
315  void setGfx(const Graphics::Surface *gfx, int statenum = kPicButtonStateEnabled, bool scale = true);
316  void setGfxFromTheme(const char *name, int statenum = kPicButtonStateEnabled, bool scale = true);
317  void setGfx(int w, int h, int r, int g, int b, int statenum = kPicButtonStateEnabled);
318 
319  void setButtonDisplay(bool enable) {_showButton = enable; }
320 
321 protected:
322  void drawWidget() override;
323 
324  Graphics::ManagedSurface _gfx[kPicButtonStateMax + 1];
325  Graphics::AlphaType _alphaType[kPicButtonStateMax + 1];
326  bool _showButton;
327 };
328 
329 /* CheckboxWidget */
330 class CheckboxWidget : public ButtonWidget {
331 protected:
332  bool _state;
333  bool _overrideText;
334  int _spacing;
335 public:
336  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);
337  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);
338  CheckboxWidget(GuiObject *boss, const Common::String &name, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0, uint8 hotkey = 0);
339 
340  void handleMouseUp(int x, int y, int button, int clickCount) override;
341  void handleMouseEntered(int button) override { readLabel(); setFlags(WIDGET_HILITED); markAsDirty(); }
342  void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED); markAsDirty(); }
343 
344  void setState(bool state);
345  void toggleState() { setState(!_state); }
346  bool getState() const { return _state; }
347 
348  void setOverride(bool enable);
349 
350 protected:
351  void drawWidget() override;
352 };
353 
354 class RadiobuttonWidget;
355 
357 public:
358  RadiobuttonGroup(GuiObject *boss, uint32 cmd = 0);
359  ~RadiobuttonGroup() override {}
360 
361  void addButton(RadiobuttonWidget *button) { _buttons.push_back(button); }
362  Common::Array<RadiobuttonWidget *> getButtonList() const { return _buttons; }
363 
364  void setValue(int state);
365  int getValue() const { return _value; }
366 
367  void setEnabled(bool ena);
368 
369  void setCmd(uint32 cmd) { _cmd = cmd; }
370  uint32 getCmd() const { return _cmd; }
371 
372 protected:
374  int _value;
375  uint32 _cmd;
376 };
377 
378 /* RadiobuttonWidget */
380 protected:
381  bool _state;
382  int _spacing;
383  int _value;
384 
385 public:
386  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);
387  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);
388  RadiobuttonWidget(GuiObject *boss, const Common::String &name, RadiobuttonGroup *group, int value, const Common::U32String &label, const Common::U32String &tooltip = Common::U32String(), uint8 hotkey = 0);
389 
390  void handleMouseUp(int x, int y, int button, int clickCount) override;
391  void handleMouseEntered(int button) override { readLabel(); setFlags(WIDGET_HILITED); markAsDirty(); }
392  void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED); markAsDirty(); }
393 
394  void setState(bool state, bool setGroup = true);
395  void toggleState() { setState(!_state); }
396  bool getState() const { return _state; }
397  int getValue() const { return _value; }
398 
399 protected:
400  void drawWidget() override;
401 
402  RadiobuttonGroup *_group;
403 };
404 
405 /* SliderWidget */
406 class SliderWidget : public Widget, public CommandSender {
407 protected:
408  uint32 _cmd;
409  int _value, _oldValue;
410  int _valueMin, _valueMax;
411  bool _isDragging;
412  uint _labelWidth;
413 public:
414  SliderWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0);
415  SliderWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0);
416  SliderWidget(GuiObject *boss, const Common::String &name, const Common::U32String &tooltip = Common::U32String(), uint32 cmd = 0);
417 
418  void setCmd(uint32 cmd) { _cmd = cmd; }
419  uint32 getCmd() const { return _cmd; }
420 
421  void setValue(int value) { _value = value; }
422  int getValue() const { return _value; }
423 
424  void setMinValue(int value) { _valueMin = value; }
425  int getMinValue() const { return _valueMin; }
426  void setMaxValue(int value) { _valueMax = value; }
427  int getMaxValue() const { return _valueMax; }
428 
429  void handleMouseMoved(int x, int y, int button) override;
430  void handleMouseDown(int x, int y, int button, int clickCount) override;
431  void handleMouseUp(int x, int y, int button, int clickCount) override;
432  void handleMouseEntered(int button) override { setFlags(WIDGET_HILITED); markAsDirty(); }
433  void handleMouseLeft(int button) override { clearFlags(WIDGET_HILITED); markAsDirty(); }
434  void handleMouseWheel(int x, int y, int direction) override;
435 
436 protected:
437  void drawWidget() override;
438 
439  int valueToPos(int value);
440  int posToValue(int pos);
441  int valueToBarWidth(int value);
442 };
443 
444 /* GraphicsWidget */
445 class GraphicsWidget : public Widget {
446 public:
447  GraphicsWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &tooltip = Common::U32String());
448  GraphicsWidget(GuiObject *boss, int x, int y, int w, int h, const Common::U32String &tooltip = Common::U32String());
449  GraphicsWidget(GuiObject *boss, const Common::String &name, const Common::U32String &tooltip = Common::U32String());
450  ~GraphicsWidget() override;
451 
452  void setGfx(const Graphics::ManagedSurface *gfx, bool scale = false);
453  void setGfx(const Graphics::Surface *gfx, bool scale = false);
454  void setGfx(int w, int h, int r, int g, int b);
455  void setGfxFromTheme(const char *name);
456 
457 protected:
458  void drawWidget() override;
459 
461  Graphics::AlphaType _alphaType;
462 };
463 
464 class PathWidget : public StaticTextWidget {
465 public:
466  PathWidget(GuiObject *boss, int x, int y, int w, int h, bool scale,
467  const Common::Path &path, Graphics::TextAlign align,
468  const Common::U32String &placeholder = Common::U32String(),
469  const Common::U32String &tooltip = Common::U32String(),
471  bool useEllipsis = true) :
472  StaticTextWidget(boss, x, y, w, h, scale,
473  path.empty() ? placeholder : Common::U32String(path.toString(Common::Path::kNativeSeparator)),
474  align, tooltip, font, Common::UNK_LANG, useEllipsis),
475  _path(path),
476  _placeholder(placeholder) { }
477  PathWidget(GuiObject *boss, int x, int y, int w, int h,
478  const Common::Path &path, Graphics::TextAlign align,
479  const Common::U32String &placeholder = Common::U32String(),
480  const Common::U32String &tooltip = Common::U32String(),
482  bool useEllipsis = true) :
483  StaticTextWidget(boss, x, y, w, h,
484  path.empty() ? placeholder : Common::U32String(path.toString(Common::Path::kNativeSeparator)),
485  align, tooltip, font, Common::UNK_LANG, useEllipsis),
486  _path(path),
487  _placeholder(placeholder) {}
488  PathWidget(GuiObject *boss, const Common::String &name,
489  const Common::Path &path,
490  const Common::U32String &placeholder = Common::U32String(),
491  const Common::U32String &tooltip = Common::U32String(),
493  bool useEllipsis = true) :
494  StaticTextWidget(boss, name,
495  path.empty() ? placeholder : Common::U32String(path.toString(Common::Path::kNativeSeparator)),
496  tooltip, font, Common::UNK_LANG, useEllipsis),
497  _path(path),
498  _placeholder(placeholder) {}
499  void setLabel(const Common::Path &path) {
500  _path = path;
501  if (path.empty()) {
502  StaticTextWidget::setLabel(_placeholder);
503  } else {
504  StaticTextWidget::setLabel(path.toString(Common::Path::kNativeSeparator));
505  }
506  }
507  const Common::Path &getLabel() const { return _path; }
508  void setEmptyPlaceHolder(const Common::U32String &placeholder) { _placeholder = placeholder; }
509 protected:
510  Common::Path _path;
511  Common::U32String _placeholder;
512 };
513 
514 /* ContainerWidget */
515 class ContainerWidget : public Widget {
516 public:
517  ContainerWidget(GuiObject *boss, int x, int y, int w, int h, bool scale = false);
518  ContainerWidget(GuiObject *boss, const Common::String &name);
519  ~ContainerWidget() override;
520 
521  bool containsWidget(Widget *) const override;
522  Widget *findWidget(int x, int y) override;
523  void removeWidget(Widget *widget) override;
524 
525  void setBackgroundType(ThemeEngine::WidgetBackground backgroundType);
526 protected:
527  void drawWidget() override;
528 
529  ThemeEngine::WidgetBackground _backgroundType;
530 };
531 
532 /* OptionsContainerWidget */
534 public:
542  OptionsContainerWidget(GuiObject *boss, const Common::String &name, const Common::String &dialogLayout,
543  const Common::String &domain);
544  ~OptionsContainerWidget() override;
545 
547  virtual void load() = 0;
548 
554  virtual bool save() = 0;
555 
560  virtual bool hasKeys() { return true; }
561 
563  virtual void setEnabled(bool e) {}
564 
565  void setParentDialog(Dialog *parentDialog) { _parentDialog = parentDialog; }
566  void setDomain(const Common::String &domain) { _domain = domain; }
567 
568 protected:
569  // Widget API
570  void reflowLayout() override;
571  void drawWidget() override {}
572  bool containsWidget(Widget *widget) const override;
573  Widget *findWidget(int x, int y) override;
574  void removeWidget(Widget *widget) override;
575 
577  GuiObject *widgetsBoss() { return this; }
578 
584  virtual void defineLayout(ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const {}
585 
586  Common::String _domain;
587  const Common::String _dialogLayout;
588 
589  Dialog *_parentDialog;
590 };
591 
592 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);
593 const Graphics::ManagedSurface *scaleGfx(const Graphics::ManagedSurface *gfx, int w, int h, bool filtering = false);
594 
595 } // End of namespace GUI
596 
597 #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:356
Definition: widget.h:445
WidgetBackground
Widget background type.
Definition: ThemeEngine.h:226
Definition: widget.h:307
Definition: path.h:52
virtual void draw()
Definition: widget.h:330
Definition: widget.h:206
virtual void defineLayout(ThemeEval &layouts, const Common::String &layoutName, const Common::String &overlayedLayout) const
Definition: widget.h:584
Definition: widget.h:406
Definition: widget.h:379
Definition: ThemeEval.h:37
Definition: system.h:46
static const char kNativeSeparator
Definition: path.h:195
Definition: object.h:60
Definition: widget.h:533
Definition: widget.h:464
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:560
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:140
String toString(char separator='/') const
GuiObject * widgetsBoss()
Definition: widget.h:577
Definition: dialog.h:49
A bold font. This is also the default font.
Definition: ThemeEngine.h:275
Definition: widget.h:271
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:563
Definition: widget.h:287
Definition: widget.h:515
Definition: widget.h:234
Definition: object.h:40
Language
Definition: language.h:45