Public Member Functions
GUI::System Class Reference

The System class is the CEGUI class that provides access to all other elements in this system. More...

Inherits GUI::EventSet.

List of all members.

Public Member Functions

Renderer getRenderer ()
 Return a pointer to the Renderer object being used by the system.
void setDefaultFont (string name)
 Set the default font to be used by the system.
void setDefaultFont (Font font)
 Set the default font to be used by the system.
Font getDefaultFont ()
 Return a pointer to the default Font for the GUI system.
void signalRedraw ()
 Causes a full re-draw next time renderGUI() is called.
bool isRedrawRequested ()
 Return a boolean value to indicate whether a full re-draw is requested next time renderGUI() is called.
void renderGUI ()
 Render the GUI.
Window setGUISheet (Window sheet)
 Set the active GUI sheet (root) window.
Window getGUISheet ()
 Return a pointer to the active GUI sheet (root) window.
float getSingleClickTimeout ()
 Return the current timeout for generation of single-click events.
float getMultiClickTimeout ()
 Return the current timeout for generation of multi-click events.
Size getMultiClickToleranceAreaSize ()
 Return the size of the allowable mouse movement tolerance used when generating multi-click events.
void setSingleClickTimeout (float timeout)
 Set the timeout used for generation of single-click events.
void setMultiClickTimeout (float timeout)
 Set the timeout to be used for the generation of multi-click events.
void setMultiClickToleranceAreaSize (Size sz)
 Set the size of the allowable mouse movement tolerance used when generating multi-click events.
Image getDefaultMouseCursor ()
 Return the currently set default mouse cursor image.
void setDefaultMouseCursor (string imageset, string image_name)
 Set the image to be used as the default mouse cursor.
Window getWindowContainingMouse ()
 Return the Window object that the mouse is presently within.
void executeScriptFile (string filename)
 Execute a script file if possible.
int executeScriptGlobal (string function_name)
 Execute a scripted global function if possible. The function should not take any parameters and should return an integer.
void executeScriptString (string str)
 If possible, execute script code contained in the given CEGUI::String object.
float getMouseMoveScaling ()
 return the current mouse movement scaling factor.
void setMouseMoveScaling (float scaling)
 Set the current mouse movement scaling factor.
void notifyWindowDestroyed (Window window)
 Internal method used to inform the System object whenever a window is destroyed, so that System can perform any required housekeeping.
bool isSystemKeyDown (int k)
 Return the current state of the given system key.
void setDefaultTooltip (Tooltip tooltip)
 Set the system default Tooltip object. This value may be NULL to indicate that no default Tooltip will be available.
void setDefaultTooltip (string tooltipType)
 Set the system default Tooltip to be used by specifying a Window type.
Tooltip getDefaultTooltip ()
 return a poiter to the system default tooltip. May return 0.
bool injectMouseMove (float delta_x, float delta_y)
 Method that injects a mouse movement event into the system.
bool injectMouseLeaves (void)
 Method that injects that the mouse has left the application window.
bool injectMouseButtonDown (int button)
 Method that injects a mouse button down event into the system.
bool injectMouseButtonUp (int button)
 Method that injects a mouse button up event into the system.
bool injectKeyDown (int key_code)
 Method that injects a key down event into the system.
bool injectKeyUp (int key_code)
 Method that injects a key up event into the system.
bool injectChar (int code_point)
 Method that injects a typed character event into the system.
bool injectMouseWheelChange (float delta)
 Method that injects a mouse-wheel / scroll-wheel event into the system.
bool injectMousePosition (float x_pos, float y_pos)
 Method that injects a new position for the mouse cursor.
bool injectTimePulse (float timeElapsed)
 Method to inject time pulses into the system.
- Public Member Functions inherited from GUI::EventSet
void addEvent (string name)
 Add a new Event to the EventSet with the given name.
void removeEvent (string name)
 Removes the Event with the given name. All connections to the event are disconnected.
void removeAllEvents ()
 Remove all Event objects from the EventSet.
bool isEventPresent (string name)
 Checks to see if an Event with the given name is present in the EventSet.
EventConnection subscribeEvent (string name, string subscriber_name)
 Subscribes the named Event to a scripted funtion.
void fireEvent (string name, EventArgs args, string eventNamespace="")
 Fires the named event passing the given EventArgs object.
bool isMuted ()
 Return whether the EventSet is muted or not.
void setMutedState (bool setting)
 Set the mute state for this EventSet.

Additional Inherited Members

- Public Attributes inherited from GUI::EventSet
Event Event
 Can be used to iterate over the events currently added to the EventSet.

Detailed Description

The System class is the CEGUI class that provides access to all other elements in this system.

This object must be created by the client application. The System object requires that you pass it an initialised Renderer object which it can use to interface to whatever rendering system will be used to display the GUI imagery.


Member Function Documentation

Renderer GUI::System::getRenderer ( )

Return a pointer to the Renderer object being used by the system.

Returns:
Pointer to the Renderer object used by the system.
void GUI::System::setDefaultFont ( string  name)

Set the default font to be used by the system.

Parameters:
nameString object containing the name of the font to be used as the system default.
Returns:
Nothing.
void GUI::System::setDefaultFont ( Font  font)

Set the default font to be used by the system.

Parameters:
fontPointer to the font to be used as the system default.
Returns:
Nothing.
Font GUI::System::getDefaultFont ( )

Return a pointer to the default Font for the GUI system.

Returns:
Pointer to a Font object that is the default font in the system.
void GUI::System::signalRedraw ( )

Causes a full re-draw next time renderGUI() is called.

Returns:
Nothing
bool GUI::System::isRedrawRequested ( )

Return a boolean value to indicate whether a full re-draw is requested next time renderGUI() is called.

Returns:
true if a re-draw has been requested
void GUI::System::renderGUI ( )

Render the GUI.

Depending upon the internal state, this may either re-use rendering from last time, or trigger a full re-draw from all elements.

Returns:
Nothing
Window GUI::System::setGUISheet ( Window  sheet)

Set the active GUI sheet (root) window.

Parameters:
sheetPointer to a Window object that will become the new GUI 'root'
Returns:
Pointer to the window that was previously set as the GUI root.
Window GUI::System::getGUISheet ( )

Return a pointer to the active GUI sheet (root) window.

Returns:
Pointer to the window object that has been set as the GUI root element.
float GUI::System::getSingleClickTimeout ( )

Return the current timeout for generation of single-click events.

A single-click is defined here as a button being pressed and then released.

Returns:
float value equal to the current single-click timeout value.
float GUI::System::getMultiClickTimeout ( )

Return the current timeout for generation of multi-click events.

A multi-click event is a double-click, or a triple-click. The value returned here is the maximum allowable time between mouse button down events for which a multi-click event will be generated.

Returns:
float value equal to the current multi-click timeout value.
Size GUI::System::getMultiClickToleranceAreaSize ( )

Return the size of the allowable mouse movement tolerance used when generating multi-click events.

This size defines an area with the mouse at the centre. The mouse must stay within the tolerance defined for a multi-click (double click, or triple click) event to be generated.

Returns:
Size object describing the current multi-click tolerance area size.
void GUI::System::setSingleClickTimeout ( float  timeout)

Set the timeout used for generation of single-click events.

A single-click is defined here as a button being pressed and then released.

Parameters:
timeoutfloat value equal to the single-click timeout value to be used from now onwards.
Note:
A timeout value of 0 indicates infinity and so no timeout occurrs; as long as the mouse is in the prescribed area, a mouse button 'clicked' event will therefore always be raised.
Returns:
Nothing.
void GUI::System::setMultiClickTimeout ( float  timeout)

Set the timeout to be used for the generation of multi-click events.

A multi-click event is a double-click, or a triple-click. The value returned here is the maximum allowable time between mouse button down events for which a multi-click event will be generated.

Parameters:
timeoutfloat value equal to the multi-click timeout value to be used from now onwards.
Note:
A timeout value of 0 indicates infinity and so no timeout occurrs; as long as the mouse is in the prescribed area, an appropriate mouse button event will therefore always be raised.
Returns:
Nothing.
void GUI::System::setMultiClickToleranceAreaSize ( Size  sz)

Set the size of the allowable mouse movement tolerance used when generating multi-click events.

This size defines an area with the mouse at the centre. The mouse must stay within the tolerance defined for a multi-click (double click, or triple click) event to be generated.

Parameters:
szSize object describing the multi-click tolerance area size to be used.
Returns:
Nothing.
Image GUI::System::getDefaultMouseCursor ( )

Return the currently set default mouse cursor image.

Returns:
Pointer to the current default image used for the mouse cursor. May return NULL if default cursor has not been set, or has intentionally been set to NULL - which results in a blank default cursor.
void GUI::System::setDefaultMouseCursor ( string  imageset,
string  image_name 
)

Set the image to be used as the default mouse cursor.

Parameters:
imagesetString object that contains the name of the Imageset that contains the image to be used.
image_nameString object that contains the name of the Image on imageset that is to be used.
Returns:
Nothing.
Exceptions:
UnknownObjectExceptionthrown if imageset is not known, or if imageset contains no Image named image_name.
Window GUI::System::getWindowContainingMouse ( )

Return the Window object that the mouse is presently within.

Returns:
Pointer to the Window object that currently contains the mouse cursor, or NULL if none.
void GUI::System::executeScriptFile ( string  filename)

Execute a script file if possible.

Parameters:
filenameString object holding the filename of the script file that is to be executed
int GUI::System::executeScriptGlobal ( string  function_name)

Execute a scripted global function if possible. The function should not take any parameters and should return an integer.

Parameters:
function_nameString object holding the name of the function, in the global script environment, that is to be executed.
Returns:
The integer value returned from the script function.
void GUI::System::executeScriptString ( string  str)

If possible, execute script code contained in the given CEGUI::String object.

Parameters:
strString object holding the valid script code that should be executed.
Returns:
Nothing.
float GUI::System::getMouseMoveScaling ( )

return the current mouse movement scaling factor.

Returns:
float value that is equal to the currently set mouse movement scaling factor. Defaults to 1.0f.
void GUI::System::setMouseMoveScaling ( float  scaling)

Set the current mouse movement scaling factor.

Parameters:
scalingfloat value specifying the scaling to be applied to mouse movement inputs.
Returns:
nothing.
void GUI::System::notifyWindowDestroyed ( Window  window)

Internal method used to inform the System object whenever a window is destroyed, so that System can perform any required housekeeping.

Note:
This method is not intended for client code usage. If you use this method anything can, and probably will, go wrong!
bool GUI::System::isSystemKeyDown ( int  k)

Return the current state of the given system key.

Parameters:
ksystem key to check
Returns:
bool value representing the state of the given system key.
void GUI::System::setDefaultTooltip ( Tooltip  tooltip)

Set the system default Tooltip object. This value may be NULL to indicate that no default Tooltip will be available.

Parameters:
tooltipPointer to a valid Tooltip based object which should be used as the default tooltip for the system, or NULL to indicate that no system default tooltip is required. Note that when passing a pointer to a Tooltip object, ownership of the Tooltip does not pass to System.
Returns:
Nothing.
void GUI::System::setDefaultTooltip ( string  tooltipType)

Set the system default Tooltip to be used by specifying a Window type.

System will internally attempt to create an instance of the specified window type (which must be derived from the base Tooltip class). If the Tooltip creation fails, the error is logged and no system default Tooltip will be available.

Parameters:
tooltipTypeString object holding the name of the Tooltip based Window type which should be used as the Tooltip for the system default.
Returns:
Nothing.
Tooltip GUI::System::getDefaultTooltip ( )

return a poiter to the system default tooltip. May return 0.

Returns:
Pointer to the current system default tooltip. May return null if no system default tooltip is available.
bool GUI::System::injectMouseMove ( float  delta_x,
float  delta_y 
)

Method that injects a mouse movement event into the system.

Parameters:
delta_xamount the mouse moved on the x axis.
delta_yamount the mouse moved on the y axis.
Returns:
  • true if the input was processed by the gui system.
  • false if the input was not processed by the gui system.
bool GUI::System::injectMouseLeaves ( void  )

Method that injects that the mouse has left the application window.

Returns:
  • true if the generated mouse move event was handled.
  • false if the generated mouse move event was not handled.
bool GUI::System::injectMouseButtonDown ( int  button)

Method that injects a mouse button down event into the system.

Parameters:
buttonOne of the MouseButton values indicating which button was pressed.
Returns:
  • true if the input was processed by the gui system.
  • false if the input was not processed by the gui system.
bool GUI::System::injectMouseButtonUp ( int  button)

Method that injects a mouse button up event into the system.

Parameters:
buttonOne of the MouseButton values indicating which button was released.
Returns:
  • true if the input was processed by the gui system.
  • false if the input was not processed by the gui system.
bool GUI::System::injectKeyDown ( int  key_code)

Method that injects a key down event into the system.

Parameters:
key_codeint value indicating which key was pressed.
Returns:
  • true if the input was processed by the gui system.
  • false if the input was not processed by the gui system.
bool GUI::System::injectKeyUp ( int  key_code)

Method that injects a key up event into the system.

Parameters:
key_codeint value indicating which key was released.
Returns:
  • true if the input was processed by the gui system.
  • false if the input was not processed by the gui system.
bool GUI::System::injectChar ( int  code_point)

Method that injects a typed character event into the system.

Parameters:
code_pointUnicode code point of the character that was typed.
Returns:
  • true if the input was processed by the gui system.
  • false if the input was not processed by the gui system.
bool GUI::System::injectMouseWheelChange ( float  delta)

Method that injects a mouse-wheel / scroll-wheel event into the system.

Parameters:
deltafloat value representing the amount the wheel moved.
Returns:
  • true if the input was processed by the gui system.
  • false if the input was not processed by the gui system.
bool GUI::System::injectMousePosition ( float  x_pos,
float  y_pos 
)

Method that injects a new position for the mouse cursor.

Parameters:
x_posNew absolute pixel position of the mouse cursor on the x axis.
y_posNew absolute pixel position of the mouse cursoe in the y axis.
Returns:
  • true if the generated mouse move event was handled.
  • false if the generated mouse move event was not handled.
bool GUI::System::injectTimePulse ( float  timeElapsed)

Method to inject time pulses into the system.

Parameters:
timeElapsedfloat value indicating the amount of time passed, in seconds, since the last time this method was called.
Returns:
Currently, this method always returns true.