aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/native
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-09-12 12:32:44 -0700
committerSven Gothel <[email protected]>2009-09-12 12:32:44 -0700
commit3cc7335e94df9daaab5250487b9f03e19aaa292a (patch)
tree942e6dd5d8bac2499c49c3e9b9910f8b84b5ed42 /src/newt/native
parentf6541cee3b33bd6ad5a94e89d860b4431cf2a353 (diff)
NEWT: Basic/Naive window parenting support ; NEWT GLWindow: remove ambigous create functions, ie with Window and Capabilities arguments
Diffstat (limited to 'src/newt/native')
-rw-r--r--src/newt/native/MacWindow.m10
-rwxr-xr-xsrc/newt/native/WindowsWindow.c6
-rwxr-xr-xsrc/newt/native/X11Window.c10
3 files changed, 17 insertions, 9 deletions
diff --git a/src/newt/native/MacWindow.m b/src/newt/native/MacWindow.m
index a93157c3f..d59a61e42 100644
--- a/src/newt/native/MacWindow.m
+++ b/src/newt/native/MacWindow.m
@@ -237,10 +237,10 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_initIDs
/*
* Class: com_sun_javafx_newt_macosx_MacWindow
* Method: createWindow0
- * Signature: (IIIIZIIIJ)J
+ * Signature: (JIIIIZIIIJ)J
*/
JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_createWindow0
- (JNIEnv *env, jobject jthis, jint x, jint y, jint w, jint h, jboolean fullscreen, jint styleMask,
+ (JNIEnv *env, jobject jthis, jlong parent, jint x, jint y, jint w, jint h, jboolean fullscreen, jint styleMask,
jint bufferingType, jint screen_idx, jlong jview)
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -264,6 +264,12 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_createWindow0
backing: (NSBackingStoreType) bufferingType
screen: screen] retain];
+ /** FIXME: test ..
+ NSWindow* parentWindow = (NSWindow*) ((intptr_t) parent);
+ if(NULL!=parentWindow) {
+ [window setParentWindow: parentWindow];
+ } */
+
if (fullscreen) {
[window setOpaque: YES];
} else {
diff --git a/src/newt/native/WindowsWindow.c b/src/newt/native/WindowsWindow.c
index edc3f0796..a171f34b2 100755
--- a/src/newt/native/WindowsWindow.c
+++ b/src/newt/native/WindowsWindow.c
@@ -1032,10 +1032,10 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_initID
/*
* Class: com_sun_javafx_newt_windows_WindowsWindow
* Method: CreateWindow
- * Signature: (ILjava/lang/String;JJZIIII)J
+ * Signature: (JILjava/lang/String;JJZIIII)J
*/
JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_CreateWindow
- (JNIEnv *env, jobject obj, jint wndClassAtom, jstring jWndName, jlong hInstance, jlong visualID,
+ (JNIEnv *env, jobject obj, jlong parent, jint wndClassAtom, jstring jWndName, jlong hInstance, jlong visualID,
jboolean bIsUndecorated,
jint jx, jint jy, jint defaultWidth, jint defaultHeight)
{
@@ -1063,7 +1063,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_CreateWin
window = CreateWindow(MAKEINTATOM(wndClassAtom), wndName, windowStyle,
x, y, width, height,
- NULL, NULL,
+ (HWND)parent, NULL,
(HINSTANCE) hInstance,
NULL);
diff --git a/src/newt/native/X11Window.c b/src/newt/native/X11Window.c
index 8651a8cea..1e7cd3bba 100755
--- a/src/newt/native/X11Window.c
+++ b/src/newt/native/X11Window.c
@@ -511,17 +511,17 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_x11_X11Window_initIDs
/*
* Class: com_sun_javafx_newt_x11_X11Window
* Method: CreateWindow
- * Signature: (JIJIIII)J
+ * Signature: (JJIJIIII)J
*/
JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_x11_X11Window_CreateWindow
- (JNIEnv *env, jobject obj, jlong display, jint screen_index,
+ (JNIEnv *env, jobject obj, jlong parent, jlong display, jint screen_index,
jlong visualID,
jlong javaObjectAtom, jlong windowDeleteAtom,
jint x, jint y, jint width, jint height)
{
Display * dpy = (Display *)(intptr_t)display;
int scrn_idx = (int)screen_index;
- Window windowParent = 0;
+ Window windowParent = (Window) parent;
Window window = 0;
XVisualInfo visualTemplate;
@@ -578,7 +578,9 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_x11_X11Window_CreateWindow
pVisualQuery=NULL;
}
- windowParent = XRootWindowOfScreen(scrn);
+ if(NULL==windowParent) {
+ windowParent = XRootWindowOfScreen(scrn);
+ }
attrMask = (CWBackPixel | CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect) ;