+(defcfun gtk-color-selection-palette-from-string :boolean
+ (str :string)
+ (colors :pointer)
+ (n-colors :pointer))
+
+(defun color-selection-palette-from-string (str)
+ (with-foreign-objects ((colors :pointer) (n-colors :int))
+ (when (gtk-color-selection-palette-from-string str colors n-colors)
+ (iter (with colors-ar = (mem-ref colors :pointer))
+ (for i from 0 below (mem-ref n-colors :int))
+ (for color-ptr =
+ (inc-pointer colors-ar
+ (* i (foreign-type-size 'gdk::color-cstruct))))
+ (for color = (convert-from-foreign color-ptr '(g-boxed-foreign color)))
+ (collect color)
+ (finally (g-free colors-ar))))))
+
+(defcfun gtk-color-selection-palette-to-string (g-string :free-from-foreign t)
+ (colors :pointer)
+ (n-colors :int))