Show
Ignore:
Timestamp:
04/22/07 06:28:25 (2 years ago)
Author:
baxissimo
Message:

Finally fixed it so that the GUI can steal mouse clicks and the user can listen for everything else.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/luigi/adapter.d

    r46 r48  
    5151interface InputAdapter 
    5252{ 
     53    /// Get the size of the specified window, using an opaque 
     54    /// window handle. 
     55    Size get_window_size(WindowHandle h); 
     56 
     57 
    5358    /** 
    54      * These are "raw" callbacks in that they haven't yet been translated or dispatched 
    55      *  to widgets.  This is all the input that comes in at the window level. 
    56      * Luigi uses these to get input which is then dispatched to widgets based on 
    57      * current focus item, location of the mouse, etc. 
    58      * See event.d for the definitons of the function types. 
     59     * These are standard user-level callbacks.   
     60     * These get dispatched to your code only for 
     61     * events that weren't handled by any widget 
     62     * on the GUI overlay. 
    5963     */ 
    6064    void addKeyCallback(KeyEventFn cb)                 ; 
     
    9094    void removeWindowCloseCallback(WindowCloseEventDg cb) ; 
    9195 
    92     Size get_window_size(WindowHandle h); 
     96    /** 
     97     * These are "raw" system callbacks in that they haven't yet been 
     98     * translated or dispatched to widgets.  This is all the input 
     99     * that comes in at the window level.  Luigi uses these to get 
     100     * input which is then dispatched to widgets based on current 
     101     * focus item, location of the mouse, etc.  See event.d for the 
     102     * definitons of the function types. 
     103     */ 
     104    void addSysKeyCallback(KeyEventFn cb)                 ; 
     105    void addSysMouseButtonCallback(MouseButtonEventFn cb) ; 
     106 
     107    // And again for delegates... 
     108    void addSysKeyCallback(KeyEventDg cb)                 ; 
     109    void addSysMouseButtonCallback(MouseButtonEventDg cb) ; 
     110 
     111    // remove raw system callback 
     112    void removeSysKeyCallback(KeyEventFn cb)                 ; 
     113    void removeSysMouseButtonCallback(MouseButtonEventFn cb) ; 
     114 
     115    // And again for delegates... 
     116    void removeSysKeyCallback(KeyEventDg cb)                 ; 
     117    void removeSysMouseButtonCallback(MouseButtonEventDg cb) ; 
    93118 
    94119    // addRaw Paint 
     
    124149            windowSize = new WindowSizeEventSignal;  
    125150            windowClose = new WindowCloseEventSignal; 
     151 
     152            sysKey = new KeyEventSignal; 
     153            sysMouseButton = new MouseButtonEventSignal; 
    126154        } 
    127155    } 
     
    136164        WindowSizeEventSignal  windowSize;  
    137165        WindowCloseEventSignal windowClose; 
     166 
     167        KeyEventSignal         sysKey; 
     168        MouseButtonEventSignal sysMouseButton; 
    138169    } 
    139170    private _LuigiSignals _lsig; 
     
    171202    void removeWindowSizeCallback(WindowSizeEventDg cb)   {_lsig.windowSize.disconnect(cb);}   
    172203    void removeWindowCloseCallback(WindowCloseEventDg cb) {_lsig.windowClose.disconnect(cb);}  
     204 
     205 
     206    // Implementation of InputAdapter 
     207    void addSysKeyCallback(KeyEventFn cb)                 {_lsig.sysKey.connect(cb);} 
     208    void addSysMouseButtonCallback(MouseButtonEventFn cb) {_lsig.sysMouseButton.connect(cb);} 
     209 
     210    // And again for delegates... 
     211    void addSysKeyCallback(KeyEventDg cb)                 {_lsig.sysKey.connect(cb);} 
     212    void addSysMouseButtonCallback(MouseButtonEventDg cb) {_lsig.sysMouseButton.connect(cb);} 
     213 
     214    // remove raw system callback 
     215    void removeSysKeyCallback(KeyEventFn cb)                 {_lsig.sysKey.disconnect(cb);} 
     216    void removeSysMouseButtonCallback(MouseButtonEventFn cb) {_lsig.sysMouseButton.disconnect(cb);}; 
     217 
     218    // And again for delegates... 
     219    void removeSysKeyCallback(KeyEventDg cb)                 {_lsig.sysKey.disconnect(cb);} 
     220    void removeSysMouseButtonCallback(MouseButtonEventDg cb) {_lsig.sysMouseButton.disconnect(cb);}; 
     221 
     222 
     223 
    173224} 
    174225