add VI_C_SETTOP for scrollbar setting
[nvi.git] / motif_l / m_motif.h
blob6b783b19fdef253e73776f176abd352fc43af7ac
1 /*-
2 * Copyright (c) 1996
3 * Rob Zimmermann. All rights reserved.
4 * Copyright (c) 1996
5 * Keith Bostic. All rights reserved.
7 * See the LICENSE file for redistribution information.
9 * "$Id: m_motif.h,v 8.7 1996/12/13 11:38:21 bostic Exp $ (Berkeley) $Date: 1996/12/13 11:38:21 $";
12 /* Describes a single 'screen' implemented in X widgetry. */
13 typedef struct {
14 Widget parent, /* the pane */
15 area, /* text goes here */
16 form, /* holds text and scrollbar */
17 scroll; /* not connected yet */
18 Region clip;
19 int color;
20 int rows,
21 cols;
22 int ch_width,
23 ch_height,
24 ch_descent;
25 int curx, cury;
26 char *characters;
27 char *flags;
28 Boolean init;
29 } xvi_screen;
32 * Color support
34 #define COLOR_INVALID 0xff /* force color change */
37 * These are color indices. When vi passes color info, we can do 2..0x3f
38 * in the 8 bits I've allocated.
40 #define COLOR_STANDARD 0x00 /* standard video */
41 #define COLOR_INVERSE 0x01 /* reverse video */
43 /* These are flag bits, they override the above colors. */
44 #define COLOR_CARET 0x80 /* draw the caret */
45 #define COLOR_SELECT 0x40 /* draw the selection */
47 #define ToRowCol( scr, lin, r, c ) \
48 r = (lin) / scr->cols; \
49 c = ((lin) - r * (scr->cols)) % scr->cols;
50 #define Linear( scr, y, x ) \
51 ( (y) * scr->cols + (x) )
52 #define CharAt( scr, y, x ) \
53 ( scr->characters + Linear( scr, y, x ) )
54 #define FlagAt( scr, y, x ) \
55 ( scr->flags + Linear( scr, y, x ) )
57 #define XPOS( scr, x ) \
58 scr->ch_width * (x)
59 #define YTOP( scr, y ) \
60 scr->ch_height * (y)
61 #define YPOS( scr, y ) \
62 YTOP( scr, ((y)+1) ) - scr->ch_descent
64 #define ROW( scr, y ) \
65 ( (y) / scr->ch_height )
67 #define COLUMN( scr, x ) \
68 ( (x) / scr->ch_width )
70 /* Internal use: */
71 extern GC __vi_copy_gc;
72 extern void (*__vi_exitp) __P((void));
73 extern xvi_screen *__vi_screen;