OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4ConsoleGUI Class Referenceabstract

#include <C4ConsoleGUI.h>

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

Classes

class  InternalState
 
class  State
 

Public Types

enum  InfoTextType { CONSOLE_Cursor, CONSOLE_FrameCounter, CONSOLE_TimeFPS }
 
enum  Stage { STAGE_Start, STAGE_Intermediate, STAGE_End }
 
enum  Cursor { CURSOR_Normal, CURSOR_Wait }
 
enum  ClientOperation { CO_None, CO_Deactivate, CO_Activate, CO_Kick }
 
enum  WindowKind {
  W_GuiWindow, W_Console, W_Viewport, W_Fullscreen,
  W_Control
}
 

Public Member Functions

 C4ConsoleGUI ()
 
 ~C4ConsoleGUI () override
 
void Execute ()
 
void AddViewport (C4ViewportWindow *cvp)
 
void RemoveViewport (C4ViewportWindow *cvp)
 
void OnObjectSelectionChanged (class C4EditCursorSelection &selection)
 
bool CreateNewScenario (StdStrBuf *out_filename, bool *out_host_as_network)
 
void OnStartGame ()
 
void EnsureDefinitionListInitialized ()
 
void CloseConsoleWindow ()
 
void ClearPointers (class C4Object *obj)
 
void EditGraphControl (const class C4ControlEditGraph *control)
 
void SetCursor (Cursor cursor)
 
void RecordingEnabled ()
 
void ShowAboutWithCopyright (StdStrBuf &copyright)
 
bool UpdateModeCtrls (int iMode)
 
void AddNetMenu ()
 
void ClearNetMenu ()
 
void AddNetMenuItemForPlayer (int32_t client_id, const char *text, C4ConsoleGUI::ClientOperation co)
 
void ClearPlayerMenu ()
 
void SetInputFunctions (std::list< const char * > &functions)
 
bool CreateConsoleWindow (C4AbstractApp *application)
 
void DeleteConsoleWindow ()
 
void Out (const char *message)
 
bool ClearLog ()
 
void DisplayInfoText (InfoTextType type, StdStrBuf &text)
 
void SetCaptionToFileName (const char *file_name)
 
bool FileSelect (StdStrBuf *sFilename, const char *szFilter, DWORD dwFlags, bool fSave)
 
void AddMenuItemForPlayer (C4Player *player, StdStrBuf &player_text)
 
void AddKickPlayerMenuItem (C4Player *player, StdStrBuf &player_text, bool enabled)
 
void ClearViewportMenu ()
 
bool Message (const char *message, bool query)
 
void EnableControls (bool fEnable)
 
void DoEnableControls (bool fEnable)
 
bool UpdateHaltCtrls (bool fHalt)
 
bool DoUpdateHaltCtrls (bool fHalt)
 
bool PropertyDlgOpen ()
 
void PropertyDlgClose ()
 
void PropertyDlgUpdate (class C4EditCursorSelection &rSelection, bool force_function_update)
 
bool ToolsDlgOpen (class C4ToolsDlg *dlg)
 
void ToolsDlgClose ()
 
void ToolsDlgInitMaterialCtrls (class C4ToolsDlg *dlg)
 
void ToolsDlgSelectTexture (C4ToolsDlg *dlg, const char *texture)
 
void ToolsDlgSelectMaterial (C4ToolsDlg *dlg, const char *material)
 
void ToolsDlgSelectBackTexture (C4ToolsDlg *dlg, const char *texture)
 
void ToolsDlgSelectBackMaterial (C4ToolsDlg *dlg, const char *material)
 
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 Editing
 
bool fGameOpen
 
C4ObjectPropertyDlgObject
 
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 35 of file C4ConsoleGUI.h.

Member Enumeration Documentation

Enumerator
CO_None 
CO_Deactivate 
CO_Activate 
CO_Kick 

Definition at line 70 of file C4ConsoleGUI.h.

Enumerator
CURSOR_Normal 
CURSOR_Wait 

Definition at line 64 of file C4ConsoleGUI.h.

Enumerator
CONSOLE_Cursor 
CONSOLE_FrameCounter 
CONSOLE_TimeFPS 

Definition at line 50 of file C4ConsoleGUI.h.

Enumerator
STAGE_Start 
STAGE_Intermediate 
STAGE_End 

Definition at line 57 of file C4ConsoleGUI.h.

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

C4ConsoleGUI::C4ConsoleGUI ( )

Definition at line 19 of file C4ConsoleGUICommon.h.

20 {
21  state = new C4ConsoleGUI::State(this);
22 }
C4ConsoleGUI::~C4ConsoleGUI ( )
override

Definition at line 24 of file C4ConsoleGUICommon.h.

24 {delete state;}

Member Function Documentation

void C4ConsoleGUI::AddKickPlayerMenuItem ( C4Player player,
StdStrBuf player_text,
bool  enabled 
)

Definition at line 662 of file C4Console.cpp.

Referenced by C4Console::UpdatePlayerMenu().

662 {}

Here is the caller graph for this function:

void C4ConsoleGUI::AddMenuItemForPlayer ( C4Player player,
StdStrBuf player_text 
)

Definition at line 663 of file C4Console.cpp.

Referenced by C4Console::UpdateViewportMenu().

663 {}

Here is the caller graph for this function:

void C4ConsoleGUI::AddNetMenu ( )

Definition at line 665 of file C4Console.cpp.

Referenced by C4Console::UpdateNetMenu().

665 {}

Here is the caller graph for this function:

void C4ConsoleGUI::AddNetMenuItemForPlayer ( int32_t  client_id,
const char *  text,
C4ConsoleGUI::ClientOperation  co 
)

Definition at line 664 of file C4Console.cpp.

Referenced by C4Console::UpdateNetMenu().

664 {}

Here is the caller graph for this function:

void C4ConsoleGUI::AddViewport ( C4ViewportWindow cvp)
inline

Definition at line 110 of file C4ConsoleGUI.h.

110 { }
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:

bool C4ConsoleGUI::ClearLog ( )

Definition at line 667 of file C4Console.cpp.

Referenced by C4MessageInput::ProcessCommand().

667 {return false;}

Here is the caller graph for this function:

void C4ConsoleGUI::ClearNetMenu ( )

Definition at line 668 of file C4Console.cpp.

Referenced by C4Console::ClearNetMenu().

668 {}

Here is the caller graph for this function:

void C4ConsoleGUI::ClearPlayerMenu ( )

Definition at line 669 of file C4Console.cpp.

Referenced by C4Console::Clear(), and C4Console::UpdatePlayerMenu().

669 {}

Here is the caller graph for this function:

void C4ConsoleGUI::ClearPointers ( class C4Object obj)
inline

Definition at line 117 of file C4ConsoleGUI.h.

Referenced by C4Console::ClearPointers().

117 {}

Here is the caller graph for this function:

void C4ConsoleGUI::ClearViewportMenu ( )

Definition at line 670 of file C4Console.cpp.

Referenced by C4Console::ClearViewportMenu().

670 {}

Here is the caller graph for this function:

virtual void C4Window::Close ( )
pure virtualinherited
void C4ConsoleGUI::CloseConsoleWindow ( )
inline

Definition at line 116 of file C4ConsoleGUI.h.

Referenced by C4Console::Close().

116 {}

Here is the caller graph for this function:

bool C4ConsoleGUI::CreateConsoleWindow ( C4AbstractApp application)

Definition at line 671 of file C4Console.cpp.

References C4Window::Init(), LoadResStr(), and C4Window::W_Console.

Referenced by C4Console::Init().

672 {
673  C4Rect r(0, 0, 400, 350);
674  if (!C4Window::Init(C4Window::W_Console, pApp, LoadResStr("IDS_CNS_CONSOLE"), &r))
675  return false;
676  return true;
677 }
Definition: C4Rect.h:27
const char * LoadResStr(const char *id)
Definition: C4Language.h:83
virtual C4Window * Init(WindowKind windowKind, C4AbstractApp *pApp, const char *Title, const C4Rect *size)
Definition: C4AppT.cpp:106

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4ConsoleGUI::CreateNewScenario ( StdStrBuf out_filename,
bool *  out_host_as_network 
)
inline

Definition at line 113 of file C4ConsoleGUI.h.

Referenced by C4Console::FileNew().

113 { return false; }

Here is the caller graph for this function:

void C4ConsoleGUI::DeleteConsoleWindow ( )

Definition at line 678 of file C4Console.cpp.

Referenced by C4Console::Clear().

678 {}

Here is the caller graph for this function:

void C4ConsoleGUI::DisplayInfoText ( C4ConsoleGUI::InfoTextType  type,
StdStrBuf text 
)

Definition at line 679 of file C4Console.cpp.

Referenced by C4EditCursor::UpdateStatusBar(), and C4Console::UpdateStatusBars().

679 {}

Here is the caller graph for this function:

void C4ConsoleGUI::DoEnableControls ( bool  fEnable)

Definition at line 680 of file C4Console.cpp.

Referenced by EnableControls().

680 {}

Here is the caller graph for this function:

bool C4ConsoleGUI::DoUpdateHaltCtrls ( bool  fHalt)

Definition at line 681 of file C4Console.cpp.

Referenced by UpdateHaltCtrls().

681 {return false;}

Here is the caller graph for this function:

void C4ConsoleGUI::EditGraphControl ( const class C4ControlEditGraph control)
inline

Definition at line 118 of file C4ConsoleGUI.h.

118 {}
void C4ConsoleGUI::EnableControls ( bool  fEnable)
inline

Definition at line 143 of file C4ConsoleGUI.h.

References C4Window::Active, Control, DoEnableControls(), and C4GameControl::NoInput().

Referenced by C4Console::CloseGame(), C4Console::InitGame(), and C4Console::UpdateMenus().

144  {
145  if (!Active) return;
146  // disable Editing if no input allowed
147  Editing &= !::Control.NoInput();
148  DoEnableControls(fEnable);
149  }
C4GameControl Control
bool NoInput() const
bool Active
Definition: C4Window.h:273
void DoEnableControls(bool fEnable)
Definition: C4Console.cpp:680

Here is the call graph for this function:

Here is the caller graph for this function:

void C4ConsoleGUI::EnsureDefinitionListInitialized ( )
inline

Definition at line 115 of file C4ConsoleGUI.h.

115 { }
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 C4ConsoleGUI::Execute ( )
inline

Definition at line 109 of file C4ConsoleGUI.h.

Referenced by C4Console::Execute().

109 { }

Here is the caller graph for this function:

bool C4ConsoleGUI::FileSelect ( StdStrBuf sFilename,
const char *  szFilter,
DWORD  dwFlags,
bool  fSave 
)

Definition at line 682 of file C4Console.cpp.

Referenced by C4Console::FileSelect().

682 {return false;}

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 * 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(), CreateConsoleWindow(), C4ViewportWindow::Init(), and C4GUI::DialogWindow::Init().

106 {return this;}

Here is the caller graph for this function:

bool C4ConsoleGUI::Message ( const char *  message,
bool  query 
)

Definition at line 683 of file C4Console.cpp.

Referenced by C4Console::Message().

683 {return false;}

Here is the caller graph for this function:

void C4ConsoleGUI::OnObjectSelectionChanged ( class C4EditCursorSelection selection)
inline

Definition at line 112 of file C4ConsoleGUI.h.

112 { }
void C4ConsoleGUI::OnStartGame ( )
inline

Definition at line 114 of file C4ConsoleGUI.h.

Referenced by C4Application::GameTick().

114 { }

Here is the caller graph for this function:

void C4ConsoleGUI::Out ( const char *  message)

Definition at line 684 of file C4Console.cpp.

Referenced by C4Game::DropDef(), C4Game::DropFile(), Log(), C4Application::ProcessCallback(), C4Console::SaveGame(), and C4Console::SaveScenario().

684 {}

Here is the caller graph for this function:

void C4Window::PerformUpdate ( )
virtualinherited

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

Definition at line 85 of file C4App.cpp.

86 {
87 }
void C4ConsoleGUI::PropertyDlgClose ( )

Definition at line 686 of file C4Console.cpp.

Referenced by C4Console::Clear(), PropertyDlgProc(), and C4EditCursor::SetMode().

686 {}

Here is the caller graph for this function:

bool C4ConsoleGUI::PropertyDlgOpen ( )

Definition at line 685 of file C4Console.cpp.

Referenced by C4EditCursor::OpenPropTools().

685 {return false;}

Here is the caller graph for this function:

void C4ConsoleGUI::PropertyDlgUpdate ( class C4EditCursorSelection rSelection,
bool  force_function_update 
)

Definition at line 687 of file C4Console.cpp.

Referenced by C4EditCursor::Clear(), C4EditCursor::Execute(), C4EditCursor::In(), C4EditCursor::OnSelectionChanged(), and C4EditCursor::OpenPropTools().

687 {}

Here is the caller graph for this function:

void C4ConsoleGUI::RecordingEnabled ( )

Definition at line 688 of file C4Console.cpp.

Referenced by C4Console::FileRecord().

688 {}

Here is the caller graph for this function:

bool C4Window::ReInit ( C4AbstractApp pApp)
virtualinherited

Definition at line 107 of file C4AppT.cpp.

107 {return false;}
void C4ConsoleGUI::RemoveViewport ( C4ViewportWindow cvp)
inline

Definition at line 111 of file C4ConsoleGUI.h.

111 { }
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 C4ViewportWindow::Init(), and C4GUI::DialogWindow::Init().

108 {return false;}

Here is the caller graph for this function:

void C4ConsoleGUI::SetCaptionToFileName ( const char *  file_name)

Definition at line 689 of file C4Console.cpp.

Referenced by C4Console::SetCaptionToFilename().

689 {}

Here is the caller graph for this function:

void C4ConsoleGUI::SetCursor ( C4ConsoleGUI::Cursor  cursor)

Definition at line 690 of file C4Console.cpp.

Referenced by C4Console::SaveGame(), and C4Console::SaveScenario().

690 {}

Here is the caller graph for this function:

void C4ConsoleGUI::SetInputFunctions ( std::list< const char * > &  functions)

Definition at line 691 of file C4Console.cpp.

Referenced by C4Console::UpdateInputCtrl().

691 {}

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:

void C4ConsoleGUI::ShowAboutWithCopyright ( StdStrBuf copyright)

Definition at line 692 of file C4Console.cpp.

Referenced by C4Console::HelpAbout().

692 {}

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; }
void C4ConsoleGUI::ToolsDlgClose ( )

Definition at line 666 of file C4Console.cpp.

Referenced by C4ToolsDlg::Clear(), and C4EditCursor::SetMode().

666 {}

Here is the caller graph for this function:

void C4ConsoleGUI::ToolsDlgInitMaterialCtrls ( class C4ToolsDlg dlg)

Definition at line 693 of file C4Console.cpp.

Referenced by C4ToolsDlg::InitMaterialCtrls().

693 {}

Here is the caller graph for this function:

bool C4ConsoleGUI::ToolsDlgOpen ( class C4ToolsDlg dlg)

Definition at line 694 of file C4Console.cpp.

Referenced by C4ToolsDlg::Open().

694 {return false;}

Here is the caller graph for this function:

void C4ConsoleGUI::ToolsDlgSelectBackMaterial ( C4ToolsDlg dlg,
const char *  material 
)

Definition at line 697 of file C4Console.cpp.

Referenced by C4ToolsDlg::SelectBackMaterial().

697 {}

Here is the caller graph for this function:

void C4ConsoleGUI::ToolsDlgSelectBackTexture ( C4ToolsDlg dlg,
const char *  texture 
)

Definition at line 698 of file C4Console.cpp.

Referenced by C4ToolsDlg::SelectBackTexture(), and C4ToolsDlg::SetBackTexture().

698 {}

Here is the caller graph for this function:

void C4ConsoleGUI::ToolsDlgSelectMaterial ( C4ToolsDlg dlg,
const char *  material 
)

Definition at line 695 of file C4Console.cpp.

Referenced by C4ToolsDlg::SelectMaterial().

695 {}

Here is the caller graph for this function:

void C4ConsoleGUI::ToolsDlgSelectTexture ( C4ToolsDlg dlg,
const char *  texture 
)

Definition at line 696 of file C4Console.cpp.

Referenced by C4ToolsDlg::SelectTexture(), and C4ToolsDlg::SetTexture().

696 {}

Here is the caller graph for this function:

bool C4ConsoleGUI::UpdateHaltCtrls ( bool  fHalt)
inline

Definition at line 152 of file C4ConsoleGUI.h.

References C4Window::Active, and DoUpdateHaltCtrls().

Referenced by C4Network2::CheckStatusReached(), C4Game::InitGameFinal(), C4Network2::OnStatusAck(), C4Network2::OnStatusReached(), C4Game::Pause(), and C4Game::Unpause().

153  {
154  if (!Active)
155  return false;
156  DoUpdateHaltCtrls(fHalt);
157  return true;
158  }
bool DoUpdateHaltCtrls(bool fHalt)
Definition: C4Console.cpp:681
bool Active
Definition: C4Window.h:273

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4ConsoleGUI::UpdateModeCtrls ( int  iMode)

Definition at line 699 of file C4Console.cpp.

Referenced by C4EditCursor::Init(), and C4EditCursor::SetMode().

699 {return false;}

Here is the caller graph for this function:

Member Data Documentation

WindowKind C4Window::eKind
inherited

Definition at line 275 of file C4Window.h.

C4Object* C4ConsoleGUI::PropertyDlgObject

Definition at line 164 of file C4ConsoleGUI.h.

Referenced by C4Console::Default().


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