50 #ifndef BerkeliumHandler_h_
51 #define BerkeliumHandler_h_
53 #include "mb/IInputManager.h"
54 #include "mb/interface/CodeMap.h"
55 #include "mb/interface/IWindow.h"
56 #include "mb/interface/IInputEventListener.h"
58 #include "mb/ILocalScreenManager.h"
59 #include "mb/interface/IWindow.h"
60 using namespace ::br::pucrio::telemidia::ginga::core::mb;
62 #include "system/thread/Thread.h"
63 using namespace ::br::pucrio::telemidia::ginga::core::system::thread;
65 #include "berkelium/Berkelium.hpp"
66 #include "berkelium/Window.hpp"
67 #include "berkelium/WindowDelegate.hpp"
68 #include "berkelium/Context.hpp"
71 #include <sys/types.h>
76 using namespace Berkelium;
85 public WindowDelegate,
86 public IInputEventListener,
87 public IMotionEventListener {
90 static map<int, int> fromGingaToBklm;
92 ILocalScreenManager* dm;
93 GingaScreenID myScreen;
100 std::auto_ptr<Window> bWindow;
106 static int callCount;
107 bool needs_full_refresh;
108 unsigned char* scroll_buffer;
110 pthread_mutex_t sMutex;
114 GingaScreenID myScreen,
int x,
int y,
int w,
int h);
123 void setKeyHandler(
bool handler);
125 void setContext(Context* context);
126 void setWindow(std::auto_ptr<Window> window);
127 void getSize(
int* w,
int* h);
128 void setBounds(
int x,
int y,
int w,
int h);
129 void setUrl(
string url);
131 ISurface* getSurface();
135 bool userEventReceived(IInputEvent* ev);
136 bool motionEventReceived(
int x,
int y,
int z);
138 virtual void onAddressBarChanged(Window *win, URLString newURL);
139 virtual void onStartLoading(Window *win, URLString newURL);
140 void onLoadingStateChanged(Window *win,
bool isLoading);
141 virtual void onLoad(Window *win);
142 virtual void onLoadError(Window *win, WideString error);
143 virtual void onResponsive(Window *win);
144 virtual void onUnresponsive(Window *win);
147 bool mapOnPaintToTexture(
148 Berkelium::Window *wini,
149 const unsigned char* bitmap_in,
const Berkelium::Rect& bitmap_rect,
150 size_t num_copy_rects,
const Berkelium::Rect *copy_rects,
152 const Berkelium::Rect& scroll_rect,
153 unsigned int dest_texture_width,
154 unsigned int dest_texture_height,
156 unsigned char* scroll_buffer);
158 ISurface* createRenderedSurface(
string fileName);
161 const unsigned char *sourceBuffer,
162 int width,
int height);
165 virtual void onPaint(
167 const unsigned char *bitmap_in,
168 const Rect &bitmap_rect,
169 size_t num_copy_rects,
170 const Rect *copy_rects,
173 const Rect &scroll_rect);
175 virtual void onCrashed(Window *win);
176 virtual void onCreatedWindow(
177 Window *win, Window *newWindow,
const Rect &initialRect);
178 virtual void onExternalHost(
184 virtual void onPaintPluginTexture(
186 void* sourceGLTexture,
187 const std::vector<Rect> srcRects,
188 const Rect &destRect);
190 virtual void onWidgetCreated(
191 Window *win, Widget *newWidget,
int zIndex);
193 virtual void onWidgetDestroyed(Window *win, Widget *newWidget);
195 virtual void onWidgetResize(
196 Window *win, Widget *wid,
int newWidth,
int newHeight);
198 virtual void onWidgetMove(Window *win, Widget *wid,
int newX,
int newY);
200 virtual void onWidgetPaint(
203 const unsigned char *sourceBuffer,
205 size_t num_copy_rects,
206 const Rect *copy_rects,
209 const Rect &scrollRect);
Definition: BerkeliumHandler.h:84