1
1
/****************************************************************************
2
* Copyright (c) 1998-2005,2008 Free Software Foundation, Inc. *
2
* Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. *
4
4
* Permission is hereby granted, free of charge, to any person obtaining a *
5
5
* copy of this software and associated documentation files (the *
27
27
****************************************************************************/
29
/* $Id: panel.priv.h,v 1.22 2008/09/27 22:36:11 tom Exp $ */
29
/* $Id: panel.priv.h,v 1.23 2009/04/11 20:33:55 tom Exp $ */
31
31
#ifndef NCURSES_PANEL_PRIV_H
32
32
#define NCURSES_PANEL_PRIV_H 1
83
85
# define Touchline(pan,start,count) touchline((pan)->win,start,count)
89
#define GetScreenHook(sp) \
90
struct panelhook* ph = NCURSES_SP_NAME(_nc_panelhook)(sp)
91
#define GetPanelHook(pan) \
92
GetScreenHook(_nc_screen_of((pan)->win))
93
#define GetWindowHook(win) \
94
SCREEN* sp = _nc_screen_of(win); \
96
#define GetHook(pan) SCREEN* sp = _nc_screen_of(pan->win); \
99
#define _nc_stdscr_pseudo_panel ((ph)->stdscr_pseudo_panel)
100
#define _nc_top_panel ((ph)->top_panel)
101
#define _nc_bottom_panel ((ph)->bottom_panel)
103
#else /* !NCURSES_SP_FUNCS */
105
#define GetScreenHook(sp) /* nothing */
106
#define GetPanelHook(pan) /* nothing */
107
#define GetWindowHook(win) /* nothing */
108
#define GetHook(pan) /* nothing */
86
110
#define _nc_stdscr_pseudo_panel _nc_panelhook()->stdscr_pseudo_panel
87
#define _nc_top_panel _nc_panelhook()->top_panel
88
#define _nc_bottom_panel _nc_panelhook()->bottom_panel
90
#define EMPTY_STACK() (_nc_top_panel==_nc_bottom_panel)
91
#define Is_Bottom(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above==(p)))
92
#define Is_Top(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel==(p)))
93
#define Is_Pseudo(p) ((p) && ((p)==_nc_bottom_panel))
111
#define _nc_top_panel _nc_panelhook()->top_panel
112
#define _nc_bottom_panel _nc_panelhook()->bottom_panel
114
#endif /* NCURSES_SP_FUNCS */
116
#define EMPTY_STACK() (_nc_top_panel == _nc_bottom_panel)
117
#define Is_Bottom(p) (((p) != (PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above == (p)))
118
#define Is_Top(p) (((p) != (PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel == (p)))
119
#define Is_Pseudo(p) (((p) != (PANEL*)0) && ((p) == _nc_bottom_panel))
95
121
/*+-------------------------------------------------------------------------
96
122
IS_LINKED(pan) - check to see if panel is in the stack
122
148
ix2 = (PENDX(pan1) < PENDX(pan2)) ? PENDX(pan1) : PENDX(pan2);\
123
149
iy1 = (PSTARTY(pan1) < PSTARTY(pan2)) ? PSTARTY(pan2) : PSTARTY(pan1);\
124
150
iy2 = (PENDY(pan1) < PENDY(pan2)) ? PENDY(pan1) : PENDY(pan2);\
125
assert((ix1<=ix2) && (iy1<=iy2));\
151
assert((ix1<=ix2) && (iy1<=iy2))
128
154
/*+-------------------------------------------------------------------------
136
162
{ PANEL* pan2 = ((panstart) ? (panstart) : _nc_bottom_panel);\
138
164
if ((pan2 != pan) && PANELS_OVERLAPPED(pan,pan2)) {\
139
int y,ix1,ix2,iy1,iy2;\
140
COMPUTE_INTERSECTION(pan,pan2,ix1,ix2,iy1,iy2);\
165
int y, ix1, ix2, iy1, iy2;\
166
COMPUTE_INTERSECTION(pan, pan2, ix1, ix2, iy1, iy2);\
141
167
for(y = iy1; y <= iy2; y++) {\
142
168
if (is_linetouched(pan->win,y - PSTARTY(pan))) {\
143
169
struct ldat* line = &(pan2->win->_line[y - PSTARTY(pan2)]);\
144
CHANGED_RANGE(line,ix1-PSTARTX(pan2),ix2-PSTARTX(pan2));\
170
CHANGED_RANGE(line, ix1 - PSTARTX(pan2), ix2 - PSTARTX(pan2));\