Release Clutter 1.11.4 (snapshot)
[profile/ivi/clutter.git] / clutter / clutter-interval.h
1 /*
2  * Clutter.
3  *
4  * An OpenGL based 'interactive canvas' library.
5  *
6  * Copyright (C) 2008  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 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
26 #error "Only <clutter/clutter.h> can be included directly."
27 #endif
28
29 #ifndef __CLUTTER_INTERVAL_H__
30 #define __CLUTTER_INTERVAL_H__
31
32 #include <clutter/clutter-types.h>
33
34 G_BEGIN_DECLS
35
36 #define CLUTTER_TYPE_INTERVAL                   (clutter_interval_get_type ())
37 #define CLUTTER_INTERVAL(obj)                   (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_INTERVAL, ClutterInterval))
38 #define CLUTTER_IS_INTERVAL(obj)                (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_INTERVAL))
39 #define CLUTTER_INTERVAL_CLASS(klass)           (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_INTERVAL, ClutterIntervalClass))
40 #define CLUTTER_IS_INTERVAL_CLASS(klass)        (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_INTERVAL))
41 #define CLUTTER_INTERVAL_GET_CLASS(obj)         (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_INTERVAL, ClutterIntervalClass))
42
43 typedef struct _ClutterIntervalPrivate          ClutterIntervalPrivate;
44 typedef struct _ClutterIntervalClass            ClutterIntervalClass;
45
46 /**
47  * ClutterInterval:
48  *
49  * The #ClutterInterval structure contains only private data and should
50  * be accessed using the provided functions.
51  *
52  * Since: 1.0
53  */
54 struct _ClutterInterval
55 {
56   /*< private >*/
57   GInitiallyUnowned parent_instance;
58
59   ClutterIntervalPrivate *priv;
60 };
61
62 /**
63  * ClutterIntervalClass:
64  * @validate: virtual function for validating an interval
65  *   using a #GParamSpec
66  * @compute_value: virtual function for computing the value
67  *   inside an interval using an adimensional factor between 0 and 1
68  *
69  * The #ClutterIntervalClass contains only private data.
70  *
71  * Since: 1.0
72  */
73 struct _ClutterIntervalClass
74 {
75   /*< private >*/
76   GInitiallyUnownedClass parent_class;
77
78   /*< public >*/
79   gboolean (* validate)      (ClutterInterval *interval,
80                               GParamSpec      *pspec);
81   gboolean (* compute_value) (ClutterInterval *interval,
82                               gdouble          factor,
83                               GValue          *value);
84
85   /*< private >*/
86   /* padding for future expansion */
87   void (*_clutter_reserved1) (void);
88   void (*_clutter_reserved2) (void);
89   void (*_clutter_reserved3) (void);
90   void (*_clutter_reserved4) (void);
91   void (*_clutter_reserved5) (void);
92   void (*_clutter_reserved6) (void);
93 };
94
95 GType            clutter_interval_get_type           (void) G_GNUC_CONST;
96
97 ClutterInterval *clutter_interval_new                (GType            gtype,
98                                                       ...);
99 ClutterInterval *clutter_interval_new_with_values    (GType            gtype,
100                                                       const GValue    *initial,
101                                                       const GValue    *final);
102
103 ClutterInterval *clutter_interval_clone              (ClutterInterval *interval);
104
105 GType            clutter_interval_get_value_type     (ClutterInterval *interval);
106
107 void             clutter_interval_set_initial        (ClutterInterval *interval,
108                                                       ...);
109 void             clutter_interval_set_initial_value  (ClutterInterval *interval,
110                                                       const GValue    *value);
111 void             clutter_interval_get_initial_value  (ClutterInterval *interval,
112                                                       GValue          *value);
113 GValue *         clutter_interval_peek_initial_value (ClutterInterval *interval);
114 void             clutter_interval_set_final          (ClutterInterval *interval,
115                                                       ...);
116 void             clutter_interval_set_final_value    (ClutterInterval *interval,
117                                                       const GValue    *value);
118 void             clutter_interval_get_final_value    (ClutterInterval *interval,
119                                                       GValue          *value);
120 GValue *         clutter_interval_peek_final_value   (ClutterInterval *interval);
121
122 void             clutter_interval_set_interval       (ClutterInterval *interval,
123                                                       ...);
124 void             clutter_interval_get_interval       (ClutterInterval *interval,
125                                                       ...);
126
127 gboolean         clutter_interval_validate           (ClutterInterval *interval,
128                                                       GParamSpec      *pspec);
129 gboolean         clutter_interval_compute_value      (ClutterInterval *interval,
130                                                       gdouble          factor,
131                                                       GValue          *value);
132
133 const GValue *   clutter_interval_compute            (ClutterInterval *interval,
134                                                       gdouble          factor);
135
136 G_END_DECLS
137
138 #endif /* __CLUTTER_INTERVAL_H__ */