X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=glib%2Fgobject.meta.lisp;h=e4fc5e3d8b8e1ed8b2710460a77f314a18f9f41d;hb=2da8ec51c87e16120d62969eb2468563e8caecef;hp=c316dfbb733e8e3eb92a9f40da991fe436a968b6;hpb=84fb40788d8b8c0c0dc5ad66ee02da0519c4676f;p=cl-gtk2.git diff --git a/glib/gobject.meta.lisp b/glib/gobject.meta.lisp index c316dfb..e4fc5e3 100644 --- a/glib/gobject.meta.lisp +++ b/glib/gobject.meta.lisp @@ -9,7 +9,8 @@ :reader gobject-class-g-type-initializer) (interface-p :initform nil :initarg :g-interface-p - :reader gobject-class-interface-p))) + :reader gobject-class-interface-p)) + (:documentation "Metaclass for GObject-based classes.")) (defun initialize-gobject-class-g-type (class) (if (gobject-class-g-type-initializer class) @@ -21,12 +22,11 @@ (warn "Type initializer for class '~A' (GType '~A') is invalid: foreign symbol '~A'" (gobject-class-g-type-name class) (class-name class) (gobject-class-g-type-initializer class)) (progn - (when (= +g-type-invalid+ type) + (when (g-type= +g-type-invalid+ type) (warn "Declared GType name '~A' for class '~A' is invalid ('~A' returned 0)" (gobject-class-g-type-name class) (class-name class) (gobject-class-g-type-initializer class))) - (unless (string= (gobject-class-g-type-name class) - (g-type-name type)) + (unless (g-type= (gobject-class-g-type-name class) type) (warn "Declared GType name '~A' for class '~A' does not match actual GType name '~A'" (gobject-class-g-type-name class) (class-name class) @@ -37,7 +37,7 @@ (defmethod initialize-instance :after ((object gobject-class) &key &allow-other-keys) (register-object-type (gobject-class-g-type-name object) (class-name object)) - (at-init (initialize-gobject-class-g-type object))) + (at-init (object) (initialize-gobject-class-g-type object))) (defclass gobject-direct-slot-definition (standard-direct-slot-definition) ((g-property-type :initform nil @@ -206,24 +206,26 @@ (defmethod slot-boundp-using-class ((class gobject-class) object (slot gobject-property-effective-slot-definition)) (handler-case - (progn (g-object-property-type object (gobject-property-effective-slot-definition-g-property-name slot) :assert-readable t) t) + (progn (g-object-property-type (pointer object) (gobject-property-effective-slot-definition-g-property-name slot) :assert-readable t) t) (property-unreadable-error () nil))) (defmethod slot-value-using-class ((class gobject-class) object (slot gobject-property-effective-slot-definition)) - (g-object-call-get-property object + (g-object-call-get-property (pointer object) (gobject-property-effective-slot-definition-g-property-name slot) (gobject-effective-slot-definition-g-property-type slot))) (defmethod (setf slot-value-using-class) (new-value (class gobject-class) object (slot gobject-property-effective-slot-definition)) - (g-object-call-set-property object + (g-object-call-set-property (pointer object) (gobject-property-effective-slot-definition-g-property-name slot) new-value (gobject-effective-slot-definition-g-property-type slot))) +(defmethod slot-boundp-using-class ((class gobject-class) object (slot gobject-fn-effective-slot-definition)) + (not (null (gobject-fn-effective-slot-definition-g-getter-fn slot)))) + (defmethod slot-value-using-class ((class gobject-class) object (slot gobject-fn-effective-slot-definition)) (let ((fn (gobject-fn-effective-slot-definition-g-getter-fn slot))) - (when fn - (funcall fn object)))) + (funcall fn object))) (defmethod (setf slot-value-using-class) (new-value (class gobject-class) object (slot gobject-fn-effective-slot-definition)) (funcall (gobject-fn-effective-slot-definition-g-setter-fn slot) object new-value))