Annotation of src/lib/libcurses/curses_private.h, Revision 1.3
1.3 ! jdc 1: /* $NetBSD: curses_private.h,v 1.2 2000/04/12 21:46:27 jdc Exp $ */
1.1 blymn 2:
3: /*-
4: * Copyright (c) 1998-2000 Brett Lymn
5: * (blymn@baea.com.au, brett_lymn@yahoo.com.au)
6: * All rights reserved.
7: *
8: * This code has been donated to The NetBSD Foundation by the Author.
9: *
10: * Redistribution and use in source and binary forms, with or without
11: * modification, are permitted provided that the following conditions
12: * are met:
13: * 1. Redistributions of source code must retain the above copyright
14: * notice, this list of conditions and the following disclaimer.
15: * 2. The name of the author may not be used to endorse or promote products
16: * derived from this software withough specific prior written permission
17: *
18: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27: * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28: *
29: *
30: */
31:
32: /* Private structure definitions for curses. */
33: /*
34: * A window an array of __LINE structures pointed to by the 'lines' pointer.
35: * A line is an array of __LDATA structures pointed to by the 'line' pointer.
36: *
37: * IMPORTANT: the __LDATA structure must NOT induce any padding, so if new
38: * fields are added -- padding fields with *constant values* should ensure
39: * that the compiler will not generate any padding when storing an array of
40: * __LDATA structures. This is to enable consistent use of memcmp, and memcpy
41: * for comparing and copying arrays.
42: */
43:
44: struct __ldata {
45: wchar_t ch; /* Character */
46: attr_t attr; /* Attributes */
47: };
48:
49: #define __LDATASIZE (sizeof(__LDATA))
50:
51: struct __line {
52: #define __ISDIRTY 0x01 /* Line is dirty. */
53: #define __ISPASTEOL 0x02 /* Cursor is past end of line */
54: #define __FORCEPAINT 0x04 /* Force a repaint of the line */
55: unsigned int flags;
56: unsigned int hash; /* Hash value for the line. */
57: int *firstchp, *lastchp; /* First and last chngd columns ptrs */
58: int firstch, lastch; /* First and last changed columns. */
59: __LDATA *line; /* Pointer to the line text. */
60: };
61:
62: struct __window { /* Window structure. */
63: struct __window *nextp, *orig; /* Subwindows list and parent. */
64: int begy, begx; /* Window home. */
65: int cury, curx; /* Current x, y coordinates. */
66: int maxy, maxx; /* Maximum values for curx, cury. */
67: short ch_off; /* x offset for firstch/lastch. */
68: __LINE **lines; /* Array of pointers to the lines */
69: __LINE *lspace; /* line space (for cleanup) */
70: __LDATA *wspace; /* window space (for cleanup) */
71:
72: #define __ENDLINE 0x00000001 /* End of screen. */
73: #define __FLUSH 0x00000002 /* Fflush(stdout) after refresh. */
74: #define __FULLWIN 0x00000004 /* Window is a screen. */
75: #define __IDLINE 0x00000008 /* Insert/delete sequences. */
76: #define __SCROLLWIN 0x00000010 /* Last char will scroll window. */
77: #define __SCROLLOK 0x00000020 /* Scrolling ok. */
78: #define __CLEAROK 0x00000040 /* Clear on next refresh. */
79: #define __LEAVEOK 0x00000100 /* If cursor left */
80: #define __KEYPAD 0x00010000 /* If interpreting keypad codes */
81: #define __NOTIMEOUT 0x00020000 /* Wait indefinitely for func keys */
82: unsigned int flags;
83: int delay; /* delay for getch() */
84: attr_t wattr; /* Character attributes */
1.2 jdc 85: wchar_t bchar; /* Background character */
86: attr_t battr; /* Background attributes */
1.1 blymn 87: };
1.2 jdc 88:
1.3 ! jdc 89: struct __winlist {
! 90: struct __window *winp; /* The window. */
! 91: struct __winlist *nextp; /* Next window. */
! 92: };
! 93:
1.2 jdc 94: /* Private functions. */
95: #ifdef DEBUG
96: void __CTRACE __P((const char *, ...));
97: #endif
98: int __delay __P((void));
99: unsigned int __hash __P((char *, int));
100: void __id_subwins __P((WINDOW *));
101: void __init_getch __P((char *));
102: void __init_acs __P((void));
103: char *__longname __P((char *, char *)); /* Original BSD version */
104: int __mvcur __P((int, int, int, int, int));
105: int __nodelay __P((void));
106: int __notimeout __P((void));
107: char *__parse_cap __P((const char *, ...));
108: void __restartwin __P((void));
109: void __restore_colors __P((void));
110: void __restore_termios __P((void));
111: void __restore_stophandler __P((void));
112: void __save_termios __P((void));
113: void __set_color __P((attr_t));
114: void __set_stophandler __P((void));
115: void __set_subwin __P((WINDOW *, WINDOW *));
116: void __startwin __P((void));
117: void __stop_signal_handler __P((int));
118: int __stopwin __P((void));
119: void __swflags __P((WINDOW *));
120: int __timeout __P((int));
121: int __touchline __P((WINDOW *, int, int, int, int));
122: int __touchwin __P((WINDOW *));
123: char *__tscroll __P((const char *, int, int));
124: int __waddch __P((WINDOW *, __LDATA *));
125:
126: /* Private #defines. */
127: #define min(a,b) (a < b ? a : b)
128: #define max(a,b) (a > b ? a : b)
129:
130: /* Private externs. */
1.3 ! jdc 131: extern int __echoit;
! 132: extern int __endwin;
! 133: extern int __pfast;
! 134: extern int __rawmode;
! 135: extern int __noqch;
! 136: extern attr_t __nca;
! 137: extern struct __winlist *__winlistp;
CVSweb <webmaster@jp.NetBSD.org>