From cb5bb1c1d992d05ffc745c30bc3d6f10803fa00b Mon Sep 17 00:00:00 2001 From: Dmitry Kalyanov Date: Sat, 14 Nov 2009 06:09:00 +0300 Subject: [PATCH] Fix parsing of arrays of GBoxed in Gdk/key-values --- gdk/gdk.key-values.lisp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gdk/gdk.key-values.lisp b/gdk/gdk.key-values.lisp index 89241fe..432810a 100644 --- a/gdk/gdk.key-values.lisp +++ b/gdk/gdk.key-values.lisp @@ -48,10 +48,13 @@ (n-keys (mem-ref n-keys :int))) (prog1 (iter (for i from 0 below n-keys) - (for keymap-key = (mem-aref keys '(g-boxed-foreign keymap-key) i)) + (for keymap-key = (convert-from-foreign (inc-pointer keys (* i (foreign-type-size 'keymap-key-cstruct))) + '(g-boxed-foreign keymap-key))) (collect keymap-key)) (glib:g-free keys)))))) +(export 'keymap-get-entries-for-keyval) + (defcfun gdk_keymap_get_entries_for_keycode :boolean (keymap (g-object keymap)) (hardware-keycode :uint) @@ -67,9 +70,10 @@ (n-keys (mem-ref n-keys :int))) (prog1 (iter (for i from 0 below n-keys) - (for keymap-key = (mem-aref keys '(g-boxed-foreign keymap-key) i)) - (collect keymap-key into r-keys) (for keyval = (mem-aref keyvals :uint)) + (for keymap-key = (convert-from-foreign (inc-pointer keys (* i (foreign-type-size 'keymap-key-cstruct))) + '(g-boxed-foreign keymap-key))) + (collect keymap-key into r-keys) (collect keyval into r-keyvals) (finally (return (values r-keys r-keyvals)))) (glib:g-free keys) -- 1.7.10.4