ginga 1.0
The Ginga iTV middleware
Loading...
Searching...
No Matches
ginga::Formatter Class Reference

Interface between libginga and the external world. More...

#include <Formatter.h>

Inheritance diagram for ginga::Formatter:
Collaboration diagram for ginga::Formatter:

Public Member Functions

GingaState getState ()
 Gets Ginga object state.
 
bool start (const std::string &, std::string *)
 Starts the presentation of an NCL file.
 
bool stop ()
 Stops the presentation.
 
void resize (int, int)
 Resizes the presentation screen.
 
void redraw (cairo_t *)
 Draws the latest frame of the presentation on Cairo context.
 
bool sendKey (const std::string &, bool)
 Sends key event to presentation.
 
bool sendTick (uint64_t, uint64_t, uint64_t)
 Sends tick event to presentation.
 
const GingaOptionsgetOptions ()
 Gets current options.
 
bool getOptionBool (const std::string &)
 Gets boolean option value.
 
void setOptionBool (const std::string &, bool)
 Sets boolean option.
 
int getOptionInt (const std::string &)
 Gets integer option value.
 
void setOptionInt (const std::string &, int)
 Sets integer option.
 
string getOptionString (const std::string &)
 Gets string option value.
 
void setOptionString (const std::string &, std::string)
 Sets string option.
 
 Formatter (const GingaOptions *)
 Creates a new Formatter.
 
 ~Formatter ()
 Destroys formatter.
 
DocumentgetDocument ()
 Gets current document.
 
WebServicesgetWebServices ()
 Gets WebServices.
 
bool getEOS ()
 Gets EOS flag.
 
void setEOS (bool)
 Sets EOS flag.
 
- Public Member Functions inherited from Ginga
 Ginga (const GingaOptions *opts)
 Creates a new Ginga object.
 
virtual ~Ginga ()=0
 Destroys Ginga object.
 

Static Public Member Functions

static void setOptionBackground (Formatter *, const string &, string)
 Sets background option of the given Formatter.
 
static void setOptionDebug (Formatter *, const string &, bool)
 Sets debug option of the given Formatter.
 
static void setOptionWebServices (Formatter *, const string &, bool)
 Sets WebServices option option of the given Formatter.
 
static void setOptionExperimental (Formatter *, const string &, bool)
 Sets the experimental option of the given Formatter.
 
static void setOptionOpenGL (Formatter *, const string &, bool)
 Sets the OpenGL option of the given Formatter.
 
static void setOptionSize (Formatter *, const string &, int)
 Sets the width or height options of the given Formatter.
 
- Static Public Member Functions inherited from Ginga
static Gingacreate (const GingaOptions *opts)
 Creates a new Ginga object.
 
static std::string version ()
 Gets libginga version string.
 

Private Attributes

GingaState _state
 Current state.
 
GingaOptions _opts
 Current options.
 
Color _background
 Current background color.
 
Time _lastTickTotal
 The last total time informed via Formatter::sendTick.
 
Time _lastTickDiff
 The last diff time informed via Formatter::sendTick.
 
uint64_t _lastTickFrameNo
 The last frame number informed via Formatter::sendTick.
 
string _saved_G_MESSAGES_DEBUG
 The saved value of environment variable G_MESSAGES_DEBUG.
 
WebServices_webservices
 Current WebServices.
 
Document_doc
 Current document tree.
 
string _docPath
 Path of the file that originated the current document.
 
bool _eos
 Whether the presentation has ended naturally.
 

Detailed Description

Interface between libginga and the external world.

Constructor & Destructor Documentation

◆ Formatter()

ginga::Formatter::Formatter ( const GingaOptions * opts)
explicit

Creates a new Formatter.

Parameters
optsOptions to initialize the formatter with.
Returns
New Formatter.

Member Function Documentation

◆ getDocument()

Document * ginga::Formatter::getDocument ( )

Gets current document.

Returns
Current document or null (no current document).

◆ getEOS()

bool ginga::Formatter::getEOS ( )

Gets EOS flag.

Returns
EOS flag.

◆ getOptionBool()

bool ginga::Formatter::getOptionBool ( const std::string & name)
virtual

Gets boolean option value.

Parameters
nameOption name.
Returns
Option value.

Implements Ginga.

◆ getOptionInt()

int ginga::Formatter::getOptionInt ( const std::string & name)
virtual

Gets integer option value.

Parameters
nameOption name.
Returns
Option value.

Implements Ginga.

◆ getOptions()

const GingaOptions * ginga::Formatter::getOptions ( )
virtual

Gets current options.

Returns
Current options.

Implements Ginga.

◆ getOptionString()

string ginga::Formatter::getOptionString ( const std::string & name)
virtual

Gets string option value.

Parameters
nameOption name.
Returns
Option value.

Implements Ginga.

◆ getState()

GingaState ginga::Formatter::getState ( )
virtual

Gets Ginga object state.

Returns
Ginga object state.

Implements Ginga.

◆ getWebServices()

WebServices * ginga::Formatter::getWebServices ( )

Gets WebServices.

Returns
WebServices or null (no current document).

◆ redraw()

void ginga::Formatter::redraw ( cairo_t * cr)
virtual

Draws the latest frame of the presentation on Cairo context.

Parameters
crCairo context.

Implements Ginga.

◆ resize()

void ginga::Formatter::resize ( int width,
int height )
virtual

Resizes the presentation screen.

Parameters
widthScreen width (in pixels).
heightScreen height (in pixels).

Implements Ginga.

◆ sendKey()

bool ginga::Formatter::sendKey ( const std::string & key,
bool press )
virtual

Sends key event to presentation.

Parameters
keyKey name.
pressWhether the key was pressed (or released).
Returns
true if successful, or false otherwise.

Implements Ginga.

◆ sendTick()

bool ginga::Formatter::sendTick ( uint64_t total,
uint64_t diff,
uint64_t frame )
virtual

Sends tick event to presentation.

Parameters
totalTime since the presentation started.
diffTime since last tick.
frameTick number.
Returns
true if successful, or false otherwise.

Implements Ginga.

◆ setEOS()

void ginga::Formatter::setEOS ( bool eos)

Sets EOS flag.

Parameters
eosFlag value.

◆ setOptionBackground()

void ginga::Formatter::setOptionBackground ( Formatter * self,
const string & name,
string value )
static

Sets background option of the given Formatter.

Parameters
selfFormatter.
nameMust be the string "background".
valueColor value.

◆ setOptionBool()

void ginga::Formatter::setOptionBool ( const std::string & name,
bool value )
virtual

Sets boolean option.

Parameters
nameOption name.
valueOption value.

Implements Ginga.

◆ setOptionDebug()

void ginga::Formatter::setOptionDebug ( Formatter * self,
const string & name,
bool value )
static

Sets debug option of the given Formatter.

Parameters
selfFormatter.
nameMust be the string "debug".
valueDebug flag value.

◆ setOptionExperimental()

void ginga::Formatter::setOptionExperimental ( Formatter * self,
const string & name,
bool value )
static

Sets the experimental option of the given Formatter.

Parameters
selfFormatter.
nameMust be the string "experimental".
valueExperimental flag value.

◆ setOptionInt()

void ginga::Formatter::setOptionInt ( const std::string & name,
int value )
virtual

Sets integer option.

Parameters
nameOption name.
valueOption value.

Implements Ginga.

◆ setOptionOpenGL()

void ginga::Formatter::setOptionOpenGL ( Formatter * self,
const string & name,
bool value )
static

Sets the OpenGL option of the given Formatter.

Parameters
selfFormatter.
nameMust be the string "opengl".
valueOpenGL flag value.

◆ setOptionSize()

void ginga::Formatter::setOptionSize ( Formatter * self,
const string & name,
int value )
static

Sets the width or height options of the given Formatter.

Parameters
selfFormatter.
nameMust be either the string "width" or the string "height".
valueWidth or height value in pixels.

◆ setOptionString()

void ginga::Formatter::setOptionString ( const std::string & name,
std::string value )
virtual

Sets string option.

Parameters
nameOption name.
valueOption value.

Implements Ginga.

◆ setOptionWebServices()

void ginga::Formatter::setOptionWebServices ( Formatter * self,
const string & name,
bool value )
static

Sets WebServices option option of the given Formatter.

Parameters
selfFormatter.
nameMust be the string "webservies".
valuewebservies flag value.

◆ start()

bool ginga::Formatter::start ( const std::string & path,
std::string * errmsg )
virtual

Starts the presentation of an NCL file.

Parameters
pathPath to NCL file.
[out]errmsgVariable to store the error message (if any).
Returns
true if successful or false otherwise.

Implements Ginga.

◆ stop()

bool ginga::Formatter::stop ( )
virtual

Stops the presentation.

Returns
true if successful or false otherwise.

Implements Ginga.


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