|
@@ -10,18 +10,25 @@
|
|
|
#ifndef WINDOW_FUNC_H
|
|
|
#define WINDOW_FUNC_H
|
|
|
|
|
|
#include "window_type.h"
|
|
|
#include "company_type.h"
|
|
|
#include "core/geometry_type.hpp"
|
|
|
#include "core/strong_typedef_type.hpp"
|
|
|
|
|
|
Window *FindWindowById(WindowClass cls, WindowNumber number);
|
|
|
Window *FindWindowByClass(WindowClass cls);
|
|
|
Window *GetMainWindow();
|
|
|
void ChangeWindowOwner(Owner old_owner, Owner new_owner);
|
|
|
|
|
|
template<typename T, std::enable_if_t<std::is_base_of<StrongTypedefBase, T>::value, int> = 0>
|
|
|
Window *FindWindowById(WindowClass cls, T number)
|
|
|
{
|
|
|
return FindWindowById(cls, static_cast<typename T::BaseType>(number));
|
|
|
}
|
|
|
|
|
|
void ResizeWindow(Window *w, int x, int y, bool clamp_to_screen = true);
|
|
|
int PositionMainToolbar(Window *w);
|
|
|
int PositionStatusbar(Window *w);
|
|
|
int PositionNewsMessage(Window *w);
|
|
|
int PositionNetworkChatWindow(Window *w);
|
|
|
|
|
@@ -34,12 +41,18 @@ void ResetWindowSystem();
|
|
|
void SetupColoursAndInitialWindow();
|
|
|
void InputLoop();
|
|
|
|
|
|
void InvalidateWindowData(WindowClass cls, WindowNumber number, int data = 0, bool gui_scope = false);
|
|
|
void InvalidateWindowClassesData(WindowClass cls, int data = 0, bool gui_scope = false);
|
|
|
|
|
|
template<typename T, std::enable_if_t<std::is_base_of<StrongTypedefBase, T>::value, int> = 0>
|
|
|
void InvalidateWindowData(WindowClass cls, T number, int data = 0, bool gui_scope = false)
|
|
|
{
|
|
|
InvalidateWindowData(cls, static_cast<typename T::BaseType>(number), data, gui_scope);
|
|
|
}
|
|
|
|
|
|
void CloseNonVitalWindows();
|
|
|
void CloseAllNonVitalWindows();
|
|
|
void DeleteAllMessages();
|
|
|
void CloseConstructionWindows();
|
|
|
void HideVitalWindows();
|
|
|
void ShowVitalWindows();
|
|
@@ -51,14 +64,26 @@ void ShowVitalWindows();
|
|
|
void ReInitAllWindows(bool zoom_changed);
|
|
|
|
|
|
void SetWindowWidgetDirty(WindowClass cls, WindowNumber number, byte widget_index);
|
|
|
void SetWindowDirty(WindowClass cls, WindowNumber number);
|
|
|
void SetWindowClassesDirty(WindowClass cls);
|
|
|
|
|
|
template<typename T, std::enable_if_t<std::is_base_of<StrongTypedefBase, T>::value, int> = 0>
|
|
|
void SetWindowDirty(WindowClass cls, T number)
|
|
|
{
|
|
|
SetWindowDirty(cls, static_cast<typename T::BaseType>(number));
|
|
|
}
|
|
|
|
|
|
void CloseWindowById(WindowClass cls, WindowNumber number, bool force = true);
|
|
|
void CloseWindowByClass(WindowClass cls);
|
|
|
|
|
|
template<typename T, std::enable_if_t<std::is_base_of<StrongTypedefBase, T>::value, int> = 0>
|
|
|
void CloseWindowById(WindowClass cls, T number, bool force = true)
|
|
|
{
|
|
|
CloseWindowById(cls, static_cast<typename T::BaseType>(number), force);
|
|
|
}
|
|
|
|
|
|
bool EditBoxInGlobalFocus();
|
|
|
bool FocusedWindowIsConsole();
|
|
|
Point GetCaretPosition();
|
|
|
|
|
|
#endif /* WINDOW_FUNC_H */
|