/*
 *			GPAC - MPEG-4 Systems C Development Kit
 *
 *			Copyright (c) Cyril Concolato 2004-2005
 *					All rights reserved
 *
 *  This file is part of GPAC / SVG Loader plugin
 *
 *  GPAC is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2, or (at your option)
 *  any later version.
 *   
 *  GPAC is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *   
 *  You should have received a copy of the GNU General Public License
 *  along with GNU Make; see the file COPYING.  If not, write to
 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
 *
 */
#ifndef _SVG_PARSER_DEV_H
#define _SVG_PARSER_DEV_H

#ifdef __cplusplus
extern "C" {
#endif

#include <gpac/m4_scenegraph_svg.h>
#include "svg_parser.h"

#ifndef M4_DISABLE_SVG

#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>

#include <gpac/m4_svg_nodes.h>
#include <gpac/intern/m4_scenegraph_dev.h>

/*enable this if you want to link SVG loader against static libxml2 & iconv*/
#if 0
#if (_MSC_VER == 1200) && (WINVER < 0x0500)
long _ftol( double );
long _ftol2( double dblSource ) { return _ftol( dblSource ); }
#endif
#endif

/* uncomment this line if you don't want the GPAC cache mechanism */
//#undef USE_GPAC_CACHE_MECHANISM


typedef struct _svg_parser
{
	/* 
		Only needed in Process data to attach graph to renderer 
		Using a void pointer to remove usage of m4_esm_dev.h
	*/
	void *inline_scene;

	/* This graph is the same as the one in inline_scene, this pointer is just for ease 
	   and to separate as much as possible the SVG Parser from the InlineScene structure */
	SceneGraph *graph;

	u8 status; // 0 = not initialized, 1 = initialized

	M4Err last_error;

	char *fileName;

	Chain *ided_nodes;
	u32 max_node_id;

	u32 svg_w, svg_h;

#ifdef USE_GPAC_CACHE_MECHANISM
	/* to handle 'data:' urls */
	u32 cacheID;
	/* store the scene decoder to get the plugin manager for cache objects */
	SceneDecoder *sdec;
#endif

};

#endif // M4_DISABLE_SVG

#ifdef __cplusplus
}
#endif

#endif // _SVG_PARSER_DEV_H
