1 | /* |
2 | * Copyright © 2016 Endless Mobile Inc. |
3 | * |
4 | * This library is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU Lesser General Public |
6 | * License as published by the Free Software Foundation; either |
7 | * version 2.1 of the License, or (at your option) any later version. |
8 | * |
9 | * This library is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | * Lesser General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU Lesser General Public |
15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
16 | * |
17 | * Authors: Matthew Watson <mattdangerw@gmail.com> |
18 | */ |
19 | |
20 | #ifndef __GTK_PROGRESS_TRACKER_PRIVATE_H__ |
21 | #define __GTK_PROGRESS_TRACKER_PRIVATE_H__ |
22 | |
23 | #include <glib-object.h> |
24 | #include "gtkcsseasevalueprivate.h" |
25 | |
26 | G_BEGIN_DECLS |
27 | |
28 | typedef enum { |
29 | GTK_PROGRESS_STATE_BEFORE, |
30 | GTK_PROGRESS_STATE_DURING, |
31 | GTK_PROGRESS_STATE_AFTER, |
32 | } GtkProgressState; |
33 | |
34 | typedef struct _GtkProgressTracker GtkProgressTracker; |
35 | |
36 | struct _GtkProgressTracker |
37 | { |
38 | guint64 last_frame_time; |
39 | guint64 duration; |
40 | double iteration; |
41 | double iteration_count; |
42 | gboolean is_running; |
43 | }; |
44 | |
45 | void gtk_progress_tracker_init_copy (GtkProgressTracker *source, |
46 | GtkProgressTracker *dest); |
47 | |
48 | void gtk_progress_tracker_start (GtkProgressTracker *tracker, |
49 | guint64 duration, |
50 | gint64 delay, |
51 | double iteration_count); |
52 | |
53 | void gtk_progress_tracker_finish (GtkProgressTracker *tracker); |
54 | |
55 | void gtk_progress_tracker_advance_frame (GtkProgressTracker *tracker, |
56 | guint64 frame_time); |
57 | |
58 | void gtk_progress_tracker_skip_frame (GtkProgressTracker *tracker, |
59 | guint64 frame_time); |
60 | |
61 | GtkProgressState gtk_progress_tracker_get_state (GtkProgressTracker *tracker); |
62 | |
63 | double gtk_progress_tracker_get_iteration (GtkProgressTracker *tracker); |
64 | |
65 | guint64 gtk_progress_tracker_get_iteration_cycle (GtkProgressTracker *tracker); |
66 | |
67 | double gtk_progress_tracker_get_progress (GtkProgressTracker *tracker, |
68 | gboolean reverse); |
69 | |
70 | double gtk_progress_tracker_get_ease_out_cubic (GtkProgressTracker *tracker, |
71 | gboolean reverse); |
72 | |
73 | G_END_DECLS |
74 | |
75 | #endif /* __GTK_PROGRESS_TRACKER_PRIVATE_H__ */ |
76 | |