1 /* NetHack may be freely redistributed. See license for details. */ 2 3 #ifndef _inventory_h_ 4 #define _inventory_h_ 5 6 #include "menuwin.h" 7 8 class objitemwin; 9 10 enum invactions { 11 V_INVACTION_APPLY = 1, 12 V_INVACTION_DRINK, 13 V_INVACTION_EAT, 14 V_INVACTION_READ, 15 V_INVACTION_ZAP, 16 V_INVACTION_WEAR, 17 V_INVACTION_PUT_ON, 18 V_INVACTION_WIELD, 19 V_INVACTION_QUIVER, 20 V_INVACTION_REMOVE, 21 V_INVACTION_DROP, 22 V_INVACTION_NAME 23 }; 24 25 26 class inventory : public menuwin 27 { 28 public: 29 inventory(window *p, std::list<menuitem> &menuitems, int how, int id); 30 virtual bool draw(); 31 virtual eventresult handle_mousemotion_event(window* target, void* result, 32 int xrel, int yrel, int state); 33 virtual eventresult handle_mousebuttonup_event(window* target, void* result, 34 int mouse_x, int mouse_y, int button, int state); 35 virtual eventresult handle_keydown_event(window* target, void* result, int sym, int mod, int unicode); 36 virtual eventresult handle_resize_event(window* target, void* result, int res_w, int res_h); 37 virtual void layout(); 38 39 private: 40 void update_invscroll(int newpos); 41 eventresult context_menu(objitemwin *target); 42 int ow_ncols, ow_vcols, ow_firstcol, ow_vrows; 43 objitemwin *ow_lasttoggled; 44 int nhid; 45 }; 46 47 48 #endif 49