This repository was archived by the owner on Jul 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathuni-anim-view.h
More file actions
87 lines (69 loc) · 2.84 KB
/
uni-anim-view.h
File metadata and controls
87 lines (69 loc) · 2.84 KB
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
/*
* Copyright © 2009-2018 Siyan Panayotov <contact@siyanpanayotov.com>
*
* Based on code by (see README for details):
* - Björn Lindqvist <bjourne@gmail.com>
*
* This file is part of Viewnior.
*
* Viewnior 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 3 of the License, or
* (at your option) any later version.
*
* Viewnior 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 Viewnior. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __UNI_ANIM_VIEW_H__
#define __UNI_ANIM_VIEW_H__
#include "uni-image-view.h"
G_BEGIN_DECLS
#define UNI_TYPE_ANIM_VIEW (uni_anim_view_get_type ())
#define UNI_ANIM_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNI_TYPE_ANIM_VIEW, UniAnimView))
#define UNI_ANIM_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNI_TYPE_ANIM_VIEW, UniAnimViewClass))
#define UNI_IS_ANIM_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNI_TYPE_ANIM_VIEW))
#define UNI_IS_ANIM_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNI_TYPE_ANIM_VIEW))
#define UNI_ANIM_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNI_TYPE_ANIM_VIEW, UniAnimViewClass))
typedef struct _UniAnimView UniAnimView;
typedef struct _UniAnimViewClass UniAnimViewClass;
/**
* UniAnimView:
*
* UniAnimView is a subclass of #UniImageView that provies facilities
* for displaying and controlling an animation.
**/
struct _UniAnimView {
UniImageView parent;
/* The current animation. */
GdkPixbufAnimation *anim;
/* The iterator of the current animation. */
GdkPixbufAnimationIter *iter;
/* ID of the currently running animation timer. */
int timer_id;
/* Timer used to get the right frame. */
GTimeVal time;
int delay;
};
struct _UniAnimViewClass {
UniImageViewClass parent_class;
/* Keybinding signals. */
void (*toggle_running) (UniAnimView * aview);
void (*step) (UniAnimView * aview);
};
GType uni_anim_view_get_type (void) G_GNUC_CONST;
/* Constructors */
GtkWidget *uni_anim_view_new (void);
/* Read-write properties */
gboolean uni_anim_view_set_anim (UniAnimView * aview,
GdkPixbufAnimation * anim);
void uni_anim_view_set_static (UniAnimView * aview,
GdkPixbuf *anim);
void uni_anim_view_set_is_playing (UniAnimView * aview,
gboolean playing);
G_END_DECLS
#endif /* __UNI_ANIM_VIEW_H__ */