HPUX: Put __HP_CURSES back in
[openafs.git] / src / gtx / gtxcurseswin.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
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
8  */
9
10 #ifndef __gator_curseswindows_h
11 #define __gator_curseswindows_h  1
12
13 #include "gtxwindows.h"         /*Base gator window dfns */
14
15 #if defined(AFS_HPUX110_ENV) && !defined(__HP_CURSES)
16 # define __HP_CURSES
17 #endif
18
19 #if defined(HAVE_NCURSES_H)
20 # include <ncurses.h>
21 #elif defined(HAVE_CURSES_H)
22 # include <curses.h>
23 #endif
24
25 /*Value for gwin w_type field*/
26 #define GATOR_WIN_CURSES    2
27
28 /*Private data for a curses gwin*/
29 struct gator_cursesgwin {
30     WINDOW *wp;                 /*Window pointer */
31     int charwidth;              /*Character width in pixels */
32     int charheight;             /*Character height in pixels */
33     char box_vertchar;          /*Vertical char for boxing purposes */
34     char box_horizchar;         /*Horizontal char for boxing purposes */
35 };
36
37 /*Curses gwin's creation parameters*/
38 struct gator_cursesgwin_params {
39     struct gwin_createparams gwin_params;       /*Basic params for the window */
40     int charwidth;              /*Character width in pixels */
41     int charheight;             /*Character height in pixels */
42     char box_vertchar;          /*Vertical char for boxing purposes */
43     char box_horizchar;         /*Horizontal char for boxing purposes */
44 };
45
46 /*Curses initialization routine*/
47
48 extern int gator_cursesgwin_init(int adebug);
49     /*
50      * Summary:
51      *    Initialize the curses window package.
52      *
53      * Args:
54      *    int adebug: Is debugging turned on?
55      *
56      * Returns:
57      *    0 on success,
58      *    Error value otherwise.
59      */
60
61 /*Curses window's creation routine*/
62
63 extern struct gwin *gator_cursesgwin_create(void *);
64     /*
65      * Summary:
66      *    Create a curses window.
67      *
68      * Args:
69      *    struct gator_cursesgwin_params *params : Ptr to creation parameters.
70      *
71      * Returns:
72      *    Ptr to the created curses window structure if successful,
73      *    Error value otherwise.
74      */
75
76 /*Curses cleanup routine*/
77
78 extern int gator_cursesgwin_cleanup(struct gwin *);
79     /*
80      * Summary:
81      *    Clean up after the curses window package.
82      *
83      * Args:
84      *    struct gwin *gwp : Ptr to base window.
85      *
86      * Returns:
87      *    0 on success,
88      *    Error value otherwise.
89      */
90
91 extern struct gwinbaseops gator_curses_gwinbops;
92
93 /*Curses window's routines*/
94
95 extern int gator_cursesgwin_box(struct gwin *);
96     /*
97      * Summary:
98      *    Draw a box around the given curses window.
99      *
100      * Args:
101      *   struct gwin *gwp : Ptr to the curses window to draw
102      *                              a box around.
103      *
104      * Returns:
105      *    0: Success.
106      *    Error value otherwise.
107      */
108
109 extern int gator_cursesgwin_clear(struct gwin *);
110     /*
111      * Summary:
112      *    Clear out the given curses window.
113      *
114      * Args:
115      *   struct gwin *gwp : Ptr to the curses window to clear
116      *                              out.
117      *
118      * Returns:
119      *    0: Success.
120      *    Error value otherwise.
121      */
122
123 extern int gator_cursesgwin_destroy(struct gwin *);
124     /*
125      * Summary:
126      *    Destroy the given curses window.
127      *
128      * Args:
129      *   struct gwin *gwp : Ptr to the curses window to destroy.
130      *
131      * Returns:
132      *    0: Success.
133      *    Error value otherwise.
134      */
135
136 extern int gator_cursesgwin_display(struct gwin *);
137     /*
138      * Summary:
139      *    Display/redraw the given curses window.
140      *
141      * Args:
142      *   struct gwin *gwp : Ptr to the curses window to draw.
143      *
144      * Returns:
145      *    0: Success.
146      *    Error value otherwise.
147      */
148
149 extern int gator_cursesgwin_drawline(struct gwin *, struct gwin_lineparams *);
150     /*
151      * Summary:
152      *    Draw a line between two points in the given curses
153      *    window.
154      *
155      * Args:
156      *   struct gwin *gwp : Ptr to the curses window in which
157      *                              the line is to be drawn.
158      *   struct gwin_lineparams *params : Ptr to other params.
159      *
160      * Returns:
161      *    0: Success.
162      *    Error value otherwise.
163      */
164
165 extern int gator_cursesgwin_drawrectangle(struct gwin *,
166                                           struct gwin_rectparams *);
167     /*
168      * Summary:
169      *    Draw a rectangle in the given curses window.
170      *
171      * Args:
172      *   struct gwin *gwp : Ptr to the curses window in which
173      *                              the rectangle is to be drawn.
174      *   struct gwin_rectparams *params : Ptr to other params.
175      *
176      * Returns:
177      *    0: Success.
178      *    Error value otherwise.
179      */
180
181 extern int gator_cursesgwin_drawchar(struct gwin *, struct gwin_charparams *);
182     /*
183      * Summary:
184      *    Draw a character in the given curses window.
185      *
186      * Args:
187      *   struct gwin *gwp : Ptr to the curses window in which
188      *                              the character is to be drawn.
189      *   struct gwin_charparams *params : Ptr to other params.
190      *
191      * Returns:
192      *    0: Success.
193      *    Error value otherwise.
194      */
195
196 extern int gator_cursesgwin_drawstring(struct gwin *, struct gwin_strparams *);
197     /*
198      * Summary:
199      *    Draw a string in the given curses window.
200      *
201      * Args:
202      *   struct gwin *gwp : Ptr to the curses window in which
203      *                              the string is to be drawn.
204      *   struct gwin_strparams *params : Ptr to other params.
205      *
206      * Returns:
207      *    0: Success.
208      *    Error value otherwise.
209      */
210
211 extern int gator_cursesgwin_invert(struct gwin *, struct gwin_invparams *);
212     /*
213      * Summary:
214      *    Invert a region in the given curses window.
215      *
216      * Args:
217      *   struct gwin *gwp : Ptr to the curses window in which
218      *                              the inverted region lies.
219      *   struct gwin_invparams *params : Ptr to other params.
220      *
221      * Returns:
222      *    0: Success.
223      *    Error value otherwise.
224      */
225
226 extern int gator_cursesgwin_getchar(struct gwin *);
227
228 extern int gator_cursesgwin_getdimensions(struct gwin *,
229                                           struct gwin_sizeparams *aparms);
230
231 extern int gator_cursesgwin_wait(struct gwin *);
232
233 #endif /* __gator_curseswindows_h */