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
35namespace Wintermute {
36
37class UIButton;
38class BaseViewport;
39class UIWindow : public UIObject {
40public:
41 BaseObject *getPrevAccessObject(BaseObject *currObject);
42 BaseObject *getNextAccessObject(BaseObject *currObject);
43 bool getWindowObjects(BaseArray<UIObject *> &objects, bool interactiveOnly);
44
45 bool _pauseMusic;
46 void cleanup();
47 void makeFreezable(bool freezable) override;
48 BaseViewport *_viewport;
49 bool _clipContents;
50 bool _inGame;
51 bool _isMenu;
52 bool _fadeBackground;
53 uint32 _fadeColor;
54 bool handleMouseWheel(int32 delta) override;
55 UIWindow *_shieldWindow;
56 UIButton *_shieldButton;
57 bool close();
58 bool goSystemExclusive();
59 bool goExclusive();
60 TWindowMode _mode;
61 bool moveFocus(bool forward = true);
62 bool handleMouse(TMouseEvent event, TMouseButton button) override;
63 Common::Point32 _dragFrom;
64 bool _dragging;
65 DECLARE_PERSISTENT(UIWindow, UIObject)
66 bool _transparent;
67 bool showWidget(const char *name, bool visible = true);
68 bool enableWidget(const char *name, bool enable = true);
69 Common::Rect32 _titleRect;
70 Common::Rect32 _dragRect;
71 bool display(int offsetX = 0, int offsetY = 0) override;
72 UIWindow(BaseGame *inGame);
73 ~UIWindow() override;
74 bool handleKeypress(Common::Event *event, bool printable = false) override;
75 BaseArray<UIObject *> _widgets;
76 TTextAlign _titleAlign;
77 bool loadFile(const char *filename);
78 bool loadBuffer(char *buffer, bool complete = true);
79 UITiledImage *_backInactive;
80 BaseFont *_fontInactive;
81 BaseSprite *_imageInactive;
82 bool listen(BaseScriptHolder *param1, uint32 param2) override;
83 bool saveAsText(BaseDynamicBuffer *buffer, int indent) override;
84
85 // scripting interface
86 ScValue *scGetProperty(const char *name) override;
87 bool scSetProperty(const char *name, ScValue *value) override;
88 bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) override;
89 const char *scToString() override;
90};
91
92} // End of namespace Wintermute
93
94#endif
Definition: coll_templ.h:345
Definition: base_dynamic_buffer.h:35
Definition: base_font.h:37
Definition: base_game.h:79
Definition: base_object.h:49
Definition: base_script_holder.h:37
Definition: base_sprite.h:40
Definition: base_viewport.h:37
Definition: script.h:44
Definition: script_stack.h:41
Definition: script_value.h:42
Definition: ui_button.h:37
Definition: ui_object.h:39
Definition: ui_tiled_image.h:37
Definition: ui_window.h:39
Definition: events.h:218
Definition: rect.h:146
Definition: rect.h:538