Crossfire Client, Branch  R11627
Data Structures | Defines | Typedefs | Enumerations | Functions | Variables
x11.c File Reference
#include <client.h>
#include "clientbmap.h"
#include <item.h>
#include <config.h>
#include <script.h>
#include <p_cmd.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "mapdata.h"
#include "x11proto.h"
#include "x11.h"
#include <errno.h>
#include "pixmaps/clear.xbm"
#include "pixmaps/locked.xbm"
#include "pixmaps/applied.xbm"
#include "pixmaps/unpaid.xbm"
#include "pixmaps/damned.xbm"
#include "pixmaps/cursed.xbm"
#include "pixmaps/magic.xbm"
#include "pixmaps/close.xbm"
#include "pixmaps/stipple.111"
#include "pixmaps/stipple.112"
Include dependency graph for x11.c:

Go to the source code of this file.

Data Structures

struct  InfoData
struct  InfoLine
struct  itemlist

Defines

#define CREATEPM(name, data)
#define GAME_WIDTH   (image_size * use_config[CONFIG_MAPWIDTH] + 5)
#define INFOCHARS   50
#define INFOCHARS   50
#define INFOLINES   36
#define INV_WIDTH   300
#define MAX_BARS_MESSAGE   80
#define MAX_INFO_WIDTH   80
#define MAXNAMELENGTH   50
#define ROOT_HEIGHT   522
#define SCROLLBAR_WIDTH   16 /* +2+2 for border on each side */
#define STAT_HEIGHT   140
#define WINDOW_SPACING   3
#define X_PROG_NAME   "cfclient"
#define XPMGCS   100

Typedefs

typedef enum inventory_show inventory_show

Enumerations

enum  {
  no_icon = 0, locked_icon, applied_icon, unpaid_icon,
  damned_icon, cursed_icon, magic_icon, close_icon,
  stipple1_icon, stipple2_icon, max_icons
}
enum  inventory_show {
  show_all = 0, show_applied = 0x1, show_unapplied = 0x2, show_unpaid = 0x4,
  show_cursed = 0x8, show_magical = 0x10, show_nonmagical = 0x20, show_locked = 0x40,
  show_unlocked = 0x80, show_mask = 0xff
}

Functions

int associate_cache_entry (Cache_Entry *ce, int pixnum)
 This functions associates image_data in the cache entry with the specific pixmap number.
static void buttonpress_in_info (XButtonEvent *xbutton)
static int buttonpress_in_list (itemlist *l, XButtonEvent *xbutton)
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 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)
static void create_status_icons (void)
static void delete_ch (void)
void display_map_doneupdate (int redraw, int notice)
 If redraw is set, force redraw of all tiles.
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.
static void display_mapcell (int ax, int ay)
int display_mapscroll (int dx, int dy)
static void do_key_press (int repeated)
static void draw_all_info (void)
static void draw_all_list (itemlist *l)
static void draw_all_message (void)
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.
static void draw_info_scrollbar (int redraw)
static void draw_list (itemlist *l)
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.
static void draw_stat_bar (int bar_pos, int height, int is_alert)
void draw_stats (int redraw)
 Draws the stats window.
static void draw_status_icon (itemlist *l, int x, int y, int face)
void end_windows (void)
int error_handler (Display *dp, XErrorEvent *xe)
void event_loop (void)
 event loop iteration stuff
static void gen_draw_face (Drawable where, int face, int x, int y, int sx, int sy)
static int get_game_display (void)
static int get_info_display (void)
int get_info_width (void)
 This is used by the common help system to determine when to wrap.
static int get_inv_display (void)
static void get_list_display (itemlist *l, int x, int y, int w, int h, const char *t, const char *s)
static int get_look_display (void)
static int get_message_display (void)
char * get_metaserver (void)
 Constructs the metaserver dialog and handles metaserver selection.
static int get_root_display (char *display_name)
static int get_stats_display (void)
static void get_window_coord (Window win, int *x, int *y, int *wx, int *wy, unsigned int *w, unsigned int *h)
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 open_container (item *op)
static void parse_game_button_press (int button, int x, int y)
void redisplay_stats (void)
void reset_image_data (void)
 Connecting to different servers, try to clear out any old images.
static void resize_list_info (itemlist *l, int w, int h)
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.
static void resize_win_info (int width, int height)
static void resize_win_message (int width, int height)
static void resize_win_root (XEvent *event)
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)
static int show_object (item *ip, inventory_show flags)
static void update_icons_list (itemlist *l)
static void usage (char *progname)
void write_ch (char key)
void x_set_echo (void)
static void xwritedown (const char *txt, int x)

Variables

static unsigned long background
Colormap colormap
static Pixmap dark1
static Pixmap dark2
static Pixmap dark3
static Window def_root
static long def_screen
static XColor discolor [16]
Display * display
static XEvent event
static XFontStruct * font
static char * font_name = "8x13"
static int FONTHEIGHT = 13
static int FONTWIDTH = 8
static unsigned long foreground
static int gargc
static char ** gargv
static GC gc_blank
static GC gc_clear_xpm
static GC gc_copy
static GC gc_floor
GC gc_game
static GC gc_message
static GC gc_root
static GC gc_stats
static GC gc_xpm [XPMGCS]
static GC gc_xpm_object
static Pixmap icon
static Pixmap icons [max_icons]
uint8 image_size = 24
static float info_ratio = 0
InfoData infodata
static itemlist inv_list
static Stats last_stats = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
static itemlist look_list
int maxfd
static XSizeHints messagehint
int misses = 0
int newimages = 0
int noautorepeat = FALSE
static int old_mapx = 11
static int old_mapy = 11
struct PixmapInfopixmaps [MAXPIXMAPNUM]
const char * rcsid_x11_x11_c = "$Id: x11.c 9201 2008-06-01 17:32:45Z anmaster $"
static XSizeHints roothint
static char stats_buff [7][600]
int sync_display = 0
int total = 0
Window win_game
Window win_message
Window win_root
Window win_stats
static Atom wm_delete_window
static Pixmap xpm_masks [XPMGCS]
static Pixmap xpm_pixmap

Define Documentation

#define CREATEPM (   name,
  data 
)
Value:
(icons[name] = XCreateBitmapFromData(display, def_root,\
                            data##_bits, data##_width, data##_height))

Referenced by create_status_icons().

#define INFOCHARS   50

Definition at line 267 of file x11.c.

Referenced by get_info_display(), and get_root_display().

#define INFOCHARS   50

Definition at line 267 of file x11.c.

#define INFOLINES   36

Definition at line 159 of file x11.c.

Referenced by get_info_display().

#define INV_WIDTH   300
#define MAX_BARS_MESSAGE   80

Definition at line 1356 of file x11.c.

Referenced by draw_all_message(), draw_message_window(), and draw_stat_bar().

#define MAX_INFO_WIDTH   80

Definition at line 163 of file x11.c.

#define MAXNAMELENGTH   50

Definition at line 164 of file x11.c.

#define ROOT_HEIGHT   522

Definition at line 180 of file x11.c.

Referenced by get_root_display().

#define SCROLLBAR_WIDTH   16 /* +2+2 for border on each side */

Definition at line 157 of file x11.c.

Referenced by buttonpress_in_info(), and draw_info_scrollbar().

#define STAT_HEIGHT   140

Definition at line 173 of file x11.c.

Referenced by get_game_display(), get_message_display(), get_stats_display(), and resize_win_root().

#define WINDOW_SPACING   3
#define X_PROG_NAME   "cfclient"

Definition at line 39 of file x11.c.

Referenced by get_game_display(), and get_root_display().

#define XPMGCS   100

Definition at line 242 of file x11.c.

Referenced by display_mapcell(), gen_draw_face(), and get_game_display().


Typedef Documentation


Enumeration Type Documentation

anonymous enum
Enumerator:
no_icon 
locked_icon 
applied_icon 
unpaid_icon 
damned_icon 
cursed_icon 
magic_icon 
close_icon 
stipple1_icon 
stipple2_icon 
max_icons 

Definition at line 244 of file x11.c.

Enumerator:
show_all 
show_applied 
show_unapplied 
show_unpaid 
show_cursed 
show_magical 
show_nonmagical 
show_locked 
show_unlocked 
show_mask 

Definition at line 103 of file x11.c.


Function Documentation

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 3159 of file x11.c.

References Cache_Entry::image_data, and pixmaps.

Referenced by finish_face_cmd().

Here is the caller graph for this function:

static void buttonpress_in_info ( XButtonEvent *  xbutton) [static]

Definition at line 2389 of file x11.c.

References InfoData::bar_length, InfoData::bar_pos, draw_all_info(), FONTHEIGHT, InfoData::has_scrollbar, InfoData::maxdisp, InfoData::numlines, SCROLLBAR_WIDTH, and InfoData::width.

Referenced by check_x_events().

Here is the call graph for this function:

Here is the caller graph for this function:

static int buttonpress_in_list ( itemlist l,
XButtonEvent *  xbutton 
) [static]
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 3536 of file x11.c.

References cleanup_textmanagers(), and csocket_fd.

Referenced by do_disconnect().

Here is the call graph for this function:

Here is the caller 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 1826 of file x11.c.

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

Referenced by item_actions().

Here is the call graph for this function:

Here is the caller graph for this function:

void command_show ( const char *  params)
static void create_status_icons ( void  ) [static]

Definition at line 1559 of file x11.c.

References applied_icon, close_icon, CREATEPM, cursed_icon, damned_icon, dark1, dark2, dark3, def_root, display, image_size, locked_icon, magic_icon, no_icon, stipple1_icon, stipple2_icon, and unpaid_icon.

Referenced by get_list_display().

Here is the caller graph for this function:

static void delete_ch ( void  ) [static]

Definition at line 552 of file x11.c.

References cpl, InfoData::data, display, FONTHEIGHT, FONTWIDTH, InfoData::gc_info, InfoLine::info, InfoData::infoline, InfoData::infopos, Player_Struct::input_text, InfoData::numlines, and InfoData::win_info.

Referenced by write_ch().

Here is the caller graph for this function:

void display_map_doneupdate ( int  redraw,
int  notice 
)

If redraw is set, force redraw of all tiles.

Do the map drawing.

If notice is set, another call will follow soon.

Definition at line 3101 of file x11.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(), MapCell::need_update, pl_pos, redraw_needed, sdl_gen_map(), Player_Struct::showmagic, the_map, TRUE, updatelock, use_config, PlayerPosition::x, and PlayerPosition::y.

Referenced by check_x_events(), configure_event(), do_key_press(), do_timeout(), expose_event(), main(), Map2Cmd(), map_scrollCmd(), MapExtendedCmd(), and toggle_splitwin().

Here is the call graph for this function:

Here is the caller 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 2986 of file x11.c.

References reset_map().

Referenced by mapdata_newmap().

Here is the call graph for this function:

Here is the caller 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 3175 of file x11.c.

Referenced by Map2Cmd(), map_scrollCmd(), and MapExtendedCmd().

Here is the caller graph for this function:

static void display_mapcell ( int  ax,
int  ay 
) [static]
int display_mapscroll ( int  dx,
int  dy 
)
Parameters:
dx
dy

Definition at line 3128 of file x11.c.

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

Referenced by mapdata_scroll().

Here is the call graph for this function:

Here is the caller graph for this function:

static void do_key_press ( int  repeated) [static]
static void draw_all_info ( void  ) [static]
static void draw_all_list ( itemlist l) [static]
static void draw_all_message ( void  ) [static]

Definition at line 1504 of file x11.c.

References display, draw_message_window(), itemlist::gc_text, MAX_BARS_MESSAGE, win_message, and xwritedown().

Referenced by check_x_events().

Here is the call graph for this function:

Here is the caller 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 925 of file x11.c.

References draw_info().

Referenced by DrawInfoCmd().

Here is the call graph for this function:

Here is the caller 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 750 of file x11.c.

References 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, 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.

Referenced by admin_callback(), bind_callback(), bind_key(), buttonpress_in_list(), command_foodbep(), command_show(), command_take(), complete_command(), configure_keys(), do_clienthelp(), do_metaserver(), draw_color_info(), draw_info(), draw_magic_map(), draw_prompt(), DrawInfoCmd(), get_image_info(), handle_local_command(), handle_query(), image_update_download_status(), init_common_cache_data(), keybinding_get_data(), list_button_event(), list_item_action(), load_window_positions(), menu_clear(), metaserver1_thread(), metaserver_select(), metaserver_show(), negotiate_connection(), new_menu_pickup(), parse_key(), parse_key_release(), print_inventory(), save_defaults(), save_keys(), save_winpos(), script_init(), script_kill(), script_list(), script_process_cmd(), script_tell(), set_autorepeat(), set_command_window(), set_scroll(), SetupCmd(), show_keys(), unbind_key(), unbind_usage(), and write_ch().

Here is the call graph for this function:

static void draw_info_scrollbar ( int  redraw) [static]
static void draw_list ( itemlist l) [static]
void draw_lists ( void  )

Redraws inventory and look windows when necessary.

Definition at line 1965 of file x11.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.

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

Here is the call graph for this function:

Here is the caller graph for this function:

void draw_magic_map ( void  )

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

Definition at line 3186 of file x11.c.

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

Referenced by check_x_events(), do_magicmap(), MagicMapCmd(), and on_drawingarea_magic_map_expose_event().

Here is the call graph for this function:

Here is the caller graph for this function:

void draw_message_window ( int  redraw)
static void draw_stat_bar ( int  bar_pos,
int  height,
int  is_alert 
) [static]

Definition at line 1358 of file x11.c.

References discolor, display, foreground, itemlist::gc_text, MAX_BARS_MESSAGE, and win_message.

Referenced by draw_message_window().

Here is the caller graph for this function:

void draw_stats ( int  redraw)
static void draw_status_icon ( itemlist l,
int  x,
int  y,
int  face 
) [static]

Definition at line 1529 of file x11.c.

References display, itemlist::gc_status, icons, and itemlist::win.

Referenced by draw_list().

Here is the caller 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 300 of file x11.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:

static void gen_draw_face ( Drawable  where,
int  face,
int  x,
int  y,
int  sx,
int  sy 
) [static]

Definition at line 348 of file x11.c.

References display, gc_floor, gc_xpm, image_size, PixmapInfo::mask, mask, MAXPIXMAPNUM, misses, pixmap, total, xpm_masks, and XPMGCS.

Referenced by display_mapcell(), and draw_list().

Here is the caller graph for this function:

static int get_game_display ( void  ) [static]
static int get_info_display ( void  ) [static]
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 2028 of file x11.c.

References InfoData::info_chars.

Referenced by print_inventory().

Here is the caller graph for this function:

static int get_inv_display ( void  ) [static]
static void get_list_display ( itemlist l,
int  x,
int  y,
int  w,
int  h,
const char *  t,
const char *  s 
) [static]
static int get_look_display ( void  ) [static]
static int get_message_display ( void  ) [static]
char* get_metaserver ( void  )

Constructs the metaserver dialog and handles metaserver selection.

Definition at line 2533 of file x11.c.

References check_x_events(), cpl, draw_prompt(), Player_Struct::input_state, Player_Struct::input_text, MAX_BUF, and Metaserver_Select.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static int get_root_display ( char *  display_name) [static]
static int get_stats_display ( void  ) [static]

Definition at line 1114 of file x11.c.

References background, colormap, crossfire_bits, crossfire_height, crossfire_width, display, font, foreground, GAME_WIDTH, gargc, gargv, gc_stats, icon, INV_WIDTH, STAT_HEIGHT, win_root, win_stats, WINDOW_SPACING, and wm_delete_window.

Referenced by init_windows().

Here is the caller graph for this function:

static void get_window_coord ( Window  win,
int *  x,
int *  y,
int *  wx,
int *  wy,
unsigned int *  w,
unsigned int *  h 
) [static]

Definition at line 3285 of file x11.c.

References display.

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

Definition at line 2041 of file x11.c.

References container_clearing_one(), and views.

Referenced by remove_item_inventory().

Here is the call graph for this function:

Here is the caller graph for this function:

void item_event_item_changed ( item it)

Definition at line 2042 of file x11.c.

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

Referenced by set_item_values().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2040 of file x11.c.

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

Referenced by remove_item().

Here is the call graph for this function:

Here is the caller graph for this function:

void load_defaults ( void  )
void magic_map_flash_pos ( void  )

Flash the player position on the magic map.

Definition at line 3238 of file x11.c.

References background, cpl, display, foreground, gc_game, gtkwin_magicmap, magic_map_gc, magicgdkpixmap, map_color, mapvbox, Player_Struct::mapxres, Player_Struct::mapyres, Player_Struct::pmapx, Player_Struct::pmapy, Player_Struct::showmagic, TRUE, and win_game.

Referenced by check_x_events(), display_map_doneupdate(), and do_timeout().

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 
)
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 2033 of file x11.c.

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

Referenced by do_clearinfo(), and get_menu_display().

Here is the call graph for this function:

Here is the caller graph for this function:

void open_container ( item op)
Parameters:
op

Definition at line 1819 of file x11.c.

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

Referenced by item_actions().

Here is the call graph for this function:

Here is the caller graph for this function:

static void parse_game_button_press ( int  button,
int  x,
int  y 
) [static]

Definition at line 2234 of file x11.c.

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

Referenced by check_x_events().

Here is the call graph for this function:

Here is the caller graph for this function:

void redisplay_stats ( void  )

Definition at line 3165 of file x11.c.

References display, gc_stats, stats_buff, and win_stats.

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 3261 of file x11.c.

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

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void resize_list_info ( itemlist l,
int  w,
int  h 
) [static]
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 3061 of file x11.c.

References bigmap, CFG_DM_SDL, CONFIG_DISPLAYMODE, CONFIG_MAPHEIGHT, CONFIG_MAPWIDTH, CONFIG_SPLITWIN, display, drawingarea, FALSE, game_bar_vpane, gameframe, gtkwin_root, height, image_size, init_SDL(), 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.

Referenced by SetupCmd().

Here is the call graph for this function:

Here is the caller graph for this function:

static void resize_win_info ( int  width,
int  height 
) [static]
static void resize_win_message ( int  width,
int  height 
) [static]

Definition at line 989 of file x11.c.

References height, messagehint, and width.

Referenced by check_x_events().

Here is the caller graph for this function:

static void resize_win_root ( XEvent *  event) [static]

Definition at line 2170 of file x11.c.

References CONFIG_SPLITWIN, display, GAME_WIDTH, info_ratio, messagehint, STAT_HEIGHT, want_config, width, itemlist::win, win_game, InfoData::win_info, win_message, win_stats, and WINDOW_SPACING.

Referenced by check_x_events().

Here is the caller graph for this function:

void save_defaults ( void  )

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

Definition at line 3455 of file x11.c.

References CONFIG_CACHE, CONFIG_CWINDOW, CONFIG_FOODBEEP, config_names, CONFIG_NUMS, CONFIG_PORT, CONFIG_SOUND, CONFIG_SPLITWIN, draw_info(), face_info, font_name, LOG(), LOG_ERROR, make_path_to_file(), MAX_BUF, InfoData::maxlines, NDI_BLUE, noautorepeat, InfoData::scroll_info_window, server, itemlist::show_icon, sound_server, use_config, want_config, and Face_Information_struct::want_faceset.

Referenced by do_savedefaults(), get_menu_display(), on_config_button_save_clicked(), and saveconfig().

Here is the call graph for this function:

Here is the caller graph for this function:

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 3299 of file x11.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, stat_game_vpane, stat_info_hpane, use_config, want_config, itemlist::win, win_game, InfoData::win_info, win_message, and win_stats.

Referenced by do_savewinpos(), get_menu_display(), and on_save_window_position_activate().

Here is the call graph for this function:

Here is the caller 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 2021 of file x11.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 2005 of file x11.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 1978 of file x11.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 1989 of file x11.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 2000 of file x11.c.

References update_list_labels(), and itemlist::weight_limit.

Referenced by StatsCmd().

Here is the call graph for this function:

Here is the caller graph for this function:

void set_window_pos ( void  )
static int show_object ( item ip,
inventory_show  flags 
) [static]
static void update_icons_list ( itemlist l) [static]

Definition at line 1810 of file x11.c.

References draw_list(), itemlist::faces, and itemlist::size.

Referenced by check_x_events().

Here is the call graph for this function:

Here is the caller graph for this function:

static void usage ( char *  progname) [static]

Definition at line 2732 of file x11.c.

Referenced by init_windows().

Here is the caller graph for this function:

void write_ch ( char  key)
static void xwritedown ( const char *  txt,
int  x 
) [static]

Definition at line 1349 of file x11.c.

References display, itemlist::gc_text, and win_message.

Referenced by draw_all_message().

Here is the caller graph for this function:


Variable Documentation

unsigned long background [static]
Colormap colormap
Pixmap dark1 [static]

Definition at line 251 of file x11.c.

Pixmap dark2 [static]

Definition at line 251 of file x11.c.

Pixmap dark3 [static]

Definition at line 251 of file x11.c.

Window def_root [static]

Definition at line 185 of file x11.c.

Referenced by create_status_icons(), get_game_display(), and get_root_display().

long def_screen [static]

Definition at line 186 of file x11.c.

Referenced by get_game_display(), and get_root_display().

XColor discolor[16] [static]
Display* display
XEvent event [static]

Definition at line 193 of file x11.c.

Referenced by check_x_events(), do_key_press(), get_root_display(), and list_selection_func().

XFontStruct* font [static]
char* font_name = "8x13" [static]

Definition at line 155 of file x11.c.

Referenced by get_root_display(), init_windows(), load_defaults(), and save_defaults().

int FONTHEIGHT = 13 [static]
int FONTWIDTH = 8 [static]
unsigned long foreground [static]
int gargc [static]
char ** gargv [static]
GC gc_blank [static]

Definition at line 252 of file x11.c.

Referenced by display_mapcell(), and get_game_display().

GC gc_clear_xpm [static]

Definition at line 252 of file x11.c.

Referenced by display_mapcell(), and get_game_display().

GC gc_copy [static]

Definition at line 256 of file x11.c.

Referenced by display_mapscroll(), end_windows(), and get_game_display().

GC gc_floor [static]

Definition at line 252 of file x11.c.

Referenced by display_map_doneupdate(), gen_draw_face(), and get_game_display().

GC gc_game
GC gc_message [static]

Definition at line 252 of file x11.c.

Referenced by end_windows(), and get_message_display().

GC gc_root [static]

Definition at line 252 of file x11.c.

Referenced by end_windows(), and get_root_display().

GC gc_stats [static]

Definition at line 252 of file x11.c.

Referenced by draw_stats(), end_windows(), get_stats_display(), and redisplay_stats().

GC gc_xpm[XPMGCS] [static]

Definition at line 252 of file x11.c.

Referenced by display_mapcell(), gen_draw_face(), and get_game_display().

GC gc_xpm_object [static]

Definition at line 252 of file x11.c.

Referenced by end_windows(), and get_game_display().

Pixmap icon [static]
Pixmap icons[max_icons] [static]

Definition at line 249 of file x11.c.

Referenced by draw_list(), and draw_status_icon().

Definition at line 231 of file x11.c.

float info_ratio = 0 [static]

Definition at line 240 of file x11.c.

Referenced by init_windows(), and resize_win_root().

Initial value:
 {0, 0, 0, 0, 1, 0, INFOLINES, INFOLINES, NDI_BLACK,
        NULL, 0, 0,0,0,0,0,0,0,0}

Definition at line 228 of file x11.c.

itemlist inv_list [static]

Definition at line 261 of file x11.c.

Stats last_stats = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} [static]

Definition at line 264 of file x11.c.

Referenced by draw_stats().

itemlist look_list [static]

Definition at line 261 of file x11.c.

int maxfd

Definition at line 68 of file client.c.

Referenced by do_network(), event_loop(), and main().

XSizeHints messagehint [static]
int misses = 0

Definition at line 342 of file x11.c.

int newimages = 0

Definition at line 342 of file x11.c.

Referenced by check_x_events().

Definition at line 153 of file x11.c.

Referenced by check_x_events(), init_windows(), load_defaults(), save_defaults(), and set_autorepeat().

int old_mapx = 11 [static]

Definition at line 182 of file x11.c.

Referenced by resize_map_window().

int old_mapy = 11 [static]

Definition at line 182 of file x11.c.

Referenced by resize_map_window().

Definition at line 236 of file x11.c.

const char* rcsid_x11_x11_c = "$Id: x11.c 9201 2008-06-01 17:32:45Z anmaster $"

Definition at line 1 of file x11.c.

XSizeHints roothint [static]
char stats_buff[7][600] [static]

Definition at line 235 of file x11.c.

Referenced by redisplay_stats().

int sync_display = 0

Definition at line 2063 of file x11.c.

Referenced by get_root_display(), and init_windows().

int total = 0

Definition at line 342 of file x11.c.

Window win_game
Window win_message
Window win_root
Window win_stats
Atom wm_delete_window [static]
Pixmap xpm_masks[XPMGCS] [static]

Definition at line 251 of file x11.c.

Referenced by display_mapcell(), and gen_draw_face().

Pixmap xpm_pixmap [static]

Definition at line 251 of file x11.c.

Referenced by display_mapcell(), and get_game_display().