1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun * quartzRandR.h 3*4882a593Smuzhiyun * 4*4882a593Smuzhiyun * Copyright (c) 2010 Jan Hauffa. 5*4882a593Smuzhiyun * 2010-2012 Apple Inc. 6*4882a593Smuzhiyun * All Rights Reserved. 7*4882a593Smuzhiyun * 8*4882a593Smuzhiyun * Permission is hereby granted, free of charge, to any person obtaining a 9*4882a593Smuzhiyun * copy of this software and associated documentation files (the "Software"), 10*4882a593Smuzhiyun * to deal in the Software without restriction, including without limitation 11*4882a593Smuzhiyun * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12*4882a593Smuzhiyun * and/or sell copies of the Software, and to permit persons to whom the 13*4882a593Smuzhiyun * Software is furnished to do so, subject to the following conditions: 14*4882a593Smuzhiyun * 15*4882a593Smuzhiyun * The above copyright notice and this permission notice shall be included in 16*4882a593Smuzhiyun * all copies or substantial portions of the Software. 17*4882a593Smuzhiyun * 18*4882a593Smuzhiyun * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19*4882a593Smuzhiyun * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20*4882a593Smuzhiyun * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 21*4882a593Smuzhiyun * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 22*4882a593Smuzhiyun * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 23*4882a593Smuzhiyun * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 24*4882a593Smuzhiyun * DEALINGS IN THE SOFTWARE. 25*4882a593Smuzhiyun * 26*4882a593Smuzhiyun * Except as contained in this notice, the name(s) of the above copyright 27*4882a593Smuzhiyun * holders shall not be used in advertising or otherwise to promote the sale, 28*4882a593Smuzhiyun * use or other dealings in this Software without prior written authorization. 29*4882a593Smuzhiyun */ 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun #ifndef _QUARTZRANDR_H_ 32*4882a593Smuzhiyun #define _QUARTZRANDR_H_ 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun #include "randrstr.h" 35*4882a593Smuzhiyun 36*4882a593Smuzhiyun typedef struct { 37*4882a593Smuzhiyun size_t width, height; 38*4882a593Smuzhiyun int refresh; 39*4882a593Smuzhiyun RRScreenSizePtr pSize; 40*4882a593Smuzhiyun void *ref; /* CGDisplayModeRef or CFDictionaryRef */ 41*4882a593Smuzhiyun } QuartzModeInfo, *QuartzModeInfoPtr; 42*4882a593Smuzhiyun 43*4882a593Smuzhiyun // Quartz specific per screen storage structure 44*4882a593Smuzhiyun typedef struct { 45*4882a593Smuzhiyun // List of CoreGraphics displays that this X11 screen covers. 46*4882a593Smuzhiyun // This is more than one CG display for video mirroring and 47*4882a593Smuzhiyun // rootless PseudoramiX mode. 48*4882a593Smuzhiyun // No CG display will be covered by more than one X11 screen. 49*4882a593Smuzhiyun int displayCount; 50*4882a593Smuzhiyun CGDirectDisplayID *displayIDs; 51*4882a593Smuzhiyun QuartzModeInfo rootlessMode, fullscreenMode, currentMode; 52*4882a593Smuzhiyun } QuartzScreenRec, *QuartzScreenPtr; 53*4882a593Smuzhiyun 54*4882a593Smuzhiyun #define QUARTZ_PRIV(pScreen) \ 55*4882a593Smuzhiyun ((QuartzScreenPtr)dixLookupPrivate(&pScreen->devPrivates, quartzScreenKey)) 56*4882a593Smuzhiyun 57*4882a593Smuzhiyun void 58*4882a593Smuzhiyun QuartzCopyDisplayIDs(ScreenPtr pScreen, int displayCount, 59*4882a593Smuzhiyun CGDirectDisplayID *displayIDs); 60*4882a593Smuzhiyun 61*4882a593Smuzhiyun Bool 62*4882a593Smuzhiyun QuartzRandRUpdateFakeModes(BOOL force_update); 63*4882a593Smuzhiyun Bool 64*4882a593Smuzhiyun QuartzRandRInit(ScreenPtr pScreen); 65*4882a593Smuzhiyun 66*4882a593Smuzhiyun /* These two functions provide functionality expected by the legacy 67*4882a593Smuzhiyun * mode switching. They are equivalent to a client requesting one 68*4882a593Smuzhiyun * of the modes corresponding to these "fake" modes. 69*4882a593Smuzhiyun * QuartzRandRSetFakeFullscreen takes an argument which is used to determine 70*4882a593Smuzhiyun * the visibility of the windows after the change. 71*4882a593Smuzhiyun */ 72*4882a593Smuzhiyun void 73*4882a593Smuzhiyun QuartzRandRSetFakeRootless(void); 74*4882a593Smuzhiyun void 75*4882a593Smuzhiyun QuartzRandRSetFakeFullscreen(BOOL state); 76*4882a593Smuzhiyun 77*4882a593Smuzhiyun /* Toggle fullscreen mode. If "fake" fullscreen is the current mode, 78*4882a593Smuzhiyun * this will just show/hide the X11 windows. If we are in a RandR fullscreen 79*4882a593Smuzhiyun * mode, this will toggles us to the default fake mode and hide windows if 80*4882a593Smuzhiyun * it is fullscreen 81*4882a593Smuzhiyun */ 82*4882a593Smuzhiyun void 83*4882a593Smuzhiyun QuartzRandRToggleFullscreen(void); 84*4882a593Smuzhiyun 85*4882a593Smuzhiyun #endif 86