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_textobject_h
11 #define __gator_textobject_h 1
13 #include "gtxobjects.h" /*Basic gator object definitions */
14 #include "gtxtextcb.h" /*Text object's circular buffer facility */
16 /*Value for onode o_type field*/
17 #define GATOR_OBJ_TEXT 0
20 #define GATOR_TEXT_SCROLL_DOWN 0
21 #define GATOR_TEXT_SCROLL_UP 1
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 */
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 */
39 /*Text object's creation routine*/
41 extern int gator_text_create(struct onode
*, struct onode_createparams
*);
44 * Create a gator text object.
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)
54 * Error value otherwise.
57 /*Text object's generic onode routines*/
59 extern int gator_text_destroy(struct onode
*);
62 * Destroy a gator text object.
65 * struct onode *onp : Ptr to the text onode to delete.
69 * Error value otherwise.
72 extern int gator_text_display(struct onode
*);
75 * Display/redraw a gator text object.
78 * struct onode *onp: Ptr to the text onode to display.
82 * Error value otherwise.
85 extern int gator_text_release(struct onode
*);
88 * Drop the refcount on a gator text object.
91 * struct onode *onp : Ptr to the onode whose refcount is
96 * Error value otherwise.
100 * Additional, text-specific operations.
103 extern int gator_text_Scroll(struct onode
*, int, int);
106 * Scroll a text object some number of lines.
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?
115 * Error value otherwise.
118 extern int gator_text_Write(struct onode
*, char *, int, int, int);
121 * Write the given string to the end of the gator text object.
124 * struct onode *onp : Ptr to the text onode to which we're
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?
133 * Error value otherwise.
136 extern int gator_text_BlankLine(struct onode
*, int);
139 * Write a given number of blank lines to the given text object.
142 * struct onode *onp : Ptr to the onode to which we're writing.
143 * int numBlanks : Number of blank lines to write.
147 * Error value otherwise.
151 * Set of exported generic text onode operations.
153 extern struct onodeops gator_text_ops
;
155 #endif /* __gator_textobject_h */