Fix `graphics-clear' of X window to respect the clip rectangle.
authorChris Hanson <org/chris-hanson/cph>
Tue, 24 Jul 1990 22:17:12 +0000 (22:17 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 24 Jul 1990 22:17:12 +0000 (22:17 +0000)
v7/src/microcode/version.h
v7/src/microcode/x11.h
v7/src/microcode/x11base.c
v7/src/microcode/x11graph.c
v8/src/microcode/version.h

index 132a4007b695af4b00f7cbaf8200c4190453677a..337ce41337e5f0c7ede78cbac81dcee02ed98bb5 100644 (file)
@@ -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
index 119b3fbbf3ad3593aa992aa2b0e37167121c761b..4e3b8448df2ddd65c0c1799b088208941f2cfac9 100644 (file)
@@ -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)
index 02c0460fd1f08f12e904af4763a9f5352bd6d549..57ccc0c10d22212071ef392817cd1eeded15a0ee 100644 (file)
@@ -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);
 }
 
index 49f3a5e7ae1cd3613f7d0d6ba60d64747a6b25ab..84c973e3502dfb53040099134dc0b4f08ee2f662 100644 (file)
@@ -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)),
index 185cc67603908c1d508b6a86adf3a4f767024706..433a1adc3290d81b856145f93d3a4b623647fbf4 100644 (file)
@@ -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