2003-11-14 15:54:54 +00:00
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
*/
|
2024-07-30 13:09:49 +02:00
|
|
|
#include <dix-config.h>
|
2005-07-14 03:36:44 +00:00
|
|
|
|
2024-07-19 13:38:58 +02:00
|
|
|
#include <stddef.h>
|
2005-04-20 12:25:48 +00:00
|
|
|
#include <X11/X.h>
|
2024-02-15 19:39:49 +01:00
|
|
|
#include <X11/Xdefs.h>
|
2005-04-20 12:25:48 +00:00
|
|
|
#include <X11/Xproto.h>
|
2024-02-15 19:39:49 +01:00
|
|
|
#include <X11/fonts/fontstruct.h>
|
2024-07-19 13:38:58 +02:00
|
|
|
#include <X11/fonts/libxfont2.h>
|
2024-03-01 13:47:23 +01:00
|
|
|
|
|
|
|
|
#include "dix/screenint_priv.h"
|
2024-04-22 12:40:00 +02:00
|
|
|
#include "mi/mi_priv.h"
|
2024-02-22 17:32:26 +01:00
|
|
|
#include "os/ddx_priv.h"
|
2024-03-01 13:47:23 +01:00
|
|
|
|
2003-11-14 15:54:54 +00:00
|
|
|
#include "screenint.h"
|
|
|
|
|
#include "input.h"
|
2005-07-03 08:53:54 +00:00
|
|
|
#include "misc.h"
|
2003-11-14 15:54:54 +00:00
|
|
|
#include "scrnintstr.h"
|
|
|
|
|
#include "windowstr.h"
|
|
|
|
|
#include "servermd.h"
|
2015-09-01 18:50:55 -07:00
|
|
|
#include "dixfontstr.h"
|
2024-02-12 14:11:52 +01:00
|
|
|
#include "extinit_priv.h"
|
2003-11-14 15:54:54 +00:00
|
|
|
#include "Xnest.h"
|
|
|
|
|
|
|
|
|
|
#include "Display.h"
|
|
|
|
|
#include "Screen.h"
|
|
|
|
|
#include "Pointer.h"
|
|
|
|
|
#include "Keyboard.h"
|
|
|
|
|
#include "Handlers.h"
|
2015-12-07 15:11:33 -08:00
|
|
|
#include "Events.h"
|
2003-11-14 15:54:54 +00:00
|
|
|
#include "Init.h"
|
|
|
|
|
#include "Args.h"
|
|
|
|
|
#include "Drawable.h"
|
|
|
|
|
#include "XNGC.h"
|
|
|
|
|
#include "XNFont.h"
|
2003-11-25 19:29:01 +00:00
|
|
|
#ifdef DPMSExtension
|
|
|
|
|
#include "dpmsproc.h"
|
|
|
|
|
#endif
|
2003-11-14 15:54:54 +00:00
|
|
|
|
2024-08-21 16:53:50 +02:00
|
|
|
Bool xnestDoFullGeneration = TRUE;
|
2003-11-14 15:54:54 +00:00
|
|
|
|
2018-01-10 13:05:46 -05:00
|
|
|
#ifdef GLXEXT
|
|
|
|
|
void
|
|
|
|
|
GlxExtensionInit(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2003-11-25 19:29:01 +00:00
|
|
|
void
|
2013-12-15 01:56:36 -08:00
|
|
|
InitOutput(ScreenInfo * screen_info, int argc, char *argv[])
|
2003-11-14 15:54:54 +00:00
|
|
|
{
|
|
|
|
|
int i, j;
|
2012-03-21 12:55:09 -07:00
|
|
|
|
2003-11-14 15:54:54 +00:00
|
|
|
xnestOpenDisplay(argc, argv);
|
2012-03-21 12:55:09 -07:00
|
|
|
|
2013-12-15 01:56:36 -08:00
|
|
|
screen_info->imageByteOrder = ImageByteOrder(xnestDisplay);
|
|
|
|
|
screen_info->bitmapScanlineUnit = BitmapUnit(xnestDisplay);
|
|
|
|
|
screen_info->bitmapScanlinePad = BitmapPad(xnestDisplay);
|
|
|
|
|
screen_info->bitmapBitOrder = BitmapBitOrder(xnestDisplay);
|
2012-03-21 12:55:09 -07:00
|
|
|
|
2013-12-15 01:56:36 -08:00
|
|
|
screen_info->numPixmapFormats = 0;
|
2003-11-14 15:54:54 +00:00
|
|
|
for (i = 0; i < xnestNumPixmapFormats; i++)
|
|
|
|
|
for (j = 0; j < xnestNumDepths; j++)
|
2003-11-14 16:49:22 +00:00
|
|
|
if ((xnestPixmapFormats[i].depth == 1) ||
|
|
|
|
|
(xnestPixmapFormats[i].depth == xnestDepths[j])) {
|
2013-12-15 01:56:36 -08:00
|
|
|
screen_info->formats[screen_info->numPixmapFormats].depth =
|
2003-11-14 15:54:54 +00:00
|
|
|
xnestPixmapFormats[i].depth;
|
2013-12-15 01:56:36 -08:00
|
|
|
screen_info->formats[screen_info->numPixmapFormats].bitsPerPixel =
|
2003-11-14 15:54:54 +00:00
|
|
|
xnestPixmapFormats[i].bits_per_pixel;
|
2013-12-15 01:56:36 -08:00
|
|
|
screen_info->formats[screen_info->numPixmapFormats].scanlinePad =
|
2003-11-14 15:54:54 +00:00
|
|
|
xnestPixmapFormats[i].scanline_pad;
|
2013-12-15 01:56:36 -08:00
|
|
|
screen_info->numPixmapFormats++;
|
2003-11-14 16:49:22 +00:00
|
|
|
break;
|
2003-11-14 15:54:54 +00:00
|
|
|
}
|
2012-03-21 12:55:09 -07:00
|
|
|
|
2015-09-01 18:50:55 -07:00
|
|
|
xnestFontPrivateIndex = xfont2_allocate_font_private_index();
|
2012-03-21 12:55:09 -07:00
|
|
|
|
2003-11-14 15:54:54 +00:00
|
|
|
if (!xnestNumScreens)
|
|
|
|
|
xnestNumScreens = 1;
|
2012-03-21 12:55:09 -07:00
|
|
|
|
2003-11-14 15:54:54 +00:00
|
|
|
for (i = 0; i < xnestNumScreens; i++)
|
|
|
|
|
AddScreen(xnestOpenScreen, argc, argv);
|
2012-03-21 12:55:09 -07:00
|
|
|
|
2013-12-15 01:56:36 -08:00
|
|
|
xnestNumScreens = screen_info->numScreens;
|
2012-03-21 12:55:09 -07:00
|
|
|
|
2003-11-14 15:54:54 +00:00
|
|
|
xnestDoFullGeneration = xnestFullGeneration;
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-07 15:11:33 -08:00
|
|
|
static void
|
|
|
|
|
xnestNotifyConnection(int fd, int ready, void *data)
|
|
|
|
|
{
|
|
|
|
|
xnestCollectEvents();
|
|
|
|
|
}
|
|
|
|
|
|
2003-11-25 19:29:01 +00:00
|
|
|
void
|
|
|
|
|
InitInput(int argc, char *argv[])
|
2003-11-14 15:54:54 +00:00
|
|
|
{
|
2009-08-05 09:39:47 +10:00
|
|
|
int rc;
|
2012-03-21 12:55:09 -07:00
|
|
|
|
2009-08-05 09:39:47 +10:00
|
|
|
rc = AllocDevicePair(serverClient, "Xnest",
|
|
|
|
|
&xnestPointerDevice,
|
|
|
|
|
&xnestKeyboardDevice,
|
|
|
|
|
xnestPointerProc, xnestKeyboardProc, FALSE);
|
2003-11-14 16:49:22 +00:00
|
|
|
|
2009-08-05 09:39:47 +10:00
|
|
|
if (rc != Success)
|
|
|
|
|
FatalError("Failed to init Xnest default devices.\n");
|
2006-10-23 02:52:35 +03:00
|
|
|
|
|
|
|
|
mieqInit();
|
2003-11-14 15:54:54 +00:00
|
|
|
|
2015-12-07 15:11:33 -08:00
|
|
|
SetNotifyFd(XConnectionNumber(xnestDisplay), xnestNotifyConnection, X_NOTIFY_READ, NULL);
|
2003-11-14 15:54:54 +00:00
|
|
|
|
|
|
|
|
RegisterBlockAndWakeupHandlers(xnestBlockHandler, xnestWakeupHandler, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2010-01-15 15:22:02 +10:00
|
|
|
void
|
|
|
|
|
CloseInput(void)
|
|
|
|
|
{
|
2011-06-27 09:10:42 +10:00
|
|
|
mieqFini();
|
2010-01-15 15:22:02 +10:00
|
|
|
}
|
|
|
|
|
|
2011-07-20 13:09:05 +10:00
|
|
|
void
|
2017-11-20 14:28:13 -05:00
|
|
|
ddxGiveUp(enum ExitCode error)
|
2003-11-14 15:54:54 +00:00
|
|
|
{
|
2024-08-21 16:53:50 +02:00
|
|
|
xnestDoFullGeneration = TRUE;
|
2003-11-14 15:54:54 +00:00
|
|
|
xnestCloseDisplay();
|
|
|
|
|
}
|
|
|
|
|
|
2007-12-07 18:54:58 -08:00
|
|
|
#ifdef __APPLE__
|
2003-11-14 16:49:22 +00:00
|
|
|
void
|
|
|
|
|
DarwinHandleGUI(int argc, char *argv[])
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-01-11 08:40:47 +01:00
|
|
|
void
|
|
|
|
|
OsVendorInit(void)
|
2003-11-14 15:54:54 +00:00
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2009-01-11 08:40:47 +01:00
|
|
|
void
|
2012-02-17 12:35:02 -08:00
|
|
|
OsVendorFatalError(const char *f, va_list args)
|
2003-11-14 16:49:22 +00:00
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2009-01-11 08:40:58 +01:00
|
|
|
#if defined(DDXBEFORERESET)
|
2004-06-21 13:44:14 +00:00
|
|
|
void
|
|
|
|
|
ddxBeforeReset(void)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
2009-01-11 08:40:58 +01:00
|
|
|
#endif
|
2019-02-21 15:22:57 -08:00
|
|
|
|
|
|
|
|
#if INPUTTHREAD
|
|
|
|
|
/** This function is called in Xserver/os/inputthread.c when starting
|
|
|
|
|
the input thread. */
|
|
|
|
|
void
|
|
|
|
|
ddxInputThreadInit(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
#endif
|