/*-
* xcolor.c - X11 client to display all colors in current colormap.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Author: Patrick J. Naughton
* naughton@wind.sun.com
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "xcolor.h"
static int screen;
static int height = 0,
width = 0;
static int cmap_size;
static void
dumpCmap(void)
{
register int i;
for (i = 0; i < 256; i++)
for (i = 0; i < 256; i++) {
printf("/name%02x %3d %3d %3d RGBcolor def\n",
}
}
static void
{
int max;
register int i,
j;
register float fw;
register float fh;
switch (cmap_size) {
}
} else {
}
for (i = 0; i < max; i++) {
register int y = (int) (i * fh);
register int h = (i + 1) * fh - y;
for (j = 0; j < max; j++) {
register int x = (int) (j * fw);
register int w = (j + 1) * fw - x;
}
}
}
static void
{
register int i,
j, k;
register float fw;
register float fh;
static int got_offsets = 0;
} else {
}
if (!got_offsets) {
got_offsets = 1;
}
/* red channel */
k = 0;
for (i = 0; i < 16; i++, k++) {
register int y = (int) (k * fh);
register int h = (k + 1) * fh - y;
for (j = 0; j < 16; j++) {
register int x = (int) (j * fw);
register int w = (j + 1) * fw - x;
}
}
/* green channel */
for (i = 0; i < 16; i++, k++) {
register int y = (int) (k * fh);
register int h = (k + 1) * fh - y;
for (j = 0; j < 16; j++) {
register int x = (int) (j * fw);
register int w = (j + 1) * fw - x;
}
}
/* blue channel */
for (i = 0; i < 16; i++, k++) {
register int y = (int) (k * fh);
register int h = (k + 1) * fh - y;
for (j = 0; j < 16; j++) {
register int x = (int) (j * fw);
register int w = (j + 1) * fw - x;
}
}
}
static void
{
redisplay_direct(w);
else
}
static void
HandleEvents(void)
{
while (1) {
case Expose:
continue;
case GraphicsExpose:
case NoExpose:
case MapNotify:
case UnmapNotify:
continue;
case ConfigureNotify:
continue;
continue;
case KeyPress:
switch (XLookupKeysym(xke, 0)) {
case XK_Escape:
return;
default:
continue;
}
case ClientMessage:
{
return;
}
continue;
}
}
}
int
main(
int argc,
char *argv[]
)
{
int i;
int geomStat;
int dump = 0;
int nobw = 0;
int half = 0;
int mask;
int useiconwin = 0;
const char *pname;
if (getenv("_SYNC")) {
extern int _Xdebug;
_Xdebug = 1;
}
for (i = 1; i < argc; i++) {
displayName = argv[++i];
dump = 1;
nobw = 1;
half = 1;
install = 0;
useiconwin = 1;
else
error("usage: %s [-display dpystr] [-geometry geomstr]\n"
"\t[-dump] [-nobw] [-half] [-noinst] [-iconwin]\n", pname);
}
}
if (dump)
dumpCmap();
if (install) {
0.0, 1.0, 1.0,
}
size_hints.x = DEFX;
size_hints.y = DEFY;
size_hints.flags = 0;
if (geom) {
&(size_hints.y),
(unsigned int *) &(size_hints.width),
(unsigned int *) &(size_hints.height));
}
}
}
mask = CWEventMask;
if (install) {
mask |= CWColormap;
}
win = XCreateWindow(
dsp,
size_hints.x,
size_hints.y,
1, /* borderwidth */
InputOutput, /* class */
visual, /* visual */
mask, /* window attribute mask */
&xswa /* the attributes */
);
if (useiconwin) {
mask = CWEventMask;
if (install) {
mask |= CWColormap;
}
if (install) {
}
}
HandleEvents();
exit(0);
}