Source:NetHack 3.4.3/include/winami.h

From NetHackWiki
Jump to: navigation, search

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.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

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