2
* Xephyr - A kdrive X server thats runs in a host X window.
3
* Authored by Matthew Allum <mallum@o-hand.com>
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.
27
#include <kdrive-config.h>
31
extern Window EphyrPreExistingHostWin;
41
KdCardInfoAdd (&ephyrFuncs, &attr, 0);
45
InitOutput (ScreenInfo *pScreenInfo, int argc, char **argv)
47
KdInitOutput (pScreenInfo, argc, argv);
51
InitInput (int argc, char **argv)
53
KdInitInput (&EphyrMouseFuncs, &EphyrKeyboardFuncs);
61
ErrorF("\nXephyr Option Usage:\n");
62
ErrorF("-parent XID Use existing window as Xephyr root win\n");
63
ErrorF("-host-cursor Re-use exisiting X host server cursor\n");
64
ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n");
71
ddxProcessArgument (int argc, char **argv, int i)
75
if (!strcmp (argv[i], "-parent"))
79
hostx_use_preexisting_window(strtol(argv[i+1], NULL, 0));
86
else if (!strcmp (argv[i], "-host-cursor"))
88
hostx_use_host_cursor();
91
else if (!strcmp (argv[i], "-fullscreen"))
93
hostx_use_fullscreen();
96
else if (argv[i][0] == ':')
98
hostx_set_display_name(argv[i]);
101
return KdProcessArgument (argc, argv, i);
109
if (hostx_want_host_cursor())
111
ephyrFuncs.initCursor = &ephyrCursorInit;
112
ephyrFuncs.enableCursor = &ephyrCursorEnable;
115
KdOsInit (&EphyrOsFuncs);
118
/* 'Fake' cursor stuff, could be improved */
121
ephyrRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
127
ephyrUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
133
ephyrSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
139
ephyrMoveCursor(ScreenPtr pScreen, int x, int y)
144
miPointerSpriteFuncRec EphyrPointerSpriteFuncs = {
146
ephyrUnrealizeCursor,
153
ephyrCursorInit(ScreenPtr pScreen)
155
miPointerInitialize(pScreen, &EphyrPointerSpriteFuncs,
156
&kdPointerScreenFuncs, FALSE);
162
ephyrCursorEnable(ScreenPtr pScreen)
167
KdCardFuncs ephyrFuncs = {
168
ephyrCardInit, /* cardinit */
169
ephyrScreenInit, /* scrinit */
170
ephyrInitScreen, /* initScreen */
171
ephyrFinishInitScreen, /* finishInitScreen */
172
ephyrCreateResources, /* createRes */
173
ephyrPreserve, /* preserve */
174
ephyrEnable, /* enable */
175
ephyrDPMS, /* dpms */
176
ephyrDisable, /* disable */
177
ephyrRestore, /* restore */
178
ephyrScreenFini, /* scrfini */
179
ephyrCardFini, /* cardfini */
182
0, /* enableCursor */
183
0, /* disableCursor */
185
0, /* recolorCursor */
189
0, /* disableAccel */
192
ephyrGetColors, /* getColors */
193
ephyrPutColors, /* putColors */