OpenClonk
C4Window Class Referenceabstract

#include <C4Window.h>

Inheritance diagram for C4Window:
[legend]
Collaboration diagram for C4Window:
[legend]

Public Types

enum  WindowKind {
  W_GuiWindow, W_Console, W_Viewport, W_Fullscreen,
  W_Control
}
 

Public Member Functions

 C4Window ()
 
virtual ~C4Window ()
 
virtual void Clear ()
 
virtual void Close ()=0
 
virtual void CharIn (const char *)
 
virtual bool ReInit (C4AbstractApp *pApp)
 
virtual void EnumerateMultiSamples (std::vector< int > &samples) const
 
bool StorePosition (const char *szWindowName, const char *szSubKey, bool fStoreSize=true)
 
bool RestorePosition (const char *szWindowName, const char *szSubKey, bool fHidden=false)
 
bool GetSize (C4Rect *pRect)
 
void SetSize (unsigned int cx, unsigned int cy)
 
void SetTitle (const char *Title)
 
void FlashWindow ()
 
void GrabMouse (bool grab)
 
virtual void RequestUpdate ()
 
virtual void PerformUpdate ()
 

Public Attributes

bool Active {false}
 
C4SurfacepSurface {nullptr}
 
WindowKind eKind
 

Protected Member Functions

virtual C4WindowInit (WindowKind windowKind, C4AbstractApp *pApp, const char *Title, const C4Rect *size)
 

Friends

class C4Draw
 
class CStdGL
 
class CStdGLCtx
 
class C4AbstractApp
 

Detailed Description

Definition at line 257 of file C4Window.h.

Member Enumeration Documentation

◆ WindowKind

Enumerator
W_GuiWindow 
W_Console 
W_Viewport 
W_Fullscreen 
W_Control 

Definition at line 263 of file C4Window.h.

264  {
265  W_GuiWindow,
266  W_Console,
267  W_Viewport,
268  W_Fullscreen,
269  W_Control // wrapper to a render target control inside a window
270  };

Constructor & Destructor Documentation

◆ C4Window()

C4Window::C4Window ( )
default

Definition at line 38 of file C4WindowSDL.cpp.

Referenced by Clear().

38  :
39  Active(false), pSurface(nullptr), eKind(W_Fullscreen), window(nullptr)
40 #ifdef WITH_QT_EDITOR
41 , glwidget(nullptr)
42 #endif
43 {
44 }
C4Surface * pSurface
Definition: C4Window.h:275
WindowKind eKind
Definition: C4Window.h:276
bool Active
Definition: C4Window.h:274
Here is the caller graph for this function:

◆ ~C4Window()

C4Window::~C4Window ( )
virtualdefault

Definition at line 46 of file C4WindowSDL.cpp.

References Clear().

Referenced by Clear().

47 {
48  Clear();
49 }
virtual void Clear()
Definition: C4AppT.cpp:102
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ CharIn()

virtual void C4Window::CharIn ( const char *  )
inlinevirtual

Reimplemented in C4FullScreen.

Definition at line 282 of file C4Window.h.

References EnumerateMultiSamples(), FlashWindow(), GetSize(), GrabMouse(), Init(), PerformUpdate(), ReInit(), RequestUpdate(), RestorePosition(), SetSize(), SetTitle(), and StorePosition().

282 { }
Here is the call graph for this function:

◆ Clear()

void C4Window::Clear ( )
virtual

Reimplemented in C4Console, and C4FullScreen.

Definition at line 102 of file C4AppT.cpp.

References C4Window(), and ~C4Window().

Referenced by C4FullScreen::Clear(), C4Console::Clear(), ~C4Window(), and C4ToolsDlg::State::~State().

102 {}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Close()

virtual void C4Window::Close ( )
pure virtual

◆ EnumerateMultiSamples()

void C4Window::EnumerateMultiSamples ( std::vector< int > &  samples) const
virtual

Definition at line 105 of file C4AppT.cpp.

References FlashWindow().

Referenced by C4StartupOptionsDlg::C4StartupOptionsDlg(), CharIn(), and C4StartupOptionsDlg::OnClosed().

105 {}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FlashWindow()

void C4Window::FlashWindow ( )

Definition at line 74 of file C4AppMac.mm.

References C4AbstractApp::Active, C4AbstractApp::C4AbstractApp(), C4AbstractApp::Clear(), C4AbstractApp::DoInit(), C4AbstractApp::fDspModeSet, C4AbstractApp::FlushMessages(), C4AbstractApp::fQuitMsgReceived, C4AbstractApp::GetIndexedDisplayMode(), C4AbstractApp::Init(), lionAndBeyond(), C4AbstractApp::MainThread, C4AbstractApp::OnResolutionChanged(), C4AbstractApp::pWindow, C4AbstractApp::Quit(), C4AbstractApp::RestoreVideoMode(), SetSize(), C4AbstractApp::SetVideoMode(), and C4AbstractApp::~C4AbstractApp().

Referenced by CharIn(), EnumerateMultiSamples(), and C4AbstractApp::NotifyUserIfInactive().

75 {
76  [NSApp requestUserAttention:NSCriticalRequest];
77 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSize()

bool C4Window::GetSize ( C4Rect pRect)

Definition at line 108 of file C4AppT.cpp.

Referenced by CharIn(), C4Application::OnResolutionChanged(), C4Game::PreInit(), and StorePosition().

108 {return false;}
Here is the caller graph for this function:

◆ GrabMouse()

void C4Window::GrabMouse ( bool  grab)

Definition at line 107 of file C4AppT.cpp.

Referenced by CharIn(), and C4Application::GameTick().

107 {}
Here is the caller graph for this function:

◆ Init()

C4Window * C4Window::Init ( C4Window::WindowKind  windowKind,
C4AbstractApp pApp,
const char *  Title,
const C4Rect size 
)
protectedvirtual

Definition at line 109 of file C4AppT.cpp.

Referenced by C4ConsoleGUIPreviewWindow::C4ConsoleGUIPreviewWindow(), C4ViewportWindow::C4ViewportWindow(), CharIn(), C4ConsoleGUI::CreateConsoleWindow(), C4GUI::DialogWindow::DialogWindow(), C4GUI::FrameDecoration::Draw(), C4ViewportWindow::Init(), and C4GUI::DialogWindow::Init().

109 {return this;}
Here is the caller graph for this function:

◆ PerformUpdate()

void C4Window::PerformUpdate ( )
virtual

Reimplemented in C4GUI::DialogWindow, C4FullScreen, and C4ViewportWindow.

Definition at line 85 of file C4App.cpp.

Referenced by CharIn(), and StorePosition().

86 {
87 }
Here is the caller graph for this function:

◆ ReInit()

bool C4Window::ReInit ( C4AbstractApp pApp)
virtual

Definition at line 110 of file C4AppT.cpp.

Referenced by CharIn(), and C4StartupOptionsDlg::OnClosed().

110 {return false;}
Here is the caller graph for this function:

◆ RequestUpdate()

void C4Window::RequestUpdate ( )
virtual

Definition at line 112 of file C4AppT.cpp.

Referenced by CharIn(), C4FullScreen::Execute(), and StorePosition().

112 {}
Here is the caller graph for this function:

◆ RestorePosition()

bool C4Window::RestorePosition ( const char *  szWindowName,
const char *  szSubKey,
bool  fHidden = false 
)

Definition at line 111 of file C4AppT.cpp.

Referenced by CharIn(), and StorePosition().

111 {return false;}
Here is the caller graph for this function:

◆ SetSize()

void C4Window::SetSize ( unsigned int  cx,
unsigned int  cy 
)

Definition at line 113 of file C4AppT.cpp.

Referenced by CharIn(), C4Application::DoInit(), FlashWindow(), C4AbstractApp::SetVideoMode(), StorePosition(), and C4GUI::Dialog::UpdateSize().

113 {}
Here is the caller graph for this function:

◆ SetTitle()

void C4Window::SetTitle ( const char *  Title)

Definition at line 114 of file C4AppT.cpp.

Referenced by CharIn(), C4Console::CloseGame(), PropertyDlgProc(), C4Console::SetCaptionToFilename(), C4GUI::Dialog::SetTitle(), and StorePosition().

114 {}
Here is the caller graph for this function:

◆ StorePosition()

bool C4Window::StorePosition ( const char *  szWindowName,
const char *  szSubKey,
bool  fStoreSize = true 
)

Definition at line 139 of file C4WindowSDL.cpp.

References GetSize(), C4Rect::Hgt, PerformUpdate(), RequestUpdate(), RestorePosition(), SetSize(), SetTitle(), C4Rect::Wdt, C4Rect::x, X, and C4Rect::y.

Referenced by CharIn().

139 { return true; }
Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ C4AbstractApp

friend class C4AbstractApp
friend

Definition at line 325 of file C4Window.h.

◆ C4Draw

friend class C4Draw
friend

Definition at line 322 of file C4Window.h.

◆ CStdGL

friend class CStdGL
friend

Definition at line 323 of file C4Window.h.

◆ CStdGLCtx

friend class CStdGLCtx
friend

Definition at line 324 of file C4Window.h.

Member Data Documentation

◆ Active

◆ eKind

WindowKind C4Window::eKind

Definition at line 276 of file C4Window.h.

◆ pSurface


The documentation for this class was generated from the following files: