17a84e134Smrg/*
27a84e134Smrg
37a84e134SmrgCopyright 1989, 1994, 1998  The Open Group
47a84e134Smrg
57a84e134SmrgPermission to use, copy, modify, distribute, and sell this software and its
67a84e134Smrgdocumentation for any purpose is hereby granted without fee, provided that
77a84e134Smrgthe above copyright notice appear in all copies and that both that
87a84e134Smrgcopyright notice and this permission notice appear in supporting
97a84e134Smrgdocumentation.
107a84e134Smrg
117a84e134SmrgThe above copyright notice and this permission notice shall be included in
127a84e134Smrgall copies or substantial portions of the Software.
137a84e134Smrg
147a84e134SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
157a84e134SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
167a84e134SmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
177a84e134SmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
187a84e134SmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
197a84e134SmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
207a84e134Smrg
217a84e134SmrgExcept as contained in this notice, the name of The Open Group shall not be
227a84e134Smrgused in advertising or otherwise to promote the sale, use or other dealings
237a84e134Smrgin this Software without prior written authorization from The Open Group.
247a84e134Smrg
257a84e134Smrg*/
267a84e134Smrg
277a84e134Smrg
287a84e134Smrg/*
297a84e134Smrg * AsciiSrc.h - Public Header file for Ascii Text Source.
307a84e134Smrg *
317a84e134Smrg * This is the public header file for the Ascii Text Source.
327a84e134Smrg * It is intended to be used with the Text widget, the simplest way to use
337a84e134Smrg * this text source is to use the AsciiText Object.
347a84e134Smrg *
357a84e134Smrg * Date:    June 29, 1989
367a84e134Smrg *
377a84e134Smrg * By:      Chris D. Peterson
38421c997bSmrg *          MIT X Consortium
397a84e134Smrg *          kit@expo.lcs.mit.edu
407a84e134Smrg */
417a84e134Smrg
427a84e134Smrg
437a84e134Smrg#ifndef _XawAsciiSrc_h
447a84e134Smrg#define _XawAsciiSrc_h
457a84e134Smrg
467a84e134Smrg#include <X11/Xaw/TextSrc.h>
477a84e134Smrg
487a84e134Smrg/* Resources:
497a84e134Smrg
507a84e134Smrg Name		     Class		RepType		Default Value
517a84e134Smrg ----		     -----		-------		-------------
527a84e134Smrg dataCompression     DataCompression	Boolean		True
537a84e134Smrg length		     Length		int		(internal)
547a84e134Smrg pieceSize	     PieceSize		int		BUFSIZ
557a84e134Smrg string		     String		String		NULL
567a84e134Smrg type		     Type		XawAsciiType	XawAsciiString
577a84e134Smrg useStringInPlace    UseStringInPlace	Boolean		False
587a84e134Smrg
597a84e134Smrg*/
60421c997bSmrg
617a84e134Smrgextern WidgetClass asciiSrcObjectClass;
627a84e134Smrg
637a84e134Smrgtypedef struct _AsciiSrcClassRec *AsciiSrcObjectClass;
647a84e134Smrgtypedef struct _AsciiSrcRec      *AsciiSrcObject;
657a84e134Smrg
667a84e134Smrg#define AsciiSourceObjectClass AsciiSrcObjectClass
677a84e134Smrg#define AsciiSourceObject      AsciiSrcObject
687a84e134Smrg
697a84e134Smrg/*
707a84e134Smrg * Resource Definitions
717a84e134Smrg */
727a84e134Smrg#define XtCDataCompression "DataCompression"
737a84e134Smrg#define XtCPieceSize "PieceSize"
747a84e134Smrg#define XtCType "Type"
757a84e134Smrg#define XtCUseStringInPlace "UseStringInPlace"
767a84e134Smrg
777a84e134Smrg#define XtNdataCompression "dataCompression"
787a84e134Smrg#define XtNpieceSize "pieceSize"
797a84e134Smrg#define XtNtype "type"
807a84e134Smrg#define XtNuseStringInPlace "useStringInPlace"
817a84e134Smrg
827a84e134Smrg#define XtRAsciiType "AsciiType"
837a84e134Smrg
847a84e134Smrg#define XtEstring "string"
857a84e134Smrg#define XtEfile "file"
867a84e134Smrg
877a84e134Smrgtypedef enum {
887a84e134Smrg  XawAsciiFile,
897a84e134Smrg  XawAsciiString
907a84e134Smrg} XawAsciiType;
917a84e134Smrg
927a84e134Smrg/*
937a84e134Smrg * Public routines
947a84e134Smrg */
957a84e134Smrg
967a84e134Smrg_XFUNCPROTOBEGIN
977a84e134Smrg
987a84e134Smrg/*
997a84e134Smrg * Function:
1007a84e134Smrg *	XawAsciiSourceFreeString
1017a84e134Smrg *
1027a84e134Smrg * Parameters:
1037a84e134Smrg *	w - AsciiSrc object
1047a84e134Smrg *
1057a84e134Smrg * Description:
1067a84e134Smrg *	  Frees the string returned by a get values call
1077a84e134Smrg *		     on the string when the source is of type string.
1087a84e134Smrg */
1097a84e134Smrgvoid XawAsciiSourceFreeString
1107a84e134Smrg(
1117a84e134Smrg Widget		w
1127a84e134Smrg );
1137a84e134Smrg
1147a84e134Smrg/*
1157a84e134Smrg * Function:
1167a84e134Smrg *	XawAsciiSave
1177a84e134Smrg *
1187a84e134Smrg * Arguments:
1197a84e134Smrg *	w - asciiSrc Object.
1207a84e134Smrg *
1217a84e134Smrg * Description:
1227a84e134Smrg *	Saves all the pieces into a file or string as required.
1237a84e134Smrg *
1247a84e134Smrg * Returns:
1257a84e134Smrg *	True if the save was successful
1267a84e134Smrg */
1277a84e134SmrgBool XawAsciiSave
1287a84e134Smrg(
1297a84e134Smrg Widget		w
1307a84e134Smrg );
1317a84e134Smrg
1327a84e134Smrg/*
1337a84e134Smrg * Function:
1347a84e134Smrg *	XawAsciiSaveAsFile
1357a84e134Smrg *
1367a84e134Smrg * Parameters:
1377a84e134Smrg *	w    - asciiSrc object
1387a84e134Smrg *	name - name of the file to save this file into
1397a84e134Smrg *
1407a84e134Smrg * Description:
1417a84e134Smrg *	Save the current buffer as a file.
1427a84e134Smrg *
1437a84e134Smrg * Returns:
1447a84e134Smrg *	True if the save was successful
1457a84e134Smrg */
1467a84e134SmrgBool XawAsciiSaveAsFile
1477a84e134Smrg(
1487a84e134Smrg Widget		w,
1497a84e134Smrg _Xconst char	*name
1507a84e134Smrg );
1517a84e134Smrg
1527a84e134Smrg/*
1537a84e134Smrg * Function:
1547a84e134Smrg *	XawAsciiSourceChanged
1557a84e134Smrg *
1567a84e134Smrg * Parameters:
1577a84e134Smrg *	w - asciiSource object
1587a84e134Smrg *
1597a84e134Smrg * Description:
1607a84e134Smrg *	Returns true if the source has changed since last saved.
1617a84e134Smrg *
1627a84e134Smrg * Returns:
1637a84e134Smrg *	a Boolean (see description)
1647a84e134Smrg */
1657a84e134SmrgBool XawAsciiSourceChanged
1667a84e134Smrg(
1677a84e134Smrg Widget		w
1687a84e134Smrg );
1697a84e134Smrg
1707a84e134Smrg_XFUNCPROTOEND
1717a84e134Smrg
1727a84e134Smrg#endif /* _XawAsciiSrc_h */
173