/*   EXTRAITS DE LA LICENCE
	Copyright CEA, contributeurs : Luc BILLARD et Damien
	CALISTE, laboratoire L_Sim, (2001-2006)
  
	Adresse mèl :
	BILLARD, non joignable par mèl ;
	CALISTE, damien P caliste AT cea P fr.

	Ce logiciel est un programme informatique servant à visualiser des
	structures atomiques dans un rendu pseudo-3D. 

	Ce logiciel est régi par la licence CeCILL soumise au droit français et
	respectant les principes de diffusion des logiciels libres. Vous pouvez
	utiliser, modifier et/ou redistribuer ce programme sous les conditions
	de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA 
	sur le site "http://www.cecill.info".

	Le fait que vous puissiez accéder à cet en-tête signifie que vous avez 
	pris connaissance de la licence CeCILL, et que vous en avez accepté les
	termes (cf. le fichier Documentation/licence.fr.txt fourni avec ce logiciel).
*/

/*   LICENCE SUM UP
	Copyright CEA, contributors : Luc BILLARD et Damien
	CALISTE, laboratoire L_Sim, (2001-2006)

	E-mail address:
	BILLARD, not reachable any more ;
	CALISTE, damien P caliste AT cea P fr.

	This software is a computer program whose purpose is to visualize atomic
	configurations in 3D.

	This software is governed by the CeCILL  license under French law and
	abiding by the rules of distribution of free software.  You can  use, 
	modify and/ or redistribute the software under the terms of the CeCILL
	license as circulated by CEA, CNRS and INRIA at the following URL
	"http://www.cecill.info". 

	The fact that you are presently reading this means that you have had
	knowledge of the CeCILL license and that you accept its terms. You can
	find a copy of this licence shipped with this software at Documentation/licence.en.txt.
*/
#ifndef VISU_BASIC_H
#define VISU_BASIC_H

#include <glib.h>
#include "visu_data.h"
#include "visu_tools.h"

/* Here, basic functions that don't require GTK, are defined. */

/**
 * loadDataFromFile:
 * @data: a #VisuData object ;
 * @bufferError: a pointer a get a GString that contains the error message, can be NULL.
 *
 * This calls the load method of the current rendering
 * method. Some informations may be store in @bufferError.
 * This buffer will be allocated via g_string_new() in this function.
 * It should be freed after use by the function which called
 * this one. The file(s) which is(are) opened is(are) stored in the
 * #VisuData. If the @bufferError is NULL, no error strings are returned.
 *
 * Returns: 1 if everithing is OK.
 */
int loadDataFromFile(VisuData *data, GString **bufferError);


/**
 * initVisuMain:
 *
 * A call to this method is done at startup after having probe the locale of the file
 * system and having initialized the rendering window. It makes the following actions :
 * create the visu object to store the signals, initialize the module part (parameters,
 * and resources), initialize the dump part, the OpenGL part and its extensions, the
 * storage of elements and the 'colorize with data' part.
 */
void initVisuMain();

/**
 * mainWithGtk:
 * @argc: the number of arguments.
 * @argv: the values of all arguments.
 *
 * This is only a header, define in gtk_main.c. It initializes the
 * GTK part of V_Sim : all subpanels, pick and observe window, pair window...
 *
 * Returns: 1 if something goes wrong, 0 otherwise.
 */
int mainWithGtk(int argc, char *argv[]);


/**
 * quitVisu:
 * @data: a pointer to the #GMainLoop.
 *
 * A call to this method makes the #GMainLoop stop.
 *
 * Returns: FALSE, always.
 */
gboolean quitVisu(gpointer data);
/**
 * loadFileWithoutGtk:
 * @data: a pointer to some user defined data.
 *
 * This method creates a #VisuData from the file which is stored in the
 * #visu_object through a call to setFileLoaded(). And it calls the renderStoredData() method.
 */
void loadFileWithoutGtk(VisuData *data);
/**
 * mainExport:
 *
 * This method is called when V_Sim is in export mode from the command line. 
 *
 * Returns: 0 if everything is normal, 1 if an error occured.
 */
int mainExport(void);
/**
 * dumpToImage:
 * @data: the #VisuData to be exported.
 *
 * This method analyzes the @data parameter to find the file format for export
 * and call dump functions. 
 *
 * Returns: 0 if no error occured.
 */
int dumpToImage(VisuData *data);
/**
 * getGeneralPaths:
 * 
 * This method sets the paths. On Unix systems, this method sets the paths
 * from macros defined by configure. On Win32 systems, it reads paths in
 * a v_sim.ini file found in the current directory or in the C:\windows.
 */
void getGeneralPaths();





/****************/
/* Private area */
/****************/


#endif
