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

Added some const modifiers.

parent d1578e4e
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -25,25 +25,25 @@
#include <tool/tool_event.h>
#include <tool/tool_event.h>
#include <tool/tool_manager.h>
#include <tool/tool_manager.h>


KiGfx::VIEW* TOOL_BASE::getView()
KiGfx::VIEW* TOOL_BASE::getView() const
{
{
	return m_toolMgr->GetView();
	return m_toolMgr->GetView();
}
}




KiGfx::VIEW_CONTROLS* TOOL_BASE::getViewControls()
KiGfx::VIEW_CONTROLS* TOOL_BASE::getViewControls() const
{	
{	
	return m_toolMgr->GetViewControls();
	return m_toolMgr->GetViewControls();
}
}




wxWindow* TOOL_BASE::getEditFrameInt()
wxWindow* TOOL_BASE::getEditFrameInt() const
{
{
	return m_toolMgr->GetEditFrame();
	return m_toolMgr->GetEditFrame();
}
}




EDA_ITEM* TOOL_BASE::getModelInt()
EDA_ITEM* TOOL_BASE::getModelInt() const
{
{
	return m_toolMgr->GetModel();
	return m_toolMgr->GetModel();
}
}
+8 −8
Original line number Original line Diff line number Diff line
@@ -80,7 +80,7 @@ public:
		return m_toolName;
		return m_toolName;
	}
	}


	TOOL_MANAGER* GetManager()
	TOOL_MANAGER* GetManager() const
	{
	{
		return m_toolMgr;
		return m_toolMgr;
	}
	}
@@ -96,8 +96,8 @@ protected:
	 */
	 */
	void attachManager( TOOL_MANAGER* aManager );
	void attachManager( TOOL_MANAGER* aManager );


	KiGfx::VIEW* getView();
	KiGfx::VIEW* getView() const;
	KiGfx::VIEW_CONTROLS* getViewControls();
	KiGfx::VIEW_CONTROLS* getViewControls() const;
	
	
	/**
	/**
	 * Function getEditFrame()
	 * Function getEditFrame()
@@ -106,7 +106,7 @@ protected:
	 * run-time type check
	 * run-time type check
	 */
	 */
	template<typename T>
	template<typename T>
	T* getEditFrame()
	T* getEditFrame() const
	{
	{
		return static_cast<T*>( getEditFrameInt() );
		return static_cast<T*>( getEditFrameInt() );
	}
	}
@@ -117,10 +117,10 @@ protected:
	 * Returns the model object if it matches the requested type.
	 * Returns the model object if it matches the requested type.
	 */
	 */
	template<typename T> 
	template<typename T> 
	T* getModel( KICAD_T modelType ) 
	T* getModel( KICAD_T modelType ) const
	{
	{
		EDA_ITEM* m = getModelInt();
		EDA_ITEM* m = getModelInt();
//		assert(modelType == m->Type());

		return static_cast<T*>( m );
		return static_cast<T*>( m );
	}
	}


@@ -132,8 +132,8 @@ protected:
private:
private:
	// hide the implementation to avoid spreading half of
	// hide the implementation to avoid spreading half of
	// kicad and wxWidgets headers to the tools that may not need them at all!
	// kicad and wxWidgets headers to the tools that may not need them at all!
	EDA_ITEM* getModelInt();
	EDA_ITEM* getModelInt() const;
	wxWindow* getEditFrameInt();
	wxWindow* getEditFrameInt() const;
};
};


#endif
#endif
+4 −4
Original line number Original line Diff line number Diff line
@@ -144,22 +144,22 @@ public:
                         KiGfx::VIEW_CONTROLS* aViewControls, wxWindow* aFrame );
                         KiGfx::VIEW_CONTROLS* aViewControls, wxWindow* aFrame );


    /* Accessors for the environment objects (view, model, etc.) */
    /* Accessors for the environment objects (view, model, etc.) */
    KiGfx::VIEW* GetView()
    KiGfx::VIEW* GetView() const
    {
    {
        return m_view;
        return m_view;
    }
    }


    KiGfx::VIEW_CONTROLS* GetViewControls()
    KiGfx::VIEW_CONTROLS* GetViewControls() const
    {
    {
        return m_viewControls;
        return m_viewControls;
    }
    }


    EDA_ITEM* GetModel()
    EDA_ITEM* GetModel() const
    {
    {
        return m_model;
        return m_model;
    }
    }


    wxWindow* GetEditFrame()
    wxWindow* GetEditFrame() const
    {
    {
        return m_editFrame;
        return m_editFrame;
    }
    }