Fixed print-object for property-definition; add class-property-info function
authorDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Sun, 12 Jul 2009 13:07:16 +0000 (17:07 +0400)
committerDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Sun, 12 Jul 2009 13:07:16 +0000 (17:07 +0400)
glib/gobject.type-info.object.lisp

index 1637b01..0a3cfbc 100644 (file)
@@ -27,7 +27,7 @@ See accessor functions:
       (call-next-method)
       (print-unreadable-object (instance stream)
         (format stream
-                "PROPERTY ~A ~A.~A (flags:~@[ readable~]~@[ writable~]~@[ constructor~]~@[ constructor-only~])"
+                "PROPERTY ~A ~A.~A (flags:~@[~* readable~]~@[~* writable~]~@[~* constructor~]~@[~* constructor-only~])"
                 (g-class-property-definition-type instance)
                 (g-class-property-definition-owner-type instance)
                 (g-class-property-definition-name instance)
@@ -92,6 +92,11 @@ See accessor functions:
            for param = (mem-aref params :pointer i)
            collect (parse-g-param-spec param))))))
 
+(defun class-property-info (g-type property-name)
+  (with-unwind (g-class (g-type-class-ref g-type) g-type-class-unref)
+    (let* ((param-spec (g-object-class-find-property g-class property-name)))
+      (when param-spec (parse-g-param-spec param-spec)))))
+
 (defun interface-properties (g-type)
   "@return{list of properties of GObject interface @code{g-type}. Each property is described by an object of type @class{g-class-property-definition}.}
 @arg[g-type]{an integer or a string specifying the GType}"