-(defbinding %container-child-get-property () nil
- (container container)
- (child widget)
- (property-name string)
- (value gvalue))
-
-(defbinding %container-child-set-property () nil
- (container container)
- (child widget)
- (property-name string)
- (value gvalue))
-
-(defmethod compute-virtual-slot-accessors
- ((class child-class) (slotd effective-child-slot-definition) direct-slotds)
- (with-slots (type) slotd
- (let ((pname (slot-definition-pname (first direct-slotds)))
- (type-number (find-type-number type)))
- (list
- #'(lambda (object)
- (with-slots (parent child) object
- (with-gc-disabled
- (let ((gvalue (gvalue-new type-number)))
- (%container-child-get-property parent child pname gvalue)
- (unwind-protect
- (funcall
- (intern-reader-function type)
- gvalue +gvalue-value-offset+)
- (gvalue-free gvalue t))))))
- #'(lambda (value object)
- (with-slots (parent child) object
- (with-gc-disabled
- (let ((gvalue (gvalue-new type-number)))
- (funcall
- (intern-writer-function type)
- value gvalue +gvalue-value-offset+)
- (%container-child-set-property parent child pname gvalue)
- (funcall
- (intern-destroy-function type)
- gvalue +gvalue-value-offset+)
- (gvalue-free gvalue nil)
- value))))))))
+(defmethod compute-effective-slot-definition-initargs ((class child-class) direct-slotds)
+ (if (eq (most-specific-slot-value direct-slotds 'allocation) :property)
+ (nconc
+ (list :pname (most-specific-slot-value direct-slotds 'pname))
+ (call-next-method))
+ (call-next-method)))
+
+(progn
+ (declaim (optimize (ext:inhibit-warnings 3)))
+ (defun %container-child-get-property (parent child pname gvalue))
+ (defun %container-child-set-property (parent child pname gvalue)))
+
+
+(defmethod initialize-internal-slot-functions ((slotd effective-child-slot-definition))
+ (let* ((type (slot-definition-type slotd))
+ (pname (slot-definition-pname slotd))
+ (type-number (find-type-number type)))
+ (setf
+ (slot-value slotd 'getter)
+ #'(lambda (object)
+ (with-slots (parent child) object
+ (let ((gvalue (gvalue-new type-number)))
+ (%container-child-get-property parent child pname gvalue)
+ (unwind-protect
+ (funcall (reader-function type) gvalue +gvalue-value-offset+)
+ (gvalue-free gvalue t))))))
+
+ (setf
+ (slot-value slotd 'setter)
+ #'(lambda (value object)
+ (with-slots (parent child) object
+ (let ((gvalue (gvalue-new type-number)))
+ (funcall (writer-function type) value gvalue +gvalue-value-offset+)
+ (%container-child-set-property parent child pname gvalue)
+ (gvalue-free gvalue t)
+ value)))))
+
+ (call-next-method)))