Skip to content

Latest commit

 

History

History
35 lines (18 loc) · 1.33 KB

hacking.md

File metadata and controls

35 lines (18 loc) · 1.33 KB

Hacking

Dependency

Ensure you have the required dependency:

  • GIRepository 2.0, which is part of GLib since version 2.80

You can install it from a package manager (e.g., apt-get install libgirepository-2.0-0) or build it from source.

Update typelibs

Update gir_version in lib/girepository-1.0/ci.sh.

Architecture

main.zig handles command line options and does some simple dispatch. girepository-2.0.zig is generated from GIRepository-3.0.typelib using the generator and core_min.zig is a minimum file to support it. The logic of generating is in gi-ext.zig, which abuses zig's formatting.

You are suggested to read in the following order:

  • EnumInfoExt, FlagsInfoExt, InterfaceInfoExt, ObjectInfoExt, StructInfoExt and UnionInfoExt. Simply emit their fields and methods.

  • ValueInfoExt then ConstantInfoExt. Almost independent.

  • TypeInfoExt.

  • ArgInfoExt and FieldInfoExt.

  • FunctionInfoExt and its helper CallableInfoExt. This is relatively complex.

  • CallbackInfoExt, PropertyInfoExt, RegisteredTypeInfoExt, SignalInfoExt and VFuncInfoExt. Simple but may be confusing if you are not familiar with other Exts.

TODOs

  • Ability to export C bindings and GIR files (unlikely to happen in near future, contributions welcomed)