static int tty_setWinPos_24(struct pvm_object me, struct data_area_4_thread *tc ) { DEBUG_INFO; struct data_area_4_tty *da = pvm_data_area( me, tty ); int n_param = POP_ISTACK; CHECK_PARAM_COUNT(n_param, 2); int y = POP_INT(); int x = POP_INT(); w_move( &(da->w), x, y ); SYSCALL_RETURN_NOTHING; }
void draw_change(WORD w_handle, GRECT *pt) { GRECT c, pprev; register GRECT *pw; register WORD start; WORD stop, moved; WORD oldtop, clrold, diffbord, wasclr; wasclr = !(D.w_win[w_handle].w_flags & VF_BROKEN); /* save old size */ w_getsize(WS_CURR, w_handle, &c); w_setsize(WS_PREV, w_handle, &c); /* set new size's */ w_setsize(WS_CURR, w_handle, pt); pw = (GRECT *) w_getxptr(WS_WORK, w_handle); wm_calc(WC_WORK, D.w_win[w_handle].w_kind, pt->g_x, pt->g_y, pt->g_w, pt->g_h, &pw->g_x, &pw->g_y, &pw->g_w, &pw->g_h); /* update rect. lists */ everyobj(gl_wtree, ROOT, NIL, (void(*)())newrect, 0, 0, MAX_DEPTH); /* remember oldtop */ oldtop = gl_wtop; gl_wtop = W_TREE[ROOT].ob_tail; /* if new top then */ /* change men */ if (gl_wtop != oldtop) w_menufix(); /* set ctrl rect and */ /* mouse owner */ w_setactive(); /* init. starting window*/ start = w_handle; /* stop at the top */ stop = DESKWH; /* set flag to say we */ /* haven't moved */ /* the top window */ moved = FALSE; /* if same upper left */ /* corner and not */ /* zero size window */ /* then its a size or */ /* top request, else */ /* its a move, grow, */ /* open or close. */ if ( (!rc_equal(&gl_rzero, pt)) && (pt->g_x == c.g_x) && (pt->g_y == c.g_y) ) { /* size or top request */ if ( (pt->g_w == c.g_w) && (pt->g_h == c.g_h) ) { /* sizes of prev and */ /* current are the same*/ /* so its a top request*/ /* return if this isn't */ /* a top request */ if ( (w_handle != W_TREE[ROOT].ob_tail) || (w_handle == oldtop) ) return; /* say when borders will*/ /* change */ diffbord = !( (D.w_win[oldtop].w_flags & VF_SUBWIN) && (D.w_win[gl_wtop].w_flags & VF_SUBWIN) ); /* draw oldtop covered */ /* with deactivated */ /* borders */ if (oldtop != NIL) { if (diffbord) w_clipdraw(oldtop, 0, MAX_DEPTH, 2); clrold = !(D.w_win[oldtop].w_flags & VF_BROKEN); } else clrold = TRUE; /* if oldtop isn't */ /* overlapped and new */ /* top was clear then */ /* just draw activated*/ /* borders */ if ( (clrold) && (wasclr) ) { w_clipdraw(gl_wtop, 0, MAX_DEPTH, 1); return; } } else /* size change */ { /* stop before current */ /* window if shrink */ /* was a pure subset */ if ( (pt->g_w <= c.g_w) && (pt->g_h <= c.g_h) ) { stop = w_handle; w_clipdraw(gl_wtop, 0, MAX_DEPTH, 2); moved = TRUE; } /* start at bottom if */ /* a shrink occurred */ if ( (pt->g_w < c.g_w) || (pt->g_h < c.g_h) ) start = DESKWH; /* update rect. is the */ /* union of two sizes */ /* + the drop shadow */ c.g_w = max(pt->g_w, c.g_w) + 2; c.g_h = max(pt->g_h, c.g_h) + 2; } } else { /* move or grow or open */ /* or close */ if ( !(c.g_w && c.g_h) || ( (pt->g_x <= c.g_x) && (pt->g_y <= c.g_y) && (pt->g_x+pt->g_w >= c.g_x+c.g_w) && (pt->g_y+pt->g_h >= c.g_y+c.g_h))) { /* a grow that is a */ /* superset or an open */ rc_copy(pt, &c); } else { /* move, close or shrink*/ /* do a move of top guy */ if ( (pt->g_w == c.g_w) && (pt->g_h == c.g_h) && (gl_wtop == w_handle) ) { moved = w_move(w_handle, &stop, &c); start = DESKWH; } /* check for a close */ if ( !(pt->g_w && pt->g_h) ) start = DESKWH; /* handle other moves */ /* and shrinks */ if ( start != DESKWH ) { rc_union(pt, &c); if ( !rc_equal(pt, &c) ) start = DESKWH; } } } /* update gl_wtop */ /* after close, */ /* or open */ if ( oldtop != W_TREE[ROOT].ob_tail ) { if (gl_wtop != NIL) { /* open or close with */ /* other windows open */ w_getsize(WS_CURR, gl_wtop, pt); rc_union(pt, &c); /* if it was an open */ /* then draw the */ /* old top guy */ /* covered */ if ( (oldtop != NIL ) && (oldtop != w_handle) ) { /* BUGFIX 2/20/86 LKW */ /* only an open if prev */ /* size was zero. */ w_getsize(WS_PREV, gl_wtop, &pprev); if (rc_equal(&pprev, &gl_rzero)) w_clipdraw(oldtop, 0, MAX_DEPTH, 2); /* */ } } } c.g_w += 2; /* account for drop shadow*/ c.g_h += 2; /* BUGFIX in 2.1 */ /* update the desktop */ /* background */ if (start == DESKWH) w_drawdesk(&c); /* start the redrawing */ w_update(start, &c, stop, moved, TRUE); }