Lines 52-57
import com.jogamp.nativewindow.util.Point;
Link Here
|
52 |
|
52 |
|
53 |
import com.jogamp.common.ExceptionUtils; |
53 |
import com.jogamp.common.ExceptionUtils; |
54 |
import com.jogamp.common.nio.Buffers; |
54 |
import com.jogamp.common.nio.Buffers; |
|
|
55 |
import com.jogamp.nativewindow.util.DimensionImmutable; |
56 |
import com.jogamp.nativewindow.util.PixelRectangle; |
55 |
import com.jogamp.nativewindow.x11.X11GraphicsDevice; |
57 |
import com.jogamp.nativewindow.x11.X11GraphicsDevice; |
56 |
import com.jogamp.nativewindow.x11.X11GraphicsScreen; |
58 |
import com.jogamp.nativewindow.x11.X11GraphicsScreen; |
57 |
import com.jogamp.newt.NewtFactory; |
59 |
import com.jogamp.newt.NewtFactory; |
Lines 276-281
public class WindowDriver extends WindowImpl {
Link Here
|
276 |
} |
278 |
} |
277 |
}); |
279 |
}); |
278 |
} |
280 |
} |
|
|
281 |
|
282 |
@Override |
283 |
protected void setIconImpl(final PixelRectangle icon) { |
284 |
if(icon!=null){ |
285 |
final DimensionImmutable size = icon.getSize(); |
286 |
final int pixelDataSize = size.getWidth() * size.getHeight() * icon.getPixelformat().comp.bytesPerPixel(); |
287 |
final Buffer pixels = icon.getPixels(); |
288 |
|
289 |
runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() { |
290 |
@Override |
291 |
public Object run(final long dpy) { |
292 |
setWindowIcon0(dpy, getWindowHandle(),pixelDataSize, |
293 |
pixels,Buffers.getDirectBufferByteOffset(pixels),true /* pixels_is_direct */); |
294 |
return null; |
295 |
} |
296 |
}); |
297 |
}else if(defaultIconData!=null){ |
298 |
//set default icon |
299 |
runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() { |
300 |
@Override |
301 |
public Object run(final long dpy) { |
302 |
setWindowIcon0(dpy, getWindowHandle(),defaultIconDataSize, |
303 |
defaultIconData,Buffers.getDirectBufferByteOffset(defaultIconData),true /* pixels_is_direct */); |
304 |
return null; |
305 |
} |
306 |
}); |
307 |
} |
308 |
} |
279 |
|
309 |
|
280 |
@Override |
310 |
@Override |
281 |
protected void setPointerIconImpl(final PointerIconImpl pi) { |
311 |
protected void setPointerIconImpl(final PointerIconImpl pi) { |
Lines 452-457
public class WindowDriver extends WindowImpl {
Link Here
|
452 |
int visualID, long javaObjectAtom, long windowDeleteAtom, |
482 |
int visualID, long javaObjectAtom, long windowDeleteAtom, |
453 |
int x, int y, int width, int height, boolean autoPosition, int flags, |
483 |
int x, int y, int width, int height, boolean autoPosition, int flags, |
454 |
int pixelDataSize, Object pixels, int pixels_byte_offset, boolean pixels_is_direct); |
484 |
int pixelDataSize, Object pixels, int pixels_byte_offset, boolean pixels_is_direct); |
|
|
485 |
private native long setWindowIcon0(long display, long windowHandle, int pixelDataSize, |
486 |
Object pixels, int pixels_byte_offset, boolean pixels_is_direct); |
455 |
private native void CloseWindow0(long display, long windowHandle, long javaObjectAtom, long windowDeleteAtom /*, long kbdHandle*/, // XKB disabled for now |
487 |
private native void CloseWindow0(long display, long windowHandle, long javaObjectAtom, long windowDeleteAtom /*, long kbdHandle*/, // XKB disabled for now |
456 |
final int randr_event_base, final int randr_error_base); |
488 |
final int randr_event_base, final int randr_error_base); |
457 |
private native void reconfigureWindow0(long display, int screen_index, long parentWindowHandle, long windowHandle, |
489 |
private native void reconfigureWindow0(long display, int screen_index, long parentWindowHandle, long windowHandle, |