OpenTTD

window_func.h
Go to the documentation of this file.
1 /* $Id: window_func.h 25681 2013-08-05 20:37:14Z michi_cc $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
9
12 #ifndef WINDOW_FUNC_H
13 #define WINDOW_FUNC_H
14
15 #include "window_type.h"
16 #include "company_type.h"
17 #include "core/geometry_type.hpp"
18
19 Window *FindWindowById(WindowClass cls, WindowNumber number);
20 Window *FindWindowByClass(WindowClass cls);
21 void ChangeWindowOwner(Owner old_owner, Owner new_owner);
22
23 void ResizeWindow(Window *w, int x, int y, bool clamp_to_screen = true);
24 int PositionMainToolbar(Window *w);
25 int PositionStatusbar(Window *w);
26 int PositionNewsMessage(Window *w);
27 int PositionNetworkChatWindow(Window *w);
28
29 int GetMainViewTop();
30 int GetMainViewBottom();
31
32 void InitWindowSystem();
33 void UnInitWindowSystem();
34 void ResetWindowSystem();
35 void SetupColoursAndInitialWindow();
36 void InputLoop();
37
38 void InvalidateWindowData(WindowClass cls, WindowNumber number, int data = 0, bool gui_scope = false);
39 void InvalidateWindowClassesData(WindowClass cls, int data = 0, bool gui_scope = false);
40
41 void DeleteNonVitalWindows();
42 void DeleteAllNonVitalWindows();
43 void DeleteConstructionWindows();
44 void HideVitalWindows();
45 void ShowVitalWindows();
46
47 void ReInitAllWindows();
48
49 void SetWindowWidgetDirty(WindowClass cls, WindowNumber number, byte widget_index);
50 void SetWindowDirty(WindowClass cls, WindowNumber number);
51 void SetWindowClassesDirty(WindowClass cls);
52
53 void DeleteWindowById(WindowClass cls, WindowNumber number, bool force = true);
54 void DeleteWindowByClass(WindowClass cls);
55
56 bool EditBoxInGlobalFocus();
57 Point GetCaretPosition();
58
59 #endif /* WINDOW_FUNC_H */
PositionNewsMessage
int PositionNewsMessage(Window *w)
(Re)position news message window at the screen.
Definition: window.cpp:3418
DeleteWindowById
void DeleteWindowById(WindowClass cls, WindowNumber number, bool force=true)
Delete a window by its class and window number (if it is open).
Definition: window.cpp:1137
SetWindowClassesDirty
void SetWindowClassesDirty(WindowClass cls)
Mark all windows of a particular class as dirty (in need of repainting)
Definition: window.cpp:3148
DeleteNonVitalWindows
void DeleteNonVitalWindows()
Try to delete a non-vital window.
Definition: window.cpp:3266
HideVitalWindows
void HideVitalWindows()
Delete all always on-top windows to get an empty screen.
Definition: window.cpp:3337
PositionMainToolbar
int PositionMainToolbar(Window *w)
(Re)position main toolbar window at the screen.
Definition: window.cpp:3396
ShowVitalWindows
void ShowVitalWindows()
Show the vital in-game windows.
Definition: main_gui.cpp:577
DeleteWindowByClass
void DeleteWindowByClass(WindowClass cls)
Delete all windows of a given class.
Definition: window.cpp:1150
window_type.h
Types related to windows.
PositionNetworkChatWindow
int PositionNetworkChatWindow(Window *w)
(Re)position network chat window at the screen.
Definition: window.cpp:3429
SetupColoursAndInitialWindow
void SetupColoursAndInitialWindow()
Initialise the default colours (remaps and the likes), and load the main windows. ...
Definition: main_gui.cpp:549
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:1198
EditBoxInGlobalFocus
bool EditBoxInGlobalFocus()
Check if an edit box is in global focus.
Definition: window.cpp:455
ResizeWindow
void ResizeWindow(Window *w, int x, int y, bool clamp_to_screen=true)
Resize the window.
Definition: window.cpp:2116
UnInitWindowSystem
void UnInitWindowSystem()
Close down the windowing system.
Definition: window.cpp:1890
GetMainViewTop
int GetMainViewTop()
Return the top of the main view available for general use.
Definition: window.cpp:2152
WindowClass
WindowClass
Window classes.
Definition: window_type.h:39
DeleteConstructionWindows
void DeleteConstructionWindows()
Delete all windows that are used for construction of vehicle etc.
Definition: window.cpp:3318
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:3220
FindWindowByClass
Window * FindWindowByClass(WindowClass cls)
Find any window by its class.
Definition: window.cpp:1121
Window
Data structure for an opened window.
Definition: window_gui.h:271
SetWindowDirty
void SetWindowDirty(WindowClass cls, WindowNumber number)
Mark window as dirty (in need of repainting)
Definition: window.cpp:3120
ReInitAllWindows
void ReInitAllWindows()
Re-initialize all windows.
Definition: window.cpp:3344
ResetWindowSystem
void ResetWindowSystem()
Reset the windowing system, by means of shutting it down followed by re-initialization.
Definition: window.cpp:1910
GetMainViewBottom
int GetMainViewBottom()
Return the bottom of the main view available for general use.
Definition: window.cpp:2163
DeleteAllNonVitalWindows
void DeleteAllNonVitalWindows()
It is possible that a stickied window gets to a position where the &#39;close&#39; button is outside the gami...
Definition: window.cpp:3295
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:3134
InputLoop
void InputLoop()
Regular call from the global game loop.
Definition: window.cpp:3029
InitWindowSystem
void InitWindowSystem()
(re)initialize the windowing system
Definition: window.cpp:1869
geometry_type.hpp
All geometry types in OpenTTD.
FindWindowById
Window * FindWindowById(WindowClass cls, WindowNumber number)
Find a window by its class and window number.
Definition: window.cpp:1105
Point
Coordinates of a point in 2D.
Definition: geometry_type.hpp:28
company_type.h
Types related to companies.
PositionStatusbar
int PositionStatusbar(Window *w)
(Re)position statusbar window at the screen.
Definition: window.cpp:3407
WindowNumber
int32 WindowNumber
Number to differentiate different windows of the same class.
Definition: window_type.h:695
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:3238
Owner
Owner
Enum for all companies/owners.
Definition: company_type.h:20