Crossfire Client, Branch  R11627
Functions
x11proto.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 allocate_colors (Display *disp, Window w, long screen_num, Colormap *colormap, XColor discolor[16])
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 (const char *params)
void check_x_events (void)
void cleanup_connection (void)
 Called from disconnect command - that closes the socket - we just need to do the gtk cleanup.
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 configure_keys (KeyCode k, KeySym keysym)
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 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 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_lists (void)
 Redraws inventory and look windows when necessary.
void draw_magic_map (void)
 Draws the magic map - basically, it is just a simple encoding of space X is color C.
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_stats (int redraw)
 Draws the stats window.
void end_windows (void)
int error_handler (Display *dp, XErrorEvent *xe)
void event_loop (void)
 event loop iteration stuff
int find_face_in_private_cache (char *face, int checksum)
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)
char * get_metaserver (void)
 Constructs the metaserver dialog and handles metaserver selection.
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 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_keys (void)
int init_pngx_loader (Display *display)
int init_sounds (void)
 Opens the audio device, and reads relevant configuration files.
int init_windows (int argc, char **argv)
void item_event_container_clearing (item *container)
void item_event_item_changed (item *it)
void item_event_item_deleting (item *it)
void load_defaults (void)
 This function processes the user saved settings file and establishes the configuration of the client.
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 menu_clear (void)
 Clears all the message panels.
void MusicCmd (const char *data, int len)
void open_container (item *op)
void parse_key (char key, KeyCode keycode, KeySym keysym, int repeated)
void parse_key_release (KeyCode kc, KeySym ks)
void parse_keybind_line (char *buf, int line, int standard)
uint8png_to_data (uint8 *data, int len, uint32 *width, uint32 *height)
int png_to_xpixmap (Display *display, Drawable draw, unsigned char *data, int len, Pixmap *pix, Pixmap *mask, Colormap *cmap, unsigned long *width, unsigned long *height)
long pngx_find_color (Display *display, Colormap *cmap, int red, int green, int blue)
void redisplay_stats (void)
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_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_xpixmap (Display *display, Drawable draw, uint8 *pixels, Pixmap *pix, Pixmap *mask, Colormap *cmap, unsigned long width, unsigned long height)
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 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_weight_limit (uint32 wlim)
 No reason to divide by 1000 everytime we do the display, so do it once and store it here.
void set_window_pos (void)
void signal_pipe (int i)
void Sound2Cmd (unsigned char *data, int len)
void SoundCmd (unsigned char *data, int len)
 ?
void unbind_key (const char *params)
void write_ch (char key)
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.

References pixmaps, and PixmapInfo::smooth_face.

void allocate_colors ( Display *  disp,
Window  w,
long  screen_num,
Colormap *  colormap,
XColor  discolor[16] 
)

Definition at line 172 of file xutil.c.

References colorname.

Referenced by get_game_display(), and get_root_display().

Here is the caller graph for this function:

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.

References Cache_Entry::image_data, and pixmaps.

void bind_key ( const char *  params)
void check_x_events ( void  )
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.

References cleanup_textmanagers(), and csocket_fd.

Here is the call 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.

References no_recurse, num_pickups, pickup_count, pickup_mode, pmode, and PU_RATIO.

void client_tick ( uint32  tick)

X11 client doesn't care about this.

Definition at line 4510 of file gx11.c.

References CFG_DM_SDL, CONFIG_DISPLAYMODE, draw_map(), gtk_draw_map(), inventory_tick(), mapdata_animation(), sdl_gen_map(), and use_config.

Here is the call graph for this function:

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.

References Player_Struct::below, client_send_apply(), closebutton, CONFIG_APPLY_CONTAINER, cpl, draw_list(), draw_lists(), itemlist::env, FALSE, set_look_list_env(), item_struct::tag, itemlist::title, update_list_labels(), and use_config.

Here is the call graph for this function:

void command_show ( const char *  params)
void configure_keys ( KeyCode  k,
KeySym  keysym 
)
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.

References BPP, CFG_DM_OPENGL, CFG_DM_PIXMAP, CFG_DM_SDL, colormap, CONFIG_DISPLAYMODE, CONFIG_ICONSCALE, CONFIG_MAPSCALE, create_icon_image(), create_map_image(), DEFAULT_IMAGE_SIZE, display, free_pixmap(), PixmapInfo::height, height, PixmapInfo::icon_height, PixmapInfo::icon_image, PixmapInfo::icon_mask, icon_rescale_factor, PixmapInfo::icon_width, Cache_Entry::image_data, image_size, PixmapInfo::map_height, PixmapInfo::map_image, PixmapInfo::map_mask, PixmapInfo::map_width, PixmapInfo::mask, mask, MAX_ICON_SPACES, MAXPIXMAPNUM, PixmapInfo::pixmap, pixmap, pixmaps, redraw_needed, rescale_rgba_data(), rgba_to_xpixmap(), use_config, PixmapInfo::width, width, and win_game.

Here is the call 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.

References Map::cells, CFG_DM_SDL, CONFIG_DISPLAYMODE, CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, cpl, display, display_mapcell(), gc_floor, gtk_draw_map(), magic_map_flash_pos(), map_updated, MapCell::need_update, pl_pos, redraw_needed, sdl_gen_map(), Player_Struct::showmagic, the_map, TRUE, updatelock, use_config, PlayerPosition::x, and PlayerPosition::y.

Here is the call graph for this function:

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.

References reset_map().

Here is the call graph for this function:

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.

References CFG_DM_SDL, CONFIG_DISPLAYMODE, CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, display, gc_copy, image_size, sdl_mapscroll(), use_config, and win_game.

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.

References draw_info().

Here is the call graph for this function:

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.

References Info_Pane::adjustment, InfoData::bar_pos, InfoLine::color, Command_Mode, CONFIG_SPLITINFO, CONFIG_TIMESTAMP, CONFIG_TRIMINFO, cpl, InfoData::data, discolor, display, draw_info(), draw_info_freeze1, draw_info_freeze2, draw_info_scrollbar(), FALSE, FONTHEIGHT, FONTWIDTH, InfoData::gc_info, gtkwin_info_text, gtkwin_info_text2, InfoData::has_scrollbar, InfoLine::info, info1_max_chars, info1_num_chars, info2_max_chars, info2_num_chars, InfoData::info_chars, info_pane, InfoData::infoline, InfoData::infopos, Player_Struct::input_state, Player_Struct::input_text, last_str, InfoData::lastcolor, LOG(), LOG_INFO, InfoData::maxdisp, InfoData::maxlines, MIN, NDI_BLACK, NDI_GREY, NDI_WHITE, InfoData::numlines, Reply_Many, root_color, InfoData::scroll_info_window, TRUE, use_config, and InfoData::win_info.

Here is the call graph for this function:

void draw_lists ( void  )

Redraws inventory and look windows when necessary.

Definition at line 1029 of file inventory.c.

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

Here is the call 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.

References closebutton, cpl, discolor, display, draw_info(), FACE_COLOR_MASK, FALSE, gc_game, gtkwin_magicmap, LOG(), LOG_WARNING, magic_map, magic_map_gc, MAGIC_MAP_PAGE, magicgdkpixmap, Player_Struct::magicmap, map_color, map_notebook, mapvbox, Player_Struct::mapxres, Player_Struct::mapyres, Player_Struct::mmapx, Player_Struct::mmapy, NDI_BLACK, root_color, TRUE, and win_game.

Here is the call graph for this function:

void draw_message_window ( int  redraw)
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.

References StatWindow::ac, Stat_struct::ac, StatWindow::armor, StatWindow::Cha, Stat_struct::Cha, StatWindow::Con, Stat_struct::Con, CONFIG_FOODBEEP, cpl, csocket, StatWindow::dam, Stat_struct::dam, StatWindow::Dex, Stat_struct::Dex, display, StatWindow::exp, Stat_struct::exp, FLOAT_MULTF, StatWindow::food, Stat_struct::food, gc_stats, StatWindow::gr, Stat_struct::grace, StatWindow::hp, Stat_struct::hp, StatWindow::Int, Stat_struct::Int, last_stats, last_used_skills, StatWindow::level, Stat_struct::level, MAX_BUF, MAX_SKILL, Stat_struct::maxgrace, Stat_struct::maxhp, Stat_struct::maxsp, NameMapping::name, need_mapping_update, NUM_RESISTS, StatWindow::playername, StatWindow::Pow, Stat_struct::Pow, PROTECTION_BOXES_X, PROTECTION_BOXES_Y, StatWindow::range, Player_Struct::range, Stat_struct::resist_change, StatWindow::resists, Stat_struct::resists, ClientSocket::sc_version, StatWindow::score, StatWindow::skill, StatWindow::skill_exp, Stat_struct::skill_exp, Stat_struct::skill_level, skill_names, StatWindow::sp, Stat_struct::sp, StatWindow::speed, Stat_struct::speed, Player_Struct::stats, StatWindow::Str, Stat_struct::Str, Player_Struct::title, update_stat_mapping(), updatelock, use_config, NameMapping::value, StatWindow::wc, Stat_struct::wc, Stat_struct::weapon_sp, StatWindow::weapon_speed, win_stats, StatWindow::Wis, and Stat_struct::Wis.

Here is the call graph for this function:

void end_windows ( void  )
int error_handler ( Display *  dp,
XErrorEvent *  xe 
)

Definition at line 286 of file x11.c.

References MAX_BUF.

Referenced by get_root_display().

Here is the caller graph for this function:

void event_loop ( void  )

event loop iteration stuff

Definition at line 234 of file main.c.

References animate_objects(), check_x_events(), csocket, csocket_fd, do_network(), do_timeout(), DoClient(), ClientSocket::fd, LOG(), LOG_INFO, MAX_TIME, maxfd, script_fdset(), script_process(), and timeout.

Here is the call graph for this function:

int find_face_in_private_cache ( char *  face,
int  checksum 
)

Definition at line 1135 of file xutil.c.

References last_face_num, name, and private_cache.

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.

References InfoData::info_chars.

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

Definition at line 459 of file image.c.

References PixmapInfo::height, PixmapInfo::map_height, map_image_size, PixmapInfo::map_width, MAXPIXMAPNUM, pixmaps, and PixmapInfo::width.

char* get_metaserver ( void  )
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.

References draw_info(), FALSE, get_window_coord(), gtkwin_root, MAX_BUF, NDI_BLUE, padj, pbar, pbar_window, TRUE, and window_root.

Here is the call 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.

References CFG_DM_OPENGL, CFG_DM_PIXMAP, CFG_DM_SDL, CONFIG_DISPLAYMODE, create_opengl_question_mark(), display, gc_game, PixmapInfo::height, PixmapInfo::icon_image, PixmapInfo::icon_mask, image_size, init_common_cache_data(), LOG(), LOG_INFO, map_image_size, PixmapInfo::mask, MAXPIXMAPNUM, PixmapInfo::pixmap, pixmap, pixmaps, use_config, PixmapInfo::width, win_root, and window_root.

Here is the call graph for this function:

void init_keys ( void  )
int init_pngx_loader ( Display *  display)

Definition at line 482 of file png.c.

References bmask, bshift, color_values, colormap_size, gmask, gshift, MAX_IMAGE_SIZE, need_color_alloc, rev_bshift, rev_gshift, rev_rshift, rmask, rshift, and ximage.

Referenced by get_root_display().

Here is the caller graph for this function:

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.

References sound_settings::audiodev, sound_settings::bit8, bit8, sound_settings::buffers, buffers, sound_settings::buflen, CHILD_STDERR, CHILD_STDIN, CHILD_STDOUT, CONFIG_SOUND, Sound_Info::data, def_sounds, Sound_Info::filename, frequency, sound_settings::frequency, init_audio(), LOG(), LOG_ERROR, LOG_INFO, logChildPipe(), MAX_BUF, MAX_SOUNDS, parse_sound_line(), raiseChild(), sample_size, settings, sign, sound_settings::sign, signal_pipe(), Sound_Info::size, sound_pipe, sound_server, sounds_in_buffer, stereo, sound_settings::stereo, ChildProcess::tube, Sound_Info::volume, want_config, and zerolevel.

Here is the call graph for this function:

int init_windows ( int  argc,
char **  argv 
)
void item_event_container_clearing ( item container)

Definition at line 525 of file inventory.c.

References container_clearing_one(), and views.

Here is the call graph for this function:

void item_event_item_changed ( item it)

Definition at line 489 of file inventory.c.

References can_write_spell_on(), item_changed_anim_hook(), item_changed_one(), spellinventory, and views.

Here is the call graph for this function:

Definition at line 596 of file inventory.c.

References can_write_spell_on(), item_deleting_one(), item_to_widget_remove_item(), spellinventory, and views.

Here is the call graph for this function:

void load_defaults ( void  )
void magic_map_flash_pos ( void  )
int main ( int  argc,
char *  argv[] 
)

The client entry point.

Parameters:
argc
argv
Returns:

Definition at line 5546 of file gx11.c.

References audio_play(), Player_Struct::below, SockList::buf, sound_settings::buffers, buffers, sound_settings::buflen, cached_server_file, clear_stat_mapping(), colorname, config_init(), CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, CONFIG_POPUPS, CONFIG_PORT, CONFIG_SOUND, cpl, ClientSocket::cs_version, csocket, current_buffer, dialog_xml, dialog_xml_file, dialog_xml_path, display_map_doneupdate(), draw_info_windows(), draw_look_list(), draw_splash(), enable_menu_items(), itemlist::env, err, error_dialog(), event_loop(), FALSE, ClientSocket::fd, first_free_buffer, get_metaserver(), gLogHandler(), gtkLogListener(), handle, ClientSocket::inbuf, info_init(), init_cache_data(), init_client_vars(), init_connection(), init_sounds(), init_text_callbacks(), init_windows(), inventory_init(), keyfunc(), keyrelfunc(), keys_init(), SockList::len, load_theme(), load_window_positions(), locate_item(), LOG(), LOG_CRITICAL, magic_map, map_init(), mapdata_reset(), MAX_BUF, maxfd, MAXSOCKBUF, meta_port, meta_server, metaserver_get_info(), metaserver_select(), metaserver_show(), negotiate_connection(), NUM_COLORS, Player_Struct::ob, on_drawingarea_magic_map_expose_event(), on_window_destroy_event(), parse_args(), pickup_init(), rcsid_cfsndserv_c, read_settings(), remove_item_inventory(), reset_client_vars(), reset_image_data(), root_color, server, set_look_list_env(), setLogListener(), settings, sigpipe_handler(), sndbuf_pos, SoundCmd(), soundfd, sounds_in_buffer, stats_init(), TRUE, use_config, want_config, window_root, window_xml, window_xml_file, window_xml_path, write_settings(), XML_PATH_DEFAULT, and zerolevel.

Here is the call 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.

References draw_info(), gtkwin_info_text, gtkwin_info_text2, info_pane, NDI_BLACK, and NUM_TEXT_VIEWS.

Here is the call graph for this function:

void MusicCmd ( const char *  data,
int  len 
)

Definition at line 199 of file sound.c.

References LOG(), and LOG_WARNING.

Here is the call graph for this function:

void open_container ( item op)
Parameters:
op

Definition at line 1334 of file inventory.c.

References closebutton, item_struct::d_name, draw_list(), draw_lists(), itemlist::env, set_look_list_env(), itemlist::title, TRUE, and update_list_labels().

Here is the call graph for this function:

void parse_key ( char  key,
KeyCode  keycode,
KeySym  keysym,
int  repeated 
)
void parse_key_release ( KeyCode  kc,
KeySym  ks 
)
void parse_keybind_line ( char *  buf,
int  line,
int  standard 
)
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.

References data_cp, data_len, data_start, height, LOG(), LOG_CRITICAL, and user_read_data().

Here is the call graph for this function:

int png_to_xpixmap ( Display *  display,
Drawable  draw,
unsigned char *  data,
int  len,
Pixmap *  pix,
Pixmap *  mask,
Colormap *  cmap,
unsigned long *  width,
unsigned long *  height 
)

Definition at line 573 of file png.c.

References bmask, bshift, data_cp, data_len, data_start, gmask, gshift, height, need_color_alloc, PNGX_DATA, pngx_find_color(), PNGX_OUTOFMEM, rev_bshift, rev_gshift, rev_rshift, rmask, rshift, user_read_data(), width, and ximage.

Here is the call graph for this function:

long pngx_find_color ( Display *  display,
Colormap *  cmap,
int  red,
int  green,
int  blue 
)
void redisplay_stats ( void  )

Definition at line 3165 of file x11.c.

References display, gc_stats, stats_buff, and win_stats.

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.

References BPP, LOG(), LOG_CRITICAL, MAX_IMAGE_HEIGHT, MAX_IMAGE_WIDTH, RATIO, and width.

Here is the call graph for this function:

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.

References Player_Struct::below, CONFIG_CACHE, cpl, display, itemlist::env, free_pixmap(), mask, MAXPIXMAPNUM, pixmap, pixmaps, reset_image_cache_data(), and want_config.

Here is the call graph for this function:

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.

References bigmap, CFG_DM_SDL, CONFIG_DISPLAYMODE, CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, CONFIG_SPLITWIN, display, draw_map(), drawingarea, FALSE, game_bar_vpane, gameframe, gtkwin_root, height, image_size, init_SDL(), map_drawing_area, map_image_size, message_frame, old_mapx, old_mapy, stat_frame, stat_game_vpane, TRUE, use_config, want_config, width, win_game, and win_root.

Here is the call graph for this function:

int rgba_to_xpixmap ( Display *  display,
Drawable  draw,
uint8 pixels,
Pixmap *  pix,
Pixmap *  mask,
Colormap *  cmap,
unsigned long  width,
unsigned long  height 
)

Definition at line 811 of file png.c.

References bmask, bshift, gmask, gshift, height, need_color_alloc, pngx_find_color(), rev_bshift, rev_gshift, rev_rshift, rmask, rshift, width, and ximage.

Referenced by create_and_rescale_image_from_data().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Definition at line 4804 of file gx11.c.

References CONFIG_SPLITINFO, CONFIG_SPLITWIN, draw_info(), game_bar_vpane, get_window_coord(), gtkwin_info, gtkwin_inv, gtkwin_look, gtkwin_message, gtkwin_root, gtkwin_stats, info_vpane, inv_hpane, inv_look_vpane, MAX_BUF, NDI_BLUE, NDI_RED, stat_game_vpane, stat_info_hpane, use_config, want_config, itemlist::win, win_game, InfoData::win_info, win_message, win_stats, window_root, and window_xml_file.

Here is the call graph for this function:

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.

References draw_info(), FALSE, NDI_BLACK, noautorepeat, and TRUE.

Here is the call graph for this function:

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.

References draw_all_info(), draw_info(), InfoData::infoline, InfoData::maxdisp, NDI_BLACK, InfoData::numlines, and InfoData::scroll_info_window.

Here is the call graph for this function:

void set_show_icon ( const char *  s)
Parameters:
s

Definition at line 1303 of file inventory.c.

References itemlist::height, itemlist_set_show_icon(), resize_list_info(), itemlist::show_icon, and itemlist::width.

Here is the call graph for this function:

void set_show_weight ( const char *  s)
Parameters:
s

Definition at line 1258 of file inventory.c.

References draw_list(), inv_viewers, inventory_viewer_set_show_weight(), set_show_weight_inv_one(), itemlist::show_weight, and update_list_labels().

Here is the call 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.

References update_list_labels(), weight_limit, and itemlist::weight_limit.

Here is the call graph for this function:

void set_window_pos ( void  )
void signal_pipe ( int  i)

Definition at line 45 of file sound.c.

void Sound2Cmd ( unsigned char *  data,
int  len 
)

Definition at line 151 of file sound.c.

References LOG(), LOG_WARNING, and name.

Here is the call graph for this function:

void SoundCmd ( unsigned char *  data,
int  len 
)

?

Parameters:
data
len

Definition at line 130 of file sound.c.

References GetShort_String(), LOG(), LOG_WARNING, and play_sound().

Here is the call graph for this function:

void write_ch ( char  key)