~ctwm/ctwm/trunk

« back to all changes in this revision

Viewing changes to icons_builtin.c

  • Committer: Matthew Fuller
  • Date: 2016-07-31 13:28:09 UTC
  • mto: This revision was merged to the branch mainline in revision 506.
  • Revision ID: fullermd@over-yonder.net-20160731132809-rtu5udfugquv228f
Comment func.

Show diffs side-by-side

added added

removed removed

Lines of Context:
182
182
        const unsigned int w = im_iconified_icon_width;
183
183
        const unsigned int h = im_iconified_icon_height;
184
184
 
 
185
        /*
 
186
         * Keep a list of ones we've made, and if we've already made one this
 
187
         * color, just hand it back.
 
188
         */
185
189
        for(col = colori; col; col = col->next) {
186
190
                if(col->color == cp.back) {
187
191
                        return col->pix;
188
192
                }
189
193
        }
190
194
 
 
195
        /* Don't have one this color yet, make it */
191
196
        col = malloc(sizeof(struct Colori));
192
197
        col->color = cp.back;
193
198
        col->pix   = XCreatePixmap(dpy, Scr->Root, w, h, Scr->d_depth);
194
199
        Draw3DBorder(col->pix, 0, 0, w, h, 4, cp, off, true, false);
 
200
 
 
201
        /* Add to the cache list so we hit the above next time */
195
202
        col->next = colori;
196
203
        colori = col;
197
204
 
198
 
        return (colori->pix);
 
205
        return colori->pix;
199
206
}
200
207
 
201
208
Pixmap