OpenTTD Source 20250205-master-gfd85ab1e2c
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"
16
20void ChangeWindowOwner(Owner old_owner, Owner new_owner);
21
22void ResizeWindow(Window *w, int x, int y, bool clamp_to_screen = true, bool schedule_resize = true);
27
28int GetMainViewTop();
30
31void InitWindowSystem();
35void InputLoop();
36
37void InvalidateWindowData(WindowClass cls, WindowNumber number, int data = 0, bool gui_scope = false);
38void InvalidateWindowClassesData(WindowClass cls, int data = 0, bool gui_scope = false);
39
44void HideVitalWindows();
45void ShowVitalWindows();
46
51void ReInitAllWindows(bool zoom_changed);
52
53void SetWindowWidgetDirty(WindowClass cls, WindowNumber number, WidgetID widget_index);
56
57void CloseWindowById(WindowClass cls, WindowNumber number, bool force = true, int data = 0);
58void CloseWindowByClass(WindowClass cls, int data = 0);
59
62Point GetCaretPosition();
63
64#endif /* WINDOW_FUNC_H */
Types related to companies.
Owner
Enum for all companies/owners.
All geometry types in OpenTTD.
Coordinates of a point in 2D.
Number to differentiate different windows of the same class.
Data structure for an opened window.
Definition window_gui.h:272
int PositionStatusbar(Window *w)
(Re)position statusbar window at the screen.
Definition window.cpp:3399
void CloseConstructionWindows()
Close all windows that are used for construction of vehicle etc.
Definition window.cpp:3303
void ShowVitalWindows()
Show the vital in-game windows.
Definition main_gui.cpp:575
Window * GetMainWindow()
Get the main window, i.e.
Definition window.cpp:1124
void InputLoop()
Regular call from the global game loop.
Definition window.cpp:2991
int PositionMainToolbar(Window *w)
(Re)position main toolbar window at the screen.
Definition window.cpp:3388
void CloseNonVitalWindows()
Try to close a non-vital window.
Definition window.cpp:3259
int PositionNetworkChatWindow(Window *w)
(Re)position network chat window at the screen.
Definition window.cpp:3421
void SetupColoursAndInitialWindow()
Initialise the default colours (remaps and the likes), and load the main windows.
Definition main_gui.cpp:546
Window * FindWindowByClass(WindowClass cls)
Find any window by its class.
Definition window.cpp:1110
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:3234
void DeleteAllMessages()
Delete all messages and close their corresponding window (if any).
Definition window.cpp:3291
int GetMainViewTop()
Return the top of the main view available for general use.
Definition window.cpp:2059
void ReInitAllWindows(bool zoom_changed)
Re-initialize all windows.
Definition window.cpp:3333
int PositionNewsMessage(Window *w)
(Re)position news message window at the screen.
Definition window.cpp:3410
int GetMainViewBottom()
Return the bottom of the main view available for general use.
Definition window.cpp:2070
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:1185
void SetWindowClassesDirty(WindowClass cls)
Mark all windows of a particular class as dirty (in need of repainting)
Definition window.cpp:3125
bool FocusedWindowIsConsole()
Check if a console is focused.
Definition window.cpp:459
void ResetWindowSystem()
Reset the windowing system, by means of shutting it down followed by re-initialization.
Definition window.cpp:1815
bool EditBoxInGlobalFocus()
Check if an edit box is in global focus.
Definition window.cpp:445
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:3217
void HideVitalWindows()
Close all always on-top windows to get an empty screen.
Definition window.cpp:3316
void ResizeWindow(Window *w, int x, int y, bool clamp_to_screen=true, bool schedule_resize=true)
Resize the window.
Definition window.cpp:2019
void CloseWindowByClass(WindowClass cls, int data=0)
Close all windows of a given class.
Definition window.cpp:1149
void CloseAllNonVitalWindows()
It is possible that a stickied window gets to a position where the 'close' button is outside the gami...
Definition window.cpp:3278
Window * FindWindowById(WindowClass cls, WindowNumber number)
Find a window by its class and window number.
Definition window.cpp:1095
void UnInitWindowSystem()
Close down the windowing system.
Definition window.cpp:1801
void CloseWindowById(WindowClass cls, WindowNumber number, bool force=true, int data=0)
Close a window by its class and window number (if it is open).
Definition window.cpp:1137
void InitWindowSystem()
(re)initialize the windowing system
Definition window.cpp:1779
void SetWindowWidgetDirty(WindowClass cls, WindowNumber number, WidgetID widget_index)
Mark a particular widget in a particular window as dirty (in need of repainting)
Definition window.cpp:3112
void SetWindowDirty(WindowClass cls, WindowNumber number)
Mark window as dirty (in need of repainting)
Definition window.cpp:3099
Types related to windows.
int WidgetID
Widget ID.
Definition window_type.h:20
WindowClass
Window classes.
Definition window_type.h:46