24 |
Os::WindowSystem *ws; |
Os::WindowSystem *ws; |
25 |
using Util::ObjectStorer; |
using Util::ObjectStorer; |
26 |
using Os::Image; |
using Os::Image; |
|
using Os::Window; |
|
27 |
|
|
28 |
using Renderables::Renderable0; |
using Renderables::Renderable0; |
29 |
using Renderables::Renderable1; |
using Renderables::Renderable1; |
223 |
DBG(dbg) << "Creating new window for Java "<<x<<" "<<y<<" "<<w<<" "<<h<<"\n"; |
DBG(dbg) << "Creating new window for Java "<<x<<" "<<y<<" "<<w<<" "<<h<<"\n"; |
224 |
jobject ehglobal = env->NewGlobalRef(eh); |
jobject ehglobal = env->NewGlobalRef(eh); |
225 |
GZZJNIEventHandler *evh = new GZZJNIEventHandler(env, ehglobal); |
GZZJNIEventHandler *evh = new GZZJNIEventHandler(env, ehglobal); |
226 |
Window *win = ws->openWindow(x, y, w, h); |
Os::Window *win = ws->openWindow(x, y, w, h); |
227 |
DBG(dbg) << "Setting its eventhandler to "<<((int)evh)<<"\n"; |
DBG(dbg) << "Setting its eventhandler to "<<((int)evh)<<"\n"; |
228 |
win->setEventHandler(evh); |
win->setEventHandler(evh); |
229 |
DBG(dbg) << "Return to J\n"; |
DBG(dbg) << "Return to J\n"; |
242 |
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_repaintWindow |
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_repaintWindow |
243 |
(JNIEnv *env, jclass, jint id) { |
(JNIEnv *env, jclass, jint id) { |
244 |
DBG(dbg_event) << "RepaintWindow called\n"; |
DBG(dbg_event) << "RepaintWindow called\n"; |
245 |
Window *w = windows.get(id); |
Os::Window *w = windows.get(id); |
246 |
w->repaint(); |
w->repaint(); |
247 |
} |
} |
248 |
|
|
249 |
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_getWindowSize |
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_getWindowSize |
250 |
(JNIEnv *env, jclass, jint id, jobject rect) { |
(JNIEnv *env, jclass, jint id, jobject rect) { |
251 |
Window *win = windows.get(id); |
Os::Window *win = windows.get(id); |
252 |
int xywh[4]; |
int xywh[4]; |
253 |
win->getSize(xywh); |
win->getSize(xywh); |
254 |
|
|
268 |
|
|
269 |
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_addTimeoutWindow |
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_addTimeoutWindow |
270 |
(JNIEnv *env, jclass, jint id, jint ms, jint tid) { |
(JNIEnv *env, jclass, jint id, jint ms, jint tid) { |
271 |
Window *w = windows.get(id); |
Os::Window *w = windows.get(id); |
272 |
w->addTimeout(ms, tid); |
w->addTimeout(ms, tid); |
273 |
} |
} |
274 |
|
|
275 |
// ImageCache |
// ImageCache |
276 |
|
/* THIS DOES NOT COMPILE ON JDK 1.4 !!!!!! |
277 |
|
|
278 |
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_writeToImageCache |
JNIEXPORT void JNICALL Java_gzz_gfx_gl_GZZGL_writeToImageCache |
279 |
(JNIEnv *env, jclass cls, jstring juri, jcharArray jbuf, jint len) { |
(JNIEnv *env, jclass cls, jstring juri, jcharArray jbuf, jint len) { |
300 |
// pb = imageCache->getPixbuf(suri, lod); |
// pb = imageCache->getPixbuf(suri, lod); |
301 |
} |
} |
302 |
(*env)->ReleaseStringUTFChars(env, juri, uri); |
(*env)->ReleaseStringUTFChars(env, juri, uri); |
303 |
|
*/ |
304 |
|
|
305 |
// Image |
// Image |
306 |
|
|