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******************************************************************/ 1345N/A/* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. 366N/A * Permission is hereby granted, free of charge, to any person obtaining a 919N/A * copy of this software and associated documentation files (the "Software"), 919N/A * to deal in the Software without restriction, including without limitation 919N/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. 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 */ 1345N/A * rep.number is a CARD32 so could be as large as 2^32 1345N/A * The X11 protocol limits the total screen size to 64k x 64k, 1345N/A * and no screen can be smaller than a pixel. While technically 1345N/A * that means we could theoretically reach 2^32 screens, and that's 1345N/A * not even taking overlap into account, Xorg is currently limited 1345N/A * to 16 screens, and few known servers have a much higher limit, 1345N/A * so 1024 seems more than enough to prevent both integer overflow 1345N/A * and insane X server responses causing massive memory allocation.