From e5ab975727134d8249277f4df707b2b14a7788f3 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Sun, 25 Sep 2011 04:38:59 +0200
Subject: NEWT/JOGL: MacOSX Update

Feature related:

- Added always-on-top

- Added translucency

- Child Window Position

  - AWT parent: manual traverse up the tree and calc position on screen
    (Problem: the parent view rect is not at the proper position,
     but covers the whole frame)

EDTUtil related:

- Works now w/ AWT ot headless (again)

- OSX native JNI callbacks gathering JNIEnv properly
  and attaches/detaches thread.

- AWT case: using AWT-Event which properly dispatches our cocoa events

- MainThread (headless) case: Fork off thread w/ main class
  and kick off NSApp run().
  This leads to same behavior as w/ AWT case.

- Using DefaultEDTUtil

- Cleanup MainThread (implements EDTUtil)
  - Currently not used as EDTUtil (osx), just as launcher
  - Removed EDTUtil impl code, reuse DefaultEDTUtil

- Cleanup AWTEDTUtil (implements EDTUtil)
  - Currently not used as EDTUtil (osx)
---
 src/newt/native/NewtMacWindow.h | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

(limited to 'src/newt/native/NewtMacWindow.h')

diff --git a/src/newt/native/NewtMacWindow.h b/src/newt/native/NewtMacWindow.h
index 7f0cd60c6..a8931d6fc 100644
--- a/src/newt/native/NewtMacWindow.h
+++ b/src/newt/native/NewtMacWindow.h
@@ -34,23 +34,41 @@
 #import <AppKit/AppKit.h>
 #import "jni.h"
 
+#include "NewtCommon.h"
+
+// #define VERBOSE_ON 1
+
+#ifdef VERBOSE_ON
+    #define DBG_PRINT(...) fprintf(stderr, __VA_ARGS__); fflush(stderr) 
+#else
+    #define DBG_PRINT(...)
+#endif
+
 @interface NewtView : NSView
 {
     jobject javaWindowObject;
 
     // This is set while messages are being dispatched and cleared afterward
-    JNIEnv* env;
+    JavaVM *jvmHandle;
+    int jvmVersion;
+
+    BOOL destroyNotifySent;
 }
 
 /* Set during event dispatching cycle */
-- (void) setJNIEnv: (JNIEnv*) env;
-- (JNIEnv*) getJNIEnv;
+- (void) setJVMHandle: (JavaVM*) vm;
+- (JavaVM*) getJVMHandle;
+- (void) setJVMVersion: (int) ver;
+- (int) getJVMVersion;
 
 /* Register or deregister (NULL) the java Window object, 
    ie, if NULL, no events are send */
 - (void) setJavaWindowObject: (jobject) javaWindowObj;
 - (jobject) getJavaWindowObject;
 
+- (void) setDestroyNotifySent: (BOOL) v;
+- (BOOL) getDestroyNotifySent;
+
 - (void) rightMouseDown: (NSEvent*) theEvent;
 
 @end
-- 
cgit v1.2.3