4 * External interface of the Quartz display modes seen by the generic, mode
5 * independent parts of the Darwin X server.
7 * Copyright (c) 2002-2012 Apple Inc. All rights reserved.
8 * Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons.
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:
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
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.
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.
37 #include "screenint.h"
41 /*------------------------------------------
42 Quartz display mode function types
43 ------------------------------------------*/
46 * Display mode initialization
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
);
56 typedef Bool (*InitCursorProc
)(ScreenPtr pScreen
);
59 * Suspend and resume X11 activity
61 typedef void (*SuspendScreenProc
)(ScreenPtr pScreen
);
62 typedef void (*ResumeScreenProc
)(ScreenPtr pScreen
);
65 * Screen state change support
67 typedef void (*AddPseudoramiXScreensProc
)
68 (int *x
, int *y
, int *width
, int *height
, ScreenPtr pScreen
);
69 typedef void (*UpdateScreenProc
)(ScreenPtr pScreen
);
72 * Rootless helper functions
74 typedef Bool (*IsX11WindowProc
)(int windowNumber
);
75 typedef void (*HideWindowsProc
)(Bool hide
);
78 * Rootless functions for optional export to GLX layer
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
),
87 typedef Bool (*DestroySurfaceProc
)
88 (ScreenPtr pScreen
, Drawable id
, DrawablePtr pDrawable
,
89 void (*notify
)(void *arg
, void *data
), void *notify_data
);
92 * Quartz display mode function list
94 typedef struct _QuartzModeProcs
{
95 DisplayInitProc DisplayInit
;
96 AddScreenProc AddScreen
;
97 SetupScreenProc SetupScreen
;
98 InitInputProc InitInput
;
100 InitCursorProc InitCursor
;
102 SuspendScreenProc SuspendScreen
;
103 ResumeScreenProc ResumeScreen
;
105 AddPseudoramiXScreensProc AddPseudoramiXScreens
;
106 UpdateScreenProc UpdateScreen
;
108 IsX11WindowProc IsX11Window
;
109 HideWindowsProc HideWindows
;
111 FrameForWindowProc FrameForWindow
;
112 TopLevelParentProc TopLevelParent
;
113 CreateSurfaceProc CreateSurface
;
114 DestroySurfaceProc DestroySurface
;
115 } QuartzModeProcsRec
, *QuartzModeProcsPtr
;
117 extern QuartzModeProcsPtr quartzProcs
;
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? */
128 extern int32_t XQuartzShieldingWindowLevel
; /* CGShieldingWindowLevel() or 0 */
131 QuartzAddScreen(int index
, ScreenPtr pScreen
);
133 QuartzSetupScreen(int index
, ScreenPtr pScreen
);
135 QuartzInitOutput(int argc
, char **argv
);
137 QuartzInitInput(int argc
, char **argv
);
139 QuartzInitServer(int argc
, char **argv
, char **envp
);
143 QuartzProcessEvent(xEvent
*xe
);
145 QuartzUpdateScreens(void);
152 QuartzSetRootClip(BOOL enable
);
154 QuartzSpaceChanged(uint32_t space_id
);
157 QuartzSetRootless(Bool state
);
159 QuartzShowFullscreen(Bool state
);
162 server_main(int argc
, char **argv
, char **envp
);