From http://www.jwz.org/xscreensaver/xscreensaver-5.22.tar.gz
[xscreensaver] / utils / colors.h
index 61421cf5c37f26b60071a423470e9aa5eb5ee47c..526a38a09b16061de07c19ea80a00997279f163e 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1992, 1997 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1992-2013 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -14,7 +14,7 @@
 
 /* Like XFreeColors, but works on `XColor *' instead of `unsigned long *'
  */
-extern void free_colors (Display *, Colormap, XColor *, int ncolors);
+extern void free_colors (Screen *, Colormap, XColor *, int ncolors);
 
 
 /* Allocates writable, non-contiguous color cells.  The number requested is
@@ -22,7 +22,7 @@ extern void free_colors (Display *, Colormap, XColor *, int ncolors);
    (Unlike XAllocColorCells(), this will allocate as many as it can, instead
    of failing if they can't all be allocated.)
  */
-extern void allocate_writable_colors (Display *dpy, Colormap cmap,
+extern void allocate_writable_colors (Screen *, Colormap,
                                      unsigned long *pixels, int *ncolorsP);
 
 
@@ -38,14 +38,16 @@ extern void allocate_writable_colors (Display *dpy, Colormap cmap,
 
    If writable_p is true, writable color cells will be allocated;
    otherwise, read-only cells will be allocated.
+
+   If allocate_p is false, screen and cmap are unused (OpenGL usage).
  */
-extern void make_color_ramp (Display *dpy, Colormap cmap,
+extern void make_color_ramp (Screen *, Visual *, Colormap,
                             int h1, double s1, double v1,
                             int h2, double s2, double v2,
                             XColor *colors, int *ncolorsP,
                             Bool closed_p,
                             Bool allocate_p,
-                            Bool writable_p);
+                            Bool *writable_pP);
 
 /* Generates a sequence of colors evenly spaced around the triangle
    indicated by the thee HSV coordinates.
@@ -56,14 +58,16 @@ extern void make_color_ramp (Display *dpy, Colormap cmap,
 
    If writable_p is true, writable color cells will be allocated;
    otherwise, read-only cells will be allocated.
+
+   If allocate_p is false, screen, visual and cmap are unused (OpenGL usage).
  */
-extern void make_color_loop (Display *, Colormap,
+extern void make_color_loop (Screen *, Visual *, Colormap,
                             int h1, double s1, double v1,
                             int h2, double s2, double v2,
                             int h3, double s3, double v3,
                             XColor *colors, int *ncolorsP,
                             Bool allocate_p,
-                            Bool writable_p);
+                            Bool *writable_pP);
 
 
 /* Allocates a hopefully-interesting colormap, which will be a closed loop
@@ -78,9 +82,10 @@ extern void make_color_loop (Display *, Colormap,
    otherwise, read-only cells will be allocated.  If no writable cells
    cannot be allocated, we will try to allocate unwritable cells
    instead, and print a message on stderr to that effect (if verbose_p).
+
+   If allocate_p is false, screen, visual and cmap are unused (OpenGL usage).
  */
-extern void make_smooth_colormap (Display *dpy, Visual *visual,
-                                 Colormap cmap,
+extern void make_smooth_colormap (Screen *, Visual *, Colormap,
                                  XColor *colors, int *ncolorsP,
                                  Bool allocate_p,
                                  Bool *writable_pP,
@@ -99,9 +104,10 @@ extern void make_smooth_colormap (Display *dpy, Visual *visual,
    otherwise, read-only cells will be allocated.  If no writable cells
    cannot be allocated, we will try to allocate unwritable cells
    instead, and print a message on stderr to that effect (if verbose_p).
+
+   If allocate_p is false, screen, visual and cmap are unused (OpenGL usage).
  */
-extern void make_uniform_colormap (Display *dpy, Visual *visual,
-                                  Colormap cmap,
+extern void make_uniform_colormap (Screen *, Visual *, Colormap,
                                   XColor *colors, int *ncolorsP,
                                   Bool allocate_p,
                                   Bool *writable_pP,
@@ -120,9 +126,10 @@ extern void make_uniform_colormap (Display *dpy, Visual *visual,
    otherwise, read-only cells will be allocated.  If no writable cells
    cannot be allocated, we will try to allocate unwritable cells
    instead, and print a message on stderr to that effect (if verbose_p).
+
+   If allocate_p is false, screen, visual and cmap are unused (OpenGL usage).
  */
-extern void make_random_colormap (Display *dpy, Visual *visual,
-                                 Colormap cmap,
+extern void make_random_colormap (Screen *, Visual *, Colormap,
                                  XColor *colors, int *ncolorsP,
                                  Bool bright_p,
                                  Bool allocate_p,
@@ -134,7 +141,7 @@ extern void make_random_colormap (Display *dpy, Visual *visual,
    of writable color cells, this rotates the contents of the array by
    `distance' steps, moving the colors of cell N to cell (N - distance).
  */
-extern void rotate_colors (Display *, Colormap,
+extern void rotate_colors (Screen *, Colormap,
                           XColor *, int ncolors, int distance);
 
 #endif /* __COLORS_H__ */