Wikia

Wikihack

Source:Winami.h

2,032pages on
this wiki
Talk0

Below is the full text to include/winami.h from NetHack 3.4.3. To link to a particular line, write [[winami.h#line123]], for example.

1.    /*	SCCS Id: @(#)winami.h	3.4	1993/01/17	*/
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. */
The NetHack General Public License applies to screenshots, source code and other content from NetHack.
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.   {
30.       amii_menu_item *items;	/* Starting pointer for item list. */
31.       amii_menu_item *last;	/* End pointer for item list. */
32.       const char	   *query;	/* Query string */
33.       int		    count;	/* Number of strings. */
34.       char	    chr;	/* Character to assign for accelerator */
35.   };
36.   
37.   /* descriptor for Amiga Intuition-based windows.  If we decide to cope with
38.    * tty-style windows also, then things will need to change. */
39.   /* per-window data */
40.   struct amii_WinDesc {
41.       xchar type;			/* type of window */
42.       struct amii_menu menu;
43.       boolean active;		/* true if window is active */
44.       boolean wasup;		/* true if menu/text window was already open */
45.       short 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	1	/* First message in the NHW_MESSAGE window for this turn */
75.       long wflags;
76.       short cursx, cursy;		/* Where the cursor is displayed at */
77.       short curs_apen,		/* Color cursor is displayed in */
78.   	  curs_bpen;
79.   };
80.   
81.   /* descriptor for intuition-based displays -- all the per-display data */
82.   /* this is a generic thing - think of it as Screen level */
83.   
84.   struct amii_DisplayDesc {
85.   /* we need this for Screen size (which will vary with display mode) */
86.       uchar rows, cols;		/* width & height of display in text units */
87.       short xpix, ypix;		/* width and height of display in pixels */
88.       int toplin;			/* flag for topl stuff */
89.       int rawprint;		/* number of raw_printed lines since synch */
90.       winid lastwin;		/* last window used for I/O */
91.   };
92.   
93.   typedef enum {
94.       WEUNK, WEKEY, WEMOUSE, WEMENU,
95.   } WETYPE;
96.   
97.   typedef struct WEVENT
98.   {
99.       WETYPE type;
100.      union {
101.  	int key;
102.  	struct {
103.  	    int x, y;
104.  	    int qual;
105.  	} mouse;
106.  	long menucode;
107.      } un;
108.  } WEVENT;
109.  
110.  #define MAXWIN 20		/* maximum number of windows, cop-out */
111.  
112.  /* port specific variable declarations */
113.  extern winid WIN_BASE;
114.  extern winid WIN_OVER;
115.  #define NHW_BASE	6
116.  #define NHW_OVER	7		/* overview window */
117.  
118.  
119.  extern struct amii_WinDesc *amii_wins[MAXWIN + 1];
120.  
121.  extern struct amii_DisplayDesc *amiIDisplay;	/* the Amiga Intuition descriptor */
122.  
123.  extern char morc;		/* last character typed to xwaitforspace */
124.  extern char defmorestr[];	/* default --more-- prompt */
125.  
126.  #endif /* WINAMI_H */

Around Wikia's network

Random Wiki