Ginga  0.13.6
 All Classes Namespaces Functions Variables
IDeviceScreen.h
1 /******************************************************************************
2 Este arquivo eh parte da implementacao do ambiente declarativo do middleware
3 Ginga (Ginga-NCL).
4 
5 Direitos Autorais Reservados (c) 1989-2007 PUC-Rio/Laboratorio TeleMidia
6 
7 Este programa eh software livre; voce pode redistribui-lo e/ou modificah-lo sob
8 os termos da Licenca Publica Geral GNU versao 2 conforme publicada pela Free
9 Software Foundation.
10 
11 Este programa eh distribuido na expectativa de que seja util, porem, SEM
12 NENHUMA GARANTIA; nem mesmo a garantia implicita de COMERCIABILIDADE OU
13 ADEQUACAO A UMA FINALIDADE ESPECIFICA. Consulte a Licenca Publica Geral do
14 GNU versao 2 para mais detalhes.
15 
16 Voce deve ter recebido uma copia da Licenca Publica Geral do GNU versao 2 junto
17 com este programa; se nao, escreva para a Free Software Foundation, Inc., no
18 endereco 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
19 
20 Para maiores informacoes:
21 ncl @ telemidia.puc-rio.br
22 http://www.ncl.org.br
23 http://www.ginga.org.br
24 http://www.telemidia.puc-rio.br
25 ******************************************************************************
26 This file is part of the declarative environment of middleware Ginga (Ginga-NCL)
27 
28 Copyright: 1989-2007 PUC-RIO/LABORATORIO TELEMIDIA, All Rights Reserved.
29 
30 This program is free software; you can redistribute it and/or modify it under
31 the terms of the GNU General Public License version 2 as published by
32 the Free Software Foundation.
33 
34 This program is distributed in the hope that it will be useful, but WITHOUT ANY
35 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
36 PARTICULAR PURPOSE. See the GNU General Public License version 2 for more
37 details.
38 
39 You should have received a copy of the GNU General Public License version 2
40 along with this program; if not, write to the Free Software
41 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
42 
43 For further information contact:
44 ncl @ telemidia.puc-rio.br
45 http://www.ncl.org.br
46 http://www.ginga.org.br
47 http://www.telemidia.puc-rio.br
48 *******************************************************************************/
49 
50 #ifndef IDEVICESCREEN_H_
51 #define IDEVICESCREEN_H_
52 
53 #include "mb/IMBDefs.h"
54 #include "mb/IInputManager.h"
55 
56 #include "IContinuousMediaProvider.h"
57 #include "IFontProvider.h"
58 #include "IImageProvider.h"
59 
60 #include "IWindow.h"
61 #include "ISurface.h"
62 
63 #include <vector>
64 #include <string>
65 using namespace std;
66 
67 namespace br {
68 namespace pucrio {
69 namespace telemidia {
70 namespace ginga {
71 namespace core {
72 namespace mb {
73  class IDeviceScreen {
74  public:
75  /*
76  * Attention:
77  *
78  * If you are exiting from your program or if you are
79  * removing all screens of a specific multimedia backend, call
80  * releaseMB() before delete a device screen,
81  */
82  virtual ~IDeviceScreen(){};
83 
84  virtual void releaseScreen()=0;
85  virtual void releaseMB()=0;
86  virtual void clearWidgetPools()=0;
87 
88  virtual string getScreenName()=0;
89  virtual GingaWindowID getScreenUnderlyingWindow()=0;
90 
91  virtual void setBackgroundImage(string uri)=0;
92 
93  virtual unsigned int getWidthResolution()=0;
94  virtual void setWidthResolution(unsigned int wRes)=0;
95  virtual unsigned int getHeightResolution()=0;
96  virtual void setHeightResolution(unsigned int hRes)=0;
97 
98  virtual void setColorKey(int r, int g, int b)=0;
99 
100  virtual IWindow* getIWindowFromId(GingaWindowID winId)=0;
101 
102  virtual bool mergeIds(
103  GingaWindowID destId, vector<GingaWindowID>* srcIds)=0;
104 
105  virtual void blitScreen(ISurface* destination)=0;
106  virtual void blitScreen(string fileUri)=0;
107 
108  virtual void refreshScreen()=0;
109 
110 
111  /* interfacing output */
112 
113  virtual IWindow* createWindow(
114  int x, int y, int w, int h, float z)=0;
115 
116  virtual GingaWindowID createUnderlyingSubWindow(
117  int x, int y, int w, int h, float z)=0;
118 
119  virtual IWindow* createWindowFrom(GingaWindowID underlyingWindow)=0;
120  virtual bool hasWindow(IWindow* win)=0;
121  virtual void releaseWindow(IWindow* win)=0;
122 
123  virtual ISurface* createSurface()=0;
124  virtual ISurface* createSurface(int w, int h)=0;
125  virtual ISurface* createSurfaceFrom(void* underlyingSurface)=0;
126  virtual bool hasSurface(ISurface* sur)=0;
127  virtual bool releaseSurface(ISurface* sur)=0;
128 
129 
130  /* interfacing content */
131 
132  virtual IContinuousMediaProvider* createContinuousMediaProvider(
133  const char* mrl, bool* hasVisual, bool isRemote)=0;
134 
135  virtual void releaseContinuousMediaProvider(
136  IContinuousMediaProvider* provider)=0;
137 
138  virtual IFontProvider* createFontProvider(
139  const char* mrl, int fontSize)=0;
140 
141  virtual void releaseFontProvider(IFontProvider* provider)=0;
142 
143  virtual IImageProvider* createImageProvider(const char* mrl)=0;
144  virtual void releaseImageProvider(IImageProvider* provider)=0;
145 
146  virtual ISurface* createRenderedSurfaceFromImageFile(
147  const char* mrl)=0;
148 
149 
150  /* interfacing input */
151 
152  virtual IInputManager* getInputManager()=0;
153  virtual IEventBuffer* createEventBuffer()=0;
154 
155  virtual IInputEvent* createInputEvent(
156  void* event, const int symbol)=0;
157 
158  virtual IInputEvent* createApplicationEvent(int type, void* data)=0;
159  virtual int fromMBToGinga(int keyCode)=0;
160  virtual int fromGingaToMB(int keyCode)=0;
161 
162 
163  /* interfacing underlying multimedia system */
164 
165  virtual void* getGfxRoot()=0;
166  };
167 }
168 }
169 }
170 }
171 }
172 }
173 
174 typedef ::br::pucrio::telemidia::ginga::core::mb::IDeviceScreen*
175  ScreenCreator(
176  int numArgs, char** args,
177  GingaScreenID myId, GingaWindowID embedId,
178  bool externalRenderer);
179 
180 typedef void ScreenDestroyer(
182 
183 #endif /*IDEVICESCREEN_H_*/