2003-11-14 16:54:54 +01:00
|
|
|
/* $Xorg: Init.c,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ */
|
|
|
|
/*
|
|
|
|
|
|
|
|
Copyright 1993 by Davor Matic
|
|
|
|
|
|
|
|
Permission to use, copy, modify, distribute, and sell this software
|
|
|
|
and its documentation for any purpose is hereby granted without fee,
|
|
|
|
provided that the above copyright notice appear in all copies and that
|
|
|
|
both that copyright notice and this permission notice appear in
|
|
|
|
supporting documentation. Davor Matic makes no representations about
|
|
|
|
the suitability of this software for any purpose. It is provided "as
|
|
|
|
is" without express or implied warranty.
|
|
|
|
|
|
|
|
*/
|
2004-04-23 21:54:30 +02:00
|
|
|
/* $XFree86: xc/programs/Xserver/hw/xnest/Init.c,v 3.24 2003/01/15 02:34:14 torrey Exp $ */
|
2003-11-14 17:49:22 +01:00
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
#include "X.h"
|
|
|
|
#include "Xproto.h"
|
|
|
|
#include "screenint.h"
|
|
|
|
#include "input.h"
|
|
|
|
#include "misc.h"
|
|
|
|
#include "scrnintstr.h"
|
|
|
|
#include "windowstr.h"
|
|
|
|
#include "servermd.h"
|
2003-11-14 17:49:22 +01:00
|
|
|
#include "mi.h"
|
|
|
|
#include "fontstruct.h"
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
#include "Xnest.h"
|
|
|
|
|
|
|
|
#include "Display.h"
|
|
|
|
#include "Screen.h"
|
|
|
|
#include "Pointer.h"
|
|
|
|
#include "Keyboard.h"
|
|
|
|
#include "Handlers.h"
|
|
|
|
#include "Init.h"
|
|
|
|
#include "Args.h"
|
|
|
|
#include "Drawable.h"
|
|
|
|
#include "XNGC.h"
|
|
|
|
#include "XNFont.h"
|
2003-11-25 20:29:01 +01:00
|
|
|
#ifdef DPMSExtension
|
|
|
|
#include "dpmsproc.h"
|
|
|
|
#endif
|
2003-11-14 16:54:54 +01:00
|
|
|
|
|
|
|
Bool xnestDoFullGeneration = True;
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
void
|
|
|
|
InitOutput(ScreenInfo *screenInfo, int argc, char *argv[])
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
xnestOpenDisplay(argc, argv);
|
|
|
|
|
|
|
|
screenInfo->imageByteOrder = ImageByteOrder(xnestDisplay);
|
|
|
|
screenInfo->bitmapScanlineUnit = BitmapUnit(xnestDisplay);
|
|
|
|
screenInfo->bitmapScanlinePad = BitmapPad(xnestDisplay);
|
|
|
|
screenInfo->bitmapBitOrder = BitmapBitOrder(xnestDisplay);
|
|
|
|
|
|
|
|
screenInfo->numPixmapFormats = 0;
|
|
|
|
for (i = 0; i < xnestNumPixmapFormats; i++)
|
|
|
|
for (j = 0; j < xnestNumDepths; j++)
|
2003-11-14 17:49:22 +01:00
|
|
|
if ((xnestPixmapFormats[i].depth == 1) ||
|
|
|
|
(xnestPixmapFormats[i].depth == xnestDepths[j])) {
|
2003-11-14 16:54:54 +01:00
|
|
|
screenInfo->formats[screenInfo->numPixmapFormats].depth =
|
|
|
|
xnestPixmapFormats[i].depth;
|
|
|
|
screenInfo->formats[screenInfo->numPixmapFormats].bitsPerPixel =
|
|
|
|
xnestPixmapFormats[i].bits_per_pixel;
|
|
|
|
screenInfo->formats[screenInfo->numPixmapFormats].scanlinePad =
|
|
|
|
xnestPixmapFormats[i].scanline_pad;
|
|
|
|
screenInfo->numPixmapFormats++;
|
2003-11-14 17:49:22 +01:00
|
|
|
break;
|
2003-11-14 16:54:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
xnestWindowPrivateIndex = AllocateWindowPrivateIndex();
|
|
|
|
xnestGCPrivateIndex = AllocateGCPrivateIndex();
|
|
|
|
xnestFontPrivateIndex = AllocateFontPrivateIndex();
|
|
|
|
|
|
|
|
if (!xnestNumScreens) xnestNumScreens = 1;
|
|
|
|
|
|
|
|
for (i = 0; i < xnestNumScreens; i++)
|
|
|
|
AddScreen(xnestOpenScreen, argc, argv);
|
|
|
|
|
|
|
|
xnestNumScreens = screenInfo->numScreens;
|
|
|
|
|
|
|
|
xnestDoFullGeneration = xnestFullGeneration;
|
|
|
|
}
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
void
|
|
|
|
InitInput(int argc, char *argv[])
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
2003-11-14 17:49:22 +01:00
|
|
|
pointer ptr, kbd;
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
ptr = AddInputDevice(xnestPointerProc, TRUE);
|
|
|
|
kbd = AddInputDevice(xnestKeyboardProc, TRUE);
|
|
|
|
|
|
|
|
RegisterPointerDevice(ptr);
|
|
|
|
RegisterKeyboardDevice(kbd);
|
|
|
|
|
|
|
|
mieqInit(kbd, ptr);
|
|
|
|
|
|
|
|
AddEnabledDevice(XConnectionNumber(xnestDisplay));
|
|
|
|
|
|
|
|
RegisterBlockAndWakeupHandlers(xnestBlockHandler, xnestWakeupHandler, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* DDX - specific abort routine. Called by AbortServer().
|
|
|
|
*/
|
|
|
|
void AbortDDX()
|
|
|
|
{
|
|
|
|
xnestDoFullGeneration = True;
|
|
|
|
xnestCloseDisplay();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Called by GiveUp(). */
|
|
|
|
void ddxGiveUp()
|
|
|
|
{
|
|
|
|
AbortDDX();
|
|
|
|
}
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
#ifdef __DARWIN__
|
|
|
|
void
|
|
|
|
DarwinHandleGUI(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void GlxExtensionInit();
|
|
|
|
void GlxWrapInitVisuals(void *procPtr);
|
|
|
|
|
|
|
|
void
|
|
|
|
DarwinGlxExtensionInit()
|
|
|
|
{
|
|
|
|
GlxExtensionInit();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
DarwinGlxWrapInitVisuals(
|
|
|
|
void *procPtr)
|
|
|
|
{
|
|
|
|
GlxWrapInitVisuals(procPtr);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
void OsVendorInit()
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-11-14 17:49:22 +01:00
|
|
|
void OsVendorFatalError()
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-06-21 15:44:14 +02:00
|
|
|
void ddxBeforeReset(void)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-11-14 16:54:54 +01:00
|
|
|
/* this is just to get the server to link on AIX */
|
|
|
|
#ifdef AIXV3
|
|
|
|
int SelectWaitTime = 10000; /* usec */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef DPMSExtension
|
|
|
|
/**************************************************************
|
|
|
|
* DPMSSet(), DPMSGet(), DPMSSupported()
|
|
|
|
*
|
|
|
|
* stubs
|
|
|
|
*
|
|
|
|
***************************************************************/
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
void
|
|
|
|
DPMSSet(int level)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
int
|
|
|
|
DPMSGet(int *level)
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2003-11-25 20:29:01 +01:00
|
|
|
Bool
|
|
|
|
DPMSSupported()
|
2003-11-14 16:54:54 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
#endif
|