Esempio n. 1
0
 /*ARGSUSED*/ void
InitExtensions(int argc, char *argv[])
{
    if (!noGEExtension)
        GEExtensionInit();

#ifdef PANORAMIX
    if (!noPanoramiXExtension)
        PanoramiXExtensionInit();
#endif
#ifdef INXQUARTZ
    if (!noPseudoramiXExtension)
        PseudoramiXExtensionInit();
#endif
    ShapeExtensionInit();
#ifdef MITSHM
    if (!noMITShmExtension)
        ShmExtensionInit();
#endif
    XInputExtensionInit();
#ifdef XTEST
    if (!noTestExtensions)
        XTestExtensionInit();
#endif
    BigReqExtensionInit();
#if defined(SCREENSAVER)
    if (!noScreenSaverExtension)
        ScreenSaverExtensionInit();
#endif
#ifdef XV
    if (!noXvExtension) {
        XvExtensionInit();
        XvMCExtensionInit();
    }
#endif
    SyncExtensionInit();
    XkbExtensionInit();
    XCMiscExtensionInit();
#ifdef XRECORD
    if (!noTestExtensions)
        RecordExtensionInit();
#endif
#ifdef DBE
    if (!noDbeExtension)
        DbeExtensionInit();
#endif
#ifdef XCSECURITY
    if (!noSecurityExtension)
        SecurityExtensionInit();
#endif
#ifdef XSELINUX
    if (!noSELinuxExtension)
        SELinuxExtensionInit();
#endif
#if defined(DPMSExtension) && !defined(NO_HW_ONLY_EXTS)
    if (!noDPMSExtension)
        DPMSExtensionInit();
#endif
#ifdef XF86BIGFONT
    if (!noXFree86BigfontExtension)
        XFree86BigfontExtensionInit();
#endif
#if !defined(NO_HW_ONLY_EXTS)
#if defined(XF86VIDMODE)
    if (!noXFree86VidModeExtension)
        XFree86VidModeExtensionInit();
#endif
#if defined(XFreeXDGA)
    if (!noXFree86DGAExtension)
        XFree86DGAExtensionInit();
#endif
#ifdef XF86DRI
    if (!noXFree86DRIExtension)
        XFree86DRIExtensionInit();
#endif
#endif
#ifdef XFIXES
    /* must be before Render to layer DisplayCursor correctly */
    if (!noXFixesExtension)
        XFixesExtensionInit();
#endif
    if (!noRenderExtension)
        RenderExtensionInit();
#ifdef RANDR
    if (!noRRExtension)
        RRExtensionInit();
#endif
#ifdef RES
    if (!noResExtension)
        ResExtensionInit();
#endif
#ifdef DMXEXT
    DMXExtensionInit();         /* server-specific extension, cannot be disabled */
#endif
#ifdef COMPOSITE
    if (!noCompositeExtension)
        CompositeExtensionInit();
#endif
#ifdef DAMAGE
    if (!noDamageExtension)
        DamageExtensionInit();
#endif

#ifdef GLXEXT
    if (serverGeneration == 1)
        GlxPushProvider(&__glXDRISWRastProvider);
    if (!noGlxExtension)
        GlxExtensionInit();
#endif
}
Esempio n. 2
0
void
InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
{
    int i;

    if (serverGeneration == 1)
        XwinExtensionInit();

    /* Log the command line */
    winLogCommandLine(argc, argv);

#if CYGDEBUG
    winDebug("InitOutput\n");
#endif

    /* Validate command-line arguments */
    if (serverGeneration == 1 && !winValidateArgs()) {
        FatalError("InitOutput - Invalid command-line arguments found.  "
                   "Exiting.\n");
    }

    /* Check for duplicate invocation on same display number. */
    if (serverGeneration == 1 && !winCheckDisplayNumber()) {
        if (g_fSilentDupError)
            g_fSilentFatalError = TRUE;
        FatalError("InitOutput - Duplicate invocation on display "
                   "number: %s.  Exiting.\n", display);
    }

#ifdef XWIN_XF86CONFIG
    /* Try to read the xorg.conf-style configuration file */
    if (!winReadConfigfile())
        winErrorFVerb(1, "InitOutput - Error reading config file\n");
#else
    winMsg(X_INFO, "xorg.conf is not supported\n");
    winMsg(X_INFO, "See http://x.cygwin.com/docs/faq/cygwin-x-faq.html "
           "for more information\n");
    winConfigFiles();
#endif

    /* Load preferences from XWinrc file */
    LoadPreferences();

    /* Setup global screen info parameters */
    pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
    pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
    pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
    pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
    pScreenInfo->numPixmapFormats = NUMFORMATS;

    /* Describe how we want common pixmap formats padded */
    for (i = 0; i < NUMFORMATS; i++) {
        pScreenInfo->formats[i] = g_PixmapFormats[i];
    }

    /* Load pointers to DirectDraw functions */
    winGetDDProcAddresses();

    /* Detect supported engines */
    winDetectSupportedEngines();
#ifdef XWIN_MULTIWINDOW
    /* Load libraries for taskbar grouping */
    winPropertyStoreInit();
#endif

    /* Store the instance handle */
    g_hInstance = GetModuleHandle(NULL);

    /* Create the messaging window */
    if (serverGeneration == 1)
        winCreateMsgWindowThread();

    /* Initialize each screen */
    for (i = 0; i < g_iNumScreens; ++i) {
        /* Initialize the screen */
        if (-1 == AddScreen(winScreenInit, argc, argv)) {
            FatalError("InitOutput - Couldn't add screen %d", i);
        }
    }

  /*
     Unless full xinerama has been explicitly enabled, register all native screens with pseudoramiX
  */
  if (!noPanoramiXExtension)
      noPseudoramiXExtension = TRUE;

  if ((g_ScreenInfo[0].fMultipleMonitors) && !noPseudoramiXExtension)
    {
      int pass;

      PseudoramiXExtensionInit();

      /* Add primary monitor on pass 0, other monitors on pass 1, to ensure
       the primary monitor is first in XINERAMA list */
      for (pass = 0; pass < 2; pass++)
        {
          int iMonitor;

          for (iMonitor = 1; ; iMonitor++)
            {
              struct GetMonitorInfoData data;
              QueryMonitor(iMonitor, &data);
              if (data.bMonitorSpecifiedExists)
                {
                  MONITORINFO mi;
                  mi.cbSize = sizeof(MONITORINFO);

                  if (GetMonitorInfo(data.monitorHandle, &mi))
                    {
                      /* pass == 1 XOR primary monitor flags is set */
                      if ((!(pass == 1)) != (!(mi.dwFlags & MONITORINFOF_PRIMARY)))
                        {
                          /*
                            Note the screen origin in a normalized coordinate space where (0,0) is at the top left
                            of the native virtual desktop area
                          */
                          data.monitorOffsetX = data.monitorOffsetX - GetSystemMetrics(SM_XVIRTUALSCREEN);
                          data.monitorOffsetY = data.monitorOffsetY - GetSystemMetrics(SM_YVIRTUALSCREEN);

                          winDebug ("InitOutput - screen %d added at virtual desktop coordinate (%d,%d) (pseudoramiX) \n",
                                    iMonitor-1, data.monitorOffsetX, data.monitorOffsetY);

                          PseudoramiXAddScreen(data.monitorOffsetX, data.monitorOffsetY,
                                               data.monitorWidth, data.monitorHeight);
                        }
                    }
                }
              else
                break;
            }
        }
    }

#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)

    /* Generate a cookie used by internal clients for authorization */
    if (g_fXdmcpEnabled || g_fAuthEnabled)
        winGenerateAuthorization();

    /* Perform some one time initialization */
    if (1 == serverGeneration) {
        /*
         * setlocale applies to all threads in the current process.
         * Apply locale specified in LANG environment variable.
         */
        setlocale(LC_ALL, "");
    }
#endif

#if CYGDEBUG || YES
    winDebug("InitOutput - Returning.\n");
#endif
}