/*****************************************************************************/
/* htmltable.cpp - 09/08/99 - By Christophe LOREK - CRYO-NETWORKS            */
/*                                                                           */
/* HTMLTABLE class                                                           */
/*                                                                           */
/* last modified on 09/08/99 By Christophe LOREK                             */
/*****************************************************************************/

#ifdef HTML_INCLUDE

#include "htmltable.h"


HTMLTABLE::HTMLTABLE(mmachine m,
										 int givenalign,
										 int givenred,
										 int givengreen,
										 int givenblue,
										 int givenwidth,
										 int givencols,
										 int givenborder,
										 int givenframe,
										 int givenrules,
										 int givencellspacing,
										 int givencellpadding)
{
	int				structbuf;
	int				nodetab;

	x = 0;
	y = 0;
	w = givenwidth;
	h = 0;
	cx = 0;
	cy = 0;

	align				= givenalign;
	red					= givenred;
	green				= givengreen;
	blue				= givenblue;	
	cols				= givencols;
	border			= givenborder;
	frame				= givenframe;
	rules				= givenrules;
	cellspacing	= givencellspacing;
	cellpadding	= givencellpadding;


// creating struct buffer
	structbuf = MMmalloc(m,NODESTRUCT_BUFSIZE,TYPEBUF);
	MMstore(m,structbuf,NODESTRUCT_STRUCT,(int)this);
	MMpush(m,1+(structbuf<<1));

// creating table node
	nodetab = MMmalloc(m,NODE_SIZE,TYPETAB);
	MMstore(m,nodetab,NODE_TYPE,NODE_TYPTABLE<<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));

//	DRAWtable();
}

HTMLTABLE::~HTMLTABLE()
{

}

int HTMLTABLE::DRAWtable()
{
	MMechostr(MSKFOO,"HTMLTABLE : '%i' '%i' '%i'\n",w,h,border);
	return 0;
}

int HTMLTABLE::Align()
{
	return align;
}

int HTMLTABLE::Red()
{
	return red;
}

int HTMLTABLE::Green()
{
	return green;
}

int HTMLTABLE::Blue()
{
	return blue;
}

int HTMLTABLE::Cols()
{
	return cols;
}

int HTMLTABLE::Border()
{
	return border;
}

int HTMLTABLE::Frame()
{
	return frame;
}

int HTMLTABLE::Rules()
{
	return rules;
}

int HTMLTABLE::Cellspacing()
{
	return cellspacing;
}

int HTMLTABLE::Cellpadding()
{
	return cellpadding;
}

#endif
