X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=ncurses%2Fbase%2Flib_window.c;h=c740ea13d798f02d55189d7fe368d7350868b99e;hb=f5da57ad7eb397b1001e2fca9cb0e278a6564716;hp=bb20f4faf2a2eb2bad27b7f68409f1520bb8b8f9;hpb=027ae42953e3186daed8f3882da73de48291b606;p=ncurses.git diff --git a/ncurses/base/lib_window.c b/ncurses/base/lib_window.c index bb20f4fa..c740ea13 100644 --- a/ncurses/base/lib_window.c +++ b/ncurses/base/lib_window.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2002,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_window.c,v 1.22 2006/05/27 19:21:19 tom Exp $") +MODULE_ID("$Id: lib_window.c,v 1.27 2009/10/24 22:12:46 tom Exp $") NCURSES_EXPORT(void) _nc_synchook(WINDOW *win) @@ -58,7 +58,7 @@ mvderwin(WINDOW *win, int y, int x) WINDOW *orig; int i; - T((T_CALLED("mvderwin(%p,%d,%d)"), win, y, x)); + T((T_CALLED("mvderwin(%p,%d,%d)"), (void *) win, y, x)); if (win && (orig = win->_parent)) { if (win->_parx == x && win->_pary == y) @@ -82,7 +82,7 @@ NCURSES_EXPORT(int) syncok(WINDOW *win, bool bf) /* enable/disable automatic wsyncup() on each change to window */ { - T((T_CALLED("syncok(%p,%d)"), win, bf)); + T((T_CALLED("syncok(%p,%d)"), (void *) win, bf)); if (win) { win->_sync = bf; @@ -98,7 +98,7 @@ wsyncup(WINDOW *win) { WINDOW *wp; - T((T_CALLED("wsyncup(%p)"), win)); + T((T_CALLED("wsyncup(%p)"), (void *) win)); if (win && win->_parent) { for (wp = win; wp->_parent; wp = wp->_parent) { int y; @@ -128,7 +128,7 @@ wsyncdown(WINDOW *win) /* mark changed every cell in win that is changed in any of its ancestors */ /* Rewritten by J. Pfeifer, 1-Apr-96 (don't even think that...) */ { - T((T_CALLED("wsyncdown(%p)"), win)); + T((T_CALLED("wsyncdown(%p)"), (void *) win)); if (win && win->_parent) { WINDOW *pp = win->_parent; @@ -149,7 +149,7 @@ wsyncdown(WINDOW *win) /* left and right character in child coordinates */ int left = pp->_line[win->_pary + y].firstchar - win->_parx; int right = pp->_line[win->_pary + y].lastchar - win->_parx; - /* The change maybe outside the childs range */ + /* The change may be outside the child's range */ if (left < 0) left = 0; if (right > win->_maxx) @@ -167,7 +167,7 @@ wcursyncup(WINDOW *win) { WINDOW *wp; - T((T_CALLED("wcursyncup(%p)"), win)); + T((T_CALLED("wcursyncup(%p)"), (void *) win)); for (wp = win; wp && wp->_parent; wp = wp->_parent) { wmove(wp->_parent, wp->_pary + wp->_cury, wp->_parx + wp->_curx); } @@ -182,18 +182,23 @@ dupwin(WINDOW *win) size_t linesize; int i; - T((T_CALLED("dupwin(%p)"), win)); + T((T_CALLED("dupwin(%p)"), (void *) win)); if (win != 0) { - +#if NCURSES_SP_FUNCS + SCREEN *sp = _nc_screen_of(win); +#endif + _nc_lock_global(curses); if (win->_flags & _ISPAD) { - nwin = newpad(win->_maxy + 1, - win->_maxx + 1); + nwin = NCURSES_SP_NAME(newpad) (NCURSES_SP_ARGx + win->_maxy + 1, + win->_maxx + 1); } else { - nwin = newwin(win->_maxy + 1, - win->_maxx + 1, - win->_begy, - win->_begx); + nwin = NCURSES_SP_NAME(newwin) (NCURSES_SP_ARGx + win->_maxy + 1, + win->_maxx + 1, + win->_begy, + win->_begx); } if (nwin != 0) { @@ -243,6 +248,7 @@ dupwin(WINDOW *win) nwin->_line[i].lastchar = win->_line[i].lastchar; } } + _nc_unlock_global(curses); } returnWin(nwin); }