Crossfire Client, Branch  R11627
external.h
Go to the documentation of this file.
00001 /*
00002  * static char *rcsid_external_h =
00003  *   "$Id: external.h 9215 2008-06-02 18:31:04Z anmaster $";
00004  */
00005 /*
00006     Crossfire client, a client program for the crossfire program.
00007 
00008     Copyright (C) 2001,2006 Mark Wedel & Crossfire Development Team
00009 
00010     This program is free software; you can redistribute it and/or modify
00011     it under the terms of the GNU General Public License as published by
00012     the Free Software Foundation; either version 2 of the License, or
00013     (at your option) any later version.
00014 
00015     This program is distributed in the hope that it will be useful,
00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018     GNU General Public License for more details.
00019 
00020     You should have received a copy of the GNU General Public License
00021     along with this program; if not, write to the Free Software
00022     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00023 
00024     The author can be reached via e-mail to crossfire-devel@real-time.com
00025 */
00026 
00027 /* This file contains external calls that the common area makes
00028  * callbacks to.
00029  * This was really a quick hack done to allow some seperation.
00030  * Really, these should be set via callbacks that the client
00031  * can make to the library.  Many of these probably should
00032  * never really be callbacks in any case, or be more general
00033  */
00034 
00035 /* Sound functions */
00036 extern void SoundCmd(unsigned char *data, int len);
00037 extern void Sound2Cmd(unsigned char *data, int len);
00038 extern void MusicCmd(const char *data, int len);
00039 
00040 /* Map window related functions */
00041 extern void resize_map_window(int x, int y);
00042 extern void display_map_newmap(void);
00043 extern void display_map_addbelow(long x, long y, long face);
00044 extern void display_map_startupdate(void);
00045 extern void display_map_doneupdate(int redraw, int notice);
00046 extern int display_mapscroll(int dx, int dy);
00047 extern void draw_magic_map(void);
00048 
00049 /* Info related functions */
00050 extern void draw_info(const char *str, int color);
00051 extern void draw_color_info(int colr, const char *buf);
00052 extern void draw_prompt(const char *str);
00053 extern void x_set_echo(void);
00054 extern void set_scroll(const char *s);
00055 extern void set_autorepeat(const char *s);
00056 extern void menu_clear(void);
00057 extern int get_info_width(void);
00058 
00059 /* Stats related commands */
00060 extern void draw_stats(int redraw);
00061 extern void draw_message_window(int redraw);
00062 
00063 /* this should really just set a field in the stats, and let the
00064  * client figure the new weight limit out
00065  */
00066 extern void set_weight_limit(uint32 wlim);
00067 
00068 /* Image related functions */
00069 extern int display_willcache(void);
00070 extern int create_and_rescale_image_from_data(Cache_Entry *ce, int pixmap_num, uint8 *rgba_data, int width, int height);
00071 extern uint8 *png_to_data(uint8 *data, int len, uint32 *width, uint32 *height);
00072 extern int associate_cache_entry(Cache_Entry *ce, int pixnum);
00073 extern void image_update_download_status(int start, int end, int total);
00074 extern void get_map_image_size(int face, uint8 *w, uint8 *h);
00075 extern void addsmooth(uint16 face, uint16 smooth_face);
00076 
00077 /* Item related commands */
00078 extern void open_container(item *op);
00079 extern void close_container(item *op);
00080 extern void set_show_icon(const char *s);
00081 extern void set_show_weight(const char *s);
00082 
00083 /* Keybinding relatated commands - this probably should not be a callback */
00084 extern void bind_key(const char *params);
00085 extern void unbind_key(const char *params);
00086 
00087 /* Misc commands */
00088 extern void save_winpos(void);
00089 extern void save_defaults(void);
00090 extern void command_show(const char *params);
00091 extern void client_tick(uint32 tick);
00092 extern void cleanup_connection();
00093 extern void client_pickup(uint32 pickup);