First import
[xorg_rtime.git] / xorg-server-1.4 / hw / kdrive / ephyr / ephyr.h
blobf49d920d16c7cc11042d269f7ed9a78cb74f84d1
1 /*
2 * Xephyr - A kdrive X server thats runs in a host X window.
3 * Authored by Matthew Allum <mallum@o-hand.com>
4 *
5 * Copyright © 2004 Nokia
7 * Permission to use, copy, modify, distribute, and sell this software and its
8 * documentation for any purpose is hereby granted without fee, provided that
9 * the above copyright notice appear in all copies and that both that
10 * copyright notice and this permission notice appear in supporting
11 * documentation, and that the name of Nokia not be used in
12 * advertising or publicity pertaining to distribution of the software without
13 * specific, written prior permission. Nokia makes no
14 * representations about the suitability of this software for any purpose. It
15 * is provided "as is" without express or implied warranty.
17 * NOKIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
18 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
19 * EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT OR
20 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
21 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
22 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23 * PERFORMANCE OF THIS SOFTWARE.
26 #ifndef _EPHYR_H_
27 #define _EPHYR_H_
28 #include <stdio.h>
29 #include <unistd.h>
30 #include <signal.h>
32 #include "os.h" /* for OsSignal() */
33 #include "kdrive.h"
34 #include "hostx.h"
35 #include "exa.h"
37 #ifdef RANDR
38 #include "randrstr.h"
39 #endif
41 #include "damage.h"
43 typedef struct _ephyrPriv {
44 CARD8 *base;
45 int bytes_per_line;
46 } EphyrPriv;
48 typedef struct _ephyrFakexaPriv {
49 ExaDriverPtr exa;
50 Bool is_synced;
52 /* The following are arguments and other information from Prepare* calls
53 * which are stored for use in the inner calls.
55 int op;
56 PicturePtr pSrcPicture, pMaskPicture, pDstPicture;
57 void *saved_ptrs[3];
58 PixmapPtr pDst, pSrc, pMask;
59 GCPtr pGC;
60 } EphyrFakexaPriv;
62 typedef struct _ephyrScrPriv {
63 Rotation randr;
64 Bool shadow;
65 PixmapPtr pShadow;
66 DamagePtr pDamage;
67 EphyrFakexaPriv *fakexa;
68 } EphyrScrPriv;
70 extern KdCardFuncs ephyrFuncs;
71 extern KdKeyboardInfo *ephyrKbd;
72 extern KdPointerInfo *ephyrMouse;
74 Bool
75 ephyrInitialize (KdCardInfo *card, EphyrPriv *priv);
77 Bool
78 ephyrCardInit (KdCardInfo *card);
80 Bool
81 ephyrScreenInit (KdScreenInfo *screen);
83 Bool
84 ephyrScreenInitialize (KdScreenInfo *screen, EphyrScrPriv *scrpriv);
86 Bool
87 ephyrInitScreen (ScreenPtr pScreen);
89 Bool
90 ephyrFinishInitScreen (ScreenPtr pScreen);
92 Bool
93 ephyrCreateResources (ScreenPtr pScreen);
95 void
96 ephyrPreserve (KdCardInfo *card);
98 Bool
99 ephyrEnable (ScreenPtr pScreen);
101 Bool
102 ephyrDPMS (ScreenPtr pScreen, int mode);
104 void
105 ephyrDisable (ScreenPtr pScreen);
107 void
108 ephyrRestore (KdCardInfo *card);
110 void
111 ephyrScreenFini (KdScreenInfo *screen);
113 void
114 ephyrCardFini (KdCardInfo *card);
116 void
117 ephyrGetColors (ScreenPtr pScreen, int fb, int n, xColorItem *pdefs);
119 void
120 ephyrPutColors (ScreenPtr pScreen, int fb, int n, xColorItem *pdefs);
122 Bool
123 ephyrMapFramebuffer (KdScreenInfo *screen);
125 void *
126 ephyrWindowLinear (ScreenPtr pScreen,
127 CARD32 row,
128 CARD32 offset,
129 int mode,
130 CARD32 *size,
131 void *closure);
133 void
134 ephyrSetScreenSizes (ScreenPtr pScreen);
136 Bool
137 ephyrUnmapFramebuffer (KdScreenInfo *screen);
139 void
140 ephyrUnsetInternalDamage (ScreenPtr pScreen);
142 Bool
143 ephyrSetInternalDamage (ScreenPtr pScreen);
145 Bool
146 ephyrCreateColormap (ColormapPtr pmap);
148 void
149 ephyrPoll(void);
151 #ifdef RANDR
152 Bool
153 ephyrRandRGetInfo (ScreenPtr pScreen, Rotation *rotations);
155 Bool
156 ephyrRandRSetConfig (ScreenPtr pScreen,
157 Rotation randr,
158 int rate,
159 RRScreenSizePtr pSize);
160 Bool
161 ephyrRandRInit (ScreenPtr pScreen);
163 void
164 ephyrShadowUpdate (ScreenPtr pScreen, shadowBufPtr pBuf);
166 #endif
168 void
169 ephyrUpdateModifierState(unsigned int state);
171 extern KdPointerDriver EphyrMouseDriver;
173 extern KdKeyboardDriver EphyrKeyboardDriver;
175 extern KdOsFuncs EphyrOsFuncs;
177 extern Bool ephyrCursorInit(ScreenPtr pScreen);
179 extern void ephyrCursorEnable(ScreenPtr pScreen);
181 /* ephyr_draw.c */
183 Bool
184 ephyrDrawInit(ScreenPtr pScreen);
186 void
187 ephyrDrawEnable(ScreenPtr pScreen);
189 void
190 ephyrDrawDisable(ScreenPtr pScreen);
192 void
193 ephyrDrawFini(ScreenPtr pScreen);
195 #endif