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/>.
8 /** @file window_func.h %Window functions not directly related to making/drawing windows. */
13 #include "window_type.h"
14 #include "company_type.h"
15 #include "core/geometry_type.hpp"
17 Window
*FindWindowById(WindowClass cls
, WindowNumber number
);
18 Window
*FindWindowByClass(WindowClass cls
);
19 void ChangeWindowOwner(Owner old_owner
, Owner new_owner
);
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
);
28 int GetMainViewBottom();
30 void InitWindowSystem();
31 void UnInitWindowSystem();
32 void ResetWindowSystem();
33 void SetupColoursAndInitialWindow();
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);
39 void CloseNonVitalWindows();
40 void CloseAllNonVitalWindows();
41 void DeleteAllMessages();
42 void CloseConstructionWindows();
43 void HideVitalWindows();
44 void ShowVitalWindows();
47 * Re-initialize all windows.
48 * @param zoom_changed Set if windows are being re-initialized due to a zoom level changed.
50 void ReInitAllWindows(bool zoom_changed
);
52 void SetWindowWidgetDirty(WindowClass cls
, WindowNumber number
, byte widget_index
);
53 void SetWindowDirty(WindowClass cls
, WindowNumber number
);
54 void SetWindowClassesDirty(WindowClass cls
);
56 void CloseWindowById(WindowClass cls
, WindowNumber number
, bool force
= true);
57 void CloseWindowByClass(WindowClass cls
);
59 bool EditBoxInGlobalFocus();
60 bool FocusedWindowIsConsole();
61 Point
GetCaretPosition();
63 #endif /* WINDOW_FUNC_H */