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 38 CLUTTER_EXPORT 39 G_DECLARE_INTERFACE (ClutterAnimatable, clutter_animatable, 40 CLUTTER, ANIMATABLE, 41 GObject) 42 43 /** 44 * ClutterAnimatableInterface: 45 * @find_property: virtual function for retrieving the #GParamSpec of 46 * an animatable property 47 * @get_initial_state: virtual function for retrieving the initial 48 * state of an animatable property 49 * @set_final_state: virtual function for setting the state of an 50 * animatable property 51 * @interpolate_value: virtual function for interpolating the progress 52 * of a property 53 * @get_actor: virtual function for getting associated actor 54 * 55 * Since: 1.0 56 */ 57 struct _ClutterAnimatableInterface 58 { 59 /*< private >*/ 60 GTypeInterface parent_iface; 61 62 /*< public >*/ 63 GParamSpec *(* find_property) (ClutterAnimatable *animatable, 64 const gchar *property_name); 65 void (* get_initial_state) (ClutterAnimatable *animatable, 66 const gchar *property_name, 67 GValue *value); 68 void (* set_final_state) (ClutterAnimatable *animatable, 69 const gchar *property_name, 70 const GValue *value); 71 gboolean (* interpolate_value) (ClutterAnimatable *animatable, 72 const gchar *property_name, 73 ClutterInterval *interval, 74 gdouble progress, 75 GValue *value); 76 ClutterActor * (* get_actor) (ClutterAnimatable *animatable); 77 }; 78 79 CLUTTER_EXPORT 80 GParamSpec *clutter_animatable_find_property (ClutterAnimatable *animatable, 81 const gchar *property_name); 82 CLUTTER_EXPORT 83 void clutter_animatable_get_initial_state (ClutterAnimatable *animatable, 84 const gchar *property_name, 85 GValue *value); 86 CLUTTER_EXPORT 87 void clutter_animatable_set_final_state (ClutterAnimatable *animatable, 88 const gchar *property_name, 89 const GValue *value); 90 CLUTTER_EXPORT 91 gboolean clutter_animatable_interpolate_value (ClutterAnimatable *animatable, 92 const gchar *property_name, 93 ClutterInterval *interval, 94 gdouble progress, 95 GValue *value); 96 97 CLUTTER_EXPORT 98 ClutterActor * clutter_animatable_get_actor (ClutterAnimatable *animatable); 99 100 G_END_DECLS 101 102 #endif /* __CLUTTER_ANIMATABLE_H__ */ 103