version 1.8 | | version 1.9 |
---|
| | |
* 0.91.9 - moved to start of file - needed for ReadPixmaps function. | | * 0.91.9 - moved to start of file - needed for ReadPixmaps function. |
*/ | | */ |
XColor exactcolor, discolor[13]; | | XColor exactcolor, discolor[13]; |
Colormap colormap; | | Colormap colormap=NULL; |
| | |
| | |
/********************************************************************** | | /********************************************************************** |
| | |
InitializeColors(XtDisplay(self->shell)); | | InitializeColors(XtDisplay(self->shell)); |
| | |
/* Default */ | | /* Default */ |
displaymode=Dm_Bitmap; | | displaymode=Dm_Png; |
#ifdef HAVE_LIBXPM | | |
if (self->res.useColorPixmaps) displaymode=Dm_Pixmap; | | |
#endif | | |
#ifdef HAVE_LIBPNG | | |
if (self->res.usePng) displaymode=Dm_Png; | | |
#endif | | |
| | |
if (displaymode==Dm_Png) | | |
FontSize=32; | | FontSize=32; |
else | | |
FontSize=24; | | |
CnvInitialize(self->shell); | | CnvInitialize(self->shell); |
| | |
| | |
| | |
fprintf(stderr,"Not enough space in colormap - switch colormap.\n"); | | fprintf(stderr,"Not enough space in colormap - switch colormap.\n"); |
/* exit(1);*/ | | /* exit(1);*/ |
} | | } |
| | if (colormap) |
XtVaSetValues(self->shell, XtNcolormap, colormap, NULL); | | XtVaSetValues(self->shell, XtNcolormap, colormap, NULL); |
AppUpdate(self); | | AppUpdate(self); |
return self; | | return self; |
| | |
} | | } |
| | |
| | |
char PixelFromAlias(char *name) { | | |
int i; | | |
for(i=0;i<13;i++) | | |
if(!strcmp(name,colorname[i][0])) | | |
return discolor[i].pixel; | | |
LOG(llevError,"Unknown color: %s\n",name); | | |
return 0; | | |
} | | |
| | |
void InitializeColors (Display *dpy) | | void InitializeColors (Display *dpy) |
{ | | { |
int i; | | return; /* this function does nothing anymore */ |
int private=0; | | |
| | |
colormap = DefaultColormap (dpy, DefaultScreen (dpy)); | | |
for (i = 0; i < 13; i++) { | | |
if (!XLookupColor (dpy, colormap, colorname[i][1], &exactcolor, | | |
&discolor[i])) { | | |
die ("Can't find color."); | | |
} | | |
if (!XAllocColor (dpy, colormap, &discolor[i])) { | | |
if (!private) { | | |
LOG(llevDebug,"Switching to a private colormap.\n"); | | |
colormap=XCopyColormapAndFree(dpy, colormap); | | |
private=1; | | |
if (!XAllocColor (dpy, colormap, &discolor[i])) | | |
die ("Can't allocate colors."); | | |
} | | |
else | | |
die ("Can't allocate colors."); | | |
} | | |
} | | |
} | | } |
| | |
/* | | /* |