[dasher] Remove huge number CUserLogBase* pointers from InputFilter methods



commit 4472c393c43f4b5266f295bd68f8082becb5f27e
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date:   Thu Jun 23 16:04:04 2011 +0100

    Remove huge number CUserLogBase* pointers from InputFilter methods
    
    In the few cases where userlog is needed, can be retrieved from interface.
    
    (Note: "the few cases" are just those which have implemented logging of
     relevant filter events. So could extend other filters too!)

 Src/DasherCore/AlternatingDirectMode.cpp  |    2 +-
 Src/DasherCore/AlternatingDirectMode.h    |    2 +-
 Src/DasherCore/ButtonMode.cpp             |   10 +++++-----
 Src/DasherCore/ButtonMode.h               |    4 ++--
 Src/DasherCore/ButtonMultiPress.cpp       |    6 +++---
 Src/DasherCore/ButtonMultiPress.h         |    2 +-
 Src/DasherCore/ClickFilter.cpp            |    2 +-
 Src/DasherCore/ClickFilter.h              |    2 +-
 Src/DasherCore/DasherButtons.cpp          |    6 +++---
 Src/DasherCore/DasherButtons.h            |    4 ++--
 Src/DasherCore/DasherInterfaceBase.cpp    |    2 +-
 Src/DasherCore/DefaultFilter.cpp          |    2 +-
 Src/DasherCore/DefaultFilter.h            |    2 +-
 Src/DasherCore/DynamicFilter.cpp          |   22 ++++++++++------------
 Src/DasherCore/DynamicFilter.h            |    8 +++-----
 Src/DasherCore/InputFilter.h              |    8 ++++----
 Src/DasherCore/OneButtonDynamicFilter.cpp |   12 ++++++------
 Src/DasherCore/OneButtonDynamicFilter.h   |    4 ++--
 Src/DasherCore/OneButtonFilter.cpp        |    2 +-
 Src/DasherCore/OneButtonFilter.h          |    2 +-
 Src/DasherCore/StylusFilter.cpp           |    2 +-
 Src/DasherCore/StylusFilter.h             |    2 +-
 Src/DasherCore/TwoButtonDynamicFilter.cpp |   12 ++++++------
 Src/DasherCore/TwoButtonDynamicFilter.h   |    4 ++--
 Src/DasherCore/TwoPushDynamicFilter.cpp   |    8 ++++----
 Src/DasherCore/TwoPushDynamicFilter.h     |    4 ++--
 Src/iPhone/Classes/IPhoneFilters.h        |    4 ++--
 Src/iPhone/Classes/IPhoneFilters.mm       |    6 +++---
 28 files changed, 71 insertions(+), 75 deletions(-)
---
diff --git a/Src/DasherCore/AlternatingDirectMode.cpp b/Src/DasherCore/AlternatingDirectMode.cpp
index 68ae11c..f6cf6e0 100644
--- a/Src/DasherCore/AlternatingDirectMode.cpp
+++ b/Src/DasherCore/AlternatingDirectMode.cpp
@@ -90,7 +90,7 @@ bool CAlternatingDirectMode::DecorateView(CDasherView *pView, CDasherInput *pInp
 }
 
 
-void CAlternatingDirectMode::DirectKeyDown(int iTime, int iId, CDasherView *pView, CDasherModel *pModel, CUserLogBase *pUserLog) {
+void CAlternatingDirectMode::DirectKeyDown(int iTime, int iId, CDasherView *pView, CDasherModel *pModel) {
   int iTargetBox;
   switch(iId) {
     case 2:
diff --git a/Src/DasherCore/AlternatingDirectMode.h b/Src/DasherCore/AlternatingDirectMode.h
index 68ef25b..32ba0a9 100644
--- a/Src/DasherCore/AlternatingDirectMode.h
+++ b/Src/DasherCore/AlternatingDirectMode.h
@@ -34,7 +34,7 @@ namespace Dasher {
   void SetupBoxes();
 
  private:
-  void DirectKeyDown(int iTime, int iId, CDasherView *pView, CDasherModel *pModel, CUserLogBase *pUserLog);
+  void DirectKeyDown(int iTime, int iId, CDasherView *pView, CDasherModel *pModel);
 
   int m_iLastBox;
 };
diff --git a/Src/DasherCore/ButtonMode.cpp b/Src/DasherCore/ButtonMode.cpp
index 5e8134a..2ec74c6 100644
--- a/Src/DasherCore/ButtonMode.cpp
+++ b/Src/DasherCore/ButtonMode.cpp
@@ -188,7 +188,7 @@ bool CButtonMode::Timer(unsigned long Time, CDasherView *pView, CDasherInput *pI
   return CDasherButtons::Timer(Time, pView, pInput, pModel, pol);
 }
 
-void CButtonMode::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog, bool bPos, int iX, int iY)
+void CButtonMode::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY)
 {
   if (iId == 100 && !m_bMenu) {
     //Mouse!
@@ -200,17 +200,17 @@ void CButtonMode::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *
           iDasherY > m_pBoxes[i].iDisplayTop &&
           iDasherX < (m_pBoxes[i].iDisplayBottom - m_pBoxes[i].iDisplayTop)) {
         //user has clicked in box! Simulate press of appropriate (direct-mode) button...
-        CDasherButtons::KeyDown(iTime, (i==m_iNumBoxes-1) ? 1 : i+2, pView, pInput, pModel, pUserLog);
+        CDasherButtons::KeyDown(iTime, (i==m_iNumBoxes-1) ? 1 : i+2, pView, pInput, pModel);
         return;
       }
     }
     //not in any box. Fall through, just to be conservative...
   }
-  CInputFilter::KeyDown(iTime, iId, pView, pInput, pModel, pUserLog, bPos, iX, iY);
+  CInputFilter::KeyDown(iTime, iId, pView, pInput, pModel, bPos, iX, iY);
 }
 
-void CButtonMode::DirectKeyDown(int iTime, int iId, CDasherView *pView, CDasherModel *pModel, CUserLogBase *pUserLog) {
-  CDasherButtons::DirectKeyDown(iTime, iId, pView, pModel, pUserLog);
+void CButtonMode::DirectKeyDown(int iTime, int iId, CDasherView *pView, CDasherModel *pModel) {
+  CDasherButtons::DirectKeyDown(iTime, iId, pView, pModel);
  if (iId!=100) m_iLastTime = iTime;
 }
 
diff --git a/Src/DasherCore/ButtonMode.h b/Src/DasherCore/ButtonMode.h
index 8126207..e384ee8 100644
--- a/Src/DasherCore/ButtonMode.h
+++ b/Src/DasherCore/ButtonMode.h
@@ -28,12 +28,12 @@ class CButtonMode : public CDasherButtons
   bool DecorateView(CDasherView *pView, CDasherInput *pInput);
 
   //override to get mouse clicks/taps back again
-  virtual void KeyDown(int Time, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog, bool bPos, int iX, int iY);
+  virtual void KeyDown(int Time, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY);
   
   bool GetSettings(SModuleSettings **pSettings, int *iCount);
  protected: 
   void SetupBoxes();
-  void DirectKeyDown(int iTime, int iId, CDasherView *pView, CDasherModel *pModel, CUserLogBase *pUserLog);
+  void DirectKeyDown(int iTime, int iId, CDasherView *pView, CDasherModel *pModel);
  private:
   bool m_bHighlight;
   int m_iLastTime;
diff --git a/Src/DasherCore/ButtonMultiPress.cpp b/Src/DasherCore/ButtonMultiPress.cpp
index ce597d4..728ee33 100644
--- a/Src/DasherCore/ButtonMultiPress.cpp
+++ b/Src/DasherCore/ButtonMultiPress.cpp
@@ -27,7 +27,7 @@ CButtonMultiPress::CButtonMultiPress(CSettingsUser *pCreator, CDasherInterfaceBa
   : CDynamicFilter(pCreator, pInterface, iID, szName) {
 }
 
-void CButtonMultiPress::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog) {
+void CButtonMultiPress::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel) {
 
   if (m_bKeyDown) return;
 
@@ -40,7 +40,7 @@ void CButtonMultiPress::KeyDown(int iTime, int iId, CDasherView *pView, CDasherI
       //previous presses should not be treated as such....
       RevertPresses(m_deQueueTimes.size());
       //...but should be combined with this one into a new event (type = #presses)
-      Event(iTime, iId, m_deQueueTimes.size()+1, pModel, pUserLog);
+      Event(iTime, iId, m_deQueueTimes.size()+1, pModel);
       if (m_deQueueTimes.size() >= maxClickCount() - 1)
 	m_deQueueTimes.clear(); //final press
       else //may still be more presses to come
@@ -57,7 +57,7 @@ void CButtonMultiPress::KeyDown(int iTime, int iId, CDasherView *pView, CDasherI
   // Record press...
   m_deQueueTimes.push_back(iTime);
   // ... and process normally; if it changes the state, pause()/reverse()'ll clear the queue
-  CDynamicFilter::KeyDown(iTime, iId, pView, pInput, pModel, pUserLog);
+  CDynamicFilter::KeyDown(iTime, iId, pView, pInput, pModel);
 }
 
 void CButtonMultiPress::pause()
diff --git a/Src/DasherCore/ButtonMultiPress.h b/Src/DasherCore/ButtonMultiPress.h
index 9c2cb4d..9d56c92 100644
--- a/Src/DasherCore/ButtonMultiPress.h
+++ b/Src/DasherCore/ButtonMultiPress.h
@@ -33,7 +33,7 @@ class CButtonMultiPress : public CDynamicFilter {
  public:
   CButtonMultiPress(CSettingsUser *pCreator, CDasherInterfaceBase *pInterface, ModuleID_t iID, const char *szName);
 
-  virtual void KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog);
+  virtual void KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel);
 
  protected:
   virtual unsigned int maxClickCount()=0;
diff --git a/Src/DasherCore/ClickFilter.cpp b/Src/DasherCore/ClickFilter.cpp
index 7e10905..d7be0f2 100644
--- a/Src/DasherCore/ClickFilter.cpp
+++ b/Src/DasherCore/ClickFilter.cpp
@@ -83,7 +83,7 @@ bool CClickFilter::Timer(unsigned long Time, CDasherView *pView, CDasherInput *p
   return pModel->NextScheduledStep(Time);
 }
 
-void CClickFilter::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog, bool bPos, int iX, int iY) {
+void CClickFilter::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY) {
   switch(iId) {
   case 100: // Mouse clicks
     {
diff --git a/Src/DasherCore/ClickFilter.h b/Src/DasherCore/ClickFilter.h
index 3a1716d..e89f022 100644
--- a/Src/DasherCore/ClickFilter.h
+++ b/Src/DasherCore/ClickFilter.h
@@ -24,7 +24,7 @@ class CClickFilter : public CInputFilter, private CZoomAdjuster {
 
   virtual bool DecorateView(CDasherView *pView, CDasherInput *pInput);
   virtual bool Timer(unsigned long Time, CDasherView *pView, CDasherInput *pInput, CDasherModel *pDasherModel, CExpansionPolicy **pol);
-  virtual void KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog, bool bPos, int iX, int iY);
+  virtual void KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY);
   virtual bool GetSettings(SModuleSettings **pSettings, int *iCount);
   
  private:
diff --git a/Src/DasherCore/DasherButtons.cpp b/Src/DasherCore/DasherButtons.cpp
index fe70d89..dc89730 100644
--- a/Src/DasherCore/DasherButtons.cpp
+++ b/Src/DasherCore/DasherButtons.cpp
@@ -39,7 +39,7 @@ void CDasherButtons::Activate() {
   m_iScanTime = std::numeric_limits<int>::min();
 }
 
-void CDasherButtons::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog) {
+void CDasherButtons::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel) {
 
   if(m_bMenu) {
     switch(iId) {
@@ -61,12 +61,12 @@ void CDasherButtons::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInpu
     }
   }
   else {
-    DirectKeyDown(iTime, iId, pView, pModel, pUserLog);
+    DirectKeyDown(iTime, iId, pView, pModel);
   }
 
 }
 
-void CDasherButtons::DirectKeyDown(int iTime, int iId, CDasherView *pView, CDasherModel *pModel, CUserLogBase *pUserLog) {
+void CDasherButtons::DirectKeyDown(int iTime, int iId, CDasherView *pView, CDasherModel *pModel) {
   if(iId == 100) // Ignore mouse events
   return;
   if(iId == 1)
diff --git a/Src/DasherCore/DasherButtons.h b/Src/DasherCore/DasherButtons.h
index fb3de08..cf2fb6a 100644
--- a/Src/DasherCore/DasherButtons.h
+++ b/Src/DasherCore/DasherButtons.h
@@ -27,7 +27,7 @@ class CDasherButtons : public CInputFilter, protected CSettingsUser
 
   virtual bool DecorateView(CDasherView *pView, CDasherInput *pInput)=0;
   
-  void KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog);
+  void KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel);
   bool Timer(unsigned long Time, CDasherView *pView, CDasherInput *pInput, CDasherModel *m_pDasherModel, CExpansionPolicy **pol);
   void Activate();
   
@@ -47,7 +47,7 @@ class CDasherButtons : public CInputFilter, protected CSettingsUser
   int m_iNumBoxes, iActiveBox;
   int m_iScanTime;
   
-  virtual void DirectKeyDown(int iTime, int iId, CDasherView *pView, CDasherModel *pModel, CUserLogBase *pUserLog);
+  virtual void DirectKeyDown(int iTime, int iId, CDasherView *pView, CDasherModel *pModel);
 };
 }
 /// @}
diff --git a/Src/DasherCore/DasherInterfaceBase.cpp b/Src/DasherCore/DasherInterfaceBase.cpp
index b8bae0d..b94123a 100644
--- a/Src/DasherCore/DasherInterfaceBase.cpp
+++ b/Src/DasherCore/DasherInterfaceBase.cpp
@@ -743,7 +743,7 @@ void CDasherInterfaceBase::KeyDown(int iTime, int iId, bool bPos, int iX, int iY
     return;
 
   if(m_pInputFilter) {
-    m_pInputFilter->KeyDown(iTime, iId, m_pDasherView, m_pInput, m_pDasherModel, m_pUserLog, bPos, iX, iY);
+    m_pInputFilter->KeyDown(iTime, iId, m_pDasherView, m_pInput, m_pDasherModel, bPos, iX, iY);
   }
 
   if(m_pInput) {
diff --git a/Src/DasherCore/DefaultFilter.cpp b/Src/DasherCore/DefaultFilter.cpp
index 4fb1f79..74c9f6f 100644
--- a/Src/DasherCore/DefaultFilter.cpp
+++ b/Src/DasherCore/DefaultFilter.cpp
@@ -140,7 +140,7 @@ bool CDefaultFilter::Timer(unsigned long Time, CDasherView *pView, CDasherInput
   return bDidSomething;
 }
 
-void CDefaultFilter::KeyDown(int iTime, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog) {
+void CDefaultFilter::KeyDown(int iTime, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel) {
 
   switch(iId) {
   case 0: // Start on space
diff --git a/Src/DasherCore/DefaultFilter.h b/Src/DasherCore/DefaultFilter.h
index 53e06f1..1cbab7b 100644
--- a/Src/DasherCore/DefaultFilter.h
+++ b/Src/DasherCore/DefaultFilter.h
@@ -18,7 +18,7 @@ class CDefaultFilter : public CInputFilter, public CSettingsUserObserver {
 
   virtual bool DecorateView(CDasherView *pView, CDasherInput *pInput);
   virtual bool Timer(unsigned long Time, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CExpansionPolicy **pol);
-  virtual void KeyDown(int iTime, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog);
+  virtual void KeyDown(int iTime, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel);
   virtual void Activate();
   virtual void Deactivate();
   bool GetSettings(SModuleSettings **, int *);
diff --git a/Src/DasherCore/DynamicFilter.cpp b/Src/DasherCore/DynamicFilter.cpp
index 0de03c8..78f9410 100644
--- a/Src/DasherCore/DynamicFilter.cpp
+++ b/Src/DasherCore/DynamicFilter.cpp
@@ -33,7 +33,7 @@ CDynamicFilter::CDynamicFilter(CSettingsUser *pCreator, CDasherInterfaceBase *pI
 bool CDynamicFilter::Timer(unsigned long iTime, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *m_pDasherModel, CExpansionPolicy **pol)
 {
   if(m_bKeyDown && !m_bKeyHandled && ((iTime - m_iKeyDownTime) > GetLongParameter(LP_HOLD_TIME))) {
-    Event(iTime, m_iHeldId, 1, m_pDasherModel, m_pUserLog);
+    Event(iTime, m_iHeldId, 1, m_pDasherModel);
     m_bKeyHandled = true;
     //return true; //ACL although that's what old DynamicFilter did, surely we should progress normally?
   }
@@ -53,10 +53,8 @@ bool CDynamicFilter::Timer(unsigned long iTime, CDasherView *pDasherView, CDashe
   return TimerImpl(iTime, pDasherView, m_pDasherModel, pol);
 }
 
-void CDynamicFilter::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog) {
-  
-  m_pUserLog = pUserLog;
-  
+void CDynamicFilter::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel) {
+    
   if(((iId == 0) || (iId == 1) || (iId == 100)) && !GetBoolParameter(BP_BACKOFF_BUTTON))
     return;
 
@@ -64,7 +62,7 @@ void CDynamicFilter::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInpu
     return;
 
   // Pass the basic key down event to the handler
-  Event(iTime, iId, 0, pModel, pUserLog);
+  Event(iTime, iId, 0, pModel);
     
   // Store the key down time so that long presses can be determined
   // TODO: This is going to cause problems if multiple buttons are
@@ -80,7 +78,7 @@ void CDynamicFilter::KeyUp(int iTime, int iId, CDasherView *pView, CDasherInput
   if (iId == m_iHeldId) m_bKeyDown = false;
 }
 
-void CDynamicFilter::Event(int iTime, int iButton, int iType, CDasherModel *pModel, CUserLogBase *pUserLog) {
+void CDynamicFilter::Event(int iTime, int iButton, int iType, CDasherModel *pModel) {
   // Types known at this point in inheritance hierarchy:
   // 0 = ordinary click
   // 1 = long click
@@ -91,13 +89,13 @@ void CDynamicFilter::Event(int iTime, int iButton, int iType, CDasherModel *pMod
   // What happens next depends on the state:
   if (isPaused()) {
     //Any button causes a restart
-    if(pUserLog)
+    if(CUserLogBase *pUserLog=m_pInterface->GetUserLogPtr())
       pUserLog->KeyDown(iButton, iType, 1);
     run();
     m_pInterface->Unpause(iTime);
   } else if (isReversing()) {
     //Any button pauses
-    if(pUserLog)
+    if(CUserLogBase *pUserLog=m_pInterface->GetUserLogPtr())
       pUserLog->KeyDown(iButton, iType, 2);
     
     m_pInterface->Stop();
@@ -108,21 +106,21 @@ void CDynamicFilter::Event(int iTime, int iButton, int iType, CDasherModel *pMod
     case 0: //single press
       if((iButton == 0) || (iButton == 100)) {
         //dedicated pause button
-        if(pUserLog)
+        if(CUserLogBase *pUserLog=m_pInterface->GetUserLogPtr())
           pUserLog->KeyDown(iButton, iType, 2);
         m_pInterface->Stop();
         break;
       }
       else if(iButton == 1) {
         //dedicated reverse button
-        if(pUserLog)
+        if(CUserLogBase *pUserLog=m_pInterface->GetUserLogPtr())
           pUserLog->KeyDown(iButton, iType, 6);
         reverse();
         break;
       }
       //else - any non-special button - fall through
     default: //or, Any special kind of event - long, double, triple, ... 
-      ActionButton(iTime, iButton, iType, pModel, pUserLog);
+      ActionButton(iTime, iButton, iType, pModel);
     }
   }
 }
diff --git a/Src/DasherCore/DynamicFilter.h b/Src/DasherCore/DynamicFilter.h
index 035afbb..110809f 100644
--- a/Src/DasherCore/DynamicFilter.h
+++ b/Src/DasherCore/DynamicFilter.h
@@ -36,14 +36,14 @@ class CDynamicFilter : public CInputFilter, public CSettingsUserObserver {
   ///when reversing, backs off; when paused, does nothing; when running, delegates to TimerImpl
   virtual bool Timer(unsigned long Time, CDasherView *pView, CDasherInput *pInput, CDasherModel *m_pDasherModel, CExpansionPolicy **pol);
 
-  virtual void KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog);
+  virtual void KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel);
   virtual void KeyUp(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel);
 
   //respond to changes to BP_DASHER_PAUSED to keep m_iState in sync
   virtual void HandleEvent(int iParameter);
  protected:
-  virtual void ActionButton(int iTime, int iButton, int iType, CDasherModel *pModel, CUserLogBase *pUserLog) = 0;
-  virtual void Event(int iTime, int iButton, int iType, CDasherModel *pModel, CUserLogBase *pUserLog);
+  virtual void ActionButton(int iTime, int iButton, int iType, CDasherModel *pModel) = 0;
+  virtual void Event(int iTime, int iButton, int iType, CDasherModel *pModel);
 
   bool m_bKeyDown;
   bool m_bKeyHandled;
@@ -62,8 +62,6 @@ class CDynamicFilter : public CInputFilter, public CSettingsUserObserver {
     int m_iHeldId;
     int m_iKeyDownTime;
     unsigned int m_uSpeedControlTime;
-
-    CUserLogBase *m_pUserLog;
 };
 }
 #endif
diff --git a/Src/DasherCore/InputFilter.h b/Src/DasherCore/InputFilter.h
index fae357d..1a4521a 100644
--- a/Src/DasherCore/InputFilter.h
+++ b/Src/DasherCore/InputFilter.h
@@ -21,8 +21,8 @@ class CInputFilter : public CDasherModule {
 
   virtual bool DecorateView(CDasherView *pView, CDasherInput *pInput) { return false; };
 
-  virtual void KeyDown(int Time, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog, bool bPos, int iX, int iY) {
-    KeyDown(Time, iId, pDasherView, pInput, pModel, pUserLog);
+  virtual void KeyDown(int Time, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY) {
+    KeyDown(Time, iId, pDasherView, pInput, pModel);
   };
   virtual void KeyUp(int Time, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY) {
     KeyUp(Time, iId, pDasherView, pInput, pModel);
@@ -40,9 +40,9 @@ class CInputFilter : public CDasherModule {
   virtual bool supportsPause() {return false;}
   
  protected:
-  CDasherInterfaceBase *m_pInterface;
+  CDasherInterfaceBase * const m_pInterface;
 
-  virtual void KeyDown(int Time, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog) {};
+  virtual void KeyDown(int Time, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel) {};
   virtual void KeyUp(int Time, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel) {};
 };
 }
diff --git a/Src/DasherCore/OneButtonDynamicFilter.cpp b/Src/DasherCore/OneButtonDynamicFilter.cpp
index b636e7f..4ffc3b7 100644
--- a/Src/DasherCore/OneButtonDynamicFilter.cpp
+++ b/Src/DasherCore/OneButtonDynamicFilter.cpp
@@ -97,13 +97,13 @@ bool COneButtonDynamicFilter::DecorateView(CDasherView *pView, CDasherInput *pIn
   return bRV;
 }
 
-void COneButtonDynamicFilter::KeyDown(int Time, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog, bool bPos, int iX, int iY) {
+void COneButtonDynamicFilter::KeyDown(int Time, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY) {
   if (iId == 100 && !GetBoolParameter(BP_BACKOFF_BUTTON))
     //mouse click - will be ignored by superclass method.
     //simulate press of button 2...
-    CButtonMultiPress::KeyDown(Time, 2, pDasherView, pInput, pModel, pUserLog);
+    CButtonMultiPress::KeyDown(Time, 2, pDasherView, pInput, pModel);
   else
-    CInputFilter::KeyDown(Time, iId, pDasherView, pInput, pModel, pUserLog, bPos, iX, iY);
+    CInputFilter::KeyDown(Time, iId, pDasherView, pInput, pModel, bPos, iX, iY);
 }
 
 void COneButtonDynamicFilter::KeyUp(int Time, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY) {
@@ -120,7 +120,7 @@ bool COneButtonDynamicFilter::TimerImpl(unsigned long Time, CDasherView *m_pDash
   return true;
 }
 
-void COneButtonDynamicFilter::ActionButton(int iTime, int iButton, int iType, CDasherModel *pModel, CUserLogBase *pUserLog) {
+void COneButtonDynamicFilter::ActionButton(int iTime, int iButton, int iType, CDasherModel *pModel) {
   if (iType != 0) {
     //double/long push
     reverse();
@@ -128,13 +128,13 @@ void COneButtonDynamicFilter::ActionButton(int iTime, int iButton, int iType, CD
   }
     
   if((iButton == 2) || (iButton == 3) || (iButton == 4)) {
-    if(pUserLog)
+    if(CUserLogBase *pUserLog=m_pInterface->GetUserLogPtr())
       pUserLog->KeyDown(iButton, iType, 5);
     m_iTarget = 1 - m_iTarget;
     m_bDecorationChanged = true;
   }
   else {
-    if(pUserLog)
+    if(CUserLogBase *pUserLog=m_pInterface->GetUserLogPtr())
       pUserLog->KeyDown(iButton, iType, 0);
   }
 }
diff --git a/Src/DasherCore/OneButtonDynamicFilter.h b/Src/DasherCore/OneButtonDynamicFilter.h
index 768b4fd..29d8ba8 100644
--- a/Src/DasherCore/OneButtonDynamicFilter.h
+++ b/Src/DasherCore/OneButtonDynamicFilter.h
@@ -36,13 +36,13 @@ class COneButtonDynamicFilter : public CButtonMultiPress {
   virtual bool GetSettings(SModuleSettings **pSettings, int *iCount);
 
   //override to get mouse clicks / taps back again...
-  virtual void KeyDown(int Time, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog, bool bPos, int iX, int iY);
+  virtual void KeyDown(int Time, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY);
   virtual void KeyUp(int Time, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY);
 
  private:
   unsigned int maxClickCount() {return 2;} //double-click to reverse
   virtual bool TimerImpl(unsigned long Time, CDasherView *pView, CDasherModel *m_pDasherModel, CExpansionPolicy **pol);
-  virtual void ActionButton(int iTime, int iButton, int iType, CDasherModel *pModel, CUserLogBase *pUserLog);
+  virtual void ActionButton(int iTime, int iButton, int iType, CDasherModel *pModel);
   
   int m_iTarget;
 
diff --git a/Src/DasherCore/OneButtonFilter.cpp b/Src/DasherCore/OneButtonFilter.cpp
index a3bde6d..f5e8a60 100644
--- a/Src/DasherCore/OneButtonFilter.cpp
+++ b/Src/DasherCore/OneButtonFilter.cpp
@@ -70,7 +70,7 @@ bool COneButtonFilter::Timer(unsigned long Time, CDasherView *pView, CDasherInpu
   return m_pDasherModel->NextScheduledStep(Time);
 }
 
-void COneButtonFilter::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog) {
+void COneButtonFilter::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel) {
   if (bStarted) {
     if (iLocation == 0) {
       //back up by one zoom step.
diff --git a/Src/DasherCore/OneButtonFilter.h b/Src/DasherCore/OneButtonFilter.h
index 7fedb79..747fffc 100644
--- a/Src/DasherCore/OneButtonFilter.h
+++ b/Src/DasherCore/OneButtonFilter.h
@@ -13,7 +13,7 @@ class COneButtonFilter : public CInputFilter, private CSettingsUser {
 
   virtual bool DecorateView(CDasherView *pView, CDasherInput *pInput);
   virtual bool Timer(unsigned long Time, CDasherView *pView, CDasherInput *pInput, CDasherModel *m_pDasherModel, CExpansionPolicy **pol);
-  virtual void KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog);
+  virtual void KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel);
   bool GetSettings(SModuleSettings **pSettings, int *iCount);
  private:
   ///true iff the scan line is moving down/up, or is in the 'reverse' stage
diff --git a/Src/DasherCore/StylusFilter.cpp b/Src/DasherCore/StylusFilter.cpp
index 9f5d9e7..4d512e9 100644
--- a/Src/DasherCore/StylusFilter.cpp
+++ b/Src/DasherCore/StylusFilter.cpp
@@ -22,7 +22,7 @@ bool CStylusFilter::Timer(unsigned long iTime, CDasherView *pView, CDasherInput
   return CDefaultFilter::Timer(iTime, pView, pInput, pModel, pol);
 }
 
-void CStylusFilter::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog) {
+void CStylusFilter::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel) {
   if(iId == 100) {
     pModel->ClearScheduledSteps();
     m_pInterface->Unpause(iTime);
diff --git a/Src/DasherCore/StylusFilter.h b/Src/DasherCore/StylusFilter.h
index adb7f6e..6da5758 100644
--- a/Src/DasherCore/StylusFilter.h
+++ b/Src/DasherCore/StylusFilter.h
@@ -14,7 +14,7 @@ class CStylusFilter : public CDefaultFilter {
   /// - motion requires continually holding stylus against screen
   virtual bool supportsPause() {return false;}
   virtual bool Timer(unsigned long Time, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CExpansionPolicy **pol);
-  virtual void KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog);
+  virtual void KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel);
   virtual void KeyUp(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel);
  protected:
   ///Transform coordinates of a click, to get location to zoom into.
diff --git a/Src/DasherCore/TwoButtonDynamicFilter.cpp b/Src/DasherCore/TwoButtonDynamicFilter.cpp
index 1fc830d..2491c07 100644
--- a/Src/DasherCore/TwoButtonDynamicFilter.cpp
+++ b/Src/DasherCore/TwoButtonDynamicFilter.cpp
@@ -92,13 +92,13 @@ bool CTwoButtonDynamicFilter::DecorateView(CDasherView *pView, CDasherInput *pIn
   return bRV;
 }
 
-void CTwoButtonDynamicFilter::KeyDown(int Time, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog, bool bPos, int iX, int iY) {
+void CTwoButtonDynamicFilter::KeyDown(int Time, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY) {
 	if (iId == 100 && !GetBoolParameter(BP_BACKOFF_BUTTON))
 		//mouse click - will be ignored by superclass method.
 		//simulate press of button 2/3 according to whether click in top/bottom half
-		CButtonMultiPress::KeyDown(Time, (iY < pView->Screen()->GetHeight()/2) ? 2 : 3, pView, pInput, pModel, pUserLog);
+		CButtonMultiPress::KeyDown(Time, (iY < pView->Screen()->GetHeight()/2) ? 2 : 3, pView, pInput, pModel);
 	else
-		CInputFilter::KeyDown(Time, iId, pView, pInput, pModel, pUserLog, bPos, iX, iY);
+		CInputFilter::KeyDown(Time, iId, pView, pInput, pModel, bPos, iX, iY);
 }
 
 void CTwoButtonDynamicFilter::KeyUp(int Time, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY) {
@@ -140,7 +140,7 @@ void CTwoButtonDynamicFilter::reverse() {
   CButtonMultiPress::reverse();
 }
 
-void CTwoButtonDynamicFilter::ActionButton(int iTime, int iButton, int iType, CDasherModel *pModel, CUserLogBase *pUserLog) {
+void CTwoButtonDynamicFilter::ActionButton(int iTime, int iButton, int iType, CDasherModel *pModel) {
   
   double dFactor(GetBoolParameter(BP_TWOBUTTON_REVERSE) ? -1.0 : 1.0);
   int iEffect; //for user log
@@ -166,7 +166,7 @@ void CTwoButtonDynamicFilter::ActionButton(int iTime, int iButton, int iType, CD
     //fall through to apply offset
   }
   else {
-    if(pUserLog)
+    if(CUserLogBase *pUserLog=m_pInterface->GetUserLogPtr())
       pUserLog->KeyDown(iButton, iType, 0);
     return;
   }
@@ -175,7 +175,7 @@ void CTwoButtonDynamicFilter::ActionButton(int iTime, int iButton, int iType, CD
   pModel->Offset(iOffset);
   pModel->ResetNats();
   
-  if(pUserLog)
+  if(CUserLogBase *pUserLog=m_pInterface->GetUserLogPtr())
     pUserLog->KeyDown(iButton, iType, iEffect);  
 }
 
diff --git a/Src/DasherCore/TwoButtonDynamicFilter.h b/Src/DasherCore/TwoButtonDynamicFilter.h
index b16762e..a9f0b2b 100644
--- a/Src/DasherCore/TwoButtonDynamicFilter.h
+++ b/Src/DasherCore/TwoButtonDynamicFilter.h
@@ -50,13 +50,13 @@ class CTwoButtonDynamicFilter : public CButtonMultiPress {
   virtual void reverse();
 
   //override to inspect x,y coords of mouse clicks/taps
-  virtual void KeyDown(int Time, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog, bool bPos, int iX, int iY);
+  virtual void KeyDown(int Time, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY);
   virtual void KeyUp(int Time, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY);
 	
  private:
   unsigned int maxClickCount() {return GetBoolParameter(BP_2B_INVERT_DOUBLE) ? 3 : 2;}
   virtual bool TimerImpl(unsigned long Time, CDasherView *m_pDasherView, CDasherModel *m_pDasherModel, CExpansionPolicy **pol);
-  virtual void ActionButton(int iTime, int iButton, int iType, CDasherModel *pModel, CUserLogBase *pUserLog);
+  virtual void ActionButton(int iTime, int iButton, int iType, CDasherModel *pModel);
   double m_dLagMul;
 
   void ApplyOffset(CDasherModel *pModel, long lOffset);
diff --git a/Src/DasherCore/TwoPushDynamicFilter.cpp b/Src/DasherCore/TwoPushDynamicFilter.cpp
index d0de1de..21972ee 100644
--- a/Src/DasherCore/TwoPushDynamicFilter.cpp
+++ b/Src/DasherCore/TwoPushDynamicFilter.cpp
@@ -167,13 +167,13 @@ m_bDecorationChanged = true;
   }
 }
 
-void CTwoPushDynamicFilter::KeyDown(int Time, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog, bool bPos, int iX, int iY) {
+void CTwoPushDynamicFilter::KeyDown(int Time, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY) {
   if (iId == 100 && !GetBoolParameter(BP_BACKOFF_BUTTON))
     //mouse click - will be ignored by superclass method.
     //simulate press of button 2...
-    CDynamicFilter::KeyDown(Time, 2, pView, pInput, pModel, pUserLog);
+    CDynamicFilter::KeyDown(Time, 2, pView, pInput, pModel);
   else
-    CInputFilter::KeyDown(Time, iId, pView, pInput, pModel, pUserLog, bPos, iX, iY);
+    CInputFilter::KeyDown(Time, iId, pView, pInput, pModel, bPos, iX, iY);
 }
 
 void CTwoPushDynamicFilter::KeyUp(int Time, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY) {
@@ -185,7 +185,7 @@ void CTwoPushDynamicFilter::KeyUp(int Time, int iId, CDasherView *pView, CDasher
     CInputFilter::KeyUp(Time, iId, pView, pInput, pModel, bPos, iX, iY);
 }
 
-void CTwoPushDynamicFilter::ActionButton(int iTime, int iButton, int iType, CDasherModel *pModel, CUserLogBase *pUserLog) {
+void CTwoPushDynamicFilter::ActionButton(int iTime, int iButton, int iType, CDasherModel *pModel) {
   // Types:
   // 0 = ordinary click
   // 1 = long click
diff --git a/Src/DasherCore/TwoPushDynamicFilter.h b/Src/DasherCore/TwoPushDynamicFilter.h
index 31f6545..2bd73fd 100644
--- a/Src/DasherCore/TwoPushDynamicFilter.h
+++ b/Src/DasherCore/TwoPushDynamicFilter.h
@@ -36,12 +36,12 @@ class CTwoPushDynamicFilter : public CDynamicFilter /*long push, but do our own
   virtual bool GetSettings(SModuleSettings **pSettings, int *iCount);
 
   //override to get mouse clicks / taps back again...
-  virtual void KeyDown(int Time, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog, bool bPos, int iX, int iY);
+  virtual void KeyDown(int Time, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY);
   virtual void KeyUp(int Time, int iId, CDasherView *pDasherView, CDasherInput *pInput, CDasherModel *pModel, bool bPos, int iX, int iY);
 
  protected:
   virtual bool TimerImpl(unsigned long Time, CDasherView *m_pDasherView, CDasherModel *m_pDasherModel, CExpansionPolicy **pol);
-  virtual void ActionButton(int iTime, int iButton, int iType, CDasherModel *pModel, CUserLogBase *pUserLog);
+  virtual void ActionButton(int iTime, int iButton, int iType, CDasherModel *pModel);
 
   virtual void HandleEvent(int iParameter);
 
diff --git a/Src/iPhone/Classes/IPhoneFilters.h b/Src/iPhone/Classes/IPhoneFilters.h
index 36e2366..20e2133 100644
--- a/Src/iPhone/Classes/IPhoneFilters.h
+++ b/Src/iPhone/Classes/IPhoneFilters.h
@@ -37,7 +37,7 @@ class CIPhoneTiltFilter : public COneDimensionalFilter, private IPhonePrefsObser
 public:
 	CIPhoneTiltFilter(CSettingsUser *pCreator, CDasherInterfaceBase *pInterface, ModuleID_t iID, CDasherInput *pTouch);
   ///override to enable hold-to-go
-	virtual void KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog);
+	virtual void KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel);
   ///override to enable hold-to-go
 	virtual void KeyUp(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel);
 
@@ -73,4 +73,4 @@ private:
   bool bUseTiltX;
 };
 
-/// @}
\ No newline at end of file
+/// @}
diff --git a/Src/iPhone/Classes/IPhoneFilters.mm b/Src/iPhone/Classes/IPhoneFilters.mm
index 3f3a6dd..3c341a3 100644
--- a/Src/iPhone/Classes/IPhoneFilters.mm
+++ b/Src/iPhone/Classes/IPhoneFilters.mm
@@ -82,10 +82,10 @@ void CIPhoneTiltFilter::ApplyTransform(myint &iDasherX, myint &iDasherY, CDasher
   }
 }
 
-void CIPhoneTiltFilter::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel, CUserLogBase *pUserLog) {
+void CIPhoneTiltFilter::KeyDown(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel) {
 	if(iId == 100 && bHoldToGo)
 		m_pInterface->Unpause(iTime);
-  else COneDimensionalFilter::KeyDown(iTime, iId, pView, pInput, pModel, pUserLog);
+  else COneDimensionalFilter::KeyDown(iTime, iId, pView, pInput, pModel);
 }
 
 void CIPhoneTiltFilter::KeyUp(int iTime, int iId, CDasherView *pView, CDasherInput *pInput, CDasherModel *pModel) {
@@ -171,4 +171,4 @@ void CIPhoneTouchFilter::ApplyTransform(myint &iDasherX, myint &iDasherY, CDashe
     m_pTilt->GetDasherCoords(iDasherX,temp,pView);
   }
   CStylusFilter::ApplyTransform(iDasherX, iDasherY, pView);
-}
\ No newline at end of file
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]