This library converts the elements from GObject Introspection into Lisp-style definitions, based on [[https://github.com/andy128k/cl-gobject-introspection][cl-gobject-introspection]].
Usage It's very easy to create a binding to a new GObject-based library via ~cl-gobject-introspection-wrapper~:
(cl:defpackage gtk (:use))
(gir-wrapper:define-gir-namespace "Gtk")
Note that all the definition symbols are exported automatically.
If there exist some definitions whose name is not converted correctly or cause symbol conflicts according to [[Conversion Rules][Conversion Rules]], you can set up the special variable ~gir-wrapper:quoted-name-alist~ to specify the corresponding symbol for a definition. This could also exclude some definitions by specifying the symbols to ~cl:nil~ so that you can define them by hand later:
(cltl2:compiler-let (gir-wrapper:quoted-name-alist '((("TextBuffer" . "get_insert") . text-buffer-get-insert) ; Specify a symbol for class method ("CSET_a_2_z" . +cset-a-z-lower-case+) ; Specify a symbol for function, constant, enumeration, class, interface, struct, or function argument. (("Widget" . "is_sensitive") . cl:nil) ; Exclude a class method. ("String" . cl:nil))) ; Exclude a function, constant, enumeration, class, struct, or interface. (gir-wrapper:define-gir-namespace "Gtk" "4.0"))
For portability consideration, we set the variable before ~gir-wrapper:define-gir-namespace~, then reset it after that, to avoid using the ~compiler-let~ in CLTL2:
(cl:eval-when (:execute :compile-toplevel :load-toplevel) (cl:setf gir-wrapper:quoted-name-alist '((("TextBuffer" . "get_insert") . text-buffer-get-insert) ("CSET_a_2_z" . +cset-a-z-lower-case+) (("Widget" . "is_sensitive") . cl:nil) ("Widget"))))
(gir-wrapper:define-gir-namespace "Gtk" "4.0")
(cl:eval-when (:execute :compile-toplevel :load-toplevel) (cl:setf gir-wrapper:quoted-name-alist '()))