Source-Changes-HG archive

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

[src/trunk]: src/lib/libcurses Add mvderwin function.



details:   https://anonhg.NetBSD.org/src/rev/a1c31de89709
branches:  trunk
changeset: 515914:a1c31de89709
user:      blymn <blymn%NetBSD.org@localhost>
date:      Mon Oct 08 10:45:13 2001 +0000

description:
Add mvderwin function.

diffstat:

 lib/libcurses/PSD.doc/fns.doc |  12 ++++++++++++
 lib/libcurses/curses.3        |   3 ++-
 lib/libcurses/curses.h        |   3 ++-
 lib/libcurses/mvwin.c         |  28 ++++++++++++++++++++++++++--
 4 files changed, 42 insertions(+), 4 deletions(-)

diffs (105 lines):

diff -r b5338e39f754 -r a1c31de89709 lib/libcurses/PSD.doc/fns.doc
--- a/lib/libcurses/PSD.doc/fns.doc     Mon Oct 08 10:14:41 2001 +0000
+++ b/lib/libcurses/PSD.doc/fns.doc     Mon Oct 08 10:45:13 2001 +0000
@@ -786,6 +786,18 @@
 should be used to move the cursor position,
 so that the routines know what's going on.
 .Ds
+.Fn mvderwin "WINDOW *win" "int y" "int x"
+.De
+Moves the subwindow
+.Vn win
+to the location
+.Vn y\*,x ) (
+where the location is relative to the top left hand corner of the
+parent window.  This call will return ERR if 
+.Vn win
+is not a subwindow or if the relocated window would lie outside the
+parent window.
+.Ds
 .Fn mvhline "int y" "int x" "chtype ch" "int count"
 .De
 Moves the cursor to the position
diff -r b5338e39f754 -r a1c31de89709 lib/libcurses/curses.3
--- a/lib/libcurses/curses.3    Mon Oct 08 10:14:41 2001 +0000
+++ b/lib/libcurses/curses.3    Mon Oct 08 10:45:13 2001 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: curses.3,v 1.32 2001/09/20 11:11:54 blymn Exp $
+.\"    $NetBSD: curses.3,v 1.33 2001/10/08 10:45:13 blymn Exp $
 .\"
 .\" Copyright (c) 1985, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -207,6 +207,7 @@
 .It move(y,x)  move to (y,x) on
 .Em stdscr
 .It mvcur(lasty,lastx,newy,newx)       actually move cursor
+.It mvderwin(win, y, x)                move window to (y,x) within parent window.
 .It mvgetnstr(str, len)        move to
 .Em y ,
 .Em x 
diff -r b5338e39f754 -r a1c31de89709 lib/libcurses/curses.h
--- a/lib/libcurses/curses.h    Mon Oct 08 10:14:41 2001 +0000
+++ b/lib/libcurses/curses.h    Mon Oct 08 10:45:13 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: curses.h,v 1.59 2001/09/20 11:11:54 blymn Exp $        */
+/*     $NetBSD: curses.h,v 1.60 2001/10/08 10:45:13 blymn Exp $        */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -661,6 +661,7 @@
 char   *longname(void);
 int     meta(WINDOW *, bool);
 int     mvcur(int, int, int, int);
+int      mvderwin(WINDOW *, int, int);
 int     mvhline(int, int, chtype, int);
 int     mvprintw(int, int, const char *, ...)
                __attribute__((__format__(__printf__, 3, 4)));
diff -r b5338e39f754 -r a1c31de89709 lib/libcurses/mvwin.c
--- a/lib/libcurses/mvwin.c     Mon Oct 08 10:14:41 2001 +0000
+++ b/lib/libcurses/mvwin.c     Mon Oct 08 10:45:13 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mvwin.c,v 1.11 2000/04/15 13:17:04 blymn Exp $ */
+/*     $NetBSD: mvwin.c,v 1.12 2001/10/08 10:45:13 blymn Exp $ */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)mvwin.c    8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: mvwin.c,v 1.11 2000/04/15 13:17:04 blymn Exp $");
+__RCSID("$NetBSD: mvwin.c,v 1.12 2001/10/08 10:45:13 blymn Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -46,6 +46,30 @@
 #include "curses_private.h"
 
 /*
+ * mvderwin --
+ *      Move a derived window.
+ *
+ */
+int
+mvderwin(WINDOW *win, int dy, int dx)
+{
+       WINDOW *parent;
+       int x, y;
+       
+       if (win == NULL)
+               return ERR;
+
+       parent = win->orig;
+
+       if (parent == NULL)
+               return ERR;
+
+       x = parent->begx + dx;
+       y = parent->begy + dy;
+       return mvwin(win, y, x);
+}
+       
+/*
  * mvwin --
  *     Relocate the starting position of a window.
  */



Home | Main Index | Thread Index | Old Index