45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * quartz.h
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * External interface of the Quartz display modes seen by the generic, mode
45e9809aff7304721fddb95654901b32195c9c7avboxsync * independent parts of the Darwin X server.
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * All Rights Reserved.
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Permission is hereby granted, free of charge, to any person obtaining a
45e9809aff7304721fddb95654901b32195c9c7avboxsync * copy of this software and associated documentation files (the "Software"),
45e9809aff7304721fddb95654901b32195c9c7avboxsync * to deal in the Software without restriction, including without limitation
45e9809aff7304721fddb95654901b32195c9c7avboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * and/or sell copies of the Software, and to permit persons to whom the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Software is furnished to do so, subject to the following conditions:
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * The above copyright notice and this permission notice shall be included in
45e9809aff7304721fddb95654901b32195c9c7avboxsync * all copies or substantial portions of the Software.
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45e9809aff7304721fddb95654901b32195c9c7avboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
45e9809aff7304721fddb95654901b32195c9c7avboxsync * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
45e9809aff7304721fddb95654901b32195c9c7avboxsync * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
45e9809aff7304721fddb95654901b32195c9c7avboxsync * DEALINGS IN THE SOFTWARE.
45e9809aff7304721fddb95654901b32195c9c7avboxsync *
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Except as contained in this notice, the name(s) of the above copyright
45e9809aff7304721fddb95654901b32195c9c7avboxsync * holders shall not be used in advertising or otherwise to promote the sale,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * use or other dealings in this Software without prior written authorization.
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#ifndef _QUARTZ_H
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define _QUARTZ_H
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "quartzPasteboard.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "screenint.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync#include "window.h"
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*------------------------------------------
45e9809aff7304721fddb95654901b32195c9c7avboxsync Quartz display mode function types
45e9809aff7304721fddb95654901b32195c9c7avboxsync ------------------------------------------*/
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Display mode initialization
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*DisplayInitProc)(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef Bool (*AddScreenProc)(int index, ScreenPtr pScreen);
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef Bool (*SetupScreenProc)(int index, ScreenPtr pScreen);
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*InitInputProc)(int argc, char **argv);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Cursor functions
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef Bool (*InitCursorProc)(ScreenPtr pScreen);
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*CursorUpdateProc)(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Suspend and resume X11 activity
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*SuspendScreenProc)(ScreenPtr pScreen);
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*ResumeScreenProc)(ScreenPtr pScreen, int x, int y);
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*CaptureScreensProc)(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*ReleaseScreensProc)(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Screen state change support
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*ScreenChangedProc)(void);
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*AddPseudoramiXScreensProc)(int *x, int *y, int *width, int *height);
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*UpdateScreenProc)(ScreenPtr pScreen);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Rootless helper functions
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef Bool (*IsX11WindowProc)(void *nsWindow, int windowNumber);
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void (*HideWindowsProc)(Bool hide);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Rootless functions for optional export to GLX layer
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef void * (*FrameForWindowProc)(WindowPtr pWin, Bool create);
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef WindowPtr (*TopLevelParentProc)(WindowPtr pWindow);
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef Bool (*CreateSurfaceProc)
45e9809aff7304721fddb95654901b32195c9c7avboxsync (ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int client_id, unsigned int *surface_id,
45e9809aff7304721fddb95654901b32195c9c7avboxsync unsigned int key[2], void (*notify) (void *arg, void *data),
45e9809aff7304721fddb95654901b32195c9c7avboxsync void *notify_data);
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef Bool (*DestroySurfaceProc)
45e9809aff7304721fddb95654901b32195c9c7avboxsync (ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable,
45e9809aff7304721fddb95654901b32195c9c7avboxsync void (*notify) (void *arg, void *data), void *notify_data);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Quartz display mode function list
45e9809aff7304721fddb95654901b32195c9c7avboxsync */
45e9809aff7304721fddb95654901b32195c9c7avboxsynctypedef struct _QuartzModeProcs {
45e9809aff7304721fddb95654901b32195c9c7avboxsync DisplayInitProc DisplayInit;
45e9809aff7304721fddb95654901b32195c9c7avboxsync AddScreenProc AddScreen;
45e9809aff7304721fddb95654901b32195c9c7avboxsync SetupScreenProc SetupScreen;
45e9809aff7304721fddb95654901b32195c9c7avboxsync InitInputProc InitInput;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync InitCursorProc InitCursor;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CursorUpdateProc CursorUpdate; // Not used if NULL
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync SuspendScreenProc SuspendScreen;
45e9809aff7304721fddb95654901b32195c9c7avboxsync ResumeScreenProc ResumeScreen;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CaptureScreensProc CaptureScreens; // Only called in fullscreen
45e9809aff7304721fddb95654901b32195c9c7avboxsync ReleaseScreensProc ReleaseScreens; // Only called in fullscreen
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync ScreenChangedProc ScreenChanged;
45e9809aff7304721fddb95654901b32195c9c7avboxsync AddPseudoramiXScreensProc AddPseudoramiXScreens;
45e9809aff7304721fddb95654901b32195c9c7avboxsync UpdateScreenProc UpdateScreen;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync IsX11WindowProc IsX11Window;
45e9809aff7304721fddb95654901b32195c9c7avboxsync HideWindowsProc HideWindows;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync FrameForWindowProc FrameForWindow;
45e9809aff7304721fddb95654901b32195c9c7avboxsync TopLevelParentProc TopLevelParent;
45e9809aff7304721fddb95654901b32195c9c7avboxsync CreateSurfaceProc CreateSurface;
45e9809aff7304721fddb95654901b32195c9c7avboxsync DestroySurfaceProc DestroySurface;
45e9809aff7304721fddb95654901b32195c9c7avboxsync} QuartzModeProcsRec, *QuartzModeProcsPtr;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern QuartzModeProcsPtr quartzProcs;
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsyncBool QuartzLoadDisplayBundle(const char *dpyBundleName);
45e9809aff7304721fddb95654901b32195c9c7avboxsync
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif