update to 1.10.4
[profile/ivi/clutter.git] / clutter / clutter-transition.h
1 /*
2  * Clutter.
3  *
4  * An OpenGL based 'interactive canvas' library.
5  *
6  * Copyright (C) 2012 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: Emmanuele Bassi <ebassi@linux.intel.com>
22  */
23
24 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
25 #error "Only <clutter/clutter.h> can be included directly."
26 #endif
27
28 #ifndef __CLUTTER_TRANSITION_H__
29 #define __CLUTTER_TRANSITION_H__
30
31 #include <clutter/clutter-types.h>
32 #include <clutter/clutter-timeline.h>
33
34 G_BEGIN_DECLS
35
36 #define CLUTTER_TYPE_TRANSITION                 (clutter_transition_get_type ())
37 #define CLUTTER_TRANSITION(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_TRANSITION, ClutterTransition))
38 #define CLUTTER_IS_TRANSITION(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_TRANSITION))
39 #define CLUTTER_TRANSITION_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_TRANSITION, ClutterTransitionClass))
40 #define CLUTTER_IS_TRANSITION_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_TRANSITION))
41 #define CLUTTER_TRANSITION_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_TRANSITION, ClutterTransitionClass))
42
43 typedef struct _ClutterTransitionPrivate        ClutterTransitionPrivate;
44 typedef struct _ClutterTransitionClass          ClutterTransitionClass;
45
46 /**
47  * ClutterTransition:
48  *
49  * The <structname>ClutterTransition</structname> structure contains private
50  * data and should only be accessed using the provided API.
51  *
52  * Since: 1.10
53  */
54 struct _ClutterTransition
55 {
56   /*< private >*/
57   ClutterTimeline parent_instance;
58
59   ClutterTransitionPrivate *priv;
60 };
61
62 /**
63  * ClutterTransitionClass:
64  * @attached: virtual function; called when a transition is attached to
65  *   a #ClutterAnimatable instance
66  * @detached: virtual function; called when a transition is detached from
67  *   a #ClutterAnimatable instance
68  * @compute_value: virtual function; called each frame to compute and apply
69  *   the interpolation of the interval
70  *
71  * The <structname>ClutterTransitionClass</structname> structure contains
72  * private data.
73  *
74  * Since: 1.10
75  */
76 struct _ClutterTransitionClass
77 {
78   /*< private >*/
79   ClutterTimelineClass parent_class;
80
81   /*< public >*/
82   void (* attached) (ClutterTransition *transition,
83                      ClutterAnimatable *animatable);
84   void (* detached) (ClutterTransition *transition,
85                      ClutterAnimatable *animatable);
86
87   void (* compute_value) (ClutterTransition *transition,
88                           ClutterAnimatable *animatable,
89                           ClutterInterval   *interval,
90                           gdouble            progress);
91
92   /*< private >*/
93   gpointer _padding[8];
94 };
95
96 CLUTTER_AVAILABLE_IN_1_10
97 GType clutter_transition_get_type (void) G_GNUC_CONST;
98
99 CLUTTER_AVAILABLE_IN_1_10
100 void                    clutter_transition_set_interval                 (ClutterTransition *transition,
101                                                                          ClutterInterval   *interval);
102 CLUTTER_AVAILABLE_IN_1_10
103 ClutterInterval *       clutter_transition_get_interval                 (ClutterTransition *transition);
104 CLUTTER_AVAILABLE_IN_1_10
105 void                    clutter_transition_set_animatable               (ClutterTransition *transition,
106                                                                          ClutterAnimatable *animatable);
107 CLUTTER_AVAILABLE_IN_1_10
108 ClutterAnimatable *     clutter_transition_get_animatable               (ClutterTransition *transition);
109 CLUTTER_AVAILABLE_IN_1_10
110 void                    clutter_transition_set_remove_on_complete       (ClutterTransition *transition,
111                                                                          gboolean           remove_complete);
112 CLUTTER_AVAILABLE_IN_1_10
113 gboolean                clutter_transition_get_remove_on_complete       (ClutterTransition *transition);
114
115 G_END_DECLS
116
117 #endif /* __CLUTTER_TRANSITION_H__ */