1// Package gdk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gdk
3
4import (
5 "structs"
6 "unsafe"
7
8 "github.com/ebitengine/purego"
9
10 "github.com/bnema/puregotk/pkg/core"
11 "github.com/bnema/puregotk/v4/gobject/types"
12)
13
14// Holds timing information for a single frame of the application’s displays.
15//
16// To retrieve `GdkFrameTimings` objects, use [method@Gdk.FrameClock.get_timings]
17// or [method@Gdk.FrameClock.get_current_timings]. The information in
18// `GdkFrameTimings` is useful for precise synchronization of video with
19// the event or audio streams, and for measuring quality metrics for the
20// application’s display, such as latency and jitter.
21type FrameTimings struct {
22 _ structs.HostLayout
23}
24
25var xFrameTimingsGLibType func() types.GType
26
27func FrameTimingsGLibType() types.GType {
28 return xFrameTimingsGLibType()
29}
30
31func (x *FrameTimings) GoPointer() uintptr {
32 return uintptr(unsafe.Pointer(x))
33}
34
35var xFrameTimingsGetComplete func(uintptr) bool
36
37// Returns whether @timings are complete.
38//
39// The timing information in a `GdkFrameTimings` is filled in
40// incrementally as the frame as drawn and passed off to the
41// window system for processing and display to the user. The
42// accessor functions for `GdkFrameTimings` can return 0 to
43// indicate an unavailable value for two reasons: either because
44// the information is not yet available, or because it isn't
45// available at all.
46//
47// Once this function returns %TRUE for a frame, you can be
48// certain that no further values will become available and be
49// stored in the `GdkFrameTimings`.
50func (x *FrameTimings) GetComplete() bool {
51
52 cret := xFrameTimingsGetComplete(x.GoPointer())
53 return cret
54}
55
56var xFrameTimingsGetFrameCounter func(uintptr) int64
57
58// Gets the frame counter value of the `GdkFrameClock` when
59// this frame was drawn.
60func (x *FrameTimings) GetFrameCounter() int64 {
61
62 cret := xFrameTimingsGetFrameCounter(x.GoPointer())
63 return cret
64}
65
66var xFrameTimingsGetFrameTime func(uintptr) int64
67
68// Returns the frame time for the frame.
69//
70// This is the time value that is typically used to time
71// animations for the frame. See [method@Gdk.FrameClock.get_frame_time].
72func (x *FrameTimings) GetFrameTime() int64 {
73
74 cret := xFrameTimingsGetFrameTime(x.GoPointer())
75 return cret
76}
77
78var xFrameTimingsGetPredictedPresentationTime func(uintptr) int64
79
80// Gets the predicted time at which this frame will be displayed.
81//
82// Although no predicted time may be available, if one is available,
83// it will be available while the frame is being generated, in contrast
84// to [method@Gdk.FrameTimings.get_presentation_time], which is only
85// available after the frame has been presented.
86//
87// In general, if you are simply animating, you should use
88// [method@Gdk.FrameClock.get_frame_time] rather than this function,
89// but this function is useful for applications that want exact control
90// over latency. For example, a movie player may want this information
91// for Audio/Video synchronization.
92func (x *FrameTimings) GetPredictedPresentationTime() int64 {
93
94 cret := xFrameTimingsGetPredictedPresentationTime(x.GoPointer())
95 return cret
96}
97
98var xFrameTimingsGetPresentationTime func(uintptr) int64
99
100// Reurns the presentation time.
101//
102// This is the time at which the frame became visible to the user.
103func (x *FrameTimings) GetPresentationTime() int64 {
104
105 cret := xFrameTimingsGetPresentationTime(x.GoPointer())
106 return cret
107}
108
109var xFrameTimingsGetRefreshInterval func(uintptr) int64
110
111// Gets the natural interval between presentation times for
112// the display that this frame was displayed on.
113//
114// Frame presentation usually happens during the “vertical
115// blanking interval”.
116func (x *FrameTimings) GetRefreshInterval() int64 {
117
118 cret := xFrameTimingsGetRefreshInterval(x.GoPointer())
119 return cret
120}
121
122var xFrameTimingsRef func(uintptr) *FrameTimings
123
124// Increases the reference count of @timings.
125func (x *FrameTimings) Ref() *FrameTimings {
126
127 cret := xFrameTimingsRef(x.GoPointer())
128 return cret
129}
130
131var xFrameTimingsUnref func(uintptr)
132
133// Decreases the reference count of @timings.
134//
135// If @timings is no longer referenced, it will be freed.
136func (x *FrameTimings) Unref() {
137
138 xFrameTimingsUnref(x.GoPointer())
139
140}
141
142func init() {
143 core.SetPackageName("GDK", "gtk4")
144 core.SetSharedLibraries("GDK", []string{"libgtk-4.so.1"})
145 var libs []uintptr
146 for _, libPath := range core.GetPaths("GDK") {
147 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
148 if err != nil {
149 panic(err)
150 }
151 libs = append(libs, lib)
152 }
153
154 core.PuregoSafeRegister(&xFrameTimingsGLibType, libs, "gdk_frame_timings_get_type")
155
156 core.PuregoSafeRegister(&xFrameTimingsGetComplete, libs, "gdk_frame_timings_get_complete")
157 core.PuregoSafeRegister(&xFrameTimingsGetFrameCounter, libs, "gdk_frame_timings_get_frame_counter")
158 core.PuregoSafeRegister(&xFrameTimingsGetFrameTime, libs, "gdk_frame_timings_get_frame_time")
159 core.PuregoSafeRegister(&xFrameTimingsGetPredictedPresentationTime, libs, "gdk_frame_timings_get_predicted_presentation_time")
160 core.PuregoSafeRegister(&xFrameTimingsGetPresentationTime, libs, "gdk_frame_timings_get_presentation_time")
161 core.PuregoSafeRegister(&xFrameTimingsGetRefreshInterval, libs, "gdk_frame_timings_get_refresh_interval")
162 core.PuregoSafeRegister(&xFrameTimingsRef, libs, "gdk_frame_timings_ref")
163 core.PuregoSafeRegister(&xFrameTimingsUnref, libs, "gdk_frame_timings_unref")
164
165}