OSDN Git Service

add missing "#ifdef X11LARGETILE"
[jnethack/source.git] / include / winami.h
1 /* NetHack 3.6  winami.h        $NHDT-Date: 1432512780 2015/05/25 00:13:00 $  $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
2 /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1991. */
3 /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1992, 1993. */
4 /* NetHack may be freely redistributed.  See license for details. */
5
6 #ifndef WINAMI_H
7 #define WINAMI_H
8
9 #define MAXWINTAGS 5
10
11 /*
12  * Information specific to a menu window.  First a structure for each
13  * menu entry, then the structure for each menu window.
14  */
15 typedef struct amii_mi {
16     struct amii_mi *next;
17     anything identifier; /* Opaque type to identify this selection */
18     long glyph;          /* Glyph for menu item */
19     long count;          /* Object count */
20     char selected;       /* Been selected? */
21     char selector;       /* Char used to select this entry. */
22     char gselector;      /* Group selector */
23     char canselect;      /* Can user select this entry. */
24     char attr;           /* Attribute for the line. */
25     char *str;           /* The text of the item. */
26 } amii_menu_item;
27
28 struct amii_menu {
29     amii_menu_item *items; /* Starting pointer for item list. */
30     amii_menu_item *last;  /* End pointer for item list. */
31     const char *query;     /* Query string */
32     int count;             /* Number of strings. */
33     char chr;              /* Character to assign for accelerator */
34 };
35
36 /* descriptor for Amiga Intuition-based windows.  If we decide to cope with
37  * tty-style windows also, then things will need to change. */
38 /* per-window data */
39 struct amii_WinDesc {
40     xchar type; /* type of window */
41     struct amii_menu menu;
42     boolean active; /* true if window is active */
43     boolean wasup;  /* true if menu/text window was already open */
44     short
45         disprows; /* Rows displayed so far (used for paging in message win) */
46     xchar offx, offy;         /* offset from topleft of display */
47     short vwx, vwy, vcx, vcy; /* View cursor location */
48     short rows, cols;         /* dimensions */
49     short curx, cury;         /* current cursor position */
50     short maxrow, maxcol;     /* the maximum size used -- for INVEN wins */
51     /* maxcol is also used by WIN_MESSAGE for */
52     /* tracking the ^P command */
53     char **data;        /* window data [row][column] */
54     menu_item *mi;      /* Menu information */
55     char *resp;         /* valid menu responses (for NHW_INVEN) */
56     char *canresp;      /* cancel responses; 1st is the return value */
57     char *morestr;      /* string to display instead of default */
58                         /* amiga stuff */
59     struct Window *win; /* Intuition window pointer */
60 #ifdef INTUI_NEW_LOOK
61     struct ExtNewWindow *newwin; /* NewWindow alloc'd */
62 #else
63     struct NewWindow *newwin; /* ExtNewWindow alloc'd */
64 #endif
65 #ifdef INTUI_NEW_LOOK
66     struct TagItem wintags[MAXWINTAGS]; /* Tag items for this window */
67 #else
68     long wintags[MAXWINTAGS * 2];
69 #endif
70     void *hook;         /* Hook structure pointer for tiles version */
71 #define FLMAP_INGLYPH 1 /* An NHW_MAP window is in glyph mode */
72 #define FLMAP_CURSUP 2  /* An NHW_MAP window has the cursor displayed */
73 #define FLMAP_SKIP 4
74 #define FLMSG_FIRST \
75     1 /* First message in the NHW_MESSAGE window for this turn */
76     long wflags;
77     short cursx, cursy; /* Where the cursor is displayed at */
78     short curs_apen,    /* Color cursor is displayed in */
79         curs_bpen;
80 };
81
82 /* descriptor for intuition-based displays -- all the per-display data */
83 /* this is a generic thing - think of it as Screen level */
84
85 struct amii_DisplayDesc {
86     /* we need this for Screen size (which will vary with display mode) */
87     uchar rows, cols; /* width & height of display in text units */
88     short xpix, ypix; /* width and height of display in pixels */
89     int toplin;       /* flag for topl stuff */
90     int rawprint;     /* number of raw_printed lines since synch */
91     winid lastwin;    /* last window used for I/O */
92 };
93
94 typedef enum {
95     WEUNK,
96     WEKEY,
97     WEMOUSE,
98     WEMENU,
99 } WETYPE;
100
101 typedef struct WEVENT {
102     WETYPE type;
103     union {
104         int key;
105         struct {
106             int x, y;
107             int qual;
108         } mouse;
109         long menucode;
110     } un;
111 } WEVENT;
112
113 #define MAXWIN 20 /* maximum number of windows, cop-out */
114
115 /* port specific variable declarations */
116 extern winid WIN_BASE;
117 extern winid WIN_OVER;
118 #define NHW_BASE 6
119 #define NHW_OVER 7 /* overview window */
120
121 extern struct amii_WinDesc *amii_wins[MAXWIN + 1];
122
123 extern struct amii_DisplayDesc
124     *amiIDisplay; /* the Amiga Intuition descriptor */
125
126 extern char morc;         /* last character typed to xwaitforspace */
127 extern char defmorestr[]; /* default --more-- prompt */
128
129 #endif /* WINAMI_H */