File: external.h

package info (click to toggle)
crossfire-client 1.50.0-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 6,348 kB
  • ctags: 2,320
  • sloc: ansic: 20,364; sh: 3,641; makefile: 242; perl: 48
file content (106 lines) | stat: -rw-r--r-- 4,297 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
 * static char *rcsid_common_external_h =
 *   "$Id: external.h 12949 2010-04-25 07:07:43Z mwedel $";
 */
/*
    Crossfire client, a client program for the crossfire program.

    Copyright (C) 2001,2006 Mark Wedel & Crossfire Development Team

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

    The author can be reached via e-mail to crossfire-devel@real-time.com
*/

/**
 * @file common/external.h
 * Contains external calls that the common area makes callbacks to.  This was
 * really a quick hack done to allow some separation.  Really, these should be
 * set via callbacks that the client can make to the library.  Many of these
 * probably should never really be callbacks in any case, or be more general.
 */

/* Sound functions */
extern void SoundCmd(unsigned char *data, int len);
extern void Sound2Cmd(unsigned char *data, int len);
extern void MusicCmd(const char *data, int len);

/* Map window related functions */
extern void resize_map_window(int x, int y);
extern void display_map_newmap(void);
extern void display_map_addbelow(long x, long y, long face);
extern void display_map_startupdate(void);
extern void display_map_doneupdate(int redraw, int notice);
extern int display_mapscroll(int dx, int dy);
extern void draw_magic_map(void);

/* Info related functions */
extern void draw_prompt(const char *str);
extern void draw_ext_info(int orig_color, int type, int subtype, char *message);
extern void x_set_echo(void);
extern void set_scroll(const char *s);
extern void set_autorepeat(const char *s);
extern void menu_clear(void);
extern int get_info_width(void);

/* Stats related commands */
extern void draw_stats(int redraw);
extern void draw_message_window(int redraw);

/* this should really just set a field in the stats, and let the
 * client figure the new weight limit out
 */
extern void set_weight_limit(uint32 wlim);

/* Image related functions */
extern int display_willcache(void);
extern int create_and_rescale_image_from_data(Cache_Entry *ce, int pixmap_num, uint8 *rgba_data, int width, int height);
extern uint8 *png_to_data(uint8 *data, int len, uint32 *width, uint32 *height);
extern int associate_cache_entry(Cache_Entry *ce, int pixnum);
extern void image_update_download_status(int start, int end, int total);
extern void get_map_image_size(int face, uint8 *w, uint8 *h);
extern void addsmooth(uint16 face, uint16 smooth_face);

/* Item related commands */
extern void open_container(item *op);
extern void close_container(item *op);
extern void set_show_icon(const char *s);
extern void set_show_weight(const char *s);

/* Keybinding relatated commands - this probably should not be a callback */
extern void bind_key(const char *params);
extern void unbind_key(const char *params);

/* Misc commands */
extern void save_winpos(void);
extern void save_defaults(void);
extern void command_show(const char *params);
extern void client_tick(uint32 tick);
extern void cleanup_connection(void);
extern void client_pickup(uint32 pickup);

/* Account Login Functions */
extern void start_login(int method);
extern void hide_all_login_windows();
extern void account_login_failure(char *message);
extern void account_creation_failure(char *message);
extern void account_add_character_failure(char *message);
extern void create_new_character_failure(char *message);
extern void choose_character_init();
extern void update_character_choose(const char *name, const char *class,
                             const char *race, const char *face,
                             const char *party, const char *map,
                             int level, int faceno);
extern void update_login_info(int type);