From: Dmitry Kalyanov Date: Sun, 29 Aug 2010 14:01:45 +0000 (+0400) Subject: Add translate-to-foreign and free-translated-object methods to gobject:fixed-array... X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=1172a48a4c54cd56da352df8104d503c08973cce;p=cl-gtk2.git Add translate-to-foreign and free-translated-object methods to gobject:fixed-array foreign type --- diff --git a/gdk/gdk.objects.lisp b/gdk/gdk.objects.lisp index 79ebcb7..3c540be 100644 --- a/gdk/gdk.objects.lisp +++ b/gdk/gdk.objects.lisp @@ -693,6 +693,16 @@ do (setf (aref result i) (mem-aref ptr el-type i))) result))) +(defmethod translate-to-foreign (value (type fixed-array)) + (if (null value) + (null-pointer) + (foreign-alloc (fixed-array-element-type type) :count (length value) :initial-contents value))) + +(defmethod free-translated-object (value (type fixed-array) param) + (declare (ignore param)) + (unless (null-pointer-p value) + (foreign-free value))) + (define-g-boxed-cstruct rectangle "GdkRectangle" (x :int :initform 0) (y :int :initform 0)