1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-21 10:13:43 +03:00

0023792: 3D viewer window content is blended with Linux desktop

Eliminate tabulation symbols
Prefer 24-bit visual over 32-bit
This commit is contained in:
kgv 2013-03-07 13:30:09 +04:00
parent 9b308cd3f6
commit b1fa9f3841

View File

@ -16,53 +16,13 @@
// and conditions governing the rights and limitations under the License. // and conditions governing the rights and limitations under the License.
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> #include <config.h>
#endif #endif
#define CTS17988 /*GG_240697
// Ne pas chercher a ajuster la profondeur du visual
// recherche en TrueColor par rapport aux MultiBuffers disponibles
*/
#define GG250997 /*
// Pour le 2D et plans overlay prendre de
// preference une colormap existante afin
// d'eviter des pb d'installation sur la nouvelle
// colormap.
*/
#define TEST /*051297
// Ameliorer la recuperation de la colormap OVERLAY lorsque
// celle ci est invalide voir ligne 925-928
*/
#define PURIFY /*GG+STT 110199
// Avoid memory leak
*/
#define IMP040100 /*GG_040100 Overlay planes are not usable
// when the alone installed colormap is used
// by the default root visual.
*/
#include <Xw_Extension.h> #include <Xw_Extension.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#if (!defined (CTS17988)) && defined(HAVE_X11_EXTENSIONS_MULTIBUF_H)
# include <X11/extensions/multibuf.h>
#endif
#include <X11/Xmu/StdCmap.h> #include <X11/Xmu/StdCmap.h>
/* ifdef then trace on */
#ifdef TRACE
#define TRACE_DEF_COLORMAP
#define TRACE_CLOSE_COLORMAP
#define TRACE_SET_COLORMAP_MAPPING
#endif
/* /*
XW_EXT_COLORMAP* Xw_def_colormap(adisplay,pclass,ncolor,basemap,mapping): XW_EXT_COLORMAP* Xw_def_colormap(adisplay,pclass,ncolor,basemap,mapping):
XW_EXT_DISPLAY *adisplay Extended Display structure XW_EXT_DISPLAY *adisplay Extended Display structure
@ -140,17 +100,8 @@ static char svalue[80] ;
static Atom DefaultAtom = 0 ; static Atom DefaultAtom = 0 ;
static const char *XW_RGB_BEST_MAP = "Xw_RGB_BEST_MAP" ; static const char *XW_RGB_BEST_MAP = "Xw_RGB_BEST_MAP" ;
#ifdef XW_PROTOTYPE
void* Xw_def_colormap (void* adisplay,Xw_TypeOfVisual pclass, void* Xw_def_colormap (void* adisplay,Xw_TypeOfVisual pclass,
int ncolor,Aspect_Handle basemap,Xw_TypeOfMapping mapping) int ncolor,Aspect_Handle basemap,Xw_TypeOfMapping mapping)
#else
void* Xw_def_colormap (adisplay,pclass,ncolor,basemap,mapping)
void *adisplay ;
Xw_TypeOfVisual pclass ;
int ncolor ;
Aspect_Handle basemap ;
Xw_TypeOfMapping mapping ;
#endif /*XW_PROTOTYPE*/
{ {
XW_EXT_DISPLAY *pdisplay = (XW_EXT_DISPLAY*)adisplay ; XW_EXT_DISPLAY *pdisplay = (XW_EXT_DISPLAY*)adisplay ;
XW_EXT_COLORMAP *pcolormap = NULL ; XW_EXT_COLORMAP *pcolormap = NULL ;
@ -385,11 +336,6 @@ RESTART :
} }
for( i=0 ; i<n ; i++,b++ ) usrpixels[i] = usrpixels[b] ; for( i=0 ; i<n ; i++,b++ ) usrpixels[i] = usrpixels[b] ;
acolor = n ; acolor = n ;
#ifdef TRACE_DEF_COLORMAP
if( Xw_get_trace() ) {
Xw_set_error(105,"Xw_def_colormap",&acolor) ;
}
#endif
} }
_CINFO.base_pixel = usrpixels[0] ; _CINFO.base_pixel = usrpixels[0] ;
@ -475,31 +421,16 @@ RESTART :
Xw_set_colormap_mapping(pcolormap,mapping) ; Xw_set_colormap_mapping(pcolormap,mapping) ;
Xw_def_highlight_color(pcolormap,1.,1.,1.) ; Xw_def_highlight_color(pcolormap,1.,1.,1.) ;
#ifdef TRACE_DEF_COLORMAP
if( Xw_get_trace() ) {
printf(" %lx = Xw_def_colormap(%lx,%d,%d)\n",
(long ) pcolormap,(long ) adisplay,pclass,acolor) ;
}
#endif
return (pcolormap); return (pcolormap);
} }
static XW_EXT_COLORMAP *PcolormapList =NULL ; static XW_EXT_COLORMAP *PcolormapList =NULL ;
#ifdef XW_PROTOTYPE //! Create and Insert one Extended colormap structure in the
//! EXtended colormap List
//! returns Extended colormap address if successful
//! or NULL if Bad Allocation
XW_EXT_COLORMAP* Xw_add_colormap_structure(int size) XW_EXT_COLORMAP* Xw_add_colormap_structure(int size)
#else
XW_EXT_COLORMAP* Xw_add_colormap_structure(size)
int size ;
#endif /*XW_PROTOTYPE*/
/*
Create and Insert one Extended colormap structure in the
EXtended colormap List
returns Extended colormap address if successful
or NULL if Bad Allocation
*/
{ {
XW_EXT_COLORMAP *pcolormap = (XW_EXT_COLORMAP*) Xw_malloc(size) ; XW_EXT_COLORMAP *pcolormap = (XW_EXT_COLORMAP*) Xw_malloc(size) ;
//int i ; //int i ;
@ -541,30 +472,17 @@ XW_EXT_COLORMAP *pcolormap = (XW_EXT_COLORMAP*) Xw_malloc(size) ;
return (pcolormap) ; return (pcolormap) ;
} }
#ifdef XW_PROTOTYPE //! Get the NEXT ColorMap structure from the List
//! returns Extended colormap address if successful
//! or NULL if No MORE Colormap is found
XW_EXT_COLORMAP* Xw_get_colormap_structure(XW_EXT_COLORMAP* pcolormap) XW_EXT_COLORMAP* Xw_get_colormap_structure(XW_EXT_COLORMAP* pcolormap)
#else
XW_EXT_COLORMAP* Xw_get_colormap_structure(pcolormap)
XW_EXT_COLORMAP *pcolormap ;
#endif /*XW_PROTOTYPE*/
/*
Get the NEXT ColorMap structure from the List
returns Extended colormap address if successful
or NULL if No MORE Colormap is found
*/
{ {
if( pcolormap ) return (XW_EXT_COLORMAP*)pcolormap->link ; if( pcolormap ) return (XW_EXT_COLORMAP*)pcolormap->link ;
else return (PcolormapList) ; else return (PcolormapList) ;
} }
#ifdef XW_PROTOTYPE
XW_STATUS Xw_close_colormap(void* acolormap) XW_STATUS Xw_close_colormap(void* acolormap)
#else
XW_STATUS Xw_close_colormap(acolormap)
void *acolormap;
#endif /*XW_PROTOTYPE*/
{ {
XW_EXT_COLORMAP *pcolormap = (XW_EXT_COLORMAP*)acolormap ; XW_EXT_COLORMAP *pcolormap = (XW_EXT_COLORMAP*)acolormap ;
XW_STATUS status ; XW_STATUS status ;
@ -577,28 +495,14 @@ XW_STATUS status ;
status = Xw_del_colormap_structure(pcolormap) ; status = Xw_del_colormap_structure(pcolormap) ;
#ifdef TRACE_CLOSE_COLORMAP
if( Xw_get_trace() ) {
printf(" %d = Xw_close_colormap(%lx)\n",status,(long ) pcolormap) ;
}
#endif
return (status) ; return (status) ;
} }
#ifdef XW_PROTOTYPE //! Remove the Extended colormap address from the Extended List and
//! Free the Extended Colormap
//! returns ERROR if the colormap address is not Found in the list
//! returns SUCCESS if successful
XW_STATUS Xw_del_colormap_structure(XW_EXT_COLORMAP* pcolormap) XW_STATUS Xw_del_colormap_structure(XW_EXT_COLORMAP* pcolormap)
#else
XW_STATUS Xw_del_colormap_structure(pcolormap)
XW_EXT_COLORMAP *pcolormap;
#endif /*XW_PROTOTYPE*/
/*
Remove the Extended colormap address from the Extended List and
Free the Extended Colormap
returns ERROR if the colormap address is not Found in the list
returns SUCCESS if successful
*/
{ {
XW_EXT_COLORMAP *fcolormap; XW_EXT_COLORMAP *fcolormap;
//int i ; //int i ;
@ -641,27 +545,18 @@ XW_EXT_COLORMAP *fcolormap;
return (XW_SUCCESS) ; return (XW_SUCCESS) ;
} }
#ifdef XW_PROTOTYPE //! Set MAPPING Colormap mode
//! if mapping is SIMPLERAMP all color cells access is done
//! across the PIXEL index array .
//! if mapping is BESTRAMP all color cells access is done
//! across the PIXEL index array and an HIGHLIGHT plane is created .
//! if mapping is HARDRAMP all color cells access is done
//! directly (Make becarefull !!)
//! if mapping is COLORCUBE all color cells access is done
//! across a ColorCube PIXEL index array .
//! if mapping is READONLY all color cells access is done
//! across a readonly PIXEL index array without color allocation.
XW_STATUS Xw_set_colormap_mapping(void* acolormap,Xw_TypeOfMapping mode) XW_STATUS Xw_set_colormap_mapping(void* acolormap,Xw_TypeOfMapping mode)
#else
XW_STATUS Xw_set_colormap_mapping(acolormap,mode)
void *acolormap ;
Xw_TypeOfMapping mode ;
#endif /*XW_PROTOTYPE*/
/*
Set MAPPING Colormap mode
if mapping is SIMPLERAMP all color cells access is done
across the PIXEL index array .
if mapping is BESTRAMP all color cells access is done
across the PIXEL index array and an HIGHLIGHT plane is created .
if mapping is HARDRAMP all color cells access is done
directly (Make becarefull !!)
if mapping is COLORCUBE all color cells access is done
across a ColorCube PIXEL index array .
if mapping is READONLY all color cells access is done
across a readonly PIXEL index array without color allocation.
*/
{ {
XW_EXT_COLORMAP *pcolormap = (XW_EXT_COLORMAP*)acolormap ; XW_EXT_COLORMAP *pcolormap = (XW_EXT_COLORMAP*)acolormap ;
int status,cstatus,gstatus ; int status,cstatus,gstatus ;
@ -941,7 +836,7 @@ int nmap;
pcolormap->define[i] = FREECOLOR ; pcolormap->define[i] = FREECOLOR ;
} }
} }
#ifdef GG250997
if( mode == Xw_TOM_READONLY ) { if( mode == Xw_TOM_READONLY ) {
if( !DefaultAtom ) DefaultAtom = XInternAtom(_CDISPLAY, if( !DefaultAtom ) DefaultAtom = XInternAtom(_CDISPLAY,
XW_RGB_BEST_MAP,True) ; XW_RGB_BEST_MAP,True) ;
@ -962,7 +857,7 @@ int nmap;
int error,gravity; int error,gravity;
// unsigned long pixel; // unsigned long pixel;
color.red = color.green = color.blue = 0xFFFF; color.red = color.green = color.blue = 0xFFFF;
#ifdef TEST
char *serror; char *serror;
Xw_print_error(); Xw_print_error();
if( !Xw_get_trace() ) Xw_set_synchronize(_CDISPLAY,True) ; if( !Xw_get_trace() ) Xw_set_synchronize(_CDISPLAY,True) ;
@ -970,9 +865,6 @@ int nmap;
if( !Xw_get_trace() ) Xw_set_synchronize(_CDISPLAY,False) ; if( !Xw_get_trace() ) Xw_set_synchronize(_CDISPLAY,False) ;
serror = Xw_get_error(&error,&gravity); serror = Xw_get_error(&error,&gravity);
if( status && (error < 1000) ) { if( status && (error < 1000) ) {
#else
if( XAllocColor(_CDISPLAY,cinfo->colormap,&color) ) {
#endif
if( _CINFO.colormap != cinfo->colormap ) { if( _CINFO.colormap != cinfo->colormap ) {
if( _CINFO.colormap && (_CINFO.colormap != _CCOLORMAP) ) { if( _CINFO.colormap && (_CINFO.colormap != _CCOLORMAP) ) {
XFreeColormap(_CDISPLAY,_CINFO.colormap) ; XFreeColormap(_CDISPLAY,_CINFO.colormap) ;
@ -992,10 +884,10 @@ int nmap;
} else { } else {
if( Xw_get_trace() ) if( Xw_get_trace() )
printf(" Xw_set_colormap_mapping.BAD registered COLORMAP 0x%lx\n",cinfo->colormap); printf(" Xw_set_colormap_mapping.BAD registered COLORMAP 0x%lx\n",cinfo->colormap);
#ifdef TEST
status = False; status = False;
Xw_print_error(); Xw_print_error();
#endif
} }
} }
} }
@ -1030,7 +922,7 @@ int nmap;
if( pinfo ) XFree(pinfo); if( pinfo ) XFree(pinfo);
XInstallColormap(_CDISPLAY,_CINFO.colormap); XInstallColormap(_CDISPLAY,_CINFO.colormap);
} }
#endif
break ; break ;
case Xw_TOM_BESTRAMP : case Xw_TOM_BESTRAMP :
@ -1330,14 +1222,6 @@ int nmap;
switch (SetColorCube) { switch (SetColorCube) {
case 'N' : case 'N' :
#ifdef TRACE_SET_COLORMAP_MAPPING
if( Xw_get_trace() ) printf(
" Xw_SET_COLOR_CUBE(%ld,%ld,%ld,%ld),(%ld,%ld,%ld,%ld)\n",
_CINFO.base_pixel,_CINFO.red_max,
_CINFO.green_max,_CINFO.blue_max,
_CGINFO.base_pixel,_CGINFO.red_max,
_CGINFO.green_max,_CGINFO.blue_max) ;
#endif
break ; break ;
case 'Y' : case 'Y' :
if( !DefaultAtom ) if( !DefaultAtom )
@ -1345,14 +1229,6 @@ int nmap;
XW_RGB_BEST_MAP,False) ; XW_RGB_BEST_MAP,False) ;
XSetRGBColormaps(_CDISPLAY,_CROOT, XSetRGBColormaps(_CDISPLAY,_CROOT,
pinfo,nmap,DefaultAtom) ; pinfo,nmap,DefaultAtom) ;
#ifdef TRACE_SET_COLORMAP_MAPPING
if( Xw_get_trace() ) printf(
" Xw_SET_STANDARD_COLOR_CUBE(%ld,%ld,%ld,%ld),(%ld,%ld,%ld,%ld)\n",
_CINFO.base_pixel,_CINFO.red_max,
_CINFO.green_max,_CINFO.blue_max,
_CGINFO.base_pixel,_CGINFO.red_max,
_CGINFO.green_max,_CGINFO.blue_max) ;
#endif
break ; break ;
case 'T' : case 'T' :
if( !DefaultAtom ) if( !DefaultAtom )
@ -1361,14 +1237,6 @@ int nmap;
XSetRGBColormaps(_CDISPLAY,_CROOT, XSetRGBColormaps(_CDISPLAY,_CROOT,
pinfo,nmap,DefaultAtom) ; pinfo,nmap,DefaultAtom) ;
XSetCloseDownMode(_CDISPLAY,RetainTemporary) ; XSetCloseDownMode(_CDISPLAY,RetainTemporary) ;
#ifdef TRACE_SET_COLORMAP_MAPPING
if( Xw_get_trace() ) printf(
" Xw_SET_TEMPORARY_COLOR_CUBE(%ld,%ld,%ld,%ld),(%ld,%ld,%ld,%ld)\n",
_CINFO.base_pixel,_CINFO.red_max,
_CINFO.green_max,_CINFO.blue_max,
_CGINFO.base_pixel,_CGINFO.red_max,
_CGINFO.green_max,_CGINFO.blue_max) ;
#endif
break ; break ;
case 'P' : case 'P' :
if( !DefaultAtom ) if( !DefaultAtom )
@ -1395,32 +1263,22 @@ int nmap;
XFlush(_CDISPLAY) ; XFlush(_CDISPLAY) ;
#ifdef TRACE_SET_COLORMAP_MAPPING
if( Xw_get_trace() ) {
printf(" Xw_set_color_mapping(%lx,%d)\n",(long ) pcolormap,mode) ;
}
#endif
return (XW_SUCCESS) ; return (XW_SUCCESS) ;
} }
#ifdef XW_PROTOTYPE //! Return the visual Information matching with the specified class
XVisualInfo* Xw_get_visual_info(XW_EXT_DISPLAY* pdisplay,Xw_TypeOfVisual pclass) //! or NULL if class is not founded on this Display.
#else XVisualInfo* Xw_get_visual_info (XW_EXT_DISPLAY* pdisplay,
XVisualInfo* Xw_get_visual_info(pdisplay,pclass) Xw_TypeOfVisual pclass)
XW_EXT_DISPLAY *pdisplay ;
Xw_TypeOfVisual pclass ;
#endif /*XW_PROTOTYPE*/
/*
Return the visual Information matching with the specified class
or NULL if class is not founded on this Display .
*/
{ {
Xw_TypeOfVisual class1 = pclass,class2 = Xw_TOV_DEFAULT ; Xw_TypeOfVisual class1 = pclass;
XVisualInfo *vinfo = NULL,*ginfo = NULL,info1,info2 ; Xw_TypeOfVisual class2 = Xw_TOV_DEFAULT;
int i,ninfo; XVisualInfo* vinfo = NULL;
long mask1 = 0,mask2 = 0; XVisualInfo* ginfo = NULL;
unsigned long backpixel; XVisualInfo info1, info2;
int i, ninfo;
long mask1 = 0,mask2 = 0;
unsigned long backpixel;
switch (class1) { switch (class1) {
case Xw_TOV_DEFAULT : case Xw_TOV_DEFAULT :
@ -1449,22 +1307,11 @@ unsigned long backpixel;
Xw_TOV_PSEUDOCOLOR,&backpixel); Xw_TOV_PSEUDOCOLOR,&backpixel);
return ginfo; return ginfo;
case Xw_TOV_PREFERRED_TRUECOLOR : case Xw_TOV_PREFERRED_TRUECOLOR :
#ifdef OLD
if( MaxCmapsOfScreen(_DSCREEN) > 1 ) {
class1 = Xw_TOV_TRUECOLOR ; class1 = Xw_TOV_TRUECOLOR ;
class2 = Xw_TOV_PSEUDOCOLOR ; class2 = Xw_TOV_PSEUDOCOLOR ;
mask2 |= VisualColormapSizeMask; mask2 |= VisualColormapSizeMask;
info2.colormap_size = 256; info2.colormap_size = 256;
} else { break;
class1 = _DCLASS ;
}
#else
class1 = Xw_TOV_TRUECOLOR ;
class2 = Xw_TOV_PSEUDOCOLOR ;
mask2 |= VisualColormapSizeMask;
info2.colormap_size = 256;
#endif
break ;
case Xw_TOV_PREFERRED_OVERLAY : case Xw_TOV_PREFERRED_OVERLAY :
class1 = Xw_TOV_PSEUDOCOLOR ; class1 = Xw_TOV_PSEUDOCOLOR ;
mask1 |= VisualColormapSizeMask; mask1 |= VisualColormapSizeMask;
@ -1477,91 +1324,59 @@ unsigned long backpixel;
break ; break ;
} }
if( !ginfo ) { if (ginfo == NULL)
#if (!defined (CTS17988)) && defined(HAVE_X11_EXTENSIONS_MULTIBUF_H) {
XmbufBufferInfo *pmono = NULL,*pstereo = NULL; info1.c_class = class1;
int nmono=0,nstereo=0; info1.screen = DefaultScreen(_DDISPLAY);
#endif
#if (!defined (CTS17988)) && defined(HAVE_X11_EXTENSIONS_MULTIBUF_H)
XmbufGetScreenInfo(_DDISPLAY, _DROOT, &nmono, &pmono,
&nstereo, &pstereo);
#endif
#if defined(__cplusplus) || defined(c_plusplus)
info1.c_class = class1 ;
#else
info1.class = class1 ;
#endif
info1.screen = DefaultScreen(_DDISPLAY) ;
mask1 |= VisualClassMask | VisualScreenMask ; mask1 |= VisualClassMask | VisualScreenMask ;
vinfo = XGetVisualInfo(_DDISPLAY,mask1,&info1,&ninfo) ; vinfo = XGetVisualInfo(_DDISPLAY,mask1,&info1,&ninfo) ;
if( ninfo ) { if (ninfo > 0)
ginfo = vinfo ; {
for( i=1 ; i<ninfo ; i++ ) { ginfo = vinfo;
if( (vinfo[i].depth > ginfo->depth) || for (i = 1; i < ninfo; i++)
(vinfo[i].visualid == _DVISUAL->visualid) ) { {
#if (!defined (CTS17988)) && defined(HAVE_X11_EXTENSIONS_MULTIBUF_H) if ((vinfo[i].depth > ginfo->depth && !(vinfo[i].depth == 32 && ginfo->depth == 24))
if( pmono ) { || (vinfo[i].depth == 24 && ginfo->depth == 32) // prefer 24-bit depth over 32-bit - we do not need blend window content with desktop (see CR23792)
for( j=0 ; j<nmono ; j++ ) { || (vinfo[i].visualid == _DVISUAL->visualid))
if( (pmono[j].visualid == vinfo[i].visualid) && {
((pmono[j].max_buffers == 0) ||
(pmono[j].max_buffers > 1)) ) {
ginfo = &vinfo[i];
break;
}
}
} else
#endif
ginfo = &vinfo[i]; ginfo = &vinfo[i];
} }
} }
if( (ginfo->depth < TrueColorMinDepth) && if ((ginfo->depth < TrueColorMinDepth)
(class1 == Xw_TOV_TRUECOLOR) ) { && (class1 == Xw_TOV_TRUECOLOR))
XFree((char*)vinfo) ; {
ginfo = vinfo = NULL ; XFree ((char* )vinfo);
ginfo = vinfo = NULL;
} }
} }
if( !ginfo && (class2 != Xw_TOV_DEFAULT) ) { if (ginfo == NULL && (class2 != Xw_TOV_DEFAULT))
#if defined(__cplusplus) || defined(c_plusplus) {
info2.c_class = class2 ; info2.c_class = class2;
#else
info2.class = class2 ; info2.screen = DefaultScreen(_DDISPLAY);
#endif mask2 |= VisualClassMask | VisualScreenMask;
info2.screen = DefaultScreen(_DDISPLAY) ; vinfo = XGetVisualInfo(_DDISPLAY,mask2,&info2,&ninfo);
mask2 |= VisualClassMask | VisualScreenMask ; if (ninfo > 0)
vinfo = XGetVisualInfo(_DDISPLAY,mask2,&info2,&ninfo) ; {
if( ninfo ) {
ginfo = vinfo ; ginfo = vinfo ;
for( i=1 ; i<ninfo ; i++ ) { for (i = 1; i < ninfo; i++)
if( vinfo[i].depth > ginfo->depth ) { {
#if (!defined (CTS17988)) && defined(HAVE_X11_EXTENSIONS_MULTIBUF_H) if ((vinfo[i].depth > ginfo->depth && !(vinfo[i].depth == 32 && ginfo->depth == 24))
if( pmono ) { || (vinfo[i].depth == 24 && ginfo->depth == 32)) // prefer 24-bit depth over 32-bit)
for( j=0 ; j<nmono ; j++ ) { {
if( (pmono[j].visualid == vinfo[i].visualid) &&
((pmono[j].max_buffers == 0) ||
(pmono[j].max_buffers > 1)) ) {
ginfo = &vinfo[i];
break;
}
}
} else
#endif
ginfo = &vinfo[i]; ginfo = &vinfo[i];
} }
} }
if( (ginfo->depth < TrueColorMinDepth) && if ((ginfo->depth < TrueColorMinDepth)
(class2 == Xw_TOV_TRUECOLOR) ) { && (class2 == Xw_TOV_TRUECOLOR))
XFree((char*)vinfo) ; {
ginfo = vinfo = NULL ; XFree((char*)vinfo);
ginfo = vinfo = NULL;
} }
} }
} }
#if (!defined (CTS17988)) && defined(HAVE_X11_EXTENSIONS_MULTIBUF_H)
if( pmono ) XFree(pmono);
if( pstereo ) XFree(pstereo);
#endif
} }
if( ginfo ) { if( ginfo ) {
@ -1579,18 +1394,9 @@ unsigned long backpixel;
return (ginfo) ; return (ginfo) ;
} }
#ifdef XW_PROTOTYPE //! Return the Overlay visual Information matching with the specified class
//! or NULL if the overlay class is not founded on this Display.
XVisualInfo* Xw_get_overlay_visual_info(XW_EXT_DISPLAY* pdisplay,Xw_TypeOfVisual /*pclass*/,unsigned long *backpixel) XVisualInfo* Xw_get_overlay_visual_info(XW_EXT_DISPLAY* pdisplay,Xw_TypeOfVisual /*pclass*/,unsigned long *backpixel)
#else
XVisualInfo* Xw_get_overlay_visual_info(pdisplay,pclass,backpixel)
XW_EXT_DISPLAY *pdisplay ;
Xw_TypeOfVisual pclass ;
unsigned long *backpixel;
#endif /*XW_PROTOTYPE*/
/*
Return the Overlay visual Information matching with the specified class
or NULL if the overlay class is not founded on this Display .
*/
{ {
XVisualInfo *vinfo = NULL,*ginfo = NULL,tinfo ; XVisualInfo *vinfo = NULL,*ginfo = NULL,tinfo ;
int ninfo; int ninfo;
@ -1628,9 +1434,9 @@ Atom oatom = XInternAtom(_DDISPLAY, "SERVER_OVERLAY_VISUALS", True);
} }
} }
} }
#ifdef PURIFY
if( prop.string && (status == Success) ) Xw_free(prop.string); if( prop.string && (status == Success) ) Xw_free(prop.string);
#endif
} else if( (pdisplay->server == XW_SERVER_IS_SUN) && EnableSunOverlay ) { } else if( (pdisplay->server == XW_SERVER_IS_SUN) && EnableSunOverlay ) {
int mOptCode,fEvent,fError; int mOptCode,fEvent,fError;
if( XQueryExtension(_DDISPLAY,"SUN_OVL",&mOptCode,&fEvent,&fError) ) { if( XQueryExtension(_DDISPLAY,"SUN_OVL",&mOptCode,&fEvent,&fError) ) {
@ -1645,17 +1451,11 @@ Atom oatom = XInternAtom(_DDISPLAY, "SERVER_OVERLAY_VISUALS", True);
} }
} }
#ifdef IMP040100
if( ginfo && MaxCmapsOfScreen(_DSCREEN) < 2 && if( ginfo && MaxCmapsOfScreen(_DSCREEN) < 2 &&
ginfo->visualid != _DVISUAL->visualid && ginfo->visualid != _DVISUAL->visualid &&
#if defined(__cplusplus) || defined(c_plusplus)
ginfo->c_class == _DCLASS ) ginfo->c_class == _DCLASS )
#else
ginfo->class == _DCLASS )
#endif
{ {
XFree(ginfo); ginfo = NULL; XFree(ginfo); ginfo = NULL;
} }
#endif
return ginfo; return ginfo;
} }