AsciiSrcP.h

Go to the documentation of this file.
00001 /*
00002 * $XConsortium: AsciiSrcP.h,v 1.10 94/04/17 20:11:49 kaleb Exp $
00003 */
00004 
00005 
00006 /***********************************************************
00007 
00008 Copyright (c) 1987, 1988, 1994  X Consortium
00009 
00010 Permission is hereby granted, free of charge, to any person obtaining a copy
00011 of this software and associated documentation files (the "Software"), to deal
00012 in the Software without restriction, including without limitation the rights
00013 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00014 copies of the Software, and to permit persons to whom the Software is
00015 furnished to do so, subject to the following conditions:
00016 
00017 The above copyright notice and this permission notice shall be included in
00018 all copies or substantial portions of the Software.
00019 
00020 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00021 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00022 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
00023 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00024 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00025 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00026 
00027 Except as contained in this notice, the name of the X Consortium shall not be
00028 used in advertising or otherwise to promote the sale, use or other dealings
00029 in this Software without prior written authorization from the X Consortium.
00030 
00031 
00032 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
00033 
00034                         All Rights Reserved
00035 
00036 Permission to use, copy, modify, and distribute this software and its 
00037 documentation for any purpose and without fee is hereby granted, 
00038 provided that the above copyright notice appear in all copies and that
00039 both that copyright notice and this permission notice appear in 
00040 supporting documentation, and that the name of Digital not be
00041 used in advertising or publicity pertaining to distribution of the
00042 software without specific, written prior permission.  
00043 
00044 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
00045 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
00046 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
00047 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
00048 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
00049 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
00050 SOFTWARE.
00051 
00052 ******************************************************************/
00053 
00054 /*
00055  * AsciiSrcP.h - Private Header for Ascii Text Source.
00056  *
00057  * This is the private header file for the Ascii Text Source.
00058  * It is intended to be used with the Text widget, the simplest way to use
00059  * this text source is to use the AsciiText Object.
00060  *
00061  * Date:    June 29, 1989
00062  *
00063  * By:      Chris D. Peterson
00064  *          MIT X Consortium 
00065  *          kit@expo.lcs.mit.edu
00066  */
00067 
00068 /* 
00069  * TextSrcP.h - Private definitions for AsciiSrc object
00070  * 
00071  */
00072 
00073 #ifndef _XawAsciiSrcP_h
00074 #define _XawAsciiSrcP_h
00075 
00076 #include <X11/Xaw3d/TextSrcP.h>
00077 #include <X11/Xaw3d/AsciiSrc.h>
00078 
00079 /************************************************************
00080  *
00081  * Private declarations.
00082  *
00083  ************************************************************/
00084 
00085 #ifdef L_tmpnam
00086 #define TMPSIZ L_tmpnam
00087 #else
00088 #define TMPSIZ 32               /* bytes to allocate for tmpnam */
00089 #endif
00090 
00091 #define MAGIC_VALUE ((XawTextPosition) -1) /* Magic value. */
00092 
00093 #define streq(a, b)        ( strcmp((a), (b)) == 0 )
00094 
00095 typedef struct _Piece {         /* Piece of the text file of BUFSIZ allocated 
00096                                    characters. */
00097   char * text;                  /* The text in this buffer. */
00098   XawTextPosition used;         /* The number of characters of this buffer 
00099                                    that have been used. */
00100   struct _Piece *prev, *next;   /* linked list pointers. */
00101 } Piece;
00102 
00103 /************************************************************
00104  *
00105  * New fields for the AsciiSrc object class record.
00106  *
00107  ************************************************************/
00108 
00109 typedef struct _AsciiSrcClassPart { char foo; } AsciiSrcClassPart;
00110 
00111 /* Full class record declaration */
00112 typedef struct _AsciiSrcClassRec {
00113     ObjectClassPart     object_class;
00114     TextSrcClassPart    text_src_class;
00115     AsciiSrcClassPart   ascii_src_class;
00116 } AsciiSrcClassRec;
00117 
00118 extern AsciiSrcClassRec asciiSrcClassRec;
00119 
00120 /* New fields for the AsciiSrc object record */
00121 
00122 typedef struct _AsciiSrcPart {
00123 
00124   /* Resources. */
00125 
00126   char       *string;           /* either the string, or the
00127                                    file name, depending upon the type. */
00128   XawAsciiType type;            /* either string or disk. */
00129   XawTextPosition piece_size;   /* Size of text buffer for each piece. */
00130   Boolean data_compression;     /* compress to minimum memory automatically
00131                                    on save? */
00132   XtCallbackList callback;      /* A callback list to call when the source is
00133                                    changed. */
00134   Boolean use_string_in_place;  /* Use the string passed in place. */
00135   int     ascii_length;         /* length field for ascii string emulation. */
00136 
00137 #ifdef ASCII_DISK
00138   String filename;              /* name of file for Compatability. */
00139 #endif /* ASCII_DISK */
00140 
00141 /* Private data. */
00142 
00143   Boolean       is_tempfile;      /* Is this a temporary file? */
00144   Boolean       changes;          /* Has this file been edited? */
00145   Boolean       allocated_string; /* Have I allocated the
00146                                      string in ascii_src->string? */
00147   XawTextPosition length;       /* length of file */
00148   Piece * first_piece;          /* first piece of the text. */
00149 } AsciiSrcPart;
00150 
00151 /****************************************************************
00152  *
00153  * Full instance record declaration
00154  *
00155  ****************************************************************/
00156 
00157 typedef struct _AsciiSrcRec {
00158   ObjectPart    object;
00159   TextSrcPart   text_src;
00160   AsciiSrcPart  ascii_src;
00161 } AsciiSrcRec;
00162 
00163 #endif /* _XawAsciiSrcP_h */ 

Generated on Sun Mar 4 15:03:55 2007 for Scilab [trunk] by  doxygen 1.5.1