3 Copyright 1993 by Davor Matic
5 Permission to use, copy, modify, distribute, and sell this software
6 and its documentation for any purpose is hereby granted without fee,
7 provided that the above copyright notice appear in all copies and that
8 both that copyright notice and this permission notice appear in
9 supporting documentation. Davor Matic makes no representations about
10 the suitability of this software for any purpose. It is provided "as
11 is" without express or implied warranty.
15 #ifdef HAVE_XNEST_CONFIG_H
16 #include <xnest-config.h>
20 #include <X11/Xproto.h>
21 #include "scrnintstr.h"
30 xnestVisual(VisualPtr pVisual
)
34 for (i
= 0; i
< xnestNumVisuals
; i
++)
35 if (pVisual
->class == xnestVisuals
[i
].class &&
36 pVisual
->bitsPerRGBValue
== xnestVisuals
[i
].bits_per_rgb
&&
37 pVisual
->ColormapEntries
== xnestVisuals
[i
].colormap_size
&&
38 pVisual
->nplanes
== xnestVisuals
[i
].depth
&&
39 pVisual
->redMask
== xnestVisuals
[i
].red_mask
&&
40 pVisual
->greenMask
== xnestVisuals
[i
].green_mask
&&
41 pVisual
->blueMask
== xnestVisuals
[i
].blue_mask
)
42 return xnestVisuals
[i
].visual
;
48 xnestVisualFromID(ScreenPtr pScreen
, VisualID visual
)
52 for (i
= 0; i
< pScreen
->numVisuals
; i
++)
53 if (pScreen
->visuals
[i
].vid
== visual
)
54 return xnestVisual(&pScreen
->visuals
[i
]);
60 xnestDefaultVisualColormap(Visual
* visual
)
64 for (i
= 0; i
< xnestNumVisuals
; i
++)
65 if (xnestVisuals
[i
].visual
== visual
)
66 return xnestDefaultColormaps
[i
];