Imported Upstream version 1.15.1
[deb_xorg-server.git] / hw / xquartz / quartz.h
CommitLineData
a09e091a
JB
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 */
48typedef void (*DisplayInitProc)(void);
49typedef Bool (*AddScreenProc)(int index, ScreenPtr pScreen);
50typedef Bool (*SetupScreenProc)(int index, ScreenPtr pScreen);
51typedef void (*InitInputProc)(int argc, char **argv);
52
53/*
54 * Cursor functions
55 */
56typedef Bool (*InitCursorProc)(ScreenPtr pScreen);
57
58/*
59 * Suspend and resume X11 activity
60 */
61typedef void (*SuspendScreenProc)(ScreenPtr pScreen);
62typedef void (*ResumeScreenProc)(ScreenPtr pScreen);
63
64/*
65 * Screen state change support
66 */
67typedef void (*AddPseudoramiXScreensProc)
68 (int *x, int *y, int *width, int *height, ScreenPtr pScreen);
69typedef void (*UpdateScreenProc)(ScreenPtr pScreen);
70
71/*
72 * Rootless helper functions
73 */
74typedef Bool (*IsX11WindowProc)(int windowNumber);
75typedef void (*HideWindowsProc)(Bool hide);
76
77/*
78 * Rootless functions for optional export to GLX layer
79 */
80typedef void * (*FrameForWindowProc)(WindowPtr pWin, Bool create);
81typedef WindowPtr (*TopLevelParentProc)(WindowPtr pWindow);
82typedef 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);
87typedef 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 */
94typedef 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
117extern QuartzModeProcsPtr quartzProcs;
118
119extern Bool XQuartzFullscreenVisible; /* Are the windows visible (predicated on !rootless) */
120extern Bool XQuartzServerVisible; /* Is the server visible ... TODO: Refactor to "active" */
121extern Bool XQuartzEnableKeyEquivalents;
122extern Bool XQuartzRootlessDefault; /* Is our default mode rootless? */
123extern Bool XQuartzIsRootless; /* Is our current mode rootless (or FS)? */
124extern Bool XQuartzFullscreenMenu; /* Show the menu bar (autohide) while in FS */
125extern Bool XQuartzFullscreenDisableHotkeys;
126extern Bool XQuartzOptionSendsAlt; /* Alt or Mode_switch? */
127
128extern int32_t XQuartzShieldingWindowLevel; /* CGShieldingWindowLevel() or 0 */
129
130Bool
131QuartzAddScreen(int index, ScreenPtr pScreen);
132Bool
133QuartzSetupScreen(int index, ScreenPtr pScreen);
134void
135QuartzInitOutput(int argc, char **argv);
136void
137QuartzInitInput(int argc, char **argv);
138void
139QuartzInitServer(int argc, char **argv, char **envp);
140void
141QuartzGiveUp(void);
142void
143QuartzProcessEvent(xEvent *xe);
144void
145QuartzUpdateScreens(void);
146
147void
148QuartzShow(void);
149void
150QuartzHide(void);
151void
152QuartzSetRootClip(BOOL enable);
153void
154QuartzSpaceChanged(uint32_t space_id);
155
156void
157QuartzSetRootless(Bool state);
158void
159QuartzShowFullscreen(Bool state);
160
161int
162server_main(int argc, char **argv, char **envp);
163#endif