optionally use bundled db
[nvi.git] / motif_l / m_motif.h
blob876ccafa20f039296e944047ee1f190f9cddf6a3
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.11 1996/12/20 10:26:59 bostic Exp $ (Berkeley) $Date: 1996/12/20 10:26:59 $";
13 * Color support
15 #define COLOR_INVALID 0xff /* force color change */
18 * These are color indices. When vi passes color info, we can do 2..0x3f
19 * in the 8 bits I've allocated.
21 #define COLOR_STANDARD 0x00 /* standard video */
22 #define COLOR_INVERSE 0x01 /* reverse video */
24 /* These are flag bits, they override the above colors. */
25 #define COLOR_CARET 0x80 /* draw the caret */
26 #define COLOR_SELECT 0x40 /* draw the selection */
28 #define ToRowCol( scr, lin, r, c ) \
29 r = (lin) / scr->cols; \
30 c = ((lin) - r * (scr->cols)) % scr->cols;
31 #define Linear( scr, y, x ) \
32 ( (y) * scr->cols + (x) )
33 #define CharAt( scr, y, x ) \
34 ( scr->characters + Linear( scr, y, x ) )
35 #define FlagAt( scr, y, x ) \
36 ( scr->flags + Linear( scr, y, x ) )
38 #define XPOS( scr, x ) \
39 scr->ch_width * (x)
40 #define YTOP( scr, y ) \
41 scr->ch_height * (y)
42 #define YPOS( scr, y ) \
43 YTOP( scr, ((y)+1) ) - scr->ch_descent
45 #define ROW( scr, y ) \
46 ( (y) / scr->ch_height )
48 #define COLUMN( scr, x ) \
49 ( (x) / scr->ch_width )
51 /* Describes a single 'screen' implemented in X widgetry. */
52 typedef struct {
53 Widget parent, /* the pane */
54 area, /* text goes here */
55 form, /* holds text and scrollbar */
56 scroll; /* not connected yet */
57 Region clip;
58 int color;
59 int rows,
60 cols;
61 int ch_width,
62 ch_height,
63 ch_descent;
64 int curx, cury;
65 char *characters;
66 char *flags;
67 Boolean init;
68 } xvi_screen;
70 /* Option type. */
71 typedef enum {
72 optToggle,
73 optInteger,
74 optString,
75 optFile,
76 optTerminator
77 } optKind;
79 /* Option entry. */
80 typedef struct {
81 optKind kind; /* Option type. */
82 String name; /* Option name. */
83 void *value; /* Current option value. */
84 u_int flags; /* Associated flags. */
85 } optData;
87 /* Option page. */
88 typedef struct {
89 String name;
90 String description;
91 Widget holder;
92 optData *toggles;
93 optData *ints;
94 optData *others;
95 } optSheet;
97 /* Utilities for converting X resources...
99 * __XutConvertResources( Widget, String root, XutResource *, int count )
100 * The resource block is loaded with converted values
101 * If the X resource does not exist, no change is made to the value
102 * 'root' should be the application name.
104 typedef enum {
105 XutRKinteger,
106 XutRKboolean,
107 XutRKpixel,
108 XutRKpixelBackup, /* if XutRKpixel fails */
109 XutRKfont,
110 XutRKcursor
111 } XutResourceKind;
113 typedef struct {
114 String name;
115 XutResourceKind kind;
116 void *value;
117 } XutResource;
119 /* Internal use: */
120 extern GC __vi_copy_gc;
121 extern void (*__vi_exitp) __P((void));
122 extern xvi_screen *__vi_screen;
124 #include "extern.h"