ginga 1.0
The Ginga iTV middleware
Loading...
Searching...
No Matches
ginga.h
Go to the documentation of this file.
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 GINGA_H
19#define GINGA_H
20
21#ifdef __cplusplus
22# define GINGA_BEGIN_DECLS extern "C" {/*}*/
23# define GINGA_END_DECLS /*{*/}
24#else
25# define GINGA_BEGIN_DECLS
26# define GINGA_END_DECLS
27#endif
28
29GINGA_BEGIN_DECLS
30#include <cairo.h>
31GINGA_END_DECLS
32
33#include <cstdint>
34#include <string>
35
45{
47 int width;
48
50 int height;
51
53 bool debug;
54
57
60
63 bool opengl;
64
66 std::string background;
67};
68
77
83class Ginga
84{
85public:
86 explicit Ginga (const GingaOptions *opts);
87 virtual ~Ginga () = 0;
88
89 virtual GingaState getState () = 0;
90 virtual bool start (const std::string &path, std::string *errmsg) = 0;
91 virtual bool stop () = 0;
92
93 virtual void resize (int width, int height) = 0;
94 virtual void redraw (cairo_t *cr) = 0;
95
96 virtual bool sendKey (const std::string &key, bool press) = 0;
97 virtual bool sendTick (uint64_t total, uint64_t diff, uint64_t frame) = 0;
98
99 virtual const GingaOptions *getOptions () = 0;
100 virtual bool getOptionBool (const std::string &name) = 0;
101 virtual void setOptionBool (const std::string &name, bool value) = 0;
102 virtual int getOptionInt (const std::string &name) = 0;
103 virtual void setOptionInt (const std::string &name, int value) = 0;
104 virtual std::string getOptionString (const std::string &name) = 0;
105 virtual void setOptionString (const std::string &name,
106 std::string value) = 0;
107
108 static Ginga *create (const GingaOptions *opts);
109 static std::string version ();
110};
111
112#endif // GINGA_H
Ginga handle.
Definition ginga.h:84
virtual bool stop()=0
Stops the presentation.
virtual void resize(int width, int height)=0
Resizes the presentation screen.
static Ginga * create(const GingaOptions *opts)
Creates a new Ginga object.
Definition Ginga.cpp:51
virtual bool sendTick(uint64_t total, uint64_t diff, uint64_t frame)=0
Sends tick event to presentation.
virtual const GingaOptions * getOptions()=0
Gets current options.
virtual GingaState getState()=0
Gets Ginga object state.
virtual bool getOptionBool(const std::string &name)=0
Gets boolean option value.
static std::string version()
Gets libginga version string.
Definition Ginga.cpp:62
virtual int getOptionInt(const std::string &name)=0
Gets integer option value.
virtual ~Ginga()=0
Destroys Ginga object.
Definition Ginga.cpp:41
virtual void setOptionString(const std::string &name, std::string value)=0
Sets string option.
Ginga(const GingaOptions *opts)
Creates a new Ginga object.
Definition Ginga.cpp:34
virtual void redraw(cairo_t *cr)=0
Draws the latest frame of the presentation on Cairo context.
virtual void setOptionInt(const std::string &name, int value)=0
Sets integer option.
virtual void setOptionBool(const std::string &name, bool value)=0
Sets boolean option.
virtual bool start(const std::string &path, std::string *errmsg)=0
Starts the presentation of an NCL file.
virtual bool sendKey(const std::string &key, bool press)=0
Sends key event to presentation.
virtual std::string getOptionString(const std::string &name)=0
Gets string option value.
GingaState
Ginga states.
Definition ginga.h:73
@ GINGA_STATE_STOPPED
Ginga is stopped.
Definition ginga.h:75
@ GINGA_STATE_PLAYING
Ginga is playing.
Definition ginga.h:74
Ginga control options.
Definition ginga.h:45
bool debug
Whether to enable debug mode.
Definition ginga.h:53
int width
Screen width (in pixels).
Definition ginga.h:47
bool experimental
Whether to enable experimental features.
Definition ginga.h:59
std::string background
Background color.
Definition ginga.h:66
bool opengl
Whether to use OpenGL back-end.
Definition ginga.h:63
int height
Screen height (in pixels).
Definition ginga.h:50
bool webservices
Whether to enable debug mode.
Definition ginga.h:56