OpenTTD Source: src/window_func.h Source File

OpenTTD Source 13.2.1

window_func.h
Go to the documentation of this file.
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
7
10 #ifndef WINDOW_FUNC_H
11 #define WINDOW_FUNC_H
12
13 #include "window_type.h"
14 #include "company_type.h"
15 #include "core/geometry_type.hpp"
16
17 Window *FindWindowById(WindowClass cls, WindowNumber number);
18 Window *FindWindowByClass(WindowClass cls);
19 void ChangeWindowOwner(Owner old_owner, Owner new_owner);
20
21 void ResizeWindow(Window *w, int x, int y, bool clamp_to_screen = true);
22 int PositionMainToolbar(Window *w);
23 int PositionStatusbar(Window *w);
24 int PositionNewsMessage(Window *w);
25 int PositionNetworkChatWindow(Window *w);
26
27 int GetMainViewTop();
28 int GetMainViewBottom();
29
30 void InitWindowSystem();
31 void UnInitWindowSystem();
32 void ResetWindowSystem();
33 void SetupColoursAndInitialWindow();
34 void InputLoop();
35
36 void InvalidateWindowData(WindowClass cls, WindowNumber number, int data = 0, bool gui_scope = false);
37 void InvalidateWindowClassesData(WindowClass cls, int data = 0, bool gui_scope = false);
38
39 void CloseNonVitalWindows();
40 void CloseAllNonVitalWindows();
41 void DeleteAllMessages();
42 void CloseConstructionWindows();
43 void HideVitalWindows();
44 void ShowVitalWindows();
45
50 void ReInitAllWindows(bool zoom_changed);
51
52 void SetWindowWidgetDirty(WindowClass cls, WindowNumber number, byte widget_index);
53 void SetWindowDirty(WindowClass cls, WindowNumber number);
54 void SetWindowClassesDirty(WindowClass cls);
55
56 void CloseWindowById(WindowClass cls, WindowNumber number, bool force = true);
57 void CloseWindowByClass(WindowClass cls);
58
59 bool EditBoxInGlobalFocus();
60 bool FocusedWindowIsConsole();
61 Point GetCaretPosition();
62
63 #endif /* WINDOW_FUNC_H */
SetWindowDirty
void SetWindowDirty(WindowClass cls, WindowNumber number)
Mark window as dirty (in need of repainting)
Definition: window.cpp:3156
PositionStatusbar
int PositionStatusbar(Window *w)
(Re)position statusbar window at the screen.
Definition: window.cpp:3444
CloseWindowById
void CloseWindowById(WindowClass cls, WindowNumber number, bool force=true)
Close a window by its class and window number (if it is open).
Definition: window.cpp:1191
FindWindowById
Window * FindWindowById(WindowClass cls, WindowNumber number)
Find a window by its class and window number.
Definition: window.cpp:1161
CloseNonVitalWindows
void CloseNonVitalWindows()
Try to close a non-vital window.
Definition: window.cpp:3296
CloseWindowByClass
void CloseWindowByClass(WindowClass cls)
Close all windows of a given class.
Definition: window.cpp:1203
window_type.h
WindowNumber
int32 WindowNumber
Number to differentiate different windows of the same class.
Definition: window_type.h:713
CloseConstructionWindows
void CloseConstructionWindows()
Close all windows that are used for construction of vehicle etc.
Definition: window.cpp:3347
Owner
Owner
Enum for all companies/owners.
Definition: company_type.h:18
CloseAllNonVitalWindows
void CloseAllNonVitalWindows()
It is possible that a stickied window gets to a position where the 'close' button is outside the gami...
Definition: window.cpp:3319
SetWindowClassesDirty
void SetWindowClassesDirty(WindowClass cls)
Mark all windows of a particular class as dirty (in need of repainting)
Definition: window.cpp:3182
geometry_type.hpp
InitWindowSystem
void InitWindowSystem()
(re)initialize the windowing system
Definition: window.cpp:1840
DeleteAllMessages
void DeleteAllMessages()
Delete all messages and close their corresponding window (if any).
Definition: window.cpp:3335
EditBoxInGlobalFocus
bool EditBoxInGlobalFocus()
Check if an edit box is in global focus.
Definition: window.cpp:481
InputLoop
void InputLoop()
Regular call from the global game loop.
Definition: window.cpp:3040
WindowClass
WindowClass
Window classes.
Definition: window_type.h:37
InvalidateWindowClassesData
void InvalidateWindowClassesData(WindowClass cls, int data=0, bool gui_scope=false)
Mark window data of all windows of a given class as invalid (in need of re-computing) Note that by de...
Definition: window.cpp:3271
Point
Coordinates of a point in 2D.
Definition: geometry_type.hpp:21
ResizeWindow
void ResizeWindow(Window *w, int x, int y, bool clamp_to_screen=true)
Resize the window.
Definition: window.cpp:2088
FindWindowByClass
Window * FindWindowByClass(WindowClass cls)
Find any window by its class.
Definition: window.cpp:1176
FocusedWindowIsConsole
bool FocusedWindowIsConsole()
Check if a console is focused.
Definition: window.cpp:495
InvalidateWindowData
void InvalidateWindowData(WindowClass cls, WindowNumber number, int data=0, bool gui_scope=false)
Mark window data of the window of a given class and specific window number as invalid (in need of re-...
Definition: window.cpp:3254
HideVitalWindows
void HideVitalWindows()
Close all always on-top windows to get an empty screen.
Definition: window.cpp:3360
ReInitAllWindows
void ReInitAllWindows(bool zoom_changed)
Re-initialize all windows.
Definition: window.cpp:3377
PositionNewsMessage
int PositionNewsMessage(Window *w)
(Re)position news message window at the screen.
Definition: window.cpp:3455
ShowVitalWindows
void ShowVitalWindows()
Show the vital in-game windows.
Definition: main_gui.cpp:566
GetMainViewBottom
int GetMainViewBottom()
Return the bottom of the main view available for general use.
Definition: window.cpp:2135
SetupColoursAndInitialWindow
void SetupColoursAndInitialWindow()
Initialise the default colours (remaps and the likes), and load the main windows.
Definition: main_gui.cpp:538
PositionNetworkChatWindow
int PositionNetworkChatWindow(Window *w)
(Re)position network chat window at the screen.
Definition: window.cpp:3466
ResetWindowSystem
void ResetWindowSystem()
Reset the windowing system, by means of shutting it down followed by re-initialization.
Definition: window.cpp:1873
PositionMainToolbar
int PositionMainToolbar(Window *w)
(Re)position main toolbar window at the screen.
Definition: window.cpp:3433
UnInitWindowSystem
void UnInitWindowSystem()
Close down the windowing system.
Definition: window.cpp:1859
Window
Data structure for an opened window.
Definition: window_gui.h:213
ChangeWindowOwner
void ChangeWindowOwner(Owner old_owner, Owner new_owner)
Change the owner of all the windows one company can take over from another company in the case of a c...
Definition: window.cpp:1239
GetMainViewTop
int GetMainViewTop()
Return the top of the main view available for general use.
Definition: window.cpp:2124
SetWindowWidgetDirty
void SetWindowWidgetDirty(WindowClass cls, WindowNumber number, byte widget_index)
Mark a particular widget in a particular window as dirty (in need of repainting)
Definition: window.cpp:3169
company_type.h