aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/native
diff options
context:
space:
mode:
Diffstat (limited to 'src/newt/native')
-rw-r--r--src/newt/native/MacWindow.m73
-rw-r--r--src/newt/native/NewtMacWindow.h4
-rw-r--r--src/newt/native/NewtMacWindow.m41
-rw-r--r--src/newt/native/WindowsWindow.c115
-rw-r--r--src/newt/native/X11Display.c52
-rw-r--r--src/newt/native/X11Window.c35
6 files changed, 305 insertions, 15 deletions
diff --git a/src/newt/native/MacWindow.m b/src/newt/native/MacWindow.m
index 30d3458ad..16e9814ef 100644
--- a/src/newt/native/MacWindow.m
+++ b/src/newt/native/MacWindow.m
@@ -285,6 +285,76 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_macosx_DisplayDriver_stopNSApplic
[pool release];
}
+static NSImage * createNSImageFromData(JNIEnv *env, jobject jiconData, jint jiconWidth, jint jiconHeight) {
+ if( NULL != jiconData ) {
+ unsigned char * iconData = (unsigned char *) (*env)->GetDirectBufferAddress(env, jiconData);
+ NSInteger iconWidth = (NSInteger) jiconWidth;
+ NSInteger iconHeight = (NSInteger) jiconHeight;
+ const NSInteger bpc = 8 /* bits per component */, spp=4 /* RGBA */, bpp = bpc * spp;
+ const NSBitmapFormat bfmt = NSAlphaNonpremultipliedBitmapFormat;
+ const BOOL hasAlpha = YES;
+
+ NSBitmapImageRep* bir = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: &iconData
+ pixelsWide: iconWidth
+ pixelsHigh: iconHeight
+ bitsPerSample: bpc
+ samplesPerPixel: spp
+ hasAlpha: hasAlpha
+ isPlanar: NO
+ colorSpaceName: NSCalibratedRGBColorSpace
+ bitmapFormat: bfmt
+ bytesPerRow: iconWidth*4
+ bitsPerPixel: bpp];
+ [bir autorelease];
+ NSImage* nsImage = [[NSImage alloc] initWithCGImage: [bir CGImage] size:NSZeroSize];
+ return nsImage;
+ }
+ return NULL;
+}
+
+/*
+ * Class: jogamp_newt_driver_macosx_DisplayDriver
+ * Method: setAppIcon0
+ */
+JNIEXPORT void JNICALL Java_jogamp_newt_driver_macosx_DisplayDriver_setAppIcon0
+ (JNIEnv *env, jobject unused, jobject jiconData, jint jiconWidth, jint jiconHeight)
+{
+ NSImage * nsImage = createNSImageFromData(env, jiconData, jiconWidth, jiconHeight);
+ if( NULL != nsImage ) {
+ [nsImage autorelease];
+ [NSApp setApplicationIconImage: nsImage];
+ }
+}
+
+JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_macosx_DisplayDriver_createPointerIcon0
+ (JNIEnv *env, jobject unused, jobject jiconData, jint jiconWidth, jint jiconHeight, jint hotX, jint hotY)
+{
+ NSImage * nsImage = createNSImageFromData(env, jiconData, jiconWidth, jiconHeight);
+ if( NULL != nsImage ) {
+ [nsImage autorelease];
+ NSPoint hotP = { hotX, hotY };
+ NSCursor * c = [[NSCursor alloc] initWithImage: nsImage hotSpot: hotP];
+ return (jlong) (intptr_t) c;
+ }
+ return 0;
+}
+
+JNIEXPORT void JNICALL Java_jogamp_newt_driver_macosx_DisplayDriver_destroyPointerIcon0
+ (JNIEnv *env, jobject unused, jlong handle)
+{
+ NSCursor * c = (NSCursor*) (intptr_t) handle ;
+ [c release];
+}
+
+JNIEXPORT void JNICALL Java_jogamp_newt_driver_macosx_WindowDriver_setPointerIcon0
+ (JNIEnv *env, jobject unused, jlong window, jlong handle)
+{
+ NewtMacWindow *mWin = (NewtMacWindow*) (intptr_t) window;
+ NSCursor * c = (NSCursor*) (intptr_t) handle ;
+
+ [mWin setCustomCursor: c];
+}
+
static NSScreen * NewtScreen_getNSScreenByIndex(int screen_idx, BOOL cap) {
NSArray *screens = [NSScreen screens];
if( screen_idx<0 || screen_idx>=[screens count] ) {
@@ -632,7 +702,7 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_macosx_WindowDriver_createView0
[pool release];
- return (jlong) ((intptr_t) myView);
+ return (jlong) (intptr_t) myView;
}
/**
@@ -674,7 +744,6 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_macosx_WindowDriver_createWindow
backing: (NSBackingStoreType) bufferingType
defer: YES
isFullscreenWindow: fullscreen];
-
// DBG_PRINT( "createWindow0.1 - %p, isVisible %d\n", myWindow, [myWindow isVisible]);
DBG_PRINT( "createWindow0.X - %p, isVisible %d\n", myWindow, [myWindow isVisible]);
diff --git a/src/newt/native/NewtMacWindow.h b/src/newt/native/NewtMacWindow.h
index ba60b5665..1f907f30e 100644
--- a/src/newt/native/NewtMacWindow.h
+++ b/src/newt/native/NewtMacWindow.h
@@ -114,6 +114,7 @@
BOOL mouseVisible;
BOOL mouseInside;
BOOL cursorIsHidden;
+ NSCursor * customCursor;
BOOL realized;
BOOL modsDown[4]; // shift, ctrl, alt/option, win/command
NSPoint lastInsideMousePosition;
@@ -151,7 +152,8 @@
- (NSPoint) screenPos2NewtClientWinPos: (NSPoint) p;
- (BOOL) isMouseInside;
-- (void) cursorHide:(BOOL)v;
+- (void) cursorHide:(BOOL)v enter:(int)enterState;
+- (void) setCustomCursor:(NSCursor*)c;
- (void) setMouseVisible:(BOOL)v hasFocus:(BOOL)focus;
- (void) setMouseConfined:(BOOL)v;
- (void) setMousePosition:(NSPoint)p;
diff --git a/src/newt/native/NewtMacWindow.m b/src/newt/native/NewtMacWindow.m
index 4b0198c7e..a7bab9b9d 100644
--- a/src/newt/native/NewtMacWindow.m
+++ b/src/newt/native/NewtMacWindow.m
@@ -41,6 +41,8 @@
#include <math.h>
+#define PRINTF(...) NSLog(@ __VA_ARGS__)
+
static jfloat GetDelta(NSEvent *event, jint javaMods[]) {
CGEventRef cgEvent = [event CGEvent];
CGFloat deltaY = 0.0;
@@ -468,6 +470,7 @@ static UniChar CKCH_CharForKeyCode(jshort keyCode) {
defaultPresentationOptions = 0;
fullscreenPresentationOptions = 0;
}
+
isFullscreenWindow = isfs;
// Why is this necessary? Without it we don't get any of the
// delegate methods like resizing and window movement.
@@ -484,6 +487,7 @@ static UniChar CKCH_CharForKeyCode(jshort keyCode) {
mouseVisible = YES;
mouseInside = NO;
cursorIsHidden = NO;
+ customCursor = NULL;
realized = YES;
DBG_PRINT("NewtWindow::create: %p, realized %d, hasPresentationSwitch %d[defaultOptions 0x%X, fullscreenOptions 0x%X], (refcnt %d)\n",
res, realized, (int)hasPresentationSwitch, (int)defaultPresentationOptions, (int)fullscreenPresentationOptions, (int)[res retainCount]);
@@ -678,13 +682,36 @@ static UniChar CKCH_CharForKeyCode(jshort keyCode) {
DBG_PRINT( "setMouseVisible: confined %d, visible %d (current: %d), mouseInside %d, hasFocus %d\n",
mouseConfined, mouseVisible, !cursorIsHidden, mouseInside, focus);
if(YES == focus && YES == mouseInside) {
- [self cursorHide: !mouseVisible];
+ [self cursorHide: !mouseVisible enter: 0];
+ }
+}
+
+- (void) setCustomCursor:(NSCursor*)c
+{
+ if(YES == mouseInside) {
+ if( NULL != c ) {
+ DBG_PRINT( "setCustomCursor push: %p\n", c);
+ [c push];
+ } else if( NULL != customCursor && [NSCursor currentCursor] == customCursor ) {
+ DBG_PRINT( "setCustomCursor pop: %p\n", customCursor);
+ [customCursor pop];
+ }
}
+ customCursor = c;
}
-- (void) cursorHide:(BOOL)v
+- (void) cursorHide:(BOOL)v enter:(int)enterState
{
- DBG_PRINT( "cursorHide: %d -> %d\n", cursorIsHidden, v);
+ DBG_PRINT( "cursorHide: %d -> %d, enter %d\n", cursorIsHidden, v, enterState);
+ if( NULL != customCursor ) {
+ if( 1 == enterState && [NSCursor currentCursor] != customCursor ) {
+ DBG_PRINT( "cursorHide.customCursor push: %p\n", customCursor);
+ [customCursor push];
+ } else if( -1 == enterState && [NSCursor currentCursor] == customCursor ) {
+ DBG_PRINT( "cursorHide.customCursor pop: %p\n", customCursor);
+ [customCursor pop];
+ }
+ }
if(v) {
if(!cursorIsHidden) {
[NSCursor hide];
@@ -941,7 +968,7 @@ static jint mods2JavaMods(NSUInteger mods)
DBG_PRINT( "*************** windowDidBecomeKey\n");
mouseInside = [self isMouseInside];
if(YES == mouseInside) {
- [self cursorHide: !mouseVisible];
+ [self cursorHide: !mouseVisible enter: 0];
}
[self focusChanged: YES];
}
@@ -995,7 +1022,7 @@ static jint mods2JavaMods(NSUInteger mods)
{
DBG_PRINT( "mouseEntered: confined %d, visible %d\n", mouseConfined, mouseVisible);
mouseInside = YES;
- [self cursorHide: !mouseVisible];
+ [self cursorHide: !mouseVisible enter: 1];
if(NO == mouseConfined) {
[self sendMouseEvent: theEvent eventType: EVENT_MOUSE_ENTERED];
}
@@ -1006,7 +1033,7 @@ static jint mods2JavaMods(NSUInteger mods)
DBG_PRINT( "mouseExited: confined %d, visible %d\n", mouseConfined, mouseVisible);
if(NO == mouseConfined) {
mouseInside = NO;
- [self cursorHide: NO];
+ [self cursorHide: NO enter: -1];
[self sendMouseEvent: theEvent eventType: EVENT_MOUSE_EXITED];
} else {
[self setMousePosition: lastInsideMousePosition];
@@ -1160,7 +1187,7 @@ static jint mods2JavaMods(NSUInteger mods)
jboolean closed = JNI_FALSE;
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
- [self cursorHide: NO];
+ [self cursorHide: NO enter: -1];
NSView* nsview = [self contentView];
if( ! [nsview isKindOfClass:[NewtView class]] ) {
diff --git a/src/newt/native/WindowsWindow.c b/src/newt/native/WindowsWindow.c
index dd0150e78..2a16dce57 100644
--- a/src/newt/native/WindowsWindow.c
+++ b/src/newt/native/WindowsWindow.c
@@ -139,7 +139,7 @@
#include "NewtCommon.h"
-// #define VERBOSE_ON 1
+#define VERBOSE_ON 1
// #define DEBUG_KEYS 1
#ifdef VERBOSE_ON
@@ -186,6 +186,10 @@ typedef struct {
int height;
/** Tristate: -1 HIDE, 0 NOP, 1 SHOW */
int setPointerVisible;
+ /** Tristate: -1 RESET, 0 NOP, 1 SET-NEW */
+ int setPointerAction;
+ HCURSOR setPointerHandle;
+ HCURSOR defPointerHandle;
/** Bool: 0 NOP, 1 FULLSCREEN */
int setFullscreen;
int pointerCaptured;
@@ -1023,10 +1027,22 @@ static LRESULT CALLBACK wndProc(HWND wnd, UINT message, WPARAM wParam, LPARAM lP
} else /* -1 == wud->setPointerVisible */ {
visibilityChangeSuccessful = SafeShowCursor(FALSE);
}
- useDefWindowProc = visibilityChangeSuccessful ? 1 : 0;
DBG_PRINT("*** WindowsWindow: WM_SETCURSOR requested visibility: %d success: %d\n", wud->setPointerVisible, visibilityChangeSuccessful);
wud->setPointerVisible = 0;
- // own signal, consumed
+ // own signal, consumed, no further processing
+ useDefWindowProc = 0;
+ res = 1;
+ } else if( 0 != wud->setPointerAction ) {
+ if( -1 == wud->setPointerAction ) {
+ wud->setPointerHandle = wud->defPointerHandle;
+ }
+ HCURSOR preHandle = SetCursor(wud->setPointerHandle);
+ DBG_PRINT("*** WindowsWindow: WM_SETCURSOR requested change %d: pre %p -> set %p, def %p\n",
+ wud->setPointerAction, (void*)preHandle, (void*)wud->setPointerHandle, (void*)wud->defPointerHandle);
+ wud->setPointerAction = 0;
+ // own signal, consumed, no further processing
+ useDefWindowProc = 0;
+ res = 1;
} else {
useDefWindowProc = 1; // NOP for us, allow parent to act
}
@@ -1246,6 +1262,7 @@ static LRESULT CALLBACK wndProc(HWND wnd, UINT message, WPARAM wParam, LPARAM lP
if( 0 == wud->pointerInside ) {
wud->pointerInside = 1;
NewtWindows_trackPointerLeave(wnd);
+ SetCursor(wud->setPointerHandle);
}
(*env)->CallVoidMethod(env, window, sendMouseEventID,
(jshort) EVENT_MOUSE_MOVED,
@@ -1997,7 +2014,8 @@ static void NewtWindow_setVisiblePosSize(HWND hwnd, BOOL atop, BOOL visible,
JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_windows_WindowDriver_CreateWindow0
(JNIEnv *env, jobject obj,
jlong hInstance, jstring jWndClassName, jstring jWndName, jint winMajor, jint winMinor,
- jlong parent, jint jx, jint jy, jint defaultWidth, jint defaultHeight, jboolean autoPosition, jint flags)
+ jlong parent, jint jx, jint jy, jint defaultWidth, jint defaultHeight, jboolean autoPosition, jint flags,
+ jlong iconSmallHandle, jlong iconBigHandle)
{
HWND parentWindow = (HWND) (intptr_t) parent;
const TCHAR* wndClassName = NULL;
@@ -2054,6 +2072,9 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_windows_WindowDriver_CreateWindo
wud->width = width;
wud->height = height;
wud->setPointerVisible = 0;
+ wud->setPointerAction = 0;
+ wud->defPointerHandle = LoadCursor( NULL, IDC_ARROW);
+ wud->setPointerHandle = wud->defPointerHandle;
wud->setFullscreen = 0;
wud->pointerCaptured = 0;
wud->pointerInside = 0;
@@ -2083,6 +2104,12 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_windows_WindowDriver_CreateWindo
RECT rc;
RECT * insets;
+ if( 0 != iconSmallHandle ) {
+ SendMessage(window, WM_SETICON, ICON_SMALL, (LPARAM) iconSmallHandle );
+ }
+ if( 0 != iconBigHandle ) {
+ SendMessage(window, WM_SETICON, ICON_BIG, (LPARAM) iconBigHandle );
+ }
ShowWindow(window, SW_SHOW);
// send insets before visibility, allowing java code a proper sync point!
@@ -2321,3 +2348,83 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_windows_WindowDriver_warpPointer0
SetCursorPos(x, y);
}
+JNIEXPORT jlong JNICALL
+Java_jogamp_newt_driver_windows_DisplayDriver_createBGRA8888Icon0(JNIEnv *env, jobject _unused,
+ jobject data, jint data_offset, jint width, jint height, jboolean isCursor, jint hotX, jint hotY) {
+
+ const unsigned char * data_ptr = (const unsigned char *) (*env)->GetDirectBufferAddress(env, data) + data_offset;
+ const int bytes = 4 * width * height; // BGRA8888
+
+ DWORD dwWidth, dwHeight;
+ BITMAPV5HEADER bi;
+ HBITMAP hBitmap;
+ void *lpBits;
+ HICON handle = NULL;
+
+ dwWidth = width; // width of cursor
+ dwHeight = height; // height of cursor
+
+ ZeroMemory(&bi,sizeof(BITMAPV5HEADER));
+ bi.bV5Size = sizeof(BITMAPV5HEADER);
+ bi.bV5Width = dwWidth;
+ bi.bV5Height = -1 * dwHeight;
+ bi.bV5Planes = 1;
+ bi.bV5BitCount = 32;
+ bi.bV5Compression = BI_BITFIELDS;
+ // The following mask specification specifies a supported 32 BPP
+ // alpha format for Windows XP.
+ bi.bV5RedMask = 0x00FF0000;
+ bi.bV5GreenMask = 0x0000FF00;
+ bi.bV5BlueMask = 0x000000FF;
+ bi.bV5AlphaMask = 0xFF000000;
+
+ HDC hdc;
+ hdc = GetDC(NULL);
+
+ // Create the DIB section with an alpha channel.
+ hBitmap = CreateDIBSection(hdc, (BITMAPINFO *)&bi, DIB_RGB_COLORS,
+ (void **)&lpBits, NULL, (DWORD)0);
+
+ memcpy(lpBits, data_ptr, bytes);
+
+ ReleaseDC(NULL,hdc);
+
+ // Create an empty mask bitmap.
+ HBITMAP hMonoBitmap = CreateBitmap(dwWidth,dwHeight,1,1,NULL);
+
+ ICONINFO ii;
+ ii.fIcon = isCursor ? FALSE : TRUE;
+ ii.xHotspot = hotX;
+ ii.yHotspot = hotY;
+ ii.hbmMask = hMonoBitmap;
+ ii.hbmColor = hBitmap;
+
+ // Create the alpha cursor with the alpha DIB section.
+ handle = CreateIconIndirect(&ii);
+
+ DeleteObject(hBitmap);
+ DeleteObject(hMonoBitmap);
+
+ return (jlong) (intptr_t) handle;
+}
+
+JNIEXPORT void JNICALL
+Java_jogamp_newt_driver_windows_DisplayDriver_destroyIcon0(JNIEnv *env, jobject _unused, jlong jhandle) {
+ HICON handle = (HICON) (intptr_t) jhandle;
+ DestroyIcon(handle);
+}
+
+JNIEXPORT void JNICALL
+Java_jogamp_newt_driver_windows_WindowDriver_setPointerIcon0(JNIEnv *env, jobject _unused, jlong window, jlong iconHandle) {
+ HWND hwnd = (HWND) (intptr_t) window;
+ WindowUserData * wud;
+#if !defined(__MINGW64__) && ( defined(UNDER_CE) || _MSC_VER <= 1200 )
+ wud = (WindowUserData *) GetWindowLong(hwnd, GWL_USERDATA);
+#else
+ wud = (WindowUserData *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
+#endif
+ wud->setPointerAction = 0 != iconHandle ? 1 : -1;
+ wud->setPointerHandle = (HCURSOR) (intptr_t) iconHandle;
+ SendMessage(hwnd, WM_SETCURSOR, 0, 0);
+}
+
diff --git a/src/newt/native/X11Display.c b/src/newt/native/X11Display.c
index e2392a113..19e733111 100644
--- a/src/newt/native/X11Display.c
+++ b/src/newt/native/X11Display.c
@@ -28,6 +28,8 @@
#include "X11Common.h"
+#include <X11/Xcursor/Xcursor.h>
+
// #include <X11/XKBlib.h> // XKB disabled for now
jclass X11NewtWindowClazz = NULL;
@@ -670,4 +672,54 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_x11_DisplayDriver_DispatchMessage
}
}
+/*
+ * Class: Java_jogamp_newt_driver_x11_DisplayDriver
+ * Method: createPointerIcon0
+ * Signature: (JJILjava/lang/Object;I)V
+ */
+JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_x11_DisplayDriver_createPointerIcon0
+ (JNIEnv *env, jclass clazz, jlong display, jobject data, jint data_offset, jint width, jint height, jint hotX, jint hotY)
+{
+ Cursor c;
+
+ if( 0 != data ) {
+ Display * dpy = (Display *) (intptr_t) display;
+ char * data_ptr = (char *) (*env)->GetDirectBufferAddress(env, data) + data_offset;
+ XcursorImage ci;
+ ci.version = 1; // XCURSOR_IMAGE_VERSION;
+ ci.size = width; // nominal size (assume square ..)
+ ci.width = width;
+ ci.height = height;
+ ci.xhot = hotX;
+ ci.yhot = hotY;
+ ci.delay = 0;
+ ci.pixels = (XcursorPixel *)(intptr_t)data_ptr;
+
+ c = XcursorImageLoadCursor (dpy, &ci);
+
+ DBG_PRINT( "X11: createPointerIcon0: %p %dx%d %d/%d -> %p\n", data_ptr, width, height, hotX, hotY, (void *)c);
+
+ } else {
+ c = 0;
+ }
+ return (jlong) (intptr_t) c;
+}
+
+/*
+ * Class: Java_jogamp_newt_driver_x11_DisplayDriver
+ * Method: destroyPointerIcon0
+ * Signature: (JJILjava/lang/Object;I)V
+ */
+JNIEXPORT void JNICALL Java_jogamp_newt_driver_x11_DisplayDriver_destroyPointerIcon0
+ (JNIEnv *env, jclass clazz, jlong display, jlong handle)
+{
+ Display * dpy = (Display *) (intptr_t) display;
+
+ if( 0 != handle ) {
+ Cursor c = (Cursor) (intptr_t) handle;
+ DBG_PRINT( "X11: destroyPointerIcon0: %p\n", (void *)c);
+ XFreeCursor(dpy, c);
+ }
+}
+
diff --git a/src/newt/native/X11Window.c b/src/newt/native/X11Window.c
index 5f5dddbe0..da2778004 100644
--- a/src/newt/native/X11Window.c
+++ b/src/newt/native/X11Window.c
@@ -497,6 +497,12 @@ static void NewtWindows_setPosSize(Display *dpy, Window w, jint x, jint y, jint
}
}
+static void NewtWindows_setIcon(Display *dpy, Window w, int data_size, const unsigned char * data_ptr) {
+ Atom _NET_WM_ICON = XInternAtom(dpy, "_NET_WM_ICON", False);
+ Atom CARDINAL = XInternAtom(dpy, "CARDINAL", False);
+ XChangeProperty(dpy, w, _NET_WM_ICON, CARDINAL, 32, PropModeReplace, data_ptr, data_size);
+}
+
/*
* Class: jogamp_newt_driver_x11_WindowDriver
* Method: CreateWindow
@@ -505,7 +511,8 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_x11_WindowDriver_CreateWindow0
(JNIEnv *env, jobject obj, jlong parent, jlong display, jint screen_index,
jint visualID,
jlong javaObjectAtom, jlong windowDeleteAtom,
- jint x, jint y, jint width, jint height, jboolean autoPosition, int flags)
+ jint x, jint y, jint width, jint height, jboolean autoPosition, int flags,
+ jint iconDataSize, jobject iconData)
{
Display * dpy = (Display *)(intptr_t)display;
Atom wm_delete_atom = (Atom)windowDeleteAtom;
@@ -626,6 +633,11 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_x11_WindowDriver_CreateWindow0
XEvent event;
int left=0, right=0, top=0, bottom=0;
+ if( 0 < iconDataSize && NULL != iconData ) {
+ const unsigned char * iconDataPtr = (const unsigned char *) (*env)->GetDirectBufferAddress(env, iconData);
+ NewtWindows_setIcon(dpy, window, (int)iconDataSize, iconDataPtr);
+ }
+
XMapWindow(dpy, window);
XIfEvent( dpy, &event, WaitForMapNotify, (XPointer) window ); // wait to get proper insets values
@@ -946,6 +958,27 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_x11_WindowDriver_setTitle0
/*
* Class: Java_jogamp_newt_driver_x11_WindowDriver
+ * Method: setPointerIcon0
+ * Signature: (JJILjava/lang/Object;I)V
+ */
+JNIEXPORT void JNICALL Java_jogamp_newt_driver_x11_WindowDriver_setPointerIcon0
+ (JNIEnv *env, jclass clazz, jlong display, jlong window, jlong handle)
+{
+ Display * dpy = (Display *) (intptr_t) display;
+ Window w = (Window)window;
+
+ if( 0 == handle ) {
+ DBG_PRINT( "X11: setPointerIcon0: reset\n");
+ XUndefineCursor(dpy, w);
+ } else {
+ Cursor c = (Cursor) (intptr_t) handle;
+ DBG_PRINT( "X11: setPointerIcon0: %p\n", (void*)c);
+ XDefineCursor(dpy, w, c);
+ }
+}
+
+/*
+ * Class: Java_jogamp_newt_driver_x11_WindowDriver
* Method: setPointerVisible0
* Signature: (JJZ)Z
*/