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