Crossfire Client, Trunk
inventory.c File Reference
#include "client.h"
#include <gtk/gtk.h>
#include "image.h"
#include "main.h"
#include "gtk2proto.h"
#include "../../pixmaps/all.xpm"
#include "../../pixmaps/coin.xpm"
#include "../../pixmaps/hand.xpm"
#include "../../pixmaps/hand2.xpm"
#include "../../pixmaps/lock.xpm"
#include "../../pixmaps/mag.xpm"
#include "../../pixmaps/nonmag.xpm"
#include "../../pixmaps/skull.xpm"
#include "../../pixmaps/unlock.xpm"
#include "../../pixmaps/unidentified.xpm"
+ Include dependency graph for inventory.c:

Go to the source code of this file.

Data Structures

struct  Notebook_Info
 

Macros

#define INV_SHOW_COLOR   0x2
 
#define INV_SHOW_ITEM   0x1
 
#define INV_TABLE_AT(x, y, cols)   inv_table_children[cols*y + x]
 
#define MAX_INV   2000
 
#define NUM_INV_LISTS   11
 

Enumerations

enum  display_type { INV_TREE, INV_TABLE }
 
enum  item_env { ITEM_INVENTORY = 0x1, ITEM_GROUND = 0x2, ITEM_IN_CONTAINER = 0x4 }
 
enum  list_property {
  LIST_NONE, LIST_ICON, LIST_NAME, LIST_WEIGHT,
  LIST_OBJECT, LIST_BACKGROUND, LIST_TYPE, LIST_BASENAME,
  LIST_FOREGROUND, LIST_FONT, LIST_NUM_COLUMNS
}
 
enum  Styles {
  Style_Magical = 0, Style_Cursed, Style_Unpaid, Style_Locked,
  Style_Applied, Style_Last, Style_Attuned, Style_Repelled,
  Style_Denied, Style_Normal, Style_Last
}
 

Functions

static void add_object_to_store (item *it, GtkTreeStore *store, GtkTreeIter *new, GtkTreeIter *parent, int color)
 
static void animate_inventory ()
 
static void animate_look ()
 
void close_container (item *op)
 
void command_show (const char *params)
 
static void draw_inv (int tab)
 
static void draw_inv_list (int tab)
 
static void draw_inv_table (int animate)
 
static void draw_inv_table_icon (GdkWindow *dst, const void *image)
 
void draw_lists ()
 
void draw_look_list ()
 
static gboolean drawingarea_inventory_table_button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
 
static gboolean drawingarea_inventory_table_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
 
static int get_item_env (item *it)
 
static GtkStyle * get_row_style (item *it)
 
void inventory_get_styles ()
 
void inventory_init (GtkWidget *window_root)
 
void inventory_tick ()
 
void item_event_container_clearing (item *container)
 
void item_event_item_changed (item *it)
 
void item_event_item_deleting (item *it)
 
static void list_item_action (GdkEventButton *event, item *tmp)
 
static void list_item_drop (item *tmp)
 
static void list_row_collapse (GtkTreeView *treeview, GtkTreeIter *iter, GtkTreePath *path, gpointer user_data)
 
static gboolean list_selection_func (GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer userdata)
 
static void ma_apply (GtkWidget *widget, item *tmp)
 
static void ma_drop (GtkWidget *widget, item *tmp)
 
static void ma_examine (GtkWidget *widget, item *tmp)
 
static void ma_lock (GtkWidget *widget, item *tmp)
 
static void ma_mark (GtkWidget *widget, item *tmp)
 
static void on_switch_page (GtkNotebook *notebook, gpointer *page, guint page_num, gpointer user_data)
 
void open_container (item *op)
 
static void remove_object_from_store (item *it, GtkTreeStore *store)
 
void set_weight_limit (guint32 wlim)
 
static void setup_list_columns (GtkWidget *treeview)
 
static int show_all (item *it)
 
static int show_applied (item *it)
 
static int show_cursed (item *it)
 
static void show_item_menu (GdkEventButton *event, item *tmp)
 
static int show_locked (item *it)
 
static int show_magical (item *it)
 
static int show_nonmagical (item *it)
 
static int show_unapplied (item *it)
 
static int show_unidentified (item *it)
 
static int show_unlocked (item *it)
 
static int show_unpaid (item *it)
 

Variables

static const GdkColor applied_color = {0, 50000, 50000, 50000}
 
static GtkWidget * encumbrance_current
 
static GtkWidget * encumbrance_max
 
static GtkWidget * inv_notebook
 
static Notebook_Info inv_notebooks [NUM_INV_LISTS]
 
static GtkStyle * inv_styles [Style_Last]
 
static GtkWidget * inv_table
 
static GtkWidget * inv_table_children [MAX_INV]
 
static int num_inv_notebook_pages = 0
 
static GtkTreeStore * store_look
 
static const char * Style_Names [Style_Last]
 
static GtkTreeStore * treestore
 
GtkWidget * treeview_look
 
static double weight_limit
 

Detailed Description

Draw inventory and 'look' windows

Definition in file inventory.c.

Macro Definition Documentation

◆ INV_SHOW_COLOR

#define INV_SHOW_COLOR   0x2

Definition at line 81 of file inventory.c.

◆ INV_SHOW_ITEM

#define INV_SHOW_ITEM   0x1

Definition at line 80 of file inventory.c.

◆ INV_TABLE_AT

#define INV_TABLE_AT (   x,
  y,
  cols 
)    inv_table_children[cols*y + x]

Definition at line 59 of file inventory.c.

◆ MAX_INV

#define MAX_INV   2000

Definition at line 56 of file inventory.c.

◆ NUM_INV_LISTS

#define NUM_INV_LISTS   11

Definition at line 79 of file inventory.c.

Enumeration Type Documentation

◆ display_type

Indicate how an inventory tab should be drawn

Enumerator
INV_TREE 
INV_TABLE 

Definition at line 87 of file inventory.c.

◆ item_env

enum item_env

Describe where an item is. These constants must be kept as-is for use in a few bitwise operations.

Enumerator
ITEM_INVENTORY 
ITEM_GROUND 
ITEM_IN_CONTAINER 

Definition at line 180 of file inventory.c.

◆ list_property

Constants used to refer to columns in the inventory list view

Enumerator
LIST_NONE 
LIST_ICON 
LIST_NAME 
LIST_WEIGHT 
LIST_OBJECT 
LIST_BACKGROUND 
LIST_TYPE 
LIST_BASENAME 
LIST_FOREGROUND 
LIST_FONT 
LIST_NUM_COLUMNS 

Definition at line 170 of file inventory.c.

◆ Styles

enum Styles
Enumerator
Style_Magical 
Style_Cursed 
Style_Unpaid 
Style_Locked 
Style_Applied 
Style_Last 
Style_Attuned 
Style_Repelled 
Style_Denied 
Style_Normal 
Style_Last 

Definition at line 62 of file inventory.c.

Function Documentation

◆ add_object_to_store()

static void add_object_to_store ( item it,
GtkTreeStore *  store,
GtkTreeIter *  new,
GtkTreeIter *  parent,
int  color 
)
static

Adds a row to the treestore.

Parameters
itthe object to add
storeThe TreeStore object.
newReturns the iter used/updated for the store
parentThe parent iter (can be null). If non null, then this creates a real tree, for things like containers.
colorIf true, do foreground/background colors, otherwise, just black & white Normally it is set. However, when showing the cursed inv tab, it doesn't make a lot of sense to show them all in the special color, since they all meet that special criteria

Definition at line 792 of file inventory.c.

References item_struct::d_name, item_struct::face, item_struct::flags, get_row_style(), PixmapInfo::icon_image, LIST_BACKGROUND, LIST_BASENAME, LIST_FONT, LIST_FOREGROUND, LIST_ICON, LIST_NAME, LIST_OBJECT, LIST_TYPE, LIST_WEIGHT, item_struct::nrof, pixmaps, item_struct::s_name, item_struct::type, and item_struct::weight.

Referenced by draw_inv_list(), and draw_look_list().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ animate_inventory()

static void animate_inventory ( )
static

◆ animate_look()

◆ close_container()

void close_container ( item op)

Open and close_container are now no-ops - since these are now drawn inline as treestores, we don't need to update what we are drawing were. and since the activation of a container will cause the list to be redrawn, don't need to worry about making an explicit call here.

Parameters
op

Definition at line 647 of file inventory.c.

Referenced by item_actions().

+ Here is the caller graph for this function:

◆ command_show()

void command_show ( const char *  params)
Parameters
params

Definition at line 661 of file inventory.c.

References draw_ext_info(), inv_notebook, inv_notebooks, MAX_BUF, MSG_TYPE_CLIENT, MSG_TYPE_CLIENT_ERROR, NDI_RED, NUM_INV_LISTS, and num_inv_notebook_pages.

+ Here is the call graph for this function:

◆ draw_inv()

static void draw_inv ( int  tab)
static

Draws the inventory and updates the encumbrance statistics display in the client. Have to determine how to draw it.

Parameters
tab

Definition at line 1147 of file inventory.c.

References cpl, draw_inv_list(), draw_inv_table(), encumbrance_current, encumbrance_max, inv_notebooks, INV_TABLE, INV_TREE, Player_Struct::ob, item_struct::weight, and weight_limit.

Referenced by draw_lists().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ draw_inv_list()

static void draw_inv_list ( int  tab)
static

Draws the inventory window. tab is the notebook tab we are drawing. Has to be passed in because the callback sets this before the notebook is updated.

Parameters
tab

Definition at line 870 of file inventory.c.

References add_object_to_store(), Player_Struct::container, cpl, item_struct::inv, inv_notebooks, INV_SHOW_COLOR, INV_SHOW_ITEM, item_struct::next, Player_Struct::ob, item_struct::open, Notebook_Info::show_func, and treestore.

Referenced by draw_inv().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ draw_inv_table()

static void draw_inv_table ( int  animate)
static

Draws the table of image icons.

Parameters
animateIf non-zero, then this is an animation run - flip the animation state of the objects, and only draw those that need to be drawn.

Definition at line 981 of file inventory.c.

References item_struct::anim_speed, item_struct::anim_state, item_struct::animation_id, animations, item_struct::applied, applied_color, cpl, item_struct::d_name, draw_inv_table_icon(), drawingarea_inventory_table_button_press_event(), drawingarea_inventory_table_expose_event(), item_struct::face, Animations::faces, item_struct::flags, PixmapInfo::icon_image, image_size, item_struct::inv, inv_table, INV_TABLE_AT, item_struct::last_anim, LOG(), LOG_ERROR, MAX_INV, item_struct::next, Animations::num_animations, Player_Struct::ob, and pixmaps.

Referenced by animate_inventory(), and draw_inv().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ draw_inv_table_icon()

static void draw_inv_table_icon ( GdkWindow *  dst,
const void *  image 
)
static

Definition at line 935 of file inventory.c.

Referenced by draw_inv_table(), and drawingarea_inventory_table_expose_event().

+ Here is the caller graph for this function:

◆ draw_lists()

void draw_lists ( )

Redraws inventory and look windows when necessary

Definition at line 1165 of file inventory.c.

References Player_Struct::below, Player_Struct::container, cpl, draw_inv(), draw_look_list(), item_struct::env, inv_notebook, item_struct::inv_updated, and Player_Struct::ob.

Referenced by load_theme(), and redraw().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ draw_look_list()

void draw_look_list ( )

Draws the objects beneath the player.

Definition at line 835 of file inventory.c.

References add_object_to_store(), Player_Struct::below, Player_Struct::container, cpl, item_struct::inv, item_struct::next, item_struct::open, store_look, and treeview_look.

Referenced by draw_lists().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drawingarea_inventory_table_button_press_event()

static gboolean drawingarea_inventory_table_button_press_event ( GtkWidget *  widget,
GdkEventButton *  event,
gpointer  user_data 
)
static
Parameters
widget
event
user_data
Returns
TRUE

Definition at line 929 of file inventory.c.

References list_item_action().

Referenced by draw_inv_table().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drawingarea_inventory_table_expose_event()

static gboolean drawingarea_inventory_table_expose_event ( GtkWidget *  widget,
GdkEventExpose *  event,
gpointer  user_data 
)
static
Parameters
widget
event
user_data
Returns
TRUE

Definition at line 951 of file inventory.c.

References cpl, draw_inv_table_icon(), item_struct::face, PixmapInfo::icon_image, item_struct::inv_updated, Player_Struct::ob, and pixmaps.

Referenced by draw_inv_table().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_item_env()

static int get_item_env ( item it)
static

Returns information on the environment of the item, using the return values below. Note that there should never be a case where both ITEM_GROUND and ITEM_INVENTORY are returned, but I prefer a more active approach in returning actual values and not presuming that lack of value means it is in the other location.

Parameters
it
Returns

Definition at line 194 of file inventory.c.

References Player_Struct::below, cpl, item_struct::env, ITEM_GROUND, ITEM_IN_CONTAINER, ITEM_INVENTORY, and Player_Struct::ob.

Referenced by item_event_item_deleting(), and list_item_drop().

+ Here is the caller graph for this function:

◆ get_row_style()

static GtkStyle* get_row_style ( item it)
static
Parameters
it
Returns
a style based on values in it

Definition at line 702 of file inventory.c.

References item_struct::applied, item_struct::cursed, item_struct::damned, inv_styles, item_struct::locked, item_struct::magical, Style_Applied, Style_Cursed, Style_Locked, Style_Magical, Style_Unpaid, and item_struct::unpaid.

Referenced by add_object_to_store().

+ Here is the caller graph for this function:

◆ inventory_get_styles()

void inventory_get_styles ( )

Gets the style information for the inventory windows. This is a separate function because if the user changes styles, it can be nice to re-load the configuration. The style for the inventory/look is a bit special. That is because with gtk, styles are widget wide - all rows in the widget would use the same style. We want to adjust the styles based on other attributes.

Definition at line 501 of file inventory.c.

References has_init, inv_styles, LOG(), LOG_INFO, Style_Last, and Style_Names.

Referenced by load_theme().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ inventory_init()

void inventory_init ( GtkWidget *  window_root)

Set up the inventory viewer.

Parameters
window_rootThe client main window.

Definition at line 528 of file inventory.c.

References encumbrance_current, encumbrance_max, inv_notebook, inv_notebooks, inv_table, inv_table_children, INV_TREE, LIST_NUM_COLUMNS, list_row_collapse(), LOG(), LOG_ERROR, MAX_INV, NUM_INV_LISTS, num_inv_notebook_pages, on_switch_page(), setup_list_columns(), store_look, treestore, Notebook_Info::treeview, treeview_look, and window_xml.

Referenced by init_ui().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ inventory_tick()

void inventory_tick ( )

This is called periodically from main.c - basically a timeout, used to animate the inventory.

Definition at line 1304 of file inventory.c.

References animate_inventory(), and animate_look().

Referenced by client_tick().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ item_event_container_clearing()

void item_event_container_clearing ( item container)

Definition at line 773 of file inventory.c.

Referenced by remove_item_inventory().

+ Here is the caller graph for this function:

◆ item_event_item_changed()

void item_event_item_changed ( item it)

Definition at line 776 of file inventory.c.

Referenced by set_item_values().

+ Here is the caller graph for this function:

◆ item_event_item_deleting()

void item_event_item_deleting ( item it)

Definition at line 760 of file inventory.c.

References Player_Struct::below, cpl, get_item_env(), item_struct::inv_updated, ITEM_GROUND, ITEM_INVENTORY, Player_Struct::ob, remove_object_from_store(), store_look, and treestore.

Referenced by remove_item().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ list_item_action()

static void list_item_action ( GdkEventButton *  event,
item tmp 
)
static
Parameters
event
tmp

Definition at line 273 of file inventory.c.

References client_send_apply(), client_send_examine(), CONFIG_INV_MENU, list_item_drop(), send_mark_obj(), show_item_menu(), item_struct::tag, toggle_locked(), and use_config.

Referenced by drawingarea_inventory_table_button_press_event(), and list_selection_func().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ list_item_drop()

static void list_item_drop ( item tmp)
static

◆ list_row_collapse()

static void list_row_collapse ( GtkTreeView *  treeview,
GtkTreeIter *  iter,
GtkTreePath *  path,
gpointer  user_data 
)
static

If the player collapses the row with the little icon, we have to unapply the object for things to work 'sanely' (eg, items not go into the container

Parameters
treeview
iter
path
user_data

Definition at line 397 of file inventory.c.

References client_send_apply(), LIST_OBJECT, and item_struct::tag.

Referenced by inventory_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ list_selection_func()

static gboolean list_selection_func ( GtkTreeSelection *  selection,
GtkTreeModel *  model,
GtkTreePath *  path,
gboolean  path_currently_selected,
gpointer  userdata 
)
static

Used when a button is pressed on the inventory or look list. The parameters are those determined by the callback. Note that this function isn't 100% ideal - some of the events/handling is only relevant for objects in the inventory and not the look window (eg, locking items). OTOH, maybe it is just as well that the behaviour is always consistent.

Parameters
selection
model
path
path_currently_selected
userdata
Returns
FALSE

Definition at line 357 of file inventory.c.

References list_item_action(), LIST_OBJECT, LOG(), and LOG_ERROR.

Referenced by setup_list_columns().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ma_apply()

static void ma_apply ( GtkWidget *  widget,
item tmp 
)
static

Definition at line 213 of file inventory.c.

References client_send_apply(), and item_struct::tag.

Referenced by show_item_menu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ma_drop()

static void ma_drop ( GtkWidget *  widget,
item tmp 
)
static

Definition at line 225 of file inventory.c.

References list_item_drop().

Referenced by show_item_menu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ma_examine()

static void ma_examine ( GtkWidget *  widget,
item tmp 
)
static

Definition at line 209 of file inventory.c.

References client_send_examine(), and item_struct::tag.

Referenced by show_item_menu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ma_lock()

static void ma_lock ( GtkWidget *  widget,
item tmp 
)
static

Definition at line 221 of file inventory.c.

References toggle_locked().

Referenced by show_item_menu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ma_mark()

static void ma_mark ( GtkWidget *  widget,
item tmp 
)
static

Definition at line 217 of file inventory.c.

References send_mark_obj().

Referenced by show_item_menu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_switch_page()

static void on_switch_page ( GtkNotebook *  notebook,
gpointer *  page,
guint  page_num,
gpointer  user_data 
)
static

People are likely go to the different tabs much less often than their inventory changes. So rather than update all the tabs whenever the players inventory changes, only update the tab the player is viewing, and if they change tabs, draw the new tab and get rid of the old info. Ideally, I'd like to call draw_inv() from this function, but there is some oddity

Parameters
notebook
page
page_num
user_data

Definition at line 1198 of file inventory.c.

References cpl, inv_notebooks, INV_TREE, item_struct::inv_updated, Player_Struct::ob, and treestore.

Referenced by inventory_init().

+ Here is the caller graph for this function:

◆ open_container()

void open_container ( item op)
Parameters
op

Definition at line 654 of file inventory.c.

Referenced by item_actions().

+ Here is the caller graph for this function:

◆ remove_object_from_store()

static void remove_object_from_store ( item it,
GtkTreeStore *  store 
)
static

Definition at line 746 of file inventory.c.

References LIST_OBJECT.

Referenced by item_event_item_deleting().

+ Here is the caller graph for this function:

◆ set_weight_limit()

void set_weight_limit ( guint32  wlim)

No reason to divide by 1000 everytime we do the display, so do it once and store it here.

Parameters
wlim

Definition at line 693 of file inventory.c.

References weight_limit.

Referenced by StatsCmd().

+ Here is the caller graph for this function:

◆ setup_list_columns()

static void setup_list_columns ( GtkWidget *  treeview)
static
Parameters
treeview

Definition at line 412 of file inventory.c.

References image_size, LIST_BACKGROUND, LIST_BASENAME, LIST_FONT, LIST_FOREGROUND, LIST_ICON, LIST_NAME, LIST_NONE, list_selection_func(), LIST_TYPE, and LIST_WEIGHT.

Referenced by inventory_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ show_all()

static int show_all ( item it)
static

Definition at line 111 of file inventory.c.

References INV_SHOW_COLOR, and INV_SHOW_ITEM.

◆ show_applied()

static int show_applied ( item it)
static

Definition at line 115 of file inventory.c.

References item_struct::applied, and INV_SHOW_ITEM.

◆ show_cursed()

static int show_cursed ( item it)
static

Definition at line 127 of file inventory.c.

References item_struct::cursed, item_struct::damned, and INV_SHOW_ITEM.

◆ show_item_menu()

static void show_item_menu ( GdkEventButton *  event,
item tmp 
)
static

Definition at line 229 of file inventory.c.

References Player_Struct::count, cpl, item_struct::env, item_struct::locked, ma_apply(), ma_drop(), ma_examine(), ma_lock(), ma_mark(), and Player_Struct::ob.

Referenced by list_item_action().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ show_locked()

static int show_locked ( item it)
static

Definition at line 139 of file inventory.c.

References INV_SHOW_COLOR, INV_SHOW_ITEM, and item_struct::locked.

◆ show_magical()

static int show_magical ( item it)
static

Definition at line 131 of file inventory.c.

References INV_SHOW_ITEM, and item_struct::magical.

◆ show_nonmagical()

static int show_nonmagical ( item it)
static

Definition at line 135 of file inventory.c.

References INV_SHOW_ITEM, and item_struct::magical.

◆ show_unapplied()

static int show_unapplied ( item it)
static

Definition at line 119 of file inventory.c.

References item_struct::applied, and INV_SHOW_ITEM.

◆ show_unidentified()

static int show_unidentified ( item it)
static

Definition at line 148 of file inventory.c.

References F_UNIDENTIFIED, item_struct::flagsval, and INV_SHOW_ITEM.

◆ show_unlocked()

static int show_unlocked ( item it)
static

Definition at line 143 of file inventory.c.

References INV_SHOW_COLOR, INV_SHOW_ITEM, item_struct::locked, and item_struct::open.

◆ show_unpaid()

static int show_unpaid ( item it)
static

Definition at line 123 of file inventory.c.

References INV_SHOW_ITEM, and item_struct::unpaid.

Variable Documentation

◆ applied_color

const GdkColor applied_color = {0, 50000, 50000, 50000}
static

Color to use to indicate that an item is applied.

Definition at line 41 of file inventory.c.

Referenced by draw_inv_table().

◆ encumbrance_current

GtkWidget* encumbrance_current
static

Definition at line 44 of file inventory.c.

Referenced by draw_inv(), and inventory_init().

◆ encumbrance_max

GtkWidget* encumbrance_max
static

Definition at line 45 of file inventory.c.

Referenced by draw_inv(), and inventory_init().

◆ inv_notebook

GtkWidget* inv_notebook
static

Definition at line 46 of file inventory.c.

Referenced by animate_inventory(), command_show(), draw_lists(), and inventory_init().

◆ inv_notebooks

Notebook_Info inv_notebooks[NUM_INV_LISTS]
static
Initial value:
= {
{"all", "All", all_xpm, show_all, INV_TREE},
{"applied", "Applied", hand_xpm, show_applied, INV_TREE},
{"unapplied", "Unapplied", hand2_xpm, show_unapplied, INV_TREE},
{"unpaid", "Unpaid", coin_xpm, show_unpaid, INV_TREE},
{"cursed", "Cursed", skull_xpm, show_cursed, INV_TREE},
{"magical", "Magical", mag_xpm, show_magical, INV_TREE},
{"nonmagical", "Non-magical", nonmag_xpm, show_nonmagical, INV_TREE},
{"locked", "Locked", lock_xpm, show_locked, INV_TREE},
{"unlocked", "Unlocked", unlock_xpm, show_unlocked, INV_TREE},
{"unidentified", "Unidentified", unidentified_xpm, show_unidentified, INV_TREE},
{"icons", "Icon View", NULL, show_all, INV_TABLE}
}

Definition at line 152 of file inventory.c.

Referenced by animate_inventory(), command_show(), draw_inv(), draw_inv_list(), inventory_init(), and on_switch_page().

◆ inv_styles

GtkStyle* inv_styles[Style_Last]
static

Definition at line 72 of file inventory.c.

Referenced by get_row_style(), and inventory_get_styles().

◆ inv_table

GtkWidget* inv_table
static

Definition at line 47 of file inventory.c.

Referenced by draw_inv_table(), and inventory_init().

◆ inv_table_children

GtkWidget* inv_table_children[MAX_INV]
static

Definition at line 57 of file inventory.c.

Referenced by inventory_init().

◆ num_inv_notebook_pages

int num_inv_notebook_pages = 0
static

Definition at line 91 of file inventory.c.

Referenced by command_show(), and inventory_init().

◆ store_look

GtkTreeStore* store_look
static

Definition at line 43 of file inventory.c.

Referenced by animate_look(), draw_look_list(), inventory_init(), and item_event_item_deleting().

◆ Style_Names

const char* Style_Names[Style_Last]
static
Initial value:
= {
"inv_magical", "inv_cursed", "inv_unpaid", "inv_locked", "inv_applied"
}

Definition at line 67 of file inventory.c.

Referenced by inventory_get_styles().

◆ treestore

GtkTreeStore* treestore
static

store of data for treeview

Definition at line 105 of file inventory.c.

Referenced by animate_inventory(), draw_inv_list(), inventory_init(), item_event_item_deleting(), and on_switch_page().

◆ treeview_look

GtkWidget* treeview_look

◆ weight_limit

double weight_limit
static

Definition at line 49 of file inventory.c.

Referenced by draw_inv(), and set_weight_limit().

show_applied
static int show_applied(item *it)
Definition: inventory.c:115
show_unpaid
static int show_unpaid(item *it)
Definition: inventory.c:123
show_cursed
static int show_cursed(item *it)
Definition: inventory.c:127
show_all
static int show_all(item *it)
Definition: inventory.c:111
INV_TREE
@ INV_TREE
Definition: inventory.c:88
show_unapplied
static int show_unapplied(item *it)
Definition: inventory.c:119
show_locked
static int show_locked(item *it)
Definition: inventory.c:139
INV_TABLE
@ INV_TABLE
Definition: inventory.c:88
show_unlocked
static int show_unlocked(item *it)
Definition: inventory.c:143
show_nonmagical
static int show_nonmagical(item *it)
Definition: inventory.c:135
show_unidentified
static int show_unidentified(item *it)
Definition: inventory.c:148
show_magical
static int show_magical(item *it)
Definition: inventory.c:131