2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #ifndef __gator_curseswindows_h
11 #define __gator_curseswindows_h 1
13 #include "gtxwindows.h" /*Base gator window dfns */
15 #if defined(AFS_HPUX110_ENV) && !defined(__HP_CURSES)
19 #if defined(HAVE_NCURSES_H)
21 #elif defined(HAVE_NCURSES_NCURSES_H)
22 # include <ncurses/ncurses.h>
23 #elif defined(HAVE_CURSES_H)
28 # if defined(HAVE_GETMAXY) && defined(HAVE_GETMAXX)
29 # define getmaxyx(w,y,x) do {(y) = getmaxy(w); (x) = getmaxx(w);} while (0)
31 # define getmaxyx(w,y,x) do {(y) = (w)->_maxy; (x) = (w)->_maxx;} while (0)
35 /*Value for gwin w_type field*/
36 #define GATOR_WIN_CURSES 2
38 /*Private data for a curses gwin*/
39 struct gator_cursesgwin
{
40 WINDOW
*wp
; /*Window pointer */
41 int charwidth
; /*Character width in pixels */
42 int charheight
; /*Character height in pixels */
43 char box_vertchar
; /*Vertical char for boxing purposes */
44 char box_horizchar
; /*Horizontal char for boxing purposes */
47 /*Curses gwin's creation parameters*/
48 struct gator_cursesgwin_params
{
49 struct gwin_createparams gwin_params
; /*Basic params for the window */
50 int charwidth
; /*Character width in pixels */
51 int charheight
; /*Character height in pixels */
52 char box_vertchar
; /*Vertical char for boxing purposes */
53 char box_horizchar
; /*Horizontal char for boxing purposes */
56 /*Curses initialization routine*/
58 extern int gator_cursesgwin_init(int adebug
);
61 * Initialize the curses window package.
64 * int adebug: Is debugging turned on?
68 * Error value otherwise.
71 /*Curses window's creation routine*/
73 extern struct gwin
*gator_cursesgwin_create(void *);
76 * Create a curses window.
79 * struct gator_cursesgwin_params *params : Ptr to creation parameters.
82 * Ptr to the created curses window structure if successful,
83 * Error value otherwise.
86 /*Curses cleanup routine*/
88 extern int gator_cursesgwin_cleanup(struct gwin
*);
91 * Clean up after the curses window package.
94 * struct gwin *gwp : Ptr to base window.
98 * Error value otherwise.
101 extern struct gwinbaseops gator_curses_gwinbops
;
103 /*Curses window's routines*/
105 extern int gator_cursesgwin_box(struct gwin
*);
108 * Draw a box around the given curses window.
111 * struct gwin *gwp : Ptr to the curses window to draw
116 * Error value otherwise.
119 extern int gator_cursesgwin_clear(struct gwin
*);
122 * Clear out the given curses window.
125 * struct gwin *gwp : Ptr to the curses window to clear
130 * Error value otherwise.
133 extern int gator_cursesgwin_destroy(struct gwin
*);
136 * Destroy the given curses window.
139 * struct gwin *gwp : Ptr to the curses window to destroy.
143 * Error value otherwise.
146 extern int gator_cursesgwin_display(struct gwin
*);
149 * Display/redraw the given curses window.
152 * struct gwin *gwp : Ptr to the curses window to draw.
156 * Error value otherwise.
159 extern int gator_cursesgwin_drawline(struct gwin
*, struct gwin_lineparams
*);
162 * Draw a line between two points in the given curses
166 * struct gwin *gwp : Ptr to the curses window in which
167 * the line is to be drawn.
168 * struct gwin_lineparams *params : Ptr to other params.
172 * Error value otherwise.
175 extern int gator_cursesgwin_drawrectangle(struct gwin
*,
176 struct gwin_rectparams
*);
179 * Draw a rectangle in the given curses window.
182 * struct gwin *gwp : Ptr to the curses window in which
183 * the rectangle is to be drawn.
184 * struct gwin_rectparams *params : Ptr to other params.
188 * Error value otherwise.
191 extern int gator_cursesgwin_drawchar(struct gwin
*, struct gwin_charparams
*);
194 * Draw a character in the given curses window.
197 * struct gwin *gwp : Ptr to the curses window in which
198 * the character is to be drawn.
199 * struct gwin_charparams *params : Ptr to other params.
203 * Error value otherwise.
206 extern int gator_cursesgwin_drawstring(struct gwin
*, struct gwin_strparams
*);
209 * Draw a string in the given curses window.
212 * struct gwin *gwp : Ptr to the curses window in which
213 * the string is to be drawn.
214 * struct gwin_strparams *params : Ptr to other params.
218 * Error value otherwise.
221 extern int gator_cursesgwin_invert(struct gwin
*, struct gwin_invparams
*);
224 * Invert a region in the given curses window.
227 * struct gwin *gwp : Ptr to the curses window in which
228 * the inverted region lies.
229 * struct gwin_invparams *params : Ptr to other params.
233 * Error value otherwise.
236 extern int gator_cursesgwin_getchar(struct gwin
*);
238 extern int gator_cursesgwin_getdimensions(struct gwin
*,
239 struct gwin_sizeparams
*aparms
);
241 extern int gator_cursesgwin_wait(struct gwin
*);
243 #endif /* __gator_curseswindows_h */