Annotation of researchv9/jerq/src/lib/layer/upfront.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Move a layer to the front of the screen
                      3:  */
                      4: #include <jerq.h>
                      5: #include "layer.h"
                      6: 
                      7: Layer *lfront, *lback;
                      8: 
                      9: static void
                     10: Lupfront(l, r, b, f, o)
                     11: Layer *l, *o;
                     12: Rectangle r;
                     13: Bitmap *b;
                     14: char *f;
                     15: {
                     16:        if (o != l) {
                     17:                o->someobs = 1;
                     18:                bitblt(o, r, o->obs, r.origin, F_STORE);
                     19:                bitblt(l->obs, r, l, r.origin, F_STORE);
                     20:        }
                     21: }
                     22: 
                     23: upfront(lp)
                     24:        register Layer *lp;
                     25: {
                     26:        if (!lp)
                     27:                return;
                     28:        if (!lp->front) {
                     29:                lp->someobs = lp->nonevis = 0;
                     30:                return;
                     31:        }
                     32:        cursinhibit();
                     33:        /*
                     34:         * Move bits of lp to front
                     35:         */
                     36:        lp->nonevis = 0;        /* can't shortcut to whole obscured */
                     37:        if (lp->someobs)
                     38:                layerop(lp, Lupfront, lp->rect);
                     39:        /*
                     40:         * Put lp at front
                     41:         */
                     42:        if(lfront!=lp){
                     43:                if(lback==lp)
                     44:                        lback=lp->front;
                     45:                if(lp->back)
                     46:                        lp->back->front=lp->front;
                     47:                lp->front->back=lp->back;
                     48:                lfront->front=lp;
                     49:                lp->back=lfront;
                     50:                lp->front=0;
                     51:                lfront=lp;
                     52:        }
                     53:        /*
                     54:         * lp is now at the front, so update nonevis for all layers.
                     55:         * if lp was fully visible before, we can't have changed it, so
                     56:         * don't bother.
                     57:         */
                     58:        if (lp->someobs)
                     59:                setvis();
                     60:        lp->someobs = 0;
                     61:        cursallow();
                     62: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.