Commit 7b7a3316 authored by Maciej Suminski's avatar Maciej Suminski

Added some const modifiers.

parent d1578e4e
......@@ -25,25 +25,25 @@
#include <tool/tool_event.h>
#include <tool/tool_manager.h>
KiGfx::VIEW* TOOL_BASE::getView()
KiGfx::VIEW* TOOL_BASE::getView() const
{
return m_toolMgr->GetView();
}
KiGfx::VIEW_CONTROLS* TOOL_BASE::getViewControls()
KiGfx::VIEW_CONTROLS* TOOL_BASE::getViewControls() const
{
return m_toolMgr->GetViewControls();
}
wxWindow* TOOL_BASE::getEditFrameInt()
wxWindow* TOOL_BASE::getEditFrameInt() const
{
return m_toolMgr->GetEditFrame();
}
EDA_ITEM* TOOL_BASE::getModelInt()
EDA_ITEM* TOOL_BASE::getModelInt() const
{
return m_toolMgr->GetModel();
}
......@@ -80,7 +80,7 @@ public:
return m_toolName;
}
TOOL_MANAGER* GetManager()
TOOL_MANAGER* GetManager() const
{
return m_toolMgr;
}
......@@ -96,8 +96,8 @@ protected:
*/
void attachManager( TOOL_MANAGER* aManager );
KiGfx::VIEW* getView();
KiGfx::VIEW_CONTROLS* getViewControls();
KiGfx::VIEW* getView() const;
KiGfx::VIEW_CONTROLS* getViewControls() const;
/**
* Function getEditFrame()
......@@ -106,7 +106,7 @@ protected:
* run-time type check
*/
template<typename T>
T* getEditFrame()
T* getEditFrame() const
{
return static_cast<T*>( getEditFrameInt() );
}
......@@ -117,10 +117,10 @@ protected:
* Returns the model object if it matches the requested type.
*/
template<typename T>
T* getModel( KICAD_T modelType )
T* getModel( KICAD_T modelType ) const
{
EDA_ITEM* m = getModelInt();
// assert(modelType == m->Type());
return static_cast<T*>( m );
}
......@@ -132,8 +132,8 @@ protected:
private:
// hide the implementation to avoid spreading half of
// kicad and wxWidgets headers to the tools that may not need them at all!
EDA_ITEM* getModelInt();
wxWindow* getEditFrameInt();
EDA_ITEM* getModelInt() const;
wxWindow* getEditFrameInt() const;
};
#endif
......@@ -144,22 +144,22 @@ public:
KiGfx::VIEW_CONTROLS* aViewControls, wxWindow* aFrame );
/* Accessors for the environment objects (view, model, etc.) */
KiGfx::VIEW* GetView()
KiGfx::VIEW* GetView() const
{
return m_view;
}
KiGfx::VIEW_CONTROLS* GetViewControls()
KiGfx::VIEW_CONTROLS* GetViewControls() const
{
return m_viewControls;
}
EDA_ITEM* GetModel()
EDA_ITEM* GetModel() const
{
return m_model;
}
wxWindow* GetEditFrame()
wxWindow* GetEditFrame() const
{
return m_editFrame;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment