Annotations for lib_newwin.c *************** 1.20 (Alexande 23-May-98): /**************************************************************************** 1.75 (tom 02-Feb-20): * Copyright 2020 Thomas E. Dickey * 1.75 (tom 02-Feb-20): * Copyright 1998-2016,2017 Free Software Foundation, Inc. * 1.20 (Alexande 23-May-98): * * 1.20 (Alexande 23-May-98): * Permission is hereby granted, free of charge, to any person obtaining a * 1.20 (Alexande 23-May-98): * copy of this software and associated documentation files (the * 1.20 (Alexande 23-May-98): * "Software"), to deal in the Software without restriction, including * 1.20 (Alexande 23-May-98): * without limitation the rights to use, copy, modify, merge, publish, * 1.20 (Alexande 23-May-98): * distribute, distribute with modifications, sublicense, and/or sell * 1.20 (Alexande 23-May-98): * copies of the Software, and to permit persons to whom the Software is * 1.20 (Alexande 23-May-98): * furnished to do so, subject to the following conditions: * 1.20 (Alexande 23-May-98): * * 1.20 (Alexande 23-May-98): * The above copyright notice and this permission notice shall be included * 1.20 (Alexande 23-May-98): * in all copies or substantial portions of the Software. * 1.20 (Alexande 23-May-98): * * 1.20 (Alexande 23-May-98): * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 1.20 (Alexande 23-May-98): * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 1.20 (Alexande 23-May-98): * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 1.20 (Alexande 23-May-98): * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 1.20 (Alexande 23-May-98): * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 1.20 (Alexande 23-May-98): * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 1.20 (Alexande 23-May-98): * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 1.20 (Alexande 23-May-98): * * 1.20 (Alexande 23-May-98): * Except as contained in this notice, the name(s) of the above copyright * 1.20 (Alexande 23-May-98): * holders shall not be used in advertising or otherwise to promote the * 1.20 (Alexande 23-May-98): * sale, use or other dealings in this Software without prior written * 1.20 (Alexande 23-May-98): * authorization. * 1.20 (Alexande 23-May-98): ****************************************************************************/ 1.20 (Alexande 23-May-98): 1.20 (Alexande 23-May-98): /**************************************************************************** 1.20 (Alexande 23-May-98): * Author: Zeyd M. Ben-Halim 1992,1995 * 1.20 (Alexande 23-May-98): * and: Eric S. Raymond * 1.36 (tom 09-Apr-05): * and: Thomas E. Dickey 1996-on * 1.53 (tom 15-Feb-09): * and: Juergen Pfeifer 2009 * 1.20 (Alexande 23-May-98): ****************************************************************************/ 1.20 (Alexande 23-May-98): 1.20 (Alexande 23-May-98): /* 1.20 (Alexande 23-May-98): ** lib_newwin.c 1.20 (Alexande 23-May-98): ** 1.20 (Alexande 23-May-98): ** The routines newwin(), subwin() and their dependent 1.20 (Alexande 23-May-98): ** 1.20 (Alexande 23-May-98): */ 1.20 (Alexande 23-May-98): 1.20 (Alexande 23-May-98): #include 1.45 (tom 23-Feb-08): #include 1.20 (Alexande 23-May-98): 1.75 (tom 02-Feb-20): MODULE_ID("$Id: lib_newwin.c,v 1.75 2020/02/02 23:34:34 tom Exp $") 1.46 (tom 05-Apr-08): 1.50 (tom 03-May-08): #define window_is(name) ((sp)->_##name == win) 1.46 (tom 05-Apr-08): 1.46 (tom 05-Apr-08): #if USE_REENTRANT 1.46 (tom 05-Apr-08): #define remove_window(name) \ 1.50 (tom 03-May-08): sp->_##name = 0 1.46 (tom 05-Apr-08): #else 1.46 (tom 05-Apr-08): #define remove_window(name) \ 1.50 (tom 03-May-08): sp->_##name = 0; \ 1.46 (tom 05-Apr-08): if (win == name) \ 1.46 (tom 05-Apr-08): name = 0 1.46 (tom 05-Apr-08): #endif 1.34 (tom 18-Aug-02): 1.48 (tom 03-May-08): static void 1.34 (tom 18-Aug-02): remove_window_from_screen(WINDOW *win) 1.34 (tom 18-Aug-02): { 1.50 (tom 03-May-08): SCREEN *sp; 1.34 (tom 18-Aug-02): 1.59 (tom 30-Aug-09): #ifdef USE_SP_WINDOWLIST 1.59 (tom 30-Aug-09): if ((sp = _nc_screen_of(win)) != 0) { 1.59 (tom 30-Aug-09): if (window_is(curscr)) { 1.59 (tom 30-Aug-09): remove_window(curscr); 1.59 (tom 30-Aug-09): } else if (window_is(stdscr)) { 1.59 (tom 30-Aug-09): remove_window(stdscr); 1.59 (tom 30-Aug-09): } else if (window_is(newscr)) { 1.59 (tom 30-Aug-09): remove_window(newscr); 1.59 (tom 30-Aug-09): } 1.59 (tom 30-Aug-09): } 1.59 (tom 30-Aug-09): #else 1.50 (tom 03-May-08): for (each_screen(sp)) { 1.46 (tom 05-Apr-08): if (window_is(curscr)) { 1.46 (tom 05-Apr-08): remove_window(curscr); 1.48 (tom 03-May-08): break; 1.46 (tom 05-Apr-08): } else if (window_is(stdscr)) { 1.46 (tom 05-Apr-08): remove_window(stdscr); 1.48 (tom 03-May-08): break; 1.46 (tom 05-Apr-08): } else if (window_is(newscr)) { 1.46 (tom 05-Apr-08): remove_window(newscr); 1.48 (tom 03-May-08): break; 1.34 (tom 18-Aug-02): } 1.34 (tom 18-Aug-02): } 1.59 (tom 30-Aug-09): #endif 1.34 (tom 18-Aug-02): } 1.20 (Alexande 23-May-98): 1.26 (tom 10-Dec-00): NCURSES_EXPORT(int) 1.27 (tom 10-Dec-00): _nc_freewin(WINDOW *win) 1.20 (Alexande 23-May-98): { 1.25 (tom 28-Oct-00): int result = ERR; 1.59 (tom 30-Aug-09): #ifdef USE_SP_WINDOWLIST 1.59 (tom 30-Aug-09): SCREEN *sp = _nc_screen_of(win); /* pretend this is parameter */ 1.59 (tom 30-Aug-09): #endif 1.20 (Alexande 23-May-98): 1.61 (tom 24-Oct-09): T((T_CALLED("_nc_freewin(%p)"), (void *) win)); 1.42 (tom 22-Dec-07): 1.23 (tom 29-Apr-00): if (win != 0) { 1.72 (tom 28-May-16): 1.59 (tom 30-Aug-09): if (_nc_nonsp_try_global(curses) == 0) { 1.72 (tom 28-May-16): WINDOWLIST *p, *q; 1.72 (tom 28-May-16): 1.47 (tom 03-May-08): q = 0; 1.73 (tom 25-Mar-17): for (each_window(sp, p)) { 1.72 (tom 28-May-16): 1.42 (tom 22-Dec-07): if (&(p->win) == win) { 1.42 (tom 22-Dec-07): remove_window_from_screen(win); 1.42 (tom 22-Dec-07): if (q == 0) 1.73 (tom 25-Mar-17): WindowList(sp) = p->next; 1.42 (tom 22-Dec-07): else 1.42 (tom 22-Dec-07): q->next = p->next; 1.42 (tom 22-Dec-07): 1.42 (tom 22-Dec-07): if (!(win->_flags & _SUBWIN)) { 1.72 (tom 28-May-16): int i; 1.72 (tom 28-May-16): 1.42 (tom 22-Dec-07): for (i = 0; i <= win->_maxy; i++) 1.42 (tom 22-Dec-07): FreeIfNeeded(win->_line[i].text); 1.42 (tom 22-Dec-07): } 1.42 (tom 22-Dec-07): free(win->_line); 1.42 (tom 22-Dec-07): free(p); 1.42 (tom 22-Dec-07): 1.42 (tom 22-Dec-07): result = OK; 1.61 (tom 24-Oct-09): T(("...deleted win=%p", (void *) win)); 1.42 (tom 22-Dec-07): break; 1.20 (Alexande 23-May-98): } 1.47 (tom 03-May-08): q = p; 1.23 (tom 29-Apr-00): } 1.59 (tom 30-Aug-09): _nc_nonsp_unlock_global(curses); 1.20 (Alexande 23-May-98): } 1.23 (tom 29-Apr-00): } 1.42 (tom 22-Dec-07): returnCode(result); 1.20 (Alexande 23-May-98): } 1.20 (Alexande 23-May-98): 1.26 (tom 10-Dec-00): NCURSES_EXPORT(WINDOW *) 1.53 (tom 15-Feb-09): NCURSES_SP_NAME(newwin) (NCURSES_SP_DCLx 1.53 (tom 15-Feb-09): int num_lines, int num_columns, int begy, int begx) 1.20 (Alexande 23-May-98): { 1.23 (tom 29-Apr-00): WINDOW *win; 1.29 (skimo 03-Jun-01): NCURSES_CH_T *ptr; 1.23 (tom 29-Apr-00): int i; 1.23 (tom 29-Apr-00): 1.61 (tom 24-Oct-09): T((T_CALLED("newwin(%p, %d,%d,%d,%d)"), (void *) SP_PARM, num_lines, num_columns, 1.59 (tom 30-Aug-09): begy, begx)); 1.23 (tom 29-Apr-00): 1.70 (tom 28-May-11): if (begy < 0 1.70 (tom 28-May-11): || begx < 0 1.70 (tom 28-May-11): || num_lines < 0 1.70 (tom 28-May-11): || num_columns < 0 1.70 (tom 28-May-11): || SP_PARM == 0) 1.23 (tom 29-Apr-00): returnWin(0); 1.23 (tom 29-Apr-00): 1.23 (tom 29-Apr-00): if (num_lines == 0) 1.53 (tom 15-Feb-09): num_lines = SP_PARM->_lines_avail - begy; 1.23 (tom 29-Apr-00): if (num_columns == 0) 1.54 (tom 18-Apr-09): num_columns = screen_columns(SP_PARM) - begx; 1.23 (tom 29-Apr-00): 1.55 (tom 09-May-09): win = NCURSES_SP_NAME(_nc_makenew) (NCURSES_SP_ARGx 1.55 (tom 09-May-09): num_lines, num_columns, begy, begx, 0); 1.55 (tom 09-May-09): if (win == 0) 1.23 (tom 29-Apr-00): returnWin(0); 1.23 (tom 29-Apr-00): 1.23 (tom 29-Apr-00): for (i = 0; i < num_lines; i++) { 1.29 (skimo 03-Jun-01): win->_line[i].text = typeCalloc(NCURSES_CH_T, (unsigned) num_columns); 1.24 (tom 29-Apr-00): if (win->_line[i].text == 0) { 1.25 (tom 28-Oct-00): (void) _nc_freewin(win); 1.23 (tom 29-Apr-00): returnWin(0); 1.20 (Alexande 23-May-98): } 1.28 (skimo 03-Jun-01): for (ptr = win->_line[i].text; 1.28 (skimo 03-Jun-01): ptr < win->_line[i].text + num_columns; 1.28 (skimo 03-Jun-01): ptr++) 1.28 (skimo 03-Jun-01): SetChar(*ptr, BLANK_TEXT, BLANK_ATTR); 1.23 (tom 29-Apr-00): } 1.20 (Alexande 23-May-98): 1.23 (tom 29-Apr-00): returnWin(win); 1.20 (Alexande 23-May-98): } 1.20 (Alexande 23-May-98): 1.53 (tom 15-Feb-09): #if NCURSES_SP_FUNCS 1.53 (tom 15-Feb-09): NCURSES_EXPORT(WINDOW *) 1.53 (tom 15-Feb-09): newwin(int num_lines, int num_columns, int begy, int begx) 1.53 (tom 15-Feb-09): { 1.59 (tom 30-Aug-09): WINDOW *win; 1.59 (tom 30-Aug-09): _nc_sp_lock_global(curses); 1.59 (tom 30-Aug-09): win = NCURSES_SP_NAME(newwin) (CURRENT_SCREEN, 1.59 (tom 30-Aug-09): num_lines, num_columns, begy, begx); 1.59 (tom 30-Aug-09): _nc_sp_unlock_global(curses); 1.59 (tom 30-Aug-09): return (win); 1.53 (tom 15-Feb-09): } 1.53 (tom 15-Feb-09): #endif 1.53 (tom 15-Feb-09): 1.26 (tom 10-Dec-00): NCURSES_EXPORT(WINDOW *) 1.32 (tom 26-Aug-01): derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx) 1.20 (Alexande 23-May-98): { 1.23 (tom 29-Apr-00): WINDOW *win; 1.23 (tom 29-Apr-00): int i; 1.23 (tom 29-Apr-00): int flags = _SUBWIN; 1.59 (tom 30-Aug-09): #if NCURSES_SP_FUNCS 1.59 (tom 30-Aug-09): SCREEN *sp = _nc_screen_of(orig); 1.59 (tom 30-Aug-09): #endif 1.20 (Alexande 23-May-98): 1.61 (tom 24-Oct-09): T((T_CALLED("derwin(%p,%d,%d,%d,%d)"), (void *) orig, num_lines, num_columns, 1.25 (tom 28-Oct-00): begy, begx)); 1.20 (Alexande 23-May-98): 1.23 (tom 29-Apr-00): /* 1.32 (tom 26-Aug-01): * make sure window fits inside the original one 1.23 (tom 29-Apr-00): */ 1.69 (tom 07-Mar-11): if (begy < 0 || begx < 0 || orig == 0 || num_lines < 0 || num_columns < 0) 1.23 (tom 29-Apr-00): returnWin(0); 1.23 (tom 29-Apr-00): if (begy + num_lines > orig->_maxy + 1 1.23 (tom 29-Apr-00): || begx + num_columns > orig->_maxx + 1) 1.23 (tom 29-Apr-00): returnWin(0); 1.20 (Alexande 23-May-98): 1.23 (tom 29-Apr-00): if (num_lines == 0) 1.23 (tom 29-Apr-00): num_lines = orig->_maxy + 1 - begy; 1.20 (Alexande 23-May-98): 1.23 (tom 29-Apr-00): if (num_columns == 0) 1.23 (tom 29-Apr-00): num_columns = orig->_maxx + 1 - begx; 1.20 (Alexande 23-May-98): 1.23 (tom 29-Apr-00): if (orig->_flags & _ISPAD) 1.23 (tom 29-Apr-00): flags |= _ISPAD; 1.20 (Alexande 23-May-98): 1.55 (tom 09-May-09): win = NCURSES_SP_NAME(_nc_makenew) (NCURSES_SP_ARGx num_lines, num_columns, 1.55 (tom 09-May-09): orig->_begy + begy, 1.55 (tom 09-May-09): orig->_begx + begx, flags); 1.55 (tom 09-May-09): if (win == 0) 1.23 (tom 29-Apr-00): returnWin(0); 1.20 (Alexande 23-May-98): 1.23 (tom 29-Apr-00): win->_pary = begy; 1.23 (tom 29-Apr-00): win->_parx = begx; 1.37 (tom 27-May-06): WINDOW_ATTRS(win) = WINDOW_ATTRS(orig); 1.33 (tom 19-Dec-01): win->_nc_bkgd = orig->_nc_bkgd; 1.20 (Alexande 23-May-98): 1.23 (tom 29-Apr-00): for (i = 0; i < num_lines; i++) 1.23 (tom 29-Apr-00): win->_line[i].text = &orig->_line[begy++].text[begx]; 1.20 (Alexande 23-May-98): 1.23 (tom 29-Apr-00): win->_parent = orig; 1.20 (Alexande 23-May-98): 1.23 (tom 29-Apr-00): returnWin(win); 1.20 (Alexande 23-May-98): } 1.20 (Alexande 23-May-98): 1.26 (tom 10-Dec-00): NCURSES_EXPORT(WINDOW *) 1.32 (tom 26-Aug-01): subwin(WINDOW *w, int l, int c, int y, int x) 1.20 (Alexande 23-May-98): { 1.71 (tom 28-May-11): WINDOW *result = 0; 1.71 (tom 28-May-11): 1.61 (tom 24-Oct-09): T((T_CALLED("subwin(%p, %d, %d, %d, %d)"), (void *) w, l, c, y, x)); 1.71 (tom 28-May-11): if (w != 0) { 1.71 (tom 28-May-11): T(("parent has begy = %ld, begx = %ld", (long) w->_begy, (long) w->_begx)); 1.20 (Alexande 23-May-98): 1.71 (tom 28-May-11): result = derwin(w, l, c, y - w->_begy, x - w->_begx); 1.71 (tom 28-May-11): } 1.71 (tom 28-May-11): returnWin(result); 1.20 (Alexande 23-May-98): } 1.20 (Alexande 23-May-98): 1.24 (tom 29-Apr-00): static bool 1.24 (tom 29-Apr-00): dimension_limit(int value) 1.24 (tom 29-Apr-00): { 1.66 (tom 24-Apr-10): NCURSES_SIZE_T test = (NCURSES_SIZE_T) value; 1.24 (tom 29-Apr-00): return (test == value && value > 0); 1.24 (tom 29-Apr-00): } 1.24 (tom 29-Apr-00): 1.26 (tom 10-Dec-00): NCURSES_EXPORT(WINDOW *) 1.54 (tom 18-Apr-09): NCURSES_SP_NAME(_nc_makenew) (NCURSES_SP_DCLx 1.54 (tom 18-Apr-09): int num_lines, 1.54 (tom 18-Apr-09): int num_columns, 1.54 (tom 18-Apr-09): int begy, 1.54 (tom 18-Apr-09): int begx, 1.54 (tom 18-Apr-09): int flags) 1.20 (Alexande 23-May-98): { 1.23 (tom 29-Apr-00): int i; 1.23 (tom 29-Apr-00): WINDOWLIST *wp; 1.23 (tom 29-Apr-00): WINDOW *win; 1.60 (tom 06-Sep-09): bool is_padwin = (flags & _ISPAD); 1.23 (tom 29-Apr-00): 1.55 (tom 09-May-09): T((T_CALLED("_nc_makenew(%p,%d,%d,%d,%d)"), 1.61 (tom 24-Oct-09): (void *) SP_PARM, num_lines, num_columns, begy, begx)); 1.23 (tom 29-Apr-00): 1.54 (tom 18-Apr-09): if (SP_PARM == 0) 1.39 (tom 03-Feb-07): returnWin(0); 1.36 (tom 09-Apr-05): 1.24 (tom 29-Apr-00): if (!dimension_limit(num_lines) || !dimension_limit(num_columns)) 1.39 (tom 03-Feb-07): returnWin(0); 1.23 (tom 29-Apr-00): 1.23 (tom 29-Apr-00): if ((wp = typeCalloc(WINDOWLIST, 1)) == 0) 1.39 (tom 03-Feb-07): returnWin(0); 1.23 (tom 29-Apr-00): 1.32 (tom 26-Aug-01): win = &(wp->win); 1.23 (tom 29-Apr-00): 1.23 (tom 29-Apr-00): if ((win->_line = typeCalloc(struct ldat, ((unsigned) num_lines))) == 0) { 1.65 (Nicholas 14-Nov-09): free(wp); 1.39 (tom 03-Feb-07): returnWin(0); 1.23 (tom 29-Apr-00): } 1.23 (tom 29-Apr-00): 1.59 (tom 30-Aug-09): _nc_nonsp_lock_global(curses); 1.42 (tom 22-Dec-07): 1.23 (tom 29-Apr-00): win->_curx = 0; 1.23 (tom 29-Apr-00): win->_cury = 0; 1.66 (tom 24-Apr-10): win->_maxy = (NCURSES_SIZE_T) (num_lines - 1); 1.66 (tom 24-Apr-10): win->_maxx = (NCURSES_SIZE_T) (num_columns - 1); 1.66 (tom 24-Apr-10): win->_begy = (NCURSES_SIZE_T) begy; 1.66 (tom 24-Apr-10): win->_begx = (NCURSES_SIZE_T) begx; 1.54 (tom 18-Apr-09): win->_yoffset = SP_PARM->_topstolen; 1.23 (tom 29-Apr-00): 1.66 (tom 24-Apr-10): win->_flags = (short) flags; 1.37 (tom 27-May-06): WINDOW_ATTRS(win) = A_NORMAL; 1.33 (tom 19-Dec-01): SetChar(win->_nc_bkgd, BLANK_TEXT, BLANK_ATTR); 1.23 (tom 29-Apr-00): 1.60 (tom 06-Sep-09): win->_clear = (is_padwin 1.54 (tom 18-Apr-09): ? FALSE 1.54 (tom 18-Apr-09): : (num_lines == screen_lines(SP_PARM) 1.54 (tom 18-Apr-09): && num_columns == screen_columns(SP_PARM))); 1.23 (tom 29-Apr-00): win->_idlok = FALSE; 1.23 (tom 29-Apr-00): win->_idcok = TRUE; 1.23 (tom 29-Apr-00): win->_scroll = FALSE; 1.23 (tom 29-Apr-00): win->_leaveok = FALSE; 1.23 (tom 29-Apr-00): win->_use_keypad = FALSE; 1.23 (tom 29-Apr-00): win->_delay = -1; 1.23 (tom 29-Apr-00): win->_immed = FALSE; 1.23 (tom 29-Apr-00): win->_sync = 0; 1.23 (tom 29-Apr-00): win->_parx = -1; 1.23 (tom 29-Apr-00): win->_pary = -1; 1.23 (tom 29-Apr-00): win->_parent = 0; 1.23 (tom 29-Apr-00): 1.23 (tom 29-Apr-00): win->_regtop = 0; 1.66 (tom 24-Apr-10): win->_regbottom = (NCURSES_SIZE_T) (num_lines - 1); 1.23 (tom 29-Apr-00): 1.23 (tom 29-Apr-00): win->_pad._pad_y = -1; 1.23 (tom 29-Apr-00): win->_pad._pad_x = -1; 1.23 (tom 29-Apr-00): win->_pad._pad_top = -1; 1.23 (tom 29-Apr-00): win->_pad._pad_bottom = -1; 1.23 (tom 29-Apr-00): win->_pad._pad_left = -1; 1.23 (tom 29-Apr-00): win->_pad._pad_right = -1; 1.20 (Alexande 23-May-98): 1.23 (tom 29-Apr-00): for (i = 0; i < num_lines; i++) { 1.23 (tom 29-Apr-00): /* 1.23 (tom 29-Apr-00): * This used to do 1.23 (tom 29-Apr-00): * 1.23 (tom 29-Apr-00): * win->_line[i].firstchar = win->_line[i].lastchar = _NOCHANGE; 1.23 (tom 29-Apr-00): * 1.23 (tom 29-Apr-00): * which marks the whole window unchanged. That's how 1.23 (tom 29-Apr-00): * SVr1 curses did it, but SVr4 curses marks the whole new 1.23 (tom 29-Apr-00): * window changed. 1.23 (tom 29-Apr-00): * 1.23 (tom 29-Apr-00): * With the old SVr1-like code, say you have stdscr full of 1.23 (tom 29-Apr-00): * characters, then create a new window with newwin(), 1.23 (tom 29-Apr-00): * then do a printw(win, "foo ");, the trailing spaces are 1.23 (tom 29-Apr-00): * completely ignored by the following refreshes. So, you 1.23 (tom 29-Apr-00): * get "foojunkjunk" on the screen instead of "foo " as 1.23 (tom 29-Apr-00): * you actually intended. 1.23 (tom 29-Apr-00): * 1.23 (tom 29-Apr-00): * SVr4 doesn't do this. Instead the spaces are actually written. 1.23 (tom 29-Apr-00): * So that's how we want ncurses to behave. 1.23 (tom 29-Apr-00): */ 1.23 (tom 29-Apr-00): win->_line[i].firstchar = 0; 1.66 (tom 24-Apr-10): win->_line[i].lastchar = (NCURSES_SIZE_T) (num_columns - 1); 1.23 (tom 29-Apr-00): 1.23 (tom 29-Apr-00): if_USE_SCROLL_HINTS(win->_line[i].oldindex = i); 1.23 (tom 29-Apr-00): } 1.23 (tom 29-Apr-00): 1.60 (tom 06-Sep-09): if (!is_padwin && (begx + num_columns == screen_columns(SP_PARM))) { 1.23 (tom 29-Apr-00): win->_flags |= _ENDLINE; 1.23 (tom 29-Apr-00): 1.54 (tom 18-Apr-09): if (begx == 0 && num_lines == screen_lines(SP_PARM) && begy == 0) 1.23 (tom 29-Apr-00): win->_flags |= _FULLWIN; 1.23 (tom 29-Apr-00): 1.54 (tom 18-Apr-09): if (begy + num_lines == screen_lines(SP_PARM)) 1.23 (tom 29-Apr-00): win->_flags |= _SCROLLWIN; 1.23 (tom 29-Apr-00): } 1.23 (tom 29-Apr-00): 1.55 (tom 09-May-09): wp->next = WindowList(SP_PARM); 1.54 (tom 18-Apr-09): wp->screen = SP_PARM; 1.55 (tom 09-May-09): WindowList(SP_PARM) = wp; 1.20 (Alexande 23-May-98): 1.61 (tom 24-Oct-09): T((T_CREATE("window %p"), (void *) win)); 1.20 (Alexande 23-May-98): 1.59 (tom 30-Aug-09): _nc_nonsp_unlock_global(curses); 1.39 (tom 03-Feb-07): returnWin(win); 1.20 (Alexande 23-May-98): } 1.51 (tom 31-May-08): 1.51 (tom 31-May-08): /* 1.51 (tom 31-May-08): * wgetch() and other functions with a WINDOW* parameter may use a SCREEN* 1.51 (tom 31-May-08): * internally, and it is useful to allow those to be invoked without switching 1.51 (tom 31-May-08): * SCREEN's, e.g., for multi-threaded applications. 1.51 (tom 31-May-08): */ 1.57 (tom 09-May-09): #if NCURSES_SP_FUNCS 1.55 (tom 09-May-09): NCURSES_EXPORT(WINDOW *) 1.55 (tom 09-May-09): _nc_curscr_of(SCREEN *sp) 1.55 (tom 09-May-09): { 1.74 (tom 13-May-17): return (sp == 0) ? NULL : CurScreen(sp); 1.55 (tom 09-May-09): } 1.55 (tom 09-May-09): 1.55 (tom 09-May-09): NCURSES_EXPORT(WINDOW *) 1.55 (tom 09-May-09): _nc_newscr_of(SCREEN *sp) 1.55 (tom 09-May-09): { 1.74 (tom 13-May-17): return (sp == 0) ? NULL : NewScreen(sp); 1.55 (tom 09-May-09): } 1.55 (tom 09-May-09): 1.55 (tom 09-May-09): NCURSES_EXPORT(WINDOW *) 1.55 (tom 09-May-09): _nc_stdscr_of(SCREEN *sp) 1.55 (tom 09-May-09): { 1.74 (tom 13-May-17): return (sp == 0) ? NULL : StdScreen(sp); 1.55 (tom 09-May-09): } 1.57 (tom 09-May-09): #endif