1// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gtk
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"
12 "github.com/bnema/puregotk/v4/gobject/types"
13)
14
15type MediaControlsClass struct {
16 _ structs.HostLayout
17
18 ParentClass WidgetClass
19}
20
21func (x *MediaControlsClass) GoPointer() uintptr {
22 return uintptr(unsafe.Pointer(x))
23}
24
25// Shows controls for video playback.
26//
27// <picture>
28//
29// <source srcset="media-controls-dark.png" media="(prefers-color-scheme: dark)">
30// <img alt="An example GtkMediaControls" src="media-controls.png">
31//
32// </picture>
33//
34// Usually, `GtkMediaControls` is used as part of [class@Gtk.Video].
35type MediaControls struct {
36 Widget
37}
38
39var xMediaControlsGLibType func() types.GType
40
41func MediaControlsGLibType() types.GType {
42 return xMediaControlsGLibType()
43}
44
45func MediaControlsNewFromInternalPtr(ptr uintptr) *MediaControls {
46 cls := &MediaControls{}
47 cls.Ptr = ptr
48 return cls
49}
50
51var xNewMediaControls func(uintptr) uintptr
52
53// Creates a new `GtkMediaControls` managing the @stream passed to it.
54func NewMediaControls(StreamVar *MediaStream) *MediaControls {
55 var cls *MediaControls
56
57 cret := xNewMediaControls(StreamVar.GoPointer())
58
59 if cret == 0 {
60 return nil
61 }
62 gobject.IncreaseRef(cret)
63 cls = &MediaControls{}
64 cls.Ptr = cret
65 return cls
66}
67
68var xMediaControlsGetMediaStream func(uintptr) uintptr
69
70// Gets the media stream managed by @controls or %NULL if none.
71func (x *MediaControls) GetMediaStream() *MediaStream {
72 var cls *MediaStream
73
74 cret := xMediaControlsGetMediaStream(x.GoPointer())
75
76 if cret == 0 {
77 return nil
78 }
79 gobject.IncreaseRef(cret)
80 cls = &MediaStream{}
81 cls.Ptr = cret
82 return cls
83}
84
85var xMediaControlsSetMediaStream func(uintptr, uintptr)
86
87// Sets the stream that is controlled by @controls.
88func (x *MediaControls) SetMediaStream(StreamVar *MediaStream) {
89
90 xMediaControlsSetMediaStream(x.GoPointer(), StreamVar.GoPointer())
91
92}
93
94func (c *MediaControls) GoPointer() uintptr {
95 if c == nil {
96 return 0
97 }
98 return c.Ptr
99}
100
101func (c *MediaControls) SetGoPointer(ptr uintptr) {
102 c.Ptr = ptr
103}
104
105// Requests the user's screen reader to announce the given message.
106//
107// This kind of notification is useful for messages that
108// either have only a visual representation or that are not
109// exposed visually at all, e.g. a notification about a
110// successful operation.
111//
112// Also, by using this API, you can ensure that the message
113// does not interrupts the user's current screen reader output.
114func (x *MediaControls) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
115
116 XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
117
118}
119
120// Retrieves the accessible parent for an accessible object.
121//
122// This function returns `NULL` for top level widgets.
123func (x *MediaControls) GetAccessibleParent() *AccessibleBase {
124 var cls *AccessibleBase
125
126 cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
127
128 if cret == 0 {
129 return nil
130 }
131 cls = &AccessibleBase{}
132 cls.Ptr = cret
133 return cls
134}
135
136// Retrieves the accessible role of an accessible object.
137func (x *MediaControls) GetAccessibleRole() AccessibleRole {
138
139 cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
140 return cret
141}
142
143// Retrieves the implementation for the given accessible object.
144func (x *MediaControls) GetAtContext() *ATContext {
145 var cls *ATContext
146
147 cret := XGtkAccessibleGetAtContext(x.GoPointer())
148
149 if cret == 0 {
150 return nil
151 }
152 cls = &ATContext{}
153 cls.Ptr = cret
154 return cls
155}
156
157// Queries the coordinates and dimensions of this accessible
158//
159// This functionality can be overridden by `GtkAccessible`
160// implementations, e.g. to get the bounds from an ignored
161// child widget.
162func (x *MediaControls) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
163
164 cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
165 return cret
166}
167
168// Retrieves the first accessible child of an accessible object.
169func (x *MediaControls) GetFirstAccessibleChild() *AccessibleBase {
170 var cls *AccessibleBase
171
172 cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
173
174 if cret == 0 {
175 return nil
176 }
177 cls = &AccessibleBase{}
178 cls.Ptr = cret
179 return cls
180}
181
182// Retrieves the next accessible sibling of an accessible object
183func (x *MediaControls) GetNextAccessibleSibling() *AccessibleBase {
184 var cls *AccessibleBase
185
186 cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
187
188 if cret == 0 {
189 return nil
190 }
191 cls = &AccessibleBase{}
192 cls.Ptr = cret
193 return cls
194}
195
196// Queries a platform state, such as focus.
197//
198// This functionality can be overridden by `GtkAccessible`
199// implementations, e.g. to get platform state from an ignored
200// child widget, as is the case for `GtkText` wrappers.
201func (x *MediaControls) GetPlatformState(StateVar AccessiblePlatformState) bool {
202
203 cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
204 return cret
205}
206
207// Resets the accessible property to its default value.
208func (x *MediaControls) ResetProperty(PropertyVar AccessibleProperty) {
209
210 XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
211
212}
213
214// Resets the accessible relation to its default value.
215func (x *MediaControls) ResetRelation(RelationVar AccessibleRelation) {
216
217 XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
218
219}
220
221// Resets the accessible state to its default value.
222func (x *MediaControls) ResetState(StateVar AccessibleState) {
223
224 XGtkAccessibleResetState(x.GoPointer(), StateVar)
225
226}
227
228// Sets the parent and sibling of an accessible object.
229//
230// This function is meant to be used by accessible implementations that are
231// not part of the widget hierarchy, and but act as a logical bridge between
232// widgets. For instance, if a widget creates an object that holds metadata
233// for each child, and you want that object to implement the `GtkAccessible`
234// interface, you will use this function to ensure that the parent of each
235// child widget is the metadata object, and the parent of each metadata
236// object is the container widget.
237func (x *MediaControls) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
238
239 XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
240
241}
242
243// Updates the next accessible sibling.
244//
245// That might be useful when a new child of a custom accessible
246// is created, and it needs to be linked to a previous child.
247func (x *MediaControls) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
248
249 XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
250
251}
252
253// Informs ATs that the platform state has changed.
254//
255// This function should be used by `GtkAccessible` implementations that
256// have a platform state but are not widgets. Widgets handle platform
257// states automatically.
258func (x *MediaControls) UpdatePlatformState(StateVar AccessiblePlatformState) {
259
260 XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
261
262}
263
264// Updates a list of accessible properties.
265//
266// See the [enum@Gtk.AccessibleProperty] documentation for the
267// value types of accessible properties.
268//
269// This function should be called by `GtkWidget` types whenever
270// an accessible property change must be communicated to assistive
271// technologies.
272//
273// Example:
274// ```c
275// value = gtk_adjustment_get_value (adjustment);
276// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
277//
278// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
279// -1);
280//
281// ```
282func (x *MediaControls) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
283
284 XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
285
286}
287
288// Updates an array of accessible properties.
289//
290// This function should be called by `GtkWidget` types whenever an accessible
291// property change must be communicated to assistive technologies.
292//
293// This function is meant to be used by language bindings.
294func (x *MediaControls) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
295
296 XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
297
298}
299
300// Updates a list of accessible relations.
301//
302// This function should be called by `GtkWidget` types whenever an accessible
303// relation change must be communicated to assistive technologies.
304//
305// If the [enum@Gtk.AccessibleRelation] requires a list of references,
306// you should pass each reference individually, followed by `NULL`, e.g.
307//
308// ```c
309// gtk_accessible_update_relation (accessible,
310//
311// GTK_ACCESSIBLE_RELATION_CONTROLS,
312// ref1, NULL,
313// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
314// ref1, ref2, ref3, NULL,
315// -1);
316//
317// ```
318func (x *MediaControls) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
319
320 XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
321
322}
323
324// Updates an array of accessible relations.
325//
326// This function should be called by `GtkWidget` types whenever an accessible
327// relation change must be communicated to assistive technologies.
328//
329// This function is meant to be used by language bindings.
330func (x *MediaControls) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
331
332 XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
333
334}
335
336// Updates a list of accessible states.
337//
338// See the [enum@Gtk.AccessibleState] documentation for the
339// value types of accessible states.
340//
341// This function should be called by `GtkWidget` types whenever
342// an accessible state change must be communicated to assistive
343// technologies.
344//
345// Example:
346//
347// ```c
348// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
349// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
350//
351// GTK_ACCESSIBLE_STATE_CHECKED, value,
352// -1);
353//
354// ```
355func (x *MediaControls) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
356
357 XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
358
359}
360
361// Updates an array of accessible states.
362//
363// This function should be called by `GtkWidget` types whenever an accessible
364// state change must be communicated to assistive technologies.
365//
366// This function is meant to be used by language bindings.
367func (x *MediaControls) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
368
369 XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
370
371}
372
373// Gets the ID of the @buildable object.
374//
375// `GtkBuilder` sets the name based on the ID attribute
376// of the `<object>` tag used to construct the @buildable.
377func (x *MediaControls) GetBuildableId() string {
378
379 cret := XGtkBuildableGetBuildableId(x.GoPointer())
380 return cret
381}
382
383func init() {
384 core.SetPackageName("GTK", "gtk4")
385 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
386 var libs []uintptr
387 for _, libPath := range core.GetPaths("GTK") {
388 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
389 if err != nil {
390 panic(err)
391 }
392 libs = append(libs, lib)
393 }
394
395 core.PuregoSafeRegister(&xMediaControlsGLibType, libs, "gtk_media_controls_get_type")
396
397 core.PuregoSafeRegister(&xNewMediaControls, libs, "gtk_media_controls_new")
398
399 core.PuregoSafeRegister(&xMediaControlsGetMediaStream, libs, "gtk_media_controls_get_media_stream")
400 core.PuregoSafeRegister(&xMediaControlsSetMediaStream, libs, "gtk_media_controls_set_media_stream")
401
402}