diff options
author | Sven Gothel <[email protected]> | 2009-09-12 22:21:04 -0700 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2009-09-12 22:21:04 -0700 |
commit | fa2e6727aaf8d3eb1bc42698f69decc86eaecc44 (patch) | |
tree | aa2e39e5a4dfafbe8b8c7ec5c278526853315261 /src/newt | |
parent | 3ddb06e50c0f841f2f66fb93e1ec41cddd50895e (diff) |
Newt: MacOSX child clipping tests (failed)
Diffstat (limited to 'src/newt')
-rwxr-xr-x | src/newt/classes/com/sun/javafx/newt/macosx/MacWindow.java | 4 | ||||
-rw-r--r-- | src/newt/native/MacWindow.m | 19 | ||||
-rwxr-xr-x | src/newt/native/NewtMacWindow.m | 8 |
3 files changed, 25 insertions, 6 deletions
diff --git a/src/newt/classes/com/sun/javafx/newt/macosx/MacWindow.java b/src/newt/classes/com/sun/javafx/newt/macosx/MacWindow.java index 277aec796..9f501ac9b 100755 --- a/src/newt/classes/com/sun/javafx/newt/macosx/MacWindow.java +++ b/src/newt/classes/com/sun/javafx/newt/macosx/MacWindow.java @@ -555,7 +555,7 @@ public class MacWindow extends Window { } if(0!=windowHandle) { // save the view .. close the window - surfaceHandle = changeContentView(windowHandle, 0); + surfaceHandle = changeContentView(parentWindowHandle, windowHandle, 0); if(recreate && 0==surfaceHandle) { throw new NativeWindowException("Internal Error - recreate, window but no view"); } @@ -594,7 +594,7 @@ public class MacWindow extends Window { private native void close0(long window); private native void setTitle0(long window, String title); private native long contentView(long window); - private native long changeContentView(long window, long view); + private native long changeContentView(long parentWindowHandle, long window, long view); private native void setContentSize(long window, int w, int h); private native void setFrameTopLeftPoint(long parentWindowHandle, long window, int x, int y); } diff --git a/src/newt/native/MacWindow.m b/src/newt/native/MacWindow.m index d862ca392..1749805c8 100644 --- a/src/newt/native/MacWindow.m +++ b/src/newt/native/MacWindow.m @@ -76,7 +76,7 @@ void setFrameTopLeftPoint(NSWindow* pwin, NSWindow* win, jint x, jint y) [win setFrameTopLeftPoint: pt]; } -static NewtView * changeContentView(JNIEnv *env, jobject javaWindowObject, NSWindow *win, NewtView *newView) { +static NewtView * changeContentView(JNIEnv *env, jobject javaWindowObject, NSWindow *pwin, NSWindow *win, NewtView *newView) { NSView* oldNSView = [win contentView]; NewtView* oldView = NULL; @@ -95,11 +95,21 @@ NS_ENDHANDLER (*env)->DeleteGlobalRef(env, globJavaWindowObject); [oldView setJavaWindowObject: NULL]; } + /** FIXME: Tried child window: auto clip or message reception .. + if(NULL!=pwin) { + [oldView removeFromSuperview]; + } */ } if(NULL!=newView) { jobject globJavaWindowObject = (*env)->NewGlobalRef(env, javaWindowObject); [newView setJavaWindowObject: globJavaWindowObject]; [newView setJNIEnv: env]; + + /** FIXME: Tried child window: auto clip or message reception .. + if(NULL!=pwin) { + NSView* pview = [pwin contentView]; + [pview addSubview: newView]; + } */ } [win setContentView: newView]; @@ -304,7 +314,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_createWindow0 NewtView* view = (0==jview)? [[NewtView alloc] initWithFrame: rect] : (NewtView*) ((intptr_t) jview) ; // Set the content view - (void) changeContentView(env, jthis, window, view); + (void) changeContentView(env, jthis, parentWindow, window, view); NS_DURING // Available >= 10.5 - Makes the menubar disapear @@ -427,13 +437,14 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_contentView * Signature: (J)J */ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_changeContentView - (JNIEnv *env, jobject jthis, jlong window, jlong jview) + (JNIEnv *env, jobject jthis, jlong parent, jlong window, jlong jview) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; + NSWindow* pwin = (NewtMacWindow*) ((intptr_t) parent); NSWindow* win = (NewtMacWindow*) ((intptr_t) window); NewtView* newView = (NewtView *) ((intptr_t) jview); - NewtView* oldView = changeContentView(env, jthis, win, newView); + NewtView* oldView = changeContentView(env, jthis, pwin, win, newView); [pool release]; diff --git a/src/newt/native/NewtMacWindow.m b/src/newt/native/NewtMacWindow.m index 1c1aecc47..146c04de1 100755 --- a/src/newt/native/NewtMacWindow.m +++ b/src/newt/native/NewtMacWindow.m @@ -99,6 +99,14 @@ jint GetDeltaY(NSEvent *event, jint javaMods) { [next rightMouseDown: theEvent]; } } + +/** FIXME: Tried child window: message reception .. +- (void)viewWillDraw +{ + fprintf(stderr, "*************** viewWillDraw: 0x%p", javaWindowObject); fflush(stderr); + [super viewWillDraw]; +} */ + @end static jmethodID sendMouseEventID = NULL; |