class Tool{
public:
        virtual void ButtonPressed( int button, int x, int y, bool shift = false ) = 0;
        virtual void ButtonReleased( int button, int x, int y, bool shift = false ) = 0;
        virtual void Motion( int x, int y, int button, bool shift = false ) = 0;
};

class ToolArrow : public Tool
{
public:
        void ButtonPressed( int button, int x, int y, bool shift = false );
        void ButtonReleased( int button, int x, int y, bool shift = false );
        void Motion( int x, int y, int button, bool shift = false );
};

class ToolRectangle : public Tool
{
public:
        void ButtonPressed( int button, int x, int y, bool shift = false );
        void ButtonReleased( int button, int x, int y, bool shift = false );
        void Motion( int x, int y, int button, bool shift = false );
};

class Painter
{
private:
        Tool *tool;
public:
        void ButtonPressed( int button, int x, int y, bool shift = false )
        { tool->ButtonPressed( button, x, y, shift ); }
        void ButtonReleased( int button, int x, int y, bool shift = false )
        { tool->ButtonReleased( button, x, y, shift ); }
        void Motion( int x, int y, int button, bool shift = false )
        { tool->Motion( x, y, button, shift ); }
}