98N/A* Copyright (c) 1990, 2011, Oracle and/or its affiliates. All rights reserved. 98N/A* Permission is hereby granted, free of charge, to any person obtaining a 1381N/A* copy of this software and associated documentation files (the "Software"), 98N/A* to deal in the Software without restriction, including without limitation 98N/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: 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* 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. 1381N/A** Handle I/O errors when opening display 98N/A** Handle X request errors. 493N/A** Just set a flag to let the routine making an X 969N/A** call know that the call resulted in a BadAccess error. 98N/A** Any other errors are processed normally. 536N/A** Examines the given colormap to determine the number of 536N/A** read-only cells, their locations, and their color values. 965N/A** All non-read-only cells (privately allocated, unallocated 729N/A** or reserved) are ignored. unsigned long masks;
/* NOTUSED */ /* start out assuming all are read-only */ /* allocate local scratch memory */ ** First, find the free cells by allocating them all private. ** We allocate by decreasing powers of 2 so the allocation ** time will be proportional to the number of display planes ** instead of the number of display cells. ** Mark the free cells we find. These allocations will ** be freed when the connection is closed. ** Find the read-only cells (excluding white/black). ** Get the Hardware color for the color of each allocated cell. ** This can only work if the returned color is a previously ** allocated r/o cell (we have all cells allocated). /* Eliminate reserved cells */ /* else if alloc succeeded, it must be read-only */ /* allocate the memory for the read-only cells */ ** Get the color values for the read-only cells, ignoring private ** Examines the default colormap with the server grabbed ** to prevent changes during the examination process. ** For each screen for which the default colormap is dynamic indexed ** record all read-only color cells in the default colormap. /* For some strange reason, colorscells_get_protected fails if not /* Open file to save in */ /* Save magic number and version */ /* For each screen of display ... */ /* Do nothing if default visual is not dynamic */ warning(
"default visual for screen %d is not dynamic indexed",
** Discover what read-only cells are in the default colormap. ** These will be considered the "workspace colors." /* Save read-only cells for screen in workspace color file */