Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-03-13 09:29:44

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 _XawTextSink_h
0049 #define _XawTextSink_h
0050 
0051 #include <X11/Xaw/Text.h>
0052 
0053 /***********************************************************************
0054  *
0055  * TextSink Object
0056  *
0057  ***********************************************************************/
0058 
0059 /* Resources:
0060 
0061  Name            Class      RepType     Default Value
0062  ----            -----      -------     -------------
0063  font                Font            XFontStruct *      XtDefaultFont
0064  foreground          Foreground      Pixel              XtDefaultForeground
0065  background          Background      Pixel              XtDefaultBackground
0066  cursorColor         Color        Pixel     XtDefaultForeground
0067 */
0068 
0069 /* Class record constants */
0070 
0071 extern WidgetClass textSinkObjectClass;
0072 
0073 typedef struct _TextSinkClassRec *TextSinkObjectClass;
0074 typedef struct _TextSinkRec      *TextSinkObject;
0075 
0076 typedef enum {XawisOn, XawisOff} XawTextInsertState;
0077 
0078 #ifndef OLDXAW
0079 #ifndef XtNcursorColor
0080 #define XtNcursorColor      "cursorColor"
0081 #endif
0082 
0083 #define XawNtextProperties  "textProperties"
0084 #define XawCTextProperties  "TextProperties"
0085 #define XawRTextProperties  "XawTextProperties"
0086 #endif
0087 
0088 /*
0089  * Public Functions
0090  */
0091 _XFUNCPROTOBEGIN
0092 
0093 /*
0094  * Function:
0095  *  XawTextSinkDisplayText
0096  *
0097  * Parameters:
0098  *  w     - the TextSink Object
0099  *  x     - location to start drawing text
0100  *  y     - ""
0101  *  pos1      - location of starting and ending points in the text buffer
0102  *  pos2      - ""
0103  *  highlight - highlight this text?
0104  *
0105  * Description:
0106  *  Stub function that in subclasses will display text.
0107  *
0108  * Note:
0109  *    This function doesn't actually display anything, it is only a place
0110  *  holder.
0111  */
0112 void XawTextSinkDisplayText
0113 (
0114  Widget         w,
0115 #if NeedWidePrototypes
0116  int            x,
0117  int            y,
0118 #else
0119  Position       x,
0120  Position       y,
0121 #endif
0122  XawTextPosition    pos1,
0123  XawTextPosition    pos2,
0124 #if NeedWidePrototypes
0125  int            highlight
0126 #else
0127  Boolean        highlight
0128 #endif
0129  );
0130 
0131 /*
0132  * Function:
0133  *  XawTextSinkInsertCursor
0134  *
0135  * Parameters:
0136  *  w   - the TextSink Object.
0137  *  x   - location for the cursor.
0138  *  y   - ""
0139  *  state   - whether to turn the cursor on, or off
0140  *
0141  * Description:
0142  *  Places the InsertCursor.
0143  *
0144  * Note:
0145  *    This function doesn't actually display anything, it is only a place
0146  *  holder.
0147  */
0148 void XawTextSinkInsertCursor
0149 (
0150  Widget         w,
0151 #if NeedWidePrototypes
0152  int            x,
0153  int            y,
0154  int            state
0155 #else
0156  Position       x,
0157  Position       y,
0158  XawTextInsertState state
0159 #endif
0160  );
0161 
0162 /*
0163  * Function:
0164  *  XawTextSinkClearToBackground
0165  *
0166  * Parameters:
0167  *  w   - TextSink Object
0168  *  x   - location of area to clear
0169  *  y   - ""
0170  *  width   - size of area to clear
0171  *  height  - ""
0172  *
0173  * Description:
0174  *  Clears a region of the sink to the background color.
0175  *
0176  * Note:
0177  *    This function doesn't actually display anything, it is only a place
0178  *  holder.
0179  */
0180 void XawTextSinkClearToBackground
0181 (
0182  Widget         w,
0183 #if NeedWidePrototypes
0184  int            x,
0185  int            y,
0186  unsigned int       width,
0187  unsigned int       height
0188 #else
0189  Position       x,
0190  Position       y,
0191  Dimension      width,
0192  Dimension      height
0193 #endif
0194  );
0195 
0196 /*
0197  * Function:
0198  *  XawTextSinkFindPosition
0199  *
0200  * Parameters:
0201  *  w       - TextSink Object
0202  *  fromPos     - reference position
0203  *  fromX       - reference location
0204  *  width       - width of section to paint text
0205  *  stopAtWordBreak - returned position is a word break?
0206  *  resPos      - Position to return
0207  *  resWidth    - Width actually used
0208  *  resHeight   - Height actually used
0209  *
0210  * Description:
0211  *  Finds a position in the text.
0212  */
0213 void XawTextSinkFindPosition
0214 (
0215  Widget         w,
0216  XawTextPosition    fromPos,
0217  int            fromX,
0218  int            width,
0219 #if NeedWidePrototypes
0220  int            stopAtWordBreak,
0221 #else
0222  Boolean        stopAtWordBreak,
0223 #endif
0224  XawTextPosition*   pos_return,
0225  int            *width_return,
0226  int            *height_return
0227  );
0228 
0229 /*
0230  * Function:
0231  *  XawTextSinkFindDistance
0232  *
0233  * Parameters:
0234  *  w       - TextSink Object
0235  *  fromPos     - starting Position
0236  *  fromX       - x location of starting Position
0237  *  toPos       - end Position
0238  *  resWidth    - Distance between fromPos and toPos
0239  *  resPos      - Actual toPos used
0240  *  resHeight   - Height required by this text
0241  *
0242  * Description:
0243  *  Find the Pixel Distance between two text Positions.
0244  */
0245 void XawTextSinkFindDistance
0246 (
0247  Widget         w,
0248  XawTextPosition    fromPos,
0249  int            fromX,
0250  XawTextPosition    toPos,
0251  int            *width_return,
0252  XawTextPosition    *pos_return,
0253  int            *height_return
0254  );
0255 
0256 /*
0257  * Function:
0258  *  XawTextSinkResolve
0259  *
0260  * Parameters:
0261  *  w   - TextSink Object
0262  *  pos - reference Position
0263  *  fromx   - reference Location
0264  *  width   - width to move
0265  *  resPos  - resulting position
0266  *
0267  * Description:
0268  *  Resolves a location to a position.
0269  */
0270 void XawTextSinkResolve
0271 (
0272  Widget         w,
0273  XawTextPosition    fromPos,
0274  int            fromX,
0275  int            width,
0276  XawTextPosition    *pos_return
0277  );
0278 
0279 /*
0280  * Function:
0281  *  XawTextSinkMaxLines
0282  *
0283  * Parameters:
0284  *  w   - TextSink Object
0285  *  height  - height to fit lines into
0286  *
0287  * Returns:
0288  *  Number of lines that will fit
0289  *
0290  * Description:
0291  *  Finds the Maximum number of lines that will fit in a given height.
0292  */
0293 int XawTextSinkMaxLines
0294 (
0295  Widget         w,
0296 #if NeedWidePrototypes
0297  unsigned int       height
0298 #else
0299  Dimension      height
0300 #endif
0301  );
0302 
0303 /*
0304  * Function:
0305  *  XawTextSinkMaxHeight
0306  *
0307  * Parameters:
0308  *  w   - TextSink Object
0309  *  lines   - number of lines
0310  *
0311  * Returns:
0312  *  Height
0313  *
0314  * Description:
0315  *  Finds the Minimum height that will contain a given number lines.
0316  */
0317 int XawTextSinkMaxHeight
0318 (
0319  Widget         w,
0320  int            lines
0321 );
0322 
0323 /*
0324  * Function:
0325  *  XawTextSinkSetTabs
0326  *
0327  * Parameters:
0328  *  w       - TextSink Object
0329  *  tab_count   - number of tabs in the list
0330  *  tabs        - text positions of the tabs
0331  * Description:
0332  *  Sets the Tab stops.
0333  */
0334 void XawTextSinkSetTabs
0335 (
0336  Widget         w,
0337  int            tab_count,
0338  int            *tabs
0339 );
0340 
0341 /*
0342  * Function:
0343  *  XawTextSinkGetCursorBounds
0344  *
0345  * Parameters:
0346  *  w   - TextSink Object
0347  *  rect    - X rectance containing the cursor bounds
0348  * Description:
0349  *  Finds the bounding box for the insert curor (caret).
0350  */
0351 void XawTextSinkGetCursorBounds
0352 (
0353  Widget         w,
0354  XRectangle     *rect_return
0355 );
0356 
0357 _XFUNCPROTOEND
0358 
0359 #endif /* _XawTextSink_h */