home *** CD-ROM | disk | FTP | other *** search
- /*
- tbdecl.h
-
- % header for textbuf files
-
- C-scape 3.2
- Copyright (c) 1986-1988 by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 9/01/87 jmd added NO_PROTO option
- 11/18/87 jmd changed unsigned's to unsigned int's
- 5/31/88 jdc changed to new fangled version
- 8/21/88 jmd preened and poked
- 9/10/88 jdc added cursor movement func (for teds)
- 9/15/87 jmd added _arg
- 10/06/88 jdc added tb->off_text flag
- 11/28/88 jmd removed startsize form tb_Open, reorganized
- 8/04/89 jdc played with tb->set_cursor
- 3/28/90 jmd ansi-fied
- 8/09/90 jdc added wrap_char
- */
-
- /* marking box in char coords */
- typedef struct _mcbox {
-
- int anchor_row;
- int anchor_col;
- int cleat_row;
- int cleat_col;
-
- } mcbox;
-
- /* The textbuf type. */
- typedef struct tb_struct {
-
- bbc_type bbc; /* text chain */
-
- long offset; /* current line */
- long cursor; /* current character */
- int col; /* current displayed col */
- int xcol; /* extra col (ted_Follow) */
-
- unsigned len; /* length of the current line (till '\n') */
- unsigned exp_len; /* displayed length of currrent line */
-
- int width; /* for word wrapping */
- int tab_size;
- long size; /* current character count */
- long max_size;
-
- unsigned limit:1; /* == TRUE if textbuf has max size */
- unsigned nend:1; /* == TRUE if line ends with a '\n' */
-
- unsigned insert:1;
- unsigned cursor_set:1; /* cursor is on text flag */
- unsigned refresh:1; /* flag for routines to update display or not */
- unsigned buf_type:2; /* type flag for textbuf as cut buffer */
-
- unsigned m_stop:1; /* flag for marked region not to follow cursor */
- int mark; /* mark mode */
- long anchor;
- long cleat;
- mcbox markbox; /* marked region anchor & cleat */
-
- char newline_char; /* character to display '\n' as */
- char tab_char; /* character to display '\t' as */
- char wrap_char; /* extra word wrapping character */
-
- } *tb_type;
-
- /*** Functions ***/
-
- /* TEXTBUF.C */
- extern int tb_FindPosition(tb_type tb, int trow, int col);
-
- /* TBSETMAX.C */
- extern int tb_SetMaxSize(tb_type tb, long size);
-
- /**** #define's *****/
-
- #define tb_Rewind(tb) tb_FindPosition(tb, 0, 0)
- #define tb_GetSize(tb) ((tb)->size )
- #define tb_GetMaxSize(tb) ( ( (tb)->limit ) ? (tb)->max_size : -1L )
-
- #define tb_GetWrapWidth(tb) (tb)->width
- #define tb_SetWrapWidth(tb, w) ((tb)->width = w)
- #define tb_GetTabSize(tb) (tb)->tab_size
- #define tb_SetTabSize(tb, s) ((tb)->tab_size = s)
-
- #define tb_GetWrapChar(tb) (tb)->wrap_char
- #define tb_SetWrapChar(tb, c) ((tb)->wrap_char = c)
-
- #define TED_MARK 0
- #define TED_COLMARK 1
- #define TED_NOMARK 2
- #define TED_FIXMARK 4
-
- #define TED_OVERWRITE 0
- #define TED_INSERT 1
-