death to trailing whitespace
[openafs.git] / src / gtx / gtxtextobj.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_textobject_h
11 #define __gator_textobject_h  1
12
13 #include "gtxobjects.h"         /*Basic gator object definitions */
14 #include "gtxtextcb.h"          /*Text object's circular buffer facility */
15
16 /*Value for onode o_type field*/
17 #define GATOR_OBJ_TEXT  0
18
19 /*Scroll directions*/
20 #define GATOR_TEXT_SCROLL_DOWN  0
21 #define GATOR_TEXT_SCROLL_UP    1
22
23 /*Private data for text onode*/
24 struct gator_textobj {
25     int *llrock;                /*Rock for lower-level graphics layer */
26     int numLines;               /*Num lines we can display */
27     struct gator_textcb_hdr *cbHdr;     /*Ptr to circular buffer header */
28     int firstEntShown;          /*ID of first text entry displayed */
29     int lastEntShown;           /*ID of last text entry displayed */
30 };
31
32 /*Text object's creation parameters*/
33 struct gator_textobj_params {
34     struct onode_createparams onode_params;     /*Params for the whole onode */
35     int maxEntries;             /*Max text entries to store */
36     int maxCharsPerEntry;       /*Max chars per text entry */
37 };
38
39 /*Text object's creation routine*/
40
41 extern int gator_text_create(struct onode *, struct onode_createparams *);
42     /*
43      * Summary:
44      *    Create a gator text object.
45      *
46      * Args:
47      *    struct onode *text_onp : Ptr to the text onode to fill out.
48      *    struct onode_createparams *params : Ptr to creation params.
49      *       (Note: this actually points to a gator_text_crparams
50      *        structure, but we use the generic version of the ptr)
51      *
52      * Returns:
53      *    Zero if successful,
54      *    Error value otherwise.
55      */
56
57 /*Text object's generic onode routines*/
58
59 extern int gator_text_destroy(struct onode *);
60     /*
61      * Summary:
62      *    Destroy a gator text object.
63      *
64      * Args:
65      *    struct onode *onp : Ptr to the text onode to delete.
66      *
67      * Returns:
68      *    0: Success.
69      *    Error value otherwise.
70      */
71
72 extern int gator_text_display(struct onode *);
73     /*
74      * Summary:
75      *    Display/redraw a gator text object.
76      *
77      * Args:
78      *    struct onode *onp: Ptr to the text onode to display.
79      *
80      * Returns:
81      *    0: Success.
82      *    Error value otherwise.
83      */
84
85 extern int gator_text_release(struct onode *);
86     /*
87      * Summary:
88      *    Drop the refcount on a gator text object.
89      *
90      * Args:
91      *    struct onode *onp : Ptr to the onode whose refcount is
92      *                                 to be dropped.
93      *
94      * Returns:
95      *    0: Success.
96      *    Error value otherwise.
97      */
98
99 /*
100  * Additional, text-specific operations.
101  */
102
103 extern int gator_text_Scroll(struct onode *, int, int);
104     /*
105      * Summary:
106      *    Scroll a text object some number of lines.
107      *
108      * Args:
109      *    struct onode *onp     : Ptr to the text onode to be scrolled.
110      *    int nlines            : Number of lines to scroll.
111      *    int down              : Scroll down?
112      *
113      * Returns:
114      *    0: Success.
115      *    Error value otherwise.
116      */
117
118 extern int gator_text_Write(struct onode *, char *, int, int, int);
119     /*
120      * Summary:
121      *    Write the given string to the end of the gator text object.
122      *
123      * Args:
124      *    struct onode *onp     : Ptr to the text onode to which we're
125      *                                  writing.
126      *    char *strToWrite      : String to write.
127      *    int numChars          : Number of chars to write.
128      *    int highlight         : Use highlighting?
129      *    int skip              : Force a skip to the next line?
130      *
131      * Returns:
132      *    0: Success.
133      *    Error value otherwise.
134      */
135
136 extern int gator_text_BlankLine(struct onode *, int);
137     /*
138      * Summary:
139      *    Write a given number of blank lines to the given text object.
140      *
141      * Args:
142      *    struct onode *onp : Ptr to the onode to which we're writing.
143      *    int numBlanks     : Number of blank lines to write.
144      *
145      * Returns:
146      *    0: Success.
147      *    Error value otherwise.
148      */
149
150 /*
151  * Set of exported generic text onode operations.
152  */
153 extern struct onodeops gator_text_ops;
154
155 #endif /* __gator_textobject_h */