2006-11-26 11:13:41 -07: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.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_XNEST_CONFIG_H
|
|
|
|
#include <xnest-config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <X11/X.h>
|
|
|
|
#include <X11/Xproto.h>
|
|
|
|
#include "scrnintstr.h"
|
|
|
|
#include "dix.h"
|
|
|
|
#include "mi.h"
|
|
|
|
#include "Xnest.h"
|
|
|
|
|
|
|
|
#include "Display.h"
|
|
|
|
#include "Visual.h"
|
|
|
|
|
|
|
|
Visual *
|
|
|
|
xnestVisual(VisualPtr pVisual)
|
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
int i;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
for (i = 0; i < xnestNumVisuals; i++)
|
|
|
|
if (pVisual->class == xnestVisuals[i].class &&
|
|
|
|
pVisual->bitsPerRGBValue == xnestVisuals[i].bits_per_rgb &&
|
|
|
|
pVisual->ColormapEntries == xnestVisuals[i].colormap_size &&
|
|
|
|
pVisual->nplanes == xnestVisuals[i].depth &&
|
|
|
|
pVisual->redMask == xnestVisuals[i].red_mask &&
|
|
|
|
pVisual->greenMask == xnestVisuals[i].green_mask &&
|
|
|
|
pVisual->blueMask == xnestVisuals[i].blue_mask)
|
|
|
|
return xnestVisuals[i].visual;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
return NULL;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
Visual *
|
|
|
|
xnestVisualFromID(ScreenPtr pScreen, VisualID visual)
|
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
int i;
|
2006-11-26 11:13:41 -07:00
|
|
|
|
2012-06-10 07:21:05 -06:00
|
|
|
for (i = 0; i < pScreen->numVisuals; i++)
|
|
|
|
if (pScreen->visuals[i].vid == visual)
|
|
|
|
return xnestVisual(&pScreen->visuals[i]);
|
|
|
|
|
|
|
|
return NULL;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
Colormap
|
2012-06-10 07:21:05 -06:00
|
|
|
xnestDefaultVisualColormap(Visual * visual)
|
2006-11-26 11:13:41 -07:00
|
|
|
{
|
2012-06-10 07:21:05 -06:00
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < xnestNumVisuals; i++)
|
|
|
|
if (xnestVisuals[i].visual == visual)
|
|
|
|
return xnestDefaultColormaps[i];
|
|
|
|
|
|
|
|
return None;
|
2006-11-26 11:13:41 -07:00
|
|
|
}
|