X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/3c44ba6c1d82d2c6495a5929253f5b0391cbae70..62f128081bd450f55d7e4ffd6602fb518f8ea304:/glib/gparam.lisp diff --git a/glib/gparam.lisp b/glib/gparam.lisp index 88c74d3..5b2f4fa 100644 --- a/glib/gparam.lisp +++ b/glib/gparam.lisp @@ -15,12 +15,14 @@ ;; 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.14 2005-01-12 13:31:57 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)) @@ -66,10 +68,14 @@ 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