1 /*   EXTRAITS DE LA LICENCE
2 	Copyright CEA, contributeurs : Damien
3 	CALISTE, laboratoire L_Sim, (2017)
4 
5 	Adresse mèl :
6 	CALISTE, damien P caliste AT cea P fr.
7 
8 	Ce logiciel est un programme informatique servant à visualiser des
9 	structures atomiques dans un rendu pseudo-3D.
10 
11 	Ce logiciel est régi par la licence CeCILL soumise au droit français et
12 	respectant les principes de diffusion des logiciels libres. Vous pouvez
13 	utiliser, modifier et/ou redistribuer ce programme sous les conditions
14 	de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA
15 	sur le site "http://www.cecill.info".
16 
17 	Le fait que vous puissiez accéder à cet en-tête signifie que vous avez
18 	pris connaissance de la licence CeCILL, et que vous en avez accepté les
19 	termes (cf. le fichier Documentation/licence.fr.txt fourni avec ce logiciel).
20 */
21 
22 /*   LICENCE SUM UP
23 	Copyright CEA, contributors : Damien
24 	CALISTE, laboratoire L_Sim, (2017)
25 
26 	E-mail address:
27 	CALISTE, damien P caliste AT cea P fr.
28 
29 	This software is a computer program whose purpose is to visualize atomic
30 	configurations in 3D.
31 
32 	This software is governed by the CeCILL  license under French law and
33 	abiding by the rules of distribution of free software.  You can  use,
34 	modify and/ or redistribute the software under the terms of the CeCILL
35 	license as circulated by CEA, CNRS and INRIA at the following URL
36 	"http://www.cecill.info".
37 
38 	The fact that you are presently reading this means that you have had
39 	knowledge of the CeCILL license and that you accept its terms. You can
40 	find a copy of this licence shipped with this software at Documentation/licence.en.txt.
41 */
42 #ifndef VISU_ANIMATION_H
43 #define VISU_ANIMATION_H
44 
45 #include <glib.h>
46 #include <glib-object.h>
47 
48 #include <visu_tools.h>
49 
50 G_BEGIN_DECLS
51 
52 /***************/
53 /* Public part */
54 /***************/
55 
56 /**
57  * VisuAnimationType:
58  * @VISU_ANIMATION_LINEAR: a linear evolution.
59  * @VISU_ANIMATION_QUAD: a quadratic evolution.
60  * @VISU_ANIMATION_SIN: a sinusoid evolution.
61  *
62  * Various type of time evolution.
63  */
64 typedef enum _VisuAnimationType
65 {
66   VISU_ANIMATION_LINEAR,
67   VISU_ANIMATION_QUAD,
68   VISU_ANIMATION_SIN
69 } VisuAnimationType;
70 
71 /**
72  * VISU_TYPE_ANIMATION:
73  *
74  * return the type of #VisuAnimation.
75  */
76 #define VISU_TYPE_ANIMATION	     (visu_animation_get_type ())
77 /**
78  * VISU_ANIMATION:
79  * @obj: a #GObject to cast.
80  *
81  * Cast the given @obj into #VisuAnimation type.
82  */
83 #define VISU_ANIMATION(obj)	        (G_TYPE_CHECK_INSTANCE_CAST(obj, VISU_TYPE_ANIMATION, VisuAnimation))
84 /**
85  * VISU_ANIMATION_CLASS:
86  * @klass: a #GObjectClass to cast.
87  *
88  * Cast the given @klass into #VisuAnimationClass.
89  */
90 #define VISU_ANIMATION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST(klass, VISU_TYPE_ANIMATION, VisuAnimationClass))
91 /**
92  * VISU_IS_ANIMATION:
93  * @obj: a #GObject to test.
94  *
95  * Test if the given @ogj is of the type of #VisuAnimation object.
96  */
97 #define VISU_IS_ANIMATION(obj)    (G_TYPE_CHECK_INSTANCE_TYPE(obj, VISU_TYPE_ANIMATION))
98 /**
99  * VISU_IS_ANIMATION_CLASS:
100  * @klass: a #GObjectClass to test.
101  *
102  * Test if the given @klass is of the type of #VisuAnimationClass class.
103  */
104 #define VISU_IS_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE(klass, VISU_TYPE_ANIMATION))
105 /**
106  * VISU_ANIMATION_GET_CLASS:
107  * @obj: a #GObject to get the class of.
108  *
109  * It returns the class of the given @obj.
110  */
111 #define VISU_ANIMATION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS(obj, VISU_TYPE_ANIMATION, VisuAnimationClass))
112 
113 typedef struct _VisuAnimationPrivate VisuAnimationPrivate;
114 
115 /**
116  * VisuAnimation:
117  *
118  * Common name to refer to a #_VisuAnimation.
119  */
120 typedef struct _VisuAnimation VisuAnimation;
121 struct _VisuAnimation
122 {
123   VisuObject parent;
124 
125   VisuAnimationPrivate *priv;
126 };
127 
128 /**
129  * VisuAnimationClass:
130  * @parent: private.
131  *
132  * Common name to refer to a #_VisuAnimationClass.
133  */
134 typedef struct _VisuAnimationClass VisuAnimationClass;
135 struct _VisuAnimationClass
136 {
137   VisuObjectClass parent;
138 };
139 
140 GType visu_animation_get_type(void);
141 
142 VisuAnimation* visu_animation_new(GObject *obj, const gchar *property);
143 
144 gboolean visu_animation_start(VisuAnimation *anim, const GValue *to, gulong tick,
145                               gulong duration, gboolean loop, VisuAnimationType type);
146 
147 gboolean visu_animation_animate(VisuAnimation *anim, gulong tick);
148 
149 gboolean visu_animation_isRunning(const VisuAnimation *anim);
150 
151 void visu_animation_getFrom(const VisuAnimation *anim, GValue *from);
152 void visu_animation_getTo(const VisuAnimation *anim, GValue *to);
153 
154 void visu_animation_abort(VisuAnimation *anim);
155 
156 G_END_DECLS
157 
158 #endif
159