53 int i,
j,
n, number_cwins, state;
56 char *row, *scoreboard;
66 Scr->cmapInfo.pushed_cmaps = cmaps;
70 if(
Scr->cmapInfo.root_pushes) {
77 if(
Scr->cmapInfo.cmaps) {
78 for(i =
Scr->cmapInfo.cmaps->number_cwins,
79 cwins =
Scr->cmapInfo.cmaps->cwins; i-- > 0; cwins++) {
83 Scr->cmapInfo.cmaps = cmaps;
93 cwins =
Scr->cmapInfo.cmaps->cwins;
94 scoreboard =
Scr->cmapInfo.cmaps->scoreboard;
100 for(i = 0; i < number_cwins; i++) {
103 for(i =
n = 0; i < number_cwins &&
n <
Scr->cmapInfo.maxCmaps; i++) {
112 row = scoreboard + (i * (i - 1) / 2);
113 for(
j = 0;
j < i;
j++)
114 if(row[
j] && (cwins[
j]->colormap->state &
CM_INSTALL)) {
135 cmap = (*maxcwin)->colormap;
176 if(
Scr->cmapInfo.root_pushes == 0) {
182 tmp =
Scr->cmapInfo.pushed_cmaps;
184 Scr->cmapInfo.pushed_cmaps =
tmp;
186 Scr->cmapInfo.root_pushes++;
218 if(
Scr->cmapInfo.root_pushes) {
219 Scr->cmapInfo.root_pushes--;
222 if(!
Scr->cmapInfo.root_pushes) {
255 cmap->install_req = 0;
302 cwin->colormap->refcnt = 1;
324 cwin->colormap->refcnt++;
367 cwins =
tmp->cmaps.cwins;
368 for(i = 0; i <
tmp->cmaps.number_cwins; i++) {
391 "%s: unable to allocate %d element colormap window array\n",
412 for(
j = 0;
j <
tmp->cmaps.number_cwins;
j++) {
414 cwins[i] =
tmp->cmaps.cwins[
j];
425 if(
j ==
tmp->cmaps.number_cwins) {
429 tmp->cmaps.number_cwins == 0,
457 tmp->cmaps.number_cwins == 0,
false);
463 if(
tmp->cmaps.number_cwins) {
467 tmp->cmaps.cwins = cwins;
470 tmp->cmaps.scoreboard =
506 if(
inc &&
tmp->cmaps.number_cwins > 0) {
510 tmp->cmaps.number_cwins);
512 for(i =
tmp->cmaps.number_cwins; i-- > 0;) {
513 tmp->cmaps.cwins[i]->colormap->state = 0;
517 for(i = 0; i <
tmp->cmaps.number_cwins; i++) {
519 if(
j >=
tmp->cmaps.number_cwins) {
520 j -=
tmp->cmaps.number_cwins;
523 j +=
tmp->cmaps.number_cwins;
525 cwins[
j] =
tmp->cmaps.cwins[i];
530 tmp->cmaps.cwins = cwins;
532 if(
tmp->cmaps.number_cwins > 1)
561 for(
sc =
Scr->StdCmapInfo.head;
sc;
sc =
sc->next) {
571 fprintf(
stderr,
"%s: unable to allocate %lu bytes for StdCmap\n",
582 if(
sc ==
Scr->StdCmapInfo.mru) {
589 if(
Scr->StdCmapInfo.tail) {
590 Scr->StdCmapInfo.tail->next =
sc;
593 Scr->StdCmapInfo.head =
sc;
595 Scr->StdCmapInfo.tail =
sc;
610 for(
sc =
Scr->StdCmapInfo.head;
sc;
sc =
sc->next) {
623 if(
Scr->StdCmapInfo.head ==
sc) {
626 if(
Scr->StdCmapInfo.tail ==
sc) {
627 Scr->StdCmapInfo.tail = prev;
629 if(
Scr->StdCmapInfo.mru ==
sc) {
654 for(i = 0; i <
natoms; i++) {
681 if(
tmp->cmaps.number_cwins) {
682 for(i = 0; i <
tmp->cmaps.number_cwins; i++) {
683 if(--
tmp->cmaps.cwins[i]->refcnt == 0) {
684 cmap =
tmp->cmaps.cwins[i]->colormap;
685 if(--
cmap->refcnt == 0) {
694 if(
tmp->cmaps.number_cwins > 1) {
698 tmp->cmaps.number_cwins = 0;
void FetchWmColormapWindows(TwmWindow *tmp)
bool InstallWindowColormaps(int type, TwmWindow *tmp)
void BumpWindowColormap(TwmWindow *tmp, int inc)
void free_cwins(TwmWindow *tmp)
void RemoveRGBColormap(Atom a)
bool InstallColormaps(int type, Colormaps *cmaps)
void UninstallRootColormap(void)
static Bool UninstallRootColormapQScanner(Display *display, XEvent *ev, char *args)
TwmColormap * CreateTwmColormap(Colormap c)
ColormapWindow * CreateColormapWindow(Window w, bool creating_parent, bool property_window)
void InsertRGBColormap(Atom a, XStandardColormap *maps, int nmaps, bool replace)
void InstallRootColormap(void)
void LocateStandardColormaps(void)
#define ColormapsScoreboardLength(cm)
Information about some XStandardColormap we're using.
Info and control for every X Window we take over.