Ginga  0.13.6
 All Classes Namespaces Functions Variables
TermWindow.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 TERMWINDOW_H_
51 #define TERMWINDOW_H_
52 
53 #include "util/IColor.h"
54 using namespace ::br::pucrio::telemidia::util;
55 
56 #include "mb/interface/IWindow.h"
57 
58 #include <iostream>
59 #include <vector>
60 using namespace std;
61 
62 namespace br {
63 namespace pucrio {
64 namespace telemidia {
65 namespace ginga {
66 namespace core {
67 namespace mb {
68  class TermWindow : public IWindow {
69  private:
70  void* win;
71 
72  GingaScreenID myScreen;
73  GingaWindowID windowId;
74  GingaWindowID parentId;
75  int x;
76  int y;
77  int width;
78  int height;
79  int r;
80  int g;
81  int b;
82  int alpha;
83  int transparencyValue;
84  bool visible;
85  bool ghost;
86 
87  ISurface* childSurface;
88  bool fit;
89  bool stretch;
90  int caps;
91 
92  pthread_mutex_t mutex;
93  pthread_mutex_t mutexC;
94 
95  public:
96  TermWindow(
97  GingaWindowID underlyingWindowID,
98  GingaWindowID parentWindowID,
99  GingaScreenID screenId,
100  int x, int y, int width, int height);
101 
102  virtual ~TermWindow();
103 
104  private:
105  void initialize(
106  GingaWindowID underlyingWindowID,
107  GingaWindowID parentWindowID,
108  GingaScreenID screenId,
109  int x, int y, int width, int height);
110 
111  public:
112  void setBgColor(int r, int g, int b, int alpha){};
113  IColor* getBgColor(){};
114  void setColorKey(int r, int g, int b){};
115  IColor* getColorKey(){};
116  void setWindowColor(int r, int g, int b, int alpha){};
117  IColor* getWindowColor(){};
118  void setBorder(int r, int g, int b, int alpha=255, int bWidth=0){};
119  void getBorder(int* r, int* g, int* b, int* alpha, int* bWidth){};
120 
121  GingaScreenID getScreen();
122  void revertContent();
123  void setChildSurface(ISurface* listener);
124  int getCap(string cap);
125  void setCaps(int caps);
126  void addCaps(int capability);
127  int getCaps();
128 
129  void draw();
130  void setBounds(int x, int y, int width, int height);
131  void moveTo(int x, int y);
132  void resize(int width, int height);
133  void raiseToTop();
134  void lowerToBottom();
135  void setCurrentTransparency(int alpha);
136  int getTransparencyValue();
137  GingaWindowID getId();
138  void show();
139  void hide();
140 
141  int getX();
142  int getY();
143  int getW();
144  int getH();
145  float getZ();
146 
147  void setX(int x);
148  void setY(int y);
149  void setW(int w);
150  void setH(int h);
151  void setZ(float z);
152 
153  void* getContent();
154  bool isGhostWndow() {return true;};
155  void setGhostWindow(bool ghost);
156  bool isVisible();
157  void validate();
158 
159  private:
160  void unprotectedValidate();
161 
162  public:
163  void setStretch(bool stretchTo);
164  bool getStretch();
165  void setFit(bool fitTo);
166  bool getFit();
167  void clearContent();
168 
169  private:
170  bool isMine(ISurface* surface);
171 
172  public:
173  void renderImgFile(string serializedImageUrl);
174  void renderFrom(ISurface* s);
175  void blit(IWindow* src);
176  void stretchBlit(IWindow* src);
177  string getDumpFileUri(int quality, int dumpW, int dumpH);
178  void lock();
179  void unlock();
180  void lockChilds();
181  void unlockChilds();
182  };
183 }
184 }
185 }
186 }
187 }
188 }
189 
190 #endif /*TERMWINDOW_H_*/
Definition: IColor.h:64