From 2d837a7a7130702ad36b694875613fae77c7ef06 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 10 Aug 2015 16:16:13 +0200 Subject: Bug 1188, Bug 1186: NEWT Window: Support non-resizable, minimize, maximize, alwaysOnBottom and sticky/all-desktop (Part 1) Change also implements Bug 1186: 'NEWT Window: Use a Bitfield holding all state flags and expose it accordingly', since it is essential for an efficient implementation. Part 1: - Bug 1186 - Using Bitfield, holding public (Window) and private state bits/mask - Bug 1188 - Window adds: - [is|set]AlwaysOnBottom(..), - [is|set]Resizable(..), - [is|set]Sticky(..), - [is|set]Maximized(..), - isChildWindow(), - Full implementation for X11 - TODO: Implement for OSX and Windows - Manual tests: - TestGearsES2NEWT, TestGearsES2NEWTSimple and TestGearsES2NewtCanvasAWT utilize new NewtDemoListener, which has a key-listener to perform all [new] actions. See source code of NewtDemoListener. --- .../classes/com/jogamp/nativewindow/util/Rectangle.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/nativewindow/classes/com') diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/util/Rectangle.java b/src/nativewindow/classes/com/jogamp/nativewindow/util/Rectangle.java index 33a1955e8..9b4d7ec68 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/util/Rectangle.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/util/Rectangle.java @@ -46,6 +46,9 @@ public class Rectangle implements Cloneable, RectangleImmutable { this.width=width; this.height=height; } + public Rectangle(final RectangleImmutable s) { + set(s); + } @Override public Object cloneMutable() { @@ -82,6 +85,12 @@ public class Rectangle implements Cloneable, RectangleImmutable { this.width = s.width; this.height = s.height; } + public final void set(final RectangleImmutable s) { + this.x = s.getX(); + this.y = s.getY(); + this.width = s.getWidth(); + this.height = s.getHeight(); + } public final void setX(final int x) { this.x = x; } public final void setY(final int y) { this.y = y; } public final void setWidth(final int width) { this.width = width; } @@ -196,6 +205,7 @@ public class Rectangle implements Cloneable, RectangleImmutable { } } { + // FIXME: Invalid, position needs to be compared differently final int sq = x*y; final int xsq = d.getX()*d.getY(); -- cgit v1.2.3