v0.2.1 c0399be

gtkatcontext.go RawHistoryFolder

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/glib"
13	"github.com/bnema/puregotk/v4/gobject"
14	"github.com/bnema/puregotk/v4/gobject/types"
15)
16
17type ATContextClass struct {
18	_ structs.HostLayout
19}
20
21func (x *ATContextClass) GoPointer() uintptr {
22	return uintptr(unsafe.Pointer(x))
23}
24
25// Communicates with platform-specific assistive technologies API.
26//
27// Each platform supported by GTK implements a `GtkATContext` subclass, and
28// is responsible for updating the accessible state in response to state
29// changes in `GtkAccessible`.
30type ATContext struct {
31	gobject.Object
32}
33
34var xATContextGLibType func() types.GType
35
36func ATContextGLibType() types.GType {
37	return xATContextGLibType()
38}
39
40func ATContextNewFromInternalPtr(ptr uintptr) *ATContext {
41	cls := &ATContext{}
42	cls.Ptr = ptr
43	return cls
44}
45
46var xATContextCreate func(AccessibleRole, uintptr, uintptr) uintptr
47
48// Creates a new `GtkATContext` instance for the given accessible role,
49// accessible instance, and display connection.
50//
51// The `GtkATContext` implementation being instantiated will depend on the
52// platform.
53func ATContextCreate(AccessibleRoleVar AccessibleRole, AccessibleVar Accessible, DisplayVar *gdk.Display) *ATContext {
54	var cls *ATContext
55
56	cret := xATContextCreate(AccessibleRoleVar, AccessibleVar.GoPointer(), DisplayVar.GoPointer())
57
58	if cret == 0 {
59		return nil
60	}
61	cls = &ATContext{}
62	cls.Ptr = cret
63	return cls
64}
65
66var xATContextGetAccessible func(uintptr) uintptr
67
68// Retrieves the `GtkAccessible` using this context.
69func (x *ATContext) GetAccessible() *AccessibleBase {
70	var cls *AccessibleBase
71
72	cret := xATContextGetAccessible(x.GoPointer())
73
74	if cret == 0 {
75		return nil
76	}
77	gobject.IncreaseRef(cret)
78	cls = &AccessibleBase{}
79	cls.Ptr = cret
80	return cls
81}
82
83var xATContextGetAccessibleRole func(uintptr) AccessibleRole
84
85// Retrieves the accessible role of this context.
86func (x *ATContext) GetAccessibleRole() AccessibleRole {
87
88	cret := xATContextGetAccessibleRole(x.GoPointer())
89	return cret
90}
91
92func (c *ATContext) GoPointer() uintptr {
93	if c == nil {
94		return 0
95	}
96	return c.Ptr
97}
98
99func (c *ATContext) SetGoPointer(ptr uintptr) {
100	c.Ptr = ptr
101}
102
103// Emitted when the attributes of the accessible for the
104// `GtkATContext` instance change.
105func (x *ATContext) ConnectStateChange(cb *func(ATContext)) uint {
106	cbPtr := uintptr(unsafe.Pointer(cb))
107	if cbRefPtr, ok := glib.GetCallback(cbPtr); ok {
108		handlerID := gobject.SignalConnect(x.GoPointer(), "state-change", cbRefPtr)
109		glib.SaveHandlerMapping(handlerID, cbPtr)
110		return handlerID
111	}
112
113	fcb := func(clsPtr uintptr) {
114		fa := ATContext{}
115		fa.Ptr = clsPtr
116		cbFn := *cb
117
118		cbFn(fa)
119
120	}
121	cbRefPtr := purego.NewCallback(fcb)
122	glib.SaveCallbackWithClosure(cbPtr, cbRefPtr, cb)
123	handlerID := gobject.SignalConnect(x.GoPointer(), "state-change", cbRefPtr)
124	glib.SaveHandlerMapping(handlerID, cbPtr)
125	return handlerID
126}
127
128func init() {
129	core.SetPackageName("GTK", "gtk4")
130	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
131	var libs []uintptr
132	for _, libPath := range core.GetPaths("GTK") {
133		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
134		if err != nil {
135			panic(err)
136		}
137		libs = append(libs, lib)
138	}
139
140	core.PuregoSafeRegister(&xATContextGLibType, libs, "gtk_at_context_get_type")
141
142	core.PuregoSafeRegister(&xATContextCreate, libs, "gtk_at_context_create")
143
144	core.PuregoSafeRegister(&xATContextGetAccessible, libs, "gtk_at_context_get_accessible")
145	core.PuregoSafeRegister(&xATContextGetAccessibleRole, libs, "gtk_at_context_get_accessible_role")
146
147}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close