| 1 | /* |
| 2 | * quartz.h |
| 3 | * |
| 4 | * External interface of the Quartz display modes seen by the generic, mode |
| 5 | * independent parts of the Darwin X server. |
| 6 | * |
| 7 | * Copyright (c) 2002-2012 Apple Inc. All rights reserved. |
| 8 | * Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons. |
| 9 | * All Rights Reserved. |
| 10 | * |
| 11 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 12 | * copy of this software and associated documentation files (the "Software"), |
| 13 | * to deal in the Software without restriction, including without limitation |
| 14 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 15 | * and/or sell copies of the Software, and to permit persons to whom the |
| 16 | * Software is furnished to do so, subject to the following conditions: |
| 17 | * |
| 18 | * The above copyright notice and this permission notice shall be included in |
| 19 | * all copies or substantial portions of the Software. |
| 20 | * |
| 21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 22 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 23 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 24 | * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 25 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 26 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 27 | * DEALINGS IN THE SOFTWARE. |
| 28 | * |
| 29 | * Except as contained in this notice, the name(s) of the above copyright |
| 30 | * holders shall not be used in advertising or otherwise to promote the sale, |
| 31 | * use or other dealings in this Software without prior written authorization. |
| 32 | */ |
| 33 | |
| 34 | #ifndef _QUARTZ_H |
| 35 | #define _QUARTZ_H |
| 36 | |
| 37 | #include "screenint.h" |
| 38 | #include "window.h" |
| 39 | #include "pixmap.h" |
| 40 | |
| 41 | /*------------------------------------------ |
| 42 | Quartz display mode function types |
| 43 | ------------------------------------------*/ |
| 44 | |
| 45 | /* |
| 46 | * Display mode initialization |
| 47 | */ |
| 48 | typedef void (*DisplayInitProc)(void); |
| 49 | typedef Bool (*AddScreenProc)(int index, ScreenPtr pScreen); |
| 50 | typedef Bool (*SetupScreenProc)(int index, ScreenPtr pScreen); |
| 51 | typedef void (*InitInputProc)(int argc, char **argv); |
| 52 | |
| 53 | /* |
| 54 | * Cursor functions |
| 55 | */ |
| 56 | typedef Bool (*InitCursorProc)(ScreenPtr pScreen); |
| 57 | |
| 58 | /* |
| 59 | * Suspend and resume X11 activity |
| 60 | */ |
| 61 | typedef void (*SuspendScreenProc)(ScreenPtr pScreen); |
| 62 | typedef void (*ResumeScreenProc)(ScreenPtr pScreen); |
| 63 | |
| 64 | /* |
| 65 | * Screen state change support |
| 66 | */ |
| 67 | typedef void (*AddPseudoramiXScreensProc) |
| 68 | (int *x, int *y, int *width, int *height, ScreenPtr pScreen); |
| 69 | typedef void (*UpdateScreenProc)(ScreenPtr pScreen); |
| 70 | |
| 71 | /* |
| 72 | * Rootless helper functions |
| 73 | */ |
| 74 | typedef Bool (*IsX11WindowProc)(int windowNumber); |
| 75 | typedef void (*HideWindowsProc)(Bool hide); |
| 76 | |
| 77 | /* |
| 78 | * Rootless functions for optional export to GLX layer |
| 79 | */ |
| 80 | typedef void * (*FrameForWindowProc)(WindowPtr pWin, Bool create); |
| 81 | typedef WindowPtr (*TopLevelParentProc)(WindowPtr pWindow); |
| 82 | typedef Bool (*CreateSurfaceProc) |
| 83 | (ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable, |
| 84 | unsigned int client_id, unsigned int *surface_id, |
| 85 | unsigned int key[2], void (*notify)(void *arg, void *data), |
| 86 | void *notify_data); |
| 87 | typedef Bool (*DestroySurfaceProc) |
| 88 | (ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable, |
| 89 | void (*notify)(void *arg, void *data), void *notify_data); |
| 90 | |
| 91 | /* |
| 92 | * Quartz display mode function list |
| 93 | */ |
| 94 | typedef struct _QuartzModeProcs { |
| 95 | DisplayInitProc DisplayInit; |
| 96 | AddScreenProc AddScreen; |
| 97 | SetupScreenProc SetupScreen; |
| 98 | InitInputProc InitInput; |
| 99 | |
| 100 | InitCursorProc InitCursor; |
| 101 | |
| 102 | SuspendScreenProc SuspendScreen; |
| 103 | ResumeScreenProc ResumeScreen; |
| 104 | |
| 105 | AddPseudoramiXScreensProc AddPseudoramiXScreens; |
| 106 | UpdateScreenProc UpdateScreen; |
| 107 | |
| 108 | IsX11WindowProc IsX11Window; |
| 109 | HideWindowsProc HideWindows; |
| 110 | |
| 111 | FrameForWindowProc FrameForWindow; |
| 112 | TopLevelParentProc TopLevelParent; |
| 113 | CreateSurfaceProc CreateSurface; |
| 114 | DestroySurfaceProc DestroySurface; |
| 115 | } QuartzModeProcsRec, *QuartzModeProcsPtr; |
| 116 | |
| 117 | extern QuartzModeProcsPtr quartzProcs; |
| 118 | |
| 119 | extern Bool XQuartzFullscreenVisible; /* Are the windows visible (predicated on !rootless) */ |
| 120 | extern Bool XQuartzServerVisible; /* Is the server visible ... TODO: Refactor to "active" */ |
| 121 | extern Bool XQuartzEnableKeyEquivalents; |
| 122 | extern Bool XQuartzRootlessDefault; /* Is our default mode rootless? */ |
| 123 | extern Bool XQuartzIsRootless; /* Is our current mode rootless (or FS)? */ |
| 124 | extern Bool XQuartzFullscreenMenu; /* Show the menu bar (autohide) while in FS */ |
| 125 | extern Bool XQuartzFullscreenDisableHotkeys; |
| 126 | extern Bool XQuartzOptionSendsAlt; /* Alt or Mode_switch? */ |
| 127 | |
| 128 | extern int32_t XQuartzShieldingWindowLevel; /* CGShieldingWindowLevel() or 0 */ |
| 129 | |
| 130 | Bool |
| 131 | QuartzAddScreen(int index, ScreenPtr pScreen); |
| 132 | Bool |
| 133 | QuartzSetupScreen(int index, ScreenPtr pScreen); |
| 134 | void |
| 135 | QuartzInitOutput(int argc, char **argv); |
| 136 | void |
| 137 | QuartzInitInput(int argc, char **argv); |
| 138 | void |
| 139 | QuartzInitServer(int argc, char **argv, char **envp); |
| 140 | void |
| 141 | QuartzGiveUp(void); |
| 142 | void |
| 143 | QuartzProcessEvent(xEvent *xe); |
| 144 | void |
| 145 | QuartzUpdateScreens(void); |
| 146 | |
| 147 | void |
| 148 | QuartzShow(void); |
| 149 | void |
| 150 | QuartzHide(void); |
| 151 | void |
| 152 | QuartzSetRootClip(BOOL enable); |
| 153 | void |
| 154 | QuartzSpaceChanged(uint32_t space_id); |
| 155 | |
| 156 | void |
| 157 | QuartzSetRootless(Bool state); |
| 158 | void |
| 159 | QuartzShowFullscreen(Bool state); |
| 160 | |
| 161 | int |
| 162 | server_main(int argc, char **argv, char **envp); |
| 163 | #endif |