/*
 * HTML Parser system
 * (c) 1998 by Jürgen Schmitz - all rights reserved
 * THIS IS NOT GPL OR SOMETHING OTHER FREE LICENSE!!
 */

#include <Xclasses/Xclasses.h>
#include "html_parser.h"
#include "html_drawspec.h"


char *text=
		"Ein HTML Text! Dabei wird der Text automatisch umgebrochen.\n"
		"Das ganze wird dann mittels HTML Tags später weiter aufgebohrt."
		"<p>
		<dl>Text DL
		<dt>Text DT
		<dd>Text DD
		<dd>Text DD
		<dd>Geschachtelt:<dl>Sub<dd>Text DD/DD</dl>
		<dd><dl>Nochmal<dt>DT<dd>DD</dl>
		<dt>DT
		<dd>DD
		</dl>
		<center>Zentriert</center>
		<div align=center>DIV Zentriert</div>
		<div align=right>DIV Rechts</div>
		<p>
		<h1>H1</h1><h2>H2</h2><h3>H3</h3>
		<h4>H4</h4><h5>H5</h5><h6>H6</h6>
		<b>BOLD<i> +ITALIC</i> und nun?</b><i> und das?</i>

<pre>
int main(int argc, char *argv[])
{
    appwindow aw;

    aw.InitSize(40);
    aw.Init(argc,argv);

    group gr;
    gadget gg;
    int w,h;

    gg.Font(FONT_GADGET);
    gr.Add(gg);

    html_parser t(text);
    html_drawspecXclasses xc(&gg);

    aw.SetGroup(gr);
    aw.Callback();
    aw.Create();
    t.Create(&xc);

    while (appwindow::TickEvent()!=EV_FINISH)
    {
        t.Draw(0,0,gg.gg_width(),w,h);
    }
}
</pre>
		"
;

int main(int argc, char *argv[])
{
	appwindow aw;

	aw.InitSize(40);
	aw.Init(argc,argv);

	group gr;
	gadget gg;
	int w,h;

	gg.Font(FONT_GADGET);
	gr.Add(gg);

	html_parser t(text);
	html_drawspecXclasses xc(&gg);

	aw.SetGroup(gr);
	aw.Callback();
	aw.Create();
	t.Create(&xc);

	while (appwindow::TickEvent()!=EV_FINISH)
	{
		t.Draw(0,0,gg.gg_width(),w,h);
	}
}
