#ifndef _PROCESSOR_H_
#define _PROCESSOR_H_

class Canvas;
class QWidget;
class QToolBar;

class Processor
{
public:
	virtual ~Processor()
	{;}

	virtual void resize( int width, int height ) = 0;
	virtual void process( const unsigned char* original, unsigned char* processed ) = 0;
	virtual QWidget* getPropertiesWidget( QWidget* parent ) = 0;
	virtual void setupToolBar( QToolBar *toolBar ) = 0;

	virtual void decorateGL( Canvas* canvas ) = 0;
	virtual bool onMousePress( Canvas* canvas, int x, int y ) = 0;
	virtual bool onMouseRelease( Canvas* canvas, int x, int y ) = 0;
};

/**
 *	Simple processor that forwards input events to another canvas' processor.
 */
class ProxyProcessor : public Processor
{
public:
	ProxyProcessor( Canvas* targetCanvas ) : _targetCanvas( targetCanvas )
	{;}

	virtual void resize( int width, int height );
	virtual void process( const unsigned char* original, unsigned char* processed );
	virtual QWidget* getPropertiesWidget( QWidget* parent );
	virtual void setupToolBar( QToolBar* toolBar );

	virtual void decorateGL( Canvas* canvas );
	virtual bool onMousePress( Canvas* canvas, int x, int y );
	virtual bool onMouseRelease( Canvas* canvas, int x, int y );

private:
	Canvas* _targetCanvas;
};

#endif
