home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / include / x11 / xaw / asciisrc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-17  |  4.4 KB  |  163 lines

  1. /* $XConsortium: AsciiSrc.h,v 1.15 94/04/17 20:11:46 kaleb Exp $ */
  2.  
  3. /*
  4.  
  5. Copyright (c) 1989, 1994  X Consortium
  6.  
  7. Permission is hereby granted, free of charge, to any person obtaining a copy
  8. of this software and associated documentation files (the "Software"), to deal
  9. in the Software without restriction, including without limitation the rights
  10. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11. copies of the Software, and to permit persons to whom the Software is
  12. furnished to do so, subject to the following conditions:
  13.  
  14. The above copyright notice and this permission notice shall be included in
  15. all copies or substantial portions of the Software.
  16.  
  17. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  20. X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  21. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  22. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23.  
  24. Except as contained in this notice, the name of the X Consortium shall not be
  25. used in advertising or otherwise to promote the sale, use or other dealings
  26. in this Software without prior written authorization from the X Consortium.
  27.  
  28. */
  29.  
  30.  
  31. /*
  32.  * AsciiSrc.h - Public Header file for Ascii Text Source.
  33.  *
  34.  * This is the public header file for the Ascii Text Source.
  35.  * It is intended to be used with the Text widget, the simplest way to use
  36.  * this text source is to use the AsciiText Object.
  37.  *
  38.  * Date:    June 29, 1989
  39.  *
  40.  * By:      Chris D. Peterson
  41.  *          MIT X Consortium 
  42.  *          kit@expo.lcs.mit.edu
  43.  */
  44.  
  45.  
  46. #ifndef _XawAsciiSrc_h
  47. #define _XawAsciiSrc_h
  48.  
  49. #include <X11/Xaw/TextSrc.h>
  50.  
  51. /* Resources:
  52.  
  53.  Name             Class        RepType        Default Value
  54.  ----             -----        -------        -------------
  55.  callback         Callback        Callback    (none)
  56.  dataCompression     DataCompression    Boolean        True
  57.  length             Length        int        (internal)
  58.  pieceSize         PieceSize        int        BUFSIZ
  59.  string             String        String        NULL
  60.  type             Type        XawAsciiType    XawAsciiString
  61.  useStringInPlace    UseStringInPlace    Boolean        False
  62.  
  63. */
  64.  
  65. /* Class record constants */
  66.  
  67. extern WidgetClass asciiSrcObjectClass;
  68.  
  69. typedef struct _AsciiSrcClassRec *AsciiSrcObjectClass;
  70. typedef struct _AsciiSrcRec      *AsciiSrcObject;
  71.  
  72. /*
  73.  * Just to make people's lives a bit easier.
  74.  */
  75.  
  76. #define AsciiSourceObjectClass AsciiSrcObjectClass
  77. #define AsciiSourceObject      AsciiSrcObject
  78.  
  79. /*
  80.  * Resource Definitions.
  81.  */
  82.  
  83. #define XtCDataCompression "DataCompression"
  84. #define XtCPieceSize "PieceSize"
  85. #define XtCType "Type"
  86. #define XtCUseStringInPlace "UseStringInPlace"
  87.  
  88. #define XtNdataCompression "dataCompression"
  89. #define XtNpieceSize "pieceSize"
  90. #define XtNtype "type"
  91. #define XtNuseStringInPlace "useStringInPlace"
  92.  
  93. #define XtRAsciiType "AsciiType"
  94.  
  95. #define XtEstring "string"
  96. #define XtEfile "file"
  97.  
  98. typedef enum {XawAsciiFile, XawAsciiString} XawAsciiType;
  99.  
  100. /************************************************************
  101.  *
  102.  * Public routines 
  103.  *
  104.  ************************************************************/
  105.  
  106. _XFUNCPROTOBEGIN
  107.  
  108. /*    Function Name: XawAsciiSourceFreeString
  109.  *    Description: Frees the string returned by a get values call
  110.  *                   on the string when the source is of type string.
  111.  *    Arguments: w - the AsciiSrc object.
  112.  *    Returns: none.
  113.  */
  114.  
  115. extern void XawAsciiSourceFreeString(
  116. #if NeedFunctionPrototypes
  117.     Widget        /* w */
  118. #endif
  119. );
  120.  
  121. /*    Function Name: XawAsciiSave
  122.  *    Description: Saves all the pieces into a file or string as required.
  123.  *    Arguments: w - the asciiSrc Object.
  124.  *    Returns: TRUE if the save was successful.
  125.  */
  126.  
  127. extern Boolean XawAsciiSave(
  128. #if NeedFunctionPrototypes
  129.     Widget        /* w */
  130. #endif
  131. );
  132.  
  133. /*    Function Name: XawAsciiSaveAsFile
  134.  *    Description: Save the current buffer as a file.
  135.  *    Arguments: w - the asciiSrc object.
  136.  *                 name - name of the file to save this file into.
  137.  *    Returns: True if the save was successful.
  138.  */
  139.  
  140. extern Boolean XawAsciiSaveAsFile(
  141. #if NeedFunctionPrototypes
  142.     Widget        /* w */,
  143.     _Xconst char*    /* name */
  144. #endif 
  145. );
  146.  
  147. /*    Function Name: XawAsciiSourceChanged
  148.  *    Description: Returns true if the source has changed since last saved.
  149.  *    Arguments: w - the asciiSource object.
  150.  *    Returns: a Boolean (see description).
  151.  */
  152.  
  153. extern Boolean XawAsciiSourceChanged(
  154. #if NeedFunctionPrototypes
  155.     Widget        /* w */
  156. #endif
  157. );
  158.  
  159. _XFUNCPROTOEND
  160.  
  161. #endif /* _XawAsciiSrc_h */
  162.  
  163.