550N/A/*
1233N/A* Copyright (c) 1990, 2011, Oracle and/or its affiliates. All rights reserved.
550N/A*
550N/A* Permission is hereby granted, free of charge, to any person obtaining a
919N/A* copy of this software and associated documentation files (the "Software"),
919N/A* to deal in the Software without restriction, including without limitation
919N/A* the rights to use, copy, modify, merge, publish, distribute, sublicense,
919N/A* and/or sell copies of the Software, and to permit persons to whom the
919N/A* Software is furnished to do so, subject to the following conditions:
550N/A*
919N/A* The above copyright notice and this permission notice (including the next
919N/A* paragraph) shall be included in all copies or substantial portions of the
919N/A* Software.
550N/A*
919N/A* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
919N/A* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
919N/A* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
919N/A* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
919N/A* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
919N/A* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
919N/A* DEALINGS IN THE SOFTWARE.
550N/A*
550N/A*/
550N/A
550N/A
550N/A/*
550N/A** Definitions shared between several Workspace Color operations
550N/A*/
550N/A
550N/A#ifndef CMCUTIL_INCLUDE
550N/A#define CMCUTIL_INCLUDE
550N/A
1233N/A#include <stdio.h>
1233N/A
550N/A/*
550N/A** Symbols
550N/A*/
550N/A
550N/A#define COUNT_PROP_NAME "XA_COMPACTED_COLORS_COUNT"
550N/A#define RETAIN_PROP_NAME "XA_COMPACTED_COLORS_XID"
550N/A
550N/A/*
550N/A** Note: if you change these, you must also change it in
550N/A** server/cscript/cs_cmap.c.
550N/A*/
550N/A#define COMPACTED_COLORS_FILE ".owcolors"
550N/A#define CMC_MAGIC 0xb0f0
550N/A#define CMC_VERSION 0
550N/A
550N/A
550N/A
550N/A/*
550N/A** Macros
550N/A*/
550N/A
550N/A#define WHITE(c)\
550N/A ((c)->red == (c)->green && \
550N/A (c)->red == (c)->blue && \
550N/A (c)->red == 0xffff)
550N/A
550N/A#define BLACK(c)\
550N/A ((c)->red == (c)->green && \
550N/A (c)->red == (c)->blue && \
550N/A (c)->red == 0x0)
550N/A
550N/A/*
550N/A** Types
550N/A*/
550N/A
550N/Atypedef unsigned long Pixel;
550N/A
550N/A
550N/A/*
550N/A** External Functions
550N/A*/
550N/A
1233N/Aextern void fatal_error(const char *format, ...)
1233N/A _X_ATTRIBUTE_PRINTF(1,2) _X_NORETURN;
1233N/Aextern void warning(const char *format, ...)
1233N/A _X_ATTRIBUTE_PRINTF(1,2);
550N/Aextern Display *open_display();
550N/Aextern int dynamic_indexed_default_visual();
1233N/Aextern const char * comp_colors_filename(const char *);
1233N/Aextern int cmc_write(FILE *f, int scr_num,
1233N/A int ncolors, XColor *colors);
1233N/Aextern int cmc_read(FILE *f, int *scr_num,
1233N/A int *ncolors, XColor **colors);
1233N/Aextern void cmc_header_write(FILE *f);
1233N/Aextern void cmc_header_test(FILE *f);
1233N/Aextern void resource_preserve(Display *dpy);
1233N/Aextern void resource_discard(Display *dpy);
1233N/Aextern void prop_update(Display *dpy, Window w, const char *name,
1233N/A Atom type, int format, int data, int nelem);
550N/A
1233N/A#endif /* !CMCUTIL_INCLUDE */