00001 #include "gui_eventreceiver.hpp" 00002 #include "gui_eventmanager.hpp" 00003 00004 namespace gui 00005 { 00006 event_receiver::event_receiver(event_manager* mManager) : 00007 pEventManager_(mManager) 00008 { 00009 } 00010 00011 event_receiver::~event_receiver() 00012 { 00013 if (pEventManager_) 00014 pEventManager_->unregister_receiver(this); 00015 } 00016 00017 void event_receiver::register_event(const std::string& sEventName) 00018 { 00019 if (pEventManager_) 00020 pEventManager_->register_event(this, sEventName); 00021 } 00022 00023 void event_receiver::unregister_event(const std::string& sEventName) 00024 { 00025 if (pEventManager_) 00026 pEventManager_->unregister_event(this, sEventName); 00027 } 00028 }