# 2.11BSD#431 - /usr/src/ucb/window/wwmove.c

##### Functions

    wwmove            X

       1: #ifndef lint
       2: static char sccsid[] = "@(#)wwmove.c	3.7 4/24/85";
       3: #endif
       4:
       5: /*
       6:  * Copyright (c) 1983 Regents of the University of California,
       7:  * All rights reserved.  Redistribution permitted subject to
       8:  * the terms of the Berkeley Software License Agreement.
       9:  */
      10:
      11: #include "ww.h"
      12:
      13: /*
      14:  * Move a window.  Should be unattached.
      15:  */
      16: wwmove(w, row, col)
      17: register struct ww *w;
      18: {
      19:     register dr, dc;
      20:     register i;
      21:
      22:     dr = row - w->ww_w.t;
      23:     dc = col - w->ww_w.l;
      24:
      25:     w->ww_w.t += dr;
      26:     w->ww_w.b += dr;
      27:     w->ww_w.l += dc;
      28:     w->ww_w.r += dc;
      29:
      30:     w->ww_b.t += dr;
      31:     w->ww_b.b += dr;
      32:     w->ww_b.l += dc;
      33:     w->ww_b.r += dc;
      34:
      35:     w->ww_i.t = MAX(w->ww_w.t, 0);
      36:     w->ww_i.b = MIN(w->ww_w.b, wwnrow);
      37:     w->ww_i.nr = w->ww_i.b - w->ww_i.t;
      38:     w->ww_i.l = MAX(w->ww_w.l, 0);
      39:     w->ww_i.r = MIN(w->ww_w.r, wwncol);
      40:     w->ww_i.nc = w->ww_i.r - w->ww_i.l;
      41:
      42:     w->ww_cur.r += dr;
      43:     w->ww_cur.c += dc;
      44:
      45:     w->ww_win -= dr;
      46:     for (i = w->ww_w.t; i < w->ww_w.b; i++)
      47:         w->ww_win[i] -= dc;
      48:     if (w->ww_fmap != 0) {
      49:         w->ww_fmap -= dr;
      50:         for (i = w->ww_w.t; i < w->ww_w.b; i++)
      51:             w->ww_fmap[i] -= dc;
      52:     }
      53:     w->ww_nvis -= dr;
      54:     for (i = w->ww_i.t; i < w->ww_i.b; i++) {
      55:         register j = w->ww_i.l;
      56:         register char *win = &w->ww_win[i][j];
      57:         register char *smap = &wwsmap[i][j];
      58:         int nvis = 0;
      59:
      60:         for (; j < w->ww_i.r; j++, win++, smap++)
      61:             if (*win == 0 && *smap == w->ww_index)
      62:                 nvis++;
      63:         w->ww_nvis[i] = nvis;
      64:     }
      65:     w->ww_buf -= dr;
      66:     for (i = w->ww_b.t; i < w->ww_b.b; i++)
      67:         w->ww_buf[i] -= dc;
      68: }

#### Defined functions

wwmove defined in line 16; used 1 times

- in /usr/src/ucb/window/cmd5.c line 69

#### Defined variables

sccsid defined in line 2; never used

Last modified: 1987-02-17 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 401 |