// 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/gdk" "github.com/bnema/puregotk/v4/glib" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) // The `GtkGLAreaClass` structure contains only private data. type GLAreaClass struct { _ structs.HostLayout ParentClass WidgetClass xRender uintptr xResize uintptr xCreateContext uintptr Padding [8]uintptr } func (x *GLAreaClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // OverrideRender sets the "render" callback function. // class closure for the `GtkGLArea::render` signal func (x *GLAreaClass) OverrideRender(cb func(*GLArea, *gdk.GLContext) bool) { if cb == nil { x.xRender = 0 } else { x.xRender = purego.NewCallback(func(AreaVarp uintptr, ContextVarp uintptr) bool { return cb(GLAreaNewFromInternalPtr(AreaVarp), gdk.GLContextNewFromInternalPtr(ContextVarp)) }) } } // GetRender gets the "render" callback function. // class closure for the `GtkGLArea::render` signal func (x *GLAreaClass) GetRender() func(*GLArea, *gdk.GLContext) bool { if x.xRender == 0 { return nil } var rawCallback func(AreaVarp uintptr, ContextVarp uintptr) bool purego.RegisterFunc(&rawCallback, x.xRender) return func(AreaVar *GLArea, ContextVar *gdk.GLContext) bool { return rawCallback(AreaVar.GoPointer(), ContextVar.GoPointer()) } } // OverrideResize sets the "resize" callback function. // class closeure for the `GtkGLArea::resize` signal func (x *GLAreaClass) OverrideResize(cb func(*GLArea, int, int)) { if cb == nil { x.xResize = 0 } else { x.xResize = purego.NewCallback(func(AreaVarp uintptr, WidthVarp int, HeightVarp int) { cb(GLAreaNewFromInternalPtr(AreaVarp), WidthVarp, HeightVarp) }) } } // GetResize gets the "resize" callback function. // class closeure for the `GtkGLArea::resize` signal func (x *GLAreaClass) GetResize() func(*GLArea, int, int) { if x.xResize == 0 { return nil } var rawCallback func(AreaVarp uintptr, WidthVarp int, HeightVarp int) purego.RegisterFunc(&rawCallback, x.xResize) return func(AreaVar *GLArea, WidthVar int, HeightVar int) { rawCallback(AreaVar.GoPointer(), WidthVar, HeightVar) } } // OverrideCreateContext sets the "create_context" callback function. // class closure for the `GtkGLArea::create-context` signal func (x *GLAreaClass) OverrideCreateContext(cb func(*GLArea) *gdk.GLContext) { if cb == nil { x.xCreateContext = 0 } else { x.xCreateContext = purego.NewCallback(func(AreaVarp uintptr) uintptr { ret := cb(GLAreaNewFromInternalPtr(AreaVarp)) if ret == nil { return 0 } return ret.GoPointer() }) } } // GetCreateContext gets the "create_context" callback function. // class closure for the `GtkGLArea::create-context` signal func (x *GLAreaClass) GetCreateContext() func(*GLArea) *gdk.GLContext { if x.xCreateContext == 0 { return nil } var rawCallback func(AreaVarp uintptr) uintptr purego.RegisterFunc(&rawCallback, x.xCreateContext) return func(AreaVar *GLArea) *gdk.GLContext { rawRet := rawCallback(AreaVar.GoPointer()) if rawRet == 0 { return nil } ret := &gdk.GLContext{} ret.Ptr = rawRet return ret } } // Allows drawing with OpenGL. // // <picture> // // <source srcset="glarea-dark.png" media="(prefers-color-scheme: dark)"> // <img alt="An example GtkGLArea" src="glarea.png"> // // </picture> // // `GtkGLArea` sets up its own [class@Gdk.GLContext], and creates a custom // GL framebuffer that the widget will do GL rendering onto. It also ensures // that this framebuffer is the default GL rendering target when rendering. // The completed rendering is integrated into the larger GTK scene graph as // a texture. // // In order to draw, you have to connect to the [signal@Gtk.GLArea::render] // signal, or subclass `GtkGLArea` and override the GtkGLAreaClass.render // virtual function. // // The `GtkGLArea` widget ensures that the `GdkGLContext` is associated with // the widget's drawing area, and it is kept updated when the size and // position of the drawing area changes. // // ## Drawing with GtkGLArea // // The simplest way to draw using OpenGL commands in a `GtkGLArea` is to // create a widget instance and connect to the [signal@Gtk.GLArea::render] signal: // // The `render()` function will be called when the `GtkGLArea` is ready // for you to draw its content: // // The initial contents of the framebuffer are transparent. // // ```c // static gboolean // render (GtkGLArea *area, GdkGLContext *context) // // { // // inside this function it's safe to use GL; the given // // GdkGLContext has been made current to the drawable // // surface used by the `GtkGLArea` and the viewport has // // already been set to be the size of the allocation // // // we can start by clearing the buffer // glClearColor (0, 0, 0, 0); // glClear (GL_COLOR_BUFFER_BIT); // // // record the active framebuffer ID, so we can return to it // // with `glBindFramebuffer (GL_FRAMEBUFFER, screen_fb)` should // // we, for instance, intend on utilizing the results of an // // intermediate render texture pass // GLuint screen_fb = 0; // glGetIntegerv (GL_FRAMEBUFFER_BINDING, &screen_fb); // // // draw your object // // draw_an_object (); // // // we completed our drawing; the draw commands will be // // flushed at the end of the signal emission chain, and // // the buffers will be drawn on the window // return TRUE; // } // // void setup_glarea (void) // // { // // create a GtkGLArea instance // GtkWidget *gl_area = gtk_gl_area_new (); // // // connect to the "render" signal // g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL); // } // // ``` // // If you need to initialize OpenGL state, e.g. buffer objects or // shaders, you should use the [signal@Gtk.Widget::realize] signal; // you can use the [signal@Gtk.Widget::unrealize] signal to clean up. // Since the `GdkGLContext` creation and initialization may fail, you // will need to check for errors, using [method@Gtk.GLArea.get_error]. // // An example of how to safely initialize the GL state is: // // ```c // static void // on_realize (GtkGLArea *area) // // { // // We need to make the context current if we want to // // call GL API // gtk_gl_area_make_current (area); // // // If there were errors during the initialization or // // when trying to make the context current, this // // function will return a GError for you to catch // if (gtk_gl_area_get_error (area) != NULL) // return; // // // You can also use gtk_gl_area_set_error() in order // // to show eventual initialization errors on the // // GtkGLArea widget itself // GError *internal_error = NULL; // init_buffer_objects (&error); // if (error != NULL) // { // gtk_gl_area_set_error (area, error); // g_error_free (error); // return; // } // // init_shaders (&error); // if (error != NULL) // { // gtk_gl_area_set_error (area, error); // g_error_free (error); // return; // } // } // // ``` // // If you need to change the options for creating the `GdkGLContext` // you should use the [signal@Gtk.GLArea::create-context] signal. type GLArea struct { Widget } var xGLAreaGLibType func() types.GType func GLAreaGLibType() types.GType { return xGLAreaGLibType() } func GLAreaNewFromInternalPtr(ptr uintptr) *GLArea { cls := &GLArea{} cls.Ptr = ptr return cls } var xNewGLArea func() uintptr // Creates a new `GtkGLArea` widget. func NewGLArea() *GLArea { var cls *GLArea cret := xNewGLArea() if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &GLArea{} cls.Ptr = cret return cls } var xGLAreaAttachBuffers func(uintptr) // Binds buffers to the framebuffer. // // Ensures that the @area framebuffer object is made the current draw // and read target, and that all the required buffers for the @area // are created and bound to the framebuffer. // // This function is automatically called before emitting the // [signal@Gtk.GLArea::render] signal, and doesn't normally need to be // called by application code. func (x *GLArea) AttachBuffers() { xGLAreaAttachBuffers(x.GoPointer()) } var xGLAreaGetAllowedApis func(uintptr) gdk.GLAPI // Gets the allowed APIs. // // See [method@Gtk.GLArea.set_allowed_apis]. func (x *GLArea) GetAllowedApis() gdk.GLAPI { cret := xGLAreaGetAllowedApis(x.GoPointer()) return cret } var xGLAreaGetApi func(uintptr) gdk.GLAPI // Gets the API that is currently in use. // // If the GL area has not been realized yet, 0 is returned. func (x *GLArea) GetApi() gdk.GLAPI { cret := xGLAreaGetApi(x.GoPointer()) return cret } var xGLAreaGetAutoRender func(uintptr) bool // Returns whether the area is in auto render mode or not. func (x *GLArea) GetAutoRender() bool { cret := xGLAreaGetAutoRender(x.GoPointer()) return cret } var xGLAreaGetContext func(uintptr) uintptr // Retrieves the `GdkGLContext` used by @area. func (x *GLArea) GetContext() *gdk.GLContext { var cls *gdk.GLContext cret := xGLAreaGetContext(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &gdk.GLContext{} cls.Ptr = cret return cls } var xGLAreaGetError func(uintptr) *glib.Error // Gets the current error set on the @area. func (x *GLArea) GetError() *glib.Error { cret := xGLAreaGetError(x.GoPointer()) return cret } var xGLAreaGetHasDepthBuffer func(uintptr) bool // Returns whether the area has a depth buffer. func (x *GLArea) GetHasDepthBuffer() bool { cret := xGLAreaGetHasDepthBuffer(x.GoPointer()) return cret } var xGLAreaGetHasStencilBuffer func(uintptr) bool // Returns whether the area has a stencil buffer. func (x *GLArea) GetHasStencilBuffer() bool { cret := xGLAreaGetHasStencilBuffer(x.GoPointer()) return cret } var xGLAreaGetRequiredVersion func(uintptr, *int, *int) // Retrieves the required version of OpenGL. // // See [method@Gtk.GLArea.set_required_version]. func (x *GLArea) GetRequiredVersion(MajorVar *int, MinorVar *int) { xGLAreaGetRequiredVersion(x.GoPointer(), MajorVar, MinorVar) } var xGLAreaGetUseEs func(uintptr) bool // Returns whether the `GtkGLArea` should use OpenGL ES. // // See [method@Gtk.GLArea.set_use_es]. func (x *GLArea) GetUseEs() bool { cret := xGLAreaGetUseEs(x.GoPointer()) return cret } var xGLAreaMakeCurrent func(uintptr) // Ensures that the `GdkGLContext` used by @area is associated with // the `GtkGLArea`. // // This function is automatically called before emitting the // [signal@Gtk.GLArea::render] signal, and doesn't normally need // to be called by application code. func (x *GLArea) MakeCurrent() { xGLAreaMakeCurrent(x.GoPointer()) } var xGLAreaQueueRender func(uintptr) // Marks the currently rendered data (if any) as invalid, and queues // a redraw of the widget. // // This ensures that the [signal@Gtk.GLArea::render] signal // is emitted during the draw. // // This is only needed when [method@Gtk.GLArea.set_auto_render] has // been called with a %FALSE value. The default behaviour is to // emit [signal@Gtk.GLArea::render] on each draw. func (x *GLArea) QueueRender() { xGLAreaQueueRender(x.GoPointer()) } var xGLAreaSetAllowedApis func(uintptr, gdk.GLAPI) // Sets the allowed APIs to create a context with. // // You should check [property@Gtk.GLArea:api] before drawing // with either API. // // By default, all APIs are allowed. func (x *GLArea) SetAllowedApis(ApisVar gdk.GLAPI) { xGLAreaSetAllowedApis(x.GoPointer(), ApisVar) } var xGLAreaSetAutoRender func(uintptr, bool) // Sets whether the `GtkGLArea` is in auto render mode. // // If @auto_render is %TRUE the [signal@Gtk.GLArea::render] signal will // be emitted every time the widget draws. This is the default and is // useful if drawing the widget is faster. // // If @auto_render is %FALSE the data from previous rendering is kept // around and will be used for drawing the widget the next time, // unless the window is resized. In order to force a rendering // [method@Gtk.GLArea.queue_render] must be called. This mode is // useful when the scene changes seldom, but takes a long time to redraw. func (x *GLArea) SetAutoRender(AutoRenderVar bool) { xGLAreaSetAutoRender(x.GoPointer(), AutoRenderVar) } var xGLAreaSetError func(uintptr, *glib.Error) // Sets an error on the area which will be shown instead of the // GL rendering. // // This is useful in the [signal@Gtk.GLArea::create-context] // signal if GL context creation fails. func (x *GLArea) SetError(ErrorVar *glib.Error) { xGLAreaSetError(x.GoPointer(), ErrorVar) } var xGLAreaSetHasDepthBuffer func(uintptr, bool) // Sets whether the `GtkGLArea` should use a depth buffer. // // If @has_depth_buffer is %TRUE the widget will allocate and // enable a depth buffer for the target framebuffer. Otherwise // there will be none. func (x *GLArea) SetHasDepthBuffer(HasDepthBufferVar bool) { xGLAreaSetHasDepthBuffer(x.GoPointer(), HasDepthBufferVar) } var xGLAreaSetHasStencilBuffer func(uintptr, bool) // Sets whether the `GtkGLArea` should use a stencil buffer. // // If @has_stencil_buffer is %TRUE the widget will allocate and // enable a stencil buffer for the target framebuffer. Otherwise // there will be none. func (x *GLArea) SetHasStencilBuffer(HasStencilBufferVar bool) { xGLAreaSetHasStencilBuffer(x.GoPointer(), HasStencilBufferVar) } var xGLAreaSetRequiredVersion func(uintptr, int, int) // Sets the required version of OpenGL to be used when creating // the context for the widget. // // This function must be called before the area has been realized. func (x *GLArea) SetRequiredVersion(MajorVar int, MinorVar int) { xGLAreaSetRequiredVersion(x.GoPointer(), MajorVar, MinorVar) } var xGLAreaSetUseEs func(uintptr, bool) // Sets whether the @area should create an OpenGL or an OpenGL ES context. // // You should check the capabilities of the `GdkGLContext` before drawing // with either API. func (x *GLArea) SetUseEs(UseEsVar bool) { xGLAreaSetUseEs(x.GoPointer(), UseEsVar) } func (c *GLArea) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *GLArea) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyAutoRender sets the "auto-render" property. // If set to %TRUE the ::render signal will be emitted every time // the widget draws. // // This is the default and is useful if drawing the widget is faster. // // If set to %FALSE the data from previous rendering is kept around and will // be used for drawing the widget the next time, unless the window is resized. // In order to force a rendering [method@Gtk.GLArea.queue_render] must be called. // This mode is useful when the scene changes seldom, but takes a long time // to redraw. func (x *GLArea) SetPropertyAutoRender(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("auto-render", &v) } // GetPropertyAutoRender gets the "auto-render" property. // If set to %TRUE the ::render signal will be emitted every time // the widget draws. // // This is the default and is useful if drawing the widget is faster. // // If set to %FALSE the data from previous rendering is kept around and will // be used for drawing the widget the next time, unless the window is resized. // In order to force a rendering [method@Gtk.GLArea.queue_render] must be called. // This mode is useful when the scene changes seldom, but takes a long time // to redraw. func (x *GLArea) GetPropertyAutoRender() bool { var v gobject.Value x.GetProperty("auto-render", &v) return v.GetBoolean() } // SetPropertyHasDepthBuffer sets the "has-depth-buffer" property. // If set to %TRUE the widget will allocate and enable a depth buffer for the // target framebuffer. // // Setting this property will enable GL's depth testing as a side effect. If // you don't need depth testing, you should call `glDisable(GL_DEPTH_TEST)` // in your `GtkGLArea::render` handler. func (x *GLArea) SetPropertyHasDepthBuffer(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("has-depth-buffer", &v) } // GetPropertyHasDepthBuffer gets the "has-depth-buffer" property. // If set to %TRUE the widget will allocate and enable a depth buffer for the // target framebuffer. // // Setting this property will enable GL's depth testing as a side effect. If // you don't need depth testing, you should call `glDisable(GL_DEPTH_TEST)` // in your `GtkGLArea::render` handler. func (x *GLArea) GetPropertyHasDepthBuffer() bool { var v gobject.Value x.GetProperty("has-depth-buffer", &v) return v.GetBoolean() } // SetPropertyHasStencilBuffer sets the "has-stencil-buffer" property. // If set to %TRUE the widget will allocate and enable a stencil buffer for the // target framebuffer. func (x *GLArea) SetPropertyHasStencilBuffer(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("has-stencil-buffer", &v) } // GetPropertyHasStencilBuffer gets the "has-stencil-buffer" property. // If set to %TRUE the widget will allocate and enable a stencil buffer for the // target framebuffer. func (x *GLArea) GetPropertyHasStencilBuffer() bool { var v gobject.Value x.GetProperty("has-stencil-buffer", &v) return v.GetBoolean() } // SetPropertyUseEs sets the "use-es" property. // If set to %TRUE the widget will try to create a `GdkGLContext` using // OpenGL ES instead of OpenGL. func (x *GLArea) SetPropertyUseEs(value bool) { var v gobject.Value v.Init(gobject.TypeBooleanVal) v.SetBoolean(value) x.SetProperty("use-es", &v) } // GetPropertyUseEs gets the "use-es" property. // If set to %TRUE the widget will try to create a `GdkGLContext` using // OpenGL ES instead of OpenGL. func (x *GLArea) GetPropertyUseEs() bool { var v gobject.Value x.GetProperty("use-es", &v) return v.GetBoolean() } // Emitted when the widget is being realized. // // This allows you to override how the GL context is created. // This is useful when you want to reuse an existing GL context, // or if you want to try creating different kinds of GL options. // // If context creation fails then the signal handler can use // [method@Gtk.GLArea.set_error] to register a more detailed error // of how the construction failed. func (x *GLArea) ConnectCreateContext(cb *func(GLArea) gdk.GLContext) uint { cbPtr := uintptr(unsafe.Pointer(cb)) if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { handlerID := gobject.SignalConnect(x.GoPointer(), "create-context", cbRefPtr) glib.SaveHandlerMapping(handlerID, cbPtr) return handlerID } fcb := func(clsPtr uintptr) uintptr { fa := GLArea{} fa.Ptr = clsPtr cbFn := *cb CreateContextCls := cbFn(fa) return CreateContextCls.Ptr } cbRefPtr := purego.NewCallback(fcb) glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb) handlerID := gobject.SignalConnect(x.GoPointer(), "create-context", cbRefPtr) glib.SaveHandlerMapping(handlerID, cbPtr) return handlerID } // Emitted every time the contents of the `GtkGLArea` should be redrawn. // // The @context is bound to the @area prior to emitting this function, // and the buffers are painted to the window once the emission terminates. func (x *GLArea) ConnectRender(cb *func(GLArea, uintptr) bool) uint { cbPtr := uintptr(unsafe.Pointer(cb)) if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { handlerID := gobject.SignalConnect(x.GoPointer(), "render", cbRefPtr) glib.SaveHandlerMapping(handlerID, cbPtr) return handlerID } fcb := func(clsPtr uintptr, ContextVarp uintptr) bool { fa := GLArea{} fa.Ptr = clsPtr cbFn := *cb return cbFn(fa, ContextVarp) } cbRefPtr := purego.NewCallback(fcb) glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb) handlerID := gobject.SignalConnect(x.GoPointer(), "render", cbRefPtr) glib.SaveHandlerMapping(handlerID, cbPtr) return handlerID } // Emitted once when the widget is realized, and then each time the widget // is changed while realized. // // This is useful in order to keep GL state up to date with the widget size, // like for instance camera properties which may depend on the width/height // ratio. // // The GL context for the area is guaranteed to be current when this signal // is emitted. // // The default handler sets up the GL viewport. func (x *GLArea) ConnectResize(cb *func(GLArea, int, int)) uint { cbPtr := uintptr(unsafe.Pointer(cb)) if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { handlerID := gobject.SignalConnect(x.GoPointer(), "resize", cbRefPtr) glib.SaveHandlerMapping(handlerID, cbPtr) return handlerID } fcb := func(clsPtr uintptr, WidthVarp int, HeightVarp int) { fa := GLArea{} fa.Ptr = clsPtr cbFn := *cb cbFn(fa, WidthVarp, HeightVarp) } cbRefPtr := purego.NewCallback(fcb) glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb) handlerID := gobject.SignalConnect(x.GoPointer(), "resize", cbRefPtr) glib.SaveHandlerMapping(handlerID, cbPtr) return handlerID } // 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 *GLArea) 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 *GLArea) 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 *GLArea) GetAccessibleRole() AccessibleRole { cret := XGtkAccessibleGetAccessibleRole(x.GoPointer()) return cret } // Retrieves the implementation for the given accessible object. func (x *GLArea) 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 *GLArea) 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 *GLArea) 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 *GLArea) 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 *GLArea) GetPlatformState(StateVar AccessiblePlatformState) bool { cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) return cret } // Resets the accessible property to its default value. func (x *GLArea) ResetProperty(PropertyVar AccessibleProperty) { XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) } // Resets the accessible relation to its default value. func (x *GLArea) ResetRelation(RelationVar AccessibleRelation) { XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) } // Resets the accessible state to its default value. func (x *GLArea) 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 *GLArea) 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 *GLArea) 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 *GLArea) 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 *GLArea) 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 *GLArea) 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 *GLArea) 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 *GLArea) 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 *GLArea) 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 *GLArea) 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 *GLArea) 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(&xGLAreaGLibType, libs, "gtk_gl_area_get_type") core.PuregoSafeRegister(&xNewGLArea, libs, "gtk_gl_area_new") core.PuregoSafeRegister(&xGLAreaAttachBuffers, libs, "gtk_gl_area_attach_buffers") core.PuregoSafeRegister(&xGLAreaGetAllowedApis, libs, "gtk_gl_area_get_allowed_apis") core.PuregoSafeRegister(&xGLAreaGetApi, libs, "gtk_gl_area_get_api") core.PuregoSafeRegister(&xGLAreaGetAutoRender, libs, "gtk_gl_area_get_auto_render") core.PuregoSafeRegister(&xGLAreaGetContext, libs, "gtk_gl_area_get_context") core.PuregoSafeRegister(&xGLAreaGetError, libs, "gtk_gl_area_get_error") core.PuregoSafeRegister(&xGLAreaGetHasDepthBuffer, libs, "gtk_gl_area_get_has_depth_buffer") core.PuregoSafeRegister(&xGLAreaGetHasStencilBuffer, libs, "gtk_gl_area_get_has_stencil_buffer") core.PuregoSafeRegister(&xGLAreaGetRequiredVersion, libs, "gtk_gl_area_get_required_version") core.PuregoSafeRegister(&xGLAreaGetUseEs, libs, "gtk_gl_area_get_use_es") core.PuregoSafeRegister(&xGLAreaMakeCurrent, libs, "gtk_gl_area_make_current") core.PuregoSafeRegister(&xGLAreaQueueRender, libs, "gtk_gl_area_queue_render") core.PuregoSafeRegister(&xGLAreaSetAllowedApis, libs, "gtk_gl_area_set_allowed_apis") core.PuregoSafeRegister(&xGLAreaSetAutoRender, libs, "gtk_gl_area_set_auto_render") core.PuregoSafeRegister(&xGLAreaSetError, libs, "gtk_gl_area_set_error") core.PuregoSafeRegister(&xGLAreaSetHasDepthBuffer, libs, "gtk_gl_area_set_has_depth_buffer") core.PuregoSafeRegister(&xGLAreaSetHasStencilBuffer, libs, "gtk_gl_area_set_has_stencil_buffer") core.PuregoSafeRegister(&xGLAreaSetRequiredVersion, libs, "gtk_gl_area_set_required_version") core.PuregoSafeRegister(&xGLAreaSetUseEs, libs, "gtk_gl_area_set_use_es") }