ginga 1.0
The Ginga iTV middleware
Loading...
Searching...
No Matches
Formatter.h
1/* Copyright (C) 2006-2018 PUC-Rio/Laboratorio TeleMidia
2
3This file is part of Ginga (Ginga-NCL).
4
5Ginga is free software: you can redistribute it and/or modify it
6under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
9
10Ginga is distributed in the hope that it will be useful, but WITHOUT
11ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
13License for more details.
14
15You should have received a copy of the GNU General Public License
16along with Ginga. If not, see <https://www.gnu.org/licenses/>. */
17
18#ifndef FORMATTER_H
19#define FORMATTER_H
20
21#include "ginga.h"
22#include "aux-ginga.h"
23
24#include "Document.h"
25
26namespace ginga {
27
28class WebServices;
29class Context;
30class Event;
31class Media;
32class MediaSettings;
33class Object;
34
38class Formatter : public Ginga
39{
40public:
41 // Ginga:
43
44 bool start (const std::string &, std::string *);
45 bool stop ();
46
47 void resize (int, int);
48 void redraw (cairo_t *);
49
50 bool sendKey (const std::string &, bool);
51 bool sendTick (uint64_t, uint64_t, uint64_t);
52
53 const GingaOptions *getOptions ();
54 bool getOptionBool (const std::string &);
55 void setOptionBool (const std::string &, bool);
56 int getOptionInt (const std::string &);
57 void setOptionInt (const std::string &, int);
58 string getOptionString (const std::string &);
59 void setOptionString (const std::string &, std::string);
60
61 // Formatter:
62 explicit Formatter (const GingaOptions *);
63 ~Formatter ();
64
67 bool getEOS ();
68 void setEOS (bool);
69
70 static void setOptionBackground (Formatter *, const string &, string);
71 static void setOptionDebug (Formatter *, const string &, bool);
72 static void setOptionWebServices (Formatter *, const string &, bool);
73 static void setOptionExperimental (Formatter *, const string &, bool);
74 static void setOptionOpenGL (Formatter *, const string &, bool);
75 static void setOptionSize (Formatter *, const string &, int);
76
77private:
80
83
86
89
92
95
98
101
104
106 string _docPath;
107
109 bool _eos;
110};
111
112}
113
114#endif // FORMATTER_H
Ginga handle.
Definition ginga.h:84
Definition Context.h:27
NCL document.
Definition Document.h:35
Event state machine.
Definition Event.h:32
Interface between libginga and the external world.
Definition Formatter.h:39
WebServices * getWebServices()
Gets WebServices.
Definition Formatter.cpp:492
int getOptionInt(const std::string &)
Gets integer option value.
~Formatter()
Destroys formatter.
Definition Formatter.cpp:472
Time _lastTickTotal
The last total time informed via Formatter::sendTick.
Definition Formatter.h:88
void setOptionBool(const std::string &, bool)
Sets boolean option.
void setOptionString(const std::string &, std::string)
Sets string option.
Document * getDocument()
Gets current document.
Definition Formatter.cpp:482
static void setOptionOpenGL(Formatter *, const string &, bool)
Sets the OpenGL option of the given Formatter.
Definition Formatter.cpp:601
static void setOptionBackground(Formatter *, const string &, string)
Sets background option of the given Formatter.
Definition Formatter.cpp:526
bool getEOS()
Gets EOS flag.
Definition Formatter.cpp:502
bool start(const std::string &, std::string *)
Starts the presentation of an NCL file.
Definition Formatter.cpp:114
static void setOptionDebug(Formatter *, const string &, bool)
Sets debug option of the given Formatter.
Definition Formatter.cpp:544
bool _eos
Whether the presentation has ended naturally.
Definition Formatter.h:109
const GingaOptions * getOptions()
Gets current options.
Definition Formatter.cpp:387
Time _lastTickDiff
The last diff time informed via Formatter::sendTick.
Definition Formatter.h:91
string _docPath
Path of the file that originated the current document.
Definition Formatter.h:106
bool stop()
Stops the presentation.
Definition Formatter.cpp:181
static void setOptionWebServices(Formatter *, const string &, bool)
Sets WebServices option option of the given Formatter.
Definition Formatter.cpp:569
GingaState _state
Current state.
Definition Formatter.h:79
string _saved_G_MESSAGES_DEBUG
The saved value of environment variable G_MESSAGES_DEBUG.
Definition Formatter.h:97
void redraw(cairo_t *)
Draws the latest frame of the presentation on Cairo context.
Definition Formatter.cpp:225
static void setOptionSize(Formatter *, const string &, int)
Sets the width or height options of the given Formatter.
Definition Formatter.cpp:619
Formatter(const GingaOptions *)
Creates a new Formatter.
Definition Formatter.cpp:432
uint64_t _lastTickFrameNo
The last frame number informed via Formatter::sendTick.
Definition Formatter.h:94
void setOptionInt(const std::string &, int)
Sets integer option.
void setEOS(bool)
Sets EOS flag.
Definition Formatter.cpp:512
Document * _doc
Current document tree.
Definition Formatter.h:103
WebServices * _webservices
Current WebServices.
Definition Formatter.h:100
bool getOptionBool(const std::string &)
Gets boolean option value.
static void setOptionExperimental(Formatter *, const string &, bool)
Sets the experimental option of the given Formatter.
Definition Formatter.cpp:587
Color _background
Current background color.
Definition Formatter.h:85
bool sendTick(uint64_t, uint64_t, uint64_t)
Sends tick event to presentation.
Definition Formatter.cpp:359
bool sendKey(const std::string &, bool)
Sends key event to presentation.
Definition Formatter.cpp:333
GingaState getState()
Gets Ginga object state.
Definition Formatter.cpp:108
GingaOptions _opts
Current options.
Definition Formatter.h:82
void resize(int, int)
Resizes the presentation screen.
Definition Formatter.cpp:195
string getOptionString(const std::string &)
Gets string option value.
Definition MediaSettings.h:26
Definition Media.h:27
Definition Object.h:30
WebSercices.
Definition WebServices.h:103
The libginga API.
GingaState
Ginga states.
Definition ginga.h:73
Ginga control options.
Definition ginga.h:45