Show
Ignore:
Timestamp:
07/16/09 21:18:01 (4 years ago)
Author:
saturday06
Message:

iojasdfaodfd

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/objective-cplusplus/i3/trunk/src/mil/include/mil/gui-cocoa/GuiModule.h

    r34305 r34447  
    33#include "../ModuleCommon.h" 
    44 
    5 namespace mil 
    6 { 
     5namespace mil { 
    76 
    87/** 
     
    109 */ 
    1110template <typename Child> 
    12 class GuiModule : public ModuleCommon<GuiModule<Child>, thread::Cocoa> 
    13 { 
     11class GuiModule : public ModuleCommon<GuiModule<Child>, thread::Cocoa> { 
    1412public: 
    1513    Tls tls; 
    1614private: 
    1715    template <typename T> 
    18     class Event : boost::noncopyable 
    19     { 
     16    class Event : boost::noncopyable { 
    2017    public: 
    2118        typedef T DataType; 
     
    3229 
    3330public: 
    34     NSWindow* getWindow() 
    35     { 
     31    NSWindow* getWindow() { 
    3632        return window; 
    3733    } 
    38      
    39     void requestExit(void* event_memory) 
    40     { 
     34 
     35    void requestExit(void* event_memory) { 
    4136        ExitEvent e; 
    4237        post(e, *this); 
    4338    } 
    4439 
    45     GuiModule() : tls(this->thread_id), repost(false), window(NULL) 
    46     { 
     40    GuiModule() : tls(this->thread_id), repost(false), window(NULL) { 
    4741        set_auto_join(this); 
    4842    } 
    4943 
    50     Child& getChild() 
    51     { 
     44    Child& getChild() { 
    5245        return *static_cast<Child*>(this); 
    5346    } 
    5447 
    5548protected: 
    56     void repostEvent() 
    57     { 
     49    void repostEvent() { 
    5850        repost = true; 
    5951    } 
    6052 
    6153    template <typename Data, typename Sender> 
    62     static void dispatcher(void* event_, void* target_) 
    63     { 
     54    static void dispatcher(void* event_, void* target_) { 
    6455        typedef Child  Target; 
    6556 
    66         if (!event_ || !target_) 
    67         { 
     57        if (!event_ || !target_) { 
    6858            return; 
    6959        } 
     
    7565        target.repost = false; 
    7666        ModuleExecuteProxy<Data, Target>::execute(event.data, target); 
    77         if (target.repost) 
    78         { 
     67        if (target.repost) { 
    7968            target.post(event.data, target); 
    8069            return; 
     
    8271    } 
    8372public: 
    84     void requestExit() 
    85     { 
     73    void requestExit() { 
    8674        ExitEvent e; 
    8775        post(e, *this); 
     
    8977 
    9078    template <typename T, typename Sender> 
    91     void post(const T& event, Sender& sender, void* memory = NULL, intptr_t owner_id = 0) 
    92     { 
     79    void post(const T& event, Sender& sender, void* memory = NULL, intptr_t owner_id = 0) { 
    9380        NSWindow* localWindow = sender.tls.thread[this->thread_id].window; 
    9481        if (!localWindow) { 
     
    10289    } 
    10390public: 
    104     void destroy() 
    105     { 
    106         if (!window) 
    107         { 
     91    void destroy() { 
     92        if (!window) { 
    10893            return; 
    10994        } 
     
    11297    } 
    11398 
    114     ~GuiModule() 
    115     { 
     99    ~GuiModule() { 
    116100        do_auto_join(); 
    117101    } 
    118102 
    119     void execute_front() 
    120     { 
     103    void execute_front() { 
    121104    } 
    122105 
    123     void mouseDown(NSEvent*) 
    124     { 
     106    void mouseDown(NSEvent*) { 
    125107    } 
    126108protected: 
    127     void loop() 
    128     { 
     109    void loop() { 
    129110        [[NSRunLoop currentRunLoop] run]; 
    130111        destroy();