Crossfire Client, Branches  R11627
external.h
Go to the documentation of this file.
1 /*
2  * static char *rcsid_external_h =
3  * "$Id: external.h 9215 2008-06-02 18:31:04Z anmaster $";
4  */
5 /*
6  Crossfire client, a client program for the crossfire program.
7 
8  Copyright (C) 2001,2006 Mark Wedel & Crossfire Development Team
9 
10  This program is free software; you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation; either version 2 of the License, or
13  (at your option) any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program; if not, write to the Free Software
22  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 
24  The author can be reached via e-mail to crossfire-devel@real-time.com
25 */
26 
27 /* This file contains external calls that the common area makes
28  * callbacks to.
29  * This was really a quick hack done to allow some seperation.
30  * Really, these should be set via callbacks that the client
31  * can make to the library. Many of these probably should
32  * never really be callbacks in any case, or be more general
33  */
34 
35 /* Sound functions */
36 extern void SoundCmd(unsigned char *data, int len);
37 extern void Sound2Cmd(unsigned char *data, int len);
38 extern void MusicCmd(const char *data, int len);
39 
40 /* Map window related functions */
41 extern void resize_map_window(int x, int y);
42 extern void display_map_newmap(void);
43 extern void display_map_addbelow(long x, long y, long face);
44 extern void display_map_startupdate(void);
45 extern void display_map_doneupdate(int redraw, int notice);
46 extern int display_mapscroll(int dx, int dy);
47 extern void draw_magic_map(void);
48 
49 /* Info related functions */
50 extern void draw_info(const char *str, int color);
51 extern void draw_color_info(int colr, const char *buf);
52 extern void draw_prompt(const char *str);
53 extern void x_set_echo(void);
54 extern void set_scroll(const char *s);
55 extern void set_autorepeat(const char *s);
56 extern void menu_clear(void);
57 extern int get_info_width(void);
58 
59 /* Stats related commands */
60 extern void draw_stats(int redraw);
61 extern void draw_message_window(int redraw);
62 
63 /* this should really just set a field in the stats, and let the
64  * client figure the new weight limit out
65  */
66 extern void set_weight_limit(uint32 wlim);
67 
68 /* Image related functions */
69 extern int display_willcache(void);
70 extern int create_and_rescale_image_from_data(Cache_Entry *ce, int pixmap_num, uint8 *rgba_data, int width, int height);
71 extern uint8 *png_to_data(uint8 *data, int len, uint32 *width, uint32 *height);
72 extern int associate_cache_entry(Cache_Entry *ce, int pixnum);
73 extern void image_update_download_status(int start, int end, int total);
74 extern void get_map_image_size(int face, uint8 *w, uint8 *h);
75 extern void addsmooth(uint16 face, uint16 smooth_face);
76 
77 /* Item related commands */
78 extern void open_container(item *op);
79 extern void close_container(item *op);
80 extern void set_show_icon(const char *s);
81 extern void set_show_weight(const char *s);
82 
83 /* Keybinding relatated commands - this probably should not be a callback */
84 extern void bind_key(const char *params);
85 extern void unbind_key(const char *params);
86 
87 /* Misc commands */
88 extern void save_winpos(void);
89 extern void save_defaults(void);
90 extern void command_show(const char *params);
91 extern void client_tick(uint32 tick);
92 extern void cleanup_connection();
93 extern void client_pickup(uint32 pickup);
void set_autorepeat(const char *s)
Definition: gx11.c:4448
static int height
Definition: mapdata.c:104
void display_map_addbelow(long x, long y, long face)
void cleanup_connection()
Definition: gx11.c:329
void set_show_icon(const char *s)
Definition: inventory.c:1303
void Sound2Cmd(unsigned char *data, int len)
Definition: sound.c:151
void set_weight_limit(uint32 wlim)
Definition: inventory.c:1245
snd_pcm_hw_params_t * params
Definition: alsa9.c:111
void close_container(item *op)
Definition: inventory.c:1342
int total
Definition: gx11.c:322
void MusicCmd(const char *data, int len)
Definition: sound.c:199
void display_map_startupdate(void)
Definition: gx11.c:5428
void client_pickup(uint32 pickup)
Definition: gx11.c:4524
void draw_stats(int redraw)
Definition: gx11.c:2015
static int width
Definition: mapdata.c:104
void display_map_newmap(void)
Definition: gx11.c:5319
uint8 * png_to_data(uint8 *data, int len, uint32 *width, uint32 *height)
Definition: png.c:63
uint32 tick
Definition: client.c:70
void x_set_echo(void)
Definition: gx11.c:4488
void display_map_doneupdate(int redraw, int notice)
Definition: gx11.c:5300
void addsmooth(uint16 face, uint16 smooth_face)
Definition: image.c:360
void draw_message_window(int redraw)
Definition: gx11.c:2458
void save_winpos(void)
Definition: gx11.c:4804
int display_mapscroll(int dx, int dy)
Definition: map.c:88
int associate_cache_entry(Cache_Entry *ce, int pixnum)
Definition: image.c:372
void get_map_image_size(int face, uint8 *w, uint8 *h)
Definition: image.c:459
int create_and_rescale_image_from_data(Cache_Entry *ce, int pixmap_num, uint8 *rgba_data, int width, int height)
Definition: image.c:252
unsigned short uint16
Definition: client-types.h:79
void draw_color_info(int colr, const char *buf)
Definition: gx11.c:1851
int display_willcache(void)
void save_defaults(void)
Definition: config.c:848
void bind_key(const char *params)
Definition: keys.c:648
unsigned int uint32
Definition: client-types.h:77
void menu_clear(void)
Definition: gx11.c:3241
void client_tick(uint32 tick)
Definition: gx11.c:4510
int get_info_width(void)
Definition: gx11.c:4453
void set_show_weight(const char *s)
Definition: inventory.c:1258
Definition: client.h:480
void command_show(const char *params)
Definition: inventory.c:1153
void draw_info(const char *str, int color)
Definition: gx11.c:1773
void draw_magic_map(void)
Definition: gx11.c:4571
void resize_map_window(int x, int y)
Definition: gx11.c:5324
void open_container(item *op)
Definition: inventory.c:1334
void SoundCmd(unsigned char *data, int len)
Definition: sound.c:130
unsigned char uint8
Definition: client-types.h:81
void unbind_key(const char *params)
Definition: keys.c:918
void draw_prompt(const char *str)
Definition: gx11.c:1310
void image_update_download_status(int start, int end, int total)
Definition: image.c:419
void set_scroll(const char *s)
Definition: gx11.c:4443