Crossfire Client, Branch  R11627
Enumerations | Functions | Variables
spells.c File Reference

Handles spell related functionality. More...

#include <gtk/gtk.h>
#include <glade/glade.h>
#include "client.h"
#include "image.h"
#include "gtk2proto.h"
#include "metaserver.h"
#include "main.h"
Include dependency graph for spells.c:

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_spells_activate (GtkMenuItem *menuitem, gpointer user_data)
void spell_get_styles (void)
 Gets the style information for the inventory windows.
static gboolean spell_selection_func (GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer userdata)
 Used if a user just single clicks on an entry - at which point, we enable the cast & invoke buttons.
void update_spell_information (void)

Variables

static int has_init = 0
const char *const rcsid_gtk2_spells_c = "$Id: spells.c 9201 2008-06-01 17:32:45Z anmaster $"
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]
 Actual styles as loaded.
static GtkWidget * spell_treeview
static GtkWidget * spell_window
static const char * Style_Names [Style_Last]
 The name of these styles in the rc * file.

Detailed Description

Handles spell related functionality.

Definition in file spells.c.


Enumeration Type Documentation

anonymous enum
Enumerator:
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 

Definition at line 53 of file spells.c.

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 44 of file spells.c.


Function Documentation

void on_spell_cast_clicked ( GtkButton *  button,
gpointer  user_data 
)
Parameters:
button
user_data

Definition at line 397 of file spells.c.

References LIST_TAG, LOG(), LOG_ERROR, MAX_BUF, send_command(), spell_options, and spell_selection.

Referenced by on_spells_activate().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_spell_close_clicked ( GtkButton *  button,
gpointer  user_data 
)
Parameters:
button
user_data

Definition at line 456 of file spells.c.

References spell_window.

Referenced by on_spells_activate().

Here is the caller graph for this function:

void on_spell_invoke_clicked ( GtkButton *  button,
gpointer  user_data 
)
Parameters:
button
user_data

Definition at line 427 of file spells.c.

References LIST_TAG, LOG(), LOG_ERROR, MAX_BUF, send_command(), spell_options, and spell_selection.

Referenced by on_spells_activate().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_spell_treeview_row_activated ( GtkTreeView *  treeview,
GtkTreePath *  path,
GtkTreeViewColumn *  column,
gpointer  user_data 
)
Parameters:
treeview
path
column
user_data

Definition at line 367 of file spells.c.

References LIST_TAG, LOG(), LOG_ERROR, MAX_BUF, and send_command().

Referenced by on_spells_activate().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_spells_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)
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 72 of file spells.c.

References LOG(), LOG_INFO, spell_styles, Style_Last, and Style_Names.

Referenced by load_theme(), and on_spells_activate().

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean spell_selection_func ( GtkTreeSelection *  selection,
GtkTreeModel *  model,
GtkTreePath *  path,
gboolean  path_currently_selected,
gpointer  userdata 
) [static]

Used if a user just single clicks on an entry - at which point, we enable the cast & invoke buttons.

Parameters:
selection
model
path
path_currently_selected
userdata

Definition at line 104 of file spells.c.

References spell_cast, spell_invoke, and TRUE.

Referenced by on_spells_activate().

Here is the caller graph for this function:

void update_spell_information ( void  )

Variable Documentation

int has_init = 0 [static]
const char* const rcsid_gtk2_spells_c = "$Id: spells.c 9201 2008-06-01 17:32:45Z anmaster $"

Definition at line 1 of file spells.c.

GtkWidget * spell_cast [static]

Definition at line 48 of file spells.c.

Referenced by on_spells_activate(), and spell_selection_func().

GtkWidget * spell_eventbox[Style_Last] [static]

Definition at line 48 of file spells.c.

Referenced by on_spells_activate(), and update_spell_information().

GtkWidget * spell_invoke [static]

Definition at line 48 of file spells.c.

Referenced by on_spells_activate(), and spell_selection_func().

GtkWidget * spell_label[Style_Last] [static]

Definition at line 48 of file spells.c.

Referenced by on_spells_activate(), and update_spell_information().

GtkWidget * spell_options [static]

Definition at line 48 of file spells.c.

Referenced by on_spell_cast_clicked(), on_spell_invoke_clicked(), and on_spells_activate().

GtkTreeSelection* spell_selection [static]

Definition at line 51 of file spells.c.

Referenced by on_spell_cast_clicked(), on_spell_invoke_clicked(), and on_spells_activate().

GtkListStore* spell_store [static]

Definition at line 50 of file spells.c.

Referenced by on_spells_activate(), and update_spell_information().

GtkStyle* spell_styles[Style_Last] [static]

Actual styles as loaded.

May be null if no style found.

Definition at line 61 of file spells.c.

Referenced by spell_get_styles(), and update_spell_information().

GtkWidget * spell_treeview [static]

Definition at line 48 of file spells.c.

Referenced by on_spells_activate().

GtkWidget* spell_window [static]

Definition at line 48 of file spells.c.

Referenced by on_spell_close_clicked(), and on_spells_activate().

const char* Style_Names[Style_Last] [static]
Initial value:
 {
    "spell_attuned", "spell_repelled", "spell_denied", "spell_normal"
}

The name of these styles in the rc * file.

Definition at line 57 of file spells.c.

Referenced by spell_get_styles().