/*****************************************************************************/
/* htmlbitmap.cpp - 03/08/99 - By Christophe LOREK - CRYO-NETWORKS           */
/*                                                                           */
/* HTMLBITMAP class                                                          */
/*                                                                           */
/* last modified on 03/08/99 By Christophe LOREK                             */
/*****************************************************************************/

#ifdef HTML_INCLUDE

#include "htmlbitmap.h"


HTMLBITMAP::HTMLBITMAP(mmachine m,
										 int givenalign,
										 int givenwidth,
										 int givenheight,
										 int givenborder,
										 char* givenurl)
{
	int				structbuf;
	int				nodetab;
	
	x = 0;
	y = 0;
	cx = 0;
	cy = 0;

	status	= HTMLBITMAP_STATUS_NOOBJ;
	url			= givenurl;			
	w				= givenwidth;
	h				= givenheight;	

	align		= givenalign;
	border	= givenborder;

// creating struct buffer
	structbuf = MMmalloc(m,NODESTRUCT_BUFSIZE,TYPEBUF);
	MMstore(m,structbuf,NODESTRUCT_STRUCT,(int)this);
	MMpush(m,1+(structbuf<<1));

// creating text node
	nodetab = MMmalloc(m,NODE_SIZE,TYPETAB);
	MMstore(m,nodetab,NODE_TYPE,NODE_TYPBITMAP<<1);
	MMstore(m,nodetab,NODE_FATHER,NIL);
	MMstore(m,nodetab,NODE_OBJBITMAP,NIL);
	MMstore(m,nodetab,NODE_STRUCT,MMpull(m));
	MMstore(m,nodetab,NODE_BROTHER,MMpull(m));
	MMstore(m,nodetab,NODE_SON,MMpull(m));
	MMpush(m,1+(nodetab<<1));

//	DRAWbitmap();
}

HTMLBITMAP::~HTMLBITMAP()
{
	if(url != NULL)
		free(url);

}

char *HTMLBITMAP::Url()
{
	return url;
}

int HTMLBITMAP::Status()
{
	return status;
}

int HTMLBITMAP::SetStatus(int givenstatus)
{
	return status = givenstatus;
}

int HTMLBITMAP::Align()
{
	return align;
}

int HTMLBITMAP::Border()	
{
	return border;
}

int HTMLBITMAP::DRAWbitmap()
{
	MMechostr(MSKFOO,"HTMLBITMAP : '%s' '%i' '%i' '%i'\n",url,w,h,border);
	return 0;
}

#endif