MultiSrcP.h revision 7a84e134
17a84e134Smrg/* $Xorg: MultiSrcP.h,v 1.4 2001/02/09 02:03:45 xorgcvs Exp $ */
27a84e134Smrg
37a84e134Smrg/*
47a84e134Smrg * Copyright 1991 by OMRON Corporation
57a84e134Smrg *
67a84e134Smrg * Permission to use, copy, modify, distribute, and sell this software and its
77a84e134Smrg * documentation for any purpose is hereby granted without fee, provided that
87a84e134Smrg * the above copyright notice appear in all copies and that both that
97a84e134Smrg * copyright notice and this permission notice appear in supporting
107a84e134Smrg * documentation, and that the name OMRON not be used in
117a84e134Smrg * advertising or publicity pertaining to distribution of the software without
127a84e134Smrg * specific, written prior permission.  OMRON make no representations
137a84e134Smrg * about the suitability of this software for any purpose.  It is provided
147a84e134Smrg * "as is" without express or implied warranty.
157a84e134Smrg *
167a84e134Smrg * OMRON DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
177a84e134Smrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
187a84e134Smrg * EVENT SHALL OMRON BE LIABLE FOR ANY SPECIAL, INDIRECT OR
197a84e134Smrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
207a84e134Smrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
217a84e134Smrg * TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
227a84e134Smrg * PERFORMANCE OF THIS SOFTWARE.
237a84e134Smrg *
247a84e134Smrg *      Author: Li Yuhong	 OMRON Corporation
257a84e134Smrg */
267a84e134Smrg
277a84e134Smrg
287a84e134Smrg/***********************************************************
297a84e134Smrg
307a84e134SmrgCopyright 1987, 1988, 1991, 1994, 1998  The Open Group
317a84e134Smrg
327a84e134SmrgPermission to use, copy, modify, distribute, and sell this software and its
337a84e134Smrgdocumentation for any purpose is hereby granted without fee, provided that
347a84e134Smrgthe above copyright notice appear in all copies and that both that
357a84e134Smrgcopyright notice and this permission notice appear in supporting
367a84e134Smrgdocumentation.
377a84e134Smrg
387a84e134SmrgThe above copyright notice and this permission notice shall be included in
397a84e134Smrgall copies or substantial portions of the Software.
407a84e134Smrg
417a84e134SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
427a84e134SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
437a84e134SmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
447a84e134SmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
457a84e134SmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
467a84e134SmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
477a84e134Smrg
487a84e134SmrgExcept as contained in this notice, the name of The Open Group shall not be
497a84e134Smrgused in advertising or otherwise to promote the sale, use or other dealings
507a84e134Smrgin this Software without prior written authorization from The Open Group.
517a84e134Smrg
527a84e134Smrg
537a84e134SmrgCopyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
547a84e134Smrg
557a84e134Smrg                        All Rights Reserved
567a84e134Smrg
577a84e134SmrgPermission to use, copy, modify, and distribute this software and its
587a84e134Smrgdocumentation for any purpose and without fee is hereby granted,
597a84e134Smrgprovided that the above copyright notice appear in all copies and that
607a84e134Smrgboth that copyright notice and this permission notice appear in
617a84e134Smrgsupporting documentation, and that the name of Digital not be
627a84e134Smrgused in advertising or publicity pertaining to distribution of the
637a84e134Smrgsoftware without specific, written prior permission.
647a84e134Smrg
657a84e134SmrgDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
667a84e134SmrgALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
677a84e134SmrgDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
687a84e134SmrgANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
697a84e134SmrgWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
707a84e134SmrgARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
717a84e134SmrgSOFTWARE.
727a84e134Smrg
737a84e134Smrg******************************************************************/
747a84e134Smrg/* $XFree86: xc/lib/Xaw/MultiSrcP.h,v 1.8 2001/01/17 19:42:28 dawes Exp $ */
757a84e134Smrg
767a84e134Smrg/*
777a84e134Smrg * MultiSrcP.h - Private Header for Multi Text Source.
787a84e134Smrg *
797a84e134Smrg * This is the private header file for the Multi Text Source.
807a84e134Smrg * It is intended to be used with the Text widget, the simplest way to use
817a84e134Smrg * this text source is to use the MultiText Object.
827a84e134Smrg *
837a84e134Smrg * Date:    June 29, 1989
847a84e134Smrg *
857a84e134Smrg * By:      Chris D. Peterson
867a84e134Smrg *          MIT X Consortium
877a84e134Smrg *          kit@expo.lcs.mit.edu
887a84e134Smrg */
897a84e134Smrg
907a84e134Smrg/*
917a84e134Smrg * This file was changed from AsciiSrcP.h.
927a84e134Smrg *
937a84e134Smrg * By Li Yuhong, Sept. 18, 1990
947a84e134Smrg */
957a84e134Smrg
967a84e134Smrg#ifndef _XawMultiSrcP_h
977a84e134Smrg#define _XawMultiSrcP_h
987a84e134Smrg
997a84e134Smrg#include <X11/Xfuncproto.h>
1007a84e134Smrg#include <X11/Xaw/TextSrcP.h>
1017a84e134Smrg#include <X11/Xaw/MultiSrc.h>
1027a84e134Smrg
1037a84e134Smrg#ifdef L_tmpnam
1047a84e134Smrg#define TMPSIZ L_tmpnam
1057a84e134Smrg#else
1067a84e134Smrg#ifdef PATH_MAX
1077a84e134Smrg#define TMPSIZ PATH_MAX
1087a84e134Smrg#else
1097a84e134Smrg#define TMPSIZ 1024		/* bytes to allocate for tmpnam */
1107a84e134Smrg#endif
1117a84e134Smrg#endif
1127a84e134Smrg
1137a84e134Smrgtypedef struct _MultiPiece {	/* Piece of the text file of BUFSIZ allocated
1147a84e134Smrg				   characters */
1157a84e134Smrg    wchar_t* text;		/* The text in this buffer */
1167a84e134Smrg    XawTextPosition used;	/* The number of characters of this buffer
1177a84e134Smrg				   that have been used */
1187a84e134Smrg    struct _MultiPiece *prev, *next;	/* linked list pointers */
1197a84e134Smrg} MultiPiece;
1207a84e134Smrg
1217a84e134Smrg/* New fields for the MultiSrc object class */
1227a84e134Smrgtypedef struct _MultiSrcClassPart {
1237a84e134Smrg    XtPointer extension;
1247a84e134Smrg} MultiSrcClassPart;
1257a84e134Smrg
1267a84e134Smrg/* Full class record */
1277a84e134Smrgtypedef struct _MultiSrcClassRec {
1287a84e134Smrg    ObjectClassPart     object_class;
1297a84e134Smrg    TextSrcClassPart	text_src_class;
1307a84e134Smrg    MultiSrcClassPart	multi_src_class;
1317a84e134Smrg} MultiSrcClassRec;
1327a84e134Smrg
1337a84e134Smrgextern MultiSrcClassRec multiSrcClassRec;
1347a84e134Smrg
1357a84e134Smrg/* New fields for the MultiSrc object */
1367a84e134Smrgtypedef struct _MultiSrcPart {
1377a84e134Smrg    /* resources */
1387a84e134Smrg    XIC ic;			/* for X Input Method */
1397a84e134Smrg    XtPointer string;		/* either the string, or the file name, depend-
1407a84e134Smrg				   ing upon the `type'.  ALWAYS IN MB FORMAT */
1417a84e134Smrg    XawAsciiType type;		/* either string or disk */
1427a84e134Smrg    XawTextPosition piece_size;	/* Size of text buffer for each piece */
1437a84e134Smrg    Boolean data_compression;	/* compress to minimum memory automatically
1447a84e134Smrg				   on save? */
1457a84e134Smrg#ifdef OLDXAW
1467a84e134Smrg    XtCallbackList callback;
1477a84e134Smrg#endif
1487a84e134Smrg    Boolean use_string_in_place;/* Use the string passed in place */
1497a84e134Smrg    int multi_length;		/* length field for multi string emulation */
1507a84e134Smrg
1517a84e134Smrg    /* private */
1527a84e134Smrg
1537a84e134Smrg    Boolean is_tempfile;	  /* Is this a temporary file? */
1547a84e134Smrg#ifdef OLDXAW
1557a84e134Smrg    Boolean changes;
1567a84e134Smrg#endif
1577a84e134Smrg    Boolean allocated_string;	/* Have I allocated the
1587a84e134Smrg				   string in multi_src->string? */
1597a84e134Smrg    XawTextPosition length; 	/* length of file - IN CHARACTERS, NOT BYTES */
1607a84e134Smrg    MultiPiece *first_piece;	/* first piece of the text */
1617a84e134Smrg#ifndef OLDXAW
1627a84e134Smrg    XtPointer pad[4];	/* for future use and keep binary compatability */
1637a84e134Smrg#endif
1647a84e134Smrg} MultiSrcPart;
1657a84e134Smrg
1667a84e134Smrg/* Full instance record */
1677a84e134Smrgtypedef struct _MultiSrcRec {
1687a84e134Smrg  ObjectPart    object;
1697a84e134Smrg  TextSrcPart	text_src;
1707a84e134Smrg  MultiSrcPart	multi_src;
1717a84e134Smrg} MultiSrcRec;
1727a84e134Smrg
1737a84e134Smrg_XFUNCPROTOBEGIN
1747a84e134Smrg
1757a84e134Smrgvoid _XawMultiSourceFreeString
1767a84e134Smrg(
1777a84e134Smrg Widget		w
1787a84e134Smrg );
1797a84e134Smrg
1807a84e134Smrg_XFUNCPROTOEND
1817a84e134Smrg
1827a84e134Smrg#endif /* _XawMultiSrcP_h */
183