3 (defcfun (colormap-new "gdk_colormap_new") (g-object colormap
:already-referenced
)
4 (visual (g-object visual
))
10 ;; GdkColormap* gdk_colormap_ref (GdkColormap *cmap);
11 ;; void gdk_colormap_unref (GdkColormap *cmap);
13 (defcfun (colormap-get-system "gdk_colormap_get_system") (g-object colormap
))
15 (export 'colormap-get-system
)
18 ;; gint gdk_colormap_get_system_size (void);
19 ;; void gdk_colormap_change (GdkColormap *colormap,
22 (defcfun gdk-colormap-alloc-colors
:int
23 (colormap (g-object colormap
))
28 (success (:pointer
:boolean
)))
30 (defun colormap-alloc-colors (colormap colors writeable best-match
)
31 (with-foreign-boxed-array (n colors-ar color colors
)
32 (with-foreign-object (success :boolean
)
33 (gdk-colormap-alloc-colors colormap colors-ar n writeable best-match success
)
34 (mem-ref success
:boolean
))))
36 (export 'colormap-alloc-colors
)
38 (defcfun (colormap-alloc-color "gdk_colormap_alloc_color") :boolean
39 (colormap (g-object colormap
))
40 (color (g-boxed-foreign color
))
42 (best-match :boolean
))
44 (export 'colormap-alloc-color
)
46 (defcfun gdk-colormap-free-colors
:void
47 (colormap (g-object colormap
))
51 (defun colormap-free-colors (colormap colors
)
52 (with-foreign-boxed-array (n colors-ptr color colors
)
53 (gdk-colormap-free-colors colormap colors-ptr n
)))
55 (export 'colormap-free-colors
)
57 (defcfun gdk-colormap-query-color
:void
58 (colormap (g-object colormap
))
60 (result (g-boxed-foreign color
)))
62 (defun colormap-query-color (colormap pixel
)
63 (let ((color (make-color)))
64 (gdk-colormap-query-color colormap pixel color
)
67 (export 'colormap-query-color
)
70 ;; void gdk_colors_store (GdkColormap *colormap,
73 ;; gint gdk_colors_alloc (GdkColormap *colormap,
74 ;; gboolean contiguous,
79 ;; void gdk_colors_free (GdkColormap *colormap,
83 ;; gint gdk_color_white (GdkColormap *colormap,
85 ;; gint gdk_color_black (GdkColormap *colormap,
88 (defcfun gdk-color-parse
:boolean
90 (color (g-boxed-foreign color
)))
92 (defun color-parse (color-spec)
93 (let ((color (make-color)))
94 (when (gdk-color-parse color-spec color
)
100 ;; gint gdk_color_alloc (GdkColormap *colormap,
102 ;; gint gdk_color_change (GdkColormap *colormap,
105 (defcfun (color= "gdk_color_equal") :boolean
106 (color-a (g-boxed-foreign color
))
107 (color-b (g-boxed-foreign color
)))
111 (defcfun (gdk-color-hash "gdk_color_hash") :uint
112 (color (g-boxed-foreign color
)))
114 (export 'gdk-color-hash
)
116 (defcfun (color-to-string "gdk_color_to_string") (glib:g-string
:free-from-foreign t
)
117 (color (g-boxed-foreign color
)))
119 (export 'color-to-string
)