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