00001 // ===================================================================================== 00002 // Filename: ContextActor.h 00003 // Description: 00004 // Version: 1.0 00005 // Created: 03/30/2007 10:02:44 PM EDT 00006 // Revision: none 00007 // Compiler: gcc 3.4.6 00008 // 00009 // Author: John P. Feltz 00010 // Email: jfeltz@gmail.com 00011 // License: Copyright (c) 2006-2007, John P. Feltz 00012 // This program is free software; you can redistribute it and/or 00013 // modify it under the terms of the GNU General Public License as 00014 // published by the Free Software Foundation, version 2 of the 00015 // License. 00016 // This program is distributed in the hope that it will be 00017 // useful, but WITHOUT ANY WARRANTY; without even the implied 00018 // warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00019 // PURPOSE. 00020 // See the GNU General Public License version 2 for more details. 00021 // 00022 // ===================================================================================== 00023 00025 00026 namespace cmil { 00027 class ContextActor : public InputActor { 00028 public: 00029 ContextActor(System* const sys); 00030 00031 virtual ~ContextActor() { 00032 log_debug("calling dtor"); 00033 00034 if(m_context) { 00035 log_debug("deleting context"); 00036 delete m_context; 00037 } 00038 }; 00039 00040 std::string getName() const; 00041 virtual InputContext* getContext(); 00042 void setContext(InputContext* const context); 00043 00045 00046 void captureNormal( ModAction* action ); 00047 Ev::Sequence* getCaptured() const; 00048 00049 bool addCombo(const Ev& event); 00050 bool addNormal(const Ev& event); 00051 00052 bool removeNormal(const Ev& event); 00053 00054 virtual void update(const InputData& input); 00055 virtual void update(const ModData& input); 00056 00057 void quit(); 00058 bool getQuit() const; 00059 00060 private: 00061 bool m_quit; 00062 InputContext* m_context; 00063 }; 00064 }