Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:15:29

0001 /* 
0002  * Motif
0003  *
0004  * Copyright (c) 1987-2012, The Open Group. All rights reserved.
0005  *
0006  * These libraries and programs are free software; you can
0007  * redistribute them and/or modify them under the terms of the GNU
0008  * Lesser General Public License as published by the Free Software
0009  * Foundation; either version 2 of the License, or (at your option)
0010  * any later version.
0011  *
0012  * These libraries and programs are distributed in the hope that
0013  * they will be useful, but WITHOUT ANY WARRANTY; without even the
0014  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
0015  * PURPOSE. See the GNU Lesser General Public License for more
0016  * details.
0017  *
0018  * You should have received a copy of the GNU Lesser General Public
0019  * License along with these librararies and programs; if not, write
0020  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
0021  * Floor, Boston, MA 02110-1301 USA
0022 */ 
0023 #ifndef _XmTextStrSoP_h
0024 #define _XmTextStrSoP_h
0025 
0026 #include <Xm/XmP.h>
0027 #include <Xm/Text.h>
0028 
0029 #ifdef __cplusplus
0030 extern "C" {
0031 #endif
0032 
0033 /****************************************************************
0034  *
0035  * Definitions for use by sources and source users.
0036  *
0037  ****************************************************************/
0038 
0039 typedef struct _XmSourceDataRec {
0040   XmTextSource source;  /* Backpointer to source record. */
0041   XmTextWidget *widgets;    /* Array of widgets displaying this source. */
0042   XmTextPosition left, right; /* Left and right extents of selection. */
0043   char * ptr;           /* Actual string data. */
0044   char * value;     /* Value of the string data. */
0045   char * gap_start;     /* Gapped buffer start pointer */
0046   char * gap_end;       /* Gapped buffer end pointer */
0047   char * PSWC_NWLN;           /* Holder for char*, short*, int* rep of NWLN */
0048   int length;           /* Number of chars of data. */
0049   int maxlength;        /* Space allocated. */
0050   int old_length;       /* Space allocated for value pointer. */
0051   int numwidgets;       /* Number of entries in above. */
0052   int maxallowed;       /* The user is not allowed to grow source */
0053   /* to a size greater than this. */
0054   Time prim_time;             /* time of primary selection */
0055   Boolean hasselection; /* Whether we own the selection. */
0056   Boolean editable;     /* Whether we allow any edits. */
0057   Boolean take_selection;   /* Whether we should take the selection. */
0058 } XmSourceDataRec, *XmSourceData;
0059 
0060 typedef void (*AddWidgetProc)(XmTextSource,
0061                   XmTextWidget);
0062 
0063 typedef int (*CountLinesProc)(XmTextSource,
0064                   XmTextPosition,
0065                   unsigned long);
0066 
0067 typedef void (*RemoveWidgetProc)(XmTextSource,
0068                  XmTextWidget);
0069 
0070 typedef XmTextPosition (*ReadProc)(XmTextSource,
0071                    XmTextPosition,  /* starting position */
0072                    XmTextPosition,  /* The last position 
0073                                we're interested in.
0074                                Don't return info 
0075                                about any later
0076                                positions. */
0077                    XmTextBlock);    /* RETURN: text read */
0078 
0079 typedef XmTextStatus (*ReplaceProc)(XmTextWidget,
0080                     XEvent *,
0081                     XmTextPosition *,
0082                     XmTextPosition *,
0083                     XmTextBlock,
0084 #if NeedWidePrototypes
0085                     int);
0086 #else
0087                                     Boolean);
0088 #endif /* NeedsWidePrototypes */
0089 
0090 typedef XmTextPosition (*ScanProc)(XmTextSource,
0091                    XmTextPosition,
0092                    XmTextScanType,
0093                    XmTextScanDirection, /*XmsdLeft/XmsdRight*/
0094                    int,
0095 #if NeedWidePrototypes
0096                    int);
0097 #else
0098                                Boolean);
0099 #endif /* NeedsWidePrototypes */
0100 
0101 typedef Boolean (*GetSelectionProc)(XmTextSource,
0102                                     XmTextPosition *,
0103                                     XmTextPosition *);
0104 
0105 typedef void (*SetSelectionProc)(XmTextSource,
0106                  XmTextPosition,
0107                  XmTextPosition,
0108                  Time);
0109 
0110 
0111 typedef struct _XmTextSourceRec {
0112   struct _XmSourceDataRec *data;   /* Source-defined data (opaque type). */
0113   AddWidgetProc AddWidget;
0114   CountLinesProc    CountLines;
0115   RemoveWidgetProc  RemoveWidget;
0116   ReadProc      ReadSource;
0117   ReplaceProc       Replace;
0118   ScanProc      Scan;
0119   GetSelectionProc  GetSelection;
0120   SetSelectionProc  SetSelection;
0121 } XmTextSourceRec;
0122 
0123 
0124 #ifdef __cplusplus
0125 }  /* Close scope of 'extern "C"' declaration which encloses file. */
0126 #endif
0127 
0128 #endif /*  _XmTextStrSoP_h */
0129 /* DON'T ADD ANYTHING AFTER THIS #endif */