// Package gtk was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gtk import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gio" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) type VideoClass struct { _ structs.HostLayout ParentClass WidgetClass } func (x *VideoClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Shows a `GtkMediaStream` with media controls. // // <picture> // // <source srcset="video-dark.png" media="(prefers-color-scheme: dark)"> // <img alt="An example GtkVideo" src="video.png"> // // </picture> // // The controls are available separately as [class@Gtk.MediaControls]. // If you just want to display a video without controls, you can treat it // like any other paintable and for example put it into a [class@Gtk.Picture]. // // `GtkVideo` aims to cover use cases such as previews, embedded animations, // etc. It supports autoplay, looping, and simple media controls. It does // not have support for video overlays, multichannel audio, device // selection, or input. If you are writing a full-fledged video player, // you may want to use the [iface@Gdk.Paintable] API and a media framework // such as Gstreamer directly. type Video struct { Widget } var xVideoGLibType func() types.GType func VideoGLibType() types.GType { return xVideoGLibType() } func VideoNewFromInternalPtr(ptr uintptr) *Video { cls := &Video{} cls.Ptr = ptr return cls } var xNewVideo func() uintptr // Creates a new empty `GtkVideo`. func NewVideo() *Video { var cls *Video cret := xNewVideo() if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Video{} cls.Ptr = cret return cls } var xNewVideoForFile func(uintptr) uintptr // Creates a `GtkVideo` to play back the given @file. func NewVideoForFile(FileVar gio.File) *Video { var cls *Video cret := xNewVideoForFile(FileVar.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Video{} cls.Ptr = cret return cls } var xNewVideoForFilename func(uintptr) uintptr // Creates a `GtkVideo` to play back the given @filename. // // This is a utility function that calls [ctor@Gtk.Video.new_for_file], // See that function for details. func NewVideoForFilename(FilenameVar *string) *Video { var cls *Video FilenameVarPtr := core.GStrdupNullable(FilenameVar) defer core.GFreeNullable(FilenameVarPtr) cret := xNewVideoForFilename(FilenameVarPtr) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Video{} cls.Ptr = cret return cls } var xNewVideoForMediaStream func(uintptr) uintptr // Creates a `GtkVideo` to play back the given @stream. func NewVideoForMediaStream(StreamVar *MediaStream) *Video { var cls *Video cret := xNewVideoForMediaStream(StreamVar.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Video{} cls.Ptr = cret return cls } var xNewVideoForResource func(uintptr) uintptr // Creates a `GtkVideo` to play back the resource at the // given @resource_path. // // This is a utility function that calls [ctor@Gtk.Video.new_for_file]. func NewVideoForResource(ResourcePathVar *string) *Video { var cls *Video ResourcePathVarPtr := core.GStrdupNullable(ResourcePathVar) defer core.GFreeNullable(ResourcePathVarPtr) cret := xNewVideoForResource(ResourcePathVarPtr) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &Video{} cls.Ptr = cret return cls } var xVideoGetAutoplay func(uintptr) bool // Returns %TRUE if videos have been set to loop. func (x *Video) GetAutoplay() bool { cret := xVideoGetAutoplay(x.GoPointer()) return cret } var xVideoGetFile func(uintptr) uintptr // Gets the file played by @self or %NULL if not playing back // a file. func (x *Video) GetFile() *gio.FileBase { var cls *gio.FileBase cret := xVideoGetFile(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &gio.FileBase{} cls.Ptr = cret return cls } var xVideoGetGraphicsOffload func(uintptr) GraphicsOffloadEnabled // Returns whether graphics offload is enabled. // // See [class@Gtk.GraphicsOffload] for more information on graphics offload. func (x *Video) GetGraphicsOffload() GraphicsOffloadEnabled { cret := xVideoGetGraphicsOffload(x.GoPointer()) return cret } var xVideoGetLoop func(uintptr) bool // Returns %TRUE if videos have been set to loop. func (x *Video) GetLoop() bool { cret := xVideoGetLoop(x.GoPointer()) return cret } var xVideoGetMediaStream func(uintptr) uintptr // Gets the media stream managed by @self or %NULL if none. func (x *Video) GetMediaStream() *MediaStream { var cls *MediaStream cret := xVideoGetMediaStream(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &MediaStream{} cls.Ptr = cret return cls } var xVideoSetAutoplay func(uintptr, bool) // Sets whether @self automatically starts playback when it // becomes visible or when a new file gets loaded. func (x *Video) SetAutoplay(AutoplayVar bool) { xVideoSetAutoplay(x.GoPointer(), AutoplayVar) } var xVideoSetFile func(uintptr, uintptr) // Makes @self play the given @file. func (x *Video) SetFile(FileVar gio.File) { xVideoSetFile(x.GoPointer(), FileVar.GoPointer()) } var xVideoSetFilename func(uintptr, uintptr) // Makes @self play the given @filename. // // This is a utility function that calls gtk_video_set_file(), func (x *Video) SetFilename(FilenameVar *string) { FilenameVarPtr := core.GStrdupNullable(FilenameVar) defer core.GFreeNullable(FilenameVarPtr) xVideoSetFilename(x.GoPointer(), FilenameVarPtr) } var xVideoSetGraphicsOffload func(uintptr, GraphicsOffloadEnabled) // Sets whether to enable graphics offload. // // See [class@Gtk.GraphicsOffload] for more information on graphics offload. func (x *Video) SetGraphicsOffload(EnabledVar GraphicsOffloadEnabled) { xVideoSetGraphicsOffload(x.GoPointer(), EnabledVar) } var xVideoSetLoop func(uintptr, bool) // Sets whether new files loaded by @self should be set to loop. func (x *Video) SetLoop(LoopVar bool) { xVideoSetLoop(x.GoPointer(), LoopVar) } var xVideoSetMediaStream func(uintptr, uintptr) // Sets the media stream to be played back. // // @self will take full control of managing the media stream. If you // want to manage a media stream yourself, consider using a // [class@Gtk.Picture] for display. // // If you want to display a file, consider using [method@Gtk.Video.set_file] // instead. func (x *Video) SetMediaStream(StreamVar *MediaStream) { xVideoSetMediaStream(x.GoPointer(), StreamVar.GoPointer()) } var xVideoSetResource func(uintptr, uintptr) // Makes @self play the resource at the given @resource_path. // // This is a utility function that calls [method@Gtk.Video.set_file]. func (x *Video) SetResource(ResourcePathVar *string) { ResourcePathVarPtr := core.GStrdupNullable(ResourcePathVar) defer core.GFreeNullable(ResourcePathVarPtr) xVideoSetResource(x.GoPointer(), ResourcePathVarPtr) } func (c *Video) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *Video) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyAutoplay sets the "autoplay" property. // If the video should automatically begin playing. func (x *Video) SetPropertyAutoplay(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("autoplay", &v) } // GetPropertyAutoplay gets the "autoplay" property. // If the video should automatically begin playing. func (x *Video) GetPropertyAutoplay() bool { var v gobject.Value x.GetProperty("autoplay", &v) return v.GetBoolean() } // SetPropertyLoop sets the "loop" property. // If new media files should be set to loop. func (x *Video) SetPropertyLoop(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("loop", &v) } // GetPropertyLoop gets the "loop" property. // If new media files should be set to loop. func (x *Video) GetPropertyLoop() bool { var v gobject.Value x.GetProperty("loop", &v) return v.GetBoolean() } // Requests the user's screen reader to announce the given message. // // This kind of notification is useful for messages that // either have only a visual representation or that are not // exposed visually at all, e.g. a notification about a // successful operation. // // Also, by using this API, you can ensure that the message // does not interrupts the user's current screen reader output. func (x *Video) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) { XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) } // Retrieves the accessible parent for an accessible object. // // This function returns `NULL` for top level widgets. func (x *Video) GetAccessibleParent() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetAccessibleParent(x.GoPointer()) if cret == 0 { return nil } cls = &AccessibleBase{} cls.Ptr = cret return cls } // Retrieves the accessible role of an accessible object. func (x *Video) GetAccessibleRole() AccessibleRole { cret := XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *Video) GetAtContext() *ATContext { var cls *ATContext cret := XGtkAccessibleGetAtContext(x.GoPointer()) if cret == 0 { return nil } cls = &ATContext{} cls.Ptr = cret return cls } // Queries the coordinates and dimensions of this accessible // // This functionality can be overridden by `GtkAccessible` // implementations, e.g. to get the bounds from an ignored // child widget. func (x *Video) GetBounds(XVar *int, YVar *int, WidthVar *int, HeightVar *int) bool { cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) return cret } // Retrieves the first accessible child of an accessible object. func (x *Video) GetFirstAccessibleChild() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) if cret == 0 { return nil } cls = &AccessibleBase{} cls.Ptr = cret return cls } // Retrieves the next accessible sibling of an accessible object func (x *Video) GetNextAccessibleSibling() *AccessibleBase { var cls *AccessibleBase cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) if cret == 0 { return nil } cls = &AccessibleBase{} cls.Ptr = cret return cls } // Queries a platform state, such as focus. // // This functionality can be overridden by `GtkAccessible` // implementations, e.g. to get platform state from an ignored // child widget, as is the case for `GtkText` wrappers. func (x *Video) GetPlatformState(StateVar AccessiblePlatformState) bool { cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *Video) ResetProperty(PropertyVar AccessibleProperty) { XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *Video) ResetRelation(RelationVar AccessibleRelation) { XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *Video) ResetState(StateVar AccessibleState) { XGtkAccessibleResetState(x.GoPointer(), StateVar) } // Sets the parent and sibling of an accessible object. // // This function is meant to be used by accessible implementations that are // not part of the widget hierarchy, and but act as a logical bridge between // widgets. For instance, if a widget creates an object that holds metadata // for each child, and you want that object to implement the `GtkAccessible` // interface, you will use this function to ensure that the parent of each // child widget is the metadata object, and the parent of each metadata // object is the container widget. func (x *Video) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) { XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) } // Updates the next accessible sibling. // // That might be useful when a new child of a custom accessible // is created, and it needs to be linked to a previous child. func (x *Video) UpdateNextAccessibleSibling(NewSiblingVar Accessible) { XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) } // Informs ATs that the platform state has changed. // // This function should be used by `GtkAccessible` implementations that // have a platform state but are not widgets. Widgets handle platform // states automatically. func (x *Video) UpdatePlatformState(StateVar AccessiblePlatformState) { XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) } // Updates a list of accessible properties. // // See the [enum@Gtk.AccessibleProperty] documentation for the // value types of accessible properties. // // This function should be called by `GtkWidget` types whenever // an accessible property change must be communicated to assistive // technologies. // // Example: // ```c // value = gtk_adjustment_get_value (adjustment); // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), // // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, // -1); // // ``` func (x *Video) UpdateProperty(FirstPropertyVar AccessibleProperty, varArgs ...interface{}) { XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) } // Updates an array of accessible properties. // // This function should be called by `GtkWidget` types whenever an accessible // property change must be communicated to assistive technologies. // // This function is meant to be used by language bindings. func (x *Video) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []AccessibleProperty, ValuesVar []gobject.Value) { XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) } // Updates a list of accessible relations. // // This function should be called by `GtkWidget` types whenever an accessible // relation change must be communicated to assistive technologies. // // If the [enum@Gtk.AccessibleRelation] requires a list of references, // you should pass each reference individually, followed by `NULL`, e.g. // // ```c // gtk_accessible_update_relation (accessible, // // GTK_ACCESSIBLE_RELATION_CONTROLS, // ref1, NULL, // GTK_ACCESSIBLE_RELATION_LABELLED_BY, // ref1, ref2, ref3, NULL, // -1); // // ``` func (x *Video) UpdateRelation(FirstRelationVar AccessibleRelation, varArgs ...interface{}) { XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) } // Updates an array of accessible relations. // // This function should be called by `GtkWidget` types whenever an accessible // relation change must be communicated to assistive technologies. // // This function is meant to be used by language bindings. func (x *Video) UpdateRelationValue(NRelationsVar int, RelationsVar []AccessibleRelation, ValuesVar []gobject.Value) { XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) } // Updates a list of accessible states. // // See the [enum@Gtk.AccessibleState] documentation for the // value types of accessible states. // // This function should be called by `GtkWidget` types whenever // an accessible state change must be communicated to assistive // technologies. // // Example: // // ```c // value = GTK_ACCESSIBLE_TRISTATE_MIXED; // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), // // GTK_ACCESSIBLE_STATE_CHECKED, value, // -1); // // ``` func (x *Video) UpdateState(FirstStateVar AccessibleState, varArgs ...interface{}) { XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) } // Updates an array of accessible states. // // This function should be called by `GtkWidget` types whenever an accessible // state change must be communicated to assistive technologies. // // This function is meant to be used by language bindings. func (x *Video) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState, ValuesVar []gobject.Value) { XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) } // Gets the ID of the @buildable object. // // `GtkBuilder` sets the name based on the ID attribute // of the `<object>` tag used to construct the @buildable. func (x *Video) GetBuildableId() string { cret := XGtkBuildableGetBuildableId(x.GoPointer()) return cret } func init() { core.SetPackageName("GTK", "gtk4") core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"}) var libs []uintptr for _, libPath := range core.GetPaths("GTK") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xVideoGLibType, libs, "gtk_video_get_type") core.PuregoSafeRegister(&xNewVideo, libs, "gtk_video_new") core.PuregoSafeRegister(&xNewVideoForFile, libs, "gtk_video_new_for_file") core.PuregoSafeRegister(&xNewVideoForFilename, libs, "gtk_video_new_for_filename") core.PuregoSafeRegister(&xNewVideoForMediaStream, libs, "gtk_video_new_for_media_stream") core.PuregoSafeRegister(&xNewVideoForResource, libs, "gtk_video_new_for_resource") core.PuregoSafeRegister(&xVideoGetAutoplay, libs, "gtk_video_get_autoplay") core.PuregoSafeRegister(&xVideoGetFile, libs, "gtk_video_get_file") core.PuregoSafeRegister(&xVideoGetGraphicsOffload, libs, "gtk_video_get_graphics_offload") core.PuregoSafeRegister(&xVideoGetLoop, libs, "gtk_video_get_loop") core.PuregoSafeRegister(&xVideoGetMediaStream, libs, "gtk_video_get_media_stream") core.PuregoSafeRegister(&xVideoSetAutoplay, libs, "gtk_video_set_autoplay") core.PuregoSafeRegister(&xVideoSetFile, libs, "gtk_video_set_file") core.PuregoSafeRegister(&xVideoSetFilename, libs, "gtk_video_set_filename") core.PuregoSafeRegister(&xVideoSetGraphicsOffload, libs, "gtk_video_set_graphics_offload") core.PuregoSafeRegister(&xVideoSetLoop, libs, "gtk_video_set_loop") core.PuregoSafeRegister(&xVideoSetMediaStream, libs, "gtk_video_set_media_stream") core.PuregoSafeRegister(&xVideoSetResource, libs, "gtk_video_set_resource") }