v0.2.1 c0399be

gtkcelleditable.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/gobject"
13	"github.com/bnema/puregotk/v4/gobject/types"
14)
15
16type CellEditableIface struct {
17	_ structs.HostLayout
18
19	GIface uintptr
20
21	xEditingDone uintptr
22
23	xRemoveWidget uintptr
24
25	xStartEditing uintptr
26}
27
28func (x *CellEditableIface) GoPointer() uintptr {
29	return uintptr(unsafe.Pointer(x))
30}
31
32// OverrideEditingDone sets the "editing_done" callback function.
33// Signal is a sign for the cell renderer to update its
34//
35//	value from the cell_editable.
36func (x *CellEditableIface) OverrideEditingDone(cb func(CellEditable)) {
37	if cb == nil {
38		x.xEditingDone = 0
39	} else {
40		x.xEditingDone = purego.NewCallback(func(CellEditableVarp uintptr) {
41			cb(&CellEditableBase{Ptr: CellEditableVarp})
42		})
43	}
44}
45
46// GetEditingDone gets the "editing_done" callback function.
47// Signal is a sign for the cell renderer to update its
48//
49//	value from the cell_editable.
50func (x *CellEditableIface) GetEditingDone() func(CellEditable) {
51	if x.xEditingDone == 0 {
52		return nil
53	}
54	var rawCallback func(CellEditableVarp uintptr)
55	purego.RegisterFunc(&rawCallback, x.xEditingDone)
56	return func(CellEditableVar CellEditable) {
57		rawCallback(CellEditableVar.GoPointer())
58	}
59}
60
61// OverrideRemoveWidget sets the "remove_widget" callback function.
62// Signal is meant to indicate that the cell is
63//
64//	finished editing, and the widget may now be destroyed.
65func (x *CellEditableIface) OverrideRemoveWidget(cb func(CellEditable)) {
66	if cb == nil {
67		x.xRemoveWidget = 0
68	} else {
69		x.xRemoveWidget = purego.NewCallback(func(CellEditableVarp uintptr) {
70			cb(&CellEditableBase{Ptr: CellEditableVarp})
71		})
72	}
73}
74
75// GetRemoveWidget gets the "remove_widget" callback function.
76// Signal is meant to indicate that the cell is
77//
78//	finished editing, and the widget may now be destroyed.
79func (x *CellEditableIface) GetRemoveWidget() func(CellEditable) {
80	if x.xRemoveWidget == 0 {
81		return nil
82	}
83	var rawCallback func(CellEditableVarp uintptr)
84	purego.RegisterFunc(&rawCallback, x.xRemoveWidget)
85	return func(CellEditableVar CellEditable) {
86		rawCallback(CellEditableVar.GoPointer())
87	}
88}
89
90// OverrideStartEditing sets the "start_editing" callback function.
91// Begins editing on a cell_editable.
92func (x *CellEditableIface) OverrideStartEditing(cb func(CellEditable, *gdk.Event)) {
93	if cb == nil {
94		x.xStartEditing = 0
95	} else {
96		x.xStartEditing = purego.NewCallback(func(CellEditableVarp uintptr, EventVarp uintptr) {
97			cb(&CellEditableBase{Ptr: CellEditableVarp}, gdk.EventNewFromInternalPtr(EventVarp))
98		})
99	}
100}
101
102// GetStartEditing gets the "start_editing" callback function.
103// Begins editing on a cell_editable.
104func (x *CellEditableIface) GetStartEditing() func(CellEditable, *gdk.Event) {
105	if x.xStartEditing == 0 {
106		return nil
107	}
108	var rawCallback func(CellEditableVarp uintptr, EventVarp uintptr)
109	purego.RegisterFunc(&rawCallback, x.xStartEditing)
110	return func(CellEditableVar CellEditable, EventVar *gdk.Event) {
111		rawCallback(CellEditableVar.GoPointer(), EventVar.GoPointer())
112	}
113}
114
115// Interface for widgets that can be used for editing cells
116//
117// The `GtkCellEditable` interface must be implemented for widgets to be usable
118// to edit the contents of a `GtkTreeView` cell. It provides a way to specify how
119// temporary widgets should be configured for editing, get the new value, etc.
120type CellEditable interface {
121	GoPointer() uintptr
122	SetGoPointer(uintptr)
123	EditingDone()
124	RemoveWidget()
125	StartEditing(EventVar *gdk.Event)
126}
127
128var xCellEditableGLibType func() types.GType
129
130func CellEditableGLibType() types.GType {
131	return xCellEditableGLibType()
132}
133
134type CellEditableBase struct {
135	Ptr uintptr
136}
137
138func (x *CellEditableBase) GoPointer() uintptr {
139	if x == nil {
140		return 0
141	}
142	return x.Ptr
143}
144
145func (x *CellEditableBase) SetGoPointer(ptr uintptr) {
146	x.Ptr = ptr
147}
148
149// Emits the `GtkCellEditable::editing-done` signal.
150func (x *CellEditableBase) EditingDone() {
151
152	XGtkCellEditableEditingDone(x.GoPointer())
153
154}
155
156// Emits the `GtkCellEditable::remove-widget` signal.
157func (x *CellEditableBase) RemoveWidget() {
158
159	XGtkCellEditableRemoveWidget(x.GoPointer())
160
161}
162
163// Begins editing on a @cell_editable.
164//
165// The `GtkCellRenderer` for the cell creates and returns a `GtkCellEditable` from
166// gtk_cell_renderer_start_editing(), configured for the `GtkCellRenderer` type.
167//
168// gtk_cell_editable_start_editing() can then set up @cell_editable suitably for
169// editing a cell, e.g. making the Esc key emit `GtkCellEditable::editing-done`.
170//
171// Note that the @cell_editable is created on-demand for the current edit; its
172// lifetime is temporary and does not persist across other edits and/or cells.
173func (x *CellEditableBase) StartEditing(EventVar *gdk.Event) {
174
175	XGtkCellEditableStartEditing(x.GoPointer(), EventVar.GoPointer())
176
177}
178
179// SetPropertyEditingCanceled sets the "editing-canceled" property.
180// Indicates whether editing on the cell has been canceled.
181func (x *CellEditableBase) SetPropertyEditingCanceled(value bool) {
182	obj := gobject.Object{}
183	obj.Ptr = x.GoPointer()
184	var v gobject.Value
185	v.Init(gobject.TypeBooleanVal)
186	v.SetBoolean(value)
187	obj.SetProperty("editing-canceled", &v)
188}
189
190// GetPropertyEditingCanceled gets the "editing-canceled" property.
191// Indicates whether editing on the cell has been canceled.
192func (x *CellEditableBase) GetPropertyEditingCanceled() bool {
193	obj := gobject.Object{}
194	obj.Ptr = x.GoPointer()
195	var v gobject.Value
196	obj.GetProperty("editing-canceled", &v)
197	return v.GetBoolean()
198}
199
200var XGtkCellEditableEditingDone func(uintptr)
201var XGtkCellEditableRemoveWidget func(uintptr)
202var XGtkCellEditableStartEditing func(uintptr, uintptr)
203
204func init() {
205	core.SetPackageName("GTK", "gtk4")
206	core.SetSharedLibraries("GTK", []string{"libgtk-4.so.1"})
207	var libs []uintptr
208	for _, libPath := range core.GetPaths("GTK") {
209		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
210		if err != nil {
211			panic(err)
212		}
213		libs = append(libs, lib)
214	}
215
216	core.PuregoSafeRegister(&xCellEditableGLibType, libs, "gtk_cell_editable_get_type")
217
218	core.PuregoSafeRegister(&XGtkCellEditableEditingDone, libs, "gtk_cell_editable_editing_done")
219	core.PuregoSafeRegister(&XGtkCellEditableRemoveWidget, libs, "gtk_cell_editable_remove_widget")
220	core.PuregoSafeRegister(&XGtkCellEditableStartEditing, libs, "gtk_cell_editable_start_editing")
221
222}

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