OpenClonk
C4GUI::DialogWindow Class Reference

#include <C4Gui.h>

Inheritance diagram for C4GUI::DialogWindow:
[legend]
Collaboration diagram for C4GUI::DialogWindow:
[legend]

Public Types

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

Public Member Functions

 DialogWindow ()
 
C4WindowInit (C4AbstractApp *pApp, const char *Title, const C4Rect &rcBounds, const char *szID)
 
void Close () override
 
void PerformUpdate () override
 
virtual C4WindowInit (WindowKind windowKind, C4AbstractApp *pApp, const char *Title, const C4Rect *size)
 
virtual void Clear ()
 
virtual void CharIn (const char *)
 
virtual bool ReInit (C4AbstractApp *pApp)
 
virtual void EnumerateMultiSamples (std::vector< int > &samples, int min_expected=0) 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 ()
 

Public Attributes

DialogpDialog {nullptr}
 
bool Active {false}
 
C4SurfacepSurface {nullptr}
 
WindowKind eKind
 

Protected Member Functions

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

Detailed Description

Definition at line 2030 of file C4Gui.h.

Member Enumeration Documentation

◆ WindowKind

enum C4Window::WindowKind
inherited
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  };
@ W_Fullscreen
Definition: C4Window.h:268
@ W_GuiWindow
Definition: C4Window.h:265
@ W_Control
Definition: C4Window.h:269
@ W_Viewport
Definition: C4Window.h:267
@ W_Console
Definition: C4Window.h:266

Constructor & Destructor Documentation

◆ DialogWindow()

C4GUI::DialogWindow::DialogWindow ( )
inline

Definition at line 2034 of file C4Gui.h.

2034 : C4Window() {}

Member Function Documentation

◆ CharIn()

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

Reimplemented in C4FullScreen.

Definition at line 282 of file C4Window.h.

282 { }

◆ Clear()

void C4Window::Clear ( )
virtualinherited

Reimplemented in C4FullScreen, and C4Console.

Definition at line 102 of file C4AppT.cpp.

102 {}

Referenced by C4Console::Clear(), C4FullScreen::Clear(), C4GUI::Dialog::DestroyConsoleWindow(), and C4Window::~C4Window().

Here is the caller graph for this function:

◆ Close()

void C4GUI::DialogWindow::Close ( )
overridevirtual

Implements C4Window.

Definition at line 234 of file C4GuiDialogs.cpp.

235  {
236  // FIXME: Close the dialog of this window
237  }

◆ EnumerateMultiSamples()

void C4Window::EnumerateMultiSamples ( std::vector< int > &  samples,
int  min_expected = 0 
) const
virtualinherited

Definition at line 105 of file C4AppT.cpp.

105 {}

Referenced by C4StartupOptionsDlg::C4StartupOptionsDlg().

Here is the caller graph for this function:

◆ FlashWindow()

void C4Window::FlashWindow ( )
inherited

Definition at line 75 of file C4AppMac.mm.

76 {
77  [NSApp requestUserAttention:NSCriticalRequest];
78 }

Referenced by C4AbstractApp::NotifyUserIfInactive().

Here is the caller graph for this function:

◆ GetSize()

bool C4Window::GetSize ( C4Rect pRect)
inherited

Definition at line 108 of file C4AppT.cpp.

108 {return false;}

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

Here is the caller graph for this function:

◆ GrabMouse()

void C4Window::GrabMouse ( bool  grab)
inherited

Definition at line 107 of file C4AppT.cpp.

107 {}

Referenced by C4Application::GameTick().

Here is the caller graph for this function:

◆ Init() [1/3]

C4Window * C4GUI::DialogWindow::Init ( C4AbstractApp pApp,
const char *  Title,
const C4Rect rcBounds,
const char *  szID 
)

Definition at line 199 of file C4GuiDialogs.cpp.

200  {
201  C4Window * result = C4Window::Init(C4Window::W_GuiWindow, pApp, Title, &rcBounds);
202  if (result)
203  {
204  // update pos
205  if (szID && *szID)
206  RestorePosition(FormatString("ConsoleGUI_%s", szID).getData(), Config.GetSubkeyPath("Console"), false);
207  else
208  SetSize(rcBounds.Wdt, rcBounds.Hgt);
209  }
210  return result;
211  }
C4Config Config
Definition: C4Config.cpp:930
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:270
const char * GetSubkeyPath(const char *subkey)
Definition: C4Config.cpp:806
int32_t Hgt
Definition: C4Rect.h:30
int32_t Wdt
Definition: C4Rect.h:30
virtual C4Window * Init(WindowKind windowKind, C4AbstractApp *pApp, const char *Title, const C4Rect *size)
Definition: C4AppT.cpp:109
bool RestorePosition(const char *szWindowName, const char *szSubKey, bool fHidden=false)
Definition: C4AppT.cpp:111
void SetSize(unsigned int cx, unsigned int cy)
Definition: C4AppT.cpp:113

References Config, FormatString(), C4Config::GetSubkeyPath(), C4Rect::Hgt, C4Window::Init(), C4Window::RestorePosition(), C4Window::SetSize(), C4Window::W_GuiWindow, and C4Rect::Wdt.

Referenced by C4GUI::Dialog::CreateConsoleWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Init() [2/3]

C4Window * C4Window::Init

Definition at line 322 of file C4AppT.cpp.

109 {return this;}

◆ Init() [3/3]

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

Definition at line 109 of file C4AppT.cpp.

109 {return this;}

Referenced by C4ConsoleGUIPreviewWindow::C4ConsoleGUIPreviewWindow(), C4ConsoleGUI::CreateConsoleWindow(), Init(), and C4ViewportWindow::Init().

Here is the caller graph for this function:

◆ PerformUpdate()

void C4GUI::DialogWindow::PerformUpdate ( )
overridevirtual

Reimplemented from C4Window.

Definition at line 214 of file C4GuiDialogs.cpp.

215  {
216  if (!pDialog)
217  return; // safety
218  C4Rect r;
219  GetSize(&r);
220  if (pSurface)
221  {
222  pSurface->Wdt = r.Wdt;
223  pSurface->Hgt = r.Hgt;
224 #ifndef USE_CONSOLE
226  glClear(GL_COLOR_BUFFER_BIT);
227 #endif
228  }
229  C4TargetFacet cgo;
230  cgo.Set(nullptr, 0, 0, r.Wdt, r.Hgt, 0, 0);
231  pDialog->Draw(cgo);
232  }
CStdGL * pGL
Definition: C4DrawGL.cpp:907
void Draw(C4TargetFacet &cgo) override
Dialog * pDialog
Definition: C4Gui.h:2033
Definition: C4Rect.h:28
int Wdt
Definition: C4Surface.h:65
int Hgt
Definition: C4Surface.h:65
void Set(const C4Facet &cpy)
Definition: C4Facet.h:182
bool GetSize(C4Rect *pRect)
Definition: C4AppT.cpp:108
C4Surface * pSurface
Definition: C4Window.h:275
bool PrepareRendering(C4Surface *sfcToSurface) override
Definition: C4DrawGL.cpp:161

References C4GUI::Dialog::Draw(), C4Window::GetSize(), C4Surface::Hgt, C4Rect::Hgt, pDialog, pGL, CStdGL::PrepareRendering(), C4Window::pSurface, C4TargetFacet::Set(), C4Surface::Wdt, and C4Rect::Wdt.

Here is the call graph for this function:

◆ ReInit()

bool C4Window::ReInit ( C4AbstractApp pApp)
virtualinherited

Definition at line 110 of file C4AppT.cpp.

110 {return false;}

◆ RequestUpdate()

void C4Window::RequestUpdate ( )
virtualinherited

Definition at line 112 of file C4AppT.cpp.

112 {}

Referenced by C4FullScreen::Execute().

Here is the caller graph for this function:

◆ RestorePosition()

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

Definition at line 111 of file C4AppT.cpp.

111 {return false;}

Referenced by Init(), and C4ViewportWindow::Init().

Here is the caller graph for this function:

◆ SetSize()

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

Definition at line 113 of file C4AppT.cpp.

113 {}

Referenced by C4Application::DoInit(), Init(), C4AbstractApp::SetVideoMode(), and C4GUI::Dialog::UpdateSize().

Here is the caller graph for this function:

◆ SetTitle()

void C4Window::SetTitle ( const char *  Title)
inherited

Definition at line 114 of file C4AppT.cpp.

114 {}

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

Here is the caller graph for this function:

◆ StorePosition()

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

Definition at line 153 of file C4WindowSDL.cpp.

153 { return true; }

Member Data Documentation

◆ Active

◆ eKind

WindowKind C4Window::eKind
inherited

Definition at line 276 of file C4Window.h.

◆ pDialog

Dialog* C4GUI::DialogWindow::pDialog {nullptr}

Definition at line 2033 of file C4Gui.h.

Referenced by C4GUI::Dialog::CreateConsoleWindow(), and PerformUpdate().

◆ pSurface


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