Source:NetHack 3.4.3/include/wintype.h

From NetHackWiki
Jump to: navigation, search

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

  1. /*	SCCS Id: @(#)wintype.h	3.4	1996/02/18	*/
  2. /* Copyright (c) David Cohrs, 1991				  */
  3. /* 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 WINTYPE_H
  2. #define WINTYPE_H
  3.  
  4. typedef int winid;		/* a window identifier */
  5.  
  6. /* generic parameter - must not be any larger than a pointer */
  7. typedef union any {
  8. genericptr_t a_void;
  9. struct obj *a_obj;
  10. int  a_int;
  11. char a_char;
  12. schar a_schar;
  13. /* add types as needed */
  14. } anything;
  15. #define ANY_P union any /* avoid typedef in prototypes */
  16. 			/* (buggy old Ultrix compiler) */
  17.  
  18. /* menu return list */
  19. typedef struct mi {
  20. anything item;		/* identifier */
  21. long count;			/* count */
  22. } menu_item;
  23. #define MENU_ITEM_P struct mi
  24.  
  25. /* select_menu() "how" argument types */
  26. #define PICK_NONE 0	/* user picks nothing (display only) */
  27. #define PICK_ONE  1	/* only pick one */
  28. #define PICK_ANY  2	/* can pick any amount */
  29.  
  30. /* window types */
  31. /* any additional port specific types should be defined in win*.h */
  32. #define NHW_MESSAGE 1
  33. #define NHW_STATUS  2
  34. #define NHW_MAP     3
  35. #define NHW_MENU    4
  36. #define NHW_TEXT    5
  37.  
  38. /* attribute types for putstr; the same as the ANSI value, for convenience */
  39. #define ATR_NONE    0
  40. #define ATR_BOLD    1
  41. #define ATR_DIM     2
  42. #define ATR_ULINE   4
  43. #define ATR_BLINK   5
  44. #define ATR_INVERSE 7
  45.  
  46. /* nh_poskey() modifier types */
  47. #define CLICK_1     1
  48. #define CLICK_2     2
  49.  
  50. /* invalid winid */
  51. #define WIN_ERR ((winid) -1)
  52.  
  53. /* menu window keyboard commands (may be mapped) */
  54. #define MENU_FIRST_PAGE		'^'
  55. #define MENU_LAST_PAGE		'|'
  56. #define MENU_NEXT_PAGE		'>'
  57. #define MENU_PREVIOUS_PAGE	'<'
  58. #define MENU_SELECT_ALL		'.'
  59. #define MENU_UNSELECT_ALL	'-'
  60. #define MENU_INVERT_ALL		'@'
  61. #define MENU_SELECT_PAGE	','
  62. #define MENU_UNSELECT_PAGE	'\\'
  63. #define MENU_INVERT_PAGE	'~'
  64. #define MENU_SEARCH		':'
  65.  
  66.  
  67. #endif /* WINTYPE_H */