ScummVM API documentation
ui_window.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 /*
23  * This file is based on WME Lite.
24  * http://dead-code.org/redir.php?target=wmelite
25  * Copyright (c) 2011 Jan Nedoma
26  */
27 
28 #ifndef WINTERMUTE_UIWINDOW_H
29 #define WINTERMUTE_UIWINDOW_H
30 
31 
32 #include "engines/wintermute/ui/ui_object.h"
33 #include "common/events.h"
34 
35 namespace Wintermute {
36 
37 class UIButton;
38 class BaseViewport;
39 class UIWindow : public UIObject {
40 public:
41  bool getWindowObjects(BaseArray<UIObject *> &Objects, bool InteractiveOnly);
42 
43  void cleanup();
44  void makeFreezable(bool freezable) override;
45 
46  bool handleMouseWheel(int32 delta) override;
47 
48  bool close();
49  bool goSystemExclusive();
50  bool goExclusive();
51  bool moveFocus(bool forward = true);
52  bool handleMouse(TMouseEvent Event, TMouseButton Button) override;
53  DECLARE_PERSISTENT(UIWindow, UIObject)
54  bool showWidget(const char *name, bool visible = true);
55  bool enableWidget(const char *name, bool enable = true);
56 
57  bool display(int offsetX = 0, int offsetY = 0) override;
58  UIWindow(BaseGame *inGame);
59  ~UIWindow() override;
60  bool handleKeypress(Common::Event *event, bool printable = false) override;
61  BaseArray<UIObject *> _widgets;
62 
63  bool loadFile(const char *filename);
64  bool loadBuffer(char *buffer, bool complete = true);
65 
66  bool listen(BaseScriptHolder *param1, uint32 param2) override;
67  bool saveAsText(BaseDynamicBuffer *buffer, int indent) override;
68 
69  // scripting interface
70  ScValue *scGetProperty(const Common::String &name) override;
71  bool scSetProperty(const char *name, ScValue *value) override;
72  bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) override;
73  const char *scToString() override;
74 
75  bool getInGame() const;
76  TWindowMode getMode() const;
77 
78 private:
79  bool _pauseMusic;
80  BaseViewport *_viewport;
81  bool _clipContents;
82  bool _inGame;
83  bool _isMenu;
84  bool _fadeBackground;
85  TWindowMode _mode;
86  Point32 _dragFrom;
87  bool _dragging;
88  bool _transparent;
89  uint32 _fadeColor;
90  UIWindow *_shieldWindow;
91  UIButton *_shieldButton;
92  Rect32 _titleRect;
93  Rect32 _dragRect;
94  UITiledImage *_backInactive;
95  BaseFont *_fontInactive;
96  BaseSprite *_imageInactive;
97  TTextAlign _titleAlign;
98 };
99 
100 } // End of namespace Wintermute
101 
102 #endif
Definition: script.h:44
Definition: base_game.h:76
Definition: script_value.h:42
Definition: str.h:59
Definition: ui_button.h:37
Definition: rect32.h:31
Definition: base_dynamic_buffer.h:35
Definition: rect32.h:60
Definition: events.h:199
Definition: script_stack.h:41
Definition: base_script_holder.h:37
Definition: coll_templ.h:63
Definition: base_font.h:37
Definition: ui_tiled_image.h:37
Definition: base_viewport.h:38
Definition: ui_window.h:39
Definition: input.h:69
Definition: base_sprite.h:40
Definition: achievements_tables.h:27
Definition: ui_object.h:39