/[classpath]/classpath/gnu/java/awt/peer/qt/QtComponentPeer.java
ViewVC logotype

Diff of /classpath/gnu/java/awt/peer/qt/QtComponentPeer.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by smarothy, Thu Aug 11 17:06:48 2005 UTC revision 1.2 by mark, Fri Aug 12 16:11:31 2005 UTC
# Line 123  public class QtComponentPeer extends Nat Line 123  public class QtComponentPeer extends Nat
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();
# Line 204  public class QtComponentPeer extends Nat Line 204  public class QtComponentPeer extends Nat
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    
# Line 214  public class QtComponentPeer extends Nat Line 214  public class QtComponentPeer extends Nat
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)
# Line 238  public class QtComponentPeer extends Nat Line 238  public class QtComponentPeer extends Nat
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)
# Line 248  public class QtComponentPeer extends Nat Line 248  public class QtComponentPeer extends Nat
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)
# Line 257  public class QtComponentPeer extends Nat Line 257  public class QtComponentPeer extends Nat
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.
# Line 277  public class QtComponentPeer extends Nat Line 277  public class QtComponentPeer extends Nat
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)
# Line 303  public class QtComponentPeer extends Nat Line 303  public class QtComponentPeer extends Nat
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    }    }
# Line 325  public class QtComponentPeer extends Nat Line 325  public class QtComponentPeer extends Nat
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)
# Line 345  public class QtComponentPeer extends Nat Line 345  public class QtComponentPeer extends Nat
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)
# Line 380  public class QtComponentPeer extends Nat Line 380  public class QtComponentPeer extends Nat
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()
# Line 389  public class QtComponentPeer extends Nat Line 389  public class QtComponentPeer extends Nat
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    
# Line 403  public class QtComponentPeer extends Nat Line 403  public class QtComponentPeer extends Nat
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();
# Line 517  public class QtComponentPeer extends Nat Line 517  public class QtComponentPeer extends Nat
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    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26