From: Chris Hanson Date: Tue, 24 Jul 1990 22:17:12 +0000 (+0000) Subject: Fix `graphics-clear' of X window to respect the clip rectangle. X-Git-Tag: 20090517-FFI~11299 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=934b7211563560f78a0803501179bb28619f3741;p=mit-scheme.git Fix `graphics-clear' of X window to respect the clip rectangle. --- diff --git a/v7/src/microcode/version.h b/v7/src/microcode/version.h index 132a4007b..337ce4133 100644 --- a/v7/src/microcode/version.h +++ b/v7/src/microcode/version.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.38 1990/07/16 22:07:38 markf Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.39 1990/07/24 22:16:52 cph Exp $ Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology @@ -46,7 +46,7 @@ MIT in each case. */ #define VERSION 11 #endif #ifndef SUBVERSION -#define SUBVERSION 38 +#define SUBVERSION 39 #endif #ifndef UCODE_TABLES_FILENAME diff --git a/v7/src/microcode/x11.h b/v7/src/microcode/x11.h index 119b3fbbf..4e3b8448d 100644 --- a/v7/src/microcode/x11.h +++ b/v7/src/microcode/x11.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/x11.h,v 1.5 1990/07/16 20:52:47 markf Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/x11.h,v 1.6 1990/07/24 22:16:59 cph Exp $ Copyright (c) 1989, 1990 Massachusetts Institute of Technology @@ -81,6 +81,12 @@ struct xwindow int x_size; int y_size; + /* The clip rectangle. */ + int clip_x; + int clip_y; + int clip_width; + int clip_height; + struct drawing_attributes attributes; /* Standard graphics contexts. */ @@ -148,6 +154,10 @@ extern Boolean x_wait_for_event (); #define XW_WINDOW(xw) ((xw) -> window) #define XW_X_SIZE(xw) ((xw) -> x_size) #define XW_Y_SIZE(xw) ((xw) -> y_size) +#define XW_CLIP_X(xw) ((xw) -> clip_x) +#define XW_CLIP_Y(xw) ((xw) -> clip_y) +#define XW_CLIP_WIDTH(xw) ((xw) -> clip_width) +#define XW_CLIP_HEIGHT(xw) ((xw) -> clip_height) #define XW_BORDER_WIDTH(xw) (((xw) -> attributes) . border_width) #define XW_INTERNAL_BORDER_WIDTH(xw) \ (((xw) -> attributes) . internal_border_width) diff --git a/v7/src/microcode/x11base.c b/v7/src/microcode/x11base.c index 02c0460fd..57ccc0c10 100644 --- a/v7/src/microcode/x11base.c +++ b/v7/src/microcode/x11base.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/x11base.c,v 1.10 1990/07/22 06:40:36 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/x11base.c,v 1.11 1990/07/24 22:17:04 cph Exp $ Copyright (c) 1989, 1990 Massachusetts Institute of Technology @@ -351,6 +351,10 @@ x_make_window (display, window, x_size, y_size, attributes, extra, deallocator, (XW_WINDOW (xw)) = window; (XW_X_SIZE (xw)) = x_size; (XW_Y_SIZE (xw)) = y_size; + (XW_CLIP_X (xw)) = 0; + (XW_CLIP_Y (xw)) = 0; + (XW_CLIP_WIDTH (xw)) = x_size; + (XW_CLIP_HEIGHT (xw)) = y_size; (xw -> attributes) = (* attributes); (XW_NORMAL_GC (xw)) = normal_gc; (XW_REVERSE_GC (xw)) = reverse_gc; @@ -1008,11 +1012,17 @@ DEFINE_PRIMITIVE ("X-WINDOW-BEEP", Prim_x_window_beep, 1, 1, 0) DEFINE_PRIMITIVE ("X-WINDOW-CLEAR", Prim_x_window_clear, 1, 1, 0) { - struct xwindow * xw; PRIMITIVE_HEADER (1); - - xw = (WINDOW_ARG (1)); - XClearWindow ((XW_DISPLAY (xw)), (XW_WINDOW (xw))); + { + struct xwindow * xw = (WINDOW_ARG (1)); + XClearArea ((XW_DISPLAY (xw)), + (XW_WINDOW (xw)), + (XW_CLIP_X (xw)), + (XW_CLIP_Y (xw)), + (XW_CLIP_WIDTH (xw)), + (XW_CLIP_HEIGHT (xw)), + False); + } PRIMITIVE_RETURN (UNSPECIFIC); } diff --git a/v7/src/microcode/x11graph.c b/v7/src/microcode/x11graph.c index 49f3a5e7a..84c973e35 100644 --- a/v7/src/microcode/x11graph.c +++ b/v7/src/microcode/x11graph.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/x11graph.c,v 1.5 1990/07/16 21:03:07 markf Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/x11graph.c,v 1.6 1990/07/24 22:17:12 cph Exp $ Copyright (c) 1989, 1990 Massachusetts Institute of Technology @@ -111,10 +111,18 @@ set_clip_rectangle (xw, x_left, y_bottom, x_right, y_top) y_top = y_bottom; y_bottom = y; } - ((rectangles [0]) . x) = x_left; - ((rectangles [0]) . y) = y_top; - ((rectangles [0]) . width) = ((x_right + 1) - x_left); - ((rectangles [0]) . height) = ((y_bottom + 1) - y_top); + { + int width = ((x_right + 1) - x_left); + int height = ((y_bottom + 1) - y_top); + (XW_CLIP_X (xw)) = x_left; + (XW_CLIP_Y (xw)) = y_top; + (XW_CLIP_WIDTH (xw)) = width; + (XW_CLIP_HEIGHT (xw)) = height; + ((rectangles [0]) . x) = x_left; + ((rectangles [0]) . y) = y_top; + ((rectangles [0]) . width) = width; + ((rectangles [0]) . height) = height; + } XSetClipRectangles (display, (XW_NORMAL_GC (xw)), diff --git a/v8/src/microcode/version.h b/v8/src/microcode/version.h index 185cc6760..433a1adc3 100644 --- a/v8/src/microcode/version.h +++ b/v8/src/microcode/version.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.38 1990/07/16 22:07:38 markf Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.39 1990/07/24 22:16:52 cph Exp $ Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology @@ -46,7 +46,7 @@ MIT in each case. */ #define VERSION 11 #endif #ifndef SUBVERSION -#define SUBVERSION 38 +#define SUBVERSION 39 #endif #ifndef UCODE_TABLES_FILENAME