detached 6bd409b

Gen: Add a type declaration for GType

See #6
commit
6bd409b7eaf670dbcd06db30c480e531532b7f65
author
Jeroen Wijenbergh · · 2024-12-10 14:37 UTC
committer
Jeroen Wijenbergh · · 2025-04-07 12:23 UTC
parent
51f7e66
signature
unsigned
3 files · +12 -0
M gen.go +8 -0
@@ -44,6 +44,14 @@ func main() {
4444 if err == nil {
4545 os.WriteFile("v4/gobject/more.go", data, 0o644)
4646 }
47+ data, err = os.ReadFile("templates/gtype")
48+ if err == nil {
49+ mkerr := os.MkdirAll("v4/gobject/types", 0o755)
50+ if mkerr != nil {
51+ panic(mkerr)
52+ }
53+ os.WriteFile("v4/gobject/types/types.go", data, 0o644)
54+ }
4755 data, err = os.ReadFile("templates/glib")
4856 if err == nil {
4957 os.WriteFile("v4/glib/more.go", data, 0o644)
@@ -44,6 +44,14 @@ func main() {
44 if err == nil {44 if err == nil {
45 os.WriteFile("v4/gobject/more.go", data, 0o644)45 os.WriteFile("v4/gobject/more.go", data, 0o644)
46 }46 }
47+ data, err = os.ReadFile("templates/gtype")
48+ if err == nil {
49+ mkerr := os.MkdirAll("v4/gobject/types", 0o755)
50+ if mkerr != nil {
51+ panic(mkerr)
52+ }
53+ os.WriteFile("v4/gobject/types/types.go", data, 0o644)
54+ }
47 data, err = os.ReadFile("templates/glib")55 data, err = os.ReadFile("templates/glib")
48 if err == nil {56 if err == nil {
49 os.WriteFile("v4/glib/more.go", data, 0o644)57 os.WriteFile("v4/glib/more.go", data, 0o644)
M internal/gir/types/types.go +1 -0
@@ -41,6 +41,7 @@ var convList = map[string]string{
4141 "guintptr": "uintptr",
4242 "utf8": "string",
4343 "filename": "string",
44+ "GType": "types.GType",
4445
4546 // these are probably not correct but needed to compile
4647 "long double": "float64",
@@ -41,6 +41,7 @@ var convList = map[string]string{
41 "guintptr": "uintptr",41 "guintptr": "uintptr",
42 "utf8": "string",42 "utf8": "string",
43 "filename": "string",43 "filename": "string",
44+ "GType": "types.GType",
44 45
45 // these are probably not correct but needed to compile46 // these are probably not correct but needed to compile
46 "long double": "float64",47 "long double": "float64",
A templates/gtype +3 -0
@@ -0,0 +1,3 @@
1+package types
2+
3+type GType uintptr
@@ -0,0 +1,3 @@
1+package types
2+
3+type GType uintptr

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