void LRefreshAll(Layer *l, int isblank) { Layer *oldflayer; oldflayer = flayer; flayer = l; if (!isblank) LClearArea(l, 0, 0, l->l_width - 1, l->l_height - 1, 0, 0); /* signal full refresh */ LayRedisplayLine(-1, -1, -1, 1); for (int y = 0; y < l->l_height; y++) LayRedisplayLine(y, 0, l->l_width - 1, 1); flayer = oldflayer; }
void ResizeLayer(Layer *l, int wi, int he, Display *norefdisp) { Window *p; Canvas *cv; Layer *oldflayer = flayer; Display *d, *olddisplay = display; if (l->l_width == wi && l->l_height == he) return; p = Layer2Window(l); /* If 'flayer' and 'l' are for the same window, then we will not * restore 'flayer'. */ if (oldflayer && (l == oldflayer || Layer2Window(oldflayer) == p)) oldflayer = NULL; flayer = l; if (p) { /* It's a window layer. Kill the overlays on it in all displays. */ for (d = displays; d; d = d->d_next) for (cv = d->d_cvlist; cv; cv = cv->c_next) { if (p == Layer2Window(cv->c_layer)) { /* Canvas 'cv' on display 'd' shows this window. Remove any non-resizable * layers over it. */ RESIZE_OR_KILL_LAYERS(cv->c_layer, wi, he); } } } else { /* It's a Blank layer. Just kill the non-resizable overlays over it. */ RESIZE_OR_KILL_LAYERS(flayer, wi, he); } for (display = displays; display; display = display->d_next) { if (display == norefdisp) continue; for (cv = D_cvlist; cv; cv = cv->c_next) if (Layer2Window(cv->c_layer) == p) { CV_CALL(cv, LayRedisplayLine(-1, -1, -1, 0)); RefreshArea(cv->c_xs, cv->c_ys, cv->c_xe, cv->c_ye, 0); } if (D_kaablamm) { kaablamm(); D_kaablamm = 0; } } /* If we started resizing a non-flayer layer, then restore the flayer. * Otherwise, flayer should already be updated to the topmost foreground layer. */ if (oldflayer) flayer = oldflayer; display = olddisplay; }
static void InpRedisplayLine(int y, int xs, int xe, int isblank) { int q, r, s, l, v; struct inpdata *inpdata; inpdata = (struct inpdata *)flayer->l_data; if (y != INPUTLINE) { LAY_CALL_UP(LayRedisplayLine(y, xs, xe, isblank)); return; } inpdata->inp.buf[inpdata->inp.len] = 0; q = xs; v = xe - xs + 1; s = 0; r = inpdata->inpstringlen; if (v > 0 && q < r) { l = v; if (l > r - q) l = r - q; LPutStr(flayer, inpdata->inpstring + q - s, l, &mchar_so, q, y); q += l; v -= l; } s = r; r += inpdata->inp.len; if (!(inpdata->inpmode & INP_NOECHO) && v > 0 && q < r) { l = v; if (l > r - q) l = r - q; LPutStr(flayer, inpdata->inp.buf + q - s, l, &mchar_so, q, y); q += l; v -= l; } s = r; r = flayer->l_width; if (!isblank && v > 0 && q < r) { l = v; if (l > r - q) l = r - q; LClearArea(flayer, q, y, q + l - 1, y, 0, 0); q += l; } }
static void InpAbort() { LAY_CALL_UP(LayRedisplayLine(INPUTLINE, 0, flayer->l_width - 1, 0)); ExitOverlayPage(); }