Ginga  0.13.6.2086-83aa
The iTV middleware.
Formatter Class Reference

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

#include <Formatter.h>

Inheritance diagram for Formatter:
Collaboration diagram for Formatter:

Public Member Functions

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

Static Public Member Functions

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

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.
 
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()

Formatter::Formatter ( const GingaOptions opts)

Creates a new Formatter.

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

Member Function Documentation

◆ getDocument()

Document * Formatter::getDocument ( )

Gets current document.

Returns
Current document or null (no current document).

◆ getEOS()

bool Formatter::getEOS ( )

Gets EOS flag.

Returns
EOS flag.

◆ getOptionBool()

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

Gets boolean option value.

Parameters
nameOption name.
Returns
Option value.

Implements Ginga.

◆ getOptionInt()

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

Gets integer option value.

Parameters
nameOption name.
Returns
Option value.

Implements Ginga.

◆ getOptions()

const GingaOptions * Formatter::getOptions ( )
virtual

Gets current options.

Returns
Current options.

Implements Ginga.

◆ getOptionString()

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

Gets string option value.

Parameters
nameOption name.
Returns
Option value.

Implements Ginga.

◆ getState()

GingaState Formatter::getState ( )
virtual

Gets Ginga object state.

Returns
Ginga object state.

Implements Ginga.

◆ redraw()

void Formatter::redraw ( cairo_t *  cr)
virtual

Draws the latest frame of the presentation on Cairo context.

Parameters
crCairo context.

Implements Ginga.

◆ resize()

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

Resizes the presentation screen.

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

Implements Ginga.

◆ sendKey()

bool 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 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 Formatter::setEOS ( bool  eos)

Sets EOS flag.

Parameters
eosFlag value.

◆ setOptionBackground()

void 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 Formatter::setOptionBool ( const std::string &  name,
bool  value 
)
virtual

Sets boolean option.

Parameters
nameOption name.
valueOption value.

Implements Ginga.

◆ setOptionDebug()

void 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 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 Formatter::setOptionInt ( const std::string &  name,
int  value 
)
virtual

Sets integer option.

Parameters
nameOption name.
valueOption value.

Implements Ginga.

◆ setOptionOpenGL()

void 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 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 Formatter::setOptionString ( const std::string &  name,
std::string  value 
)
virtual

Sets string option.

Parameters
nameOption name.
valueOption value.

Implements Ginga.

◆ start()

bool 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 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: