merge with/from trunk at r35190
[blender.git] / intern / ghost / intern / GHOST_System.cpp
index 458a35bf34b7c10e3db67c477708a6f6df450d30..a23188e52af49e0615f61768086fdd7f03ef23f6 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
  * $Id$
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
@@ -14,7 +14,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
  * All rights reserved.
  * ***** END GPL LICENSE BLOCK *****
  */
 
+/** \file ghost/intern/GHOST_System.cpp
+ *  \ingroup GHOST
+ */
+
+
 /**
 
  * $Id$
  * @date       May 7, 2001
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #include "GHOST_System.h"
 
 #include <time.h>
@@ -226,10 +227,37 @@ GHOST_TSuccess GHOST_System::addEventConsumer(GHOST_IEventConsumer* consumer)
 }
 
 
+ GHOST_TSuccess GHOST_System::beginRecord(FILE *file)
+ {
+       return this->m_eventManager->beginRecord(file);
+ }
+
+ GHOST_TSuccess GHOST_System::endRecord()
+ {
+       return this->m_eventManager->endRecord();
+ }
+
+ GHOST_TSuccess GHOST_System::playbackEvents(FILE *file)
+ {
+       return this->m_eventManager->playbackEvents(file);
+ }
+
+
+ bool GHOST_System::playingEvents(bool *hasevent) const
+ {
+       return this->m_eventManager->playingEvents(hasevent);
+ }
+
+ bool GHOST_System::recordingEvents()
+ {
+       return this->m_eventManager->recordingEvents();
+ }
+
+
 GHOST_TSuccess GHOST_System::pushEvent(GHOST_IEvent* event)
 {
        GHOST_TSuccess success;
-       if (m_eventManager) {
+       if (m_eventManager && !m_eventManager->playingEvents(NULL)) {
                success = m_eventManager->pushEvent(event);
        }
        else {
@@ -275,7 +303,6 @@ GHOST_TSuccess GHOST_System::getButtonState(GHOST_TButtonMask mask, bool& isDown
        return success;
 }
 
-
 GHOST_TSuccess GHOST_System::init()
 {
        m_timerManager = new GHOST_TimerManager ();
@@ -283,12 +310,15 @@ GHOST_TSuccess GHOST_System::init()
        m_eventManager = new GHOST_EventManager ();
     m_ndofManager = new GHOST_NDOFManager();
 
+#if 0
        if(m_ndofManager)
                printf("ndof manager \n");
-
+#endif
+       
 #ifdef GHOST_DEBUG
        if (m_eventManager) {
-               m_eventManager->addConsumer(&m_eventPrinter);
+               m_eventPrinter = new GHOST_EventPrinter();
+               m_eventManager->addConsumer(m_eventPrinter);
        }
 #endif // GHOST_DEBUG