Source:NetHack 3.6.1/include/wintype.h

From NetHackWiki
(Redirected from Wintype.h)
Jump to: navigation, search

Below is the full text to wintype.h from the source code of NetHack 3.6.1. To link to a particular line, write [[Source:NetHack 3.6.1/include/wintype.h#line123]], for example.

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.  /* NetHack 3.6  wintype.h       $NHDT-Date: 1461028538 2016/04/19 01:15:38 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.16 $ */
  2.  /* Copyright (c) David Cohrs, 1991                                */
  3.  /* NetHack may be freely redistributed.  See license for details. */
  4.  
  5.  #ifndef WINTYPE_H
  6.  #define WINTYPE_H
  7.  
  8.  typedef int winid; /* a window identifier */
  9.  
  10.  /* generic parameter - must not be any larger than a pointer */
  11.  typedef union any {
  12.      genericptr_t a_void;
  13.      struct obj *a_obj;
  14.      struct monst *a_monst;
  15.      int a_int;
  16.      char a_char;
  17.      schar a_schar;
  18.      uchar a_uchar;
  19.      unsigned int a_uint;
  20.      long a_long;
  21.      unsigned long a_ulong;
  22.      int *a_iptr;
  23.      long *a_lptr;
  24.      unsigned long *a_ulptr;
  25.      unsigned *a_uptr;
  26.      const char *a_string;
  27.      int NDECL((*a_nfunc));
  28.      unsigned long a_mask32; /* used by status highlighting */
  29.      /* add types as needed */
  30.  } anything;
  31.  #define ANY_P union any /* avoid typedef in prototypes */
  32.                          /* (buggy old Ultrix compiler) */
  33.  
  34.  /* symbolic names for the data types housed in anything */
  35.  enum any_types {
  36.      ANY_VOID = 1,
  37.      ANY_OBJ,         /* struct obj */
  38.      ANY_MONST,       /* struct monst (not used) */
  39.      ANY_INT,         /* int */
  40.      ANY_CHAR,        /* char */
  41.      ANY_UCHAR,       /* unsigned char */
  42.      ANY_SCHAR,       /* signed char */
  43.      ANY_UINT,        /* unsigned int */
  44.      ANY_LONG,        /* long */
  45.      ANY_ULONG,       /* unsigned long */
  46.      ANY_IPTR,        /* pointer to int */
  47.      ANY_UPTR,        /* pointer to unsigned int */
  48.      ANY_LPTR,        /* pointer to long */
  49.      ANY_ULPTR,       /* pointer to unsigned long */
  50.      ANY_STR,         /* pointer to null-terminated char string */
  51.      ANY_NFUNC,       /* pointer to function taking no args, returning int */
  52.      ANY_MASK32       /* 32-bit mask (stored as unsigned long) */
  53.  };
  54.  
  55.  /* menu return list */
  56.  typedef struct mi {
  57.      anything item; /* identifier */
  58.      long count;    /* count */
  59.  } menu_item;
  60.  #define MENU_ITEM_P struct mi
  61.  
  62.  /* select_menu() "how" argument types */
  63.  /* [MINV_PICKMASK in monst.h assumes these have values of 0, 1, 2] */
  64.  #define PICK_NONE 0 /* user picks nothing (display only) */
  65.  #define PICK_ONE 1  /* only pick one */
  66.  #define PICK_ANY 2  /* can pick any amount */
  67.  
  68.  /* window types */
  69.  /* any additional port specific types should be defined in win*.h */
  70.  #define NHW_MESSAGE 1
  71.  #define NHW_STATUS 2
  72.  #define NHW_MAP 3
  73.  #define NHW_MENU 4
  74.  #define NHW_TEXT 5
  75.  
  76.  /* attribute types for putstr; the same as the ANSI value, for convenience */
  77.  #define ATR_NONE 0
  78.  #define ATR_BOLD 1
  79.  #define ATR_DIM 2
  80.  #define ATR_ULINE 4
  81.  #define ATR_BLINK 5
  82.  #define ATR_INVERSE 7
  83.  
  84.  /* nh_poskey() modifier types */
  85.  #define CLICK_1 1
  86.  #define CLICK_2 2
  87.  
  88.  /* invalid winid */
  89.  #define WIN_ERR ((winid) -1)
  90.  
  91.  /* menu window keyboard commands (may be mapped) */
  92.  /* clang-format off */
  93.  #define MENU_FIRST_PAGE         '^'
  94.  #define MENU_LAST_PAGE          '|'
  95.  #define MENU_NEXT_PAGE          '>'
  96.  #define MENU_PREVIOUS_PAGE      '<'
  97.  #define MENU_SELECT_ALL         '.'
  98.  #define MENU_UNSELECT_ALL       '-'
  99.  #define MENU_INVERT_ALL         '@'
  100.  #define MENU_SELECT_PAGE        ','
  101.  #define MENU_UNSELECT_PAGE      '\\'
  102.  #define MENU_INVERT_PAGE        '~'
  103.  #define MENU_SEARCH             ':'
  104.  /* clang-format on */
  105.  
  106.  #endif /* WINTYPE_H */