Crossfire Client, Branch
R11627
|
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. | |
uint8 * | png_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) |
uint8 * | rescale_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) |
Referenced from common/commands.c.
face | |
smooth_face |
void animate_inventory | ( | void | ) |
Definition at line 1097 of file inventory.c.
References item_struct::anim_speed, item_struct::anim_state, item_struct::animation_id, animations, draw_inv_table(), item_struct::face, Animations::faces, PixmapInfo::icon_image, inv_notebook, INV_TABLE, item_struct::last_anim, LIST_ICON, LIST_OBJECT, Animations::num_animations, pixmaps, tick, and Notebook_Info::treestore.
Referenced by inventory_tick().
void animate_look | ( | void | ) |
Definition at line 1165 of file inventory.c.
References item_struct::anim_speed, item_struct::anim_state, item_struct::animation_id, animations, item_struct::face, Animations::faces, PixmapInfo::icon_image, item_struct::last_anim, LIST_ICON, LIST_OBJECT, Animations::num_animations, pixmaps, store_look, and tick.
Referenced by inventory_tick().
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.
void cleanup_connection | ( | void | ) |
void clear_stat_mapping | ( | void | ) |
Definition at line 725 of file stats.c.
References need_mapping_update.
Referenced by main().
void client_pickup | ( | uint32 | pickup | ) |
void client_tick | ( | uint32 | tick | ) |
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.
op |
Definition at line 1342 of file inventory.c.
void command_show | ( | const char * | params | ) |
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().
int create_and_rescale_image_from_data | ( | Cache_Entry * | ce, |
int | pixmap_num, | ||
uint8 * | rgba_data, | ||
int | width, | ||
int | height | ||
) |
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.
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.
redraw | If set, force redraw of all tiles. |
notice | If set, another call will follow soon. |
Do the map drawing.
If notice is set, another call will follow soon.
void display_map_newmap | ( | void | ) |
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.
int display_mapscroll | ( | int | dx, |
int | dy | ||
) |
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.
int do_timeout | ( | void | ) |
Map, spell, and inventory maintenance.
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.
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.
colr | The color to use when displaying text. |
buf | The text to display. |
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?.
str | Pointer to displayable text. |
color | Color of the text. |
void draw_inv | ( | int | tab | ) |
Draws the inventory.
Have to determine how to draw it.
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().
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.
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().
void draw_inv_table | ( | int | animate | ) |
Draws the table of image icons.
animate | If 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().
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().
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().
void draw_magic_map | ( | void | ) |
void draw_map | ( | int | redraw | ) |
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().
void draw_message_window | ( | int | redraw | ) |
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().
void draw_stats | ( | int | redraw | ) |
gboolean drawingarea_inventory_table_button_press_event | ( | GtkWidget * | widget, |
GdkEventButton * | event, | ||
gpointer | user_data | ||
) |
widget | |
event | |
user_data |
Definition at line 811 of file inventory.c.
References list_item_action(), and TRUE.
Referenced by draw_inv_table().
gboolean drawingarea_inventory_table_expose_event | ( | GtkWidget * | widget, |
GdkEventExpose * | event, | ||
gpointer | user_data | ||
) |
widget | |
event | |
user_data |
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().
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.
mx | |
my | Square to smooth on. You should not call this function to smooth on a 'completely black' square. |
layer | Layer to examine (we smooth only one layer at a time) |
picx | |
picy | Place 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.
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.
enable | If 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().
void event_loop | ( | void | ) |
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.
void get_map_image_size | ( | int | face, |
uint8 * | w, | ||
uint8 * | h | ||
) |
void get_metaserver | ( | void | ) |
void get_window_coord | ( | GtkWidget * | win, |
int * | x, | ||
int * | y, | ||
int * | wx, | ||
int * | wy, | ||
int * | w, | ||
int * | h | ||
) |
void gtk_draw_map | ( | int | redraw | ) |
redraw |
Definition at line 337 of file map.c.
References Map::cells, CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, display_mapcell(), drawingarea, LOG(), LOG_INFO, map_image_size, map_updated, mapwindow, MapCell::need_resmooth, MapCell::need_update, the_map, time_map_redraw, use_config, Map::x, PlayerPosition::x, Map::y, and PlayerPosition::y.
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.
start | The start value just sent to the server. |
end | |
total | The total number of images. |
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().
void info_init | ( | GtkWidget * | window_root | ) |
Initialize the information panels in the client.
These panels are the client areas where text is drawn.
window_root | Parent (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().
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.
void init_glx_opengl | ( | GtkWidget * | drawingarea | ) |
void init_opengl | ( | GtkWidget * | drawingarea | ) |
void init_SDL | ( | GtkWidget * | sdl_window, |
int | just_lightmap | ||
) |
int init_sounds | ( | void | ) |
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().
void inventory_init | ( | GtkWidget * | window_root | ) |
Set up the inventory viewer.
window_root | The 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().
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().
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.
void item_event_item_deleting | ( | item * | it | ) |
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.
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().
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.
selection | |
model | |
path | |
path_currently_selected | |
userdata |
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().
void load_defaults | ( | void | ) |
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.
reload | If 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().
void load_window_positions | ( | GtkWidget * | window_root | ) |
Retrieves saved window positions saved with the Client | Save Window Position menu item.
window_root | The 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().
void magic_map_flash_pos | ( | void | ) |
int main | ( | int | argc, |
char * | argv[] | ||
) |
void map_init | ( | GtkWidget * | window_root | ) |
This initializes the stuff we need for the map.
window_root | The 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().
void menu_about | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Instantiates and displays the client's about box dialog.
menuitem | The 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().
void menu_clear | ( | void | ) |
void menu_quit_character | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
File | Quit Character Causes the client to ask the server to delete the current character.
menuitem | |
user_data |
Definition at line 106 of file menubar.c.
References extended_command().
Referenced by enable_menu_items().
void menu_quit_program | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
File | Quit Shuts down the client application.
menuitem | |
user_data |
Definition at line 86 of file menubar.c.
References LOG(), and LOG_INFO.
Referenced by enable_menu_items().
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.
selection | |
model | |
path | |
path_currently_selected | |
userdata |
Definition at line 66 of file metaserver.c.
References metaserver_button, metaserver_entry, and TRUE.
Referenced by get_metaserver().
void on_about_close_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
Closes and hides the client's about box dialog.
button | The about dialog's close button. |
user_data |
Definition at line 122 of file about.c.
References about_window.
Referenced by menu_about().
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.
button | |
user_data |
Definition at line 388 of file metaserver.c.
Referenced by get_metaserver().
void on_config_button_apply_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
Defines the behavior invoked when the configuration dialog apply button is pressed.
button | |
user_data |
Definition at line 941 of file config.c.
References read_config_window().
Referenced by config_init().
void on_config_button_close_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
Defines the behavior invoked when the configuration dialog close button is pressed.
button | |
user_data |
Definition at line 955 of file config.c.
Referenced by config_init().
void on_config_button_save_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
Defines the behavior invoked when the configuration dialog save button is pressed.
button | |
user_data |
Definition at line 926 of file config.c.
References read_config_window(), and save_defaults().
Referenced by config_init().
void on_configure_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Defines the behavior invoked when the configuration dialog is activated.
menuitem | |
user_data |
Definition at line 968 of file config.c.
References setup_config_window().
Referenced by enable_menu_items().
gboolean on_drawingarea_magic_map_expose_event | ( | GtkWidget * | widget, |
GdkEventExpose * | event, | ||
gpointer | user_data | ||
) |
widget | |
event | |
user_data |
Definition at line 154 of file magicmap.c.
References draw_magic_map(), and FALSE.
Referenced by main().
gboolean on_drawingarea_map_button_press_event | ( | GtkWidget * | widget, |
GdkEventButton * | event, | ||
gpointer | user_data | ||
) |
widget | |
event | |
user_data |
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().
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().
gboolean on_drawingarea_map_expose_event | ( | GtkWidget * | widget, |
GdkEventExpose * | event, | ||
gpointer | user_data | ||
) |
widget | |
event | |
user_data |
Definition at line 678 of file map.c.
References draw_map(), FALSE, and TRUE.
Referenced by map_init().
gboolean on_inv_table_expose_event | ( | GtkWidget * | widget, |
GdkEventExpose * | event, | ||
gpointer | user_data | ||
) |
widget | |
event | |
user_data |
Definition at line 1086 of file inventory.c.
References draw_inv_table(), and TRUE.
Referenced by inventory_init().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
void on_menu_ratio_30_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
Definition at line 365 of file pickup.c.
References new_menu_pickup().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
void on_metaserver_select_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
Establish a connection with the server when pressing the connect button.
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().
void on_metaserver_text_entry_activate | ( | GtkEntry * | entry, |
gpointer | user_data | ||
) |
This callback handles the user entering text into the metaserver freeform entry box.
entry | |
user_data |
Definition at line 370 of file metaserver.c.
References metaserver_connect_to().
Referenced by get_metaserver().
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.
widget | |
event | |
user_data |
Definition at line 408 of file metaserver.c.
References FALSE, metaserver_button, metaserver_selection, and TRUE.
Referenced by get_metaserver().
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
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().
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.
menuitem | |
user_data |
Definition at line 1048 of file config.c.
References save_winpos().
Referenced by enable_menu_items().
void on_spell_cast_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
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().
void on_spell_close_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) |
button | |
user_data |
Definition at line 456 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 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().
void on_spell_treeview_row_activated | ( | GtkTreeView * | treeview, |
GtkTreePath * | path, | ||
GtkTreeViewColumn * | column, | ||
gpointer | user_data | ||
) |
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().
void on_spells_activate | ( | GtkMenuItem * | menuitem, |
gpointer | user_data | ||
) |
menuitem | |
user_data |
Definition at line 198 of file spells.c.
References dialog_xml, FALSE, has_init, LIST_BACKGROUND, LIST_COST, LIST_DAMAGE, LIST_DESCRIPTION, LIST_FONT, LIST_FOREGROUND, 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(), 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, TRUE, and update_spell_information().
Referenced by enable_menu_items().
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.
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().
void on_window_destroy_event | ( | GtkObject * | object, |
gpointer | user_data | ||
) |
void open_container | ( | item * | op | ) |
op |
Definition at line 1334 of file inventory.c.
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.
argc | |
argv |
Definition at line 350 of file main.c.
References CFG_DM_OPENGL, CFG_DM_PIXMAP, CFG_DM_SDL, CONFIG_CACHE, CONFIG_DARKNESS, CONFIG_DISPLAYMODE, CONFIG_DOWNLOAD, CONFIG_ECHO, CONFIG_FASTTCP, CONFIG_FOGWAR, CONFIG_ICONSCALE, CONFIG_MAPHEIGHT, CONFIG_MAPSCALE, CONFIG_MAPWIDTH, CONFIG_NUMS, CONFIG_PORT, CONFIG_RESISTS, CONFIG_SHOWICON, CONFIG_SMOOTH, CONFIG_SOUND, CONFIG_SPLASH, CONFIG_SPLITINFO, CONFIG_SPLITWIN, CONFIG_TRIMINFO, DEFAULT_IMAGE_SIZE, dialog_xml_path, face_info, FALSE, FULL_VERSION, image_size, load_defaults(), LOG(), LOG_INFO, LOG_WARNING, map_image_half_size, map_image_size, MAP_MAX_SIZE, mapdata_init(), MAX_BUF, MINLOG, server, sound_server, time_map_redraw, TRUE, updatekeycodes, usage(), use_config, VERSION_INFO, want_config, Face_Information_struct::want_faceset, want_skill_exp, and window_xml_path.
Referenced by main().
void pickup_init | ( | GtkWidget * | window_root | ) |
Maps the menuitem lists into pickup values.
In this way, client_pickup knows what values to change.
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().
uint8* png_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 | ||
) |
*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.
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:
*data | PNG data - this is any 4 byte per pixel data, in RGBA format. |
*width | Source width modified to contain the new image size. |
*height | Source height modified to contain the new image size. |
scale | Percentage 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. |
void reset_image_data | ( | void | ) |
void reset_map | ( | void | ) |
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.
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.
*data | |
width | |
height | |
**pix |
Definition at line 500 of file png.c.
References height, TRUE, and width.
Referenced by create_icon_image().
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.
*window | |
*data | |
width | |
height | |
**pix | |
**mask | |
*colormap |
void save_defaults | ( | void | ) |
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.
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)
s |
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)
s |
void set_show_icon | ( | const char * | s | ) |
s |
Definition at line 1303 of file inventory.c.
void set_show_weight | ( | const char * | s | ) |
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.
tag | text tag to set values on |
style | style to get values from |
base_style | base style for the widget to compare against |
Definition at line 133 of file info.c.
References FALSE.
Referenced by info_get_styles().
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.
wlim |
Definition at line 1245 of file inventory.c.
void SoundCmd | ( | unsigned char * | data, |
int | len | ||
) |
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().
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().
void stats_init | ( | GtkWidget * | window_root | ) |
*window_root |
Definition at line 176 of file stats.c.
References StatWindow::ac, StatWindow::armor, StatWindow::Cha, StatWindow::Con, StatWindow::dam, StatWindow::Dex, StatWindow::exp, StatWindow::Int, lastmax, lastval, StatWindow::level, MAX_BUF, MAX_STAT_BARS, StatWindow::playername, StatWindow::Pow, PROTECTION_BOXES_X, PROTECTION_BOXES_Y, StatWindow::range, StatWindow::resists, SKILL_BOXES_X, SKILL_BOXES_Y, StatWindow::skill_exp, StatWindow::speed, stat_bar, stat_bar_names, stat_label, stats_get_styles(), StatWindow::Str, StatWindow::table_protections, StatWindow::table_skills_exp, StatWindow::wc, StatWindow::weapon_speed, and StatWindow::Wis.
Referenced by main().
void update_spell_information | ( | void | ) |
Definition at line 119 of file spells.c.
References Stat_struct::attuned, background, cpl, Spell_struct::dam, Stat_struct::denied, font, foreground, Spell_struct::grace, has_init, Spell_struct::level, LIST_BACKGROUND, LIST_COST, LIST_DAMAGE, LIST_DESCRIPTION, LIST_FONT, LIST_FOREGROUND, 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, 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, Spell_struct::tag, and text.
Referenced by do_timeout(), load_theme(), and on_spells_activate().
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.
stat_no | The stat number to update. |
max_stat | The normal maximum value this stat can have. Note that within game terms, the actual value can go above this via supercharging stats. |
current_stat | current value of the stat. |
statbar_max | |
statbar_stat | this 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. |
name | Printable name of the stat. |
can_alert | Whether 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().