XPanoramiX.c revision 1345
475N/A/***************************************************************** 475N/ACopyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. 475N/APermission is hereby granted, free of charge, to any person obtaining a copy 475N/Aof this software and associated documentation files (the "Software"), to deal 919N/Ain the Software without restriction, including without limitation the rights 919N/Ato use, copy, modify, merge, publish, distribute, sublicense, and/or sell 919N/AThe above copyright notice and this permission notice shall be included in 919N/Aall copies or substantial portions of the Software. 919N/ATHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 919N/AIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 919N/AFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 919N/ADIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, 919N/ABUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, 919N/AWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 919N/AIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 919N/AExcept as contained in this notice, the name of Digital Equipment Corporation 919N/Ashall not be used in advertising or otherwise to promote the sale, use or other 475N/Adealings in this Software without prior written authorization from Digital 475N/A******************************************************************/ 493N/A/* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. 970N/A * Permission is hereby granted, free of charge, to any person obtaining a 977N/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, 1339N/A * and/or sell copies of the Software, and to permit persons to whom the 1339N/A * Software is furnished to do so, subject to the following conditions: 475N/A * The above copyright notice and this permission notice (including the next 1276N/A * paragraph) shall be included in all copies or substantial portions of the 1276N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1276N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1276N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 911N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 475N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 1276N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 475N/A * DEALINGS IN THE SOFTWARE. NULL,
/* wire_to_event */ NULL,
/* event_to_wire */ compatibility with XFree86 & Xorg protocols ****/ Returns the number of heads and a pointer to an array of structures describing the position and size of the individual heads. Returns NULL and number = 0 if Xinerama is not active. Returned array should be freed with XFree(). /**************************************************************************** * PanoramiX public interfaces * ****************************************************************************/ #
ifdef SUNSOFT /* Cache version info *//* new api for xinerama */ /* screen_number may seem like hyper-bogus stuff, but: it may be possible to have 2 xinerama screen sets on return False;
/* no no, must say zero */ if ((
maj ==
1) && (
min >= 0)) {
return True;
/* can't check in 1.0 protocol */ if ((
maj ==
1) && (
min >= 0)) {
/* Use Sun extended protocol */ /* get the count of screens that we need to know about NOTE: screen_number implies a set of fb's for this /* Make sure not to overflow buffers if X server has more screens /* now read the servers list of frame buffers */ /* assume the start up and list are in the same order */ if (i > 0)
/* fb0 never gets a hint */ return 0;
/* don't yet support multiple Xinerama screens */ if ((
fb < 0) || (
fb >=
fbs))
/* fb value not valid */ /* Xinerama is not active, so there's only one framebuffer */ /* (for screen 0). Return appropriate values anyway. */ if (
fb == 0)
/* assume screen == fb == 0. Code only supports one screen.*/ /* Xinerama is active, so do the right thing. */ if ((
fb > -
1) && (
fb <
fbs))
/* if fb has a legal value */ XFree86 & Xorg Xinerama 1.1 protocol ****/ /*******************************************************************\ Alternate interface to make up for shortcomings in the original, namely, the omission of the screen origin. The new interface is in the "Xinerama" namespace instead of "PanoramiX". \*******************************************************************/ return False;
/* server doesn't even have the extension */ * rep.number is a CARD32 so could be as large as 2^32 * The X11 protocol limits the total screen size to 64k x 64k, * and no screen can be smaller than a pixel. While technically * that means we could theoretically reach 2^32 screens, and that's * not even taking overlap into account, Xorg is currently limited * to 16 screens, and few known servers have a much higher limit, * so 1024 seems more than enough to prevent both integer overflow * and insane X server responses causing massive memory allocation.