home *** CD-ROM | disk | FTP | other *** search
/ IRIS Development Option 6.2 / IRIS_Development_Option_6.2_814-0478-001.iso / dist / dev.idb / usr / include / abi / Xm / TextStrSoP.h.z / TextStrSoP.h
C/C++ Source or Header  |  1996-03-14  |  8KB  |  263 lines

  1. /* 
  2.  * (c) Copyright 1989, 1990, 1991, 1992, 1993 OPEN SOFTWARE FOUNDATION, INC. 
  3.  * ALL RIGHTS RESERVED 
  4. */ 
  5. /* 
  6.  * Motif Release 1.2.3
  7. */ 
  8. /*   $RCSfile: TextStrSoP.h,v $ $Revision: 1.2 $ $Date: 1994/04/20 01:40:45 $ */
  9. /*
  10. *  (c) Copyright 1989, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  11. /*
  12. *  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  13. #ifndef _XmTextStrSoP_h
  14. #define _XmTextStrSoP_h
  15.  
  16. #include <Xm/XmP.h>
  17. #include <Xm/Text.h>
  18.  
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22.  
  23. /****************************************************************
  24.  *
  25.  * Definitions for use by sources and source users.
  26.  *
  27.  ****************************************************************/
  28.  
  29. typedef enum {EditDone, EditError, EditReject} XmTextStatus;
  30.  
  31. typedef enum {XmsdLeft, XmsdRight} XmTextScanDirection;
  32.     
  33. typedef struct _XmSourceDataRec {
  34.     XmTextSource source;    /* Backpointer to source record. */
  35.     XmTextWidget *widgets;    /* Array of widgets displaying this source. */
  36.     XmTextPosition left, right; /* Left and right extents of selection. */
  37.     char * ptr;            /* Actual string data. */
  38.     char * value;        /* Value of the string data. */
  39.     char * gap_start;        /* Gapped buffer start pointer */
  40.     char * gap_end;        /* Gapped buffer end pointer */
  41.     char * PSWC_NWLN;           /* Holder for char*, short*, int* rep of NWLN */
  42.     int length;            /* Number of chars of data. */
  43.     int maxlength;        /* Space allocated. */
  44.     int old_length;        /* Space allocated for value pointer. */
  45.     int numwidgets;        /* Number of entries in above. */
  46.     int maxallowed;        /* The user is not allowed to grow source */
  47.                 /* to a size greater than this. */
  48.     Time prim_time;             /* time of primary selection */
  49.     Boolean hasselection;    /* Whether we own the selection. */
  50.     Boolean editable;        /* Whether we allow any edits. */
  51. } XmSourceDataRec, *XmSourceData;
  52.  
  53. #ifdef _NO_PROTO
  54. typedef void (*AddWidgetProc)(); /* source, widget */
  55. #else
  56. typedef void (*AddWidgetProc)(
  57.             XmTextSource,
  58.             XmTextWidget);
  59. #endif
  60.  
  61. #ifdef _NO_PROTO
  62. typedef int (*CountLinesProc)(); /* source, start, length */
  63. #else
  64. typedef int (*CountLinesProc)(
  65.              XmTextSource,
  66.              XmTextPosition,
  67.              unsigned long);
  68. #endif
  69.  
  70. #ifdef _NO_PROTO
  71. typedef void (*RemoveWidgetProc)(); /* source, widget */
  72. #else
  73. typedef void (*RemoveWidgetProc)(
  74.             XmTextSource,
  75.             XmTextWidget);
  76. #endif
  77.  
  78. #ifdef _NO_PROTO
  79. typedef XmTextPosition (*ReadProc)(); /* source, position,
  80.                      last_position, block */
  81. #else
  82. typedef XmTextPosition (*ReadProc)(
  83.             XmTextSource,
  84.             XmTextPosition,    /* starting position */
  85.             XmTextPosition,    /* The last position we're interested in.
  86.                       Don't return info about any later
  87.                    positions. */
  88.             XmTextBlock);    /* RETURN: text read in */
  89. #endif
  90.  
  91. #ifdef _NO_PROTO
  92. typedef XmTextStatus (*ReplaceProc)(); /* initiator, event, start, end, block,
  93.                       call_callback */
  94. #else
  95. typedef XmTextStatus (*ReplaceProc)(
  96.             XmTextWidget,
  97.         XEvent *,
  98.             XmTextPosition *,
  99.             XmTextPosition *,
  100.             XmTextBlock,
  101. #if NeedWidePrototypes
  102.                 int);
  103. #else
  104.             Boolean);
  105. #endif /* NeedsWidePrototypes */
  106. #endif
  107.  
  108. #ifdef _NO_PROTO
  109. typedef XmTextPosition (*ScanProc)(); /* source, pos, sType, dir, 
  110.                      count, include */
  111. #else
  112. typedef XmTextPosition (*ScanProc)(
  113.             XmTextSource,
  114.             XmTextPosition,
  115.             XmTextScanType,
  116.             XmTextScanDirection,    /* Either XmsdLeft or XmsdRight. */
  117.             int,
  118. #if NeedWidePrototypes
  119.                 int);
  120. #else
  121.             Boolean);
  122. #endif /* NeedsWidePrototypes */
  123. #endif
  124.  
  125. #ifdef _NO_PROTO
  126. typedef Boolean (*GetSelectionProc)(); /* source, left, right */
  127. #else
  128. typedef Boolean (*GetSelectionProc)(
  129.             XmTextSource,
  130.             XmTextPosition *,
  131.             XmTextPosition *);
  132. #endif
  133.  
  134. #ifdef _NO_PROTO
  135. typedef void (*SetSelectionProc)(); /* source, left, right, time */
  136. #else
  137. typedef void (*SetSelectionProc)(
  138.             XmTextSource,
  139.             XmTextPosition,
  140.             XmTextPosition,
  141.             Time);
  142. #endif
  143.  
  144.  
  145. typedef struct _XmTextSourceRec {
  146.     struct _XmSourceDataRec *data;   /* Source-defined data (opaque type). */
  147.     AddWidgetProc    AddWidget;
  148.     CountLinesProc    CountLines;
  149.     RemoveWidgetProc    RemoveWidget;
  150.     ReadProc        ReadSource;
  151.     ReplaceProc        Replace;
  152.     ScanProc        Scan;
  153.     GetSelectionProc    GetSelection;
  154.     SetSelectionProc    SetSelection;
  155. } XmTextSourceRec;
  156.  
  157.  
  158. /********    Private Function Declarations    ********/
  159. #ifdef _NO_PROTO
  160.  
  161. extern char * _XmStringSourceGetString() ;
  162. extern Boolean _XmTextFindStringBackwards() ;
  163. extern Boolean _XmTextFindStringForwards() ;
  164. extern Boolean _XmStringSourceFindString() ;
  165. extern void _XmStringSourceSetGappedBuffer() ;
  166. extern Boolean _XmTextModifyVerify() ;
  167. extern XmTextSource _XmStringSourceCreate() ;
  168. extern void _XmStringSourceDestroy() ;
  169. extern char * _XmStringSourceGetValue() ;
  170. extern void _XmStringSourceSetValue() ;
  171. extern Boolean _XmStringSourceHasSelection() ;
  172. extern Boolean _XmStringSourceGetEditable() ;
  173. extern void _XmStringSourceSetEditable() ;
  174. extern int _XmStringSourceGetMaxLength() ;
  175. extern void _XmStringSourceSetMaxLength() ;
  176. extern void _XmTextValueChanged();
  177. #else
  178.  
  179. extern char * _XmStringSourceGetString( 
  180.                         XmTextWidget tw,
  181.                         XmTextPosition from,
  182.                         XmTextPosition to,
  183. #if NeedWidePrototypes
  184.                         int want_wchar) ;
  185. #else
  186.                         Boolean want_wchar) ;
  187. #endif /* NeedWidePrototypes */
  188. extern Boolean _XmTextFindStringBackwards( 
  189.                         Widget w,
  190.                         XmTextPosition start,
  191.                         char *search_string,
  192.                         XmTextPosition *position) ;
  193. extern Boolean _XmTextFindStringForwards( 
  194.                         Widget w,
  195.                         XmTextPosition start,
  196.                         char *search_string,
  197.                         XmTextPosition *position) ;
  198. extern Boolean _XmStringSourceFindString( 
  199.                         Widget w,
  200.                         XmTextPosition start,
  201.                         char *string,
  202.                         XmTextPosition *position) ;
  203. extern void _XmStringSourceSetGappedBuffer( 
  204.                         XmSourceData data,
  205.                         XmTextPosition position) ;
  206. extern Boolean _XmTextModifyVerify(
  207.             XmTextWidget initiator,
  208.                 XEvent *event,
  209.                 XmTextPosition *start,
  210.                 XmTextPosition *end,
  211.                 XmTextPosition *cursorPos,
  212.                 XmTextBlock block,
  213.                 XmTextBlock newblock,
  214.             Boolean *freeBlock) ;
  215. extern XmTextSource _XmStringSourceCreate( 
  216.                         char *value,
  217. #if NeedWidePrototypes
  218.                         int is_wchar) ;
  219. #else
  220.                         Boolean is_wchar) ;
  221. #endif /* NeedWidePrototypes */
  222. extern void _XmStringSourceDestroy( 
  223.                         XmTextSource source) ;
  224. extern char * _XmStringSourceGetValue( 
  225.                         XmTextSource source,
  226. #if NeedWidePrototypes
  227.                         int want_wchar) ;
  228. #else
  229.                         Boolean want_wchar) ;
  230. #endif /* NeedWidePrototypes */
  231. extern void _XmStringSourceSetValue( 
  232.                         XmTextWidget widget,
  233.                         char *value) ;
  234. extern Boolean _XmStringSourceHasSelection( 
  235.                         XmTextSource source) ;
  236. extern Boolean _XmStringSourceGetEditable( 
  237.                         XmTextSource source) ;
  238. extern void _XmStringSourceSetEditable( 
  239.                         XmTextSource source,
  240. #if NeedWidePrototypes
  241.                         int editable) ;
  242. #else
  243.                         Boolean editable) ;
  244. #endif /* NeedWidePrototypes */
  245. extern int _XmStringSourceGetMaxLength( 
  246.                         XmTextSource source) ;
  247. extern void _XmStringSourceSetMaxLength( 
  248.                         XmTextSource source,
  249.                         int max) ;
  250. extern void _XmTextValueChanged(XmTextWidget initiator,
  251.                 XEvent *event);
  252.  
  253. #endif /* _NO_PROTO */
  254. /********    End Private Function Declarations    ********/
  255.  
  256.  
  257. #ifdef __cplusplus
  258. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  259. #endif
  260.  
  261. #endif /*  _XmTextStrSoP_h */
  262. /* DON'T ADD ANYTHING AFTER THIS #endif */
  263.