From e70a0e4e0e6f24600f39dbaf95c67edecb5d4ac2 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 19 Aug 2013 09:47:36 +0200 Subject: [PATCH] Reformatting. --- common/tool/tool_dispatcher.cpp | 2 +- common/tool/tool_manager.cpp | 4 ++-- include/tool/tool_base.h | 8 +++----- include/tool/tool_event.h | 6 +++--- include/tool/tool_interactive.h | 24 ++++++++++++++---------- include/tool/tool_manager.h | 8 ++++---- include/view/view_item.h | 17 ++++++++--------- pcbnew/pcbnew_id.h | 3 +-- 8 files changed, 36 insertions(+), 36 deletions(-) diff --git a/common/tool/tool_dispatcher.cpp b/common/tool/tool_dispatcher.cpp index 8a73cee15e..5eb905af23 100644 --- a/common/tool/tool_dispatcher.cpp +++ b/common/tool/tool_dispatcher.cpp @@ -207,7 +207,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent &aEvent ) if( type == wxEVT_MOTION ) { - wxMouseEvent *me = static_cast(&aEvent ); + wxMouseEvent *me = static_cast( &aEvent ); pos = getView()->ToWorld( VECTOR2D( me->GetX(), me->GetY() ) ); if( pos != m_lastMousePos ) { diff --git a/common/tool/tool_manager.cpp b/common/tool/tool_manager.cpp index f659b681b0..c3082eca70 100644 --- a/common/tool/tool_manager.cpp +++ b/common/tool/tool_manager.cpp @@ -100,10 +100,10 @@ void TOOL_MANAGER::ScheduleNextState( TOOL_BASE *aTool, TOOL_STATE_FUNC& aHandle } -optional TOOL_MANAGER::ScheduleWait( TOOL_BASE *aTool, +optional TOOL_MANAGER::ScheduleWait( TOOL_BASE* aTool, const TOOL_EVENT_LIST& aConditions ) { - ToolState *st = m_toolState[aTool]; + ToolState* st = m_toolState[aTool]; st->pendingWait = true; st->waitEvents = aConditions; diff --git a/include/tool/tool_base.h b/include/tool/tool_base.h index ca686b0ddb..0925e4edb1 100644 --- a/include/tool/tool_base.h +++ b/include/tool/tool_base.h @@ -58,7 +58,6 @@ typedef DELEGATE TOOL_STATE_FUNC; class TOOL_BASE { public: - TOOL_BASE( TOOL_Type aType, TOOL_ID aId, const std::string& aName = std::string( "" ) ) : m_type( aType ), m_toolId( aId ), @@ -95,7 +94,7 @@ protected: * Sets the TOOL_MANAGER the tool will belong to. * Called by TOOL_MANAGER::RegisterTool() */ - void attachManager( TOOL_MANAGER *aManager ); + void attachManager( TOOL_MANAGER* aManager ); KiGfx::VIEW* getView(); KiGfx::VIEW_CONTROLS* getViewControls(); @@ -107,7 +106,7 @@ protected: * run-time type check */ template - T *getEditFrame() + T* getEditFrame() { return static_cast( getEditFrameInt() ); } @@ -120,12 +119,11 @@ protected: template T* getModel( KICAD_T modelType ) { - EDA_ITEM *m = getModelInt(); + EDA_ITEM* m = getModelInt(); // assert(modelType == m->Type()); return static_cast( m ); } -protected: TOOL_Type m_type; TOOL_ID m_toolId; std::string m_toolName; diff --git a/include/tool/tool_event.h b/include/tool/tool_event.h index d5dec8525d..8a771a9297 100644 --- a/include/tool/tool_event.h +++ b/include/tool/tool_event.h @@ -98,7 +98,7 @@ enum TOOL_MouseButtons enum TOOL_ContextMenuTrigger { CMENU_BUTTON = 0, // On the right button - CMENU_NOW, // Right now (after TOOL_INTERACTIVE::SetContxtMenu) + CMENU_NOW, // Right now (after TOOL_INTERACTIVE::SetContextMenu) CMENU_OFF // Never }; @@ -217,10 +217,10 @@ public: bool Matches( const TOOL_EVENT& aEvent ) const { - if( ! ( m_category & aEvent.m_category ) ) + if( !( m_category & aEvent.m_category ) ) return false; - if( ! ( m_actions & aEvent.m_actions ) ) + if( !( m_actions & aEvent.m_actions ) ) return false; if( m_category == TC_Command ) diff --git a/include/tool/tool_interactive.h b/include/tool/tool_interactive.h index 10b7250588..4703c420b7 100644 --- a/include/tool/tool_interactive.h +++ b/include/tool/tool_interactive.h @@ -49,14 +49,14 @@ public: * Brings the tool to a known, initial state. If the tool claimed anything from the model or the view, * it must release it when its reset. */ - virtual void Reset ( ) = 0; + virtual void Reset() = 0; /** * Function SetContextMenu() * * Assigns a context menu and tells when it should be activated */ - void SetContextMenu( CONTEXT_MENU *aMenu, TOOL_ContextMenuTrigger aTrigger = CMENU_BUTTON ); + void SetContextMenu( CONTEXT_MENU* aMenu, TOOL_ContextMenuTrigger aTrigger = CMENU_BUTTON ); /** * Function Go() @@ -65,7 +65,8 @@ public: * No conditions means any event. */ template - void Go ( int (T::*aStateFunc)( TOOL_EVENT& ), const TOOL_EVENT_LIST & aConditions = TOOL_EVENT( TC_Any, TA_Any ) ); + void Go( int (T::*aStateFunc)( TOOL_EVENT& ), + const TOOL_EVENT_LIST& aConditions = TOOL_EVENT( TC_Any, TA_Any ) ); /** * Function Wait() @@ -73,25 +74,27 @@ public: * Suspends execution of the tool until an event specified in aEventList arrives. * No parameters means waiting for any event. */ - OPT_TOOL_EVENT Wait ( const TOOL_EVENT_LIST & aEventList = TOOL_EVENT ( TC_Any, TA_Any ) ); + OPT_TOOL_EVENT Wait( const TOOL_EVENT_LIST& aEventList = TOOL_EVENT ( TC_Any, TA_Any ) ); /** functions below are not yet implemented - their interface may change */ template - bool InvokeTool ( const std::string& aToolName, const Parameters& parameters, ReturnValue& returnValue ); + bool InvokeTool( const std::string& aToolName, const Parameters& parameters, + ReturnValue& returnValue ); template - bool InvokeWindow ( const std::string& aWindowName, const Parameters& parameters, ReturnValue& returnValue ); + bool InvokeWindow( const std::string& aWindowName, const Parameters& parameters, + ReturnValue& returnValue ); template - void Yield ( const T& returnValue ); + void Yield( const T& returnValue ); protected: /* helper functions for constructing events for Wait() and Go() with less typing */ const TOOL_EVENT evActivate( std::string aToolName = "" ); const TOOL_EVENT evCommand( int aCommandId = -1 ); - const TOOL_EVENT evCommand( std::string aCommandStr = ""); + const TOOL_EVENT evCommand( std::string aCommandStr = "" ); const TOOL_EVENT evMotion(); const TOOL_EVENT evClick( int aButton = MB_Any ); const TOOL_EVENT evDrag( int aButton = MB_Any ); @@ -104,9 +107,10 @@ private: // hide TOOL_MANAGER implementation template -void TOOL_INTERACTIVE::Go( int (T::*aStateFunc)( TOOL_EVENT& ), const TOOL_EVENT_LIST& aConditions ) +void TOOL_INTERACTIVE::Go( int (T::*aStateFunc)( TOOL_EVENT& ), + const TOOL_EVENT_LIST& aConditions ) { - TOOL_STATE_FUNC sptr (static_cast( this ), aStateFunc); + TOOL_STATE_FUNC sptr( static_cast( this ), aStateFunc ); goInternal( sptr, aConditions ); } diff --git a/include/tool/tool_manager.h b/include/tool/tool_manager.h index f428806a0b..36599977a0 100644 --- a/include/tool/tool_manager.h +++ b/include/tool/tool_manager.h @@ -73,17 +73,17 @@ public: * An user-defined parameter object can be also passed */ void InvokeTool( TOOL_ID aToolId ); - void InvokeTool( const std::string& name ); + void InvokeTool( const std::string& aName ); template - void InvokeTool( const std::string& name, const Parameters& aToolParams ); + void InvokeTool( const std::string& aName, const Parameters& aToolParams ); /** * Function FindTool() * Searches for a tool with given name or ID */ - TOOL_BASE* FindTool( int aId ); - TOOL_BASE* FindTool( const std::string& aName ); + TOOL_BASE* FindTool( int aId ) const; + TOOL_BASE* FindTool( const std::string& aName ) const; /** * Resets the state of a given tool by clearing its wait and diff --git a/include/view/view_item.h b/include/view/view_item.h index 1cdc67f3e6..17325d338b 100644 --- a/include/view/view_item.h +++ b/include/view/view_item.h @@ -124,7 +124,7 @@ public: /** * Function ViewIsVisible() - * Returns if the item is visible (or not). + * Returns information if the item is visible (or not). * * @return when true, the item is visible (i.e. to be displayed, not visible in the * *current* viewport) @@ -160,7 +160,7 @@ public: * Function ViewRelease() * Releases the item from an associated dynamic VIEW. For static views calling has no effect. */ - void ViewRelease(); + virtual void ViewRelease(); protected: friend class VIEW; @@ -171,7 +171,7 @@ protected: * * @param aView[]: dynamic VIEW instance the item is being added to. */ - void viewAssign( VIEW* aView ) + virtual void viewAssign( VIEW* aView ) { // release the item from a previously assigned dynamic view (if there is any) ViewRelease(); @@ -182,7 +182,6 @@ protected: VIEW* m_view; ///* Current dynamic view the item is assigned to. bool m_visible; ///* Are we visible in the current dynamic VIEW. -private: ///* Helper for storing cached items group ids typedef std::pair GroupPair; @@ -198,7 +197,7 @@ private: * @param aLayer is the layer number for which group id is queried. * @return group id or -1 in case there is no group id (ie. item is not cached). */ - int getGroup( int aLayer ) const; + virtual int getGroup( int aLayer ) const; /** * Function getAllGroups() @@ -206,7 +205,7 @@ private: * * @return vector of group ids. */ - std::vector getAllGroups() const; + virtual std::vector getAllGroups() const; /** * Function setGroup() @@ -215,13 +214,13 @@ private: * @param aLayer is the layer numbe. * @param aGroup is the group id. */ - void setGroup( int aLayer, int aGroup ); + virtual void setGroup( int aLayer, int aGroup ); /** * Function deleteGroups() * Removes all of the stored group ids. Forces recaching of the item. */ - void deleteGroups(); + virtual void deleteGroups(); /** * Function storesGroups() @@ -229,7 +228,7 @@ private: * * @returns true in case it is cached at least for one layer. */ - bool storesGroups() const; + virtual bool storesGroups() const; }; } // namespace KiGfx diff --git a/pcbnew/pcbnew_id.h b/pcbnew/pcbnew_id.h index 64329eb5c8..ba479ffe65 100644 --- a/pcbnew/pcbnew_id.h +++ b/pcbnew/pcbnew_id.h @@ -366,8 +366,7 @@ enum pcbnew_ids ID_FOOTPRINT_WIZARD_SELECT_WIZARD, ID_FOOTPRINT_WIZARD_EXPORT_TO_BOARD, - ID_SELECTION_TOOL - + ID_SELECTION_TOOL }; #endif // PCBNEW_ID_H_