OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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)
 
virtual void Close ()
 
virtual void PerformUpdate ()
 
virtual void Clear ()
 
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 ()
 

Public Attributes

DialogpDialog
 
bool Active
 
C4SurfacepSurface
 
WindowKind eKind
 

Protected Member Functions

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

Detailed Description

Definition at line 2029 of file C4Gui.h.

Member Enumeration Documentation

enum C4Window::WindowKind
inherited
Enumerator
W_GuiWindow 
W_Console 
W_Viewport 
W_Fullscreen 
W_Control 

Definition at line 267 of file C4Window.h.

268  {
269  W_GuiWindow,
270  W_Console,
271  W_Viewport,
272  W_Fullscreen,
273  W_Control // wrapper to a render target control inside a window
274  };

Constructor & Destructor Documentation

C4GUI::DialogWindow::DialogWindow ( )
inline

Definition at line 2033 of file C4Gui.h.

2033 : C4Window(), pDialog(nullptr) {}
Dialog * pDialog
Definition: C4Gui.h:2032
C4Window()
Definition: C4AppT.cpp:101

Member Function Documentation

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

Reimplemented in C4FullScreen.

Definition at line 286 of file C4Window.h.

286 { }
void C4Window::Clear ( )
virtualinherited

Reimplemented in C4Console, and C4FullScreen.

Definition at line 100 of file C4AppT.cpp.

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

100 {}

Here is the caller graph for this function:

void C4GUI::DialogWindow::Close ( )
virtual

Implements C4Window.

Definition at line 235 of file C4GuiDialogs.cpp.

236  {
237  // FIXME: Close the dialog of this window
238  }
void C4Window::EnumerateMultiSamples ( std::vector< int > &  samples) const
virtualinherited

Definition at line 103 of file C4AppT.cpp.

Referenced by C4StartupOptionsDlg::C4StartupOptionsDlg().

103 {}

Here is the caller graph for this function:

void C4Window::FlashWindow ( )
inherited

Definition at line 75 of file C4AppMac.mm.

Referenced by C4AbstractApp::NotifyUserIfInactive().

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

Here is the caller graph for this function:

bool C4Window::GetSize ( C4Rect pRect)
inherited

Definition at line 106 of file C4AppT.cpp.

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

106 {return 0;}

Here is the caller graph for this function:

void C4Window::GrabMouse ( bool  grab)
inherited

Definition at line 105 of file C4AppT.cpp.

Referenced by C4Application::GameTick().

105 {}

Here is the caller graph for this function:

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

Definition at line 107 of file C4AppT.cpp.

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

107 {return this;}

Here is the caller graph for this function:

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

Definition at line 200 of file C4GuiDialogs.cpp.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

void C4GUI::DialogWindow::PerformUpdate ( )
virtual

Reimplemented from C4Window.

Definition at line 215 of file C4GuiDialogs.cpp.

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

216  {
217  if (!pDialog)
218  return; // safety
219  C4Rect r;
220  GetSize(&r);
221  if (pSurface)
222  {
223  pSurface->Wdt = r.Wdt;
224  pSurface->Hgt = r.Hgt;
225 #ifndef USE_CONSOLE
227  glClear(GL_COLOR_BUFFER_BIT);
228 #endif
229  }
230  C4TargetFacet cgo;
231  cgo.Set(nullptr, 0, 0, r.Wdt, r.Hgt, 0, 0);
232  pDialog->Draw(cgo);
233  }
virtual void Draw(C4TargetFacet &cgo)
bool GetSize(C4Rect *pRect)
Definition: C4AppT.cpp:106
int Wdt
Definition: C4Surface.h:67
C4Surface * pSurface
Definition: C4Window.h:279
Definition: C4Rect.h:29
int Hgt
Definition: C4Surface.h:67
int32_t Wdt
Definition: C4Rect.h:32
Dialog * pDialog
Definition: C4Gui.h:2032
void Set(const C4Facet &cpy)
Definition: C4Facet.h:184
virtual bool PrepareRendering(C4Surface *sfcToSurface) override
Definition: C4DrawGL.cpp:178
CStdGL * pGL
Definition: C4DrawGL.cpp:914
int32_t Hgt
Definition: C4Rect.h:32

Here is the call graph for this function:

bool C4Window::ReInit ( C4AbstractApp pApp)
virtualinherited

Definition at line 108 of file C4AppT.cpp.

108 {return 0;}
void C4Window::RequestUpdate ( )
virtualinherited

Definition at line 110 of file C4AppT.cpp.

Referenced by C4FullScreen::Execute().

110 {}

Here is the caller graph for this function:

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

Definition at line 109 of file C4AppT.cpp.

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

109 {return 0;}

Here is the caller graph for this function:

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

Definition at line 111 of file C4AppT.cpp.

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

111 {}

Here is the caller graph for this function:

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

Definition at line 112 of file C4AppT.cpp.

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

112 {}

Here is the caller graph for this function:

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

Definition at line 143 of file C4WindowSDL.cpp.

143 { return true; }

Member Data Documentation

WindowKind C4Window::eKind
inherited

Definition at line 280 of file C4Window.h.

Dialog* C4GUI::DialogWindow::pDialog

Definition at line 2032 of file C4Gui.h.

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


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