XPanoramiX.c revision 366
366N/A/***************************************************************** 366N/ACopyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 366N/APermission is hereby granted, free of charge, to any person obtaining a copy 366N/Aof this software and associated documentation files (the "Software"), to deal 366N/Ain the Software without restriction, including without limitation the rights 366N/Ato use, copy, modify, merge, publish, distribute, sublicense, and/or sell 366N/AThe above copyright notice and this permission notice shall be included in 366N/Aall copies or substantial portions of the Software. 366N/ATHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 366N/AIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 366N/AFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 366N/ADIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, 366N/ABUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, 366N/AWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 366N/AIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 366N/AExcept as contained in this notice, the name of Digital Equipment Corporation 366N/Ashall not be used in advertising or otherwise to promote the sale, use or other 366N/Adealings in this Software without prior written authorization from Digital 366N/A******************************************************************/ 366N/A/* Copyright 2008 Sun Microsystems, Inc. All rights reserved. 366N/A * Permission is hereby granted, free of charge, to any person obtaining a 366N/A * copy of this software and associated documentation files (the 366N/A * "Software"), to deal in the Software without restriction, including 366N/A * without limitation the rights to use, copy, modify, merge, publish, 366N/A * distribute, and/or sell copies of the Software, and to permit persons 366N/A * to whom the Software is furnished to do so, provided that the above 366N/A * copyright notice(s) and this permission notice appear in all copies of 366N/A * the Software and that both the above copyright notice(s) and this 366N/A * permission notice appear in supporting documentation. 366N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 366N/A * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 366N/A * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 366N/A * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 366N/A * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL 366N/A * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING 366N/A * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 366N/A * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 366N/A * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 366N/A * Except as contained in this notice, the name of a copyright holder 366N/A * shall not be used in advertising or otherwise to promote the sale, use 366N/A * or other dealings in this Software without prior written authorization 366N/A * of the copyright holder. 366N/A compatibility with XFree86 & Xorg protocols ****/ 366N/A Returns the number of heads and a pointer to an array of 366N/A structures describing the position and size of the individual 366N/A heads. Returns NULL and number = 0 if Xinerama is not active. 366N/A Returned array should be freed with XFree(). 366N/A/**************************************************************************** 366N/A * PanoramiX public interfaces * 366N/A ****************************************************************************/ 366N/A/* new api for xinerama */ 366N/A /* screen_number may seem like hyper-bogus stuff, but: 366N/A it may be possible to have 2 xinerama screen sets on 366N/A return True;
/* can't check in 1.0 protocol */ 366N/A /* Use Sun extended protocol */ 366N/A /* get the count of screens that we need to know about 366N/A NOTE: screen_number implies a set of fb's for this 366N/A /* Make sure not to overflow buffers if X server has more screens 366N/A /* now read the servers list of frame buffers */ 366N/A /* assume the start up and list are in the same order */ 366N/A if (i > 0)
/* fb0 never gets a hint */ 366N/A return 0;
/* don't yet support multiple Xinerama screens */ 366N/A /* Xinerama is not active, so there's only one framebuffer */ 366N/A /* (for screen 0). Return appropriate values anyway. */ 366N/A if (
fb == 0)
/* assume screen == fb == 0. Code only supports one screen.*/ 366N/A /* Xinerama is active, so do the right thing. */ 366N/A if ((
fb > -
1) && (
fb <
fbs))
/* if fb has a legal value */ 366N/A XFree86 & Xorg Xinerama 1.1 protocol ****/ 366N/A/*******************************************************************\ 366N/A Alternate interface to make up for shortcomings in the original, 366N/A namely, the omission of the screen origin. The new interface is 366N/A in the "Xinerama" namespace instead of "PanoramiX". 366N/A\*******************************************************************/ 366N/A return False;
/* server doesn't even have the extension */