-
Notifications
You must be signed in to change notification settings - Fork 6
/
adw-animation-util.go
80 lines (64 loc) · 1.58 KB
/
adw-animation-util.go
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
// Code generated by girgen. DO NOT EDIT.
package adw
import (
"runtime"
"unsafe"
coreglib "github.com/diamondburned/gotk4/pkg/core/glib"
"github.com/diamondburned/gotk4/pkg/gtk/v4"
)
// #include <stdlib.h>
// #include <adwaita.h>
import "C"
// GetEnableAnimations checks whether animations are enabled for widget.
//
// This should be used when implementing an animated widget to know whether to
// animate it or not.
//
// The function takes the following parameters:
//
// - widget: GtkWidget.
//
// The function returns the following values:
//
// - ok: whether animations are enabled for widget.
//
func GetEnableAnimations(widget gtk.Widgetter) bool {
var _arg1 *C.GtkWidget // out
var _cret C.gboolean // in
_arg1 = (*C.GtkWidget)(unsafe.Pointer(coreglib.InternObject(widget).Native()))
_cret = C.adw_get_enable_animations(_arg1)
runtime.KeepAlive(widget)
var _ok bool // out
if _cret != 0 {
_ok = true
}
return _ok
}
// Lerp computes the linear interpolation between a and b for t.
//
// The function takes the following parameters:
//
// - a: start.
// - b: end.
// - t: interpolation rate.
//
// The function returns the following values:
//
// - gdouble: computed value.
//
func Lerp(a, b, t float64) float64 {
var _arg1 C.double // out
var _arg2 C.double // out
var _arg3 C.double // out
var _cret C.double // in
_arg1 = C.double(a)
_arg2 = C.double(b)
_arg3 = C.double(t)
_cret = C.adw_lerp(_arg1, _arg2, _arg3)
runtime.KeepAlive(a)
runtime.KeepAlive(b)
runtime.KeepAlive(t)
var _gdouble float64 // out
_gdouble = float64(_cret)
return _gdouble
}