1 | /* GTK - The GIMP Toolkit |
2 | * |
3 | * Copyright (C) 2014 Lieven van der Heide |
4 | * |
5 | * This library is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU Lesser General Public |
7 | * License as published by the Free Software Foundation; either |
8 | * version 2.1 of the License, or (at your option) any later version. |
9 | * |
10 | * This library is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | * Lesser General Public License for more details. |
14 | * |
15 | * You should have received a copy of the GNU Lesser General Public |
16 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
17 | */ |
18 | |
19 | #ifndef __GTK_KINETIC_SCROLLING_H__ |
20 | #define __GTK_KINETIC_SCROLLING_H__ |
21 | |
22 | #include <glib.h> |
23 | |
24 | G_BEGIN_DECLS |
25 | |
26 | typedef enum { |
27 | GTK_KINETIC_SCROLLING_CHANGE_NONE = 0, |
28 | GTK_KINETIC_SCROLLING_CHANGE_LOWER = 1 << 0, |
29 | GTK_KINETIC_SCROLLING_CHANGE_UPPER = 1 << 1, |
30 | GTK_KINETIC_SCROLLING_CHANGE_IN_OVERSHOOT = 1 << 2, |
31 | } GtkKineticScrollingChange; |
32 | |
33 | typedef struct _GtkKineticScrolling GtkKineticScrolling; |
34 | |
35 | GtkKineticScrolling * gtk_kinetic_scrolling_new (double lower, |
36 | double upper, |
37 | double overshoot_width, |
38 | double decel_friction, |
39 | double overshoot_friction, |
40 | double initial_position, |
41 | double initial_velocity); |
42 | void gtk_kinetic_scrolling_free (GtkKineticScrolling *kinetic); |
43 | |
44 | GtkKineticScrollingChange gtk_kinetic_scrolling_update_size (GtkKineticScrolling *data, |
45 | double lower, |
46 | double upper); |
47 | |
48 | gboolean gtk_kinetic_scrolling_tick (GtkKineticScrolling *data, |
49 | double time_delta, |
50 | double *position, |
51 | double *velocity); |
52 | |
53 | void gtk_kinetic_scrolling_stop (GtkKineticScrolling *data); |
54 | |
55 | G_END_DECLS |
56 | |
57 | #endif /* __GTK_KINETIC_SCROLLING_H__ */ |
58 | |