// 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/gobject/types" ) type IMMulticontextClass struct { _ structs.HostLayout ParentClass IMContextClass xGtkReserved1 uintptr xGtkReserved2 uintptr xGtkReserved3 uintptr xGtkReserved4 uintptr } func (x *IMMulticontextClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // OverrideGtkReserved1 sets the "_gtk_reserved1" callback function. func (x *IMMulticontextClass) OverrideGtkReserved1(cb func()) { if cb == nil { x.xGtkReserved1 = 0 } else { x.xGtkReserved1 = purego.NewCallback(func() { cb() }) } } // GetGtkReserved1 gets the "_gtk_reserved1" callback function. func (x *IMMulticontextClass) GetGtkReserved1() func() { if x.xGtkReserved1 == 0 { return nil } var rawCallback func() purego.RegisterFunc(&rawCallback, x.xGtkReserved1) return func() { rawCallback() } } // OverrideGtkReserved2 sets the "_gtk_reserved2" callback function. func (x *IMMulticontextClass) OverrideGtkReserved2(cb func()) { if cb == nil { x.xGtkReserved2 = 0 } else { x.xGtkReserved2 = purego.NewCallback(func() { cb() }) } } // GetGtkReserved2 gets the "_gtk_reserved2" callback function. func (x *IMMulticontextClass) GetGtkReserved2() func() { if x.xGtkReserved2 == 0 { return nil } var rawCallback func() purego.RegisterFunc(&rawCallback, x.xGtkReserved2) return func() { rawCallback() } } // OverrideGtkReserved3 sets the "_gtk_reserved3" callback function. func (x *IMMulticontextClass) OverrideGtkReserved3(cb func()) { if cb == nil { x.xGtkReserved3 = 0 } else { x.xGtkReserved3 = purego.NewCallback(func() { cb() }) } } // GetGtkReserved3 gets the "_gtk_reserved3" callback function. func (x *IMMulticontextClass) GetGtkReserved3() func() { if x.xGtkReserved3 == 0 { return nil } var rawCallback func() purego.RegisterFunc(&rawCallback, x.xGtkReserved3) return func() { rawCallback() } } // OverrideGtkReserved4 sets the "_gtk_reserved4" callback function. func (x *IMMulticontextClass) OverrideGtkReserved4(cb func()) { if cb == nil { x.xGtkReserved4 = 0 } else { x.xGtkReserved4 = purego.NewCallback(func() { cb() }) } } // GetGtkReserved4 gets the "_gtk_reserved4" callback function. func (x *IMMulticontextClass) GetGtkReserved4() func() { if x.xGtkReserved4 == 0 { return nil } var rawCallback func() purego.RegisterFunc(&rawCallback, x.xGtkReserved4) return func() { rawCallback() } } type IMMulticontextPrivate struct { _ structs.HostLayout } func (x *IMMulticontextPrivate) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // Supports switching between multiple input methods. // // Text widgets such as `GtkText` or `GtkTextView` use a `GtkIMMultiContext` // to implement their `im-module` property for switching between different // input methods. type IMMulticontext struct { IMContext } var xIMMulticontextGLibType func() types.GType func IMMulticontextGLibType() types.GType { return xIMMulticontextGLibType() } func IMMulticontextNewFromInternalPtr(ptr uintptr) *IMMulticontext { cls := &IMMulticontext{} cls.Ptr = ptr return cls } var xNewIMMulticontext func() uintptr // Creates a new `GtkIMMulticontext`. func NewIMMulticontext() *IMMulticontext { var cls *IMMulticontext cret := xNewIMMulticontext() if cret == 0 { return nil } cls = &IMMulticontext{} cls.Ptr = cret return cls } var xIMMulticontextGetContextId func(uintptr) string // Gets the id of the currently active delegate of the @context. func (x *IMMulticontext) GetContextId() string { cret := xIMMulticontextGetContextId(x.GoPointer()) return cret } var xIMMulticontextSetContextId func(uintptr, uintptr) // Sets the context id for @context. // // This causes the currently active delegate of @context to be // replaced by the delegate corresponding to the new context id. // // Setting this to a non-%NULL value overrides the system-wide // IM module setting. See the [property@Gtk.Settings:gtk-im-module] // property. func (x *IMMulticontext) SetContextId(ContextIdVar *string) { ContextIdVarPtr := core.GStrdupNullable(ContextIdVar) defer core.GFreeNullable(ContextIdVarPtr) xIMMulticontextSetContextId(x.GoPointer(), ContextIdVarPtr) } func (c *IMMulticontext) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *IMMulticontext) SetGoPointer(ptr uintptr) { c.Ptr = ptr } 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(&xIMMulticontextGLibType, libs, "gtk_im_multicontext_get_type") core.PuregoSafeRegister(&xNewIMMulticontext, libs, "gtk_im_multicontext_new") core.PuregoSafeRegister(&xIMMulticontextGetContextId, libs, "gtk_im_multicontext_get_context_id") core.PuregoSafeRegister(&xIMMulticontextSetContextId, libs, "gtk_im_multicontext_set_context_id") }