From: Chris Hanson Date: Wed, 15 Feb 2006 05:10:00 +0000 (+0000) Subject: Change XTERM-RECONFIGURE primitive so that it's arguments are given in X-Git-Tag: 20090517-FFI~1096 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=1812efe247c8a69e540d86cd2a2c14ee88c5533e;p=mit-scheme.git Change XTERM-RECONFIGURE primitive so that it's arguments are given in character cells rather than in pixels. --- diff --git a/v7/src/edwin/xterm.scm b/v7/src/edwin/xterm.scm index f7a1d0f8e..94d2f5d43 100644 --- a/v7/src/edwin/xterm.scm +++ b/v7/src/edwin/xterm.scm @@ -1,10 +1,10 @@ #| -*-Scheme-*- -$Id: xterm.scm,v 1.74 2005/11/12 22:31:01 cph Exp $ +$Id: xterm.scm,v 1.75 2006/02/15 05:10:00 cph Exp $ Copyright 1989,1990,1991,1992,1993,1995 Massachusetts Institute of Technology Copyright 1996,1998,1999,2000,2001,2002 Massachusetts Institute of Technology -Copyright 2003,2005 Massachusetts Institute of Technology +Copyright 2003,2005,2006 Massachusetts Institute of Technology This file is part of MIT/GNU Scheme. @@ -696,9 +696,9 @@ USA. (let ((xterm (screen-xterm screen)) (x-size (vector-ref event 2)) (y-size (vector-ref event 3))) - (xterm-reconfigure xterm x-size y-size) (let ((x-size (xterm-map-x-size xterm x-size)) (y-size (xterm-map-y-size xterm y-size))) + (xterm-reconfigure xterm x-size y-size) (if (not (and (= x-size (screen-x-size screen)) (= y-size (screen-y-size screen)))) (begin diff --git a/v7/src/microcode/x11term.c b/v7/src/microcode/x11term.c index 30ba60e68..169cde99a 100644 --- a/v7/src/microcode/x11term.c +++ b/v7/src/microcode/x11term.c @@ -1,9 +1,9 @@ /* -*-C-*- -$Id: x11term.c,v 1.31 2005/11/13 03:45:59 cph Exp $ +$Id: x11term.c,v 1.32 2006/02/15 05:09:50 cph Exp $ Copyright 1989,1990,1991,1992,1993,1995 Massachusetts Institute of Technology -Copyright 2000,2005 Massachusetts Institute of Technology +Copyright 2000,2005,2006 Massachusetts Institute of Technology This file is part of MIT/GNU Scheme. @@ -324,16 +324,11 @@ DEFUN (xterm_dump_rectangle, (xw, x, y, width, height), static void DEFUN (xterm_reconfigure, (xw, width, height), struct xwindow * xw AND - unsigned int width AND - unsigned int height) + unsigned int x_csize AND + unsigned int y_csize) { - unsigned int extra = (2 * (XW_INTERNAL_BORDER_WIDTH (xw))); - unsigned int x_size = ((width < extra) ? 0 : (width - extra)); - unsigned int y_size = ((height < extra) ? 0 : (height - extra)); - if ((x_size != (XW_X_SIZE (xw))) || (y_size != (XW_Y_SIZE (xw)))) + if ((x_csize != (XW_X_CSIZE (xw))) || (y_csize != (XW_Y_CSIZE (xw)))) { - unsigned int x_csize = (x_size / (FONT_WIDTH (XW_FONT (xw)))); - unsigned int y_csize = (y_size / (FONT_HEIGHT (XW_FONT (xw)))); char * new_char_map = (x_malloc (x_csize * y_csize)); char * new_hl_map = (x_malloc (x_csize * y_csize)); unsigned int old_x_csize = (XW_X_CSIZE (xw)); @@ -381,12 +376,16 @@ DEFUN (xterm_reconfigure, (xw, width, height), } free (XW_CHARACTER_MAP (xw)); free (XW_HIGHLIGHT_MAP (xw)); - (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; + { + unsigned int x_size = (XTERM_X_PIXEL (xw, x_csize)); + unsigned int y_size = (XTERM_Y_PIXEL (xw, x_csize)); + (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_X_CSIZE (xw)) = x_csize; (XW_Y_CSIZE (xw)) = y_csize; (XW_CHARACTER_MAP (xw))= new_char_map;