~ubuntu-branches/debian/sid/ncurses/sid-200908151540

« back to all changes in this revision

Viewing changes to panel/panel.priv.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-05-24 15:13:01 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090524151301-uixgxq2zonfov2nr
Tags: 5.7+20090523-1
MergingĀ upstreamĀ versionĀ 5.7+20090523.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
 
 * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc.              *
 
2
 * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
3
3
 *                                                                          *
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            *
26
26
 * authorization.                                                           *
27
27
 ****************************************************************************/
28
28
 
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 $ */
30
30
 
31
31
#ifndef NCURSES_PANEL_PRIV_H
32
32
#define NCURSES_PANEL_PRIV_H 1
39
39
#include <string.h>
40
40
#include <assert.h>
41
41
 
42
 
#include "curses.priv.h"
 
42
struct screen;              /* forward declaration */
 
43
 
 
44
#include "curses.priv.h"    /* includes nc_panel.h */
43
45
#include "panel.h"
44
 
#include <nc_panel.h>
 
46
 
45
47
 
46
48
#if USE_RCS_IDS
47
49
#  define MODULE_ID(id) static const char Ident[] = id;
83
85
#  define Touchline(pan,start,count) touchline((pan)->win,start,count)
84
86
#endif
85
87
 
 
88
#if NCURSES_SP_FUNCS
 
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); \
 
95
                        GetScreenHook(sp)
 
96
#define GetHook(pan)    SCREEN* sp = _nc_screen_of(pan->win); \
 
97
                        GetScreenHook(sp)
 
98
 
 
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)
 
102
 
 
103
#else   /* !NCURSES_SP_FUNCS */
 
104
 
 
105
#define GetScreenHook(sp) /* nothing */
 
106
#define GetPanelHook(pan) /* nothing */
 
107
#define GetWindowHook(win) /* nothing */
 
108
#define GetHook(pan) /* nothing */
 
109
 
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
89
 
 
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
 
113
 
 
114
#endif  /* NCURSES_SP_FUNCS */
 
115
 
 
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))
94
120
 
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))
126
152
 
127
153
 
128
154
/*+-------------------------------------------------------------------------
136
162
{  PANEL* pan2 = ((panstart) ? (panstart) : _nc_bottom_panel);\
137
163
   while(pan2) {\
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));\
145
171
          }\
146
172
        }\
147
173
      }\
180
206
      err = err_if_unlinked;\
181
207
  }
182
208
 
 
209
#if NCURSES_SP_FUNCS
 
210
/* These may become later renamed and part of panel.h and the public API */
 
211
extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_update_panels)(SCREEN*);
 
212
#endif
 
213
 
183
214
#endif /* NCURSES_PANEL_PRIV_H */