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/gdk"
12 "github.com/bnema/puregotk/v4/gdkpixbuf"
13 "github.com/bnema/puregotk/v4/gio"
14 "github.com/bnema/puregotk/v4/gobject"
15 "github.com/bnema/puregotk/v4/gobject/types"
16)
17
18type PictureClass struct {
19 _ structs.HostLayout
20
21 ParentClass WidgetClass
22}
23
24func (x *PictureClass) GoPointer() uintptr {
25 return uintptr(unsafe.Pointer(x))
26}
27
28// Displays a `GdkPaintable`.
29//
30// <picture>
31//
32// <source srcset="picture-dark.png" media="(prefers-color-scheme: dark)">
33// <img alt="An example GtkPicture" src="picture.png">
34//
35// </picture>
36//
37// Many convenience functions are provided to make pictures simple to use.
38// For example, if you want to load an image from a file, and then display
39// it, there’s a convenience function to do this:
40//
41// ```c
42// GtkWidget *widget = gtk_picture_new_for_filename ("myfile.png");
43// ```
44//
45// If the file isn’t loaded successfully, the picture will contain a
46// “broken image” icon similar to that used in many web browsers.
47// If you want to handle errors in loading the file yourself,
48// for example by displaying an error message, then load the image with
49// and image loading framework such as libglycin, then create the `GtkPicture`
50// with [ctor@Gtk.Picture.new_for_paintable].
51//
52// Sometimes an application will want to avoid depending on external data
53// files, such as image files. See the documentation of `GResource` for details.
54// In this case, [ctor@Gtk.Picture.new_for_resource] and
55// [method@Gtk.Picture.set_resource] should be used.
56//
57// `GtkPicture` displays an image at its natural size. See [class@Gtk.Image]
58// if you want to display a fixed-size image, such as an icon.
59//
60// ## Sizing the paintable
61//
62// You can influence how the paintable is displayed inside the `GtkPicture`
63// by changing [property@Gtk.Picture:content-fit]. See [enum@Gtk.ContentFit]
64// for details. [property@Gtk.Picture:can-shrink] can be unset to make sure
65// that paintables are never made smaller than their ideal size - but
66// be careful if you do not know the size of the paintable in use (like
67// when displaying user-loaded images). This can easily cause the picture to
68// grow larger than the screen. And [property@Gtk.Widget:halign] and
69// [property@Gtk.Widget:valign] can be used to make sure the paintable doesn't
70// fill all available space but is instead displayed at its original size.
71//
72// ## CSS nodes
73//
74// `GtkPicture` has a single CSS node with the name `picture`.
75//
76// ## Accessibility
77//
78// `GtkPicture` uses the [enum@Gtk.AccessibleRole.img] role.
79type Picture struct {
80 Widget
81}
82
83var xPictureGLibType func() types.GType
84
85func PictureGLibType() types.GType {
86 return xPictureGLibType()
87}
88
89func PictureNewFromInternalPtr(ptr uintptr) *Picture {
90 cls := &Picture{}
91 cls.Ptr = ptr
92 return cls
93}
94
95var xNewPicture func() uintptr
96
97// Creates a new empty `GtkPicture` widget.
98func NewPicture() *Picture {
99 var cls *Picture
100
101 cret := xNewPicture()
102
103 if cret == 0 {
104 return nil
105 }
106 gobject.IncreaseRef(cret)
107 cls = &Picture{}
108 cls.Ptr = cret
109 return cls
110}
111
112var xNewPictureForFile func(uintptr) uintptr
113
114// Creates a new `GtkPicture` displaying the given @file.
115//
116// If the file isn’t found or can’t be loaded, the resulting
117// `GtkPicture` is empty.
118//
119// If you need to detect failures to load the file, use an
120// image loading framework such as libglycin to load the file
121// yourself, then create the `GtkPicture` from the texture.
122func NewPictureForFile(FileVar gio.File) *Picture {
123 var cls *Picture
124
125 cret := xNewPictureForFile(FileVar.GoPointer())
126
127 if cret == 0 {
128 return nil
129 }
130 gobject.IncreaseRef(cret)
131 cls = &Picture{}
132 cls.Ptr = cret
133 return cls
134}
135
136var xNewPictureForFilename func(uintptr) uintptr
137
138// Creates a new `GtkPicture` displaying the file @filename.
139//
140// This is a utility function that calls [ctor@Gtk.Picture.new_for_file].
141// See that function for details.
142func NewPictureForFilename(FilenameVar *string) *Picture {
143 var cls *Picture
144
145 FilenameVarPtr := core.GStrdupNullable(FilenameVar)
146 defer core.GFreeNullable(FilenameVarPtr)
147
148 cret := xNewPictureForFilename(FilenameVarPtr)
149
150 if cret == 0 {
151 return nil
152 }
153 gobject.IncreaseRef(cret)
154 cls = &Picture{}
155 cls.Ptr = cret
156 return cls
157}
158
159var xNewPictureForPaintable func(uintptr) uintptr
160
161// Creates a new `GtkPicture` displaying @paintable.
162//
163// The `GtkPicture` will track changes to the @paintable and update
164// its size and contents in response to it.
165func NewPictureForPaintable(PaintableVar gdk.Paintable) *Picture {
166 var cls *Picture
167
168 cret := xNewPictureForPaintable(PaintableVar.GoPointer())
169
170 if cret == 0 {
171 return nil
172 }
173 gobject.IncreaseRef(cret)
174 cls = &Picture{}
175 cls.Ptr = cret
176 return cls
177}
178
179var xNewPictureForPixbuf func(uintptr) uintptr
180
181// Creates a new `GtkPicture` displaying @pixbuf.
182//
183// This is a utility function that calls [ctor@Gtk.Picture.new_for_paintable],
184// See that function for details.
185//
186// The pixbuf must not be modified after passing it to this function.
187func NewPictureForPixbuf(PixbufVar *gdkpixbuf.Pixbuf) *Picture {
188 var cls *Picture
189
190 cret := xNewPictureForPixbuf(PixbufVar.GoPointer())
191
192 if cret == 0 {
193 return nil
194 }
195 gobject.IncreaseRef(cret)
196 cls = &Picture{}
197 cls.Ptr = cret
198 return cls
199}
200
201var xNewPictureForResource func(uintptr) uintptr
202
203// Creates a new `GtkPicture` displaying the resource at @resource_path.
204//
205// This is a utility function that calls [ctor@Gtk.Picture.new_for_file].
206// See that function for details.
207func NewPictureForResource(ResourcePathVar *string) *Picture {
208 var cls *Picture
209
210 ResourcePathVarPtr := core.GStrdupNullable(ResourcePathVar)
211 defer core.GFreeNullable(ResourcePathVarPtr)
212
213 cret := xNewPictureForResource(ResourcePathVarPtr)
214
215 if cret == 0 {
216 return nil
217 }
218 gobject.IncreaseRef(cret)
219 cls = &Picture{}
220 cls.Ptr = cret
221 return cls
222}
223
224var xPictureGetAlternativeText func(uintptr) string
225
226// Gets the alternative textual description of the picture.
227//
228// The returned string will be %NULL if the picture cannot be described textually.
229func (x *Picture) GetAlternativeText() string {
230
231 cret := xPictureGetAlternativeText(x.GoPointer())
232 return cret
233}
234
235var xPictureGetCanShrink func(uintptr) bool
236
237// Returns whether the `GtkPicture` respects its contents size.
238func (x *Picture) GetCanShrink() bool {
239
240 cret := xPictureGetCanShrink(x.GoPointer())
241 return cret
242}
243
244var xPictureGetContentFit func(uintptr) ContentFit
245
246// Returns the fit mode for the content of the `GtkPicture`.
247//
248// See [enum@Gtk.ContentFit] for details.
249func (x *Picture) GetContentFit() ContentFit {
250
251 cret := xPictureGetContentFit(x.GoPointer())
252 return cret
253}
254
255var xPictureGetFile func(uintptr) uintptr
256
257// Gets the `GFile` currently displayed if @self is displaying a file.
258//
259// If @self is not displaying a file, for example when
260// [method@Gtk.Picture.set_paintable] was used, then %NULL is returned.
261func (x *Picture) GetFile() *gio.FileBase {
262 var cls *gio.FileBase
263
264 cret := xPictureGetFile(x.GoPointer())
265
266 if cret == 0 {
267 return nil
268 }
269 gobject.IncreaseRef(cret)
270 cls = &gio.FileBase{}
271 cls.Ptr = cret
272 return cls
273}
274
275var xPictureGetKeepAspectRatio func(uintptr) bool
276
277// Returns whether the `GtkPicture` preserves its contents aspect ratio.
278func (x *Picture) GetKeepAspectRatio() bool {
279
280 cret := xPictureGetKeepAspectRatio(x.GoPointer())
281 return cret
282}
283
284var xPictureGetPaintable func(uintptr) uintptr
285
286// Gets the `GdkPaintable` being displayed by the `GtkPicture`.
287func (x *Picture) GetPaintable() *gdk.PaintableBase {
288 var cls *gdk.PaintableBase
289
290 cret := xPictureGetPaintable(x.GoPointer())
291
292 if cret == 0 {
293 return nil
294 }
295 gobject.IncreaseRef(cret)
296 cls = &gdk.PaintableBase{}
297 cls.Ptr = cret
298 return cls
299}
300
301var xPictureSetAlternativeText func(uintptr, uintptr)
302
303// Sets an alternative textual description for the picture contents.
304//
305// It is equivalent to the "alt" attribute for images on websites.
306//
307// This text will be made available to accessibility tools.
308//
309// If the picture cannot be described textually, set this property to %NULL.
310func (x *Picture) SetAlternativeText(AlternativeTextVar *string) {
311
312 AlternativeTextVarPtr := core.GStrdupNullable(AlternativeTextVar)
313 defer core.GFreeNullable(AlternativeTextVarPtr)
314
315 xPictureSetAlternativeText(x.GoPointer(), AlternativeTextVarPtr)
316
317}
318
319var xPictureSetCanShrink func(uintptr, bool)
320
321// If set to %TRUE, the @self can be made smaller than its contents.
322//
323// The contents will then be scaled down when rendering.
324//
325// If you want to still force a minimum size manually, consider using
326// [method@Gtk.Widget.set_size_request].
327//
328// Also of note is that a similar function for growing does not exist
329// because the grow behavior can be controlled via
330// [method@Gtk.Widget.set_halign] and [method@Gtk.Widget.set_valign].
331func (x *Picture) SetCanShrink(CanShrinkVar bool) {
332
333 xPictureSetCanShrink(x.GoPointer(), CanShrinkVar)
334
335}
336
337var xPictureSetContentFit func(uintptr, ContentFit)
338
339// Sets how the content should be resized to fit the `GtkPicture`.
340//
341// See [enum@Gtk.ContentFit] for details.
342func (x *Picture) SetContentFit(ContentFitVar ContentFit) {
343
344 xPictureSetContentFit(x.GoPointer(), ContentFitVar)
345
346}
347
348var xPictureSetFile func(uintptr, uintptr)
349
350// Makes @self load and display @file.
351//
352// See [ctor@Gtk.Picture.new_for_file] for details.
353//
354// ::: warning
355//
356// Note that this function should not be used with untrusted data.
357// Use a proper image loading framework such as libglycin, which can
358// load many image formats into a `GdkTexture`, and then use
359// [method@Gtk.Image.set_from_paintable].
360func (x *Picture) SetFile(FileVar gio.File) {
361
362 xPictureSetFile(x.GoPointer(), FileVar.GoPointer())
363
364}
365
366var xPictureSetFilename func(uintptr, uintptr)
367
368// Makes @self load and display the given @filename.
369//
370// This is a utility function that calls [method@Gtk.Picture.set_file].
371//
372// ::: warning
373//
374// Note that this function should not be used with untrusted data.
375// Use a proper image loading framework such as libglycin, which can
376// load many image formats into a `GdkTexture`, and then use
377// [method@Gtk.Image.set_from_paintable].
378func (x *Picture) SetFilename(FilenameVar *string) {
379
380 FilenameVarPtr := core.GStrdupNullable(FilenameVar)
381 defer core.GFreeNullable(FilenameVarPtr)
382
383 xPictureSetFilename(x.GoPointer(), FilenameVarPtr)
384
385}
386
387var xPictureSetKeepAspectRatio func(uintptr, bool)
388
389// If set to %TRUE, the @self will render its contents according to
390// their aspect ratio.
391//
392// That means that empty space may show up at the top/bottom or
393// left/right of @self.
394//
395// If set to %FALSE or if the contents provide no aspect ratio,
396// the contents will be stretched over the picture's whole area.
397func (x *Picture) SetKeepAspectRatio(KeepAspectRatioVar bool) {
398
399 xPictureSetKeepAspectRatio(x.GoPointer(), KeepAspectRatioVar)
400
401}
402
403var xPictureSetPaintable func(uintptr, uintptr)
404
405// Makes @self display the given @paintable.
406//
407// If @paintable is `NULL`, nothing will be displayed.
408//
409// See [ctor@Gtk.Picture.new_for_paintable] for details.
410func (x *Picture) SetPaintable(PaintableVar gdk.Paintable) {
411
412 xPictureSetPaintable(x.GoPointer(), PaintableVar.GoPointer())
413
414}
415
416var xPictureSetPixbuf func(uintptr, uintptr)
417
418// Sets a `GtkPicture` to show a `GdkPixbuf`.
419//
420// See [ctor@Gtk.Picture.new_for_pixbuf] for details.
421//
422// This is a utility function that calls [method@Gtk.Picture.set_paintable].
423func (x *Picture) SetPixbuf(PixbufVar *gdkpixbuf.Pixbuf) {
424
425 xPictureSetPixbuf(x.GoPointer(), PixbufVar.GoPointer())
426
427}
428
429var xPictureSetResource func(uintptr, uintptr)
430
431// Makes @self load and display the resource at the given
432// @resource_path.
433//
434// This is a utility function that calls [method@Gtk.Picture.set_file].
435func (x *Picture) SetResource(ResourcePathVar *string) {
436
437 ResourcePathVarPtr := core.GStrdupNullable(ResourcePathVar)
438 defer core.GFreeNullable(ResourcePathVarPtr)
439
440 xPictureSetResource(x.GoPointer(), ResourcePathVarPtr)
441
442}
443
444func (c *Picture) GoPointer() uintptr {
445 if c == nil {
446 return 0
447 }
448 return c.Ptr
449}
450
451func (c *Picture) SetGoPointer(ptr uintptr) {
452 c.Ptr = ptr
453}
454
455// SetPropertyAlternativeText sets the "alternative-text" property.
456// The alternative textual description for the picture.
457func (x *Picture) SetPropertyAlternativeText(value string) {
458 var v gobject.Value
459 v.Init(gobject.TypeStringVal)
460 v.SetString(&value)
461 x.SetProperty("alternative-text", &v)
462}
463
464// GetPropertyAlternativeText gets the "alternative-text" property.
465// The alternative textual description for the picture.
466func (x *Picture) GetPropertyAlternativeText() string {
467 var v gobject.Value
468 x.GetProperty("alternative-text", &v)
469 return v.GetString()
470}
471
472// SetPropertyCanShrink sets the "can-shrink" property.
473// If the `GtkPicture` can be made smaller than the natural size of its contents.
474func (x *Picture) SetPropertyCanShrink(value bool) {
475 var v gobject.Value
476 v.Init(gobject.TypeBooleanVal)
477 v.SetBoolean(value)
478 x.SetProperty("can-shrink", &v)
479}
480
481// GetPropertyCanShrink gets the "can-shrink" property.
482// If the `GtkPicture` can be made smaller than the natural size of its contents.
483func (x *Picture) GetPropertyCanShrink() bool {
484 var v gobject.Value
485 x.GetProperty("can-shrink", &v)
486 return v.GetBoolean()
487}
488
489// SetPropertyKeepAspectRatio sets the "keep-aspect-ratio" property.
490// Whether the GtkPicture will render its contents trying to preserve the aspect
491// ratio.
492func (x *Picture) SetPropertyKeepAspectRatio(value bool) {
493 var v gobject.Value
494 v.Init(gobject.TypeBooleanVal)
495 v.SetBoolean(value)
496 x.SetProperty("keep-aspect-ratio", &v)
497}
498
499// GetPropertyKeepAspectRatio gets the "keep-aspect-ratio" property.
500// Whether the GtkPicture will render its contents trying to preserve the aspect
501// ratio.
502func (x *Picture) GetPropertyKeepAspectRatio() bool {
503 var v gobject.Value
504 x.GetProperty("keep-aspect-ratio", &v)
505 return v.GetBoolean()
506}
507
508// Requests the user's screen reader to announce the given message.
509//
510// This kind of notification is useful for messages that
511// either have only a visual representation or that are not
512// exposed visually at all, e.g. a notification about a
513// successful operation.
514//
515// Also, by using this API, you can ensure that the message
516// does not interrupts the user's current screen reader output.
517func (x *Picture) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) {
518
519 XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar)
520
521}
522
523// Retrieves the accessible parent for an accessible object.
524//
525// This function returns `NULL` for top level widgets.
526func (x *Picture) GetAccessibleParent() *AccessibleBase {
527 var cls *AccessibleBase
528
529 cret := XGtkAccessibleGetAccessibleParent(x.GoPointer())
530
531 if cret == 0 {
532 return nil
533 }
534 cls = &AccessibleBase{}
535 cls.Ptr = cret
536 return cls
537}
538
539// Retrieves the accessible role of an accessible object.
540func (x *Picture) GetAccessibleRole() AccessibleRole {
541
542 cret := XGtkAccessibleGetAccessibleRole(x.GoPointer())
543 return cret
544}
545
546// Retrieves the implementation for the given accessible object.
547func (x *Picture) GetAtContext() *ATContext {
548 var cls *ATContext
549
550 cret := XGtkAccessibleGetAtContext(x.GoPointer())
551
552 if cret == 0 {
553 return nil
554 }
555 cls = &ATContext{}
556 cls.Ptr = cret
557 return cls
558}
559
560// Queries the coordinates and dimensions of this accessible
561//
562// This functionality can be overridden by `GtkAccessible`
563// implementations, e.g. to get the bounds from an ignored
564// child widget.
565func (x *Picture) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool {
566
567 cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar)
568 return cret
569}
570
571// Retrieves the first accessible child of an accessible object.
572func (x *Picture) GetFirstAccessibleChild() *AccessibleBase {
573 var cls *AccessibleBase
574
575 cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer())
576
577 if cret == 0 {
578 return nil
579 }
580 cls = &AccessibleBase{}
581 cls.Ptr = cret
582 return cls
583}
584
585// Retrieves the next accessible sibling of an accessible object
586func (x *Picture) GetNextAccessibleSibling() *AccessibleBase {
587 var cls *AccessibleBase
588
589 cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer())
590
591 if cret == 0 {
592 return nil
593 }
594 cls = &AccessibleBase{}
595 cls.Ptr = cret
596 return cls
597}
598
599// Queries a platform state, such as focus.
600//
601// This functionality can be overridden by `GtkAccessible`
602// implementations, e.g. to get platform state from an ignored
603// child widget, as is the case for `GtkText` wrappers.
604func (x *Picture) GetPlatformState(StateVar AccessiblePlatformState) bool {
605
606 cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar)
607 return cret
608}
609
610// Resets the accessible property to its default value.
611func (x *Picture) ResetProperty(PropertyVar AccessibleProperty) {
612
613 XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar)
614
615}
616
617// Resets the accessible relation to its default value.
618func (x *Picture) ResetRelation(RelationVar AccessibleRelation) {
619
620 XGtkAccessibleResetRelation(x.GoPointer(), RelationVar)
621
622}
623
624// Resets the accessible state to its default value.
625func (x *Picture) ResetState(StateVar AccessibleState) {
626
627 XGtkAccessibleResetState(x.GoPointer(), StateVar)
628
629}
630
631// Sets the parent and sibling of an accessible object.
632//
633// This function is meant to be used by accessible implementations that are
634// not part of the widget hierarchy, and but act as a logical bridge between
635// widgets. For instance, if a widget creates an object that holds metadata
636// for each child, and you want that object to implement the `GtkAccessible`
637// interface, you will use this function to ensure that the parent of each
638// child widget is the metadata object, and the parent of each metadata
639// object is the container widget.
640func (x *Picture) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) {
641
642 XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer())
643
644}
645
646// Updates the next accessible sibling.
647//
648// That might be useful when a new child of a custom accessible
649// is created, and it needs to be linked to a previous child.
650func (x *Picture) UpdateNextAccessibleSibling(NewSiblingVar Accessible) {
651
652 XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer())
653
654}
655
656// Informs ATs that the platform state has changed.
657//
658// This function should be used by `GtkAccessible` implementations that
659// have a platform state but are not widgets. Widgets handle platform
660// states automatically.
661func (x *Picture) UpdatePlatformState(StateVar AccessiblePlatformState) {
662
663 XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar)
664
665}
666
667// Updates a list of accessible properties.
668//
669// See the [enum@Gtk.AccessibleProperty] documentation for the
670// value types of accessible properties.
671//
672// This function should be called by `GtkWidget` types whenever
673// an accessible property change must be communicated to assistive
674// technologies.
675//
676// Example:
677// ```c
678// value = gtk_adjustment_get_value (adjustment);
679// gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
680//
681// GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
682// -1);
683//
684// ```
685func (x *Picture) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) {
686
687 XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...)
688
689}
690
691// Updates an array of accessible properties.
692//
693// This function should be called by `GtkWidget` types whenever an accessible
694// property change must be communicated to assistive technologies.
695//
696// This function is meant to be used by language bindings.
697func (x *Picture) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) {
698
699 XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar)
700
701}
702
703// Updates a list of accessible relations.
704//
705// This function should be called by `GtkWidget` types whenever an accessible
706// relation change must be communicated to assistive technologies.
707//
708// If the [enum@Gtk.AccessibleRelation] requires a list of references,
709// you should pass each reference individually, followed by `NULL`, e.g.
710//
711// ```c
712// gtk_accessible_update_relation (accessible,
713//
714// GTK_ACCESSIBLE_RELATION_CONTROLS,
715// ref1, NULL,
716// GTK_ACCESSIBLE_RELATION_LABELLED_BY,
717// ref1, ref2, ref3, NULL,
718// -1);
719//
720// ```
721func (x *Picture) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) {
722
723 XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...)
724
725}
726
727// Updates an array of accessible relations.
728//
729// This function should be called by `GtkWidget` types whenever an accessible
730// relation change must be communicated to assistive technologies.
731//
732// This function is meant to be used by language bindings.
733func (x *Picture) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) {
734
735 XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar)
736
737}
738
739// Updates a list of accessible states.
740//
741// See the [enum@Gtk.AccessibleState] documentation for the
742// value types of accessible states.
743//
744// This function should be called by `GtkWidget` types whenever
745// an accessible state change must be communicated to assistive
746// technologies.
747//
748// Example:
749//
750// ```c
751// value = GTK_ACCESSIBLE_TRISTATE_MIXED;
752// gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
753//
754// GTK_ACCESSIBLE_STATE_CHECKED, value,
755// -1);
756//
757// ```
758func (x *Picture) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) {
759
760 XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...)
761
762}
763
764// Updates an array of accessible states.
765//
766// This function should be called by `GtkWidget` types whenever an accessible
767// state change must be communicated to assistive technologies.
768//
769// This function is meant to be used by language bindings.
770func (x *Picture) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) {
771
772 XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar)
773
774}
775
776// Gets the ID of the @buildable object.
777//
778// `GtkBuilder` sets the name based on the ID attribute
779// of the `<object>` tag used to construct the @buildable.
780func (x *Picture) GetBuildableId() string {
781
782 cret := XGtkBuildableGetBuildableId(x.GoPointer())
783 return cret
784}
785
786func init() {
787 core.SetPackageName("GTK", "gtk4")
788 core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
789 var libs []uintptr
790 for _, libPath := range core.GetPaths("GTK") {
791 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
792 if err != nil {
793 panic(err)
794 }
795 libs = append(libs, lib)
796 }
797
798 core.PuregoSafeRegister(&xPictureGLibType, libs, "gtk_picture_get_type")
799
800 core.PuregoSafeRegister(&xNewPicture, libs, "gtk_picture_new")
801 core.PuregoSafeRegister(&xNewPictureForFile, libs, "gtk_picture_new_for_file")
802 core.PuregoSafeRegister(&xNewPictureForFilename, libs, "gtk_picture_new_for_filename")
803 core.PuregoSafeRegister(&xNewPictureForPaintable, libs, "gtk_picture_new_for_paintable")
804 core.PuregoSafeRegister(&xNewPictureForPixbuf, libs, "gtk_picture_new_for_pixbuf")
805 core.PuregoSafeRegister(&xNewPictureForResource, libs, "gtk_picture_new_for_resource")
806
807 core.PuregoSafeRegister(&xPictureGetAlternativeText, libs, "gtk_picture_get_alternative_text")
808 core.PuregoSafeRegister(&xPictureGetCanShrink, libs, "gtk_picture_get_can_shrink")
809 core.PuregoSafeRegister(&xPictureGetContentFit, libs, "gtk_picture_get_content_fit")
810 core.PuregoSafeRegister(&xPictureGetFile, libs, "gtk_picture_get_file")
811 core.PuregoSafeRegister(&xPictureGetKeepAspectRatio, libs, "gtk_picture_get_keep_aspect_ratio")
812 core.PuregoSafeRegister(&xPictureGetPaintable, libs, "gtk_picture_get_paintable")
813 core.PuregoSafeRegister(&xPictureSetAlternativeText, libs, "gtk_picture_set_alternative_text")
814 core.PuregoSafeRegister(&xPictureSetCanShrink, libs, "gtk_picture_set_can_shrink")
815 core.PuregoSafeRegister(&xPictureSetContentFit, libs, "gtk_picture_set_content_fit")
816 core.PuregoSafeRegister(&xPictureSetFile, libs, "gtk_picture_set_file")
817 core.PuregoSafeRegister(&xPictureSetFilename, libs, "gtk_picture_set_filename")
818 core.PuregoSafeRegister(&xPictureSetKeepAspectRatio, libs, "gtk_picture_set_keep_aspect_ratio")
819 core.PuregoSafeRegister(&xPictureSetPaintable, libs, "gtk_picture_set_paintable")
820 core.PuregoSafeRegister(&xPictureSetPixbuf, libs, "gtk_picture_set_pixbuf")
821 core.PuregoSafeRegister(&xPictureSetResource, libs, "gtk_picture_set_resource")
822
823}