2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2012-01-01 17:22:32 +00:00
|
|
|
/** @file window_func.h %Window functions not directly related to making/drawing windows. */
|
2007-12-19 19:44:29 +00:00
|
|
|
|
|
|
|
#ifndef WINDOW_FUNC_H
|
|
|
|
#define WINDOW_FUNC_H
|
|
|
|
|
|
|
|
#include "window_type.h"
|
2008-09-30 20:51:04 +00:00
|
|
|
#include "company_type.h"
|
2013-08-05 20:37:14 +00:00
|
|
|
#include "core/geometry_type.hpp"
|
2007-12-19 19:44:29 +00:00
|
|
|
|
|
|
|
Window *FindWindowById(WindowClass cls, WindowNumber number);
|
2009-11-29 00:41:08 +00:00
|
|
|
Window *FindWindowByClass(WindowClass cls);
|
2008-09-30 20:39:50 +00:00
|
|
|
void ChangeWindowOwner(Owner old_owner, Owner new_owner);
|
2007-12-19 19:44:29 +00:00
|
|
|
|
2012-04-03 20:09:41 +00:00
|
|
|
void ResizeWindow(Window *w, int x, int y, bool clamp_to_screen = true);
|
2007-12-19 20:45:46 +00:00
|
|
|
int PositionMainToolbar(Window *w);
|
2010-11-13 23:40:36 +00:00
|
|
|
int PositionStatusbar(Window *w);
|
2010-11-18 19:24:40 +00:00
|
|
|
int PositionNewsMessage(Window *w);
|
2011-02-11 18:24:12 +00:00
|
|
|
int PositionNetworkChatWindow(Window *w);
|
2007-12-19 19:44:29 +00:00
|
|
|
|
2009-11-07 17:24:04 +00:00
|
|
|
int GetMainViewTop();
|
|
|
|
int GetMainViewBottom();
|
|
|
|
|
2007-12-19 19:44:29 +00:00
|
|
|
void InitWindowSystem();
|
|
|
|
void UnInitWindowSystem();
|
|
|
|
void ResetWindowSystem();
|
2009-02-09 02:57:15 +00:00
|
|
|
void SetupColoursAndInitialWindow();
|
2007-12-19 19:44:29 +00:00
|
|
|
void InputLoop();
|
2008-05-10 12:30:27 +00:00
|
|
|
|
2011-03-13 21:32:13 +00:00
|
|
|
void InvalidateWindowData(WindowClass cls, WindowNumber number, int data = 0, bool gui_scope = false);
|
|
|
|
void InvalidateWindowClassesData(WindowClass cls, int data = 0, bool gui_scope = false);
|
2007-12-19 19:44:29 +00:00
|
|
|
|
2021-05-17 13:46:38 +00:00
|
|
|
void CloseNonVitalWindows();
|
|
|
|
void CloseAllNonVitalWindows();
|
2019-02-16 23:15:58 +00:00
|
|
|
void DeleteAllMessages();
|
2021-05-17 13:46:38 +00:00
|
|
|
void CloseConstructionWindows();
|
2007-12-19 19:44:29 +00:00
|
|
|
void HideVitalWindows();
|
|
|
|
void ShowVitalWindows();
|
|
|
|
|
2021-04-05 17:43:12 +00:00
|
|
|
/**
|
|
|
|
* Re-initialize all windows.
|
|
|
|
* @param zoom_changed Set if windows are being re-initialized due to a zoom level changed.
|
|
|
|
*/
|
|
|
|
void ReInitAllWindows(bool zoom_changed);
|
2009-06-28 20:09:40 +00:00
|
|
|
|
2009-09-13 19:15:59 +00:00
|
|
|
void SetWindowWidgetDirty(WindowClass cls, WindowNumber number, byte widget_index);
|
|
|
|
void SetWindowDirty(WindowClass cls, WindowNumber number);
|
|
|
|
void SetWindowClassesDirty(WindowClass cls);
|
2008-05-10 12:30:27 +00:00
|
|
|
|
2021-05-17 13:46:38 +00:00
|
|
|
void CloseWindowById(WindowClass cls, WindowNumber number, bool force = true);
|
|
|
|
void CloseWindowByClass(WindowClass cls);
|
2007-12-25 11:26:07 +00:00
|
|
|
|
2013-08-05 20:36:20 +00:00
|
|
|
bool EditBoxInGlobalFocus();
|
2019-11-04 18:10:09 +00:00
|
|
|
bool FocusedWindowIsConsole();
|
2013-08-05 20:37:14 +00:00
|
|
|
Point GetCaretPosition();
|
2013-08-05 20:36:20 +00:00
|
|
|
|
2007-12-19 19:44:29 +00:00
|
|
|
#endif /* WINDOW_FUNC_H */
|