Source:NetHack 3.3.0/winami.h
Revision as of 12:09, 4 March 2008 by Kernigh bot (talk | contribs) (NetHack 3.3.0/winami.h moved to Source:NetHack 3.3.0/winami.h: Robot: moved page)
Below is the full text to winami.h from the source code of NetHack 3.3.0. To link to a particular line, write [[NetHack 3.3.0/winami.h#line123]], for example.
Warning! This is the source code from an old release. For the latest release, see Source code
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. /* SCCS Id: @(#)winami.h 3.3 93/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. */ 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. char selected; /* Been selected? */ 20. char selector; /* Char used to select this entry. */ 21. char gselector; /* Group selector */ 22. char canselect; /* Can user select this entry. */ 23. char attr; /* Attribute for the line. */ 24. char *str; /* The text of the item. */ 25. } amii_menu_item; 26. 27. struct amii_menu 28. { 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 disprows; /* Rows displayed so far (used for paging in message win) */ 45. xchar offx, offy; /* offset from topleft of display */ 46. short vwx, vwy, vcx, vcy; /* View cursor location */ 47. short rows, cols; /* dimensions */ 48. short curx, cury; /* current cursor position */ 49. short maxrow, maxcol; /* the maximum size used -- for INVEN wins */ 50. /* maxcol is also used by WIN_MESSAGE for */ 51. /* tracking the ^P command */ 52. char **data; /* window data [row][column] */ 53. menu_item *mi; /* Menu information */ 54. char *resp; /* valid menu responses (for NHW_INVEN) */ 55. char *canresp; /* cancel responses; 1st is the return value */ 56. char *morestr; /* string to display instead of default */ 57. /* amiga stuff */ 58. struct Window *win; /* Intuition window pointer */ 59. #ifdef INTUI_NEW_LOOK 60. struct ExtNewWindow *newwin; /* NewWindow alloc'd */ 61. #else 62. struct NewWindow *newwin; /* ExtNewWindow alloc'd */ 63. #endif 64. #ifdef INTUI_NEW_LOOK 65. struct TagItem wintags[ MAXWINTAGS ];/* Tag items for this window */ 66. #else 67. long wintags[ MAXWINTAGS*2 ]; 68. #endif 69. void *hook; /* Hook structure pointer for tiles version */ 70. #define FLMAP_INGLYPH 1 /* An NHW_MAP window is in glyph mode */ 71. #define FLMAP_CURSUP 2 /* An NHW_MAP window has the cursor displayed */ 72. #define FLMAP_SKIP 4 73. #define FLMSG_FIRST 1 /* First message in the NHW_MESSAGE window for this turn */ 74. long wflags; 75. short cursx, cursy; /* Where the cursor is displayed at */ 76. short curs_apen, /* Color cursor is displayed in */ 77. curs_bpen; 78. }; 79. 80. /* descriptor for intuition-based displays -- all the per-display data */ 81. /* this is a generic thing - think of it as Screen level */ 82. 83. struct amii_DisplayDesc { 84. /* we need this for Screen size (which will vary with display mode) */ 85. uchar rows, cols; /* width & height of display in text units */ 86. short xpix, ypix; /* width and height of display in pixels */ 87. int toplin; /* flag for topl stuff */ 88. int rawprint; /* number of raw_printed lines since synch */ 89. winid lastwin; /* last window used for I/O */ 90. }; 91. 92. typedef enum { 93. WEUNK, WEKEY, WEMOUSE, WEMENU, 94. } WETYPE; 95. 96. typedef struct WEVENT 97. { 98. WETYPE type; 99. union { 100. int key; 101. struct { 102. int x, y; 103. int qual; 104. } mouse; 105. long menucode; 106. } un; 107. } WEVENT; 108. 109. #define MAXWIN 20 /* maximum number of windows, cop-out */ 110. 111. /* port specific variable declarations */ 112. extern winid WIN_BASE; 113. extern winid WIN_OVER; 114. #define NHW_BASE 6 115. #define NHW_OVER 7 /* overview window */ 116. 117. 118. extern struct amii_WinDesc *amii_wins[MAXWIN + 1]; 119. 120. extern struct amii_DisplayDesc *amiIDisplay; /* the Amiga Intuition descriptor */ 121. 122. extern char morc; /* last character typed to xwaitforspace */ 123. extern char defmorestr[]; /* default --more-- prompt */ 124. 125. #endif /* WINAMI_H */