summaryrefslogtreecommitdiff
path: root/plugins/mouse/msd-timeline.h
blob: 5e6941136d867b2e5c316371edadbb16af834924 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/* msdtimeline.c
 *
 * Copyright (C) 2008 Carlos Garnacho  <carlos@imendio.com>
 * Copyright (C) 2012-2021 MATE Developers
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#ifndef __MSD_TIMELINE_H__
#define __MSD_TIMELINE_H__

#include <glib-object.h>
#include <gdk/gdk.h>

#ifdef __cplusplus
extern "C" {
#endif

#define MSD_TYPE_TIMELINE_DIRECTION       (msd_timeline_direction_get_type ())
#define MSD_TYPE_TIMELINE_PROGRESS_TYPE   (msd_timeline_progress_type_get_type ())
#define MSD_TYPE_TIMELINE                 (msd_timeline_get_type ())
#define MSD_TIMELINE(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), MSD_TYPE_TIMELINE, MsdTimeline))
#define MSD_TIMELINE_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass),  MSD_TYPE_TIMELINE, MsdTimelineClass))
#define MSD_IS_TIMELINE(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MSD_TYPE_TIMELINE))
#define MSD_IS_TIMELINE_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass),  MSD_TYPE_TIMELINE))
#define MSD_TIMELINE_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj),  MSD_TYPE_TIMELINE, MsdTimelineClass))

typedef enum {
  MSD_TIMELINE_DIRECTION_FORWARD,
  MSD_TIMELINE_DIRECTION_BACKWARD
} MsdTimelineDirection;

typedef enum {
  MSD_TIMELINE_PROGRESS_LINEAR,
  MSD_TIMELINE_PROGRESS_SINUSOIDAL,
  MSD_TIMELINE_PROGRESS_EXPONENTIAL
} MsdTimelineProgressType;

typedef struct MsdTimeline      MsdTimeline;
typedef struct MsdTimelineClass MsdTimelineClass;

struct MsdTimeline
{
  GObject parent_instance;
};

struct MsdTimelineClass
{
  GObjectClass parent_class;

  void (* started)           (MsdTimeline *timeline);
  void (* finished)          (MsdTimeline *timeline);
  void (* paused)            (MsdTimeline *timeline);

  void (* frame)             (MsdTimeline *timeline,
			      gdouble      progress);

  void (* __msd_reserved1) (void);
  void (* __msd_reserved2) (void);
  void (* __msd_reserved3) (void);
  void (* __msd_reserved4) (void);
};

typedef gdouble (*MsdTimelineProgressFunc) (gdouble progress);

GType                   msd_timeline_get_type           (void) G_GNUC_CONST;
GType                   msd_timeline_direction_get_type (void) G_GNUC_CONST;
GType                   msd_timeline_progress_type_get_type (void) G_GNUC_CONST;

MsdTimeline            *msd_timeline_new                (guint                    duration);
MsdTimeline            *msd_timeline_new_for_screen     (guint                    duration,
							 GdkScreen               *screen);

void                    msd_timeline_start              (MsdTimeline             *timeline);
void                    msd_timeline_pause              (MsdTimeline             *timeline);
void                    msd_timeline_rewind             (MsdTimeline             *timeline);

gboolean                msd_timeline_is_running         (MsdTimeline             *timeline);

guint                   msd_timeline_get_fps            (MsdTimeline             *timeline);
void                    msd_timeline_set_fps            (MsdTimeline             *timeline,
							 guint                    fps);

gboolean                msd_timeline_get_loop           (MsdTimeline             *timeline);
void                    msd_timeline_set_loop           (MsdTimeline             *timeline,
							 gboolean                 loop);

guint                   msd_timeline_get_duration       (MsdTimeline             *timeline);
void                    msd_timeline_set_duration       (MsdTimeline             *timeline,
							 guint                    duration);

GdkScreen              *msd_timeline_get_screen         (MsdTimeline             *timeline);
void                    msd_timeline_set_screen         (MsdTimeline             *timeline,
							 GdkScreen               *screen);

MsdTimelineDirection    msd_timeline_get_direction      (MsdTimeline             *timeline);
void                    msd_timeline_set_direction      (MsdTimeline             *timeline,
							 MsdTimelineDirection     direction);

MsdTimelineProgressType msd_timeline_get_progress_type  (MsdTimeline             *timeline);
void                    msd_timeline_set_progress_type  (MsdTimeline             *timeline,
							 MsdTimelineProgressType  type);
void                    msd_timeline_get_progress_func  (MsdTimeline             *timeline);

void                    msd_timeline_set_progress_func  (MsdTimeline             *timeline,
							 MsdTimelineProgressFunc  progress_func);

gdouble                 msd_timeline_get_progress       (MsdTimeline             *timeline);

#ifdef __cplusplus
}
#endif

#endif /* __MSD_TIMELINE_H__ */