00001 /* SCCS Id: @(#)wintype.h 3.4 1996/02/18 */ 00002 /* Copyright (c) David Cohrs, 1991 */ 00003 /* NetHack may be freely redistributed. See license for details. */ 00004 00005 #ifndef WINTYPE_H 00006 #define WINTYPE_H 00007 00008 typedef int winid; /* a window identifier */ 00009 00010 /* generic parameter - must not be any larger than a pointer */ 00011 typedef union any { 00012 genericptr_t a_void; 00013 struct obj *a_obj; 00014 int a_int; 00015 char a_char; 00016 schar a_schar; 00017 /* add types as needed */ 00018 } anything; 00019 #define ANY_P union any /* avoid typedef in prototypes */ 00020 /* (buggy old Ultrix compiler) */ 00021 00022 /* menu return list */ 00023 typedef struct mi { 00024 anything item; /* identifier */ 00025 long count; /* count */ 00026 } menu_item; 00027 #define MENU_ITEM_P struct mi 00028 00029 /* select_menu() "how" argument types */ 00030 #define PICK_NONE 0 /* user picks nothing (display only) */ 00031 #define PICK_ONE 1 /* only pick one */ 00032 #define PICK_ANY 2 /* can pick any amount */ 00033 00034 /* window types */ 00035 /* any additional port specific types should be defined in win*.h */ 00036 #define NHW_MESSAGE 1 00037 #define NHW_STATUS 2 00038 #define NHW_MAP 3 00039 #define NHW_MENU 4 00040 #define NHW_TEXT 5 00041 00042 /* attribute types for putstr; the same as the ANSI value, for convenience */ 00043 #define ATR_NONE 0 00044 #define ATR_BOLD 1 00045 #define ATR_DIM 2 00046 #define ATR_ULINE 4 00047 #define ATR_BLINK 5 00048 #define ATR_INVERSE 7 00049 00050 /* nh_poskey() modifier types */ 00051 #define CLICK_1 1 00052 #define CLICK_2 2 00053 00054 /* invalid winid */ 00055 #define WIN_ERR ((winid) -1) 00056 00057 /* menu window keyboard commands (may be mapped) */ 00058 #define MENU_FIRST_PAGE '^' 00059 #define MENU_LAST_PAGE '|' 00060 #define MENU_NEXT_PAGE '>' 00061 #define MENU_PREVIOUS_PAGE '<' 00062 #define MENU_SELECT_ALL '.' 00063 #define MENU_UNSELECT_ALL '-' 00064 #define MENU_INVERT_ALL '@' 00065 #define MENU_SELECT_PAGE ',' 00066 #define MENU_UNSELECT_PAGE '\\' 00067 #define MENU_INVERT_PAGE '~' 00068 #define MENU_SEARCH ':' 00069 00070 00071 #endif /* WINTYPE_H */