Imported Debian patch 2:1.15.1-0ubuntu2.6
[deb_xorg-server.git] / hw / kdrive / ephyr / ephyr.h
CommitLineData
a09e091a
JB
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
6 *
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.
16 *
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.
24 */
25
26#ifndef _EPHYR_H_
27#define _EPHYR_H_
28#include <stdio.h>
29#include <unistd.h>
30#include <signal.h>
31#include <libgen.h>
32#include <xcb/xcb_image.h>
33
34#include "os.h" /* for OsSignal() */
35#include "kdrive.h"
36#include "hostx.h"
37#include "exa.h"
38
39#ifdef RANDR
40#include "randrstr.h"
41#endif
42
43#include "damage.h"
44
45typedef struct _ephyrPriv {
46 CARD8 *base;
47 int bytes_per_line;
48} EphyrPriv;
49
50typedef struct _ephyrFakexaPriv {
51 ExaDriverPtr exa;
52 Bool is_synced;
53
54 /* The following are arguments and other information from Prepare* calls
55 * which are stored for use in the inner calls.
56 */
57 int op;
58 PicturePtr pSrcPicture, pMaskPicture, pDstPicture;
59 void *saved_ptrs[3];
60 PixmapPtr pDst, pSrc, pMask;
61 GCPtr pGC;
62} EphyrFakexaPriv;
63
64typedef struct _ephyrScrPriv {
65 /* ephyr server info */
66 Rotation randr;
67 Bool shadow;
68 DamagePtr pDamage;
69 EphyrFakexaPriv *fakexa;
70
71 /* Host X window info */
72 xcb_window_t win;
73 xcb_window_t win_pre_existing; /* Set via -parent option like xnest */
74 xcb_window_t peer_win; /* Used for GL; should be at most one */
75 xcb_image_t *ximg;
76 int win_width, win_height;
77 int server_depth;
78 unsigned char *fb_data; /* only used when host bpp != server bpp */
79 xcb_shm_segment_info_t shminfo;
80
81 KdScreenInfo *screen;
82 int mynum; /* Screen number */
83} EphyrScrPriv;
84
85extern KdCardFuncs ephyrFuncs;
86extern KdKeyboardInfo *ephyrKbd;
87extern KdPointerInfo *ephyrMouse;
88
89extern miPointerScreenFuncRec ephyrPointerScreenFuncs;
90
91Bool
92 ephyrInitialize(KdCardInfo * card, EphyrPriv * priv);
93
94Bool
95 ephyrCardInit(KdCardInfo * card);
96
97Bool
98ephyrScreenInitialize(KdScreenInfo *screen);
99
100Bool
101 ephyrInitScreen(ScreenPtr pScreen);
102
103Bool
104 ephyrFinishInitScreen(ScreenPtr pScreen);
105
106Bool
107 ephyrCreateResources(ScreenPtr pScreen);
108
109void
110 ephyrPreserve(KdCardInfo * card);
111
112Bool
113 ephyrEnable(ScreenPtr pScreen);
114
115Bool
116 ephyrDPMS(ScreenPtr pScreen, int mode);
117
118void
119 ephyrDisable(ScreenPtr pScreen);
120
121void
122 ephyrRestore(KdCardInfo * card);
123
124void
125 ephyrScreenFini(KdScreenInfo * screen);
126
127void
128 ephyrCardFini(KdCardInfo * card);
129
130void
131 ephyrGetColors(ScreenPtr pScreen, int n, xColorItem * pdefs);
132
133void
134 ephyrPutColors(ScreenPtr pScreen, int n, xColorItem * pdefs);
135
136Bool
137 ephyrMapFramebuffer(KdScreenInfo * screen);
138
139void *ephyrWindowLinear(ScreenPtr pScreen,
140 CARD32 row,
141 CARD32 offset, int mode, CARD32 *size, void *closure);
142
143void
144 ephyrSetScreenSizes(ScreenPtr pScreen);
145
146Bool
147 ephyrUnmapFramebuffer(KdScreenInfo * screen);
148
149void
150 ephyrUnsetInternalDamage(ScreenPtr pScreen);
151
152Bool
153 ephyrSetInternalDamage(ScreenPtr pScreen);
154
155Bool
156 ephyrCreateColormap(ColormapPtr pmap);
157
158void
159 ephyrPoll(void);
160
161#ifdef RANDR
162Bool
163 ephyrRandRGetInfo(ScreenPtr pScreen, Rotation * rotations);
164
165Bool
166
167ephyrRandRSetConfig(ScreenPtr pScreen,
168 Rotation randr, int rate, RRScreenSizePtr pSize);
169Bool
170 ephyrRandRInit(ScreenPtr pScreen);
171
172void
173 ephyrShadowUpdate(ScreenPtr pScreen, shadowBufPtr pBuf);
174
175#endif
176
177void
178 ephyrUpdateModifierState(unsigned int state);
179
180extern KdPointerDriver EphyrMouseDriver;
181
182extern KdKeyboardDriver EphyrKeyboardDriver;
183
184extern KdOsFuncs EphyrOsFuncs;
185
186extern Bool ephyrCursorInit(ScreenPtr pScreen);
187
188extern void ephyrCursorEnable(ScreenPtr pScreen);
189
190extern int ephyrBufferHeight(KdScreenInfo * screen);
191
192/* ephyr_draw.c */
193
194Bool
195 ephyrDrawInit(ScreenPtr pScreen);
196
197void
198 ephyrDrawEnable(ScreenPtr pScreen);
199
200void
201 ephyrDrawDisable(ScreenPtr pScreen);
202
203void
204 ephyrDrawFini(ScreenPtr pScreen);
205
206/*ephyvideo.c*/
207
208Bool ephyrInitVideo(ScreenPtr pScreen);
209
210#endif