123 |
{ |
{ |
124 |
this.owner = owner; |
this.owner = owner; |
125 |
this.toolkit = kit; |
this.toolkit = kit; |
126 |
qtApp = toolkit.guiThread.QApplicationPointer; |
qtApp = QtToolkit.guiThread.QApplicationPointer; |
127 |
nativeObject = 0; |
nativeObject = 0; |
128 |
callInit(); // Calls the init method FROM THE MAIN THREAD. |
callInit(); // Calls the init method FROM THE MAIN THREAD. |
129 |
setup(); |
setup(); |
204 |
{ |
{ |
205 |
WindowEvent e = new WindowEvent((Window)owner, |
WindowEvent e = new WindowEvent((Window)owner, |
206 |
WindowEvent.WINDOW_CLOSING); |
WindowEvent.WINDOW_CLOSING); |
207 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
208 |
} |
} |
209 |
} |
} |
210 |
|
|
214 |
MouseEvent.MOUSE_ENTERED, |
MouseEvent.MOUSE_ENTERED, |
215 |
System.currentTimeMillis(), |
System.currentTimeMillis(), |
216 |
(modifiers & 0x2FF), x, y, 0, false); |
(modifiers & 0x2FF), x, y, 0, false); |
217 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
218 |
} |
} |
219 |
|
|
220 |
protected void focusInEvent() |
protected void focusInEvent() |
221 |
{ |
{ |
222 |
FocusEvent e = new FocusEvent(owner, FocusEvent.FOCUS_GAINED); |
FocusEvent e = new FocusEvent(owner, FocusEvent.FOCUS_GAINED); |
223 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
224 |
} |
} |
225 |
|
|
226 |
protected void focusOutEvent() |
protected void focusOutEvent() |
227 |
{ |
{ |
228 |
FocusEvent e = new FocusEvent(owner, FocusEvent.FOCUS_LOST); |
FocusEvent e = new FocusEvent(owner, FocusEvent.FOCUS_LOST); |
229 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
230 |
} |
} |
231 |
|
|
232 |
protected void keyPressEvent(int modifiers, int code, int unicode, int dummy) |
protected void keyPressEvent(int modifiers, int code, int unicode, int dummy) |
238 |
modifiers, code, (char)(unicode & 0xFFFF), |
modifiers, code, (char)(unicode & 0xFFFF), |
239 |
KeyEvent.KEY_LOCATION_UNKNOWN); |
KeyEvent.KEY_LOCATION_UNKNOWN); |
240 |
if (!manager.dispatchEvent (e)) |
if (!manager.dispatchEvent (e)) |
241 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
242 |
} |
} |
243 |
|
|
244 |
protected void keyReleaseEvent(int modifiers, int code, int unicode, int dummy) |
protected void keyReleaseEvent(int modifiers, int code, int unicode, int dummy) |
248 |
System.currentTimeMillis(), |
System.currentTimeMillis(), |
249 |
modifiers, code, (char)(unicode & 0xFFFF), |
modifiers, code, (char)(unicode & 0xFFFF), |
250 |
KeyEvent.KEY_LOCATION_UNKNOWN); |
KeyEvent.KEY_LOCATION_UNKNOWN); |
251 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
252 |
} |
} |
253 |
|
|
254 |
protected void leaveEvent(int modifiers, int x, int y, int dummy) |
protected void leaveEvent(int modifiers, int x, int y, int dummy) |
257 |
MouseEvent.MOUSE_EXITED, |
MouseEvent.MOUSE_EXITED, |
258 |
System.currentTimeMillis(), |
System.currentTimeMillis(), |
259 |
(modifiers & 0x2FF), x, y, 0, false); |
(modifiers & 0x2FF), x, y, 0, false); |
260 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
261 |
} |
} |
262 |
|
|
263 |
// FIXME: Coalesce press-release events into clicks. |
// FIXME: Coalesce press-release events into clicks. |
277 |
System.currentTimeMillis(), |
System.currentTimeMillis(), |
278 |
(modifiers & 0x2FF), x, y, clickCount, |
(modifiers & 0x2FF), x, y, clickCount, |
279 |
false, button); |
false, button); |
280 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
281 |
} |
} |
282 |
|
|
283 |
protected void mouseMoveEvent( int modifiers, int x, int y, int clickCount) |
protected void mouseMoveEvent( int modifiers, int x, int y, int clickCount) |
303 |
timeStamp, |
timeStamp, |
304 |
(modifiers & 0x2FF), x, y, clickCount, |
(modifiers & 0x2FF), x, y, clickCount, |
305 |
false, button); |
false, button); |
306 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
307 |
} |
} |
308 |
lastMME = timeStamp; |
lastMME = timeStamp; |
309 |
} |
} |
325 |
(modifiers & 0x2FF), x, y, clickCount, |
(modifiers & 0x2FF), x, y, clickCount, |
326 |
( button == POPUP_TRIGGER ), |
( button == POPUP_TRIGGER ), |
327 |
button); |
button); |
328 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
329 |
} |
} |
330 |
|
|
331 |
protected void mouseReleaseEvent( int modifiers, int x, int y, int clickCount) |
protected void mouseReleaseEvent( int modifiers, int x, int y, int clickCount) |
345 |
System.currentTimeMillis(), |
System.currentTimeMillis(), |
346 |
(modifiers & 0x2FF), x, y, clickCount, |
(modifiers & 0x2FF), x, y, clickCount, |
347 |
false, button); |
false, button); |
348 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
349 |
} |
} |
350 |
|
|
351 |
protected void moveEvent() |
protected void moveEvent() |
352 |
{ |
{ |
353 |
ComponentEvent e = new ComponentEvent(owner, |
ComponentEvent e = new ComponentEvent(owner, |
354 |
ComponentEvent.COMPONENT_MOVED); |
ComponentEvent.COMPONENT_MOVED); |
355 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
356 |
} |
} |
357 |
|
|
358 |
protected void paintEvent(QtGraphics g) |
protected void paintEvent(QtGraphics g) |
380 |
owner.setSize(width, height); |
owner.setSize(width, height); |
381 |
ComponentEvent e = new ComponentEvent(owner, |
ComponentEvent e = new ComponentEvent(owner, |
382 |
ComponentEvent.COMPONENT_RESIZED); |
ComponentEvent.COMPONENT_RESIZED); |
383 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
384 |
} |
} |
385 |
|
|
386 |
protected void showEvent() |
protected void showEvent() |
389 |
{ |
{ |
390 |
WindowEvent e = new WindowEvent((Window)owner, |
WindowEvent e = new WindowEvent((Window)owner, |
391 |
WindowEvent.WINDOW_OPENED); |
WindowEvent.WINDOW_OPENED); |
392 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
393 |
} |
} |
394 |
else |
else |
395 |
{ |
{ |
396 |
ComponentEvent e = new ComponentEvent(owner, |
ComponentEvent e = new ComponentEvent(owner, |
397 |
ComponentEvent.COMPONENT_SHOWN); |
ComponentEvent.COMPONENT_SHOWN); |
398 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
399 |
} |
} |
400 |
} |
} |
401 |
|
|
403 |
{ |
{ |
404 |
ComponentEvent e = new ComponentEvent(owner, |
ComponentEvent e = new ComponentEvent(owner, |
405 |
ComponentEvent.COMPONENT_HIDDEN); |
ComponentEvent.COMPONENT_HIDDEN); |
406 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
407 |
} |
} |
408 |
|
|
409 |
private native Dimension getMinimumSizeNative(); |
private native Dimension getMinimumSizeNative(); |
517 |
public GraphicsConfiguration getGraphicsConfiguration() |
public GraphicsConfiguration getGraphicsConfiguration() |
518 |
{ |
{ |
519 |
int id = whichScreen(); // get the ID of the screen the widget is on. |
int id = whichScreen(); // get the ID of the screen the widget is on. |
520 |
GraphicsDevice[] devs = toolkit.graphicsEnv.getScreenDevices(); |
GraphicsDevice[] devs = QtToolkit.graphicsEnv.getScreenDevices(); |
521 |
return devs[id].getDefaultConfiguration(); |
return devs[id].getDefaultConfiguration(); |
522 |
} |
} |
523 |
|
|