#ifdef HAVE_CONFIG_H
#include <kdrive-config.h>
#endif
#include "ephyr.h"
extern Window EphyrPreExistingHostWin;
extern Bool EphyrWantGrayScale;
void
InitCard (char *name)
{
KdCardAttr attr;
EPHYR_DBG("mark");
KdCardInfoAdd (&ephyrFuncs, &attr, 0);
}
void
InitOutput (ScreenInfo *pScreenInfo, int argc, char **argv)
{
KdInitOutput (pScreenInfo, argc, argv);
}
void
InitInput (int argc, char **argv)
{
KdInitInput (&EphyrMouseFuncs, &EphyrKeyboardFuncs);
}
void
ddxUseMsg (void)
{
KdUseMsg();
ErrorF("\nXephyr Option Usage:\n");
ErrorF("-parent XID Use existing window as Xephyr root win\n");
ErrorF("-host-cursor Re-use exisiting X host server cursor\n");
ErrorF("-fullscreen Attempt to run Xephyr fullscreen\n");
ErrorF("-grayscale Simulate 8bit grayscale\n");
ErrorF("-fakexa Simulate acceleration using software rendering\n");
ErrorF("\n");
exit(1);
}
int
ddxProcessArgument (int argc, char **argv, int i)
{
EPHYR_DBG("mark");
if (!strcmp (argv[i], "-parent"))
{
if(i+1 < argc)
{
hostx_use_preexisting_window(strtol(argv[i+1], NULL, 0));
return 2;
}
UseMsg();
exit(1);
}
else if (!strcmp (argv[i], "-host-cursor"))
{
hostx_use_host_cursor();
return 1;
}
else if (!strcmp (argv[i], "-fullscreen"))
{
hostx_use_fullscreen();
return 1;
}
else if (!strcmp (argv[i], "-grayscale"))
{
EphyrWantGrayScale = 1;
return 1;
}
else if (!strcmp (argv[i], "-fakexa"))
{
ephyrFuncs.initAccel = ephyrDrawInit;
ephyrFuncs.enableAccel = ephyrDrawEnable;
ephyrFuncs.disableAccel = ephyrDrawDisable;
ephyrFuncs.finiAccel = ephyrDrawFini;
return 1;
}
else if (argv[i][0] == ':')
{
hostx_set_display_name(argv[i]);
}
return KdProcessArgument (argc, argv, i);
}
void
OsVendorInit (void)
{
EPHYR_DBG("mark");
if (hostx_want_host_cursor())
{
ephyrFuncs.initCursor = &ephyrCursorInit;
ephyrFuncs.enableCursor = &ephyrCursorEnable;
}
KdOsInit (&EphyrOsFuncs);
}
static Bool
ephyrRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
{
return TRUE;
}
static Bool
ephyrUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
{
return TRUE;
}
static void
ephyrSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
{
;
}
static void
ephyrMoveCursor(ScreenPtr pScreen, int x, int y)
{
;
}
miPointerSpriteFuncRec EphyrPointerSpriteFuncs = {
ephyrRealizeCursor,
ephyrUnrealizeCursor,
ephyrSetCursor,
ephyrMoveCursor,
};
Bool
ephyrCursorInit(ScreenPtr pScreen)
{
miPointerInitialize(pScreen, &EphyrPointerSpriteFuncs,
&kdPointerScreenFuncs, FALSE);
return TRUE;
}
void
ephyrCursorEnable(ScreenPtr pScreen)
{
;
}
KdCardFuncs ephyrFuncs = {
ephyrCardInit,
ephyrScreenInit,
ephyrInitScreen,
ephyrFinishInitScreen,
ephyrCreateResources,
ephyrPreserve,
ephyrEnable,
ephyrDPMS,
ephyrDisable,
ephyrRestore,
ephyrScreenFini,
ephyrCardFini,
0,
0,
0,
0,
0,
0,
0,
0,
0,
ephyrGetColors,
ephyrPutColors,
};