reindent-20030715
[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 #if defined(AFS_HPUX110_ENV) && !defined(__HP_CURSES)
15 #define __HP_CURSES
16 #endif
17 #ifdef AFS_LINUX20_ENV
18 #include <ncurses.h>            /*Curses library */
19 #else
20 #include <curses.h>             /*Curses library */
21 #endif
22
23 /*Value for gwin w_type field*/
24 #define GATOR_WIN_CURSES    2
25
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 */
33 };
34
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 */
42 };
43
44 /*Curses initialization routine*/
45
46 extern int gator_cursesgwin_init();
47     /*
48      * Summary:
49      *    Initialize the curses window package.
50      *
51      * Args:
52      *    int adebug: Is debugging turned on?
53      *
54      * Returns:
55      *    0 on success,
56      *    Error value otherwise.
57      */
58
59 /*Curses window's creation routine*/
60
61 extern struct gwin *gator_cursesgwin_create();
62     /*
63      * Summary:
64      *    Create a curses window.
65      *
66      * Args:
67      *    struct gator_cursesgwin_params *params : Ptr to creation parameters.
68      *
69      * Returns:
70      *    Ptr to the created curses window structure if successful,
71      *    Error value otherwise.
72      */
73
74 /*Curses cleanup routine*/
75
76 extern int gator_cursesgwin_cleanup();
77     /*
78      * Summary:
79      *    Clean up after the curses window package.
80      *
81      * Args:
82      *    struct gwin *gwp : Ptr to base window.
83      *
84      * Returns:
85      *    0 on success,
86      *    Error value otherwise.
87      */
88
89 extern struct gwinbaseops gator_curses_gwinbops;
90
91 /*Curses window's routines*/
92
93 extern int gator_cursesgwin_box();
94     /*
95      * Summary:
96      *    Draw a box around the given curses window.
97      *
98      * Args:
99      *   struct gwin *gwp : Ptr to the curses window to draw
100      *                              a box around.
101      *
102      * Returns:
103      *    0: Success.
104      *    Error value otherwise.
105      */
106
107 extern int gator_cursesgwin_clear();
108     /*
109      * Summary:
110      *    Clear out the given curses window.
111      *
112      * Args:
113      *   struct gwin *gwp : Ptr to the curses window to clear
114      *                              out.
115      *
116      * Returns:
117      *    0: Success.
118      *    Error value otherwise.
119      */
120
121 extern int gator_cursesgwin_destroy();
122     /*
123      * Summary:
124      *    Destroy the given curses window.
125      *
126      * Args:
127      *   struct gwin *gwp : Ptr to the curses window to destroy.
128      *
129      * Returns:
130      *    0: Success.
131      *    Error value otherwise.
132      */
133
134 extern int gator_cursesgwin_display();
135     /*
136      * Summary:
137      *    Display/redraw the given curses window.
138      *
139      * Args:
140      *   struct gwin *gwp : Ptr to the curses window to draw.
141      *
142      * Returns:
143      *    0: Success.
144      *    Error value otherwise.
145      */
146
147 extern int gator_cursesgwin_drawline();
148     /*
149      * Summary:
150      *    Draw a line between two points in the given curses
151      *    window.
152      *
153      * Args:
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.
157      *
158      * Returns:
159      *    0: Success.
160      *    Error value otherwise.
161      */
162
163 extern int gator_cursesgwin_drawrectangle();
164     /*
165      * Summary:
166      *    Draw a rectangle in the given curses window.
167      *
168      * Args:
169      *   struct gwin *gwp : Ptr to the curses window in which
170      *                              the rectangle is to be drawn.
171      *   struct gwin_rectparams *params : Ptr to other params.
172      *
173      * Returns:
174      *    0: Success.
175      *    Error value otherwise.
176      */
177
178 extern int gator_cursesgwin_drawchar();
179     /*
180      * Summary:
181      *    Draw a character in the given curses window.
182      *
183      * Args:
184      *   struct gwin *gwp : Ptr to the curses window in which
185      *                              the character is to be drawn.
186      *   struct gwin_charparams *params : Ptr to other params.
187      *
188      * Returns:
189      *    0: Success.
190      *    Error value otherwise.
191      */
192
193 extern int gator_cursesgwin_drawstring();
194     /*
195      * Summary:
196      *    Draw a string in the given curses window.
197      *
198      * Args:
199      *   struct gwin *gwp : Ptr to the curses window in which
200      *                              the string is to be drawn.
201      *   struct gwin_strparams *params : Ptr to other params.
202      *
203      * Returns:
204      *    0: Success.
205      *    Error value otherwise.
206      */
207
208 extern int gator_cursesgwin_invert();
209     /*
210      * Summary:
211      *    Invert a region in the given curses window.
212      *
213      * Args:
214      *   struct gwin *gwp : Ptr to the curses window in which
215      *                              the inverted region lies.
216      *   struct gwin_invparams *params : Ptr to other params.
217      *
218      * Returns:
219      *    0: Success.
220      *    Error value otherwise.
221      */
222
223 extern int gator_cursesgwin_getchar();
224
225 extern int gator_cursesgwin_getdimensions();
226
227 extern int gator_cursesgwin_wait();
228
229 #endif /* __gator_curseswindows_h */