116 |
{ |
{ |
117 |
this.owner = owner; |
this.owner = owner; |
118 |
this.toolkit = kit; |
this.toolkit = kit; |
119 |
qtApp = toolkit.guiThread.QApplicationPointer; |
qtApp = QtToolkit.guiThread.QApplicationPointer; |
120 |
nativeObject = 0; |
nativeObject = 0; |
121 |
synchronized(this) |
synchronized(this) |
122 |
{ |
{ |
230 |
{ |
{ |
231 |
WindowEvent e = new WindowEvent((Window)owner, |
WindowEvent e = new WindowEvent((Window)owner, |
232 |
WindowEvent.WINDOW_CLOSING); |
WindowEvent.WINDOW_CLOSING); |
233 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
234 |
} |
} |
235 |
} |
} |
236 |
|
|
240 |
MouseEvent.MOUSE_ENTERED, |
MouseEvent.MOUSE_ENTERED, |
241 |
System.currentTimeMillis(), |
System.currentTimeMillis(), |
242 |
(modifiers & 0x2FF), x, y, 0, false); |
(modifiers & 0x2FF), x, y, 0, false); |
243 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
244 |
} |
} |
245 |
|
|
246 |
protected void focusInEvent() |
protected void focusInEvent() |
247 |
{ |
{ |
248 |
FocusEvent e = new FocusEvent(owner, FocusEvent.FOCUS_GAINED); |
FocusEvent e = new FocusEvent(owner, FocusEvent.FOCUS_GAINED); |
249 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
250 |
} |
} |
251 |
|
|
252 |
protected void focusOutEvent() |
protected void focusOutEvent() |
253 |
{ |
{ |
254 |
FocusEvent e = new FocusEvent(owner, FocusEvent.FOCUS_LOST); |
FocusEvent e = new FocusEvent(owner, FocusEvent.FOCUS_LOST); |
255 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
256 |
} |
} |
257 |
|
|
258 |
protected void keyPressEvent(int modifiers, int code, int unicode, int dummy) |
protected void keyPressEvent(int modifiers, int code, int unicode, int dummy) |
264 |
modifiers, code, (char)(unicode & 0xFFFF), |
modifiers, code, (char)(unicode & 0xFFFF), |
265 |
KeyEvent.KEY_LOCATION_UNKNOWN); |
KeyEvent.KEY_LOCATION_UNKNOWN); |
266 |
if (!manager.dispatchEvent (e)) |
if (!manager.dispatchEvent (e)) |
267 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
268 |
} |
} |
269 |
|
|
270 |
protected void keyReleaseEvent(int modifiers, int code, int unicode, int dummy) |
protected void keyReleaseEvent(int modifiers, int code, int unicode, int dummy) |
274 |
System.currentTimeMillis(), |
System.currentTimeMillis(), |
275 |
modifiers, code, (char)(unicode & 0xFFFF), |
modifiers, code, (char)(unicode & 0xFFFF), |
276 |
KeyEvent.KEY_LOCATION_UNKNOWN); |
KeyEvent.KEY_LOCATION_UNKNOWN); |
277 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
278 |
} |
} |
279 |
|
|
280 |
protected void leaveEvent(int modifiers, int x, int y, int dummy) |
protected void leaveEvent(int modifiers, int x, int y, int dummy) |
283 |
MouseEvent.MOUSE_EXITED, |
MouseEvent.MOUSE_EXITED, |
284 |
System.currentTimeMillis(), |
System.currentTimeMillis(), |
285 |
(modifiers & 0x2FF), x, y, 0, false); |
(modifiers & 0x2FF), x, y, 0, false); |
286 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
287 |
} |
} |
288 |
|
|
289 |
// FIXME: Coalesce press-release events into clicks. |
// FIXME: Coalesce press-release events into clicks. |
303 |
System.currentTimeMillis(), |
System.currentTimeMillis(), |
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 |
|
|
309 |
protected void mouseMoveEvent( int modifiers, int x, int y, int clickCount) |
protected void mouseMoveEvent( int modifiers, int x, int y, int clickCount) |
327 |
System.currentTimeMillis(), |
System.currentTimeMillis(), |
328 |
(modifiers & 0x2FF), x, y, clickCount, |
(modifiers & 0x2FF), x, y, clickCount, |
329 |
false, button); |
false, button); |
330 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
331 |
} |
} |
332 |
|
|
333 |
protected void mousePressEvent( int modifiers, int x, int y, int clickCount) |
protected void mousePressEvent( int modifiers, int x, int y, int clickCount) |
347 |
(modifiers & 0x2FF), x, y, clickCount, |
(modifiers & 0x2FF), x, y, clickCount, |
348 |
( button == POPUP_TRIGGER ), |
( button == POPUP_TRIGGER ), |
349 |
button); |
button); |
350 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
351 |
} |
} |
352 |
|
|
353 |
protected void mouseReleaseEvent( int modifiers, int x, int y, int clickCount) |
protected void mouseReleaseEvent( int modifiers, int x, int y, int clickCount) |
367 |
System.currentTimeMillis(), |
System.currentTimeMillis(), |
368 |
(modifiers & 0x2FF), x, y, clickCount, |
(modifiers & 0x2FF), x, y, clickCount, |
369 |
false, button); |
false, button); |
370 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
371 |
} |
} |
372 |
|
|
373 |
protected void moveEvent(int x, int y, int oldx, int oldy) |
protected void moveEvent(int x, int y, int oldx, int oldy) |
393 |
ignoreResize = false; |
ignoreResize = false; |
394 |
ComponentEvent e = new ComponentEvent(owner, |
ComponentEvent e = new ComponentEvent(owner, |
395 |
ComponentEvent.COMPONENT_RESIZED); |
ComponentEvent.COMPONENT_RESIZED); |
396 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
397 |
QtToolkit.repaintThread.queueComponent(this); |
QtToolkit.repaintThread.queueComponent(this); |
398 |
} |
} |
399 |
|
|
403 |
{ |
{ |
404 |
WindowEvent e = new WindowEvent((Window)owner, |
WindowEvent e = new WindowEvent((Window)owner, |
405 |
WindowEvent.WINDOW_OPENED); |
WindowEvent.WINDOW_OPENED); |
406 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
407 |
} |
} |
408 |
else |
else |
409 |
{ |
{ |
410 |
ComponentEvent e = new ComponentEvent(owner, |
ComponentEvent e = new ComponentEvent(owner, |
411 |
ComponentEvent.COMPONENT_SHOWN); |
ComponentEvent.COMPONENT_SHOWN); |
412 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
413 |
} |
} |
414 |
} |
} |
415 |
|
|
417 |
{ |
{ |
418 |
ComponentEvent e = new ComponentEvent(owner, |
ComponentEvent e = new ComponentEvent(owner, |
419 |
ComponentEvent.COMPONENT_HIDDEN); |
ComponentEvent.COMPONENT_HIDDEN); |
420 |
toolkit.eventQueue.postEvent(e); |
QtToolkit.eventQueue.postEvent(e); |
421 |
} |
} |
422 |
|
|
423 |
// ************ Public methods ********************* |
// ************ Public methods ********************* |
527 |
public GraphicsConfiguration getGraphicsConfiguration() |
public GraphicsConfiguration getGraphicsConfiguration() |
528 |
{ |
{ |
529 |
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. |
530 |
GraphicsDevice[] devs = toolkit.graphicsEnv.getScreenDevices(); |
GraphicsDevice[] devs = QtToolkit.graphicsEnv.getScreenDevices(); |
531 |
return devs[id].getDefaultConfiguration(); |
return devs[id].getDefaultConfiguration(); |
532 |
} |
} |
533 |
|
|