Fix parsing of arrays of GBoxed in Gdk/key-values
authorDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Sat, 14 Nov 2009 03:09:00 +0000 (06:09 +0300)
committerDmitry Kalyanov <Kalyanov.Dmitry@gmail.com>
Sat, 14 Nov 2009 03:09:00 +0000 (06:09 +0300)
gdk/gdk.key-values.lisp

index 89241fe..432810a 100644 (file)
             (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)
             (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)