Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:25

0001 /***********************************************************
0002 
0003 Copyright 1987, 1988, 1994, 1998  The Open Group
0004 
0005 Permission to use, copy, modify, distribute, and sell this software and its
0006 documentation for any purpose is hereby granted without fee, provided that
0007 the above copyright notice appear in all copies and that both that
0008 copyright notice and this permission notice appear in supporting
0009 documentation.
0010 
0011 The above copyright notice and this permission notice shall be included in
0012 all copies or substantial portions of the Software.
0013 
0014 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
0017 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
0018 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0019 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0020 
0021 Except as contained in this notice, the name of The Open Group shall not be
0022 used in advertising or otherwise to promote the sale, use or other dealings
0023 in this Software without prior written authorization from The Open Group.
0024 
0025 
0026 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
0027 
0028                         All Rights Reserved
0029 
0030 Permission to use, copy, modify, and distribute this software and its
0031 documentation for any purpose and without fee is hereby granted,
0032 provided that the above copyright notice appear in all copies and that
0033 both that copyright notice and this permission notice appear in
0034 supporting documentation, and that the name of Digital not be
0035 used in advertising or publicity pertaining to distribution of the
0036 software without specific, written prior permission.
0037 
0038 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
0039 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
0040 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
0041 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
0042 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
0043 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
0044 SOFTWARE.
0045 
0046 ******************************************************************/
0047 
0048 #ifndef _XawTextSinkP_h
0049 #define _XawTextSinkP_h
0050 
0051 /*
0052  * TextSink Object Private Data
0053  */
0054 #include <X11/Xaw/TextSink.h>
0055 #include <X11/Xaw/TextP.h>  /* This sink works with the Text widget */
0056 #include <X11/Xaw/TextSrcP.h>   /* This sink works with the Text Source */
0057 #include <X11/Xmu/Xmu.h>
0058 
0059 #ifndef OLDXAW
0060 /* font/fontset defined? */
0061 #define XAW_TPROP_FONT      (1<<0)
0062 #define XAW_TPROP_FONTSET   (1<<1)
0063 
0064 /* extra attributes */
0065 #define XAW_TPROP_FOREGROUND    (1<<2)
0066 #define XAW_TPROP_BACKGROUND    (1<<3)
0067 #define XAW_TPROP_FPIXMAP   (1<<4)
0068 #define XAW_TPROP_BPIXMAP   (1<<5)
0069 #define XAW_TPROP_UNDERLINE (1<<6)
0070 #define XAW_TPROP_OVERSTRIKE    (1<<7)
0071 #define XAW_TPROP_SUBSCRIPT (1<<8)
0072 #define XAW_TPROP_SUPERSCRIPT   (1<<9)
0073 
0074 /* xlfd attributes */
0075 #define XAW_TPROP_FOUNDRY   (1<<0)
0076 #define XAW_TPROP_FAMILY    (1<<1)
0077 #define XAW_TPROP_WEIGHT    (1<<2)
0078 #define XAW_TPROP_SLANT     (1<<3)
0079 #define XAW_TPROP_SETWIDTH  (1<<4)
0080 #define XAW_TPROP_ADDSTYLE  (1<<5)
0081 #define XAW_TPROP_PIXELSIZE (1<<6)
0082 #define XAW_TPROP_POINTSIZE (1<<7)
0083 #define XAW_TPROP_RESX      (1<<8)
0084 #define XAW_TPROP_RESY      (1<<9)
0085 #define XAW_TPROP_SPACING   (1<<10)
0086 #define XAW_TPROP_AVGWIDTH  (1<<11)
0087 #define XAW_TPROP_REGISTRY  (1<<12)
0088 #define XAW_TPROP_ENCODING  (1<<13)
0089 struct _XawTextProperty {   /* to be extended/modified */
0090     XrmQuark identifier, code;
0091     unsigned long mask;
0092     XFontStruct *font;
0093     XFontSet fontset;
0094     Pixel foreground, background;
0095     Pixmap foreground_pixmap, background_pixmap;
0096     XrmQuark xlfd;
0097 
0098     unsigned long xlfd_mask;
0099     XrmQuark foundry, family, weight, slant, setwidth, addstyle, pixel_size,
0100          point_size, res_x, res_y, spacing, avgwidth, registry, encoding;
0101 
0102     short underline_position, underline_thickness;
0103 };
0104 
0105 struct _XawTextPropertyList {
0106     XrmQuark identifier;
0107     Screen *screen;
0108     Colormap colormap;
0109     int depth;
0110     XawTextProperty **properties;
0111     Cardinal num_properties;
0112     XawTextPropertyList *next;
0113 };
0114 
0115 typedef struct _XawTextPaintStruct XawTextPaintStruct;
0116 struct _XawTextPaintStruct {
0117     XawTextPaintStruct *next;
0118     int x, y, width;
0119     char *text;         /* formatted text */
0120     Cardinal length;        /* length of text */
0121     XawTextProperty *property;
0122     int max_ascent, max_descent;
0123     XmuArea *backtabs;
0124     Boolean highlight;
0125 };
0126 
0127 typedef struct {
0128     XmuArea *clip, *hightabs;           /* clip list */
0129     XawTextPaintStruct *paint, *bearings;   /* drawing information */
0130 } XawTextPaintList;
0131 
0132 typedef struct {
0133     XtPointer next_extension;
0134     XrmQuark record_type;
0135     long version;
0136     Cardinal record_size;
0137     Bool (*BeginPaint)(Widget);
0138     void (*PreparePaint)(Widget, int, int,
0139              XawTextPosition, XawTextPosition, Bool);
0140     void (*DoPaint)(Widget);
0141     Bool (*EndPaint)(Widget);
0142 } TextSinkExtRec, *TextSinkExt;
0143 #endif
0144 
0145 typedef void (*_XawSinkDisplayTextProc)
0146      (Widget, int, int, XawTextPosition, XawTextPosition, Bool);
0147 
0148 typedef void (*_XawSinkInsertCursorProc)
0149      (Widget, int, int, XawTextInsertState);
0150 
0151 typedef void (*_XawSinkClearToBackgroundProc)
0152      (Widget, int, int, unsigned int, unsigned int);
0153 
0154 typedef void (*_XawSinkFindPositionProc)
0155      (Widget, XawTextPosition, int, int, Bool, XawTextPosition*, int*, int*);
0156 
0157 typedef void (*_XawSinkFindDistanceProc)
0158      (Widget, XawTextPosition, int, XawTextPosition, int*,
0159       XawTextPosition*, int*);
0160 
0161 typedef void (*_XawSinkResolveProc)
0162      (Widget, XawTextPosition, int, int, XawTextPosition*);
0163 
0164 typedef int  (*_XawSinkMaxLinesProc)
0165      (Widget, unsigned int);
0166 
0167 typedef int  (*_XawSinkMaxHeightProc)
0168      (Widget, int);
0169 
0170 typedef void (*_XawSinkSetTabsProc)
0171      (Widget, int, short*);
0172 
0173 typedef void (*_XawSinkGetCursorBoundsProc)
0174      (Widget, XRectangle*);
0175 
0176 typedef struct _TextSinkClassPart {
0177     _XawSinkDisplayTextProc DisplayText;
0178     _XawSinkInsertCursorProc InsertCursor;
0179     _XawSinkClearToBackgroundProc ClearToBackground;
0180     _XawSinkFindPositionProc FindPosition;
0181     _XawSinkFindDistanceProc FindDistance;
0182     _XawSinkResolveProc Resolve;
0183     _XawSinkMaxLinesProc MaxLines;
0184     _XawSinkMaxHeightProc MaxHeight;
0185     _XawSinkSetTabsProc SetTabs;
0186     _XawSinkGetCursorBoundsProc GetCursorBounds;
0187 #ifndef OLDXAW
0188     TextSinkExt extension;
0189 #endif
0190 } TextSinkClassPart;
0191 
0192 /* Full class record */
0193 typedef struct _TextSinkClassRec {
0194     ObjectClassPart     object_class;
0195     TextSinkClassPart   text_sink_class;
0196 } TextSinkClassRec;
0197 
0198 extern TextSinkClassRec textSinkClassRec;
0199 
0200 /* New fields for the TextSink object */
0201 typedef struct {
0202     /* resources */
0203     Pixel foreground;       /* Foreground color */
0204     Pixel background;       /* Background color */
0205 
0206     /* private */
0207     Position *tabs;     /* The tab stops as pixel values */
0208     short *char_tabs;       /* The tabs stops as character values */
0209     int tab_count;      /* number of items in tabs */
0210 
0211 #ifndef OLDXAW
0212     /* more resources */
0213     Pixel cursor_color;
0214     XawTextPropertyList *properties;
0215     XawTextPaintList *paint;
0216     XtPointer pad[2];   /* for future use and keep binary compatibility */
0217 #endif
0218 } TextSinkPart;
0219 
0220 /* Full instance record */
0221 typedef struct _TextSinkRec {
0222     ObjectPart   object;
0223     TextSinkPart text_sink;
0224 } TextSinkRec;
0225 
0226 /* Semi private routines */
0227 #ifndef OLDXAW
0228 XawTextPropertyList *XawTextSinkConvertPropertyList
0229 (
0230  String          name,
0231  String          spec,
0232  Screen         *screen,
0233  Colormap        Colormap,
0234  int             depth
0235  );
0236 
0237 XawTextProperty *XawTextSinkGetProperty
0238 (
0239  Widget          w,
0240  XrmQuark        property
0241  );
0242 
0243 XawTextProperty *XawTextSinkCopyProperty
0244 (
0245  Widget         w,
0246  XrmQuark       property
0247  );
0248 
0249 XawTextProperty *XawTextSinkAddProperty
0250 (
0251  Widget          w,
0252  XawTextProperty    *property
0253  );
0254 
0255 XawTextProperty *XawTextSinkCombineProperty
0256 (
0257  Widget          w,
0258  XawTextProperty    *result_in_out,
0259  XawTextProperty    *property,
0260  Bool            override
0261  );
0262 
0263 Bool XawTextSinkBeginPaint
0264 (
0265  Widget         w
0266  );
0267 
0268 void XawTextSinkPreparePaint
0269 (
0270  Widget         w,
0271  int            y,
0272  int            line,
0273  XawTextPosition    from,
0274  XawTextPosition    to,
0275  Bool           highlight
0276 );
0277 
0278 void XawTextSinkDoPaint
0279 (
0280  Widget         w
0281  );
0282 
0283 Bool XawTextSinkEndPaint
0284 (
0285  Widget         w
0286  );
0287 #endif
0288 
0289 #define XtInheritDisplayText       ((_XawSinkDisplayTextProc)_XtInherit)
0290 #define XtInheritInsertCursor      ((_XawSinkInsertCursorProc)_XtInherit)
0291 #define XtInheritClearToBackground ((_XawSinkClearToBackgroundProc)_XtInherit)
0292 #define XtInheritFindPosition      ((_XawSinkFindPositionProc)_XtInherit)
0293 #define XtInheritFindDistance      ((_XawSinkFindDistanceProc)_XtInherit)
0294 #define XtInheritResolve       ((_XawSinkResolveProc)_XtInherit)
0295 #define XtInheritMaxLines      ((_XawSinkMaxLinesProc)_XtInherit)
0296 #define XtInheritMaxHeight     ((_XawSinkMaxHeightProc)_XtInherit)
0297 #define XtInheritSetTabs       ((_XawSinkSetTabsProc)_XtInherit)
0298 #define XtInheritGetCursorBounds   ((_XawSinkGetCursorBoundsProc)_XtInherit)
0299 
0300 #endif /* _XawTextSinkP_h */