+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
This change finishes merging for menu and panel libraries, does
part of the form library.
-- 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
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).
# 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
# 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)
/****************************************************************************
- * 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 *
#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 */
NULL /* enumerate previous function */
};
-NCURSES_EXPORT_VAR(const FIELDTYPE *)
+NCURSES_EXPORT_VAR(FIELDTYPE *)
_nc_Default_FieldType = &default_fieldtype;
/*---------------------------------------------------------------------------
/****************************************************************************
- * 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 *
* 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))
#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*);
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 */
/****************************************************************************
- * 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
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
+ }
}
/*---------------------------------------------------------------------------
/****************************************************************************
- * 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 *
/*
- * $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
*
/* 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
* 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
#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++)
.\" 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
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
#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) \
/* "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))\
| Return Values : Attribute value
+--------------------------------------------------------------------------*/
GEN_MENU_ATTR_GET_FCT(grey)
+
/* m_attribs.c ends here */
/****************************************************************************
- * 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.
| 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))
free(menu);
menu = (MENU *) 0;
}
+ else
+ err = E_OK;
}
}
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)
#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(MENU* menu, int pad)
|
| Description : Set the character to be used to separate the item name
| from its description. This must be a printable
#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
{
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;
/*---------------------------------------------------------------------------
| Facility : libnmenu
-| Function : WINDOW *menu_sub(const MENU *menu)
+| Function : WINDOW* menu_sub(const MENU *menu)
|
| Description : Returns a pointer to the subwindow of the menu
|
#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
{
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;
/*---------------------------------------------------------------------------
| Facility : libnmenu
-| Function : WINDOW *menu_win(const MENU *)
+| Function : WINDOW* menu_win(const MENU*)
|
| Description : Returns pointer to the window of the 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 */
/****************************************************************************
- * 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 *
* 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
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
/****************************************************************************
- * 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 *
#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)
}
/* 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);
/****************************************************************************
- * 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
/****************************************************************************
- * 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 *
#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))
test = path;
else
test++;
- return (test - path);
+ return (unsigned) (test - path);
}
NCURSES_EXPORT(char *)
/****************************************************************************
- * 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);
}
/****************************************************************************
- * 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);
}
/****************************************************************************
- * 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_bottom.c
*/
#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)
T((T_CALLED("bottom_panel(%p)"), pan));
if (pan)
{
+ GetHook(pan);
if (!Is_Bottom(pan))
{
/****************************************************************************
- * 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 1999,2008 *
****************************************************************************/
/* p_delete.c
*/
#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)
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;
/****************************************************************************
- * 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_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);
}
*/
#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);
}
/****************************************************************************
- * 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 *
/****************************************************************************
* 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);
}
/****************************************************************************
- * 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 *
*/
#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;
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;
{
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))))
*/
#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);
}
*/
#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);
}
/****************************************************************************
- * 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_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
/****************************************************************************
- * 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)
{
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) : "--",
/****************************************************************************
- * 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 */
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
/****************************************************************************
- * 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 *
* 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 */