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 */
14 #if defined(AFS_HPUX110_ENV) && !defined(__HP_CURSES)
17 #ifdef AFS_LINUX20_ENV
18 #include <ncurses.h> /*Curses library */
20 #include <curses.h> /*Curses library */
23 /*Value for gwin w_type field*/
24 #define GATOR_WIN_CURSES 2
26 /*Private data for a curses gwin*/
27 struct gator_cursesgwin {
28 WINDOW *wp; /*Window pointer */
29 int charwidth; /*Character width in pixels */
30 int charheight; /*Character height in pixels */
31 char box_vertchar; /*Vertical char for boxing purposes */
32 char box_horizchar; /*Horizontal char for boxing purposes */
35 /*Curses gwin's creation parameters*/
36 struct gator_cursesgwin_params {
37 struct gwin_createparams gwin_params; /*Basic params for the window */
38 int charwidth; /*Character width in pixels */
39 int charheight; /*Character height in pixels */
40 char box_vertchar; /*Vertical char for boxing purposes */
41 char box_horizchar; /*Horizontal char for boxing purposes */
44 /*Curses initialization routine*/
46 extern int gator_cursesgwin_init(int adebug);
49 * Initialize the curses window package.
52 * int adebug: Is debugging turned on?
56 * Error value otherwise.
59 /*Curses window's creation routine*/
61 extern struct gwin *gator_cursesgwin_create(void *);
64 * Create a curses window.
67 * struct gator_cursesgwin_params *params : Ptr to creation parameters.
70 * Ptr to the created curses window structure if successful,
71 * Error value otherwise.
74 /*Curses cleanup routine*/
76 extern int gator_cursesgwin_cleanup(struct gwin *);
79 * Clean up after the curses window package.
82 * struct gwin *gwp : Ptr to base window.
86 * Error value otherwise.
89 extern struct gwinbaseops gator_curses_gwinbops;
91 /*Curses window's routines*/
93 extern int gator_cursesgwin_box(struct gwin *);
96 * Draw a box around the given curses window.
99 * struct gwin *gwp : Ptr to the curses window to draw
104 * Error value otherwise.
107 extern int gator_cursesgwin_clear(struct gwin *);
110 * Clear out the given curses window.
113 * struct gwin *gwp : Ptr to the curses window to clear
118 * Error value otherwise.
121 extern int gator_cursesgwin_destroy(struct gwin *);
124 * Destroy the given curses window.
127 * struct gwin *gwp : Ptr to the curses window to destroy.
131 * Error value otherwise.
134 extern int gator_cursesgwin_display(struct gwin *);
137 * Display/redraw the given curses window.
140 * struct gwin *gwp : Ptr to the curses window to draw.
144 * Error value otherwise.
147 extern int gator_cursesgwin_drawline(struct gwin *, struct gwin_lineparams *);
150 * Draw a line between two points in the given curses
154 * struct gwin *gwp : Ptr to the curses window in which
155 * the line is to be drawn.
156 * struct gwin_lineparams *params : Ptr to other params.
160 * Error value otherwise.
163 extern int gator_cursesgwin_drawrectangle(struct gwin *,
164 struct gwin_rectparams *);
167 * Draw a rectangle in the given curses window.
170 * struct gwin *gwp : Ptr to the curses window in which
171 * the rectangle is to be drawn.
172 * struct gwin_rectparams *params : Ptr to other params.
176 * Error value otherwise.
179 extern int gator_cursesgwin_drawchar(struct gwin *, struct gwin_charparams *);
182 * Draw a character in the given curses window.
185 * struct gwin *gwp : Ptr to the curses window in which
186 * the character is to be drawn.
187 * struct gwin_charparams *params : Ptr to other params.
191 * Error value otherwise.
194 extern int gator_cursesgwin_drawstring(struct gwin *, struct gwin_strparams *);
197 * Draw a string in the given curses window.
200 * struct gwin *gwp : Ptr to the curses window in which
201 * the string is to be drawn.
202 * struct gwin_strparams *params : Ptr to other params.
206 * Error value otherwise.
209 extern int gator_cursesgwin_invert(struct gwin *, struct gwin_invparams *);
212 * Invert a region in the given curses window.
215 * struct gwin *gwp : Ptr to the curses window in which
216 * the inverted region lies.
217 * struct gwin_invparams *params : Ptr to other params.
221 * Error value otherwise.
224 extern int gator_cursesgwin_getchar(struct gwin *);
226 extern int gator_cursesgwin_getdimensions(struct gwin *,
227 struct gwin_sizeparams *aparms);
229 extern int gator_cursesgwin_wait(struct gwin *);
231 #endif /* __gator_curseswindows_h */