1706f2543Smrg/* 2706f2543Smrg * Xephyr - A kdrive X server thats runs in a host X window. 3706f2543Smrg * Authored by Matthew Allum <mallum@o-hand.com> 4706f2543Smrg * 5706f2543Smrg * Copyright � 2004 Nokia 6706f2543Smrg * 7706f2543Smrg * Permission to use, copy, modify, distribute, and sell this software and its 8706f2543Smrg * documentation for any purpose is hereby granted without fee, provided that 9706f2543Smrg * the above copyright notice appear in all copies and that both that 10706f2543Smrg * copyright notice and this permission notice appear in supporting 11706f2543Smrg * documentation, and that the name of Nokia not be used in 12706f2543Smrg * advertising or publicity pertaining to distribution of the software without 13706f2543Smrg * specific, written prior permission. Nokia makes no 14706f2543Smrg * representations about the suitability of this software for any purpose. It 15706f2543Smrg * is provided "as is" without express or implied warranty. 16706f2543Smrg * 17706f2543Smrg * NOKIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 18706f2543Smrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 19706f2543Smrg * EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT OR 20706f2543Smrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 21706f2543Smrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 22706f2543Smrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 23706f2543Smrg * PERFORMANCE OF THIS SOFTWARE. 24706f2543Smrg */ 25706f2543Smrg 26706f2543Smrg#ifndef _EPHYR_H_ 27706f2543Smrg#define _EPHYR_H_ 28706f2543Smrg#include <stdio.h> 29706f2543Smrg#include <unistd.h> 30706f2543Smrg#include <signal.h> 31706f2543Smrg#include <libgen.h> 32706f2543Smrg 33706f2543Smrg#include "os.h" /* for OsSignal() */ 34706f2543Smrg#include "kdrive.h" 35706f2543Smrg#include "hostx.h" 36706f2543Smrg#include "exa.h" 37706f2543Smrg 38706f2543Smrg#ifdef RANDR 39706f2543Smrg#include "randrstr.h" 40706f2543Smrg#endif 41706f2543Smrg 42706f2543Smrg#include "damage.h" 43706f2543Smrg 44706f2543Smrgtypedef struct _ephyrPriv { 45706f2543Smrg CARD8 *base; 46706f2543Smrg int bytes_per_line; 47706f2543Smrg} EphyrPriv; 48706f2543Smrg 49706f2543Smrgtypedef struct _ephyrFakexaPriv { 50706f2543Smrg ExaDriverPtr exa; 51706f2543Smrg Bool is_synced; 52706f2543Smrg 53706f2543Smrg /* The following are arguments and other information from Prepare* calls 54706f2543Smrg * which are stored for use in the inner calls. 55706f2543Smrg */ 56706f2543Smrg int op; 57706f2543Smrg PicturePtr pSrcPicture, pMaskPicture, pDstPicture; 58706f2543Smrg void *saved_ptrs[3]; 59706f2543Smrg PixmapPtr pDst, pSrc, pMask; 60706f2543Smrg GCPtr pGC; 61706f2543Smrg} EphyrFakexaPriv; 62706f2543Smrg 63706f2543Smrgtypedef struct _ephyrScrPriv { 64706f2543Smrg Rotation randr; 65706f2543Smrg Bool shadow; 66706f2543Smrg DamagePtr pDamage; 67706f2543Smrg EphyrFakexaPriv *fakexa; 68706f2543Smrg} EphyrScrPriv; 69706f2543Smrg 70706f2543Smrgextern KdCardFuncs ephyrFuncs; 71706f2543Smrgextern KdKeyboardInfo *ephyrKbd; 72706f2543Smrgextern KdPointerInfo *ephyrMouse; 73706f2543Smrg 74706f2543Smrgextern miPointerScreenFuncRec ephyrPointerScreenFuncs; 75706f2543Smrg 76706f2543SmrgBool 77706f2543SmrgephyrInitialize (KdCardInfo *card, EphyrPriv *priv); 78706f2543Smrg 79706f2543SmrgBool 80706f2543SmrgephyrCardInit (KdCardInfo *card); 81706f2543Smrg 82706f2543SmrgBool 83706f2543SmrgephyrScreenInit (KdScreenInfo *screen); 84706f2543Smrg 85706f2543SmrgBool 86706f2543SmrgephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv); 87706f2543Smrg 88706f2543SmrgBool 89706f2543SmrgephyrInitScreen (ScreenPtr pScreen); 90706f2543Smrg 91706f2543SmrgBool 92706f2543SmrgephyrFinishInitScreen (ScreenPtr pScreen); 93706f2543Smrg 94706f2543SmrgBool 95706f2543SmrgephyrCreateResources (ScreenPtr pScreen); 96706f2543Smrg 97706f2543Smrgvoid 98706f2543SmrgephyrPreserve (KdCardInfo *card); 99706f2543Smrg 100706f2543SmrgBool 101706f2543SmrgephyrEnable (ScreenPtr pScreen); 102706f2543Smrg 103706f2543SmrgBool 104706f2543SmrgephyrDPMS (ScreenPtr pScreen, int mode); 105706f2543Smrg 106706f2543Smrgvoid 107706f2543SmrgephyrDisable (ScreenPtr pScreen); 108706f2543Smrg 109706f2543Smrgvoid 110706f2543SmrgephyrRestore (KdCardInfo *card); 111706f2543Smrg 112706f2543Smrgvoid 113706f2543SmrgephyrScreenFini (KdScreenInfo *screen); 114706f2543Smrg 115706f2543Smrgvoid 116706f2543SmrgephyrCardFini (KdCardInfo *card); 117706f2543Smrg 118706f2543Smrgvoid 119706f2543SmrgephyrGetColors (ScreenPtr pScreen, int n, xColorItem *pdefs); 120706f2543Smrg 121706f2543Smrgvoid 122706f2543SmrgephyrPutColors (ScreenPtr pScreen, int n, xColorItem *pdefs); 123706f2543Smrg 124706f2543SmrgBool 125706f2543SmrgephyrMapFramebuffer (KdScreenInfo *screen); 126706f2543Smrg 127706f2543Smrgvoid * 128706f2543SmrgephyrWindowLinear (ScreenPtr pScreen, 129706f2543Smrg CARD32 row, 130706f2543Smrg CARD32 offset, 131706f2543Smrg int mode, 132706f2543Smrg CARD32 *size, 133706f2543Smrg void *closure); 134706f2543Smrg 135706f2543Smrgvoid 136706f2543SmrgephyrSetScreenSizes (ScreenPtr pScreen); 137706f2543Smrg 138706f2543SmrgBool 139706f2543SmrgephyrUnmapFramebuffer (KdScreenInfo *screen); 140706f2543Smrg 141706f2543Smrgvoid 142706f2543SmrgephyrUnsetInternalDamage (ScreenPtr pScreen); 143706f2543Smrg 144706f2543SmrgBool 145706f2543SmrgephyrSetInternalDamage (ScreenPtr pScreen); 146706f2543Smrg 147706f2543SmrgBool 148706f2543SmrgephyrCreateColormap (ColormapPtr pmap); 149706f2543Smrg 150706f2543Smrgvoid 151706f2543SmrgephyrPoll(void); 152706f2543Smrg 153706f2543Smrg#ifdef RANDR 154706f2543SmrgBool 155706f2543SmrgephyrRandRGetInfo (ScreenPtr pScreen, Rotation *rotations); 156706f2543Smrg 157706f2543SmrgBool 158706f2543SmrgephyrRandRSetConfig (ScreenPtr pScreen, 159706f2543Smrg Rotation randr, 160706f2543Smrg int rate, 161706f2543Smrg RRScreenSizePtr pSize); 162706f2543SmrgBool 163706f2543SmrgephyrRandRInit (ScreenPtr pScreen); 164706f2543Smrg 165706f2543Smrgvoid 166706f2543SmrgephyrShadowUpdate (ScreenPtr pScreen, shadowBufPtr pBuf); 167706f2543Smrg 168706f2543Smrg#endif 169706f2543Smrg 170706f2543Smrgvoid 171706f2543SmrgephyrUpdateModifierState(unsigned int state); 172706f2543Smrg 173706f2543Smrgextern KdPointerDriver EphyrMouseDriver; 174706f2543Smrg 175706f2543Smrgextern KdKeyboardDriver EphyrKeyboardDriver; 176706f2543Smrg 177706f2543Smrgextern KdOsFuncs EphyrOsFuncs; 178706f2543Smrg 179706f2543Smrgextern Bool ephyrCursorInit(ScreenPtr pScreen); 180706f2543Smrg 181706f2543Smrgextern void ephyrCursorEnable(ScreenPtr pScreen); 182706f2543Smrg 183706f2543Smrgextern int ephyrBufferHeight(KdScreenInfo *screen); 184706f2543Smrg 185706f2543Smrg/* ephyr_draw.c */ 186706f2543Smrg 187706f2543SmrgBool 188706f2543SmrgephyrDrawInit(ScreenPtr pScreen); 189706f2543Smrg 190706f2543Smrgvoid 191706f2543SmrgephyrDrawEnable(ScreenPtr pScreen); 192706f2543Smrg 193706f2543Smrgvoid 194706f2543SmrgephyrDrawDisable(ScreenPtr pScreen); 195706f2543Smrg 196706f2543Smrgvoid 197706f2543SmrgephyrDrawFini(ScreenPtr pScreen); 198706f2543Smrg 199706f2543Smrg/*ephyvideo.c*/ 200706f2543Smrg 201706f2543SmrgBool ephyrInitVideo(ScreenPtr pScreen) ; 202706f2543Smrg 203706f2543Smrg#endif 204