detached 0c73bf8

Gir: Quick hack to make gobject.Type an alias of types.GType

Co-authored-by: Peter Fern <github@0xc0dedbad.com>
commit
0c73bf8173c265cf7f051df077cfe4d9e6937631
author
Jeroen Wijenbergh · · 2025-04-07 12:16 UTC
committer
Jeroen Wijenbergh · · 2025-04-07 12:23 UTC
parent
c67787d
signature
unsigned
2 files · +8 -1
M internal/gir/pass/pass.go +1 -1
@@ -205,7 +205,7 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string
205205 for _, alias := range ns.Aliases {
206206 fn := alias.FilenameSafe()
207207 files = append(files, fn)
208- typeName := alias.Type.Template(ns.Name, p.Types, false)
208+ typeName := alias.Template(ns.Name, p.Types)
209209 if typeName == "" {
210210 typeName = "uintptr"
211211 }
@@ -205,7 +205,7 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string
205 for _, alias := range ns.Aliases {205 for _, alias := range ns.Aliases {
206 fn := alias.FilenameSafe()206 fn := alias.FilenameSafe()
207 files = append(files, fn)207 files = append(files, fn)
208- typeName := alias.Type.Template(ns.Name, p.Types, false)208+ typeName := alias.Template(ns.Name, p.Types)
209 if typeName == "" {209 if typeName == "" {
210 typeName = "uintptr"210 typeName = "uintptr"
211 }211 }
M internal/gir/types/types.go +7 -0
@@ -87,6 +87,13 @@ type Alias struct {
8787 Type Type `xml:"http://www.gtk.org/introspection/core/1.0 type"`
8888 }
8989
90+func (a *Alias) Template(ns string, kinds KindMap) string {
91+ if v, ok := convList[a.CType]; ok {
92+ return util.NormalizeNamespace(ns, v, true)
93+ }
94+ return a.Type.Template(ns, kinds, false)
95+}
96+
9097 type AnyType struct {
9198 // Possible variants.
9299 Type *Type `xml:"http://www.gtk.org/introspection/core/1.0 type"`
@@ -87,6 +87,13 @@ type Alias struct {
87 Type Type `xml:"http://www.gtk.org/introspection/core/1.0 type"`87 Type Type `xml:"http://www.gtk.org/introspection/core/1.0 type"`
88 }88 }
89 89
90+func (a *Alias) Template(ns string, kinds KindMap) string {
91+ if v, ok := convList[a.CType]; ok {
92+ return util.NormalizeNamespace(ns, v, true)
93+ }
94+ return a.Type.Template(ns, kinds, false)
95+}
96+
90 type AnyType struct {97 type AnyType struct {
91 // Possible variants.98 // Possible variants.
92 Type *Type `xml:"http://www.gtk.org/introspection/core/1.0 type"`99 Type *Type `xml:"http://www.gtk.org/introspection/core/1.0 type"`

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