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