pix_grab.c revision 919
970N/A/* Copyright 2004 Sun Microsystems, Inc. All rights reserved. 970N/A * Use is subject to license terms. 970N/A * Permission is hereby granted, free of charge, to any person obtaining a 970N/A * copy of this software and associated documentation files (the "Software"), 970N/A * to deal in the Software without restriction, including without limitation 970N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense, 970N/A * and/or sell copies of the Software, and to permit persons to whom the 970N/A * Software is furnished to do so, subject to the following conditions: 970N/A * The above copyright notice and this permission notice (including the next 970N/A * paragraph) shall be included in all copies or substantial portions of the 970N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 970N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 970N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 970N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 970N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 970N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 970N/A * DEALINGS IN THE SOFTWARE. 970N/A/* Some structure definition for internal bookkeeping 970N/A * NOTE: there is only one locking window created per device for 970N/A * the use of all pixmaps on that device 970N/A/****************************************** 970N/A * create shared memory file for pixmap information 970N/A * Dga_token token; INPUT 970N/A * magic cookie supplied by the server 970N/A * returns a user virtual address for a dga_window structure. * returns NULL if anything goes awry. *****************************************/ /* Remember to account for multiple clients grabbing the same pixmap /* First determine if this is a X pixmap - if so, get (
void)
fprintf(
stderr,
"dga_pix_grab: Unsupported pixmap type\n");
/* This is the first time through this code so get the "dga_pix_grab: XDgaGetRetainedPath failed\n");
/* Now get the port number for this display */ /* Now start by initializing all the per client structs - * all 64 of them - if thie is the first time you /* If it is not the first time, see if this client has grabbed * a pixmap before and therefore done all the set up. * Search through the client structures for matching token /* We found a match and the pixmap already has been grabbed before */ /* This client has Never grabbed before set up the direct * Open the shared file using server command line * -sharedretainedpath variable for file path if it is * set, else use /tmp. This is because these files can * be very big and there usually isn't much space in /tmp. /* map the shpx directory for this client and map at 4 megabytes */ /* The first 2 entries on the file have special meaning. */ /* BMAC - Find out about the rache code - what should I do there? */ /* Now fill out the Dga_pixmap structure */ /* This is the new location added for locking performance * For windows it pts to the second member in the c_wm_chngcnt * array but here I think that it just pts to the previous field * since for pixmaps the array ctr is -1 always lockp =
NULL;
/* init to NULL for check below */ /* Check to see if there are already a lockp and unlockp * for this device--if not create 'em /* only get new lock pages if necessary */ /* REMIND Daryl: What else do we need to clean up? */ /* add to linked list of grabbed pixmaps - for internal bookkeeping /* Find pixmap in dga_plist */ /* TODO: Daryl what is this routine supposed to be used for??? */ /* this checks to see if the shared pixmap info * area has changed and if so reinits the data /* This routine seems to requoire that the handle have 1. if the pixmap is cached or not 2. what type the pixmap is = like retained one?? 3. something called sh_rache_scr0, sh_rache_scr1; 4. something called sh_Scr_Virt[]; virtual screen table */ /* Nothing has changed */ /* Nothing has changed */