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