14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25 package com.sun.glass.ui.mac;
26
27 import com.sun.glass.events.WindowEvent;
28 import com.sun.glass.events.mac.NpapiEvent;
29 import com.sun.glass.ui.Cursor;
30 import com.sun.glass.ui.Pixels;
31 import com.sun.glass.ui.Screen;
32 import com.sun.glass.ui.View;
33 import com.sun.glass.ui.Window;
34
35 import java.util.Map;
36
37 /**
38 * MacOSX platform implementation class for Window.
39 */
40 final class MacWindow extends Window {
41
42 private native static void _initIDs();
43 static {
44 _initIDs();
45 }
46
47 protected MacWindow(Window owner, Screen screen, int styleMask) {
48 super(owner, screen, styleMask);
49 }
50 protected MacWindow(long parent) {
51 super(parent);
52 }
53
107 @Override native protected void _setIcon(long ptr, Pixels pixels);
108 @Override native protected void _toFront(long ptr);
109 @Override native protected void _toBack(long ptr);
110 @Override native protected void _enterModal(long ptr);
111 @Override native protected void _enterModalWithWindow(long dialog, long window);
112 @Override native protected void _exitModal(long ptr);
113
114 @Override native protected boolean _grabFocus(long ptr);
115 @Override native protected void _ungrabFocus(long ptr);
116
117 @Override native protected int _getEmbeddedX(long ptr);
118 @Override native protected int _getEmbeddedY(long ptr);
119
120 @Override
121 protected void notifyResize(int type, int width, int height) {
122 width = Math.round( width * getPlatformScaleX());
123 height = Math.round(height * getPlatformScaleY());
124 super.notifyResize(type, width, height);
125 }
126
127 @Override
128 protected void _setCursor(long ptr, Cursor cursor) {
129 ((MacCursor)cursor).set();
130 }
131
132 @Override
133 public void dispatchNpapiEvent(Map eventInfo) {
134 NpapiEvent.dispatchCocoaNpapiEvent(this, eventInfo);
135 }
136
137 @Override
138 protected void _requestInput(long ptr, String text, int type, double width, double height,
139 double Mxx, double Mxy, double Mxz, double Mxt,
140 double Myx, double Myy, double Myz, double Myt,
141 double Mzx, double Mzy, double Mzz, double Mzt) {
142 throw new UnsupportedOperationException("Not supported yet.");
143 }
144
145 @Override
146 protected void _releaseInput(long ptr) {
|
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25 package com.sun.glass.ui.mac;
26
27 import com.sun.glass.events.WindowEvent;
28 import com.sun.glass.events.mac.NpapiEvent;
29 import com.sun.glass.ui.Cursor;
30 import com.sun.glass.ui.Pixels;
31 import com.sun.glass.ui.Screen;
32 import com.sun.glass.ui.View;
33 import com.sun.glass.ui.Window;
34 import com.sun.glass.ui.Window.State;
35
36 import java.util.Map;
37
38 /**
39 * MacOSX platform implementation class for Window.
40 */
41 final class MacWindow extends Window {
42
43 private native static void _initIDs();
44 static {
45 _initIDs();
46 }
47
48 protected MacWindow(Window owner, Screen screen, int styleMask) {
49 super(owner, screen, styleMask);
50 }
51 protected MacWindow(long parent) {
52 super(parent);
53 }
54
108 @Override native protected void _setIcon(long ptr, Pixels pixels);
109 @Override native protected void _toFront(long ptr);
110 @Override native protected void _toBack(long ptr);
111 @Override native protected void _enterModal(long ptr);
112 @Override native protected void _enterModalWithWindow(long dialog, long window);
113 @Override native protected void _exitModal(long ptr);
114
115 @Override native protected boolean _grabFocus(long ptr);
116 @Override native protected void _ungrabFocus(long ptr);
117
118 @Override native protected int _getEmbeddedX(long ptr);
119 @Override native protected int _getEmbeddedY(long ptr);
120
121 @Override
122 protected void notifyResize(int type, int width, int height) {
123 width = Math.round( width * getPlatformScaleX());
124 height = Math.round(height * getPlatformScaleY());
125 super.notifyResize(type, width, height);
126 }
127
128 protected void notifyMove(final int x, final int y, boolean isMaximized) {
129 if (isMaximized() != isMaximized && !isMinimized()) {
130 setState(isMaximized ? State.MAXIMIZED : State.NORMAL);
131 handleWindowEvent(System.nanoTime(),
132 isMaximized
133 ? WindowEvent.MAXIMIZE
134 : WindowEvent.RESTORE);
135 }
136 notifyMove(x, y);
137 }
138
139 @Override
140 protected void _setCursor(long ptr, Cursor cursor) {
141 ((MacCursor)cursor).set();
142 }
143
144 @Override
145 public void dispatchNpapiEvent(Map eventInfo) {
146 NpapiEvent.dispatchCocoaNpapiEvent(this, eventInfo);
147 }
148
149 @Override
150 protected void _requestInput(long ptr, String text, int type, double width, double height,
151 double Mxx, double Mxy, double Mxz, double Mxt,
152 double Myx, double Myy, double Myz, double Myt,
153 double Mzx, double Mzy, double Mzz, double Mzt) {
154 throw new UnsupportedOperationException("Not supported yet.");
155 }
156
157 @Override
158 protected void _releaseInput(long ptr) {
|