]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.7 - patch 20090411
authorThomas E. Dickey <dickey@invisible-island.net>
Sat, 11 Apr 2009 22:39:24 +0000 (22:39 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sat, 11 Apr 2009 22:39:24 +0000 (22:39 +0000)
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
  This change finishes merging for menu and panel libraries, does
  part of the form library.

31 files changed:
NEWS
dist.mk
form/fld_newftyp.c
form/form.priv.h
form/frm_sub.c
include/nc_panel.h
include/term_entry.h
man/form_field_validation.3x
menu/m_attribs.c
menu/m_new.c
menu/m_pad.c
menu/m_sub.c
menu/m_win.c
menu/menu.h
ncurses/base/lib_initscr.c
ncurses/base/nc_panel.c
ncurses/tinfo/access.c
panel/p_above.c
panel/p_below.c
panel/p_bottom.c
panel/p_delete.c
panel/p_hidden.c
panel/p_hide.c
panel/p_move.c
panel/p_new.c
panel/p_replace.c
panel/p_show.c
panel/p_update.c
panel/panel.c
panel/panel.h
panel/panel.priv.h

diff --git a/NEWS b/NEWS
index 4fd2b31314977b419fea7803e5042a33b99e499d..cfd83aa963a099b872650c68281e0f14c9f04844 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1379 2009/04/04 22:35:29 tom Exp $
+-- $Id: NEWS,v 1.1380 2009/04/11 22:00:37 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,11 @@ See the AUTHORS file for the corresponding full names.
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20090411
+       + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+         This change finishes merging for menu and panel libraries, does
+         part of the form library.
+
 20090404
        + suppress configure check for static/dynamic linker flags for gcc on
          Darwin (report by Nelson Beebe).
diff --git a/dist.mk b/dist.mk
index 59d6c2a102b060d6e024bf5334af9bc1cd30290b..f4ac795bd35335e760ee0450c70ff8144236c5d5 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.692 2009/04/04 18:57:01 tom Exp $
+# $Id: dist.mk,v 1.693 2009/04/11 20:38:16 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -37,7 +37,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 7
-NCURSES_PATCH = 20090404
+NCURSES_PATCH = 20090411
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index c2984b10e3c73ec6a44111662437ca2f39a6e88d..f101dce57b4ffce0fe5b8e107fcd2299237efa9a 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2007,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            *
@@ -32,9 +32,9 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_newftyp.c,v 1.15 2007/10/13 19:30:55 tom Exp $")
+MODULE_ID("$Id: fld_newftyp.c,v 1.16 2009/04/11 21:27:33 tom Exp $")
 
-static FIELDTYPE const default_fieldtype =
+static FIELDTYPE default_fieldtype =
 {
   0,                           /* status                                      */
   0L,                          /* reference count                             */
@@ -49,7 +49,7 @@ static FIELDTYPE const default_fieldtype =
   NULL                         /* enumerate previous function                 */
 };
 
-NCURSES_EXPORT_VAR(const FIELDTYPE *)
+NCURSES_EXPORT_VAR(FIELDTYPE *)
 _nc_Default_FieldType = &default_fieldtype;
 
 /*---------------------------------------------------------------------------
index fea627d30d7d9d1c213a84ead2c0c3afcf5171d8..82a844fa34820c34f8600cd7fe2b0d1ce90414d2 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2008 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            *
@@ -30,7 +30,7 @@
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
-/* $Id: form.priv.h,v 0.27 2008/09/08 20:29:05 tom Exp $ */
+/* $Id: form.priv.h,v 0.28 2009/04/11 21:27:04 tom Exp $ */
 
 #ifndef FORM_PRIV_H
 #define FORM_PRIV_H 1
 
 #include "form.h"
 
+       /***********************
+       *   Default objects    *
+       ***********************/
+extern NCURSES_EXPORT_VAR(FORM *)      _nc_Default_Form;
+extern NCURSES_EXPORT_VAR(FIELD *)     _nc_Default_Field;
+extern NCURSES_EXPORT_VAR(FIELDTYPE *) _nc_Default_FieldType;
+
 /* form  status values */
 #define _OVLMODE         (0x04U) /* Form is in overlay mode                */
 #define _WINDOW_MODIFIED (0x10U) /* Current field window has been modified */
 #define Normalize_Field(field) \
   ((field) = (field != 0) ? (field) : _nc_Default_Field)
 
+#if NCURSES_SP_FUNCS
+#define Get_Form_Screen(form) \
+  ((form)->win ? _nc_screen_of((form->win)):CURRENT_SCREEN)
+#endif
+
 /* Retrieve forms window */
 #define Get_Form_Window(form) \
   ((form)->sub?(form)->sub:((form)->win?(form)->win:stdscr))
@@ -144,8 +156,6 @@ TypeArgument;
 
 #define C_ZEROS '\0'
 
-extern NCURSES_EXPORT_VAR(const FIELDTYPE *) _nc_Default_FieldType;
-
 extern NCURSES_EXPORT(TypeArgument *) _nc_Make_Argument (const FIELDTYPE*, va_list*, int*);
 extern NCURSES_EXPORT(TypeArgument *) _nc_Copy_Argument (const FIELDTYPE*, const TypeArgument*, int*);
 extern NCURSES_EXPORT(void) _nc_Free_Argument (const FIELDTYPE*, TypeArgument*);
@@ -176,8 +186,8 @@ extern NCURSES_EXPORT(wchar_t *) _nc_Widen_String(char *, int *);
 extern NCURSES_EXPORT(FIELD **)            _nc_retrace_field_ptr (FIELD **);
 extern NCURSES_EXPORT(FIELD *)     _nc_retrace_field (FIELD *);
 extern NCURSES_EXPORT(FIELDTYPE *)  _nc_retrace_field_type (FIELDTYPE *);
-extern NCURSES_EXPORT(FORM *)  _nc_retrace_form (FORM *);
-extern NCURSES_EXPORT(Form_Hook)  _nc_retrace_form_hook (Form_Hook);
+extern NCURSES_EXPORT(FORM *)       _nc_retrace_form (FORM *);
+extern NCURSES_EXPORT(Form_Hook)    _nc_retrace_form_hook (Form_Hook);
 
 #else /* !TRACE */
 
index 6db0023db1ab56a3cc25ac0f32a82b72bae73f37..3c34bcf3974b78d9297651a4820fbc5529faf734 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2004,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            *
  ****************************************************************************/
 
 /****************************************************************************
- *   Author:  Juergen Pfeifer, 1995,1997                                    *
+ *   Author:  Juergen Pfeifer, 1995-1997,2009                               *
  ****************************************************************************/
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_sub.c,v 1.9 2004/12/11 22:13:39 tom Exp $")
+MODULE_ID("$Id: frm_sub.c,v 1.10 2009/04/11 18:32:47 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -50,9 +50,18 @@ set_form_sub(FORM *form, WINDOW *win)
 
   if (form && (form->status & _POSTED))
     RETURN(E_POSTED);
+  else
+    {
+#if NCURSES_SP_FUNCS
+      FORM *f = Normalize_Form(form);
 
-  Normalize_Form(form)->sub = win;
-  RETURN(E_OK);
+      f->sub = win ? win : Get_Form_Screen(f)->_stdscr;
+      RETURN(E_OK);
+#else
+      Normalize_Form(form)->sub = win;
+      RETURN(E_OK);
+#endif
+    }
 }
 
 /*---------------------------------------------------------------------------
index 6578577ee9887d4ac1738a75795d685d9692b07d..ece9594736835c8f58a2a529b49ce2460e0ab0de 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2008 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            *
@@ -33,7 +33,7 @@
 
 
 /*
- * $Id: nc_panel.h,v 1.5 2008/08/04 18:26:46 tom Exp $
+ * $Id: nc_panel.h,v 1.6 2009/04/11 21:17:57 tom Exp $
  *
  *     nc_panel.h
  *
@@ -62,6 +62,10 @@ struct panelhook {
 /* Retrieve the panelhook of the current screen */
 extern NCURSES_EXPORT(struct panelhook*) _nc_panelhook (void);
 
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(struct panelhook*) NCURSES_SP_NAME(_nc_panelhook) (SCREEN *);
+#endif
+
 #ifdef __cplusplus
 }
 #endif
index fb875407276fde5385522a62213ec56cc711f116..7b034cf96a44bb750091e18694e02c56709000e3 100644 (file)
@@ -32,7 +32,7 @@
  *     and: Thomas E. Dickey                        1998-on                 *
  ****************************************************************************/
 
-/* $Id: term_entry.h,v 1.35 2008/08/16 16:16:03 tom Exp $ */
+/* $Id: term_entry.h,v 1.36 2008/11/16 00:19:59 juergen Exp $ */
 
 /*
  *     term_entry.h -- interface to entry-manipulation code
@@ -81,7 +81,7 @@ ENTRY;
 #define EXT_NAMES(tp,i,limit,index,table) table[i]
 #endif
 
-#define NUM_EXT_NAMES(tp) ((tp)->ext_Booleans + (tp)->ext_Numbers + (tp)->ext_Strings)
+#define NUM_EXT_NAMES(tp) (unsigned) ((tp)->ext_Booleans + (tp)->ext_Numbers + (tp)->ext_Strings)
 
 #define for_each_boolean(n,tp) for(n = 0; n < NUM_BOOLEANS(tp); n++)
 #define for_each_number(n,tp)  for(n = 0; n < NUM_NUMBERS(tp);  n++)
index 2da52efd2e36392a7cfa0ae9da4985f3fb1a4343..1778bacbddc5e0311dfb87ea9fd0ffbf0aaf0f3e 100644 (file)
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: form_field_validation.3x,v 1.16 2006/12/24 16:08:08 tom Exp $
+.\" $Id: form_field_validation.3x,v 1.17 2008/12/14 19:22:16 juergen Exp $
 .TH form_field_validation 3X ""
 .SH NAME
 \fBform_field_validation\fR - data type validation for fields
@@ -70,9 +70,7 @@ argument pointing to a string list; a fourth \fBint\fR flag argument to enable
 case-sensitivity; and a fifth \fBint\fR flag argument specifying whether a partial
 match must be a unique one (if this flag is off, a prefix matches the first
 of any set of more than one list elements with that prefix). Please notice
-that the string list is not copied, only a reference to it is stored in the
-field. So you should avoid using a list that lives in automatic variables
-on the stack.
+that the string list is copied. So you may use a list that lives in automatic variables on the stack.
 .TP 5
 TYPE_INTEGER
 Integer data, parsable to an integer by \fBatoi(3)\fR.  Requires a third
index 1126ffb84f5a85de747ff5a28049e1647a549a69..388d2de66c46b5ba1afa96342653605f23ee6250 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_attribs.c,v 1.14 2004/12/11 23:29:12 tom Exp $")
+MODULE_ID("$Id: m_attribs.c,v 1.15 2008/11/16 00:19:59 juergen Exp $")
 
 /* Macro to redraw menu if it is posted and changed */
 #define Refresh_Menu(menu) \
@@ -49,9 +49,9 @@ MODULE_ID("$Id: m_attribs.c,v 1.14 2004/12/11 23:29:12 tom Exp $")
 
 /* "Template" macro to generate a function to set a menus attribute */
 #define GEN_MENU_ATTR_SET_FCT( name ) \
-NCURSES_IMPEXP int NCURSES_API set_menu_ ## name (MENU * menu, chtype attr)\
+NCURSES_IMPEXP int NCURSES_API set_menu_ ## name (MENU* menu, chtype attr) \
 {\
-   T((T_CALLED("set_menu_" #name "(%p,%s)"), menu, _traceattr(attr)));\
+  T((T_CALLED("set_menu_" #name "(%p,%s)"), menu, _traceattr(attr))); \
    if (!(attr==A_NORMAL || (attr & A_ATTRIBUTES)==attr))\
       RETURN(E_BAD_ARGUMENT);\
    if (menu && ( menu -> name != attr))\
@@ -140,4 +140,5 @@ GEN_MENU_ATTR_SET_FCT(grey)
 |   Return Values :  Attribute value
 +--------------------------------------------------------------------------*/
 GEN_MENU_ATTR_GET_FCT(grey)
+
 /* m_attribs.c ends here */
index c20c6651779058b8b3ce2b6a7b7b49cf10c46ce5..6068dc611b02ef7a5c08cdfb30290efc50aaafa3 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2006,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            *
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_new.c,v 1.18 2006/11/04 19:04:06 tom Exp $")
+MODULE_ID("$Id: m_new.c,v 1.19 2009/04/05 00:32:13 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
-|   Function      :  MENU *new_menu(ITEM **items)
+|   Function      :  MENU* _nc_new_menu(SCREEN*, ITEM **items)
 |   
 |   Description   :  Creates a new menu connected to the item pointer
 |                    array items and returns a pointer to the new menu.
@@ -51,18 +51,25 @@ MODULE_ID("$Id: m_new.c,v 1.18 2006/11/04 19:04:06 tom Exp $")
 |   Return Values :  NULL on error
 +--------------------------------------------------------------------------*/
 NCURSES_EXPORT(MENU *)
-new_menu(ITEM ** items)
+NCURSES_SP_NAME(new_menu) (NCURSES_SP_DCLx ITEM ** items)
 {
   int err = E_SYSTEM_ERROR;
   MENU *menu = (MENU *) calloc(1, sizeof(MENU));
 
-  T((T_CALLED("new_menu(%p)"), items));
+  T((T_CALLED("new_menu(%p,%p)"), SP_PARM, items));
   if (menu)
     {
       *menu = _nc_Default_Menu;
       menu->status = 0;
       menu->rows = menu->frows;
       menu->cols = menu->fcols;
+#if NCURSES_SP_FUNCS
+      /* This ensures userwin and usersub are always non-null,
+         so we can derive always the SCREEN that this menu is
+         running on. */
+      menu->userwin = SP_PARM->_stdscr;
+      menu->usersub = SP_PARM->_stdscr;
+#endif
       if (items && *items)
        {
          if (!_nc_Connect_Items(menu, items))
@@ -71,6 +78,8 @@ new_menu(ITEM ** items)
              free(menu);
              menu = (MENU *) 0;
            }
+         else
+           err = E_OK;
        }
     }
 
@@ -80,6 +89,25 @@ new_menu(ITEM ** items)
   returnMenu(menu);
 }
 
+/*---------------------------------------------------------------------------
+|   Facility      :  libnmenu  
+|   Function      :  MENU *new_menu(ITEM **items)
+|   
+|   Description   :  Creates a new menu connected to the item pointer
+|                    array items and returns a pointer to the new menu.
+|                    The new menu is initialized with the values from the
+|                    default menu.
+|
+|   Return Values :  NULL on error
++--------------------------------------------------------------------------*/
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(MENU *)
+new_menu(ITEM ** items)
+{
+  return NCURSES_SP_NAME(new_menu) (CURRENT_SCREEN, items);
+}
+#endif
+
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
 |   Function      :  int free_menu(MENU *menu)  
index 76083ba36d3468a3554bf007f6ba5022151312ad..79659aa233fbd82c3f4ce8e8ee974f49e8be57c4 100644 (file)
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_pad.c,v 1.10 2004/12/25 21:40:58 tom Exp $")
+MODULE_ID("$Id: m_pad.c,v 1.11 2009/02/07 23:11:44 tom Exp $")
 
 /* Macro to redraw menu if it is posted and changed */
 #define Refresh_Menu(menu) \
    if ( (menu) && ((menu)->status & _POSTED) )\
    {\
       _nc_Draw_Menu( menu );\
-      _nc_Show_Menu( menu );\
+      _nc_Show_Menu( menu ); \
    }
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
-|   Function      :  int set_menu_pad(MENU *menu, int pad)
+|   Function      :  int set_menu_pad(MENUmenu, int pad)
 |   
 |   Description   :  Set the character to be used to separate the item name
 |                    from its description. This must be a printable 
index 82649c57b130bc35f630f3e2e0aed374db679814..ae77f075809d48edd8133cb1d57477bd0f155484 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_sub.c,v 1.10 2004/12/25 21:38:31 tom Exp $")
+MODULE_ID("$Id: m_sub.c,v 1.11 2009/04/05 00:35:51 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -57,8 +57,22 @@ set_menu_sub(MENU * menu, WINDOW *win)
     {
       if (menu->status & _POSTED)
        RETURN(E_POSTED);
-      menu->usersub = win;
-      _nc_Calculate_Item_Length_and_Width(menu);
+      else
+#if NCURSES_SP_FUNCS
+       {
+         /* We ensure that usersub is never null. So even if a null
+            WINDOW parameter is passed, we store the SCREENS stdscr.
+            The only MENU that can have a null usersub is the static
+            _nc_default_Menu.
+          */
+         SCREEN *sp = _nc_screen_of(menu->usersub);
+
+         menu->usersub = win ? win : sp->_stdscr;
+         _nc_Calculate_Item_Length_and_Width(menu);
+       }
+#else
+       menu->usersub = win;
+#endif
     }
   else
     _nc_Default_Menu.usersub = win;
@@ -68,7 +82,7 @@ set_menu_sub(MENU * menu, WINDOW *win)
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
-|   Function      :  WINDOW *menu_sub(const MENU *menu)
+|   Function      :  WINDOWmenu_sub(const MENU *menu)
 |   
 |   Description   :  Returns a pointer to the subwindow of the menu
 |
index c3f857f716880d11fbf6ff7e73320a74a038e800..28715416ced7ebdaf904517f72aef25dde2dd6ed 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_win.c,v 1.15 2004/12/25 21:39:20 tom Exp $")
+MODULE_ID("$Id: m_win.c,v 1.16 2009/04/05 00:38:22 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -57,8 +57,22 @@ set_menu_win(MENU * menu, WINDOW *win)
     {
       if (menu->status & _POSTED)
        RETURN(E_POSTED);
-      menu->userwin = win;
-      _nc_Calculate_Item_Length_and_Width(menu);
+      else
+#if NCURSES_SP_FUNCS
+       {
+         /* We ensure that userwin is never null. So even if a null
+            WINDOW parameter is passed, we store the SCREENS stdscr.
+            The only MENU that can have a null userwin is the static
+            _nc_default_Menu.
+          */
+         SCREEN *sp = _nc_screen_of(menu->userwin);
+
+         menu->userwin = win ? win : sp->_stdscr;
+         _nc_Calculate_Item_Length_and_Width(menu);
+       }
+#else
+       menu->userwin = win;
+#endif
     }
   else
     _nc_Default_Menu.userwin = win;
@@ -68,7 +82,7 @@ set_menu_win(MENU * menu, WINDOW *win)
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
-|   Function      :  WINDOW *menu_win(const MENU *)
+|   Function      :  WINDOW* menu_win(const MENU*)
 |   
 |   Description   :  Returns pointer to the window of the menu
 |
@@ -80,7 +94,7 @@ menu_win(const MENU * menu)
   const MENU *m = Normalize_Menu(menu);
 
   T((T_CALLED("menu_win(%p)"), menu));
-  returnWin(m->userwin ? m->userwin : stdscr);
+  returnWin(Get_Menu_UserWin(m));
 }
 
 /* m_win.c ends here */
index 84352eb5d2f66f72767c2d4651b604c6cacc3477..4eeac018bdb36f4b0198f0cdb12993c2d20df7c6 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2007,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            *
@@ -30,7 +30,7 @@
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
-/* $Id: menu.h,v 1.19 2007/02/24 17:32:13 tom Exp $ */
+/* $Id: menu.h,v 1.20 2009/04/05 00:28:07 tom Exp $ */
 
 #ifndef ETI_MENU
 #define ETI_MENU
@@ -249,6 +249,10 @@ extern NCURSES_EXPORT(bool)        item_visible (const ITEM *);
 
 extern NCURSES_EXPORT(void)    menu_format (const MENU *,int *,int *);
 
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(MENU *)  NCURSES_SP_NAME(new_menu) (SCREEN*, ITEM **);
+#endif
+
 #ifdef __cplusplus
   }
 #endif
index b2fef0c1d0854651eb01eb9b39941afa3bb84cb0..334682fab71d187bc8c11fbca08988cb9fc5d0a0 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 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            *
@@ -45,7 +45,7 @@
 #include <sys/termio.h>                /* needed for ISC */
 #endif
 
-MODULE_ID("$Id: lib_initscr.c,v 1.38 2008/08/16 21:20:48 Werner.Fink Exp $")
+MODULE_ID("$Id: lib_initscr.c,v 1.39 2009/02/14 20:55:49 tom Exp $")
 
 NCURSES_EXPORT(WINDOW *)
 initscr(void)
@@ -90,7 +90,11 @@ initscr(void)
        }
 
        /* def_shell_mode - done in newterm/_nc_setupscreen */
+#if NCURSES_SP_FUNCS
+       NCURSES_SP_NAME(def_prog_mode) (CURRENT_SCREEN);
+#else
        def_prog_mode();
+#endif
     }
     result = stdscr;
     _nc_unlock_global(curses);
index 59bfbbe86ef6d0172796a6228f8808ec4d4a6507..69b10bc0c66223e86a5c4cd08dc37c2ae8d400b1 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2000,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            *
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: nc_panel.c,v 1.4 2000/12/10 02:43:28 tom Exp $")
+MODULE_ID("$Id: nc_panel.c,v 1.5 2009/04/11 21:05:10 tom Exp $")
 
+NCURSES_EXPORT(struct panelhook *)
+NCURSES_SP_NAME(_nc_panelhook) (NCURSES_SP_DCL0)
+{
+    return (SP_PARM
+           ? &(SP_PARM->_panelHook)
+           : (CURRENT_SCREEN
+              ? &(CURRENT_SCREEN->_panelHook)
+              : 0));
+}
+
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(struct panelhook *)
 _nc_panelhook(void)
 {
-    return (SP ? &(SP->_panelHook) : NULL);
+    return NCURSES_SP_NAME(_nc_panelhook) (CURRENT_SCREEN);
 }
+#endif
index ce8ccdac53f68cbbd2533733d9006441d85c7d1f..08091aa4057bb6cc74c5767cbda275258774b906 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2007,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            *
@@ -38,7 +38,7 @@
 #include <tic.h>
 #include <nc_alloc.h>
 
-MODULE_ID("$Id: access.c,v 1.14 2007/11/18 00:57:53 tom Exp $")
+MODULE_ID("$Id: access.c,v 1.15 2009/04/05 00:03:10 tom Exp $")
 
 #define LOWERCASE(c) ((isalpha(UChar(c)) && isupper(UChar(c))) ? tolower(UChar(c)) : (c))
 
@@ -97,7 +97,7 @@ _nc_pathlast(const char *path)
        test = path;
     else
        test++;
-    return (test - path);
+    return (unsigned) (test - path);
 }
 
 NCURSES_EXPORT(char *)
index 32495f627f2db93727be71e767091cfebbdac7d4..58db0e605b6efc9f1199462c9662f96b85ad26a6 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,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            *
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1997-1999,2008          *
  ****************************************************************************/
 
 /* p_above.c
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_above.c,v 1.6 2005/02/19 16:44:57 tom Exp $")
+MODULE_ID("$Id: p_above.c,v 1.7 2009/04/11 20:03:06 tom Exp $")
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(PANEL *)
+ground_panel(SCREEN * sp)
+{
+  T((T_CALLED("ground_panel(%p)"), sp));
+  if (sp)
+    {
+      struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp);
+
+      if (_nc_bottom_panel)    /* this is the pseudo panel */
+       returnPanel(_nc_bottom_panel->above);
+      else
+       returnPanel(0);
+    }
+  else
+    {
+      if (0 == CURRENT_SCREEN)
+       returnPanel(0);
+      else
+       returnPanel(ground_panel(CURRENT_SCREEN));
+    }
+}
+#endif
 
 NCURSES_EXPORT(PANEL *)
 panel_above(const PANEL * pan)
 {
+  PANEL *result;
+
   T((T_CALLED("panel_above(%p)"), pan));
-  if (!pan)
+  if (pan)
+    result = pan->above;
+  else
     {
+#if NCURSES_SP_FUNCS
+      result = ground_panel(CURRENT_SCREEN);
+#else
       /* if top and bottom are equal, we have no or only the pseudo panel;
          if not, we return the panel above the pseudo panel */
-      returnPanel(EMPTY_STACK()? (PANEL *) 0 : _nc_bottom_panel->above);
+      result = EMPTY_STACK()? (PANEL *) 0 : _nc_bottom_panel->above;
+#endif
     }
-  else
-    returnPanel(pan->above);
+  returnPanel(result);
 }
index c4b241015f5bfe6df483e70b9aee1fb7b81b5e1d..bf54ec593ecc9328e51789af6cd2b8bf619762f2 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,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            *
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1997-1999,2008          *
  ****************************************************************************/
 
 /* p_below.c
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_below.c,v 1.6 2005/02/19 16:45:10 tom Exp $")
+MODULE_ID("$Id: p_below.c,v 1.7 2009/04/11 20:17:59 tom Exp $")
 
+#if NCURSES_SP_FUNCS
 NCURSES_EXPORT(PANEL *)
-panel_below(const PANEL * pan)
+ceiling_panel(SCREEN * sp)
 {
-  T((T_CALLED("panel_below(%p)"), pan));
-  if (!pan)
+  T((T_CALLED("ceiling_panel(%p)"), sp));
+  if (sp)
     {
+      struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp);
+
       /* if top and bottom are equal, we have no or only the pseudo panel */
       returnPanel(EMPTY_STACK()? (PANEL *) 0 : _nc_top_panel);
     }
   else
     {
+      if (0 == CURRENT_SCREEN)
+       returnPanel(0);
+      else
+       returnPanel(ceiling_panel(CURRENT_SCREEN));
+    }
+}
+#endif
+
+NCURSES_EXPORT(PANEL *)
+panel_below(const PANEL * pan)
+{
+  PANEL *result;
+
+  T((T_CALLED("panel_below(%p)"), pan));
+  if (pan)
+    {
+      GetHook(pan);
       /* we must not return the pseudo panel */
-      returnPanel(Is_Pseudo(pan->below) ? (PANEL *) 0 : pan->below);
+      result = Is_Pseudo(pan->below) ? (PANEL *) 0 : pan->below;
+    }
+  else
+    {
+#if NCURSES_SP_FUNCS
+      result = ceiling_panel(CURRENT_SCREEN);
+#else
+      /* if top and bottom are equal, we have no or only the pseudo panel */
+      result = EMPTY_STACK()? (PANEL *) 0 : _nc_top_panel;
+#endif
     }
+  returnPanel(result);
 }
index b861fd9b2ce7189ec1dec9b93dbc16be849ae8aa..2a6a2addc52514bfa86afc1732bb488106661d21 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,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            *
@@ -29,6 +29,7 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1997-1999,2008          *
  ****************************************************************************/
 
 /* p_bottom.c
@@ -36,7 +37,7 @@
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_bottom.c,v 1.11 2005/02/19 16:38:16 tom Exp $")
+MODULE_ID("$Id: p_bottom.c,v 1.12 2008/11/16 00:19:59 juergen Exp $")
 
 NCURSES_EXPORT(int)
 bottom_panel(PANEL * pan)
@@ -46,6 +47,7 @@ bottom_panel(PANEL * pan)
   T((T_CALLED("bottom_panel(%p)"), pan));
   if (pan)
     {
+      GetHook(pan);
       if (!Is_Bottom(pan))
        {
 
index 24ee26b4ff23c3b14fabf744c1cd35c655053e5d..011703f5eadd2ecb0b1b2c6b605beef54ce28342 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,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            *
@@ -29,6 +29,7 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1999,2008               *
  ****************************************************************************/
 
 /* p_delete.c
@@ -36,7 +37,7 @@
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_delete.c,v 1.8 2005/02/19 16:38:45 tom Exp $")
+MODULE_ID("$Id: p_delete.c,v 1.9 2009/04/11 18:58:36 tom Exp $")
 
 NCURSES_EXPORT(int)
 del_panel(PANEL * pan)
@@ -47,8 +48,11 @@ del_panel(PANEL * pan)
   if (pan)
     {
       dBug(("--> del_panel %s", USER_PTR(pan->user)));
-      HIDE_PANEL(pan, err, OK);
-      free((void *)pan);
+      {
+       GetHook(pan);
+       HIDE_PANEL(pan, err, OK);
+       free((void *)pan);
+      }
     }
   else
     err = ERR;
index 624c07dae0bae8cc460d940fd909c56c8fc2185a..39b01cee5a31bc40e15793e00631a109e2847432 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,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            *
@@ -29,6 +29,7 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1997-1999,2008          *
  ****************************************************************************/
 
 /* p_hidden.c
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_hidden.c,v 1.7 2005/02/19 16:39:17 tom Exp $")
+MODULE_ID("$Id: p_hidden.c,v 1.8 2009/04/11 19:01:56 tom Exp $")
 
 NCURSES_EXPORT(int)
 panel_hidden(const PANEL * pan)
 {
+  int rc = ERR;
+
   T((T_CALLED("panel_hidden(%p)"), pan));
-  if (!pan)
-    returnCode(ERR);
-  returnCode(IS_LINKED(pan) ? FALSE : TRUE);
+  if (pan)
+    {
+      GetHook(pan);
+      rc = (IS_LINKED(pan) ? FALSE : TRUE);
+    }
+  returnCode(rc);
 }
index 08d8853a201c65213a08ea86eca7eb496ac03de2..efcd00e45706e463c8241ae3566de455be7dda7c 100644 (file)
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_hide.c,v 1.9 2005/02/19 16:39:41 tom Exp $")
+MODULE_ID("$Id: p_hide.c,v 1.10 2009/02/07 23:11:45 tom Exp $")
 
 NCURSES_EXPORT(int)
 hide_panel(register PANEL * pan)
 {
-  int err = OK;
+  int err = ERR;
 
   T((T_CALLED("hide_panel(%p)"), pan));
-  if (!pan)
-    returnCode(ERR);
 
-  dBug(("--> hide_panel %s", USER_PTR(pan->user)));
-  dStack("<u%d>", 1, pan);
+  if (pan)
+    {
+      GetHook(pan);
 
-  HIDE_PANEL(pan, err, ERR);
+      dBug(("--> hide_panel %s", USER_PTR(pan->user)));
+      dStack("<u%d>", 1, pan);
 
-  dStack("<u%d>", 9, pan);
+      HIDE_PANEL(pan, err, ERR);
 
+      err = OK;
+
+      dStack("<u%d>", 9, pan);
+    }
   returnCode(err);
 }
index 3818e8cba860c773c3f1606128497c545abc5632..a06e86b19989bd7ab479768c638bcc11ec5069d3 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,2008 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            *
@@ -29,6 +29,7 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1997-1999,2009          *
  ****************************************************************************/
 
 /* p_move.c
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_move.c,v 1.9 2005/02/19 16:46:49 tom Exp $")
+MODULE_ID("$Id: p_move.c,v 1.10 2008/11/16 00:19:59 juergen Exp $")
 
 NCURSES_EXPORT(int)
 move_panel(PANEL * pan, int starty, int startx)
 {
-  T((T_CALLED("move_panel(%p,%d,%d)"), pan, starty, startx));
+  int rc = ERR;
 
-  if (!pan)
-    returnCode(ERR);
+  T((T_CALLED("move_panel(%p,%d,%d)"), pan, starty, startx));
 
-  if (IS_LINKED(pan))
+  if (pan)
     {
-      Touchpan(pan);
-      PANEL_UPDATE(pan, (PANEL *) 0);
+      GetHook(pan);
+      if (IS_LINKED(pan))
+       {
+         Touchpan(pan);
+         PANEL_UPDATE(pan, (PANEL *) 0);
+       }
+      rc = mvwin(pan->win, starty, startx);
     }
-
-  returnCode(mvwin(pan->win, starty, startx));
+  returnCode(rc);
 }
index 2719316888e082a3d0dbffbe9b173e997e59300e..5d9d5082cf313436a3044029cee1edac27f75e1f 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2008 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            *
@@ -38,7 +38,7 @@
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_new.c,v 1.10 2008/08/04 18:25:48 tom Exp $")
+MODULE_ID("$Id: p_new.c,v 1.14 2009/04/11 20:43:04 tom Exp $")
 
 #ifdef TRACE
 static char *stdscr_id;
@@ -50,20 +50,27 @@ static char *new_id;
   Establish the pseudo panel for stdscr if necessary.
 --------------------------------------------------------------------------*/
 static PANEL *
-root_panel(void)
+root_panel(NCURSES_SP_DCL0)
 {
+#if NCURSES_SP_FUNCS
+  struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp);
+
+#elif NO_LEAKS
+  struct panelhook *ph = _nc_panelhook();
+#endif
+
   if (_nc_stdscr_pseudo_panel == (PANEL *) 0)
     {
 
-      assert(stdscr && !_nc_bottom_panel && !_nc_top_panel);
+      assert(SP_PARM && SP_PARM->_stdscr && !_nc_bottom_panel && !_nc_top_panel);
 #if NO_LEAKS
-      _nc_panelhook()->destroy = del_panel;
+      ph->destroy = del_panel;
 #endif
       _nc_stdscr_pseudo_panel = (PANEL *) malloc(sizeof(PANEL));
       if (_nc_stdscr_pseudo_panel != 0)
        {
          PANEL *pan = _nc_stdscr_pseudo_panel;
-         WINDOW *win = stdscr;
+         WINDOW *win = SP_PARM->_stdscr;
 
          pan->win = win;
          pan->below = (PANEL *) 0;
@@ -86,13 +93,15 @@ new_panel(WINDOW *win)
 {
   PANEL *pan = (PANEL *) 0;
 
+  GetWindowHook(win);
+
   T((T_CALLED("new_panel(%p)"), win));
 
   if (!win)
     returnPanel(pan);
 
   if (!_nc_stdscr_pseudo_panel)
-    (void)root_panel();
+    (void)root_panel(NCURSES_SP_ARG);
   assert(_nc_stdscr_pseudo_panel);
 
   if (!(win->_flags & _ISPAD) && (pan = (PANEL *) malloc(sizeof(PANEL))))
index 5d0d295c8b17e4a23875d257c601343fba077c15..b4bf6f4a36e66a926e9f4fa31f276f85287a6766 100644 (file)
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_replace.c,v 1.9 2005/02/19 16:41:31 tom Exp $")
+MODULE_ID("$Id: p_replace.c,v 1.10 2009/02/07 23:11:45 tom Exp $")
 
 NCURSES_EXPORT(int)
 replace_panel(PANEL * pan, WINDOW *win)
 {
-  T((T_CALLED("replace_panel(%p,%p)"), pan, win));
+  int rc = ERR;
 
-  if (!pan)
-    returnCode(ERR);
+  T((T_CALLED("replace_panel(%p,%p)"), pan, win));
 
-  if (IS_LINKED(pan))
+  if (pan)
     {
-      Touchpan(pan);
-      PANEL_UPDATE(pan, (PANEL *) 0);
+      GetHook(pan);
+      if (IS_LINKED(pan))
+       {
+         Touchpan(pan);
+         PANEL_UPDATE(pan, (PANEL *) 0);
+       }
+      pan->win = win;
+      rc = OK;
     }
-
-  pan->win = win;
-
-  returnCode(OK);
+  returnCode(rc);
 }
index 35eee237b958007d378339d8b4801e3d31881911..c517b4b1ca06f41a7eb7eb377fc6cd3ba41787d5 100644 (file)
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_show.c,v 1.11 2005/02/19 16:42:02 tom Exp $")
+MODULE_ID("$Id: p_show.c,v 1.12 2009/02/07 23:11:45 tom Exp $")
 
 NCURSES_EXPORT(int)
 show_panel(PANEL * pan)
 {
-  int err = OK;
+  int err = ERR;
 
   T((T_CALLED("show_panel(%p)"), pan));
 
-  if (!pan)
-    returnCode(ERR);
+  if (pan)
+    {
+      GetHook(pan);
 
-  if (Is_Top(pan))
-    returnCode(OK);
+      if (Is_Top(pan))
+       returnCode(OK);
 
-  dBug(("--> show_panel %s", USER_PTR(pan->user)));
+      dBug(("--> show_panel %s", USER_PTR(pan->user)));
 
-  HIDE_PANEL(pan, err, OK);
+      HIDE_PANEL(pan, err, OK);
 
-  dStack("<lt%d>", 1, pan);
-  assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel);
+      dStack("<lt%d>", 1, pan);
+      assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel);
 
-  _nc_top_panel->above = pan;
-  pan->below = _nc_top_panel;
-  pan->above = (PANEL *) 0;
-  _nc_top_panel = pan;
+      _nc_top_panel->above = pan;
+      pan->below = _nc_top_panel;
+      pan->above = (PANEL *) 0;
+      _nc_top_panel = pan;
 
-  dStack("<lt%d>", 9, pan);
+      err = OK;
 
-  returnCode(OK);
+      dStack("<lt%d>", 9, pan);
+    }
+  returnCode(err);
 }
index 5967718160ff901e3894241f7ce7f2bd9cffcc2f..d199e45a37b3af413d120de5b1beadb8b858bf23 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,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            *
@@ -29,6 +29,7 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1997-1999,2008          *
  ****************************************************************************/
 
 /* p_update.c
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_update.c,v 1.9 2005/02/19 16:49:47 tom Exp $")
+MODULE_ID("$Id: p_update.c,v 1.10 2009/04/11 19:48:36 tom Exp $")
 
 NCURSES_EXPORT(void)
-update_panels(void)
+NCURSES_SP_NAME(update_panels) (NCURSES_SP_DCL0)
 {
   PANEL *pan;
 
-  T((T_CALLED("update_panels()")));
+  T((T_CALLED("update_panels(%p)"), SP_PARM));
   dBug(("--> update_panels"));
-  pan = _nc_bottom_panel;
-  while (pan && pan->above)
-    {
-      PANEL_UPDATE(pan, pan->above);
-      pan = pan->above;
-    }
 
-  pan = _nc_bottom_panel;
-  while (pan)
+  if (SP_PARM)
     {
-      Wnoutrefresh(pan);
-      pan = pan->above;
+      GetScreenHook(SP_PARM);
+
+      pan = _nc_bottom_panel;
+      while (pan && pan->above)
+       {
+         PANEL_UPDATE(pan, pan->above);
+         pan = pan->above;
+       }
+
+      pan = _nc_bottom_panel;
+      while (pan)
+       {
+         Wnoutrefresh(pan);
+         pan = pan->above;
+       }
     }
 
   returnVoid;
 }
+
+#if NCURSES_SP_FUNCS
+NCURSES_EXPORT(void)
+update_panels(void)
+{
+  NCURSES_SP_NAME(update_panels) (CURRENT_SCREEN);
+}
+#endif
index 16a8083d64b2a524044a134daff17edaa6eb0202..8ef39847b343cc460805be66d27c6c4d5c704882 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2005,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            *
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1996-1999,2008          *
+ *     and: Thomas E. Dickey                                                *
  ****************************************************************************/
 
 /* panel.c -- implementation of panels library, some core routines */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: panel.c,v 1.23 2005/02/19 18:04:31 tom Exp $")
+MODULE_ID("$Id: panel.c,v 1.24 2009/04/11 21:29:10 tom Exp $")
 
 /*+-------------------------------------------------------------------------
        _nc_retrace_panel (pan)
@@ -91,6 +93,8 @@ _nc_dStack(const char *fmt, int num, const PANEL * pan)
 {
   char s80[80];
 
+  GetPanelHook(pan);
+
   sprintf(s80, fmt, num, pan);
   _tracef("%s b=%s t=%s", s80,
          (_nc_bottom_panel) ? USER_PTR(_nc_bottom_panel->user) : "--",
index 1e02091d97f2f100c66532e07e081d38ba7946c6..6ed2061d1ff8ca4d6ee1cb14ce6c9ea5a2eb96c2 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2001,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2006,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            *
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995                    *
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
+ *     and: Juergen Pfeifer                         1996-1999,2008          *
  ****************************************************************************/
 
-/* $Id: panel.h,v 1.10 2006/05/27 19:49:40 tom Exp $ */
+/* $Id: panel.h,v 1.11 2009/04/11 19:50:40 tom Exp $ */
 
 /* panel.h -- interface file for panels library */
 
@@ -68,6 +69,13 @@ extern NCURSES_EXPORT(int)     move_panel (PANEL *, int, int);
 extern NCURSES_EXPORT(int)     replace_panel (PANEL *,WINDOW *);
 extern NCURSES_EXPORT(int)     panel_hidden (const PANEL *);
 
+#if NCURSES_SP_FUNCS
+extern NCURSES_EXPORT(PANEL *) ground_panel(SCREEN *);
+extern NCURSES_EXPORT(PANEL *) ceiling_panel(SCREEN *);
+
+extern NCURSES_EXPORT(void)    NCURSES_SP_NAME(update_panels) (SCREEN*);
+#endif
+
 #if    defined(__cplusplus)
 }
 #endif
index 4fb8144e1b7732c3f5ed20cb2c2a58cefb0b8aa3..ce4f98937fc91c7a5f6677d8cfdb29edf3e821f5 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2008 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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 
-/* $Id: panel.priv.h,v 1.22 2008/09/27 22:36:11 tom Exp $ */
+/* $Id: panel.priv.h,v 1.23 2009/04/11 20:33:55 tom Exp $ */
 
 #ifndef NCURSES_PANEL_PRIV_H
 #define NCURSES_PANEL_PRIV_H 1
 #include <string.h>
 #include <assert.h>
 
-#include "curses.priv.h"
+struct screen;              /* forward declaration */
+
+#include "curses.priv.h"    /* includes nc_panel.h */
 #include "panel.h"
-#include <nc_panel.h>
+
 
 #if USE_RCS_IDS
 #  define MODULE_ID(id) static const char Ident[] = id;
 #  define Touchline(pan,start,count) touchline((pan)->win,start,count)
 #endif
 
+#if NCURSES_SP_FUNCS
+#define GetScreenHook(sp) \
+                       struct panelhook* ph = NCURSES_SP_NAME(_nc_panelhook)(sp)
+#define GetPanelHook(pan) \
+                       GetScreenHook(_nc_screen_of((pan)->win))
+#define GetWindowHook(win) \
+                       SCREEN* sp = _nc_screen_of(win); \
+                       GetScreenHook(sp)
+#define GetHook(pan)   SCREEN* sp = _nc_screen_of(pan->win); \
+                       GetScreenHook(sp)
+
+#define _nc_stdscr_pseudo_panel ((ph)->stdscr_pseudo_panel)
+#define _nc_top_panel           ((ph)->top_panel)
+#define _nc_bottom_panel        ((ph)->bottom_panel)
+
+#else  /* !NCURSES_SP_FUNCS */
+
+#define GetScreenHook(sp) /* nothing */
+#define GetPanelHook(pan) /* nothing */
+#define GetWindowHook(win) /* nothing */
+#define GetHook(pan) /* nothing */
+
 #define _nc_stdscr_pseudo_panel _nc_panelhook()->stdscr_pseudo_panel
-#define _nc_top_panel _nc_panelhook()->top_panel
-#define _nc_bottom_panel _nc_panelhook()->bottom_panel
+#define _nc_top_panel           _nc_panelhook()->top_panel
+#define _nc_bottom_panel        _nc_panelhook()->bottom_panel
+
+#endif /* NCURSES_SP_FUNCS */
 
-#define EMPTY_STACK() (_nc_top_panel==_nc_bottom_panel)
-#define Is_Bottom(p)  (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above==(p)))
-#define Is_Top(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel==(p)))
-#define Is_Pseudo(p) ((p) && ((p)==_nc_bottom_panel))
+#define EMPTY_STACK() (_nc_top_panel == _nc_bottom_panel)
+#define Is_Bottom(p)  (((p) != (PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above == (p)))
+#define Is_Top(p)     (((p) != (PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel == (p)))
+#define Is_Pseudo(p)  (((p) != (PANEL*)0) && ((p) == _nc_bottom_panel))
 
 /*+-------------------------------------------------------------------------
        IS_LINKED(pan) - check to see if panel is in the stack
    ix2 = (PENDX(pan1)   < PENDX(pan2))   ? PENDX(pan1)   : PENDX(pan2);\
    iy1 = (PSTARTY(pan1) < PSTARTY(pan2)) ? PSTARTY(pan2) : PSTARTY(pan1);\
    iy2 = (PENDY(pan1)   < PENDY(pan2))   ? PENDY(pan1)   : PENDY(pan2);\
-   assert((ix1<=ix2) && (iy1<=iy2));\
+   assert((ix1<=ix2) && (iy1<=iy2))
 
 
 /*+-------------------------------------------------------------------------
 {  PANEL* pan2 = ((panstart) ? (panstart) : _nc_bottom_panel);\
    while(pan2) {\
       if ((pan2 != pan) && PANELS_OVERLAPPED(pan,pan2)) {\
-        int y,ix1,ix2,iy1,iy2;\
-        COMPUTE_INTERSECTION(pan,pan2,ix1,ix2,iy1,iy2);\
+        int y, ix1, ix2, iy1, iy2;\
+        COMPUTE_INTERSECTION(pan, pan2, ix1, ix2, iy1, iy2);\
        for(y = iy1; y <= iy2; y++) {\
          if (is_linetouched(pan->win,y - PSTARTY(pan))) {\
             struct ldat* line = &(pan2->win->_line[y - PSTARTY(pan2)]);\
-            CHANGED_RANGE(line,ix1-PSTARTX(pan2),ix2-PSTARTX(pan2));\
+            CHANGED_RANGE(line, ix1 - PSTARTX(pan2), ix2 - PSTARTX(pan2));\
           }\
        }\
       }\
       err = err_if_unlinked;\
   }
 
+#if NCURSES_SP_FUNCS
+/* These may become later renamed and part of panel.h and the public API */
+extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_update_panels)(SCREEN*);
+#endif
+
 #endif /* NCURSES_PANEL_PRIV_H */