749N/A/* $XConsortium: AsciiSrc.h,v 1.15 94/04/17 20:11:46 kaleb Exp $ */
749N/A
749N/A/*
749N/A
749N/ACopyright (c) 1989, 1994 X Consortium
749N/A
749N/APermission is hereby granted, free of charge, to any person obtaining a copy
749N/Aof this software and associated documentation files (the "Software"), to deal
749N/Ain the Software without restriction, including without limitation the rights
749N/Ato use, copy, modify, merge, publish, distribute, sublicense, and/or sell
749N/Acopies of the Software, and to permit persons to whom the Software is
749N/Afurnished to do so, subject to the following conditions:
749N/A
749N/AThe above copyright notice and this permission notice shall be included in
749N/Aall copies or substantial portions of the Software.
749N/A
749N/ATHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
749N/AIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
749N/AFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
749N/AX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
749N/AAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
749N/ACONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
749N/A
749N/AExcept as contained in this notice, the name of the X Consortium shall not be
749N/Aused in advertising or otherwise to promote the sale, use or other dealings
749N/Ain this Software without prior written authorization from the X Consortium.
749N/A
749N/A*/
749N/A
749N/A
749N/A/*
749N/A * AsciiSrc.h - Public Header file for Ascii Text Source.
749N/A *
749N/A * This is the public header file for the Ascii Text Source.
749N/A * It is intended to be used with the Text widget, the simplest way to use
749N/A * this text source is to use the AsciiText Object.
749N/A *
749N/A * Date: June 29, 1989
749N/A *
749N/A * By: Chris D. Peterson
749N/A * MIT X Consortium
749N/A * kit@expo.lcs.mit.edu
749N/A */
749N/A
749N/A
749N/A#ifndef _XawAsciiSrc_h
749N/A#define _XawAsciiSrc_h
749N/A
749N/A#include <X11/Xaw/TextSrc.h>
749N/A
749N/A/* Resources:
749N/A
749N/A Name Class RepType Default Value
749N/A ---- ----- ------- -------------
749N/A callback Callback Callback (none)
749N/A dataCompression DataCompression Boolean True
749N/A length Length int (internal)
749N/A pieceSize PieceSize int BUFSIZ
749N/A string String String NULL
749N/A type Type XawAsciiType XawAsciiString
749N/A useStringInPlace UseStringInPlace Boolean False
749N/A
749N/A*/
749N/A
749N/A/* Class record constants */
749N/A
749N/Aextern WidgetClass asciiSrcObjectClass;
749N/A
749N/Atypedef struct _AsciiSrcClassRec *AsciiSrcObjectClass;
749N/Atypedef struct _AsciiSrcRec *AsciiSrcObject;
749N/A
749N/A/*
749N/A * Just to make people's lives a bit easier.
749N/A */
749N/A
749N/A#define AsciiSourceObjectClass AsciiSrcObjectClass
749N/A#define AsciiSourceObject AsciiSrcObject
749N/A
749N/A/*
749N/A * Resource Definitions.
749N/A */
749N/A
749N/A#define XtCDataCompression "DataCompression"
749N/A#define XtCPieceSize "PieceSize"
749N/A#define XtCType "Type"
749N/A#define XtCUseStringInPlace "UseStringInPlace"
749N/A
749N/A#define XtNdataCompression "dataCompression"
749N/A#define XtNpieceSize "pieceSize"
749N/A#define XtNtype "type"
749N/A#define XtNuseStringInPlace "useStringInPlace"
749N/A
749N/A#define XtRAsciiType "AsciiType"
749N/A
749N/A#define XtEstring "string"
749N/A#define XtEfile "file"
749N/A
749N/Atypedef enum {XawAsciiFile, XawAsciiString} XawAsciiType;
749N/A
749N/A/************************************************************
749N/A *
749N/A * Public routines
749N/A *
749N/A ************************************************************/
749N/A
749N/A_XFUNCPROTOBEGIN
749N/A
749N/A/* Function Name: XawAsciiSourceFreeString
749N/A * Description: Frees the string returned by a get values call
749N/A * on the string when the source is of type string.
749N/A * Arguments: w - the AsciiSrc object.
749N/A * Returns: none.
749N/A */
749N/A
749N/Aextern void XawAsciiSourceFreeString(
749N/A#if NeedFunctionPrototypes
749N/A Widget /* w */
749N/A#endif
749N/A);
749N/A
749N/A/* Function Name: XawAsciiSave
749N/A * Description: Saves all the pieces into a file or string as required.
749N/A * Arguments: w - the asciiSrc Object.
749N/A * Returns: TRUE if the save was successful.
749N/A */
749N/A
749N/Aextern Boolean XawAsciiSave(
749N/A#if NeedFunctionPrototypes
749N/A Widget /* w */
749N/A#endif
749N/A);
749N/A
749N/A/* Function Name: XawAsciiSaveAsFile
749N/A * Description: Save the current buffer as a file.
749N/A * Arguments: w - the asciiSrc object.
749N/A * name - name of the file to save this file into.
749N/A * Returns: True if the save was successful.
749N/A */
749N/A
749N/Aextern Boolean XawAsciiSaveAsFile(
749N/A#if NeedFunctionPrototypes
749N/A Widget /* w */,
749N/A _Xconst char* /* name */
749N/A#endif
749N/A);
749N/A
749N/A/* Function Name: XawAsciiSourceChanged
749N/A * Description: Returns true if the source has changed since last saved.
749N/A * Arguments: w - the asciiSource object.
749N/A * Returns: a Boolean (see description).
749N/A */
749N/A
749N/Aextern Boolean XawAsciiSourceChanged(
749N/A#if NeedFunctionPrototypes
749N/A Widget /* w */
749N/A#endif
749N/A);
749N/A
749N/A_XFUNCPROTOEND
749N/A
749N/A#endif /* _XawAsciiSrc_h */
749N/A