00001 /* SCCS Id: @(#)winami.h 3.4 1993/01/17 */ 00002 /* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1991. */ 00003 /* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1992, 1993. */ 00004 /* NetHack may be freely redistributed. See license for details. */ 00005 00006 #ifndef WINAMI_H 00007 #define WINAMI_H 00008 00009 #define MAXWINTAGS 5 00010 00011 /* 00012 * Information specific to a menu window. First a structure for each 00013 * menu entry, then the structure for each menu window. 00014 */ 00015 typedef struct amii_mi { 00016 struct amii_mi *next; 00017 anything identifier; /* Opaque type to identify this selection */ 00018 long glyph; /* Glyph for menu item */ 00019 long count; /* Object count */ 00020 char selected; /* Been selected? */ 00021 char selector; /* Char used to select this entry. */ 00022 char gselector; /* Group selector */ 00023 char canselect; /* Can user select this entry. */ 00024 char attr; /* Attribute for the line. */ 00025 char *str; /* The text of the item. */ 00026 } amii_menu_item; 00027 00028 struct amii_menu 00029 { 00030 amii_menu_item *items; /* Starting pointer for item list. */ 00031 amii_menu_item *last; /* End pointer for item list. */ 00032 const char *query; /* Query string */ 00033 int count; /* Number of strings. */ 00034 char chr; /* Character to assign for accelerator */ 00035 }; 00036 00037 /* descriptor for Amiga Intuition-based windows. If we decide to cope with 00038 * tty-style windows also, then things will need to change. */ 00039 /* per-window data */ 00040 struct amii_WinDesc { 00041 xchar type; /* type of window */ 00042 struct amii_menu menu; 00043 boolean active; /* true if window is active */ 00044 boolean wasup; /* true if menu/text window was already open */ 00045 short disprows; /* Rows displayed so far (used for paging in message win) */ 00046 xchar offx, offy; /* offset from topleft of display */ 00047 short vwx, vwy, vcx, vcy; /* View cursor location */ 00048 short rows, cols; /* dimensions */ 00049 short curx, cury; /* current cursor position */ 00050 short maxrow, maxcol; /* the maximum size used -- for INVEN wins */ 00051 /* maxcol is also used by WIN_MESSAGE for */ 00052 /* tracking the ^P command */ 00053 char **data; /* window data [row][column] */ 00054 menu_item *mi; /* Menu information */ 00055 char *resp; /* valid menu responses (for NHW_INVEN) */ 00056 char *canresp; /* cancel responses; 1st is the return value */ 00057 char *morestr; /* string to display instead of default */ 00058 /* amiga stuff */ 00059 struct Window *win; /* Intuition window pointer */ 00060 #ifdef INTUI_NEW_LOOK 00061 struct ExtNewWindow *newwin; /* NewWindow alloc'd */ 00062 #else 00063 struct NewWindow *newwin; /* ExtNewWindow alloc'd */ 00064 #endif 00065 #ifdef INTUI_NEW_LOOK 00066 struct TagItem wintags[ MAXWINTAGS ];/* Tag items for this window */ 00067 #else 00068 long wintags[ MAXWINTAGS*2 ]; 00069 #endif 00070 void *hook; /* Hook structure pointer for tiles version */ 00071 #define FLMAP_INGLYPH 1 /* An NHW_MAP window is in glyph mode */ 00072 #define FLMAP_CURSUP 2 /* An NHW_MAP window has the cursor displayed */ 00073 #define FLMAP_SKIP 4 00074 #define FLMSG_FIRST 1 /* First message in the NHW_MESSAGE window for this turn */ 00075 long wflags; 00076 short cursx, cursy; /* Where the cursor is displayed at */ 00077 short curs_apen, /* Color cursor is displayed in */ 00078 curs_bpen; 00079 }; 00080 00081 /* descriptor for intuition-based displays -- all the per-display data */ 00082 /* this is a generic thing - think of it as Screen level */ 00083 00084 struct amii_DisplayDesc { 00085 /* we need this for Screen size (which will vary with display mode) */ 00086 uchar rows, cols; /* width & height of display in text units */ 00087 short xpix, ypix; /* width and height of display in pixels */ 00088 int toplin; /* flag for topl stuff */ 00089 int rawprint; /* number of raw_printed lines since synch */ 00090 winid lastwin; /* last window used for I/O */ 00091 }; 00092 00093 typedef enum { 00094 WEUNK, WEKEY, WEMOUSE, WEMENU, 00095 } WETYPE; 00096 00097 typedef struct WEVENT 00098 { 00099 WETYPE type; 00100 union { 00101 int key; 00102 struct { 00103 int x, y; 00104 int qual; 00105 } mouse; 00106 long menucode; 00107 } un; 00108 } WEVENT; 00109 00110 #define MAXWIN 20 /* maximum number of windows, cop-out */ 00111 00112 /* port specific variable declarations */ 00113 extern winid WIN_BASE; 00114 extern winid WIN_OVER; 00115 #define NHW_BASE 6 00116 #define NHW_OVER 7 /* overview window */ 00117 00118 00119 extern struct amii_WinDesc *amii_wins[MAXWIN + 1]; 00120 00121 extern struct amii_DisplayDesc *amiIDisplay; /* the Amiga Intuition descriptor */ 00122 00123 extern char morc; /* last character typed to xwaitforspace */ 00124 extern char defmorestr[]; /* default --more-- prompt */ 00125 00126 #endif /* WINAMI_H */