// 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 IMContextSimpleClass struct { _ structs.HostLayout ParentClass IMContextClass } func (x *IMContextSimpleClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } type IMContextSimplePrivate struct { _ structs.HostLayout } func (x *IMContextSimplePrivate) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } const ( // Evaluates to the maximum length of a compose sequence. // // This macro is longer used by GTK. MAX_COMPOSE_LEN int = 7 ) // Supports compose sequences, dead keys and numeric Unicode input. // // ## Compose sequences // // `GtkIMContextSimple` reads compose sequences from the first of the // following files that is found: ~/.config/gtk-4.0/Compose, ~/.XCompose, // /usr/share/X11/locale/$locale/Compose (for locales that have a nontrivial // Compose file). A subset of the file syntax described in the Compose(5) // manual page is supported. Additionally, `include "%L"` loads GTK’s built-in // table of compose sequences rather than the locale-specific one from X11. // // If none of these files is found, `GtkIMContextSimple` uses a built-in table // of compose sequences that is derived from the X11 Compose files. // // Note that compose sequences typically start with the Compose_key, which is // often not available as a dedicated key on keyboards. Keyboard layouts may // map this keysym to other keys, such as the right Control key. // // ## Unicode characters // // `GtkIMContextSimple` also supports numeric entry of Unicode characters // by typing <kbd>Ctrl</kbd>-<kbd>Shift</kbd>-<kbd>u</kbd>, followed by a // hexadecimal Unicode codepoint. // // For example, // // Ctrl-Shift-u 1 2 3 Enter // // yields U+0123 LATIN SMALL LETTER G WITH CEDILLA, i.e. ģ. // // ## Dead keys // // `GtkIMContextSimple` supports dead keys. For example, typing // // dead_acute a // // yields U+00E! LATIN SMALL LETTER_A WITH ACUTE, i.e. á. Note that this // depends on the keyboard layout including dead keys. type IMContextSimple struct { IMContext } var xIMContextSimpleGLibType func() types.GType func IMContextSimpleGLibType() types.GType { return xIMContextSimpleGLibType() } func IMContextSimpleNewFromInternalPtr(ptr uintptr) *IMContextSimple { cls := &IMContextSimple{} cls.Ptr = ptr return cls } var xNewIMContextSimple func() uintptr // Creates a new `GtkIMContextSimple`. func NewIMContextSimple() *IMContextSimple { var cls *IMContextSimple cret := xNewIMContextSimple() if cret == 0 { return nil } cls = &IMContextSimple{} cls.Ptr = cret return cls } var xIMContextSimpleAddComposeFile func(uintptr, string) // Adds an additional table from the X11 compose file. func (x *IMContextSimple) AddComposeFile(ComposeFileVar string) { xIMContextSimpleAddComposeFile(x.GoPointer(), ComposeFileVar) } var xIMContextSimpleAddTable func(uintptr, []uint16, int, int) // Adds an additional table to search to the input context. // Each row of the table consists of @max_seq_len key symbols // followed by two #guint16 interpreted as the high and low // words of a #gunicode value. Tables are searched starting // from the last added. // // The table must be sorted in dictionary order on the // numeric value of the key symbol fields. (Values beyond // the length of the sequence should be zero.) func (x *IMContextSimple) AddTable(DataVar []uint16, MaxSeqLenVar int, NSeqsVar int) { xIMContextSimpleAddTable(x.GoPointer(), DataVar, MaxSeqLenVar, NSeqsVar) } func (c *IMContextSimple) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *IMContextSimple) 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(&xIMContextSimpleGLibType, libs, "gtk_im_context_simple_get_type") core.PuregoSafeRegister(&xNewIMContextSimple, libs, "gtk_im_context_simple_new") core.PuregoSafeRegister(&xIMContextSimpleAddComposeFile, libs, "gtk_im_context_simple_add_compose_file") core.PuregoSafeRegister(&xIMContextSimpleAddTable, libs, "gtk_im_context_simple_add_table") }