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 ()
 
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
 
C4SurfacepSurface
 
WindowKind eKind
 

Protected Member Functions

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

Detailed Description

Definition at line 36 of file C4ConsoleGUI.h.

Member Enumeration Documentation

Enumerator
CO_None 
CO_Deactivate 
CO_Activate 
CO_Kick 

Definition at line 71 of file C4ConsoleGUI.h.

Enumerator
CURSOR_Normal 
CURSOR_Wait 

Definition at line 65 of file C4ConsoleGUI.h.

Enumerator
CONSOLE_Cursor 
CONSOLE_FrameCounter 
CONSOLE_TimeFPS 

Definition at line 51 of file C4ConsoleGUI.h.

Enumerator
STAGE_Start 
STAGE_Intermediate 
STAGE_End 

Definition at line 58 of file C4ConsoleGUI.h.

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

C4ConsoleGUI::C4ConsoleGUI ( )

Definition at line 19 of file C4ConsoleGUICommon.h.

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

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 667 of file C4Console.cpp.

Referenced by C4Console::UpdatePlayerMenu().

667 {}

Here is the caller graph for this function:

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

Definition at line 668 of file C4Console.cpp.

Referenced by C4Console::UpdateViewportMenu().

668 {}

Here is the caller graph for this function:

void C4ConsoleGUI::AddNetMenu ( )

Definition at line 670 of file C4Console.cpp.

Referenced by C4Console::UpdateNetMenu().

670 {}

Here is the caller graph for this function:

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

Definition at line 669 of file C4Console.cpp.

Referenced by C4Console::UpdateNetMenu().

669 {}

Here is the caller graph for this function:

void C4ConsoleGUI::AddViewport ( C4ViewportWindow cvp)
inline

Definition at line 111 of file C4ConsoleGUI.h.

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

bool C4ConsoleGUI::ClearLog ( )

Definition at line 672 of file C4Console.cpp.

Referenced by C4MessageInput::ProcessCommand().

672 {return 0;}

Here is the caller graph for this function:

void C4ConsoleGUI::ClearNetMenu ( )

Definition at line 673 of file C4Console.cpp.

Referenced by C4Console::ClearNetMenu().

673 {}

Here is the caller graph for this function:

void C4ConsoleGUI::ClearPlayerMenu ( )

Definition at line 674 of file C4Console.cpp.

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

674 {}

Here is the caller graph for this function:

void C4ConsoleGUI::ClearPointers ( class C4Object obj)
inline

Definition at line 118 of file C4ConsoleGUI.h.

Referenced by C4Console::ClearPointers().

118 {}

Here is the caller graph for this function:

void C4ConsoleGUI::ClearViewportMenu ( )

Definition at line 675 of file C4Console.cpp.

Referenced by C4Console::ClearViewportMenu().

675 {}

Here is the caller graph for this function:

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

Definition at line 117 of file C4ConsoleGUI.h.

Referenced by C4Console::Close().

117 {}

Here is the caller graph for this function:

bool C4ConsoleGUI::CreateConsoleWindow ( C4AbstractApp application)

Definition at line 676 of file C4Console.cpp.

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

Referenced by C4Console::Init().

677 {
678  C4Rect r(0, 0, 400, 350);
679  if (!C4Window::Init(C4Window::W_Console, pApp, LoadResStr("IDS_CNS_CONSOLE"), &r))
680  return false;
681  return true;
682 }
Definition: C4Rect.h:29
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:107

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 114 of file C4ConsoleGUI.h.

Referenced by C4Console::FileNew().

114 { return false; }

Here is the caller graph for this function:

void C4ConsoleGUI::DeleteConsoleWindow ( )

Definition at line 683 of file C4Console.cpp.

Referenced by C4Console::Clear().

683 {}

Here is the caller graph for this function:

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

Definition at line 684 of file C4Console.cpp.

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

684 {}

Here is the caller graph for this function:

void C4ConsoleGUI::DoEnableControls ( bool  fEnable)

Definition at line 685 of file C4Console.cpp.

Referenced by EnableControls().

685 {}

Here is the caller graph for this function:

bool C4ConsoleGUI::DoUpdateHaltCtrls ( bool  fHalt)

Definition at line 686 of file C4Console.cpp.

Referenced by UpdateHaltCtrls().

686 {return 0;}

Here is the caller graph for this function:

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

Definition at line 119 of file C4ConsoleGUI.h.

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

Definition at line 144 of file C4ConsoleGUI.h.

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

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

void C4ConsoleGUI::EnsureDefinitionListInitialized ( )
inline

Definition at line 116 of file C4ConsoleGUI.h.

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

Definition at line 110 of file C4ConsoleGUI.h.

Referenced by C4Console::Execute().

110 { }

Here is the caller graph for this function:

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

Definition at line 687 of file C4Console.cpp.

Referenced by C4Console::FileSelect().

687 {return 0;}

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

107 {return this;}

Here is the caller graph for this function:

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

Definition at line 688 of file C4Console.cpp.

Referenced by C4Console::Message().

688 {return 0;}

Here is the caller graph for this function:

void C4ConsoleGUI::OnObjectSelectionChanged ( class C4EditCursorSelection selection)
inline

Definition at line 113 of file C4ConsoleGUI.h.

113 { }
void C4ConsoleGUI::OnStartGame ( )
inline

Definition at line 115 of file C4ConsoleGUI.h.

Referenced by C4Application::GameTick().

115 { }

Here is the caller graph for this function:

void C4ConsoleGUI::Out ( const char *  message)

Definition at line 689 of file C4Console.cpp.

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

689 {}

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 691 of file C4Console.cpp.

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

691 {}

Here is the caller graph for this function:

bool C4ConsoleGUI::PropertyDlgOpen ( )

Definition at line 690 of file C4Console.cpp.

Referenced by C4EditCursor::OpenPropTools().

690 {return 0;}

Here is the caller graph for this function:

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

Definition at line 692 of file C4Console.cpp.

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

692 {}

Here is the caller graph for this function:

void C4ConsoleGUI::RecordingEnabled ( )

Definition at line 693 of file C4Console.cpp.

Referenced by C4Console::FileRecord().

693 {}

Here is the caller graph for this function:

bool C4Window::ReInit ( C4AbstractApp pApp)
virtualinherited

Definition at line 108 of file C4AppT.cpp.

108 {return 0;}
void C4ConsoleGUI::RemoveViewport ( C4ViewportWindow cvp)
inline

Definition at line 112 of file C4ConsoleGUI.h.

112 { }
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 C4GUI::DialogWindow::Init().

109 {return 0;}

Here is the caller graph for this function:

void C4ConsoleGUI::SetCaptionToFileName ( const char *  file_name)

Definition at line 694 of file C4Console.cpp.

Referenced by C4Console::SetCaptionToFilename().

694 {}

Here is the caller graph for this function:

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

Definition at line 695 of file C4Console.cpp.

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

695 {}

Here is the caller graph for this function:

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

Definition at line 696 of file C4Console.cpp.

Referenced by C4Console::UpdateInputCtrl().

696 {}

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(), C4GUI::DialogWindow::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:

void C4ConsoleGUI::ShowAboutWithCopyright ( StdStrBuf copyright)

Definition at line 697 of file C4Console.cpp.

Referenced by C4Console::HelpAbout().

697 {}

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

Definition at line 671 of file C4Console.cpp.

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

671 {}

Here is the caller graph for this function:

void C4ConsoleGUI::ToolsDlgInitMaterialCtrls ( class C4ToolsDlg dlg)

Definition at line 698 of file C4Console.cpp.

Referenced by C4ToolsDlg::InitMaterialCtrls().

698 {}

Here is the caller graph for this function:

bool C4ConsoleGUI::ToolsDlgOpen ( class C4ToolsDlg dlg)

Definition at line 699 of file C4Console.cpp.

Referenced by C4ToolsDlg::Open().

699 {return 0;}

Here is the caller graph for this function:

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

Definition at line 702 of file C4Console.cpp.

Referenced by C4ToolsDlg::SelectBackMaterial().

702 {}

Here is the caller graph for this function:

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

Definition at line 703 of file C4Console.cpp.

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

703 {}

Here is the caller graph for this function:

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

Definition at line 700 of file C4Console.cpp.

Referenced by C4ToolsDlg::SelectMaterial().

700 {}

Here is the caller graph for this function:

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

Definition at line 701 of file C4Console.cpp.

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

701 {}

Here is the caller graph for this function:

bool C4ConsoleGUI::UpdateHaltCtrls ( bool  fHalt)
inline

Definition at line 153 of file C4ConsoleGUI.h.

References C4Window::Active, and DoUpdateHaltCtrls().

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4ConsoleGUI::UpdateModeCtrls ( int  iMode)

Definition at line 704 of file C4Console.cpp.

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

704 {return 0;}

Here is the caller graph for this function:

Member Data Documentation

WindowKind C4Window::eKind
inherited

Definition at line 280 of file C4Window.h.

C4Object* C4ConsoleGUI::PropertyDlgObject

Definition at line 165 of file C4ConsoleGUI.h.

Referenced by C4Console::Default().


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