Home | History | Annotate | Line # | Download | only in dist
      1 /* $XConsortium: tocintrnl.h,v 2.18 91/07/14 18:53:37 converse Exp $ */
      2 /* $XdotOrg$ */
      3 /*
      4  *			  COPYRIGHT 1987
      5  *		   DIGITAL EQUIPMENT CORPORATION
      6  *		       MAYNARD, MASSACHUSETTS
      7  *			ALL RIGHTS RESERVED.
      8  *
      9  * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
     10  * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
     11  * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR
     12  * ANY PURPOSE.  IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
     13  *
     14  * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
     15  * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
     16  * ADDITION TO THAT SET FORTH ABOVE.
     17  *
     18  *
     19  * Permission to use, copy, modify, and distribute this software and its
     20  * documentation for any purpose and without fee is hereby granted, provided
     21  * that the above copyright notice appear in all copies and that both that
     22  * copyright notice and this permission notice appear in supporting
     23  * documentation, and that the name of Digital Equipment Corporation not be
     24  * used in advertising or publicity pertaining to distribution of the software
     25  * without specific, written prior permission.
     26  */
     27 
     28 /* $XFree86$ */
     29 
     30 /* Includes for modules implementing toc stuff. */
     31 
     32 #ifndef _tocinternal_h
     33 #define _tocinternal_h
     34 
     35 #include "xmh.h"
     36 #include <X11/IntrinsicP.h>	/* %%% */
     37 #include "tsource.h"
     38 
     39 typedef enum {
     40     unknown, valid, invalid
     41 } ValidType;
     42 
     43 /* silly IBM compiler, but it's probably just as silly to use bitfields. */
     44 #ifdef AIXV5 /* probably want !gcc too */
     45 #define FateType int
     46 #endif
     47 
     48 typedef struct _MsgRec {
     49     Toc		toc;		/* Which toc this message is in. */
     50     Toc		desttoc;	/* Folder to copy or move to (NULL if none) */
     51     Scrn	*scrn;		/* Scrns showing this message (if any) */
     52     Widget      source;		/* Source (if any) containing this msg. */
     53     XawTextPosition position;	/* Position in the scanfile for this msg. */
     54     XawTextPosition startPos;	/* Where to start the insertion point. */
     55     char	*buf;		/* The scanline for this message. */
     56     int		msgid;		/* Message id for this message. */
     57     short	length;		/* #/chars for this msg's entry in scanfile */
     58     unsigned char num_scrns;	/* How many scrns are currently showing msg */
     59     FateType	fate:2;		/* What will be done to this message */
     60     unsigned	changed:1;	/* True iff this entry needs to be saved */
     61     unsigned	visible:1;	/* Whether we should show this message */
     62     unsigned	temporary:1;	/* Whether we should delete this message when
     63 				   it is no longer visible */
     64     unsigned	reapable:1;	/* True iff we don't need to keep this
     65 				   composition around */
     66     unsigned	unused:2;
     67 } MsgRec;
     68 
     69 #ifdef AIXV5 /* probably want !gcc too */
     70 #undef FateType
     71 #endif
     72 
     73 typedef struct _TocRec {
     74    Scrn		*scrn;		/* Scrns containing this table of contents. */
     75    Cardinal	num_scrns;	/* How many scrns are currently showing toc. */
     76    char 	*foldername;	/* Folder name for this toc */
     77    char		*path;		/* Full path to folder's directory. */
     78    char		*scanfile;	/* Full path to file containing scan. */
     79    Msg		curmsg;		/* Current msgid for this toc. */
     80    int		nummsgs;	/* How many info entries we currently have. */
     81    Msg		*msgs;		/* Array of pointers to info about each msg. */
     82    int		numsequences;	/* #/sequences defined for this folder. */
     83    Sequence	*seqlist;	/* Array of pointers to sequences. */
     84    Sequence 	viewedseq;	/* Seq currently shown (NULL == all msgs) */
     85    Sequence	selectseq;	/* The most recently selected sequence */
     86    Widget       source;		/* Source for the file containing info. */
     87    Boolean	hasselection;	/* Whether we own the selection. */
     88    XawTextPosition left, right;	/* Left and right extents of selection. */
     89    int		length;		/* #/chars in the scanfile. */
     90    int		origlength;	/* Original #/chars in the scanfile. */
     91    int		lastPos;	/* Last legal position */
     92    ValidType	validity;	/* Whether the scan file for this toc is */
     93 				/* up to date. */
     94    Boolean	needsrepaint;	/* TRUE if we should repaint this toc. */
     95    Boolean	needscachesave;	/* TRUE if the cache needs saving. */
     96    Boolean	needslabelupdate;/* TRUE if the toclabel needs repainting. */
     97    Boolean	stopupdate;	/* Zero if refreshing; nonzero if refreshing is
     98 				   currently inhibited. */
     99    Boolean	haschanged;	/* Whether it's changed in the process of */
    100 				/* the current commit. */
    101    Boolean	delete_pending;	/* Is a delete folder operation pending? */
    102    Boolean	force_reset;	/* temporary bug work-around for sequences */
    103    char		*incfile;	/* Which file to incorporate from (if any). */
    104    int		mailpending;	/* True if we're currently displaying
    105 				   mail pending true for this folder */
    106    long		lastreaddate;	/* Last time we read or wrote the cache. */
    107    Stack	sequence_stack;	/* Stack of sequence names. */
    108 } TocRec;
    109 
    110 #endif /* _tocinternal_h */
    111