/****************************************************************************
	Knihovna obsahuje definici tridy TScreenObject a definici strury
	TScreenObjectParams, ktere jsou zakladnimi datovymi typy pro definici 
	obrazovych objektu.

*****************************************************************************/

#ifndef GR_OBJECT_H
#define GR_OBJECT_H
#include "GLCD_types.h"
#include "GR_types.h"

/****************************************************************************
	Parametry obrazoveho objektu

*****************************************************************************/
typedef struct TScreenObjectParams
{
public:
	short width;					//sirka objektu
	short height;					//vyska objektu
	FONT *font;						//pismo objektu

}TScreenObjectParams;


/****************************************************************************
	Trida TScreenObject je zakladni datovy typ pro definovani chovani 
	grafickeho objektu
*****************************************************************************/
class TScreenObject
{
public:
	short x;															//Pozice X
	short y;															//Pozice Y
	SCREEN_OBJECT_TYPE type;											//Typ objektu
	char id;															//ID objektu
	unsigned char* caption;												//text objektu
	const unsigned short * bitmap;										//bitmapa objektu
	SCREEN_OBJECT_STATE state;											//stav objektu
	TScreenObjectParams* params;										//parametry objektu
	void (*draw)(TScreenObject* obj, OBJECT_MESSAGE message);			//Kreslici funkce objektu
	void (*object_callback)(TScreenObject *obj,OBJECT_MESSAGE message);	//Callback objektu
																		//Metody pro inicializaci
	void Init(		short X, 
					short Y, 
					SCREEN_OBJECT_TYPE Type, 
					char Id, 
					unsigned char * Caption, 
					SCREEN_OBJECT_STATE State, 
					void *Params, 
					void (*Object_callback)(TScreenObject *obj,
					OBJECT_MESSAGE message), 
					void (*Draw)(TScreenObject *obj, OBJECT_MESSAGE message));
	
	void Init(		short X, 
					short Y, 
					SCREEN_OBJECT_TYPE Type, 
					char Id, 
					unsigned char * Caption, 
					const unsigned short * Bitmap,
					SCREEN_OBJECT_STATE State, 
					void *Params, 
					void (*Object_callback)(TScreenObject *obj,OBJECT_MESSAGE message), 
					void (*Draw)(TScreenObject *obj, OBJECT_MESSAGE message));

	TScreenObject(void);												//Vychozi konstruktor
};


#endif