#define __VERSION__ 	"39"
#define __REVISION__ 	"7"
#define __NAME__			"Gallery"
#define __AUTHOR__		"Markus Hillenbrand"

char *V = "$VER: " __NAME__ " " __VERSION__ "." __REVISION__ " (" __DATE__ ")";

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

#include <string.h>
#include <stdlib.h>
#include <stdio.h>

#include <GUIC_Classes/GUIC_System.hpp>
#include <GUIC_Classes/GUIC_Application.hpp>
#include <GUIC_Classes/GUIC_Message.hpp>

#include "GalleryWindow.hpp"
#include "StatusWindow.hpp"

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

void main (int argc, char **argv)
{
	GUIC_SystemC::checkStackSize(50000);
	
	GUIC_ApplicationC app(__NAME__);

	app.setAuthor		(__AUTHOR__);
	app.setVersion	(__VERSION__);
	app.setRevision	(__REVISION__);
	app.setDate		(__DATE__);
	app.setTime		(__TIME__);
	app.setInitializer	(TRUE);

	GUIC_ScreenC			screen;
	StatusWindowC		sWindow(&app, &screen);
	GalleryWindowC 	gWindow(&app, &screen, &sWindow);
	
	screen.add(gWindow);
	
	app.add(screen);
	
	app.start();

	BOOL running = TRUE;
	GUIC_EventC *event = 0;

	LONG count = 0;
	
	while (running && (event = app.wait()) )
		{
		if (event->id == GUIC_CloseWindow && event->window == (GUIC_WindowC*) &gWindow) 
			{
			GUIC_MessageC	message	("Do you really want to quit ?", "Yes|No");
			if (1 == message.request(*event->window)) running = FALSE;
			}
		}

	app.stop();
}

