+ ;; We need to search for the for the most specific known type
+ ;; because internal types, unknown to Lisp, may be passed in GValues
+ (labels ((find-most-specific-known-type (type)
+ (or
+ (type-from-number type)
+ (let ((parent (type-parent type)))
+ (unless (zerop parent)
+ (find-most-specific-known-type parent))))))
+ (let ((type-number (ref-type-number gvalue)))
+ (unless (zerop type-number)
+ (or
+ (find-most-specific-known-type type-number)
+ ;; This will signal an error if the type hierarchy is unknown
+ (type-from-number type-number t))))))
+
+(defun gvalue-get (gvalue)