OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
MWGui::Console Class Reference

#include <console.hpp>

Inheritance diagram for MWGui::Console:
Collaboration diagram for MWGui::Console:

Public Types

typedef std::list< std::string > StringList
 
- Public Types inherited from MWGui::WindowBase
typedef
MyGUI::delegates::CMultiDelegate1
< WindowBase * > 
EventHandle_WindowBase
 

Public Member Functions

void setSelectedObject (const MWWorld::Ptr &object)
 Set the implicit object for script execution. More...
 
 Console (int w, int h, bool consoleOnlyScripts)
 
virtual void open ()
 Notify that window has been made visible. More...
 
virtual void close ()
 Notify that window has been hidden. More...
 
virtual void exit ()
 Gracefully exits the window. More...
 
void setFont (const std::string &fntName)
 
void onResChange (int width, int height)
 
void print (const std::string &msg, const std::string &color="#FFFFFF")
 
void printOK (const std::string &msg)
 Output from successful console command. More...
 
void printError (const std::string &msg)
 Error message. More...
 
void execute (const std::string &command)
 
void executeFile (const std::string &path)
 
virtual void resetReference ()
 
- Public Member Functions inherited from MWGui::WindowBase
 WindowBase (const std::string &parLayout)
 
virtual void setVisible (bool visible)
 Sets the visibility of the window. More...
 
bool isVisible ()
 Returns the visibility state of the window. More...
 
void center ()
 
- Public Member Functions inherited from MWGui::Layout
 Layout (const std::string &_layout, MyGUI::Widget *_parent=nullptr)
 
virtual ~Layout ()
 
MyGUI::Widget * getWidget (const std::string &_name)
 
template<typename T >
void getWidget (T *&_widget, const std::string &_name)
 
void setCoord (int x, int y, int w, int h)
 
void setText (const std::string &name, const std::string &caption)
 
void setTitle (const std::string &title)
 
- Public Member Functions inherited from MWGui::ReferenceInterface
 ReferenceInterface ()
 
virtual ~ReferenceInterface ()
 
void checkReferenceAvailable ()
 closes the window, if the MW-reference has become unavailable More...
 

Public Attributes

MyGUI::EditBox * mCommandLine
 
MyGUI::EditBox * mHistory
 
StringList mCommandHistory
 
StringList::iterator mCurrent
 
std::string mEditString
 
- Public Attributes inherited from MWGui::Layout
MyGUI::Widget * mMainWidget
 

Protected Member Functions

virtual void onReferenceUnavailable ()
 called when reference has become unavailable More...
 

Private Member Functions

void keyPress (MyGUI::Widget *_sender, MyGUI::KeyCode key, MyGUI::Char _char)
 
void acceptCommand (MyGUI::EditBox *_sender)
 
std::string complete (std::string input, std::vector< std::string > &matches)
 
bool compile (const std::string &cmd, Compiler::Output &output)
 
virtual void report (const std::string &message, const Compiler::TokenLoc &loc, Type type)
 Report error to the user. More...
 
virtual void report (const std::string &message, Type type)
 Report a file related error. More...
 
void listNames ()
 
- Private Member Functions inherited from Compiler::ErrorHandler
 ErrorHandler ()
 constructor More...
 
virtual ~ErrorHandler ()
 destructor More...
 
bool isGood () const
 Was compiling successful? More...
 
int countErrors () const
 Return number of errors. More...
 
int countWarnings () const
 Return number of warnings. More...
 
void warning (const std::string &message, const TokenLoc &loc)
 Generate a warning message. More...
 
void error (const std::string &message, const TokenLoc &loc)
 Generate an error message. More...
 
void endOfFile ()
 Generate an error message for an unexpected EOF. More...
 
virtual void reset ()
 Remove all previous error/warning events. More...
 
void setWarningsMode (int mode)
 // 0 ignore, 1 rate as warning, 2 rate as error More...
 
void downgradeErrors (bool downgrade)
 Treat errors as warnings. More...
 

Private Attributes

Compiler::Extensions mExtensions
 
MWScript::CompilerContext mCompilerContext
 
std::vector< std::string > mNames
 
bool mConsoleOnlyScripts
 

Additional Inherited Members

- Protected Attributes inherited from MWGui::Layout
std::string mPrefix
 
std::string mLayoutName
 
MyGUI::VectorWidgetPtr mListWindowRoot
 
- Protected Attributes inherited from MWGui::ReferenceInterface
MWWorld::Ptr mPtr
 
- Private Types inherited from Compiler::ErrorHandler
enum  Type { WarningMessage, ErrorMessage }
 

Member Typedef Documentation

typedef std::list<std::string> MWGui::Console::StringList

Constructor & Destructor Documentation

MWGui::Console::Console ( int  w,
int  h,
bool  consoleOnlyScripts 
)

Here is the call graph for this function:

Member Function Documentation

void MWGui::Console::acceptCommand ( MyGUI::EditBox *  _sender)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::Console::close ( )
virtual

Notify that window has been hidden.

Reimplemented from MWGui::WindowBase.

Here is the call graph for this function:

bool MWGui::Console::compile ( const std::string &  cmd,
Compiler::Output output 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

std::string MWGui::Console::complete ( std::string  input,
std::vector< std::string > &  matches 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::Console::execute ( const std::string &  command)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::Console::executeFile ( const std::string &  path)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::Console::exit ( )
virtual

Gracefully exits the window.

Reimplemented from MWGui::WindowBase.

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::Console::keyPress ( MyGUI::Widget *  _sender,
MyGUI::KeyCode  key,
MyGUI::Char  _char 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::Console::listNames ( )
private

Write all valid identifiers and keywords into mNames and sort them.

Note
If mNames is not empty, this function is a no-op.
The list may contain duplicates (if a name is a keyword and an identifier at the same time).

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::Console::onReferenceUnavailable ( )
protectedvirtual

called when reference has become unavailable

Implements MWGui::ReferenceInterface.

Here is the call graph for this function:

void MWGui::Console::onResChange ( int  width,
int  height 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::Console::open ( )
virtual

Notify that window has been made visible.

Reimplemented from MWGui::WindowBase.

Here is the call graph for this function:

void MWGui::Console::print ( const std::string &  msg,
const std::string &  color = "#FFFFFF" 
)

Here is the caller graph for this function:

void MWGui::Console::printError ( const std::string &  msg)

Error message.

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::Console::printOK ( const std::string &  msg)

Output from successful console command.

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::Console::report ( const std::string &  message,
const Compiler::TokenLoc loc,
Type  type 
)
privatevirtual

Report error to the user.

Implements Compiler::ErrorHandler.

Here is the call graph for this function:

void MWGui::Console::report ( const std::string &  message,
Type  type 
)
privatevirtual

Report a file related error.

Implements Compiler::ErrorHandler.

Here is the call graph for this function:

void MWGui::Console::resetReference ( )
virtual

Reimplemented from MWGui::ReferenceInterface.

Here is the call graph for this function:

Here is the caller graph for this function:

void MWGui::Console::setFont ( const std::string &  fntName)
void MWGui::Console::setSelectedObject ( const MWWorld::Ptr object)

Set the implicit object for script execution.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

StringList MWGui::Console::mCommandHistory
MyGUI::EditBox* MWGui::Console::mCommandLine
MWScript::CompilerContext MWGui::Console::mCompilerContext
private
bool MWGui::Console::mConsoleOnlyScripts
private
StringList::iterator MWGui::Console::mCurrent
std::string MWGui::Console::mEditString
Compiler::Extensions MWGui::Console::mExtensions
private
MyGUI::EditBox* MWGui::Console::mHistory
std::vector<std::string> MWGui::Console::mNames
private

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