(svn r27763) -Update from Eints:
[openttd.git] / src / window_func.h
blob453b88978901d9ecd285e89169ee00156c5ad4cb
1 /* $Id$ */
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 */
10 /** @file window_func.h %Window functions not directly related to making/drawing windows. */
12 #ifndef WINDOW_FUNC_H
13 #define WINDOW_FUNC_H
15 #include "window_type.h"
16 #include "company_type.h"
17 #include "core/geometry_type.hpp"
19 Window *FindWindowById(WindowClass cls, WindowNumber number);
20 Window *FindWindowByClass(WindowClass cls);
21 void ChangeWindowOwner(Owner old_owner, Owner new_owner);
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);
29 int GetMainViewTop();
30 int GetMainViewBottom();
32 void InitWindowSystem();
33 void UnInitWindowSystem();
34 void ResetWindowSystem();
35 void SetupColoursAndInitialWindow();
36 void InputLoop();
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);
41 void DeleteNonVitalWindows();
42 void DeleteAllNonVitalWindows();
43 void DeleteConstructionWindows();
44 void HideVitalWindows();
45 void ShowVitalWindows();
47 void ReInitAllWindows();
49 void SetWindowWidgetDirty(WindowClass cls, WindowNumber number, byte widget_index);
50 void SetWindowDirty(WindowClass cls, WindowNumber number);
51 void SetWindowClassesDirty(WindowClass cls);
53 void DeleteWindowById(WindowClass cls, WindowNumber number, bool force = true);
54 void DeleteWindowByClass(WindowClass cls);
56 bool EditBoxInGlobalFocus();
57 Point GetCaretPosition();
59 #endif /* WINDOW_FUNC_H */