Release Clutter 1.11.4 (snapshot)
[profile/ivi/clutter.git] / clutter / clutter-animatable.h
1 /*
2  * Clutter.
3  *
4  * An OpenGL based 'interactive canvas' library.
5  *
6  * Copyright (C) 2009  Intel Corporation.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
20  *
21  * Author:
22  *   Emmanuele Bassi <ebassi@linux.intel.com>
23  */
24
25 #ifndef __CLUTTER_ANIMATABLE_H__
26 #define __CLUTTER_ANIMATABLE_H__
27
28 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
29 #error "Only <clutter/clutter.h> can be included directly."
30 #endif
31
32 #include <clutter/clutter-types.h>
33
34 G_BEGIN_DECLS
35
36 #define CLUTTER_TYPE_ANIMATABLE                 (clutter_animatable_get_type ())
37 #define CLUTTER_ANIMATABLE(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ANIMATABLE, ClutterAnimatable))
38 #define CLUTTER_IS_ANIMATABLE(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ANIMATABLE))
39 #define CLUTTER_ANIMATABLE_GET_IFACE(obj)       (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_ANIMATABLE, ClutterAnimatableIface))
40
41 typedef struct _ClutterAnimatableIface          ClutterAnimatableIface;
42
43 /**
44  * ClutterAnimatable:
45  *
46  * #ClutterAnimatable is an opaque structure whose members cannot be directly
47  * accessed
48  *
49  * Since: 1.0
50  */
51
52 /**
53  * ClutterAnimatableIface:
54  * @animate_property: virtual function for custom interpolation of a
55  *   property. This virtual function is deprecated
56  * @find_property: virtual function for retrieving the #GParamSpec of
57  *   an animatable property
58  * @get_initial_state: virtual function for retrieving the initial
59  *   state of an animatable property
60  * @set_final_state: virtual function for setting the state of an
61  *   animatable property
62  * @interpolate_value: virtual function for interpolating the progress
63  *   of a property
64  *
65  * Base interface for #GObject<!-- -->s that can be animated by a
66  * a #ClutterAnimation.
67  *
68  * Since: 1.0
69  */
70 struct _ClutterAnimatableIface
71 {
72   /*< private >*/
73   GTypeInterface parent_iface;
74
75   /*< public >*/
76   gboolean    (* animate_property)  (ClutterAnimatable *animatable,
77                                      ClutterAnimation  *animation,
78                                      const gchar       *property_name,
79                                      const GValue      *initial_value,
80                                      const GValue      *final_value,
81                                      gdouble            progress,
82                                      GValue            *value);
83   GParamSpec *(* find_property)     (ClutterAnimatable *animatable,
84                                      const gchar       *property_name);
85   void        (* get_initial_state) (ClutterAnimatable *animatable,
86                                      const gchar       *property_name,
87                                      GValue            *value);
88   void        (* set_final_state)   (ClutterAnimatable *animatable,
89                                      const gchar       *property_name,
90                                      const GValue      *value);
91   gboolean    (* interpolate_value) (ClutterAnimatable *animatable,
92                                      const gchar       *property_name,
93                                      ClutterInterval   *interval,
94                                      gdouble            progress,
95                                      GValue            *value);
96 };
97
98 GType clutter_animatable_get_type (void) G_GNUC_CONST;
99
100 GParamSpec *clutter_animatable_find_property     (ClutterAnimatable *animatable,
101                                                   const gchar       *property_name);
102 void        clutter_animatable_get_initial_state (ClutterAnimatable *animatable,
103                                                   const gchar       *property_name,
104                                                   GValue            *value);
105 void        clutter_animatable_set_final_state   (ClutterAnimatable *animatable,
106                                                   const gchar       *property_name,
107                                                   const GValue      *value);
108 gboolean    clutter_animatable_interpolate_value (ClutterAnimatable *animatable,
109                                                   const gchar       *property_name,
110                                                   ClutterInterval   *interval,
111                                                   gdouble            progress,
112                                                   GValue            *value);
113
114 G_END_DECLS
115
116 #endif /* __CLUTTER_ANIMATABLE_H__ */