1 /* $Id: panel.priv.h,v 1.10 1999/09/29 15:21:58 juergen Exp $ */
7 # include <ncurses_cfg.h>
15 # include <dmalloc.h> /* Gray Watson's library */
19 # include <dbmalloc.h> /* Conor Cahill's library */
25 #if ( CC_HAS_INLINE_FUNCS && !defined(TRACE) )
26 # define INLINE inline
32 # define MODULE_ID(id) static const char Ident[] = id;
34 # define MODULE_ID(id) /*nothing*/
39 extern const char *_nc_my_visbuf(const void *);
41 # define USER_PTR(ptr) _nc_visbuf((const char *)ptr)
43 # define USER_PTR(ptr) _nc_my_visbuf((const char *)ptr)
46 extern void _nc_dPanel(const char*, const PANEL*);
47 extern void _nc_dStack(const char*, int, const PANEL*);
48 extern void _nc_Wnoutrefresh(const PANEL*);
49 extern void _nc_Touchpan(const PANEL*);
50 extern void _nc_Touchline(const PANEL*, int, int);
52 # define dBug(x) _tracef x
53 # define dPanel(text,pan) _nc_dPanel(text,pan)
54 # define dStack(fmt,num,pan) _nc_dStack(fmt,num,pan)
55 # define Wnoutrefresh(pan) _nc_Wnoutrefresh(pan)
56 # define Touchpan(pan) _nc_Touchpan(pan)
57 # define Touchline(pan,start,count) _nc_Touchline(pan,start,count)
60 # define dPanel(text,pan)
61 # define dStack(fmt,num,pan)
62 # define Wnoutrefresh(pan) wnoutrefresh((pan)->win)
63 # define Touchpan(pan) touchwin((pan)->win)
64 # define Touchline(pan,start,count) touchline((pan)->win,start,count)
67 #define _nc_stdscr_pseudo_panel _nc_panelhook()->stdscr_pseudo_panel
68 #define _nc_top_panel _nc_panelhook()->top_panel
69 #define _nc_bottom_panel _nc_panelhook()->bottom_panel
71 #define EMPTY_STACK() (_nc_top_panel==_nc_bottom_panel)
72 #define Is_Bottom(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above==(p)))
73 #define Is_Top(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel==(p)))
74 #define Is_Pseudo(p) ((p) && ((p)==_nc_bottom_panel))
76 /*+-------------------------------------------------------------------------
77 _nc_panel_is_linked(pan) - check to see if panel is in the stack
78 --------------------------------------------------------------------------*/
79 /* This works! The only case where it would fail is, when the list has
80 only one element. But this could only be the pseudo panel at the bottom */
81 #define _nc_panel_is_linked(p) ((((p)->above!=(PANEL*)0)||((p)->below!=(PANEL*)0)||((p)==_nc_bottom_panel)) ? TRUE : FALSE)
83 #define PSTARTX(pan) ((pan)->win->_begx)
84 #define PENDX(pan) ((pan)->win->_begx + getmaxx((pan)->win))
85 #define PSTARTY(pan) ((pan)->win->_begy)
86 #define PENDY(pan) ((pan)->win->_begy + getmaxy((pan)->win))
88 /*+-------------------------------------------------------------------------
89 PANELS_OVERLAPPED(pan1,pan2) - check panel overlapped
90 ---------------------------------------------------------------------------*/
91 #define PANELS_OVERLAPPED(pan1,pan2) \
92 (( !(pan1) || !(pan2) || \
93 PSTARTY(pan1) >= PENDY(pan2) || PENDY(pan1) <= PSTARTY(pan2) ||\
94 PSTARTX(pan1) >= PENDX(pan2) || PENDX(pan1) <= PSTARTX(pan2) ) \
98 #define PANEL_UPDATE(pan,panstart) { int y; PANEL* pan2 = panstart;\
101 pan2 = _nc_bottom_panel;\
104 if ((pan2 != pan) && PANELS_OVERLAPPED(pan,pan2)) {\
105 for(y = PSTARTY(pan); y < PENDY(pan); y++) {\
106 if( (y >= PSTARTY(pan2)) && (y < PENDY(pan2)) &&\
107 ((is_linetouched(pan->win,y - PSTARTY(pan)) == TRUE)) )\
108 Touchline(pan2,y - PSTARTY(pan2),1);\
114 #endif /* _PANEL_PRIV_H */