+(defbinding (gvalue-p "g_type_check_value") () boolean
+ (location pointer))
+
+(defmacro with-gvalue ((gvalue &optional type (value nil value-p)) &body body)
+ `(with-memory (,gvalue +gvalue-size+)
+ ,(cond
+ ((and type value-p) `(gvalue-init ,gvalue ,type ,value))
+ (type `(gvalue-init ,gvalue ,type)))
+ ,@body
+ ,(unless value-p `(gvalue-take ,gvalue))))
+
+
+(deftype param-flag-type ()
+ '(flags
+ (:readable 1)
+ (:writable 2)
+ (:construct 4)
+ (:construct-only 8)
+ (:lax-validation 16)
+ (:private 32)))
+
+(eval-when (:compile-toplevel :load-toplevel :execute)
+ (defclass param-spec-class (ginstance-class)
+ ())
+
+ (defmethod shared-initialize ((class param-spec-class) names &rest initargs)
+ (declare (ignore names initargs))
+ (call-next-method)
+ (unless (slot-boundp class 'ref)
+ (setf (slot-value class 'ref) '%param-spec-ref))
+ (unless (slot-boundp class 'unref)
+ (setf (slot-value class 'unref) '%param-spec-unref)))
+
+ (defmethod validate-superclass ((class param-spec-class) (super standard-class))
+ t ;(subtypep (class-name super) 'param)
+))
+
+
+(defbinding %param-spec-ref () pointer
+ (location pointer))
+
+(defbinding %param-spec-unref () nil
+ (location pointer))
+
+
+;; TODO: rename to param-spec
+(defclass param (ginstance)
+ ((name
+ :allocation :alien
+ :reader param-name
+ :type string)
+ (flags
+ :allocation :alien
+ :reader param-flags
+ :type param-flag-type)
+ (value-type
+ :allocation :alien
+ :reader param-value-type
+ :type type-number)
+ (owner-type
+ :allocation :alien
+ :reader param-owner-type
+ :type type-number)
+ (nickname
+ :allocation :virtual
+ :getter "g_param_spec_get_nick"
+ :reader param-nickname
+ :type (copy-of string))
+ (documentation
+ :allocation :virtual
+ :getter "g_param_spec_get_blurb"
+ :reader param-documentation
+ :type (copy-of string)))
+ (:metaclass param-spec-class)
+ (:gtype "GParam"))
+
+
+(defclass param-char (param)
+ ((minimum
+ :allocation :alien
+ :reader param-minimum
+ :type char)
+ (maximum
+ :allocation :alien
+ :reader param-maximum
+ :type char)
+ (default-value
+ :allocation :alien
+ :reader param-default-value
+ :type char))
+ (:metaclass param-spec-class)
+ (:gtype "GParamChar"))
+
+(defclass param-unsigned-char (param)
+ (
+; (minimum
+; :allocation :alien
+; :reader param-unsigned-char-minimum
+; :type unsigned-char)
+; (maximum
+; :allocation :alien
+; :reader param-unsigned-char-maximum
+; :type unsigned-char)
+; (default-value
+; :allocation :alien
+; :reader param-unsigned-char-default-value
+; :type unsigned-char)
+ )
+ (:metaclass param-spec-class)
+ (:gtype "GParamUChar"))
+
+(defclass param-boolean (param)
+ ((default-value
+ :allocation :alien
+ :reader param-default-value
+ :type boolean))
+ (:metaclass param-spec-class)
+ (:gtype "GParamBoolean"))
+
+(defclass param-int (param)
+ ((minimum
+ :allocation :alien
+ :reader param-minimum
+ :type int)
+ (maximum
+ :allocation :alien
+ :reader param-maximum
+ :type int)
+ (default-value
+ :allocation :alien
+ :reader param-default-value
+ :type int))
+ (:metaclass param-spec-class)
+ (:gtype "GParamInt"))
+
+(defclass param-unsigned-int (param)
+ ((minimum
+ :allocation :alien
+ :reader param-minimum
+ :type unsigned-int)
+ (maximum
+ :allocation :alien
+ :reader param-maximum
+ :type unsigned-int)
+ (default-value
+ :allocation :alien
+ :reader param-default-value
+ :type unsigned-int))
+ (:metaclass param-spec-class)
+ (:gtype "GParamUInt"))
+
+(defclass param-long (param)
+ ((minimum
+ :allocation :alien
+ :reader param-minimum
+ :type long)
+ (maximum
+ :allocation :alien
+ :reader param-maximum
+ :type long)
+ (default-value
+ :allocation :alien
+ :reader param-default-value
+ :type long))
+ (:metaclass param-spec-class)
+ (:gtype "GParam"))
+
+(defclass param-unsigned-long (param)
+ ((minimum
+ :allocation :alien
+ :reader param-minimum
+ :type unsigned-long)
+ (maximum
+ :allocation :alien
+ :reader param-maximum
+ :type unsigned-long)
+ (default-value
+ :allocation :alien
+ :reader param-default-value
+ :type unsigned-long))
+ (:metaclass param-spec-class)
+ (:gtype "GParamULong"))
+
+(defclass param-unichar (param)
+ ()
+ (:metaclass param-spec-class)
+ (:gtype "GParamUnichar"))
+
+(defclass param-enum (param)
+ ((class
+ :allocation :alien
+ :reader param-enum-class
+ :type pointer)
+ (default-value
+ :allocation :alien
+ :reader param-default-value
+ :type long))
+ (:metaclass param-spec-class)
+ (:gtype "GParamEnum"))
+
+(defclass param-flags (param)
+ ((class
+ :allocation :alien
+ :reader param-flags-class
+ :type pointer)
+ (default-value
+ :allocation :alien
+ :reader param-default-value
+ :type long))
+ (:metaclass param-spec-class)
+ (:gtype "GParamFlags"))
+
+(defclass param-single-float (param)
+ ((minimum
+ :allocation :alien
+ :reader param-minimum
+ :type single-float)
+ (maximum
+ :allocation :alien
+ :reader param-maximum
+ :type single-float)
+ (default-value
+ :allocation :alien
+ :reader param-default-value
+ :type single-float)
+ (epsilon
+ :allocation :alien
+ :reader param-float-epsilon
+ :type single-float))
+ (:metaclass param-spec-class)
+ (:gtype "GParamFloat"))
+
+(defclass param-double-float (param)
+ ((minimum
+ :allocation :alien
+ :reader param-minimum
+ :type double-float)
+ (maximum
+ :allocation :alien
+ :reader param-maximum
+ :type double-float)
+ (default-value
+ :allocation :alien
+ :reader param-default-value
+ :type double-float)
+ (epsilon
+ :allocation :alien
+ :reader param-float-epsilon
+ :type double-float))
+ (:metaclass param-spec-class)
+ (:gtype "GParamDouble"))
+
+(defclass param-string (param)
+ ((default-value
+ :allocation :alien
+ :reader param-default-value
+ :type string))
+ (:metaclass param-spec-class)
+ (:gtype "GParamString"))
+
+(defclass param-param (param)
+ ()
+ (:metaclass param-spec-class)
+ (:gtype "GParamParam"))
+
+(defclass param-boxed (param)
+ ()
+ (:metaclass param-spec-class)
+ (:gtype "GParamBoxed"))
+
+(defclass param-pointer (param)
+ ()
+ (:metaclass param-spec-class)
+ (:gtype "GParamPointer"))
+
+(defclass param-value-array (param)
+ ((element-spec
+ :allocation :alien
+ :reader param-value-array-element-spec
+ :type param)
+ (length
+ :allocation :alien
+ :reader param-value-array-length
+ :type unsigned-int))
+ (:metaclass param-spec-class)
+ (:gtype "GParamValueArray"))
+
+(defclass param-object (param)
+ ()
+ (:metaclass param-spec-class)
+ (:gtype "GParamObject"))
+
+(defclass param-overrride (param)
+ ()
+ (:metaclass param-spec-class)
+ (:gtype "GParamOverride"))