1 /*
2 * $XConsortium: TextSinkP.h,v 1.6 94/04/17 20:13:13 kaleb Exp $
3 */
4 
5 /***********************************************************
6 
7 Copyright (c) 1987, 1988, 1994  X Consortium
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
22 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 
26 Except as contained in this notice, the name of the X Consortium shall not be
27 used in advertising or otherwise to promote the sale, use or other dealings
28 in this Software without prior written authorization from the X Consortium.
29 
30 
31 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
32 
33                         All Rights Reserved
34 
35 Permission to use, copy, modify, and distribute this software and its
36 documentation for any purpose and without fee is hereby granted,
37 provided that the above copyright notice appear in all copies and that
38 both that copyright notice and this permission notice appear in
39 supporting documentation, and that the name of Digital not be
40 used in advertising or publicity pertaining to distribution of the
41 software without specific, written prior permission.
42 
43 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
44 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
45 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
46 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
47 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
48 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
49 SOFTWARE.
50 
51 ******************************************************************/
52 
53 /*
54  * TextSinkP.h - Private definitions for TextSink object
55  *
56  */
57 
58 #ifndef _XawTextSinkP_h
59 #define _XawTextSinkP_h
60 
61 /***********************************************************************
62  *
63  * TextSink Object Private Data
64  *
65  ***********************************************************************/
66 
67 #include <X11/neXtaw/TextSink.h>
68 #include <X11/neXtaw/TextP.h>	/* This source works with the Text widget. */
69 #include <X11/neXtaw/TextSrcP.h>/* This source works with the Text Source. */
70 
71 /************************************************************
72  *
73  * New fields for the TextSink object class record.
74  *
75  ************************************************************/
76 
77 typedef struct _TextSinkClassPart {
78   void (*DisplayText)();
79   void (*InsertCursor)();
80   void (*ClearToBackground)();
81   void (*FindPosition)();
82   void (*FindDistance)();
83   void (*Resolve)();
84   int  (*MaxLines)();
85   int  (*MaxHeight)();
86   void (*SetTabs)();
87   void (*GetCursorBounds)();
88 } TextSinkClassPart;
89 
90 /* Full class record declaration */
91 typedef struct _TextSinkClassRec {
92     ObjectClassPart     object_class;
93     TextSinkClassPart	text_sink_class;
94 } TextSinkClassRec;
95 
96 extern TextSinkClassRec textSinkClassRec;
97 
98 /* New fields for the TextSink object record */
99 typedef struct {
100     /* resources */
101     Pixel foreground;		/* Foreground color. */
102     Pixel background;		/* Background color. */
103 
104     /* private state. */
105     Position *tabs;		/* The tab stops as pixel values. */
106     short    *char_tabs;	/* The tabs stops as character values. */
107     int      tab_count;		/* number of items in tabs */
108 
109 } TextSinkPart;
110 
111 /****************************************************************
112  *
113  * Full instance record declaration
114  *
115  ****************************************************************/
116 
117 typedef struct _TextSinkRec {
118   ObjectPart    object;
119   TextSinkPart	text_sink;
120 } TextSinkRec;
121 
122 /************************************************************
123  *
124  * Private declarations.
125  *
126  ************************************************************/
127 
128 typedef int (*_XawSinkIntFunc)();
129 typedef void (*_XawSinkVoidFunc)();
130 
131 #define XtInheritDisplayText          ((_XawSinkVoidFunc) _XtInherit)
132 #define XtInheritInsertCursor         ((_XawSinkVoidFunc) _XtInherit)
133 #define XtInheritClearToBackground    ((_XawSinkVoidFunc) _XtInherit)
134 #define XtInheritFindPosition         ((_XawSinkVoidFunc) _XtInherit)
135 #define XtInheritFindDistance         ((_XawSinkVoidFunc) _XtInherit)
136 #define XtInheritResolve              ((_XawSinkVoidFunc) _XtInherit)
137 #define XtInheritMaxLines             ((_XawSinkIntFunc) _XtInherit)
138 #define XtInheritMaxHeight            ((_XawSinkIntFunc) _XtInherit)
139 #define XtInheritSetTabs              ((_XawSinkVoidFunc) _XtInherit)
140 #define XtInheritGetCursorBounds      ((_XawSinkVoidFunc) _XtInherit)
141 
142 #endif /* _XawTextSinkP_h */
143