Added finalizing of all gtk+ classes at the end of compilation
[cl-gtk2.git] / gdk / gdk.colors.lisp
blobcf0dd1647cff7a3e0a5d39a19641a197b1613aaf
1 (in-package :gdk)
3 (defcfun (colormap-new "gdk_colormap_new") (g-object colormap :already-referenced)
4 (visual (g-object visual))
5 (allocate :boolean))
7 (export 'colormap-new)
9 ;; deprecated
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)
17 ;; deprecated
18 ;; gint gdk_colormap_get_system_size (void);
19 ;; void gdk_colormap_change (GdkColormap *colormap,
20 ;; gint ncolors);
22 (defcfun gdk-colormap-alloc-colors :int
23 (colormap (g-object colormap))
24 (colors :pointer)
25 (n-colors :int)
26 (writeable :boolean)
27 (best-match :boolean)
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))
41 (writeable :boolean)
42 (best-match :boolean))
44 (export 'colormap-alloc-color)
46 (defcfun gdk-colormap-free-colors :void
47 (colormap (g-object colormap))
48 (colors :pointer)
49 (n-colors :int))
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))
59 (pixel :ulong)
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)
65 color))
67 (export 'colormap-query-color)
69 ;; ignored:
70 ;; void gdk_colors_store (GdkColormap *colormap,
71 ;; GdkColor *colors,
72 ;; gint ncolors);
73 ;; gint gdk_colors_alloc (GdkColormap *colormap,
74 ;; gboolean contiguous,
75 ;; gulong *planes,
76 ;; gint nplanes,
77 ;; gulong *pixels,
78 ;; gint npixels);
79 ;; void gdk_colors_free (GdkColormap *colormap,
80 ;; gulong *pixels,
81 ;; gint npixels,
82 ;; gulong planes);
83 ;; gint gdk_color_white (GdkColormap *colormap,
84 ;; GdkColor *color);
85 ;; gint gdk_color_black (GdkColormap *colormap,
86 ;; GdkColor *color);
88 (defcfun gdk-color-parse :boolean
89 (spec :string)
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)
95 color)))
97 (export 'color-parse)
99 ;; ignored:
100 ;; gint gdk_color_alloc (GdkColormap *colormap,
101 ;; GdkColor *color);
102 ;; gint gdk_color_change (GdkColormap *colormap,
103 ;; GdkColor *color);
105 (defcfun (color= "gdk_color_equal") :boolean
106 (color-a (g-boxed-foreign color))
107 (color-b (g-boxed-foreign color)))
109 (export '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)