00001 /* $XConsortium: AsciiSrc.h,v 1.15 94/04/17 20:11:46 kaleb Exp $ */ 00002 00003 /* 00004 00005 Copyright (c) 1989, 1994 X Consortium 00006 00007 Permission is hereby granted, free of charge, to any person obtaining a copy 00008 of this software and associated documentation files (the "Software"), to deal 00009 in the Software without restriction, including without limitation the rights 00010 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00011 copies of the Software, and to permit persons to whom the Software is 00012 furnished to do so, subject to the following conditions: 00013 00014 The above copyright notice and this permission notice shall be included in 00015 all copies or substantial portions of the Software. 00016 00017 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00018 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00019 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00020 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 00021 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00022 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00023 00024 Except as contained in this notice, the name of the X Consortium shall not be 00025 used in advertising or otherwise to promote the sale, use or other dealings 00026 in this Software without prior written authorization from the X Consortium. 00027 00028 */ 00029 00030 00031 /* 00032 * AsciiSrc.h - Public Header file for Ascii Text Source. 00033 * 00034 * This is the public header file for the Ascii Text Source. 00035 * It is intended to be used with the Text widget, the simplest way to use 00036 * this text source is to use the AsciiText Object. 00037 * 00038 * Date: June 29, 1989 00039 * 00040 * By: Chris D. Peterson 00041 * MIT X Consortium 00042 * kit@expo.lcs.mit.edu 00043 */ 00044 00045 00046 #ifndef _XawAsciiSrc_h 00047 #define _XawAsciiSrc_h 00048 00049 #include <X11/Xaw3d/TextSrc.h> 00050 00051 /* Resources: 00052 00053 Name Class RepType Default Value 00054 ---- ----- ------- ------------- 00055 callback Callback Callback (none) 00056 dataCompression DataCompression Boolean True 00057 length Length int (internal) 00058 pieceSize PieceSize int BUFSIZ 00059 string String String NULL 00060 type Type XawAsciiType XawAsciiString 00061 useStringInPlace UseStringInPlace Boolean False 00062 00063 */ 00064 00065 /* Class record constants */ 00066 00067 extern WidgetClass asciiSrcObjectClass; 00068 00069 typedef struct _AsciiSrcClassRec *AsciiSrcObjectClass; 00070 typedef struct _AsciiSrcRec *AsciiSrcObject; 00071 00072 /* 00073 * Just to make people's lives a bit easier. 00074 */ 00075 00076 #define AsciiSourceObjectClass AsciiSrcObjectClass 00077 #define AsciiSourceObject AsciiSrcObject 00078 00079 /* 00080 * Resource Definitions. 00081 */ 00082 00083 #define XtCDataCompression "DataCompression" 00084 #define XtCPieceSize "PieceSize" 00085 #define XtCType "Type" 00086 #define XtCUseStringInPlace "UseStringInPlace" 00087 00088 #define XtNdataCompression "dataCompression" 00089 #define XtNpieceSize "pieceSize" 00090 #define XtNtype "type" 00091 #define XtNuseStringInPlace "useStringInPlace" 00092 00093 #define XtRAsciiType "AsciiType" 00094 00095 #define XtEstring "string" 00096 #define XtEfile "file" 00097 00098 typedef enum {XawAsciiFile, XawAsciiString} XawAsciiType; 00099 00100 /************************************************************ 00101 * 00102 * Public routines 00103 * 00104 ************************************************************/ 00105 00106 _XFUNCPROTOBEGIN 00107 00108 /* Function Name: XawAsciiSourceFreeString 00109 * Description: Frees the string returned by a get values call 00110 * on the string when the source is of type string. 00111 * Arguments: w - the AsciiSrc object. 00112 * Returns: none. 00113 */ 00114 00115 extern void XawAsciiSourceFreeString( 00116 #if NeedFunctionPrototypes 00117 Widget /* w */ 00118 #endif 00119 ); 00120 00121 /* Function Name: XawAsciiSave 00122 * Description: Saves all the pieces into a file or string as required. 00123 * Arguments: w - the asciiSrc Object. 00124 * Returns: TRUE if the save was successful. 00125 */ 00126 00127 extern Boolean XawAsciiSave( 00128 #if NeedFunctionPrototypes 00129 Widget /* w */ 00130 #endif 00131 ); 00132 00133 /* Function Name: XawAsciiSaveAsFile 00134 * Description: Save the current buffer as a file. 00135 * Arguments: w - the asciiSrc object. 00136 * name - name of the file to save this file into. 00137 * Returns: True if the save was successful. 00138 */ 00139 00140 extern Boolean XawAsciiSaveAsFile( 00141 #if NeedFunctionPrototypes 00142 Widget /* w */, 00143 _Xconst char* /* name */ 00144 #endif 00145 ); 00146 00147 /* Function Name: XawAsciiSourceChanged 00148 * Description: Returns true if the source has changed since last saved. 00149 * Arguments: w - the asciiSource object. 00150 * Returns: a Boolean (see description). 00151 */ 00152 00153 extern Boolean XawAsciiSourceChanged( 00154 #if NeedFunctionPrototypes 00155 Widget /* w */ 00156 #endif 00157 ); 00158 00159 _XFUNCPROTOEND 00160 00161 #endif /* _XawAsciiSrc_h */ 00162
1.5.1