Crossfire Client, Trunk
|
#include "client.h"
#include <assert.h>
#include <gtk/gtk.h>
#include "image.h"
#include "metaserver.h"
#include "main.h"
#include "gtk2proto.h"
Go to the source code of this file.
Enumerations | |
enum | { LIST_IMAGE, LIST_NAME, LIST_LEVEL, LIST_TIME, LIST_COST, LIST_DAMAGE, LIST_SKILL, LIST_PATH, LIST_DESCRIPTION, LIST_BACKGROUND, LIST_MAX_SP, LIST_TAG, LIST_FOREGROUND, LIST_FONT } |
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 | |
void | on_spell_cast_clicked (GtkButton *button, gpointer user_data) |
void | on_spell_close_clicked (GtkButton *button, gpointer user_data) |
void | on_spell_invoke_clicked (GtkButton *button, gpointer user_data) |
void | on_spell_treeview_row_activated (GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data) |
void | on_spell_window_size_allocate (GtkWidget *widget, gpointer user_data) |
void | on_spells_activate (GtkMenuItem *menuitem, gpointer user_data) |
void | spell_get_styles (void) |
static gboolean | spell_selection_func (GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer userdata) |
void | update_spell_information (void) |
Variables | |
static gpointer | description_renderer = NULL |
static int | has_init = 0 |
static GtkWidget * | spell_cast |
static GtkWidget * | spell_eventbox [Style_Last] |
static GtkWidget * | spell_invoke |
static GtkWidget * | spell_label [Style_Last] |
static GtkWidget * | spell_options |
static GtkTreeSelection * | spell_selection |
static GtkListStore * | spell_store |
static GtkStyle * | spell_styles [Style_Last] |
static GtkWidget * | spell_treeview |
static GtkWidget * | spell_window |
static const char * | Style_Names [Style_Last] |
Handles spell related functionality.
Definition in file spells.c.
anonymous enum |
enum Styles |
void on_spell_cast_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
button | |
user_data |
Definition at line 515 of file spells.c.
References LIST_TAG, LOG(), LOG_ERROR, MAX_BUF, options, send_command(), spell_options, and spell_selection.
Referenced by on_spell_treeview_row_activated(), and on_spells_activate().
void on_spell_close_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
button | |
user_data |
Definition at line 571 of file spells.c.
References spell_window.
Referenced by on_spells_activate().
void on_spell_invoke_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
button | |
user_data |
Definition at line 543 of file spells.c.
References LIST_TAG, LOG(), LOG_ERROR, MAX_BUF, options, send_command(), spell_options, and spell_selection.
Referenced by on_spells_activate().
void on_spell_treeview_row_activated | ( | GtkTreeView * | treeview, |
GtkTreePath * | path, | ||
GtkTreeViewColumn * | column, | ||
gpointer | user_data | ||
) |
treeview | |
path | |
column | |
user_data |
Definition at line 502 of file spells.c.
References on_spell_cast_clicked().
Referenced by on_spells_activate().
void on_spell_window_size_allocate | ( | GtkWidget * | widget, |
gpointer | user_data | ||
) |
Adjust the line wrap width used by the spells dialog Description column text renderer and force redraw of the rows to cause row height adjustment. To compute the new wrap width, the widths of all other columns are subtracted from the width of the spells window to determine the available width for the description column. The remaining space is then configured as the new wrap width. Once the new wrap is computed, mark all the rows changed so that the renderer adjusts the row height to expand or contract to fit the reformatted description.
widget | |
user_data |
Definition at line 124 of file spells.c.
References description_renderer, has_init, spell_store, spell_treeview, and width.
Referenced by on_spells_activate().
void on_spells_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
menuitem | |
user_data |
Definition at line 283 of file spells.c.
References description_renderer, dialog_xml, has_init, LIST_BACKGROUND, LIST_COST, LIST_DAMAGE, LIST_DESCRIPTION, LIST_FONT, LIST_FOREGROUND, LIST_IMAGE, LIST_LEVEL, LIST_MAX_SP, LIST_NAME, LIST_SKILL, on_spell_cast_clicked(), on_spell_close_clicked(), on_spell_invoke_clicked(), on_spell_treeview_row_activated(), on_spell_window_size_allocate(), spell_cast, spell_eventbox, spell_get_styles(), spell_invoke, spell_label, spell_options, spell_selection, spell_selection_func(), spell_store, spell_treeview, spell_window, Style_Attuned, Style_Denied, Style_Normal, Style_Repelled, and update_spell_information().
Referenced by init_menu_items().
void spell_get_styles | ( | void | ) |
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 66 of file spells.c.
References LOG(), LOG_INFO, spell_styles, Style_Last, and Style_Names.
Referenced by load_theme(), and on_spells_activate().
|
static |
Used if a user just single clicks on an entry - at which point, we enable the cast & invoke buttons.
selection | |
model | |
path | |
path_currently_selected | |
userdata |
Definition at line 100 of file spells.c.
References spell_cast, and spell_invoke.
Referenced by on_spells_activate().
void update_spell_information | ( | void | ) |
When spell information updates, the treeview is cleared and re-populated. The clear/re-populate is easier than "editing" the contents.
Definition at line 190 of file spells.c.
References Stat_struct::attuned, cpl, Spell_struct::dam, Stat_struct::denied, Spell_struct::face, PixmapInfo::full_icon_image, Spell_struct::grace, has_init, Spell_struct::level, LIST_BACKGROUND, LIST_COST, LIST_DAMAGE, LIST_DESCRIPTION, LIST_FONT, LIST_FOREGROUND, LIST_IMAGE, LIST_LEVEL, LIST_MAX_SP, LIST_NAME, LIST_SKILL, LIST_TAG, MAX_BUF, Spell_struct::message, Spell_struct::name, Spell_struct::next, Spell_struct::path, pixmaps, Stat_struct::repelled, Spell_struct::skill, Spell_struct::sp, spell_eventbox, spell_label, spell_store, spell_styles, Player_Struct::spelldata, Player_Struct::spells_updated, Player_Struct::stats, Style_Attuned, Style_Denied, Style_Last, Style_Normal, Style_Repelled, and Spell_struct::tag.
Referenced by client_tick(), load_theme(), and on_spells_activate().
|
static |
The cell renderer for the spell dialog descriptions.
Definition at line 49 of file spells.c.
Referenced by on_spell_window_size_allocate(), and on_spells_activate().
|
static |
Whether or not the spell dialog initialized since the client started up.
Definition at line 55 of file spells.c.
Referenced by on_spell_window_size_allocate(), on_spells_activate(), and update_spell_information().
|
static |
Definition at line 36 of file spells.c.
Referenced by on_spells_activate(), and spell_selection_func().
|
static |
Definition at line 37 of file spells.c.
Referenced by on_spells_activate(), and update_spell_information().
|
static |
Definition at line 35 of file spells.c.
Referenced by on_spells_activate(), and spell_selection_func().
|
static |
Definition at line 37 of file spells.c.
Referenced by on_spells_activate(), and update_spell_information().
|
static |
Definition at line 36 of file spells.c.
Referenced by on_spell_cast_clicked(), on_spell_invoke_clicked(), and on_spells_activate().
|
static |
Definition at line 34 of file spells.c.
Referenced by on_spell_cast_clicked(), on_spell_invoke_clicked(), and on_spells_activate().
|
static |
Definition at line 33 of file spells.c.
Referenced by on_spell_window_size_allocate(), on_spells_activate(), and update_spell_information().
|
static |
The actual styles loaded, or NULL if no styles were found.
Definition at line 52 of file spells.c.
Referenced by spell_get_styles(), and update_spell_information().
|
static |
Definition at line 36 of file spells.c.
Referenced by on_spell_window_size_allocate(), and on_spells_activate().
|
static |
Definition at line 35 of file spells.c.
Referenced by on_spell_close_clicked(), and on_spells_activate().
|
static |
The names of theme file styles that are used in the spell dialog.
Definition at line 45 of file spells.c.
Referenced by spell_get_styles().