1 /*   EXTRAITS DE LA LICENCE
2 	Copyright CEA, contributeurs : Luc BILLARD et Damien
3 	CALISTE, laboratoire L_Sim, (2001-2005)
4 
5 	Adresse mèl :
6 	BILLARD, non joignable par mèl ;
7 	CALISTE, damien P caliste AT cea P fr.
8 
9 	Ce logiciel est un programme informatique servant à visualiser des
10 	structures atomiques dans un rendu pseudo-3D.
11 
12 	Ce logiciel est régi par la licence CeCILL soumise au droit français et
13 	respectant les principes de diffusion des logiciels libres. Vous pouvez
14 	utiliser, modifier et/ou redistribuer ce programme sous les conditions
15 	de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA
16 	sur le site "http://www.cecill.info".
17 
18 	Le fait que vous puissiez accéder à cet en-tête signifie que vous avez
19 	pris connaissance de la licence CeCILL, et que vous en avez accepté les
20 	termes (cf. le fichier Documentation/licence.fr.txt fourni avec ce logiciel).
21 */
22 
23 /*   LICENCE SUM UP
24 	Copyright CEA, contributors : Luc BILLARD et Damien
25 	CALISTE, laboratoire L_Sim, (2001-2005)
26 
27 	E-mail address:
28 	BILLARD, not reachable any more ;
29 	CALISTE, damien P caliste AT cea P fr.
30 
31 	This software is a computer program whose purpose is to visualize atomic
32 	configurations in 3D.
33 
34 	This software is governed by the CeCILL  license under French law and
35 	abiding by the rules of distribution of free software.  You can  use,
36 	modify and/ or redistribute the software under the terms of the CeCILL
37 	license as circulated by CEA, CNRS and INRIA at the following URL
38 	"http://www.cecill.info".
39 
40 	The fact that you are presently reading this means that you have had
41 	knowledge of the CeCILL license and that you accept its terms. You can
42 	find a copy of this licence shipped with this software at Documentation/licence.en.txt.
43 */
44 #ifndef VISUTOOLS_H
45 #define VISUTOOLS_H
46 
47 #ifdef HAVE_CONFIG_H
48 #include <config.h>
49 #endif
50 
51 #include <stdio.h>
52 #include <glib.h>
53 #include <glib-object.h>
54 
55 #include "coreTools/toolDbg.h"
56 
57 G_BEGIN_DECLS
58 
59 #ifndef DEBUG
60   #define DEBUG 0
61 #endif
62 #define DBG_fprintf if(DEBUG) (void)fprintf
63 
64 #if DEBUG == 1
65 #define VisuObject ToolDbgObj
66 #define VisuObjectClass ToolDbgObjClass
67 #define VISU_TYPE_OBJECT TOOL_TYPE_DBG_OBJ
68 #else
69 #define VisuObject GObject
70 #define VisuObjectClass GObjectClass
71 #define VISU_TYPE_OBJECT G_TYPE_OBJECT
72 #endif
73 
74 #define VISU_DECLARE_CONST(ModuleObjName, module_obj_name, MODULE, OBJ_NAME) \
75   static inline const ModuleObjName * MODULE##_##OBJ_NAME##_CONST (gconstpointer ptr) {    \
76     return G_TYPE_CHECK_INSTANCE_CAST (ptr, module_obj_name##_get_type (), ModuleObjName); } \
77 
78 
79 #ifdef ENABLE_NLS
80 #  include <libintl.h>
81 #  undef _
82 #  define _(String) dgettext (PACKAGE, String)
83 #  ifdef gettext_noop
84 #    define N_(String) gettext_noop (String)
85 #  else
86 #    define N_(String) (String)
87 #  endif
88 #else
89 #  define textdomain(String) (String)
90 #  define gettext(String) (String)
91 #  define dgettext(Domain,Message) (Message)
92 #  define dcgettext(Domain,Message,Type) (Message)
93 #  define bindtextdomain(Domain,Directory) (Domain)
94 #  define _(String) (String)
95 #  define N_(String) (String)
96 #endif
97 
98 /**
99  * TOOL_MAX_LINE_LENGTH
100  *
101  * This is the maximum number of characters read on a
102  * line of an input file.
103  */
104 #define TOOL_MAX_LINE_LENGTH 256
105 
106 /**
107  * ToolVoidDataFunc:
108  * @data: a pointer to some user defined object.
109  *
110  * These methods are used when no specific argument is required except
111  * a user-defined object and when void is the return type.
112  */
113 typedef void (*ToolVoidDataFunc)(gpointer data);
114 
115 /**
116  * ToolInitFunc:
117  *
118  * These methods are used by V_Sim to initialise some part of the
119  * program. They are called once on start-up.
120  */
121 typedef void (*ToolInitFunc)(void);
122 
123 gchar* tool_getValidPath(GList **pathList, const char **filenames, int accessMode);
124 
125 float tool_modulo_float(float a, int b);
126 
127 gchar* tool_path_normalize(const gchar* path);
128 
129 #if GLIB_MINOR_VERSION < 5
130 gboolean g_file_set_contents(const gchar *fileName, const gchar *str,
131 			     gsize len, GError **error);
132 #endif
133 #if GLIB_MINOR_VERSION < 27
134 void g_list_free_full(GList *list, GDestroyNotify free_func);
135 #endif
136 
137 gboolean tool_XML_substitute(GString *output, const gchar *filename,
138 				 const gchar *tag, GError **error);
139 
140 G_END_DECLS
141 
142 #endif
143