Atrinik Client  4.0
inventory.h
Go to the documentation of this file.
1 /*************************************************************************
2  * Atrinik, a Multiplayer Online Role Playing Game *
3  * *
4  * Copyright (C) 2009-2014 Alex Tokar and Atrinik Development Team *
5  * *
6  * Fork from Crossfire (Multiplayer game for X-windows). *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the Free Software *
20  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
21  * *
22  * The author can be reached at admin@atrinik.org *
23  ************************************************************************/
24 
30 #ifndef INVENTORY_H
31 #define INVENTORY_H
32 
38 #define INVENTORY_FILTER_ALL 0
39 
40 #define INVENTORY_FILTER_APPLIED 1
41 
42 #define INVENTORY_FILTER_CONTAINER 2
43 
44 #define INVENTORY_FILTER_MAGICAL 4
45 
46 #define INVENTORY_FILTER_CURSED 8
47 
48 #define INVENTORY_FILTER_UNIDENTIFIED 16
49 
50 #define INVENTORY_FILTER_UNAPPLIED 32
51 
52 #define INVENTORY_FILTER_LOCKED 64
53 
56 #define INVENTORY_FILTER_MAX 7
57 
60 #define INVENTORY_ICON_SIZE 32
61 
63 #define INVENTORY_COLS(_inventory) ((_inventory)->w / INVENTORY_ICON_SIZE)
64 
65 #define INVENTORY_ROWS(_inventory) ((_inventory)->h / INVENTORY_ICON_SIZE)
66 
69 #define INVENTORY_WHERE(_inventory) \
70  ((_inventory)->display == INVENTORY_DISPLAY_MAIN ? cpl.ob : cpl.below)
71 
72 #define INVENTORY_MOUSE_INSIDE(_widget, _mx, _my) ((_mx) >= (_widget)->x + INVENTORY((_widget))->x && (_mx) < (_widget)->x + INVENTORY((_widget))->x + INVENTORY((_widget))->w && (_my) >= (_widget)->y + INVENTORY((_widget))->y && (_my) < (_widget)->y + INVENTORY((_widget))->y + INVENTORY((_widget))->h)
73 
77 typedef enum inventory_display {
82 
86 typedef struct inventory_struct {
88  uint32_t selected;
89 
91  int x;
92 
94  int y;
95 
97  int w;
98 
100  int h;
101 
104 
107 
110 
113 
115  uint32_t last_clicked;
117 
118 #endif
uint32_t last_clicked
Definition: inventory.h:115
scrollbar_info_struct scrollbar_info
Definition: inventory.h:109
inventory_display
Definition: inventory.h:77
uint32_t selected
Definition: inventory.h:88
scrollbar_struct scrollbar
Definition: inventory.h:106
struct inventory_struct inventory_struct
texture_struct * texture
Definition: inventory.h:112
Display player's inventory.
Definition: inventory.h:79
inventory_display_t display
Definition: inventory.h:103
Display below inventory.
Definition: inventory.h:80
enum inventory_display inventory_display_t