MCPcopy Index your code
hub / github.com/diamondburned/gotk4

github.com/diamondburned/gotk4 @v0.3.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.3.1 ↗ · + Follow
9,966 symbols 30,364 edges 141 files 8,595 documented · 86% 1 cross-repo links updated 12mo agopkg/v0.3.1 · 2024-08-03★ 68370 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

gotk4 logo

gotk4

built with nix

A GTK4 bindings generator for Go.

Package documentation | Package examples | GIR documentation | Progress tracker

All generated packages are in pkg/. The generation code is in gir/girgen/.

Examples are put in another repository, diamondburned/gotk4-examples, along with instructions on getting started with using these packages. Refer to its README for more information.

As of the time this README was written, most of pkg/gtk/v4 and pkg/gtk/v3 are ready to be used for most purposes. However, memory leaks and sometimes crashes may occur in certain parts of the API, while other parts might be completely missing. In that case, an issue should be opened.

Contributing to gotk4

For contributing guidelines, see CONTRIBUTING.md.

Community

For questions and discussions, join the gotk4 Matrix room!

License

gotk4 contains 3 directories licensed differently:

Some small snippets of code were taken from tinyzimmer's go-glib, which implements type subclassing.

The logo is licensed under the Creative Commons CC0 1.0 Universal Public Domain Dedication from egonelbre/gophers. It was modified to have a GTK4 logo.

The Gopher itself is licensed under the Creative Commons Attribution 4.0 by Renee French.

The GTK logo is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported by Andreas Nilsson, taken from the GNOME Project.

Extension points exported contracts — how you extend this code

LineLogger (Interface)
LineLogger describes anything that can log itself. [12 implementers]
gir/girgen/logger/logger.go
DragSurfacer (Interface)
DragSurfacer describes DragSurface's interface methods. [3 implementers]
pkg/gdk/v4/gdk.go
Fonter (Interface)
Fonter describes Font's interface methods. [2 implementers]
pkg/pangocairo/pangocairo.go
Windower (Interface)
Windower describes Window's interface methods. [2 implementers]
pkg/atk/atk.go
Fonter (Interface)
Fonter describes types inherited from class Font. To get the original type, the caller must assert this to an interface [2 …
pkg/pango/pango.go
Rendererer (Interface)
Rendererer describes types inherited from class Renderer. To get the original type, the caller must assert this to an i [2 …
pkg/gsk/v4/gsk.go
X11GLContexter (Interface)
X11GLContexter describes types inherited from class X11GLContext. To get the original type, the caller must assert this [1 …
pkg/gdkx11/v4/gdkx11.go
Objector (Interface)
Objector is an interface that describes the Object type's methods. Only this package's Object types and types that embed [1 …
pkg/core/glib/glib.go

Core symbols most depended-on inside this repo

Pointer
called by 9859
pkg/gdk/v3/gdk.go
Native
called by 2062
pkg/cairo/matrix.go
StructNative
called by 1654
pkg/core/gextras/gextras.go
TypeFromInstance
called by 1448
pkg/core/glib/glib.go
String
called by 1265
pkg/gdk/v3/gdk.go
NewStructNative
called by 1160
pkg/core/gextras/gextras.go
Pointer
called by 1025
pkg/gdk/v4/gdk.go
TryRepanic
called by 983
pkg/core/closure/funcstack.go

Shape

Method 4,608
Function 4,236
Struct 775
TypeAlias 231
Interface 74
FuncType 32
Class 10

Languages

Go99%
C++1%
C1%

Modules by API surface

pkg/gdk/v3/gdk.go1,263 symbols
pkg/glib/v2/glib.go1,085 symbols
pkg/gtk/v3/gtk_export.go947 symbols
pkg/gdk/v4/gdk.go934 symbols
pkg/atk/atk.go910 symbols
pkg/pango/pango.go788 symbols
pkg/gtk/v4/gtk_export.go574 symbols
pkg/gsk/v4/gsk.go481 symbols
pkg/graphene/graphene.go443 symbols
pkg/gio/v2/gio_export.go271 symbols
pkg/core/glib/glib.go165 symbols
pkg/gdkpixbuf/v2/gdkpixbuf.go154 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add gotk4 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact