define-g-object-class: do not specify :initarg for slots that can not be written to
authorDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Sun, 13 Sep 2009 00:30:48 +0000 (04:30 +0400)
committerDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Sun, 13 Sep 2009 00:30:48 +0000 (04:30 +0400)
glib/gobject.generating.lisp

index e7b57e6..6cd58e6 100644 (file)
      :allocation ,(if (gobject-property-p property) :gobject-property :gobject-fn)
      :g-property-type ,(if (gobject-property-p property) (gobject-property-type property) (cffi-property-type property))
      :accessor ,(intern (format nil "~A-~A" (symbol-name class-name) (property-name property)) (symbol-package class-name))
-     :initarg ,(intern (string-upcase (property-name property)) (find-package :keyword))
+     ,@(when (if (gobject-property-p property)
+                 t
+                 (not (null (cffi-property-writer property))))
+             `(:initarg
+               ,(intern (string-upcase (property-name property)) (find-package :keyword))))
      ,@(if (gobject-property-p property)
            `(:g-property-name ,(gobject-property-gname property))
            `(:g-getter ,(cffi-property-reader property)
-                                :g-setter ,(cffi-property-writer property)))))
+                       :g-setter ,(cffi-property-writer property)))))
 
 (defmacro define-g-object-class (g-type-name name
                                  (&key (superclass 'g-object)