1 /* dzl-animation.h
2  *
3  * Copyright (C) 2010-2016 Christian Hergert <christian@hergert.me>
4  *
5  * This file is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License as published by the Free
7  * Software Foundation; either version 2.1 of the License, or (at your option)
8  * any later version.
9  *
10  * This file is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
13  * License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef DZL_ANIMATION_H
20 #define DZL_ANIMATION_H
21 
22 #include <gdk/gdk.h>
23 
24 #include "dzl-version-macros.h"
25 
26 G_BEGIN_DECLS
27 
28 #define DZL_TYPE_ANIMATION      (dzl_animation_get_type())
29 #define DZL_TYPE_ANIMATION_MODE (dzl_animation_mode_get_type())
30 
31 DZL_AVAILABLE_IN_ALL
32 G_DECLARE_FINAL_TYPE (DzlAnimation, dzl_animation, DZL, ANIMATION, GInitiallyUnowned)
33 
34 enum _DzlAnimationMode
35 {
36   DZL_ANIMATION_LINEAR,
37   DZL_ANIMATION_EASE_IN_QUAD,
38   DZL_ANIMATION_EASE_OUT_QUAD,
39   DZL_ANIMATION_EASE_IN_OUT_QUAD,
40   DZL_ANIMATION_EASE_IN_CUBIC,
41   DZL_ANIMATION_EASE_OUT_CUBIC,
42   DZL_ANIMATION_EASE_IN_OUT_CUBIC,
43 
44   DZL_ANIMATION_LAST
45 };
46 
47 typedef enum   _DzlAnimationMode    DzlAnimationMode;
48 
49 DZL_AVAILABLE_IN_ALL
50 GType         dzl_animation_mode_get_type      (void);
51 DZL_AVAILABLE_IN_ALL
52 void          dzl_animation_start              (DzlAnimation     *animation);
53 DZL_AVAILABLE_IN_ALL
54 void          dzl_animation_stop               (DzlAnimation     *animation);
55 DZL_AVAILABLE_IN_ALL
56 void          dzl_animation_add_property       (DzlAnimation     *animation,
57                                                 GParamSpec       *pspec,
58                                                 const GValue     *value);
59 DZL_AVAILABLE_IN_ALL
60 DzlAnimation *dzl_object_animatev              (gpointer          object,
61                                                 DzlAnimationMode  mode,
62                                                 guint             duration_msec,
63                                                 GdkFrameClock    *frame_clock,
64                                                 const gchar      *first_property,
65                                                 va_list           args);
66 DZL_AVAILABLE_IN_ALL
67 DzlAnimation* dzl_object_animate               (gpointer          object,
68                                                 DzlAnimationMode  mode,
69                                                 guint             duration_msec,
70                                                 GdkFrameClock    *frame_clock,
71                                                 const gchar      *first_property,
72                                                 ...) G_GNUC_NULL_TERMINATED;
73 DZL_AVAILABLE_IN_ALL
74 DzlAnimation* dzl_object_animate_full          (gpointer          object,
75                                                 DzlAnimationMode  mode,
76                                                 guint             duration_msec,
77                                                 GdkFrameClock    *frame_clock,
78                                                 GDestroyNotify    notify,
79                                                 gpointer          notify_data,
80                                                 const gchar      *first_property,
81                                                 ...) G_GNUC_NULL_TERMINATED;
82 DZL_AVAILABLE_IN_ALL
83 guint         dzl_animation_calculate_duration (GdkMonitor       *monitor,
84                                                 gdouble           from_value,
85                                                 gdouble           to_value);
86 
87 G_END_DECLS
88 
89 #endif /* DZL_ANIMATION_H */
90