#ifndef _MMEDIA_
#define _MMEDIA_

#include <windows.h>




#include "x/scolplugin.h"
#include "x/Version.h"




/****************************************************************************************/
/*                                                                                      */
/*     Structure for bitmap type                                                         */
/*                                                                                      */
/****************************************************************************************/

//$ LB (13/06/2002) : changed the objbitmap struct to manage the GDI problem.
//$ LB (12/07/2003) : 16 bits to 24 bits


typedef unsigned char* OBJBITMAP_BUFFER;

struct ObjBitmap {

        int PosX ;
        int PosY ;
        int TailleW ;
        int TailleH ;
        int BPP , BytesPP, BPL ;
        int Flags ;
        HWND WHandler ;        
        int Couleurs ; /* nombre de couleur */

		int handler;           // new global handler
		OBJBITMAP_BUFFER bits; // bitmap buffer
		PALETTEENTRY *table;   // table of colors
        HBITMAP DIBhandler;    // handler of the DIBSection
};

typedef struct ObjBitmap * PtrObjBitmap ;




/////////////////////////////////////////////////////// FUNCTIONS
struct ObjVoid {

        int     Type            ; /* Objet type                                         */       
        int     Father          ; /* magma poiner on father                             */
        int     Buffer          ; /* TYPEBUF type data                                  */
        int     Tab             ; /* TYPETAB type data                                  */
} ;
typedef struct ObjVoid *PtrObjVoid ;

struct ObjWindow {

        int     PosX            ; /* position X a l'ecran                               */ 
        int     PosY            ; /* position Y a l'ecran                               */ 
        int     TailleW         ; /* taille horizontale de la fenetre                   */ 
        int     TailleH         ; /* tailel verticale de la fenetre                     */ 
        int     Flags           ; /* flags de la fenetre                                */ 
        HWND    WHandler        ; /* Handler Windows                                    */ 
        int     MinW            ; /* taille minimale horizontale de la fenetre          */ 
        int     MinH            ; /* taille minimale verticale de la fenetre            */ 
        int     MaxW            ; /* taille maximale horizontale de la fenetre          */ 
        int     MaxH            ; /* taille maximale verticale de la fenetre            */ 
        HWND    Child           ; /* fenetre fille pour le scrolling                    */ 
        HCURSOR Cursor          ; /* fenetre fille pour le scrolling                   */ 

		//$LB(16/12/2003)
		unsigned char tSimulated; /* 1 if simulated (Win95,98,ME,NT),                    */
		PtrObjBitmap  tBuf      ; /* bitmap buffer for simulated transpary               */
		PtrObjBitmap  tBkg      ; /* point to LIB2DtransBkg                              */
		int           tX, tY    ; /* <=> window coordinates <=> coordinates of the LIB2DtransBkg area to draw */
		unsigned char tColorB   ; /* transparency color R G B                            */
		unsigned char tColorG   ;
		unsigned char tColorR   ; 
		unsigned char tfactor   ; /* alpha blending factor                                    */
		int           tflags    ; /* transparency flags : transparency color | alpha blending */

        };          
typedef struct ObjWindow *PtrObjWindow ;



extern HWND HScol;
extern cbmachine ww;



struct Palette {
    unsigned char R [ 256 ] ;
    unsigned char G [ 256 ] ;
    unsigned char B [ 256 ] ;
} ;

typedef struct Palette * PtrPalette ;

#endif
