-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathwintype.h
More file actions
123 lines (109 loc) · 3.53 KB
/
wintype.h
File metadata and controls
123 lines (109 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/* SCCS Id: @(#)wintype.h 3.4 1996/02/18 */
/* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */
#ifndef WINTYPE_H
#define WINTYPE_H
typedef int winid; /* a window identifier */
/* generic parameter - must not be any larger than a pointer */
typedef union any {
genericptr_t a_void;
struct obj *a_obj;
struct monst *a_monst;
int a_int;
int a_xint16;
int a_xint8;
char a_char;
schar a_schar;
uchar a_uchar;
unsigned int a_uint;
long a_long;
unsigned long a_ulong;
coordxy a_coordxy;
int *a_iptr;
xint16 *a_xint16ptr;
xint8 *a_xint8ptr;
long *a_lptr;
coordxy *a_coordxyptr;
unsigned long *a_ulptr;
unsigned *a_uptr;
const char *a_string;
int (*a_nfunc)(void);
unsigned long a_mask32; /* used by status highlighting */
/* add types as needed */
} anything;
#define ANY_P union any /* avoid typedef in prototypes */
/* (buggy old Ultrix compiler) */
/* symbolic names for the data types housed in anything */
enum any_types {
ANY_VOID = 1,
ANY_OBJ, /* struct obj */
ANY_MONST, /* struct monst (not used) */
ANY_INT, /* int */
ANY_CHAR, /* char */
ANY_UCHAR, /* unsigned char */
ANY_SCHAR, /* signed char */
ANY_UINT, /* unsigned int */
ANY_LONG, /* long */
ANY_ULONG, /* unsigned long */
ANY_IPTR, /* pointer to int */
ANY_UPTR, /* pointer to unsigned int */
ANY_LPTR, /* pointer to long */
ANY_ULPTR, /* pointer to unsigned long */
ANY_STR, /* pointer to null-terminated char string */
ANY_NFUNC, /* pointer to function taking no args, returning int */
ANY_MASK32, /* 32-bit mask (stored as unsigned long) */
ANY_INVALID /* leave this last */
};
/* menu return list */
typedef struct mi {
anything item; /* identifier */
long count; /* count */
} menu_item;
#define MENU_ITEM_P struct mi
/* select_menu() "how" argument types */
#define PICK_NONE 0 /* user picks nothing (display only) */
#define PICK_ONE 1 /* only pick one */
#define PICK_ANY 2 /* can pick any amount */
/* window types */
/* any additional port specific types should be defined in win*.h */
#define NHW_MESSAGE 1
#define NHW_STATUS 2
#define NHW_MAP 3
#define NHW_MENU 4
#define NHW_TEXT 5
/* attribute types for putstr; the same as the ANSI value, for convenience */
#define ATR_NONE 0
#define ATR_BOLD 1
#define ATR_DIM 2
#define ATR_ITALIC 3
#define ATR_ULINE 4
#define ATR_BLINK 5
#define ATR_INVERSE 7
#ifdef MENU_COLOR
# define ATR_UNDEFINED 8
#endif
/* not a display attribute but passed to putstr() as an attribute;
can be masked with one regular display attribute */
#define ATR_URGENT 16
#define ATR_NOHISTORY 32
/* nh_poskey() modifier types */
#define CLICK_1 1
#define CLICK_2 2
/* invalid winid */
#define WIN_ERR ((winid) -1)
/* menu window keyboard commands (may be mapped) */
#define MENU_FIRST_PAGE '^'
#define MENU_LAST_PAGE '|'
#define MENU_NEXT_PAGE '>'
#define MENU_PREVIOUS_PAGE '<'
#define MENU_SELECT_ALL '.'
#define MENU_UNSELECT_ALL '-'
#define MENU_INVERT_ALL '@'
#define MENU_SELECT_PAGE ','
#define MENU_UNSELECT_PAGE '\\'
#define MENU_INVERT_PAGE '~'
#define MENU_SEARCH ':'
#define MENU_ITEMFLAGS_NONE 0x0000000U
#define MENU_ITEMFLAGS_SELECTED 0x0000001U
#define MENU_ITEMFLAGS_SKIPINVERT 0x0000002U
#endif /* WINTYPE_H */