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