Ginga  0.13.6.1771-df200
The iTV middleware.
ginga.h
Go to the documentation of this file.
1 /* Copyright (C) 2006-2017 PUC-Rio/Laboratorio TeleMidia
2 
3 This file is part of Ginga (Ginga-NCL).
4 
5 Ginga is free software: you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 
10 Ginga is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
13 License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with Ginga. If not, see <http://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 
30 #include <cairo.h>
32 
33 #include <cstdint>
34 #include <string>
35 
40 {
41  int width;
42  int height;
43  bool debug;
45  bool opengl;
46  std::string background;
47 };
48 
52 typedef enum
53 {
56 } GingaState;
57 
61 class Ginga
62 {
63 public:
64  Ginga (int, char **, GingaOptions *);
65  virtual ~Ginga () = 0;
66 
67  virtual GingaState getState () = 0;
68  virtual bool start (const std::string &, std::string *) = 0;
69  virtual bool stop () = 0;
70 
71  virtual void resize (int, int) = 0;
72  virtual void redraw (cairo_t *) = 0;
73 
74  virtual bool sendKeyEvent (const std::string &, bool) = 0;
75  virtual bool sendTickEvent (uint64_t, uint64_t, uint64_t) = 0;
76 
77  virtual const GingaOptions *getOptions () = 0;
78  virtual bool getOptionBool (const std::string &) = 0;
79  virtual void setOptionBool (const std::string &, bool) = 0;
80  virtual int getOptionInt (const std::string &) = 0;
81  virtual void setOptionInt (const std::string &, int) = 0;
82  virtual std::string getOptionString (const std::string &) = 0;
83  virtual void setOptionString (const std::string &, std::string) = 0;
84 
85 public:
86  static Ginga *create (int, char **, GingaOptions *);
87  static std::string version ();
88 };
89 
90 #endif // GINGA_H
Ginga object.
Definition: ginga.h:61
int height
Definition: ginga.h:42
Ginga options.
Definition: ginga.h:39
#define GINGA_END_DECLS
Definition: ginga.h:26
#define GINGA_BEGIN_DECLS
Definition: ginga.h:25
std::string background
Definition: ginga.h:46
Definition: ginga.h:54
GingaState
Ginga states.
Definition: ginga.h:52
bool debug
Definition: ginga.h:43
bool experimental
Definition: ginga.h:44
bool opengl
Definition: ginga.h:45
Definition: ginga.h:55
int width
Definition: ginga.h:41