;; License along with this library; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-;; $Id: gparam.lisp,v 1.12 2004-12-16 23:21:18 espen Exp $
+;; $Id: gparam.lisp,v 1.15 2005-02-03 23:09:04 espen Exp $
(in-package "GLIB")
(deftype gvalue () 'pointer)
+(register-type 'gvalue "GValue")
+
(eval-when (:compile-toplevel :load-toplevel :execute)
(defbinding (size-of-gvalue "size_of_gvalue") () unsigned-int))
(deallocate-memory gvalue)))
(defun gvalue-type (gvalue)
- (type-from-number (system:sap-ref-32 gvalue 0)))
+ (type-from-number (sap-ref-32 gvalue 0)))
(defun gvalue-get (gvalue)
(funcall (reader-function (gvalue-type gvalue))
value gvalue +gvalue-value-offset+)
value)
-(defmacro with-gvalue ((gvalue type &optional (value nil value-p)) &body body)
- `(let ((,gvalue ,(if value-p
- `(gvalue-new ,type ,value)
- `(gvalue-new))))
+(defbinding (gvalue-p "g_type_check_value") () boolean
+ (location pointer))
+
+(defmacro with-gvalue ((gvalue &optional type (value nil value-p)) &body body)
+ `(let ((,gvalue ,(cond
+ ((and type value-p) `(gvalue-new ,type ,value))
+ (type `(gvalue-new ,type))
+ (`(gvalue-new)))))
(unwind-protect
(progn
,@body
(defclass param-spec-class (ginstance-class)
())
- (defmethod validate-superclass
- ((class param-spec-class) (super pcl::standard-class))
+ (defmethod validate-superclass ((class param-spec-class) (super standard-class))
t ;(subtypep (class-name super) 'param)
))