OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4ViewportWindow Class Reference

#include <C4ViewportWindow.h>

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

Public Types

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

Public Member Functions

 C4ViewportWindow (C4Viewport *cvp)
 
void EditCursorMove (int X, int Y, uint32_t)
 
C4WindowInit (int32_t iPlayer)
 
void Close () override
 
void PerformUpdate () override
 
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

C4Viewportcvp
 
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 32 of file C4ViewportWindow.h.

Member Enumeration Documentation

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

Definition at line 262 of file C4Window.h.

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

Constructor & Destructor Documentation

C4ViewportWindow::C4ViewportWindow ( C4Viewport cvp)
inline

Definition at line 36 of file C4ViewportWindow.h.

36 : cvp(cvp) { }
C4Viewport * cvp

Member Function Documentation

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

Reimplemented in C4FullScreen.

Definition at line 281 of file C4Window.h.

281 { }
void C4Window::Clear ( )
virtualinherited

Reimplemented in C4Console, and C4FullScreen.

Definition at line 99 of file C4AppT.cpp.

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

99 {}

Here is the caller graph for this function:

void C4ViewportWindow::Close ( )
overridevirtual

Implements C4Window.

Definition at line 150 of file C4ViewportWindow.cpp.

References C4ViewportList::CloseViewport(), cvp, and Viewports.

151 {
153 }
C4Viewport * cvp
C4ViewportList Viewports
Definition: C4Viewport.cpp:841
bool CloseViewport(int32_t iPlayer, bool fSilent)
Definition: C4Viewport.cpp:961

Here is the call graph for this function:

void C4ViewportWindow::EditCursorMove ( int  X,
int  Y,
uint32_t  state 
)

Definition at line 154 of file C4ViewportWindow.cpp.

References Console, cvp, C4Console::EditCursor, C4Viewport::GetZoom(), C4EditCursor::Move(), C4Viewport::WindowToGameX(), and C4Viewport::WindowToGameY().

155 {
157 }
C4EditCursor EditCursor
Definition: C4Console.h:90
C4Console Console
Definition: C4Globals.cpp:45
C4Viewport * cvp
float WindowToGameY(int32_t win_y)
Definition: C4Viewport.h:83
bool Move(float iX, float iY, float zoom, DWORD dwKeyState)
float GetZoom()
Definition: C4Viewport.h:45
#define X(sdl, oc)
float WindowToGameX(int32_t win_x)
Definition: C4Viewport.h:82

Here is the call graph for this function:

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

Definition at line 102 of file C4AppT.cpp.

Referenced by C4StartupOptionsDlg::C4StartupOptionsDlg().

102 {}

Here is the caller graph for this function:

void C4Window::FlashWindow ( )
inherited

Definition at line 74 of file C4AppMac.mm.

Referenced by C4AbstractApp::NotifyUserIfInactive().

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

Here is the caller graph for this function:

bool C4Window::GetSize ( C4Rect pRect)
inherited

Definition at line 105 of file C4AppT.cpp.

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

105 {return false;}

Here is the caller graph for this function:

void C4Window::GrabMouse ( bool  grab)
inherited

Definition at line 104 of file C4AppT.cpp.

Referenced by C4Application::GameTick().

104 {}

Here is the caller graph for this function:

C4Window * C4ViewportWindow::Init ( int32_t  iPlayer)

Definition at line 133 of file C4ViewportWindow.cpp.

References Application, Config, FormatString(), C4PlayerList::Get(), C4Player::GetName(), C4Config::GetSubkeyPath(), C4Window::Init(), LoadResStr(), NO_OWNER, Players, C4Window::pSurface, C4Window::RestorePosition(), and C4Window::W_Viewport.

134 {
135  C4Window* result;
136  const char * Title = Player == NO_OWNER ? LoadResStr("IDS_CNS_VIEWPORT") : ::Players.Get(Player)->GetName();
137  C4Rect r(0,0,800,500);
138  result = C4Window::Init(C4Window::W_Viewport, &Application, Title, &r);
139 
140  if (!result) return result;
141 
142  pSurface = new C4Surface(&Application, this);
143 #ifndef WITH_QT_EDITOR
144  // Position and size
145  RestorePosition(FormatString("Viewport%i", Player+1).getData(), Config.GetSubkeyPath("Console"));
146 #endif
147  return result;
148 }
C4Config Config
Definition: C4Config.cpp:833
const char * GetSubkeyPath(const char *strSubkey)
Definition: C4Config.cpp:713
C4Surface * pSurface
Definition: C4Window.h:274
Definition: C4Rect.h:27
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
C4PlayerList Players
bool RestorePosition(const char *szWindowName, const char *szSubKey, bool fHidden=false)
Definition: C4AppT.cpp:108
const int NO_OWNER
Definition: C4Constants.h:138
virtual C4Window * Init(WindowKind windowKind, C4AbstractApp *pApp, const char *Title, const C4Rect *size)
Definition: C4AppT.cpp:106
C4Application Application
Definition: C4Globals.cpp:44
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:270

Here is the call graph for this function:

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

Definition at line 106 of file C4AppT.cpp.

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

106 {return this;}

Here is the caller graph for this function:

void C4ViewportWindow::PerformUpdate ( )
overridevirtual

Reimplemented from C4Window.

Definition at line 119 of file C4ViewportWindow.cpp.

References cvp, C4Viewport::Execute(), and C4Viewport::UpdateOutputSize().

120 {
121 #ifdef WITH_QT_EDITOR
122  if (viewport_widget)
123  viewport_widget->update();
124 #else
125  if (cvp)
126  {
128  cvp->Execute();
129  }
130 #endif
131 }
C4Viewport * cvp
bool UpdateOutputSize(int32_t new_width=0, int32_t new_height=0)
Definition: C4Viewport.cpp:52
void Execute()
Definition: C4Viewport.cpp:380

Here is the call graph for this function:

bool C4Window::ReInit ( C4AbstractApp pApp)
virtualinherited

Definition at line 107 of file C4AppT.cpp.

107 {return false;}
void C4Window::RequestUpdate ( )
virtualinherited

Definition at line 109 of file C4AppT.cpp.

Referenced by C4FullScreen::Execute().

109 {}

Here is the caller graph for this function:

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

Definition at line 108 of file C4AppT.cpp.

Referenced by Init(), and C4GUI::DialogWindow::Init().

108 {return false;}

Here is the caller graph for this function:

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

Definition at line 110 of file C4AppT.cpp.

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

110 {}

Here is the caller graph for this function:

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

Definition at line 111 of file C4AppT.cpp.

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

111 {}

Here is the caller graph for this function:

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

Definition at line 139 of file C4WindowSDL.cpp.

139 { return true; }

Member Data Documentation

C4Viewport* C4ViewportWindow::cvp

Definition at line 35 of file C4ViewportWindow.h.

Referenced by Close(), EditCursorMove(), and PerformUpdate().

WindowKind C4Window::eKind
inherited

Definition at line 275 of file C4Window.h.


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