]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - panel/panel.c
ncurses 5.7 - patch 20100703
[ncurses.git] / panel / panel.c
index a56d57ef5ea8990809a6f06575a3779ba3bddf05..96cbbab77400f27e68f79c52c6841880611ef35d 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2009,2010 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            *
  *                                                                          *
  * 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>                         *
 /****************************************************************************
  *  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"
 
  ****************************************************************************/
 
 /* panel.c -- implementation of panels library, some core routines */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: panel.c,v 1.20 2001/02/24 23:17:26 tom Exp $")
+MODULE_ID("$Id: panel.c,v 1.25 2010/01/23 21:22:16 tom Exp $")
 
 
+/*+-------------------------------------------------------------------------
+       _nc_retrace_panel (pan)
+--------------------------------------------------------------------------*/
+#ifdef TRACE
+NCURSES_EXPORT(PANEL *)
+_nc_retrace_panel(PANEL * pan)
+{
+  T((T_RETURN("%p"), (void *)pan));
+  return pan;
+}
+#endif
+
+/*+-------------------------------------------------------------------------
+       _nc_my_visbuf(ptr)
+--------------------------------------------------------------------------*/
 #ifdef TRACE
 #ifndef TRACE_TXT
 NCURSES_EXPORT(const char *)
 #ifdef TRACE
 #ifndef TRACE_TXT
 NCURSES_EXPORT(const char *)
-_nc_my_visbuf (const void *ptr)
+_nc_my_visbuf(const void *ptr)
 {
 {
-       char temp[32];
-       if (ptr != 0)
-               sprintf(temp, "ptr:%p", ptr);
-       else
-               strcpy(temp, "<null>");
-       return _nc_visbuf(temp);
+  char temp[32];
+
+  if (ptr != 0)
+    sprintf(temp, "ptr:%p", ptr);
+  else
+    strcpy(temp, "<null>");
+  return _nc_visbuf(temp);
 }
 #endif
 #endif
 
 }
 #endif
 #endif
 
-
 /*+-------------------------------------------------------------------------
        dPanel(text,pan)
 --------------------------------------------------------------------------*/
 #ifdef TRACE
 NCURSES_EXPORT(void)
 /*+-------------------------------------------------------------------------
        dPanel(text,pan)
 --------------------------------------------------------------------------*/
 #ifdef TRACE
 NCURSES_EXPORT(void)
-_nc_dPanel 
-(const char *text, const PANEL *pan)
+_nc_dPanel(const char *text, const PANEL * pan)
 {
 {
-       _tracef("%s id=%s b=%s a=%s y=%d x=%d",
-               text, USER_PTR(pan->user),
-               (pan->below) ?  USER_PTR(pan->below->user) : "--",
-               (pan->above) ?  USER_PTR(pan->above->user) : "--",
-               PSTARTY(pan), PSTARTX(pan));
+  _tracef("%s id=%s b=%s a=%s y=%d x=%d",
+         text, USER_PTR(pan->user),
+         (pan->below) ? USER_PTR(pan->below->user) : "--",
+         (pan->above) ? USER_PTR(pan->above->user) : "--",
+         PSTARTY(pan), PSTARTX(pan));
 }
 #endif
 
 }
 #endif
 
@@ -73,21 +89,22 @@ _nc_dPanel
 --------------------------------------------------------------------------*/
 #ifdef TRACE
 NCURSES_EXPORT(void)
 --------------------------------------------------------------------------*/
 #ifdef TRACE
 NCURSES_EXPORT(void)
-_nc_dStack 
-(const char *fmt, int num, const PANEL *pan)
+_nc_dStack(const char *fmt, int num, const PANEL * pan)
 {
   char s80[80];
 
 {
   char s80[80];
 
-  sprintf(s80,fmt,num,pan);
-  _tracef("%s b=%s t=%s",s80,
-         (_nc_bottom_panel) ?  USER_PTR(_nc_bottom_panel->user) : "--",
-         (_nc_top_panel)    ?  USER_PTR(_nc_top_panel->user)    : "--");
-  if(pan)
+  GetPanelHook(pan);
+
+  sprintf(s80, fmt, num, pan);
+  _tracef("%s b=%s t=%s", s80,
+         (_nc_bottom_panel) ? USER_PTR(_nc_bottom_panel->user) : "--",
+         (_nc_top_panel) ? USER_PTR(_nc_top_panel->user) : "--");
+  if (pan)
     _tracef("pan id=%s", USER_PTR(pan->user));
   pan = _nc_bottom_panel;
     _tracef("pan id=%s", USER_PTR(pan->user));
   pan = _nc_bottom_panel;
-  while(pan)
+  while (pan)
     {
     {
-      dPanel("stk",pan);
+      dPanel("stk", pan);
       pan = pan->above;
     }
 }
       pan = pan->above;
     }
 }
@@ -98,9 +115,9 @@ _nc_dStack
 --------------------------------------------------------------------------*/
 #ifdef TRACE
 NCURSES_EXPORT(void)
 --------------------------------------------------------------------------*/
 #ifdef TRACE
 NCURSES_EXPORT(void)
-_nc_Wnoutrefresh (const PANEL *pan)
+_nc_Wnoutrefresh(const PANEL * pan)
 {
 {
-  dPanel("wnoutrefresh",pan);
+  dPanel("wnoutrefresh", pan);
   wnoutrefresh(pan->win);
 }
 #endif
   wnoutrefresh(pan->win);
 }
 #endif
@@ -110,9 +127,9 @@ _nc_Wnoutrefresh (const PANEL *pan)
 --------------------------------------------------------------------------*/
 #ifdef TRACE
 NCURSES_EXPORT(void)
 --------------------------------------------------------------------------*/
 #ifdef TRACE
 NCURSES_EXPORT(void)
-_nc_Touchpan (const PANEL *pan)
+_nc_Touchpan(const PANEL * pan)
 {
 {
-  dPanel("Touchpan",pan);
+  dPanel("Touchpan", pan);
   touchwin(pan->win);
 }
 #endif
   touchwin(pan->win);
 }
 #endif
@@ -122,19 +139,23 @@ _nc_Touchpan (const PANEL *pan)
 --------------------------------------------------------------------------*/
 #ifdef TRACE
 NCURSES_EXPORT(void)
 --------------------------------------------------------------------------*/
 #ifdef TRACE
 NCURSES_EXPORT(void)
-_nc_Touchline 
-(const PANEL *pan, int start, int count)
+_nc_Touchline(const PANEL * pan, int start, int count)
 {
   char s80[80];
 {
   char s80[80];
-  sprintf(s80,"Touchline s=%d c=%d",start,count);
-  dPanel(s80,pan);
-  touchline(pan->win,start,count);
+
+  sprintf(s80, "Touchline s=%d c=%d", start, count);
+  dPanel(s80, pan);
+  touchline(pan->win, start, count);
 }
 #endif
 
 #ifndef TRACE
 #  ifndef __GNUC__
      /* Some C compilers need something defined in a source file */
 }
 #endif
 
 #ifndef TRACE
 #  ifndef __GNUC__
      /* Some C compilers need something defined in a source file */
-     void _nc_dummy_panel(void) { }
+extern void _nc_dummy_panel(void);
+void
+_nc_dummy_panel(void)
+{
+}
 #  endif
 #endif
 #  endif
 #endif