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 908N/A* copy of this software and associated documentation files (the "Software"), 733N/A* to deal in the Software without restriction, including without limitation 98N/A* the rights to use, copy, modify, merge, publish, distribute, sublicense, 98N/A* and/or sell copies of the Software, and to permit persons to whom the 98N/A* Software is furnished to do so, subject to the following conditions: 98N/A* The above copyright notice and this permission notice (including the next 98N/A* paragraph) shall be included in all copies or substantial portions of the 98N/A* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 98N/A* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 98N/A* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 98N/A* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 98N/A* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 98N/A* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 98N/A* DEALINGS IN THE SOFTWARE. 606N/A /* Grab as many private cells as we can */ 908N/A ** May not be able to get as many colors as requested. 493N/A /* Free enough space for workspace colors */ 557N/A /* Allocate the workspace colors */ 606N/A /* Free placeholder pixels */ 851N/A ** Tell everybody how many workspace colors there are. 851N/A** For each screen for which there is saved workspace colors, 606N/A** allocates these colors as high as possible in the default 98N/A** colormap of the screen. 851N/A /* For some strange reason, cmc_alloc_protected fails if not 851N/A /* Open file where workspace colors are stored */ 606N/A /* Do nothing if not found */ 98N/A /* Check magic number and version */ 98N/A /* Abandon any previously allocated workspace colors (all screens) */ 908N/A /* For each screen of display ... */ 908N/A /* See if screen is still present */ 908N/A warning(
"Warning: cannot allocated saved colors for screen %d because\nthe display no longer has this many screens\n",
scr_num);
908N/A ** Existence of workspace colors for the screen implies 908N/A ** that its default visual was dynamic indexed. Make sure 908N/A warning(
"default visual for screen %d is no longer dynamic indexed\nsaved colors not allocated for screen %d",
scr_num,
scr_num);
908N/A /* Allocate workspace colors at high end of colormap */ /* Preserve newly allocated client resources */