Crossfire Client, Branch  R11627
Functions
gtk2proto.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void addsmooth (uint16 face, uint16 smooth_face)
 Referenced from common/commands.c.
void animate_inventory (void)
void animate_look (void)
int associate_cache_entry (Cache_Entry *ce, int pixnum)
 This functions associates image_data in the cache entry with the specific pixmap number.
void bind_key (char *params)
 Implements the "bind" command when entered as a text command.
void cleanup_connection (void)
 Called from disconnect command - that closes the socket - we just need to do the gtk cleanup.
void clear_stat_mapping (void)
void client_pickup (uint32 pickup)
 We get pickup information from server, update our status.
void client_tick (uint32 tick)
 X11 client doesn't care about this.
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.
void command_show (const char *params)
void config_init (GtkWidget *window_root)
 Set up the configuration popup dialog using libglade and the XML layout file loaded from main.c and connect various signals associated with this dialog.
int create_and_rescale_image_from_data (Cache_Entry *ce, int pixmap_num, uint8 *rgba_data, int width, int height)
 Takes the pixmap to put the data into, as well as the rgba data (ie, already loaded with png_to_data).
void create_opengl_map_image (uint8 *data, PixmapInfo *pi)
void create_opengl_question_mark (void)
void display_map_doneupdate (int redraw, int notice)
 Do the map drawing.
void display_map_newmap (void)
 The player has changed maps, so any info we have (for fog of war) is bogus, so clear out all that old info.
void display_map_startupdate (void)
 This isn't used - it is basically a prequel - we know we got a map command from the server, but have digested it all yet.
int display_mapscroll (int dx, int dy)
void do_network (void)
 main loop iteration related stuff
int do_timeout (void)
 Map, spell, and inventory maintenance.
void draw_color_info (int colr, const char *buf)
 Display information in color.
void draw_info (const char *str, int color)
 Add text to the informational message windows.
void draw_inv (int tab)
 Draws the inventory.
void draw_inv_list (int tab)
 Draws the inventory window.
void draw_inv_table (int animate)
 Draws the table of image icons.
void draw_keybindings (GtkWidget *keylist)
 Output the current list of keybindings to the message pane.
void draw_lists (void)
 Redraws inventory and look windows when necessary.
void draw_look_list (void)
 Draws the objects beneath the player.
void draw_magic_map (void)
 Draws the magic map - basically, it is just a simple encoding of space X is color C.
void draw_map (int redraw)
void draw_message_window (int redraw)
 Updates the stats pain - hp, sp, etc labels.
void draw_prompt (const char *str)
 Draws a prompt.
void draw_splash (void)
 Simple routine to put the splash icon in the map window.
void draw_stats (int redraw)
 Draws the stats window.
gboolean drawingarea_inventory_table_button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
gboolean drawingarea_inventory_table_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
void drawquarterlightmap_sdl (int tl, int tr, int bl, int br, int width, int height, int startx, int starty, int endx, int endy, int destx, int desty)
void drawsmooth (int mx, int my, int layer, int picx, int picy)
 Draw anything in adjacent squares that could smooth on given square.
void enable_menu_items (int enable)
 Enables/disables menubar options and connects signals to them.
void event_loop (void)
 event loop iteration stuff
int get_info_width (void)
 This is used by the common help system to determine when to wrap.
void get_map_image_size (int face, uint8 *w, uint8 *h)
void get_metaserver (void)
 Constructs the metaserver dialog and handles metaserver selection.
void get_window_coord (GtkWidget *win, int *x, int *y, int *wx, int *wy, int *w, int *h)
 Gets the coordinates of a specified window.
void gtk_command_history (int direction)
 Deals with command history.
void gtk_complete_command (void)
 Executes when the TAB key is pressed while the command input box has focus to give hints on what commands begin with the text already entered to this point.
void gtk_draw_map (int redraw)
void image_update_download_status (int start, int end, int total)
 Draws a status bar showing where we our in terms of downloading all the image data.
void info_get_styles (void)
 Loads up values from the style file.
void info_init (GtkWidget *window_root)
 Initialize the information panels in the client.
void init_cache_data (void)
 Initializes the data for image caching Create question mark to display in each supported rendering mode when an image is not cached.
void init_glx_opengl (GtkWidget *drawingarea)
void init_opengl (GtkWidget *drawingarea)
void init_SDL (GtkWidget *sdl_window, int just_lightmap)
int init_sounds (void)
 Opens the audio device, and reads relevant configuration files.
void inventory_get_styles (void)
 Gets the style information for the inventory windows.
void inventory_init (GtkWidget *window_root)
 Set up the inventory viewer.
void inventory_tick (void)
 This is called periodically from main.c - basically a timeout, used to animate the inventory.
void item_event_container_clearing (item *container)
void item_event_item_changed (item *it)
void item_event_item_deleting (item *it)
gboolean keybinding_selection_func (GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer userdata)
 Called when the user clicks one of the entries in the list of keybindings and places information about it into the input fields on the dialog.
void keyfunc (GtkWidget *widget, GdkEventKey *event, GtkWidget *window)
 GTK Callback function used to handle client key press events.
void keyrelfunc (GtkWidget *widget, GdkEventKey *event, GtkWidget *window)
 GTK callback function used to handle client key release events.
void keys_init (GtkWidget *window_root)
 Reads in the keybindings, and initializes special values.
void list_row_collapse (GtkTreeView *treeview, GtkTreeIter *iter, GtkTreePath *path, gpointer user_data)
 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.
gboolean list_selection_func (GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer userdata)
 Used when a button is pressed on the inventory or look list.
void load_defaults (void)
 This function processes the user saved settings file and establishes the configuration of the client.
void load_theme (int reload)
 Loads the theme stored away in the theme value above.
void load_window_positions (GtkWidget *window_root)
 Retrieves saved window positions saved with the Client | Save Window Position menu item.
void magic_map_flash_pos (void)
 Flash the player position on the magic map.
int main (int argc, char *argv[])
 The client entry point.
void map_init (GtkWidget *window_root)
 This initializes the stuff we need for the map.
void menu_about (GtkMenuItem *menuitem, gpointer user_data)
 Instantiates and displays the client's about box dialog.
void menu_clear (void)
 Clears all the message panels.
void menu_quit_character (GtkMenuItem *menuitem, gpointer user_data)
 File | Quit Character Causes the client to ask the server to delete the current character.
void menu_quit_program (GtkMenuItem *menuitem, gpointer user_data)
 File | Quit Shuts down the client application.
gboolean metaserver_selection_func (GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer userdata)
 Enables the connect button and clears the server entry box when a server is navigated to or otherwise selected.
void MusicCmd (const char *data, int len)
void on_about_close_clicked (GtkButton *button, gpointer user_data)
 Closes and hides the client's about box dialog.
void on_button_metaserver_quit_pressed (GtkButton *button, gpointer user_data)
 Quits the client application if the quit button is pressed.
void on_config_button_apply_clicked (GtkButton *button, gpointer user_data)
 Defines the behavior invoked when the configuration dialog apply button is pressed.
void on_config_button_close_clicked (GtkButton *button, gpointer user_data)
 Defines the behavior invoked when the configuration dialog close button is pressed.
void on_config_button_save_clicked (GtkButton *button, gpointer user_data)
 Defines the behavior invoked when the configuration dialog save button is pressed.
void on_configure_activate (GtkMenuItem *menuitem, gpointer user_data)
 Defines the behavior invoked when the configuration dialog is activated.
gboolean on_drawingarea_magic_map_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
gboolean on_drawingarea_map_button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
gboolean on_drawingarea_map_configure_event (GtkWidget *widget, GdkEventConfigure *event, gpointer user_data)
gboolean on_drawingarea_map_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
void on_entry_commands_activate (GtkEntry *entry, gpointer user_data)
 Used to process keyboard input whenever the player types commands into the command entry box.
gboolean on_inv_table_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
void on_keybinding_button_bind_clicked (GtkButton *button, gpointer user_data)
 Sets up a new binding when the "Add" button is clicked.
void on_keybinding_button_clear_clicked (GtkButton *button, gpointer user_data)
 Implements the "Clear Fields" button function on the keybinding dialog.
void on_keybinding_button_close_clicked (GtkButton *button, gpointer user_data)
 Deactivates the keybinding dialog when the "Close Window" button is clicked.
void on_keybinding_button_remove_clicked (GtkButton *button, gpointer user_data)
 Implements the "Remove Binding" button function that unbinds the currently selected keybinding.
void on_keybinding_button_update_clicked (GtkButton *button, gpointer user_data)
 Implements the "Update Binding" button to update the currently selected keybinding to match the currently shown identifiers, key, or command input fields.
gboolean on_keybinding_entry_key_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
 Respond to a key press in the "Key" input box.
void on_keybindings_activate (GtkMenuItem *menuitem, gpointer user_data)
 Menubar item to activate keybindings window.
void on_menu_all_weapons_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_arrows_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_body_armor_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_boots_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_bows_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_cloaks_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_dont_pickup_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_drinks_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_flesh_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_food_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_gloves_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_helmets_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_jewels_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_keys_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_magical_items_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_missile_weapons_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_normal_book_scrolls_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_not_cursed_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_potions_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_10_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_15_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_20_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_25_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_30_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_35_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_40_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_45_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_50_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_5_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_ratio_pickup_off_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_shields_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_skillscrolls_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_spellbooks_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_stop_before_pickup_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_valuables_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_menu_wands_rods_horns_activate (GtkMenuItem *menuitem, gpointer user_data)
void on_metaserver_select_clicked (GtkButton *button, gpointer user_data)
 Establish a connection with the server when pressing the connect button.
void on_metaserver_text_entry_activate (GtkEntry *entry, gpointer user_data)
 This callback handles the user entering text into the metaserver freeform entry box.
gboolean on_metaserver_text_entry_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
 Activate the connect button and unselect servers if keys are pressed to enter a server name.
void on_notebook_switch_page (GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer user_data)
 People are likely go to the different tabs much less often than their inventory changes.
void on_save_window_position_activate (GtkMenuItem *menuitem, gpointer user_data)
 Handles saving of the window positions when the Client | Save Window Position menu item is activated.
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 on_treeview_metaserver_row_activated (GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data)
 Selects and attempts a connection to a server if the player activates one of the server entries.
void on_window_destroy_event (GtkObject *object, gpointer user_data)
 Handles client shutdown.
void open_container (item *op)
void opengl_free_pixmap (PixmapInfo *pi)
void opengl_gen_map (int redraw)
int parse_args (int argc, char **argv)
 parse_args: Parses command line options, and does variable initialization.
void pickup_init (GtkWidget *window_root)
 Maps the menuitem lists into pickup values.
uint8png_to_data (uint8 *data, int len, uint32 *width, uint32 *height)
int png_to_gdkpixmap (GdkWindow *window, uint8 *data, int len, GdkPixmap **pix, GdkBitmap **mask, GdkColormap *colormap)
uint8rescale_rgba_data (uint8 *data, int *width, int *height, int scale)
 Takes png data and scales it accordingly.
void reset_image_data (void)
 Connecting to different servers, try to clear out any old images.
void reset_keybinding_status (void)
 Reset the state of the keybinding dialog.
void reset_map (void)
 Request a map update from the server.
void resize_map_window (int x, int y)
 Resize_map_window is a NOOP for the time being - not sure if it will in fact need to do something, since there are scrollbars for the map window now.
int rgba_to_gdkpixbuf (uint8 *data, int width, int height, GdkPixbuf **pix)
 Takes data that has already been converted into RGBA format (via png_to_data above perhaps) and creates a GdkPixbuf of it.
int rgba_to_gdkpixmap (GdkWindow *window, uint8 *data, int width, int height, GdkPixmap **pix, GdkBitmap **mask, GdkColormap *colormap)
 Takes data that has already been converted into RGBA format (via png_to_data above perhaps) and creates a GdkPixmap and GdkBitmap out of it.
void save_defaults (void)
 This function saves user settings chosen using the configuration popup dialog.
void save_winpos (void)
 Handles saving of the window positions when the Client | Save Window Position menu item is executed.
void sdl_gen_map (int redraw)
int sdl_mapscroll (int dx, int dy)
void set_autorepeat (const char *s)
 A stub function that does nothing.
void set_scroll (const char *s)
 A stub function that does nothing.
void set_show_icon (const char *s)
void set_show_weight (const char *s)
void set_text_tag_from_style (GtkTextTag *tag, GtkStyle *style, GtkStyle *base_style)
 Sets attributes in the text tag from a style.
void set_weight_limit (uint32 wlim)
 No reason to divide by 1000 everytime we do the display, so do it once and store it here.
void Sound2Cmd (unsigned char *data, int len)
void SoundCmd (unsigned char *data, int len)
 ?
void spell_get_styles (void)
 Gets the style information for the inventory windows.
void stats_get_styles (void)
 Gets the style information for the stat bars (only portion of the window right now that has custom style support.
void stats_init (GtkWidget *window_root)
void unbind_key (const char *params)
void update_keybinding_list (void)
 Update the keybinding dialog to reflect the current state of the keys file.
void update_spell_information (void)
void update_stat (int stat_no, sint64 max_stat, sint64 current_stat, sint64 statbar_max, sint64 statbar_stat, const char *name, int can_alert)
 Updates the stat bar and text display as it pertains to a specific stat.
void x_set_echo (void)

Function Documentation

void addsmooth ( uint16  face,
uint16  smooth_face 
)

Referenced from common/commands.c.

Parameters:
face
smooth_face

Definition at line 360 of file image.c.

void animate_inventory ( void  )
void animate_look ( void  )
int associate_cache_entry ( Cache_Entry ce,
int  pixnum 
)

This functions associates image_data in the cache entry with the specific pixmap number.

Currently, there is no failure condition, but there is the potential that in the future, we want to more closely look at the data and if it isn't valid, return the failure code.

Returns:
0 on success, -1 on failure.

Definition at line 372 of file image.c.

void cleanup_connection ( void  )

Called from disconnect command - that closes the socket - we just need to do the gtk cleanup.

Definition at line 329 of file gx11.c.

void clear_stat_mapping ( void  )

Definition at line 725 of file stats.c.

References need_mapping_update.

Referenced by main().

Here is the caller graph for this function:

void client_pickup ( uint32  pickup)

We get pickup information from server, update our status.

Definition at line 4524 of file gx11.c.

void client_tick ( uint32  tick)

X11 client doesn't care about this.

Definition at line 4510 of file gx11.c.

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 1342 of file inventory.c.

void command_show ( const char *  params)
Parameters:
params

Definition at line 1153 of file inventory.c.

void config_init ( GtkWidget *  window_root)

Set up the configuration popup dialog using libglade and the XML layout file loaded from main.c and connect various signals associated with this dialog.

Definition at line 407 of file config.c.

References dialog_xml, has_init, on_config_button_apply_clicked(), on_config_button_close_clicked(), and on_config_button_save_clicked().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int create_and_rescale_image_from_data ( Cache_Entry ce,
int  pixmap_num,
uint8 rgba_data,
int  width,
int  height 
)

Takes the pixmap to put the data into, as well as the rgba data (ie, already loaded with png_to_data).

Scales and stores the relevant data into the pixmap structure.

Parameters:
cecan be NULL
pixmap_num
rgba_data
width
height
Returns:
1 on failure.

Definition at line 252 of file image.c.

void create_opengl_map_image ( uint8 data,
PixmapInfo pi 
)

Referenced by create_map_image().

Here is the caller graph for this function:

void create_opengl_question_mark ( void  )

Referenced by init_cache_data().

Here is the caller graph for this function:

void display_map_doneupdate ( int  redraw,
int  notice 
)

Do the map drawing.

If redraw is set, force redraw of all tiles.

If notice is set, another call will follow soon.

Do the map drawing.

this should perhaps be removed, and left to being done from from the main event loop.

Parameters:
redrawIf set, force redraw of all tiles.
noticeIf set, another call will follow soon.

Do the map drawing.

If notice is set, another call will follow soon.

Definition at line 5300 of file gx11.c.

void display_map_newmap ( void  )

The player has changed maps, so any info we have (for fog of war) is bogus, so clear out all that old info.

Definition at line 5319 of file gx11.c.

void display_map_startupdate ( void  )

This isn't used - it is basically a prequel - we know we got a map command from the server, but have digested it all yet.

This can be useful if there is info we know we need to store away or the like before it is destroyed, but there isn't anything like that for the gtk client.

Definition at line 5428 of file gx11.c.

int display_mapscroll ( int  dx,
int  dy 
)
Parameters:
dx
dy

Definition at line 88 of file map.c.

void do_network ( void  )

main loop iteration related stuff

Definition at line 176 of file main.c.

References CFG_DM_OPENGL, CFG_DM_SDL, CONFIG_DISPLAYMODE, csocket, csocket_fd, DoClient(), draw_lists(), draw_map(), FALSE, ClientSocket::fd, LOG(), LOG_WARNING, maxfd, opengl_gen_map(), script_fdset(), script_process(), sdl_gen_map(), timeout, and use_config.

Here is the call graph for this function:

int do_timeout ( void  )

Map, spell, and inventory maintenance.

Returns:
TRUE

Definition at line 4535 of file gx11.c.

References cpl, display_map_doneupdate(), draw_info_windows(), FALSE, inventory_tick(), magic_map_flash_pos(), mapdata_animation(), redraw_needed, Player_Struct::showmagic, Player_Struct::spells_updated, tick, TRUE, update_spell_information(), update_spell_list(), and updatelock.

Here is the call graph for this function:

void draw_color_info ( int  colr,
const char *  buf 
)

Display information in color.

This function simply calls draw_info() with the parameter order swapped, and it provides no unique features. Since it is called from common, it is likely a legacy function that should probably be considered deprecated. Important: This function calls draw_info(), so if a color other than black is specified, the text is routed to both the primary and secondary (critical) message panes.

Parameters:
colrThe color to use when displaying text.
bufThe text to display.

Definition at line 1851 of file gx11.c.

void draw_info ( const char *  str,
int  color 
)

Add text to the informational message windows.

Colored text implies some level of importance, and results in the messge being auto-routed to the critical message panel. Note that with the textbufs, it seems you need to manually set it to the bottom of the screen - otherwise, the scrollbar just stays at the top. However, this does not seem ideal if you are trying to scroll back while new stuff comes in. Question: Is there a good reason for draw_info() and draw_color_info() to write directly to the message panel when add_to_textbuf() does this? Does it really make sense to use color to determine if a message is critical?.

Parameters:
strPointer to displayable text.
colorColor of the text.

Definition at line 1773 of file gx11.c.

void draw_inv ( int  tab)

Draws the inventory.

Have to determine how to draw it.

Parameters:
tab

Definition at line 1013 of file inventory.c.

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

Referenced by draw_lists().

Here is the call graph for this function:

Here is the caller graph for this function:

void draw_inv_list ( int  tab)

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 754 of file inventory.c.

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

Referenced by draw_inv().

Here is the call graph for this function:

Here is the caller graph for this function:

void draw_inv_table ( int  animate)

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 857 of file inventory.c.

References item_struct::anim_speed, item_struct::anim_state, item_struct::animation_id, animations, cpl, item_struct::d_name, 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_children, inv_table_tooltips, INVHELPTEXT, item_struct::last_anim, MAX_INV_COLUMNS, MAX_INV_ROWS, item_struct::next, Animations::num_animations, Player_Struct::ob, and pixmaps.

Referenced by animate_inventory(), draw_inv(), and on_inv_table_expose_event().

Here is the call graph for this function:

Here is the caller graph for this function:

void draw_lists ( void  )

Redraws inventory and look windows when necessary.

Definition at line 1029 of file inventory.c.

Referenced by check_x_events(), close_container(), do_network(), load_theme(), and open_container().

Here is the caller graph for this function:

void draw_look_list ( void  )

Draws the objects beneath the player.

Definition at line 718 of file inventory.c.

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

Referenced by draw_lists(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:

void draw_magic_map ( void  )

Draws the magic map - basically, it is just a simple encoding of space X is color C.

Definition at line 4571 of file gx11.c.

void draw_map ( int  redraw)
Parameters:
redraw

Definition at line 654 of file map.c.

References CFG_DM_OPENGL, CFG_DM_PIXMAP, CFG_DM_SDL, CONFIG_DISPLAYMODE, cpl, draw_splash(), gtk_draw_map(), Player_Struct::input_state, Metaserver_Select, opengl_gen_map(), sdl_gen_map(), and use_config.

Referenced by client_tick(), do_network(), get_metaserver(), on_drawingarea_map_expose_event(), and resize_map_window().

Here is the call graph for this function:

Here is the caller graph for this function:

void draw_message_window ( int  redraw)

Updates the stats pain - hp, sp, etc labels.

Parameters:
redraw

Definition at line 2458 of file gx11.c.

void draw_splash ( void  )

Simple routine to put the splash icon in the map window.

Only supported with non-SDL right now.

Definition at line 620 of file map.c.

References CFG_DM_PIXMAP, CONFIG_DISPLAYMODE, map_drawing_area, mapgc, and use_config.

Referenced by draw_map(), and main().

Here is the caller graph for this function:

void draw_stats ( int  redraw)

Draws the stats window.

If redraw is true, it means we need to redraw the entire thing, and not just do an updated

Definition at line 2015 of file gx11.c.

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

Definition at line 811 of file inventory.c.

References list_item_action(), and TRUE.

Referenced by draw_inv_table().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 827 of file inventory.c.

References item_struct::face, PixmapInfo::icon_image, image_size, pixmaps, and TRUE.

Referenced by draw_inv_table().

Here is the caller graph for this function:

void drawquarterlightmap_sdl ( int  tl,
int  tr,
int  bl,
int  br,
int  width,
int  height,
int  startx,
int  starty,
int  endx,
int  endy,
int  destx,
int  desty 
)
void drawsmooth ( int  mx,
int  my,
int  layer,
int  picx,
int  picy 
)

Draw anything in adjacent squares that could smooth on given square.

Parameters:
mx
mySquare to smooth on. You should not call this function to smooth on a 'completely black' square.
layerLayer to examine (we smooth only one layer at a time)
picx
picyPlace on the map_drawing_area->window to draw

Definition at line 104 of file map.c.

References CAN_SMOOTH, Map::cells, draw_pixmap(), MapCellLayer::face, MapCell::heads, map_image_size, pixmaps, MapCell::smooth, PixmapInfo::smooth_face, the_map, Map::x, and Map::y.

Here is the call graph for this function:

void enable_menu_items ( int  enable)

Enables/disables menubar options and connects signals to them.

Some do not make sense if not connected to the server, so should be disabled until connected.

Parameters:
enableIf true, enable the items, if false, disable them. Presently it looks as though enable is not actually used at all. Is this a bug?

Definition at line 121 of file menubar.c.

References menu_about(), menu_quit_character(), menu_quit_program(), on_configure_activate(), on_disconnect_activate(), on_keybindings_activate(), on_menu_all_weapons_activate(), on_menu_arrows_activate(), on_menu_body_armor_activate(), on_menu_boots_activate(), on_menu_bows_activate(), on_menu_cloaks_activate(), on_menu_dont_pickup_activate(), on_menu_drinks_activate(), on_menu_flesh_activate(), on_menu_food_activate(), on_menu_gloves_activate(), on_menu_helmets_activate(), on_menu_jewels_activate(), on_menu_keys_activate(), on_menu_magical_items_activate(), on_menu_missile_weapons_activate(), on_menu_normal_book_scrolls_activate(), on_menu_not_cursed_activate(), on_menu_potions_activate(), on_menu_ratio_10_activate(), on_menu_ratio_15_activate(), on_menu_ratio_20_activate(), on_menu_ratio_25_activate(), on_menu_ratio_35_activate(), on_menu_ratio_40_activate(), on_menu_ratio_45_activate(), on_menu_ratio_50_activate(), on_menu_ratio_5_activate(), on_menu_ratio_pickup_off_activate(), on_menu_shields_activate(), on_menu_skillscrolls_activate(), on_menu_spellbooks_activate(), on_menu_stop_before_pickup_activate(), on_menu_valuables_activate(), on_menu_wands_rods_horns_activate(), on_save_window_position_activate(), on_spells_activate(), and window_root.

Referenced by get_metaserver(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:

void event_loop ( void  )

event loop iteration stuff

Definition at line 234 of file main.c.

int get_info_width ( void  )

This is used by the common help system to determine when to wrap.

Should be able to get width of window, and divide by character width - however, still not perfect if we are using a variable width font. Actually, gtk can do word wrapping for us, so maybe the real fix is to have it to the word wrapping and just run a sufficiently large value. FIXME: should be better than hardcoded value.

Returns:
The width of the info window in characters.

Definition at line 4453 of file gx11.c.

void get_map_image_size ( int  face,
uint8 w,
uint8 h 
)
Parameters:
face
w
h

Definition at line 459 of file image.c.

void get_metaserver ( void  )

Constructs the metaserver dialog and handles metaserver selection.

Definition at line 5432 of file gx11.c.

void get_window_coord ( GtkWidget *  win,
int *  x,
int *  y,
int *  wx,
int *  wy,
int *  w,
int *  h 
)

Gets the coordinates of a specified window.

Parameters:
winPass in a GtkWidget pointer to get its coordinates.
xParent-relative window x coordinate
yParent-relative window y coordinate
wx?
wy?
wWindow width
hWindow height

Definition at line 4789 of file gx11.c.

void gtk_draw_map ( int  redraw)
void image_update_download_status ( int  start,
int  end,
int  total 
)

Draws a status bar showing where we our in terms of downloading all the image data.

A few hacks: If start is 1, this is the first batch, so it means we need to create the appropriate status window. If start = end = total, it means were finished, so destroy the gui element.

Parameters:
startThe start value just sent to the server.
end
totalThe total number of images.

Definition at line 419 of file image.c.

void info_get_styles ( void  )

Loads up values from the style file.

Note that the actual name of the style file is set elsewhere.

This function is designed so that it should be possible to call it multiple times - it will release old style data and load up new values. In this way, a user should be able to change styles on the fly and have things work.

Definition at line 165 of file info.c.

References Info_Pane::bold_tag, Info_Pane::color_tags, Info_Pane::default_tag, font_style_names, Info_Pane::font_tags, has_init, has_style, info_pane, Info_Pane::italic_tag, LOG(), LOG_INFO, MAX_BUF, max_subtype, MSG_TYPE_LAST, msg_type_names, Info_Pane::msg_type_tags, NUM_COLORS, NUM_FONTS, NUM_TEXT_VIEWS, set_text_tag_from_style(), Msg_Type_Names::subtype, Msg_Type_Names::type, Info_Pane::underline_tag, and usercolorname.

Referenced by info_init(), and load_theme().

Here is the call graph for this function:

Here is the caller graph for this function:

void info_init ( GtkWidget *  window_root)

Initialize the information panels in the client.

These panels are the client areas where text is drawn.

Parameters:
window_rootParent (root) window of the application.

Definition at line 413 of file info.c.

References Info_Pane::adjustment, FALSE, info_get_styles(), info_pane, MAX_BUF, message_callback(), MSG_TYPE_LAST, NUM_TEXT_VIEWS, Info_Pane::scrolled_window, setTextManager(), Info_Pane::textbuffer, Info_Pane::textmark, and Info_Pane::textview.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void init_cache_data ( void  )

Initializes the data for image caching Create question mark to display in each supported rendering mode when an image is not cached.

When image caching is enabled, if a needed image is not yet in the cache, a question mark image is displayed instead. The image displayed is unique to the display mode. This function creates the image to use when OpenGL mode is in effect.

Definition at line 542 of file image.c.

void init_glx_opengl ( GtkWidget *  drawingarea)
void init_opengl ( GtkWidget *  drawingarea)

Referenced by map_init().

Here is the caller graph for this function:

void init_SDL ( GtkWidget *  sdl_window,
int  just_lightmap 
)
int init_sounds ( void  )

Opens the audio device, and reads relevant configuration files.

Returns:
Returns 0 on success. On failure, the calling function will likely disable sound support/requests from the server.

Definition at line 60 of file sound.c.

void inventory_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 394 of file inventory.c.

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

Referenced by inventory_init(), and load_theme().

Here is the call graph for this function:

Here is the caller graph for this function:

void inventory_init ( GtkWidget *  window_root)

Set up the inventory viewer.

Parameters:
window_rootThe client main window.

Definition at line 421 of file inventory.c.

References inv_notebook, inv_table, inv_table_children, inv_table_tooltips, INV_TREE, inventory_get_styles(), LIST_NUM_COLUMNS, list_row_collapse(), LOG(), LOG_ERROR, MAX_INV_COLUMNS, MAX_INV_ROWS, NUM_INV_LISTS, num_inv_notebook_pages, on_inv_table_expose_event(), on_notebook_switch_page(), setup_list_columns(), store_look, Notebook_Info::treestore, Notebook_Info::treeview, treeview_look, and weight_label.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void inventory_tick ( void  )

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

Definition at line 1374 of file inventory.c.

References animate_inventory(), animate_look(), itemview_tick(), and update_lists_labels().

Here is the call graph for this function:

void item_event_container_clearing ( item container)

Definition at line 525 of file inventory.c.

void item_event_item_changed ( item it)

Definition at line 489 of file inventory.c.

Definition at line 596 of file inventory.c.

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

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 282 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:

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

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 237 of file inventory.c.

References event, FALSE, 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:

void load_defaults ( void  )

This function processes the user saved settings file and establishes the configuration of the client.

Definition at line 710 of file config.c.

void load_theme ( int  reload)

Loads the theme stored away in the theme value above.

the theme string is loaded/saved into the config file, and can also be changed by the user in the config menu.

Parameters:
reloadIf true, user has changed theme after initial startup. In this mode, we need to call the routines that store away private theme data. When program is starting up, this is false, because all the widgets haven't been realized yet, and the initialize routines will get the theme data at that time.

Definition at line 116 of file config.c.

References Player_Struct::below, cpl, draw_lists(), draw_message_window(), draw_stats(), info_get_styles(), item_struct::inv_updated, inventory_get_styles(), LOG(), LOG_ERROR, MAX_BUF, Player_Struct::ob, spell_get_styles(), stats_get_styles(), TRUE, and update_spell_information().

Referenced by main(), and read_config_window().

Here is the call graph for this function:

Here is the caller graph for this function:

void load_window_positions ( GtkWidget *  window_root)

Retrieves saved window positions saved with the Client | Save Window Position menu item.

Parameters:
window_rootThe client's main window.

Definition at line 1064 of file config.c.

References draw_info(), LOG(), LOG_ERROR, LOG_INFO, MAX_BUF, NDI_RED, and window_xml_file.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void magic_map_flash_pos ( void  )

Flash the player position on the magic map.

Definition at line 4766 of file gx11.c.

int main ( int  argc,
char *  argv[] 
)

The client entry point.

Parameters:
argc
argv
Returns:

Definition at line 5546 of file gx11.c.

void map_init ( GtkWidget *  window_root)

This initializes the stuff we need for the map.

Parameters:
window_rootThe client's main playing window.

Definition at line 103 of file map.c.

References CFG_DM_OPENGL, CFG_DM_PIXMAP, CFG_DM_SDL, CONFIG_DISPLAYMODE, CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, dark, dark1, dark2, dark3, init_opengl(), init_SDL(), map_drawing_area, map_image_size, map_notebook, mapgc, NDI_BLACK, NDI_WHITE, on_drawingarea_map_button_press_event(), on_drawingarea_map_configure_event(), on_drawingarea_map_expose_event(), root_color, TRUE, and use_config.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void menu_about ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Instantiates and displays the client's about box dialog.

Parameters:
menuitemThe menu item that launches the about box
user_data

Definition at line 55 of file about.c.

References about_window, dialog_xml, on_about_close_clicked(), text, TRUE, and VERSION_INFO.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void menu_clear ( void  )

Clears all the message panels.

It is not clear why someone would use it, but is called from the common area, and so is supported here.

Definition at line 3241 of file gx11.c.

void menu_quit_character ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

File | Quit Character Causes the client to ask the server to delete the current character.

Parameters:
menuitem
user_data

Definition at line 106 of file menubar.c.

References extended_command().

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void menu_quit_program ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

File | Quit Shuts down the client application.

Parameters:
menuitem
user_data

Definition at line 86 of file menubar.c.

References LOG(), and LOG_INFO.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Enables the connect button and clears the server entry box when a server is navigated to or otherwise selected.

Parameters:
selection
model
path
path_currently_selected
userdata
Returns:
TRUE

Definition at line 66 of file metaserver.c.

References metaserver_button, metaserver_entry, and TRUE.

Referenced by get_metaserver().

Here is the caller graph for this function:

void MusicCmd ( const char *  data,
int  len 
)

Definition at line 199 of file sound.c.

void on_about_close_clicked ( GtkButton *  button,
gpointer  user_data 
)

Closes and hides the client's about box dialog.

Parameters:
buttonThe about dialog's close button.
user_data

Definition at line 122 of file about.c.

References about_window.

Referenced by menu_about().

Here is the caller graph for this function:

void on_button_metaserver_quit_pressed ( GtkButton *  button,
gpointer  user_data 
)

Quits the client application if the quit button is pressed.

This is also used to quit the client if the button's accelerator is pressed.

Parameters:
button
user_data

Definition at line 388 of file metaserver.c.

Referenced by get_metaserver().

Here is the caller graph for this function:

void on_config_button_apply_clicked ( GtkButton *  button,
gpointer  user_data 
)

Defines the behavior invoked when the configuration dialog apply button is pressed.

Parameters:
button
user_data

Definition at line 941 of file config.c.

References read_config_window().

Referenced by config_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_config_button_close_clicked ( GtkButton *  button,
gpointer  user_data 
)

Defines the behavior invoked when the configuration dialog close button is pressed.

Parameters:
button
user_data

Definition at line 955 of file config.c.

Referenced by config_init().

Here is the caller graph for this function:

void on_config_button_save_clicked ( GtkButton *  button,
gpointer  user_data 
)

Defines the behavior invoked when the configuration dialog save button is pressed.

Parameters:
button
user_data

Definition at line 926 of file config.c.

References read_config_window(), and save_defaults().

Referenced by config_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_configure_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Defines the behavior invoked when the configuration dialog is activated.

Parameters:
menuitem
user_data

Definition at line 968 of file config.c.

References setup_config_window().

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean on_drawingarea_magic_map_expose_event ( GtkWidget *  widget,
GdkEventExpose *  event,
gpointer  user_data 
)
Parameters:
widget
event
user_data
Returns:
FALSE

Definition at line 154 of file magicmap.c.

References draw_magic_map(), and FALSE.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean on_drawingarea_map_button_press_event ( GtkWidget *  widget,
GdkEventButton *  event,
gpointer  user_data 
)
Parameters:
widget
event
user_data
Returns:
FALSE

Definition at line 694 of file map.c.

References clear_fire(), CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, FALSE, fire_dir(), look_at(), map_image_size, move_player(), and use_config.

Referenced by map_init().

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean on_drawingarea_map_configure_event ( GtkWidget *  widget,
GdkEventConfigure *  event,
gpointer  user_data 
)

Definition at line 586 of file map.c.

References CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, cs_print_string(), csocket, FALSE, ClientSocket::fd, map_image_size, MAP_MAX_SIZE, mapdata_set_size(), and use_config.

Referenced by map_init().

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean on_drawingarea_map_expose_event ( GtkWidget *  widget,
GdkEventExpose *  event,
gpointer  user_data 
)
Parameters:
widget
event
user_data
Returns:
FALSE

Definition at line 678 of file map.c.

References draw_map(), FALSE, and TRUE.

Referenced by map_init().

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean on_inv_table_expose_event ( GtkWidget *  widget,
GdkEventExpose *  event,
gpointer  user_data 
)
Parameters:
widget
event
user_data
Returns:
TRUE

Definition at line 1086 of file inventory.c.

References draw_inv_table(), and TRUE.

Referenced by inventory_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_all_weapons_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 291 of file pickup.c.

References new_menu_pickup(), and PU_ALLWEAPON.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_arrows_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 312 of file pickup.c.

References new_menu_pickup(), and PU_ARROW.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_body_armor_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 146 of file pickup.c.

References new_menu_pickup(), and PU_ARMOUR.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_boots_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 153 of file pickup.c.

References new_menu_pickup(), and PU_BOOTS.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_bows_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 305 of file pickup.c.

References new_menu_pickup(), and PU_BOW.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_cloaks_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 160 of file pickup.c.

References new_menu_pickup(), and PU_CLOAK.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_dont_pickup_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 128 of file pickup.c.

References new_menu_pickup(), and PU_INHIBIT.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_drinks_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 217 of file pickup.c.

References new_menu_pickup(), and PU_DRINK.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_flesh_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 280 of file pickup.c.

References new_menu_pickup(), and PU_FLESH.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_food_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 224 of file pickup.c.

References new_menu_pickup(), and PU_FOOD.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_gloves_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 167 of file pickup.c.

References new_menu_pickup(), and PU_GLOVES.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_helmets_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 174 of file pickup.c.

References new_menu_pickup(), and PU_HELMET.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_jewels_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 273 of file pickup.c.

References new_menu_pickup(), and PU_JEWELS.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_keys_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 231 of file pickup.c.

References new_menu_pickup(), and PU_KEY.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_magical_items_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 238 of file pickup.c.

References new_menu_pickup(), and PU_MAGICAL.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_missile_weapons_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 298 of file pickup.c.

References new_menu_pickup(), and PU_MISSILEWEAPON.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_normal_book_scrolls_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 200 of file pickup.c.

References new_menu_pickup(), and PU_READABLES.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_not_cursed_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 266 of file pickup.c.

References new_menu_pickup(), and PU_NOT_CURSED.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_potions_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 245 of file pickup.c.

References new_menu_pickup(), and PU_POTION.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_ratio_10_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 337 of file pickup.c.

References new_menu_pickup().

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_ratio_15_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 344 of file pickup.c.

References new_menu_pickup().

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_ratio_20_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 351 of file pickup.c.

References new_menu_pickup().

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_ratio_25_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 358 of file pickup.c.

References new_menu_pickup().

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_ratio_30_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 365 of file pickup.c.

References new_menu_pickup().

Here is the call graph for this function:

void on_menu_ratio_35_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 372 of file pickup.c.

References new_menu_pickup().

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_ratio_40_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 379 of file pickup.c.

References new_menu_pickup().

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_ratio_45_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 386 of file pickup.c.

References new_menu_pickup().

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_ratio_50_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 393 of file pickup.c.

References new_menu_pickup().

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_ratio_5_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 330 of file pickup.c.

References new_menu_pickup().

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_ratio_pickup_off_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 323 of file pickup.c.

References new_menu_pickup().

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_shields_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 181 of file pickup.c.

References new_menu_pickup(), and PU_SHIELD.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_skillscrolls_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 192 of file pickup.c.

References new_menu_pickup(), and PU_SKILLSCROLL.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_spellbooks_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 208 of file pickup.c.

References new_menu_pickup(), and PU_SPELLBOOK.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_stop_before_pickup_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 135 of file pickup.c.

References new_menu_pickup(), and PU_STOP.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_valuables_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 252 of file pickup.c.

References new_menu_pickup(), and PU_VALUABLES.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_menu_wands_rods_horns_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Definition at line 259 of file pickup.c.

References new_menu_pickup(), and PU_MAGIC_DEVICE.

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_metaserver_select_clicked ( GtkButton *  button,
gpointer  user_data 
)

Establish a connection with the server when pressing the connect button.

Parameters:
button
user_data

Definition at line 257 of file metaserver.c.

References CONFIG_PORT, cpl, csocket, FALSE, ClientSocket::fd, init_connection(), Player_Struct::input_state, LIST_HOSTNAME, LIST_IPADDR, metaserver_button, metaserver_entry, metaserver_selection, metaserver_status, name, Playing, and use_config.

Referenced by get_metaserver().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_metaserver_text_entry_activate ( GtkEntry *  entry,
gpointer  user_data 
)

This callback handles the user entering text into the metaserver freeform entry box.

Parameters:
entry
user_data

Definition at line 370 of file metaserver.c.

References metaserver_connect_to().

Referenced by get_metaserver().

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean on_metaserver_text_entry_key_press_event ( GtkWidget *  widget,
GdkEventKey *  event,
gpointer  user_data 
)

Activate the connect button and unselect servers if keys are pressed to enter a server name.

Parameters:
widget
event
user_data
Returns:
FALSE

Definition at line 408 of file metaserver.c.

References FALSE, metaserver_button, metaserver_selection, and TRUE.

Referenced by get_metaserver().

Here is the caller graph for this function:

void on_notebook_switch_page ( GtkNotebook *  notebook,
GtkNotebookPage *  page,
guint  page_num,
gpointer  user_data 
)

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 1065 of file inventory.c.

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

Referenced by inventory_init().

Here is the caller graph for this function:

void on_save_window_position_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Handles saving of the window positions when the Client | Save Window Position menu item is activated.

Parameters:
menuitem
user_data

Definition at line 1048 of file config.c.

References save_winpos().

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

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 on_treeview_metaserver_row_activated ( GtkTreeView *  treeview,
GtkTreePath *  path,
GtkTreeViewColumn *  column,
gpointer  user_data 
)

Selects and attempts a connection to a server if the player activates one of the server entries.

Parameters:
treeview
path
column
user_data

Definition at line 346 of file metaserver.c.

References LIST_HOSTNAME, LIST_IPADDR, metaserver_connect_to(), and name.

Referenced by get_metaserver().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_window_destroy_event ( GtkObject *  object,
gpointer  user_data 
)

Handles client shutdown.

Definition at line 162 of file main.c.

References LOG(), and LOG_INFO.

Referenced by get_metaserver(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:

void open_container ( item op)
Parameters:
op

Definition at line 1334 of file inventory.c.

Referenced by free_pixmap().

Here is the caller graph for this function:

void opengl_gen_map ( int  redraw)

Referenced by do_network(), and draw_map().

Here is the caller graph for this function:

int parse_args ( int  argc,
char **  argv 
)
void pickup_init ( GtkWidget *  window_root)

Maps the menuitem lists into pickup values.

In this way, client_pickup knows what values to change.

Parameters:
window_root

Definition at line 405 of file pickup.c.

References has_init, LOG(), LOG_ERROR, MAX_PICKUPS, PickupMapping::menuitem, num_pickups, PickupMapping::pickup_mode, PU_ALLWEAPON, PU_ARMOUR, PU_ARROW, PU_BOOTS, PU_BOW, PU_CLOAK, PU_DRINK, PU_FLESH, PU_FOOD, PU_GLOVES, PU_HELMET, PU_INHIBIT, PU_JEWELS, PU_KEY, PU_MAGIC_DEVICE, PU_MAGICAL, PU_MISSILEWEAPON, PU_NOT_CURSED, PU_POTION, PU_RATIO, PU_READABLES, PU_SHIELD, PU_SKILLSCROLL, PU_SPELLBOOK, PU_STOP, and PU_VALUABLES.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

uint8* png_to_data ( uint8 data,
int  len,
uint32 width,
uint32 height 
)
Parameters:
*data
len
*width
*height

Definition at line 63 of file png.c.

int png_to_gdkpixmap ( GdkWindow *  window,
uint8 data,
int  len,
GdkPixmap **  pix,
GdkBitmap **  mask,
GdkColormap *  colormap 
)
Parameters:
*window
*data
len
**pix
**mask
*colormap

Definition at line 544 of file png.c.

References data_cp, data_len, data_start, height, PNGX_DATA, PNGX_OUTOFMEM, rgb, user_read_data(), and width.

Here is the call graph for this function:

uint8* rescale_rgba_data ( uint8 data,
int *  width,
int *  height,
int  scale 
)

Takes png data and scales it accordingly.

This function is based on pnmscale, but has been modified to support alpha channel - instead of blending the alpha channel, it takes the most opaque value - blending it is not likely to give sane results IMO - for any image that has transparent information, if we blended the alpha, the result would be the edges of that region being partially transparent. This function has also been re-written to use more static data - in the case of the client, it will be called thousands of times, so it doesn't make sense to free the data and then re-allocate it.

For pixels that are fully transparent, the end result after scaling is they will be tranparent black. This is a needed effect for blending to work properly.

This function returns a new pointer to the scaled image data. This is malloc'd data, so should be freed at some point to prevent leaks. This function does not modify the data passed to it - the caller is responsible for freeing it if it is no longer needed.

function arguments:

Parameters:
*dataPNG data - this is any 4 byte per pixel data, in RGBA format.
*widthSource width modified to contain the new image size.
*heightSource height modified to contain the new image size.
scalePercentage size that new image should be. 100 is a same size image - values larger than 100 will result in zoom, values less than 100 will result in a shrinkage.

Definition at line 244 of file png.c.

void reset_image_data ( void  )

Connecting to different servers, try to clear out any old images.

Try to free the data to prevent memory leaks. This could be more clever, ie, if we're caching images and go to a new server and get a name, we should try to re-arrange our cache or the like.

Definition at line 387 of file image.c.

void reset_map ( void  )

Request a map update from the server.

This is to circumvent a bug in some server versions.

Todo:
remove

This is to circumvent a bug in some server versions.

Todo:
remove

This is to circumvent a bug in some server versions.

Todo:
remove

Definition at line 76 of file map.c.

void resize_map_window ( int  x,
int  y 
)

Resize_map_window is a NOOP for the time being - not sure if it will in fact need to do something, since there are scrollbars for the map window now.

Note - this is note a window resize request, but rather process the size (in spaces) of the map - is received from server.

Definition at line 5324 of file gx11.c.

int rgba_to_gdkpixbuf ( uint8 data,
int  width,
int  height,
GdkPixbuf **  pix 
)

Takes data that has already been converted into RGBA format (via png_to_data above perhaps) and creates a GdkPixbuf of it.

Parameters:
*data
width
height
**pix
Returns:
Non-zero on error (currently, no checks for error conditions is done

Definition at line 500 of file png.c.

References height, TRUE, and width.

Referenced by create_icon_image().

Here is the caller graph for this function:

int rgba_to_gdkpixmap ( GdkWindow *  window,
uint8 data,
int  width,
int  height,
GdkPixmap **  pix,
GdkBitmap **  mask,
GdkColormap *  colormap 
)

Takes data that has already been converted into RGBA format (via png_to_data above perhaps) and creates a GdkPixmap and GdkBitmap out of it.

Parameters:
*window
*data
width
height
**pix
**mask
*colormap
Returns:
Non-zero on error (currently, no checks for error conditions is done

Definition at line 407 of file png.c.

References height, and width.

void save_defaults ( void  )

This function saves user settings chosen using the configuration popup dialog.

Definition at line 848 of file config.c.

void save_winpos ( void  )

Handles saving of the window positions when the Client | Save Window Position menu item is executed.

All hpaned and vpaned widget settings have the information required, and the code automatically works for Glade XML layouts that follow the glade-2's default widget naming convention.

Definition at line 4804 of file gx11.c.

void sdl_gen_map ( int  redraw)
int sdl_mapscroll ( int  dx,
int  dy 
)
void set_autorepeat ( const char *  s)

A stub function that does nothing.

These are callbacks used by the common code, but they are not implemented in GTK, either because it makes no sense (set_scroll for example), or because it may not be technically possible to do so if we limit ourselves to proper GTK2 code (Eg, don't mess with the internals of X or platform specific issues)

Parameters:
s

Definition at line 4448 of file gx11.c.

void set_scroll ( const char *  s)

A stub function that does nothing.

These are callbacks used by the common code, but they are not implemented in GTK, either because it makes no sense (set_scroll for example), or because it may not be technically possible to do so if we limit ourselves to proper GTK2 code (Eg, don't mess with the internals of X or platform specific issues)

Parameters:
s

Definition at line 4443 of file gx11.c.

void set_show_icon ( const char *  s)
Parameters:
s

Definition at line 1303 of file inventory.c.

void set_show_weight ( const char *  s)
Parameters:
s

Definition at line 1258 of file inventory.c.

void set_text_tag_from_style ( GtkTextTag *  tag,
GtkStyle *  style,
GtkStyle *  base_style 
)

Sets attributes in the text tag from a style.

Best I can gather, there is no way to take all of the attributes from a style and apply them directly to a text tag, hence this function to do the work. GtkTextTags also know what attributes are set and which are not set - thus, you can apply multiple tags to the same text, and get all of the effects. For styles, that isn't the case - a style contains all of the information. So this function also compares the loaded style from the base style, and only sets the attributes that are different.

Parameters:
tagtext tag to set values on
stylestyle to get values from
base_stylebase style for the widget to compare against

Definition at line 133 of file info.c.

References FALSE.

Referenced by info_get_styles().

Here is the caller graph for this function:

void set_weight_limit ( uint32  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 1245 of file inventory.c.

void Sound2Cmd ( unsigned char *  data,
int  len 
)

Definition at line 151 of file sound.c.

void SoundCmd ( unsigned char *  data,
int  len 
)

?

Parameters:
data
len

Definition at line 130 of file sound.c.

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:

void stats_get_styles ( void  )

Gets the style information for the stat bars (only portion of the window right now that has custom style support.

Definition at line 139 of file stats.c.

References bar_colors, has_init, LOG(), LOG_INFO, MAX_BUF, MAX_STAT_BARS, NUM_STYLES, stat_bar, stat_bar_names, and stat_style_names.

Referenced by load_theme(), and stats_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void stats_init ( GtkWidget *  window_root)
void update_spell_information ( void  )
void update_stat ( int  stat_no,
sint64  max_stat,
sint64  current_stat,
sint64  statbar_max,
sint64  statbar_stat,
const char *  name,
int  can_alert 
)

Updates the stat bar and text display as it pertains to a specific stat.

Parameters:
stat_noThe stat number to update.
max_statThe normal maximum value this stat can have. Note that within game terms, the actual value can go above this via supercharging stats.
current_statcurrent value of the stat.
statbar_max
statbar_statthis is the stat value to use for drawing the statbar. For most stats, this is same as current stat, but for the exp bar, we basically want it to be a graph relative to amount for next level.
namePrintable name of the stat.
can_alertWhether this stat can go on alert when it gets low. It doesn't make sense for this to happen on exp (not really an alert if you gain a level). Note: This is no longer used with the new style code - if a stat shouldn't ever change color when it is low, the style should dictate that.

Definition at line 292 of file stats.c.

References bar_colors, CONFIG_GRAD_COLOR, lastmax, lastval, stat_bar, stat_label, STYLE_GRAD_LOW, STYLE_GRAD_NORMAL, STYLE_GRAD_SUPER, STYLE_LOW, STYLE_NORMAL, STYLE_SUPER, and use_config.

Referenced by draw_message_window().

Here is the caller graph for this function: