Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libcurses Fix resize of windows with subwins.



details:   https://anonhg.NetBSD.org/src/rev/c4bb39218c5b
branches:  trunk
changeset: 543106:c4bb39218c5b
user:      dsl <dsl%NetBSD.org@localhost>
date:      Mon Feb 17 11:07:19 2003 +0000

description:
Fix resize of windows with subwins.
Let window size be given as a -ver number => lines from bottom.
Fix trace calls of pointers
(approved by Brett Lumn)

diffstat:

 lib/libcurses/addbytes.c       |    6 +-
 lib/libcurses/attributes.c     |   12 +-
 lib/libcurses/background.c     |    8 +-
 lib/libcurses/color.c          |    6 +-
 lib/libcurses/curses_private.h |    9 +-
 lib/libcurses/erase.c          |    6 +-
 lib/libcurses/getch.c          |    6 +-
 lib/libcurses/getstr.c         |    6 +-
 lib/libcurses/insdelln.c       |    6 +-
 lib/libcurses/keypad.c         |    6 +-
 lib/libcurses/newwin.c         |   55 ++++++-----
 lib/libcurses/overlay.c        |    6 +-
 lib/libcurses/overwrite.c      |    6 +-
 lib/libcurses/refresh.c        |   16 +-
 lib/libcurses/resize.c         |  198 +++++++++++++++++++++-------------------
 lib/libcurses/screen.c         |   16 +-
 lib/libcurses/scroll.c         |    6 +-
 lib/libcurses/toucholap.c      |    6 +-
 lib/libcurses/touchwin.c       |   12 +-
 19 files changed, 202 insertions(+), 190 deletions(-)

diffs (truncated from 1058 to 300 lines):

diff -r 79aaf0406e29 -r c4bb39218c5b lib/libcurses/addbytes.c
--- a/lib/libcurses/addbytes.c  Mon Feb 17 10:32:02 2003 +0000
+++ b/lib/libcurses/addbytes.c  Mon Feb 17 11:07:19 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: addbytes.c,v 1.24 2002/12/23 12:26:07 jdc Exp $        */
+/*     $NetBSD: addbytes.c,v 1.25 2003/02/17 11:07:19 dsl Exp $        */
 
 /*
  * Copyright (c) 1987, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)addbytes.c 8.4 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: addbytes.c,v 1.24 2002/12/23 12:26:07 jdc Exp $");
+__RCSID("$NetBSD: addbytes.c,v 1.25 2003/02/17 11:07:19 dsl Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -135,7 +135,7 @@
 
                default:
 #ifdef DEBUG
-                       __CTRACE("ADDBYTES(%0.2o, %d, %d)\n", win, y, x);
+                       __CTRACE("ADDBYTES(%p, %d, %d)\n", win, y, x);
 #endif
 
                        lp = win->lines[y];
diff -r 79aaf0406e29 -r c4bb39218c5b lib/libcurses/attributes.c
--- a/lib/libcurses/attributes.c        Mon Feb 17 10:32:02 2003 +0000
+++ b/lib/libcurses/attributes.c        Mon Feb 17 11:07:19 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: attributes.c,v 1.10 2003/01/27 21:04:10 jdc Exp $      */
+/*     $NetBSD: attributes.c,v 1.11 2003/02/17 11:07:19 dsl Exp $      */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: attributes.c,v 1.10 2003/01/27 21:04:10 jdc Exp $");
+__RCSID("$NetBSD: attributes.c,v 1.11 2003/02/17 11:07:19 dsl Exp $");
 #endif                         /* not lint */
 
 #include "curses.h"
@@ -91,7 +91,7 @@
 wattron(WINDOW *win, int attr)
 {
 #ifdef DEBUG
-       __CTRACE ("wattron: win %0.2o, attr %08x\n", win, attr);
+       __CTRACE ("wattron: win %p, attr %08x\n", win, attr);
 #endif
        /* If can enter modes, set the relevent attribute bits. */
        if (__tc_me != NULL) {
@@ -133,7 +133,7 @@
 wattroff(WINDOW *win, int attr)
 {
 #ifdef DEBUG
-       __CTRACE ("wattroff: win %0.2o, attr %08x\n", win, attr);
+       __CTRACE ("wattroff: win %p, attr %08x\n", win, attr);
 #endif
        /* If can do exit modes, unset the relevent attribute bits. */
        if (__tc_me != NULL) {
@@ -170,7 +170,7 @@
 wattrset(WINDOW *win, int attr)
 {
 #ifdef DEBUG
-       __CTRACE ("wattrset: win %0.2o, attr %08x\n", win, attr);
+       __CTRACE ("wattrset: win %p, attr %08x\n", win, attr);
 #endif
        wattron(win, attr);
        wattroff(win, (~attr & ~__COLOR) | ((attr & __COLOR) ? 0 : __COLOR));
@@ -185,7 +185,7 @@
 getattrs(WINDOW *win)
 {
 #ifdef DEBUG
-       __CTRACE ("getattrs: win %0.2o\n", win);
+       __CTRACE ("getattrs: win %p\n", win);
 #endif
        return((chtype) win->wattr);
 }
diff -r 79aaf0406e29 -r c4bb39218c5b lib/libcurses/background.c
--- a/lib/libcurses/background.c        Mon Feb 17 10:32:02 2003 +0000
+++ b/lib/libcurses/background.c        Mon Feb 17 11:07:19 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: background.c,v 1.7 2002/08/04 16:43:05 jdc Exp $       */
+/*     $NetBSD: background.c,v 1.8 2003/02/17 11:07:19 dsl Exp $       */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: background.c,v 1.7 2002/08/04 16:43:05 jdc Exp $");
+__RCSID("$NetBSD: background.c,v 1.8 2003/02/17 11:07:19 dsl Exp $");
 #endif                         /* not lint */
 
 #include "curses.h"
@@ -72,7 +72,7 @@
 wbkgdset(WINDOW *win, chtype ch)
 {
 #ifdef DEBUG
-       __CTRACE("wbkgdset: (%0.2o), '%s', %08x\n",
+       __CTRACE("wbkgdset: (%p), '%s', %08x\n",
            win, unctrl(ch & +__CHARTEXT), ch & __ATTRIBUTES);
 #endif
 
@@ -96,7 +96,7 @@
        int     y, x;
 
 #ifdef DEBUG
-       __CTRACE("wbkgd: (%0.2o), '%s', %08x\n",
+       __CTRACE("wbkgd: (%p), '%s', %08x\n",
            win, unctrl(ch & +__CHARTEXT), ch & __ATTRIBUTES);
 #endif
 
diff -r 79aaf0406e29 -r c4bb39218c5b lib/libcurses/color.c
--- a/lib/libcurses/color.c     Mon Feb 17 10:32:02 2003 +0000
+++ b/lib/libcurses/color.c     Mon Feb 17 11:07:19 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: color.c,v 1.22 2003/01/27 21:06:16 jdc Exp $   */
+/*     $NetBSD: color.c,v 1.23 2003/02/17 11:07:19 dsl Exp $   */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: color.c,v 1.22 2003/01/27 21:06:16 jdc Exp $");
+__RCSID("$NetBSD: color.c,v 1.23 2003/02/17 11:07:19 dsl Exp $");
 #endif                         /* not lint */
 
 #include "curses.h"
@@ -546,7 +546,7 @@
 
        for (wlp = __winlistp; wlp != NULL; wlp = wlp->nextp) {
 #ifdef DEBUG
-               __CTRACE("__change_pair: win = %0.2o\n", wlp->winp);
+               __CTRACE("__change_pair: win = %p\n", wlp->winp);
 #endif
                win = wlp->winp;
                if (win == curscr) {
diff -r 79aaf0406e29 -r c4bb39218c5b lib/libcurses/curses_private.h
--- a/lib/libcurses/curses_private.h    Mon Feb 17 10:32:02 2003 +0000
+++ b/lib/libcurses/curses_private.h    Mon Feb 17 11:07:19 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: curses_private.h,v 1.28 2003/01/27 21:09:20 jdc Exp $  */
+/*     $NetBSD: curses_private.h,v 1.29 2003/02/17 11:07:19 dsl Exp $  */
 
 /*-
  * Copyright (c) 1998-2000 Brett Lymn
@@ -99,7 +99,8 @@
        int begy, begx;                 /* Window home. */
        int cury, curx;                 /* Current x, y coordinates. */
        int maxy, maxx;                 /* Maximum values for curx, cury. */
-       short ch_off;                   /* x offset for firstch/lastch. */
+       int reqy, reqx;                 /* Size requested when created */
+       int ch_off;                     /* x offset for firstch/lastch. */
        __LINE **lines;                 /* Array of pointers to the lines */
        __LINE  *lspace;                /* line space (for cleanup) */
        __LDATA *wspace;                /* window space (for cleanup) */
@@ -164,7 +165,7 @@
        WINDOW  *stdscr;        /* Standard screen. */
        WINDOW  *__virtscr;     /* Virtual screen (for doupdate()). */
        int      curwin;        /* current window for refresh */
-       short    lx, ly;        /* loop parameters for refresh */
+       int      lx, ly;        /* loop parameters for refresh */
        int      COLS;          /* Columns on the screen. */
        int      LINES;         /* Lines on the screen. */
        int      COLORS;        /* Maximum colors on the screen */
@@ -254,7 +255,7 @@
 
 /* Private functions. */
 #ifdef DEBUG
-void    __CTRACE(const char *, ...);
+void    __CTRACE(const char *, ...) __attribute__((__format__(__printf__, 1, 0)));
 #endif
 void     __cputchar_args(char, void *);
 void     _cursesi_free_keymap(keymap_t *);
diff -r 79aaf0406e29 -r c4bb39218c5b lib/libcurses/erase.c
--- a/lib/libcurses/erase.c     Mon Feb 17 10:32:02 2003 +0000
+++ b/lib/libcurses/erase.c     Mon Feb 17 11:07:19 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: erase.c,v 1.15 2000/05/20 15:12:15 mycroft Exp $       */
+/*     $NetBSD: erase.c,v 1.16 2003/02/17 11:07:19 dsl Exp $   */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)erase.c    8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: erase.c,v 1.15 2000/05/20 15:12:15 mycroft Exp $");
+__RCSID("$NetBSD: erase.c,v 1.16 2003/02/17 11:07:19 dsl Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -71,7 +71,7 @@
        __LDATA *sp, *end, *start, *maxx;
 
 #ifdef DEBUG
-       __CTRACE("werase: (%0.2o)\n", win);
+       __CTRACE("werase: (%p)\n", win);
 #endif
 #ifdef __GNUC__
        maxx = NULL;            /* XXX gcc -Wuninitialized */
diff -r 79aaf0406e29 -r c4bb39218c5b lib/libcurses/getch.c
--- a/lib/libcurses/getch.c     Mon Feb 17 10:32:02 2003 +0000
+++ b/lib/libcurses/getch.c     Mon Feb 17 11:07:19 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getch.c,v 1.38 2002/12/23 12:11:38 jdc Exp $   */
+/*     $NetBSD: getch.c,v 1.39 2003/02/17 11:07:20 dsl Exp $   */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)getch.c    8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: getch.c,v 1.38 2002/12/23 12:11:38 jdc Exp $");
+__RCSID("$NetBSD: getch.c,v 1.39 2003/02/17 11:07:20 dsl Exp $");
 #endif
 #endif                                 /* not lint */
 
@@ -847,7 +847,7 @@
        if (is_wintouched(win))
                wrefresh(win);
 #ifdef DEBUG
-       __CTRACE("wgetch: __echoit = %d, __rawmode = %d, flags = %0.2o\n",
+       __CTRACE("wgetch: __echoit = %d, __rawmode = %d, flags = %#.4x\n",
            __echoit, __rawmode, win->flags);
 #endif
        if (__echoit && !__rawmode) {
diff -r 79aaf0406e29 -r c4bb39218c5b lib/libcurses/getstr.c
--- a/lib/libcurses/getstr.c    Mon Feb 17 10:32:02 2003 +0000
+++ b/lib/libcurses/getstr.c    Mon Feb 17 11:07:19 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getstr.c,v 1.16 2002/01/02 10:38:27 blymn Exp $        */
+/*     $NetBSD: getstr.c,v 1.17 2003/02/17 11:07:20 dsl Exp $  */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)getstr.c   8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: getstr.c,v 1.16 2002/01/02 10:38:27 blymn Exp $");
+__RCSID("$NetBSD: getstr.c,v 1.17 2003/02/17 11:07:20 dsl Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -176,7 +176,7 @@
 
        while ((c = wgetch(win)) != ERR && c != '\n' && c != '\r') {
 #ifdef DEBUG
-               __CTRACE("__wgetnstr: win %0.2o, char 0x%x, remain %d\n", win,
+               __CTRACE("__wgetnstr: win %p, char 0x%x, remain %d\n", win,
                    c, remain);
 #endif
                *str = c;
diff -r 79aaf0406e29 -r c4bb39218c5b lib/libcurses/insdelln.c
--- a/lib/libcurses/insdelln.c  Mon Feb 17 10:32:02 2003 +0000
+++ b/lib/libcurses/insdelln.c  Mon Feb 17 11:07:19 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: insdelln.c,v 1.8 2001/04/20 12:56:08 jdc Exp $ */
+/*     $NetBSD: insdelln.c,v 1.9 2003/02/17 11:07:20 dsl Exp $ */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: insdelln.c,v 1.8 2001/04/20 12:56:08 jdc Exp $");
+__RCSID("$NetBSD: insdelln.c,v 1.9 2003/02/17 11:07:20 dsl Exp $");
 #endif                         /* not lint */
 
 /* 
@@ -77,7 +77,7 @@
        __LINE *temp;
 
 #ifdef DEBUG
-       __CTRACE("winsdelln: (%0.2o) cury=%d lines=%d\n", win, win->cury,
+       __CTRACE("winsdelln: (%p) cury=%d lines=%d\n", win, win->cury,
            lines);
 #endif
 
diff -r 79aaf0406e29 -r c4bb39218c5b lib/libcurses/keypad.c
--- a/lib/libcurses/keypad.c    Mon Feb 17 10:32:02 2003 +0000
+++ b/lib/libcurses/keypad.c    Mon Feb 17 11:07:19 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: keypad.c,v 1.8 2001/06/13 10:45:57 wiz Exp $  */
+/*     $NetBSD: keypad.c,v 1.9 2003/02/17 11:07:20 dsl Exp $  */
 
 /*-
  * Copyright (c) 1998-1999 Brett Lymn (blymn%baea.com.au@localhost, brett_lymn%yahoo.com@localhost)
@@ -28,7 +28,7 @@
 



Home | Main Index | Thread Index | Old Index