Atrinik Client 2.5
include/proto.h
00001 #ifndef __CPROTO__
00002 /* src/client/animations.c */
00003 void read_anims();
00004 void anims_reset();
00005 /* src/client/client.c */
00006 void DoClient();
00007 void SockList_Init(SockList *sl);
00008 void SockList_AddChar(SockList *sl, char c);
00009 void SockList_AddShort(SockList *sl, uint16 data);
00010 void SockList_AddInt(SockList *sl, uint32 data);
00011 void SockList_AddString(SockList *sl, char *data);
00012 void SockList_AddStringTerminated(SockList *sl, char *data);
00013 int GetInt_String(const unsigned char *data);
00014 sint64 GetInt64_String(const unsigned char *data);
00015 short GetShort_String(const unsigned char *data);
00016 char *GetString_String(uint8 *data, int *pos, char *dest, size_t dest_size);
00017 int cs_write_string(char *buf, size_t len);
00018 void check_animation_status(int anum);
00019 /* src/client/commands.c */
00020 void BookCmd(unsigned char *data, int len);
00021 void SetupCmd(char *buf, int len);
00022 void AddMeFail(unsigned char *data, int len);
00023 void AddMeSuccess(unsigned char *data, int len);
00024 void AnimCmd(unsigned char *data, int len);
00025 void ImageCmd(unsigned char *data, int len);
00026 void SkillRdyCmd(char *data, int len);
00027 void DrawInfoCmd(unsigned char *data);
00028 void DrawInfoCmd2(unsigned char *data, int len);
00029 void TargetObject(unsigned char *data, int len);
00030 void StatsCmd(unsigned char *data, int len);
00031 void PreParseInfoStat(char *cmd);
00032 void handle_query(char *data);
00033 void send_reply(char *text);
00034 void PlayerCmd(unsigned char *data, int len);
00035 void ItemXCmd(unsigned char *data, int len);
00036 void ItemYCmd(unsigned char *data, int len);
00037 void UpdateItemCmd(unsigned char *data, int len);
00038 void DeleteItem(unsigned char *data, int len);
00039 void DeleteInventory(unsigned char *data);
00040 void MapStatsCmd(unsigned char *data, int len);
00041 void Map2Cmd(unsigned char *data, int len);
00042 void MagicMapCmd(unsigned char *data, int len);
00043 void VersionCmd(char *data);
00044 void SendVersion();
00045 void RequestFile(int idx);
00046 void SendAddMe();
00047 void NewCharCmd();
00048 void DataCmd(unsigned char *data, int len);
00049 void ShopCmd(unsigned char *data, int len);
00050 void QuestListCmd(unsigned char *data, int len);
00051 void ReadyCmd(unsigned char *data, int len);
00052 /* src/client/curl.c */
00053 int curl_connect(void *c_data);
00054 curl_data *curl_data_new(const char *url);
00055 curl_data *curl_download_start(const char *url);
00056 sint8 curl_download_finished(curl_data *data);
00057 void curl_data_free(curl_data *data);
00058 void curl_init();
00059 void curl_deinit();
00060 /* src/client/ignore.c */
00061 void ignore_list_clear();
00062 void ignore_list_load();
00063 int ignore_check(const char *name, const char *type);
00064 void ignore_command(const char *cmd);
00065 /* src/client/image.c */
00066 bmap_struct *bmap_find(const char *name);
00067 void bmap_add(bmap_struct *bmap);
00068 void read_bmaps_p0();
00069 void read_bmaps();
00070 void finish_face_cmd(int pnum, uint32 checksum, char *face);
00071 int request_face(int pnum);
00072 int get_bmap_id(char *name);
00073 void blit_face(int id, int x, int y);
00074 /* src/client/item.c */
00075 void objects_free(object *op);
00076 object *object_find_object_inv(object *op, sint32 tag);
00077 object *object_find_object(object *op, sint32 tag);
00078 object *object_find(sint32 tag);
00079 void object_remove(object *op);
00080 void object_remove_inventory(object *op);
00081 object *object_create(object *env, sint32 tag, int bflag);
00082 void object_set_values(object *op, const char *name, sint32 weight, uint16 face, int flags, uint16 anim, uint16 animspeed, sint32 nrof, uint8 itype, uint8 stype, uint8 qual, uint8 cond, uint8 skill, uint8 level, uint8 dir);
00083 void toggle_locked(object *op);
00084 void object_send_mark(object *op);
00085 void ready_object(object *op);
00086 void objects_init();
00087 void update_object(int tag, int loc, const char *name, int weight, int face, int flags, int anim, int animspeed, int nrof, uint8 itype, uint8 stype, uint8 qual, uint8 cond, uint8 skill, uint8 level, uint8 direction, int bflag);
00088 void animate_objects();
00089 /* src/client/keybind.c */
00090 void keybind_load();
00091 void keybind_save();
00092 void keybind_free(keybind_struct *keybind);
00093 void keybind_deinit();
00094 keybind_struct *keybind_add(SDLKey key, SDLMod mod, const char *command);
00095 void keybind_edit(size_t i, SDLKey key, SDLMod mod, const char *command);
00096 void keybind_remove(size_t i);
00097 void keybind_repeat_toggle(size_t i);
00098 char *keybind_get_key_shortcut(SDLKey key, SDLMod mod, char *buf, size_t len);
00099 keybind_struct *keybind_find_by_command(const char *cmd);
00100 int keybind_command_matches_event(const char *cmd, SDL_KeyboardEvent *event);
00101 int keybind_command_matches_state(const char *cmd);
00102 int keybind_process_event(SDL_KeyboardEvent *event);
00103 void keybind_repeat();
00104 void keybind_process(keybind_struct *keybind, uint8 type);
00105 int keybind_process_command_up(const char *cmd);
00106 int keybind_process_command(const char *cmd);
00107 /* src/client/main.c */
00108 void free_bitmaps();
00109 void list_vid_modes();
00110 int main(int argc, char *argv[]);
00111 /* src/client/menu.c */
00112 int client_command_check(const char *cmd);
00113 void send_command_check(const char *cmd);
00114 void blt_inventory_face_from_tag(int tag, int x, int y);
00115 void show_menu();
00116 void blt_window_slider(_Sprite *slider, int maxlen, int winlen, int startoff, int len, int x, int y);
00117 /* src/client/metaserver.c */
00118 void metaserver_init();
00119 void metaserver_disable();
00120 server_struct *server_get_id(size_t num);
00121 size_t server_get_count();
00122 int ms_connecting(int val);
00123 void metaserver_clear_data();
00124 void metaserver_add(const char *ip, int port, const char *name, int player, const char *version, const char *desc);
00125 int metaserver_thread(void *dummy);
00126 void metaserver_get_servers();
00127 /* src/client/misc.c */
00128 unsigned long isqrt(unsigned long n);
00129 size_t split_string(char *str, char *array[], size_t array_size, char sep);
00130 void *reallocz(void *ptr, size_t old_size, size_t new_size);
00131 void convert_newline(char *str);
00132 void browser_open(const char *url);
00133 int rndm(int min, int max);
00134 char *package_get_version_full(char *dst, size_t dstlen);
00135 char *package_get_version_partial(char *dst, size_t dstlen);
00136 /* src/client/player.c */
00137 void clear_player();
00138 void new_player(long tag, long weight, short face);
00139 void client_send_apply(int tag);
00140 void client_send_examine(int tag);
00141 void client_send_move(int loc, int tag, int nrof);
00142 void send_command(const char *command);
00143 void CompleteCmd(unsigned char *data, int len);
00144 void set_weight_limit(uint32 wlim);
00145 void init_player_data();
00146 void widget_player_data_event(widgetdata *widget, int x, int y);
00147 void widget_show_player_data(widgetdata *widget);
00148 void widget_player_stats(widgetdata *widget);
00149 void widget_skillgroups(widgetdata *widget);
00150 void widget_show_player_doll_event();
00151 void widget_show_player_doll(widgetdata *widget);
00152 void widget_show_main_lvl(widgetdata *widget);
00153 void widget_show_skill_exp(widgetdata *widget);
00154 void widget_show_regeneration(widgetdata *widget);
00155 void widget_show_container(widgetdata *widget);
00156 void widget_highlight_menu(widgetdata *widget);
00157 void widget_menu_event(widgetdata *widget, int x, int y);
00158 void widget_menuitem_event(widgetdata *widget, int x, int y, void (*menu_func_ptr)(widgetdata *, int, int));
00159 void widget_show_label(widgetdata *widget);
00160 void widget_show_bitmap(widgetdata *widget);
00161 int gender_to_id(const char *gender);
00162 /* src/client/porting.c */
00163 /* src/client/scripts.c */
00164 void script_load(const char *cparams);
00165 void script_list();
00166 void script_process();
00167 int script_trigger_event(const char *cmd, const uint8 *data, const int data_len, const enum CmdFormat format);
00168 void script_send(const char *params);
00169 void script_killall();
00170 void script_autoload();
00171 void script_unload(const char *params);
00172 /* src/client/server_files.c */
00173 void server_files_init();
00174 void server_files_load(int post_load);
00175 FILE *server_file_open(size_t id);
00176 void server_file_save(size_t id, unsigned char *data, size_t len);
00177 int server_files_updating();
00178 void server_files_setup_add(char *buf, size_t buf_size);
00179 int server_files_parse_setup(const char *cmd, const char *param);
00180 void server_files_clear_update();
00181 /* src/client/server_settings.c */
00182 void server_settings_init();
00183 void server_settings_deinit();
00184 /* src/client/settings.c */
00185 void settings_init();
00186 void settings_load();
00187 void settings_save();
00188 void settings_deinit();
00189 void *setting_get(setting_struct *setting);
00190 const char *setting_get_str(int cat, int setting);
00191 sint64 setting_get_int(int cat, int setting);
00192 void settings_apply();
00193 void settings_apply_change();
00194 void setting_set_int(int cat, int setting, sint64 val);
00195 int setting_is_text(setting_struct *setting);
00196 sint64 category_from_name(const char *name);
00197 sint64 setting_from_name(const char *name);
00198 /* src/client/socket.c */
00199 void command_buffer_free(command_buffer *buf);
00200 int send_command_binary(uint8 cmd, uint8 *body, unsigned int len);
00201 int send_socklist(SockList msg);
00202 command_buffer *get_next_input_command();
00203 void socket_thread_start();
00204 void socket_thread_stop();
00205 int handle_socket_shutdown();
00206 int socket_get_error();
00207 int socket_close(struct ClientSocket *csock);
00208 int socket_initialize();
00209 void socket_deinitialize();
00210 int socket_open(struct ClientSocket *csock, char *host, int port);
00211 /* src/client/sound.c */
00212 void sound_init();
00213 void sound_deinit();
00214 void sound_play_effect(const char *filename, int volume);
00215 void sound_start_bg_music(const char *filename, int volume, int loop);
00216 void sound_stop_bg_music();
00217 void update_map_bg_music(const char *bg_music);
00218 void sound_update_volume();
00219 const char *sound_get_bg_music();
00220 const char *sound_get_bg_music_basename();
00221 uint8 sound_map_background(int new);
00222 void SoundCmd(uint8 *data, int len);
00223 void sound_pause_music();
00224 void sound_resume_music();
00225 int sound_playing_music();
00226 /* src/client/sprite.c */
00227 void sprite_init_system();
00228 _Sprite *sprite_load_file(char *fname, uint32 flags);
00229 _Sprite *sprite_tryload_file(char *fname, uint32 flag, SDL_RWops *rwop);
00230 void sprite_free_sprite(_Sprite *sprite);
00231 void sprite_blt(_Sprite *sprite, int x, int y, SDL_Rect *box, _BLTFX *bltfx);
00232 void sprite_blt_map(_Sprite *sprite, int x, int y, SDL_Rect *box, _BLTFX *bltfx, uint32 stretch, sint16 zoom, sint16 rotate);
00233 Uint32 getpixel(SDL_Surface *surface, int x, int y);
00234 void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel);
00235 struct _anim *add_anim(int type, int mapx, int mapy, int value);
00236 void remove_anim(struct _anim *anim);
00237 void play_anims();
00238 int sprite_collision(int x, int y, int x2, int y2, _Sprite *sprite1, _Sprite *sprite2);
00239 void surface_pan(SDL_Surface *surface, SDL_Rect *box);
00240 void draw_frame(SDL_Surface *surface, int x, int y, int w, int h);
00241 void border_create(SDL_Surface *surface, int x, int y, int w, int h, int color, int size);
00242 void border_create_color(SDL_Surface *surface, SDL_Rect *coords, const char *color_notation);
00243 /* src/client/tilestretcher.c */
00244 int add_color_to_surface(SDL_Surface *dest, Uint8 red, Uint8 green, Uint8 blue);
00245 int copy_pixel_to_pixel(SDL_Surface *src, SDL_Surface *dest, int x, int y, int x2, int y2, float brightness);
00246 int copy_vertical_line(SDL_Surface *src, SDL_Surface *dest, int src_x, int src_sy, int src_ey, int dest_x, int dest_sy, int dest_ey, float brightness, int extra);
00247 SDL_Surface *tile_stretch(SDL_Surface *src, int n, int e, int s, int w);
00248 /* src/client/updates.c */
00249 void cmd_request_update(unsigned char *data, int len);
00250 int file_updates_finished();
00251 void file_updates_parse();
00252 /* src/client/upgrader.c */
00253 void upgrader_init();
00254 /* src/client/video.c */
00255 int video_get_bpp();
00256 int video_set_size();
00257 uint32 get_video_flags();
00258 int video_fullscreen_toggle(SDL_Surface **surface, uint32 *flags);
00259 /* src/client/wrapper.c */
00260 void LOG(LogLevel logLevel, char *format, ...) __attribute__((format(printf, 2, 3)));
00261 void system_start();
00262 void system_end();
00263 char *get_word_from_string(char *str, int *pos);
00264 void copy_file(const char *filename, const char *filename_out);
00265 void copy_if_exists(const char *from, const char *to, const char *src, const char *dst);
00266 void rmrf(const char *path);
00267 void copy_rec(const char *src, const char *dst);
00268 const char *get_config_dir();
00269 void get_data_dir_file(char *buf, size_t len, const char *fname);
00270 char *file_path(const char *fname, const char *mode);
00271 FILE *fopen_wrapper(const char *fname, const char *mode);
00272 SDL_Surface *IMG_Load_wrapper(const char *file);
00273 TTF_Font *TTF_OpenFont_wrapper(const char *file, int ptsize);
00274 /* src/events/console.c */
00275 void mouse_InputNumber();
00276 /* src/events/event.c */
00277 uint8 key_is_pressed(SDLKey key);
00278 int draggingInvItem(int src);
00279 void resize_window(int width, int height);
00280 int Event_PollInputDevice();
00281 /* src/events/keys.c */
00282 void init_keys();
00283 void reset_keys();
00284 int key_event(SDL_KeyboardEvent *key);
00285 int event_poll_key(SDL_Event *event);
00286 void cursor_keys(int num);
00287 void key_repeat();
00288 void check_menu_keys(int menu, int key);
00289 /* src/events/move.c */
00290 void move_keys(int num);
00291 int dir_from_tile_coords(int tx, int ty);
00292 /* src/gui/book.c */
00293 void book_name_change(const char *name, size_t len);
00294 void book_load(const char *data, int len);
00295 void book_show();
00296 void book_handle_key(SDLKey key);
00297 void book_handle_event(SDL_Event *event);
00298 void book_redraw();
00299 /* src/gui/effects.c */
00300 void effects_init();
00301 void effects_deinit();
00302 void effects_reinit();
00303 void effect_sprites_free(effect_struct *effect);
00304 void effect_free(effect_struct *effect);
00305 void effect_sprite_def_free(effect_sprite_def *sprite_def);
00306 void effect_sprite_free(effect_sprite *sprite);
00307 void effect_sprite_remove(effect_sprite *sprite);
00308 void effect_sprites_play();
00309 int effect_start(const char *name);
00310 void effect_debug(const char *type);
00311 void effect_stop();
00312 uint8 effect_has_overlay();
00313 void effect_scale(_Sprite *sprite);
00314 /* src/gui/fps.c */
00315 void fps_init();
00316 void fps_do();
00317 void widget_show_fps(widgetdata *widget);
00318 /* src/gui/help.c */
00319 void free_help_files();
00320 void read_help_files();
00321 void show_help(const char *helpname);
00322 /* src/gui/input.c */
00323 void widget_number_event(widgetdata *widget, int x, int y);
00324 void widget_show_console(widgetdata *widget);
00325 void widget_show_number(widgetdata *widget);
00326 void do_number();
00327 void do_console();
00328 /* src/gui/inventory.c */
00329 void inventory_filter_set(uint64 filter);
00330 void inventory_filter_toggle(uint64 filter);
00331 int get_inventory_data(object *op, int *ctag, int *slot, int *start, int *count, int wxlen, int wylen);
00332 void widget_inventory_event(widgetdata *widget, int x, int y, SDL_Event event);
00333 void widget_show_inventory_window(widgetdata *widget);
00334 void widget_below_window_event(widgetdata *widget, int x, int y, int MEvent);
00335 void widget_show_below_window(widgetdata *widget);
00336 int blt_inv_item_centered(object *tmp, int x, int y);
00337 void blt_inv_item(object *tmp, int x, int y);
00338 /* src/gui/main.c */
00339 void show_meta_server();
00340 /* src/gui/map.c */
00341 void load_mapdef_dat();
00342 void widget_show_mapname(widgetdata *widget);
00343 void clear_map();
00344 void display_mapscroll(int dx, int dy);
00345 void update_map_name(const char *name);
00346 void update_map_weather(const char *weather);
00347 void init_map_data(int xl, int yl, int px, int py);
00348 void align_tile_stretch(int x, int y);
00349 void adjust_tile_stretch();
00350 void map_set_data(int x, int y, int layer, sint16 face, uint8 quick_pos, uint8 obj_flags, const char *name, const char *name_color, sint16 height, uint8 probe, sint16 zoom, sint16 align, uint8 draw_double, uint8 alpha, sint16 rotate, uint8 infravision);
00351 void map_clear_cell(int x, int y);
00352 void map_set_darkness(int x, int y, uint8 darkness);
00353 void map_draw_map();
00354 void map_draw_one(int x, int y, _Sprite *sprite);
00355 void widget_map_mevent(widgetdata *widget, SDL_Event *event);
00356 void widget_map_render(widgetdata *widget);
00357 int mouse_to_tile_coords(int mx, int my, int *tx, int *ty);
00358 /* src/gui/menu_buttons.c */
00359 void widget_menubuttons(widgetdata *widget);
00360 void widget_menubuttons_event(widgetdata *widget, SDL_Event *event);
00361 /* src/gui/mplayer.c */
00362 void widget_show_mplayer(widgetdata *widget);
00363 void widget_mplayer_background(widgetdata *widget);
00364 void widget_mplayer_deinit(widgetdata *widget);
00365 void widget_mplayer_mevent(widgetdata *widget, SDL_Event *event);
00366 void mplayer_now_playing();
00367 /* src/gui/party.c */
00368 void widget_party_background(widgetdata *widget);
00369 void widget_party_render(widgetdata *widget);
00370 void widget_party_mevent(widgetdata *widget, SDL_Event *event);
00371 void PartyCmd(unsigned char *data, int len);
00372 /* src/gui/protections.c */
00373 void widget_show_resist(widgetdata *widget);
00374 /* src/gui/quickslots.c */
00375 void quickslots_init();
00376 void quickslots_handle_key(int slot);
00377 int get_quickslot(int x, int y);
00378 void show_quickslots(int x, int y, int vertical_quickslot);
00379 void widget_quickslots(widgetdata *widget);
00380 void widget_quickslots_mouse_event(widgetdata *widget, SDL_Event *event);
00381 void QuickSlotCmd(unsigned char *data, int len);
00382 /* src/gui/range.c */
00383 void widget_range_event(widgetdata *widget, int x, int y, SDL_Event event, int MEvent);
00384 void widget_show_range(widgetdata *widget);
00385 /* src/gui/region_map.c */
00386 void RegionMapCmd(uint8 *data, int len);
00387 void region_map_clear();
00388 void region_map_handle_key(SDLKey key);
00389 void region_map_handle_event(SDL_Event *event);
00390 void region_map_show();
00391 /* src/gui/settings.c */
00392 void settings_open();
00393 /* src/gui/skills.c */
00394 void widget_skills_render(widgetdata *widget);
00395 void widget_skills_mevent(widgetdata *widget, SDL_Event *event);
00396 int skill_find(const char *name, size_t *type, size_t *id);
00397 int skill_find_type_selected(const char *name, size_t *id);
00398 skill_entry_struct *skill_get(size_t type, size_t id);
00399 void skills_init();
00400 void skills_reload();
00401 void SkilllistCmd(char *data);
00402 /* src/gui/spells.c */
00403 void widget_spells_render(widgetdata *widget);
00404 void widget_spells_mevent(widgetdata *widget, SDL_Event *event);
00405 int spell_find(const char *name, size_t *spell_path, size_t *spell_id);
00406 int spell_find_path_selected(const char *name, size_t *spell_id);
00407 spell_entry_struct *spell_get(size_t spell_path, size_t spell_id);
00408 void spells_init();
00409 void spells_reload();
00410 void SpelllistCmd(char *data);
00411 /* src/gui/target.c */
00412 void widget_event_target(widgetdata *widget, int x, int y);
00413 void widget_show_target(widgetdata *widget);
00414 /* src/gui/textwin.c */
00415 void textwin_init();
00416 void textwin_scroll_adjust(widgetdata *widget);
00417 void textwin_readjust(widgetdata *widget);
00418 void draw_info_flags(const char *color, int flags, const char *str);
00419 void draw_info_format(const char *color, char *format, ...) __attribute__((format(printf, 2, 3)));
00420 void draw_info(const char *color, const char *str);
00421 void textwin_handle_copy();
00422 void textwin_show(int x, int y, int w, int h);
00423 void widget_textwin_show(widgetdata *widget);
00424 void textwin_event(widgetdata *widget, SDL_Event *event);
00425 void menu_textwin_clear(widgetdata *widget, int x, int y);
00426 void menu_textwin_font_inc(widgetdata *widget, int x, int y);
00427 void menu_textwin_font_dec(widgetdata *widget, int x, int y);
00428 /* src/gui/updater.c */
00429 void updater_open();
00430 /* src/toolkit/binreloc.c */
00431 int br_init(BrInitError *error);
00432 int br_init_lib(BrInitError *error);
00433 char *br_find_exe(const char *default_exe);
00434 char *br_find_exe_dir(const char *default_dir);
00435 char *br_find_prefix(const char *default_prefix);
00436 char *br_find_bin_dir(const char *default_bin_dir);
00437 char *br_find_sbin_dir(const char *default_sbin_dir);
00438 char *br_find_data_dir(const char *default_data_dir);
00439 char *br_find_locale_dir(const char *default_locale_dir);
00440 char *br_find_lib_dir(const char *default_lib_dir);
00441 char *br_find_libexec_dir(const char *default_libexec_dir);
00442 char *br_find_etc_dir(const char *default_etc_dir);
00443 char *br_strcat(const char *str1, const char *str2);
00444 char *br_build_path(const char *dir, const char *file);
00445 char *br_dirname(const char *path);
00446 /* src/toolkit/button.c */
00447 int button_show(int bitmap_id, int bitmap_id_over, int bitmap_id_clicked, int x, int y, const char *text, int font, const char *color, const char *color_shadow, const char *color_over, const char *color_over_shadow, uint64 flags);
00448 void button_create(button_struct *button);
00449 void button_render(button_struct *button, const char *text);
00450 int button_event(button_struct *button, SDL_Event *event);
00451 void button_tooltip(button_struct *button, int font, const char *text);
00452 /* src/toolkit/clipboard.c */
00453 int clipboard_init();
00454 int clipboard_set(const char *str);
00455 char *clipboard_get();
00456 /* src/toolkit/list.c */
00457 list_struct *list_get_focused();
00458 void list_set_focus(list_struct *list);
00459 void list_set_parent(list_struct *list, int px, int py);
00460 list_struct *list_create(uint32 id, uint32 max_rows, uint32 cols, int spacing);
00461 void list_add(list_struct *list, uint32 row, uint32 col, const char *str);
00462 void list_remove_row(list_struct *list, uint32 row);
00463 void list_set_column(list_struct *list, uint32 col, int width, int spacing, const char *name, int centered);
00464 void list_set_font(list_struct *list, int font);
00465 void list_scrollbar_enable(list_struct *list);
00466 void list_show(list_struct *list, int x, int y);
00467 void list_clear_rows(list_struct *list);
00468 void list_clear(list_struct *list);
00469 void list_offsets_ensure(list_struct *list);
00470 void list_remove(list_struct *list);
00471 void list_remove_all();
00472 int list_handle_keyboard(list_struct *list, SDL_KeyboardEvent *event);
00473 int lists_handle_keyboard(SDL_KeyboardEvent *event);
00474 int list_handle_mouse(list_struct *list, int mx, int my, SDL_Event *event);
00475 int lists_handle_mouse(int mx, int my, SDL_Event *event);
00476 list_struct *list_exists(uint32 id);
00477 void list_sort(list_struct *list, int type);
00478 int list_set_selected(list_struct *list, const char *str, uint32 col);
00479 /* src/toolkit/popup.c */
00480 popup_struct *popup_create(int bitmap_id);
00481 void popup_destroy_visible();
00482 int popup_overlay_need_update(popup_struct *popup);
00483 void popup_draw();
00484 int popup_handle_event(SDL_Event *event);
00485 popup_struct *popup_get_visible();
00486 /* src/toolkit/progress.c */
00487 void progress_dots_create(progress_dots *progress);
00488 void progress_dots_show(progress_dots *progress, SDL_Surface *surface, int x, int y);
00489 int progress_dots_width(progress_dots *progress);
00490 /* src/toolkit/range_buttons.c */
00491 int range_buttons_show(int x, int y, int *val, int advance);
00492 /* src/toolkit/scroll_buttons.c */
00493 void scroll_buttons_show(SDL_Surface *surface, int x, int y, int *pos, int max_pos, int advance, SDL_Rect *box);
00494 /* src/toolkit/SDL_gfx.c */
00495 int fastPixelColorNolock(SDL_Surface *dst, Sint16 x, Sint16 y, Uint32 color);
00496 int fastPixelColorNolockNoclip(SDL_Surface *dst, Sint16 x, Sint16 y, Uint32 color);
00497 int fastPixelColor(SDL_Surface *dst, Sint16 x, Sint16 y, Uint32 color);
00498 int fastPixelRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00499 int fastPixelRGBANolock(SDL_Surface *dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00500 int _putPixelAlpha(SDL_Surface *dst, Sint16 x, Sint16 y, Uint32 color, Uint8 alpha);
00501 int pixelColor(SDL_Surface *dst, Sint16 x, Sint16 y, Uint32 color);
00502 int pixelColorNolock(SDL_Surface *dst, Sint16 x, Sint16 y, Uint32 color);
00503 int _filledRectAlpha(SDL_Surface *dst, Sint16 xx, Sint16 yy, Sint16 x2, Sint16 y2, Uint32 color, Uint8 alpha);
00504 int filledRectAlpha(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Uint32 color);
00505 int _HLineAlpha(SDL_Surface *dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color);
00506 int _VLineAlpha(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 y2, Uint32 color);
00507 int pixelColorWeight(SDL_Surface *dst, Sint16 x, Sint16 y, Uint32 color, Uint32 weight);
00508 int pixelColorWeightNolock(SDL_Surface *dst, Sint16 x, Sint16 y, Uint32 color, Uint32 weight);
00509 int pixelRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00510 int hlineColorStore(SDL_Surface *dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color);
00511 int hlineRGBAStore(SDL_Surface *dst, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00512 int hlineColor(SDL_Surface *dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color);
00513 int hlineRGBA(SDL_Surface *dst, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00514 int vlineColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 y2, Uint32 color);
00515 int vlineRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00516 int rectangleColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Uint32 color);
00517 int rectangleRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00518 int roundedRectangleColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color);
00519 int roundedRectangleRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00520 int roundedBoxColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color);
00521 int roundedBoxRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00522 int boxColor(SDL_Surface *dst, Sint16 xx, Sint16 yy, Sint16 x2, Sint16 y2, Uint32 color);
00523 int boxRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00524 int lineColor(SDL_Surface *dst, Sint16 xx, Sint16 yy, Sint16 x2, Sint16 y2, Uint32 color);
00525 int lineRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00526 int _aalineColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Uint32 color, int draw_endpoint);
00527 int aalineColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Uint32 color);
00528 int aalineRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00529 int circleColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Uint32 color);
00530 int circleRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00531 int arcColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color);
00532 int arcRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00533 int aacircleColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Uint32 color);
00534 int aacircleRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00535 int filledCircleColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Uint32 color);
00536 int filledCircleRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00537 int ellipseColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color);
00538 int ellipseRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00539 int aaellipseColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color);
00540 int aaellipseRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00541 int filledEllipseColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color);
00542 int filledEllipseRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00543 int _pieColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color, Uint8 filled);
00544 int pieColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color);
00545 int pieRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00546 int filledPieColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color);
00547 int filledPieRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00548 int trigonColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color);
00549 int trigonRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00550 int aatrigonColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color);
00551 int aatrigonRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00552 int filledTrigonColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color);
00553 int filledTrigonRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00554 int polygonColor(SDL_Surface *dst, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color);
00555 int polygonRGBA(SDL_Surface *dst, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00556 int aapolygonColor(SDL_Surface *dst, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color);
00557 int aapolygonRGBA(SDL_Surface *dst, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00558 int _gfxPrimitivesCompareInt(const void *a, const void *b);
00559 int filledPolygonColorMT(SDL_Surface *dst, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color, int **polyInts, int *polyAllocated);
00560 int filledPolygonRGBAMT(SDL_Surface *dst, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a, int **polyInts, int *polyAllocated);
00561 int filledPolygonColor(SDL_Surface *dst, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color);
00562 int filledPolygonRGBA(SDL_Surface *dst, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00563 int _HLineTextured(SDL_Surface *dst, Sint16 x1, Sint16 x2, Sint16 y, SDL_Surface *texture, int texture_dx, int texture_dy);
00564 int texturedPolygonMT(SDL_Surface *dst, const Sint16 *vx, const Sint16 *vy, int n, SDL_Surface *texture, int texture_dx, int texture_dy, int **polyInts, int *polyAllocated);
00565 int texturedPolygon(SDL_Surface *dst, const Sint16 *vx, const Sint16 *vy, int n, SDL_Surface *texture, int texture_dx, int texture_dy);
00566 double _evaluateBezier(double *data, int ndata, double t);
00567 int bezierColor(SDL_Surface *dst, const Sint16 *vx, const Sint16 *vy, int n, int s, Uint32 color);
00568 int bezierRGBA(SDL_Surface *dst, const Sint16 *vx, const Sint16 *vy, int n, int s, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00569 int thickLineColor(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Uint8 width, Uint32 color);
00570 int thickLineRGBA(SDL_Surface *dst, Sint16 x, Sint16 y, Sint16 x2, Sint16 y2, Uint8 width, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00571 /* src/toolkit/SDL_rotozoom.c */
00572 Uint32 _colorkey(SDL_Surface *src);
00573 int _shrinkSurfaceRGBA(SDL_Surface *src, SDL_Surface *dst, int factorx, int factory);
00574 int _shrinkSurfaceY(SDL_Surface *src, SDL_Surface *dst, int factorx, int factory);
00575 int _zoomSurfaceRGBA(SDL_Surface *src, SDL_Surface *dst, int flipx, int flipy, int smooth);
00576 int _zoomSurfaceY(SDL_Surface *src, SDL_Surface *dst, int flipx, int flipy);
00577 void _transformSurfaceRGBA(SDL_Surface *src, SDL_Surface *dst, int cx, int cy, int isin, int icos, int flipx, int flipy, int smooth);
00578 void transformSurfaceY(SDL_Surface *src, SDL_Surface *dst, int cx, int cy, int isin, int icos, int flipx, int flipy);
00579 SDL_Surface *rotateSurface90Degrees(SDL_Surface *src, int numClockwiseTurns);
00580 void _rotozoomSurfaceSizeTrig(int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight, double *canglezoom, double *sanglezoom);
00581 void rotozoomSurfaceSizeXY(int width, int height, double angle, double zoomx, double zoomy, int *dstwidth, int *dstheight);
00582 void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth, int *dstheight);
00583 SDL_Surface *rotozoomSurface(SDL_Surface *src, double angle, double zoom, int smooth);
00584 SDL_Surface *rotozoomSurfaceXY(SDL_Surface *src, double angle, double zoomx, double zoomy, int smooth);
00585 void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight);
00586 SDL_Surface *zoomSurface(SDL_Surface *src, double zoomx, double zoomy, int smooth);
00587 SDL_Surface *shrinkSurface(SDL_Surface *src, int factorx, int factory);
00588 /* src/toolkit/sha1.c */
00589 void sha1_starts(sha1_context *ctx);
00590 void sha1_update(sha1_context *ctx, const unsigned char *input, size_t ilen);
00591 void sha1_finish(sha1_context *ctx, unsigned char output[20]);
00592 void sha1(const unsigned char *input, size_t ilen, unsigned char output[20]);
00593 int sha1_file(const char *path, unsigned char output[20]);
00594 void sha1_hmac_starts(sha1_context *ctx, const unsigned char *key, size_t keylen);
00595 void sha1_hmac_update(sha1_context *ctx, const unsigned char *input, size_t ilen);
00596 void sha1_hmac_finish(sha1_context *ctx, unsigned char output[20]);
00597 void sha1_hmac_reset(sha1_context *ctx);
00598 void sha1_hmac(const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char output[20]);
00599 /* src/toolkit/text.c */
00600 void text_init();
00601 void text_deinit();
00602 void text_offset_set(int x, int y);
00603 void text_offset_reset();
00604 void text_color_set(int r, int g, int b);
00605 void text_set_selection(sint64 *start, sint64 *end, uint8 *started);
00606 const char *get_font_filename(int font);
00607 int get_font_id(const char *name, size_t size);
00608 char *text_strip_markup(char *buf, size_t *buf_len, uint8 do_free);
00609 int text_color_parse(const char *color_notation, SDL_Color *color);
00610 int blt_character(int *font, int orig_font, SDL_Surface *surface, SDL_Rect *dest, const char *cp, SDL_Color *color, SDL_Color *orig_color, uint64 flags, SDL_Rect *box, int *x_adjust);
00611 int glyph_get_width(int font, char c);
00612 int glyph_get_height(int font, char c);
00613 void string_blt(SDL_Surface *surface, int font, const char *text, int x, int y, const char *color_notation, uint64 flags, SDL_Rect *box);
00614 void string_blt_shadow(SDL_Surface *surface, int font, const char *text, int x, int y, const char *color_notation, const char *color_shadow_notation, uint64 flags, SDL_Rect *box);
00615 void string_blt_format(SDL_Surface *surface, int font, int x, int y, const char *color_notation, uint64 flags, SDL_Rect *box, const char *text, ...) __attribute__((format(printf, 8, 9)));
00616 void string_blt_shadow_format(SDL_Surface *surface, int font, int x, int y, const char *color_notation, const char *color_shadow_notation, uint64 flags, SDL_Rect *box, const char *text, ...) __attribute__((format(printf, 9, 10)));
00617 int string_get_width(int font, const char *text, uint64 flags);
00618 int string_get_height(int font, const char *text, uint64 flags);
00619 void string_truncate_overflow(int font, char *text, int max_width);
00620 void text_enable_debug();
00621 /* src/toolkit/text_input.c */
00622 int text_input_center_offset();
00623 void text_input_draw_background(SDL_Surface *surface, int x, int y, int bitmap);
00624 void text_input_draw_text(SDL_Surface *surface, int x, int y, int font, const char *text, const char *color_notation, uint64 flags, int bitmap, SDL_Rect *box);
00625 void text_input_show(SDL_Surface *surface, int x, int y, int font, const char *text, const char *color_notation, uint64 flags, int bitmap, SDL_Rect *box);
00626 void text_input_clear();
00627 void text_input_open(int maxchar);
00628 void text_input_history_clear();
00629 void text_input_add_string(const char *text);
00630 int text_input_handle(SDL_KeyboardEvent *key);
00631 /* src/toolkit/tooltip.c */
00632 void tooltip_create(int mx, int my, int font, const char *text);
00633 void tooltip_show();
00634 /* src/toolkit/widget.c*/
00635 void init_widgets_fromCurrent();
00636 widgetdata *create_widget_object(int widget_subtype_id);
00637 void remove_widget_object(widgetdata *widget);
00638 void remove_widget_object_intern(widgetdata *widget);
00639 void remove_widget_inv(widgetdata *widget);
00640 void init_widgets();
00641 void kill_widgets();
00642 void reset_widget(const char *name);
00643 void widgets_ensure_onscreen();
00644 void kill_widget_tree(widgetdata *widget);
00645 widgetdata *create_widget(int widget_id);
00646 void remove_widget(widgetdata *widget);
00647 void detach_widget(widgetdata *widget);
00648 void save_interface_file();
00649 void save_interface_file_rec(widgetdata *widget, FILE *stream);
00650 int widget_event_mousedn(int x, int y, SDL_Event *event);
00651 int widget_event_mouseup(int x, int y, SDL_Event *event);
00652 int widget_event_mousemv(int x, int y, SDL_Event *event);
00653 int widget_event_start_move(widgetdata *widget, int x, int y);
00654 int widget_event_respond(int x, int y);
00655 int widget_event_override();
00656 widgetdata *get_widget_owner(int x, int y, widgetdata *start, widgetdata *end);
00657 widgetdata *get_widget_owner_rec(int x, int y, widgetdata *widget, widgetdata *end);
00658 void process_widgets();
00659 void process_widgets_rec(widgetdata *widget);
00660 void SetPriorityWidget(widgetdata *node);
00661 void SetPriorityWidget_reverse(widgetdata *node);
00662 void insert_widget_in_container(widgetdata *widget_container, widgetdata *widget);
00663 widgetdata *get_outermost_container(widgetdata *widget);
00664 widgetdata *widget_find_by_surface(SDL_Surface *surface);
00665 void move_widget(widgetdata *widget, int x, int y);
00666 void move_widget_rec(widgetdata *widget, int x, int y);
00667 void resize_widget(widgetdata *widget, int side, int offset);
00668 void resize_widget_rec(widgetdata *widget, int x, int width, int y, int height);
00669 widgetdata *add_label(char *text, int font, const char *color);
00670 widgetdata *add_bitmap(int bitmap_id);
00671 widgetdata *create_menu(int x, int y, widgetdata *owner);
00672 void add_menuitem(widgetdata *menu, char *text, void (*menu_func_ptr)(widgetdata *, int, int), int menu_type, int val);
00673 void add_separator(widgetdata *widget);
00674 void menu_finalize(widgetdata *widget);
00675 void widget_redraw_all(int widget_type_id);
00676 void menu_move_widget(widgetdata *widget, int x, int y);
00677 void menu_create_widget(widgetdata *widget, int x, int y);
00678 void menu_remove_widget(widgetdata *widget, int x, int y);
00679 void menu_detach_widget(widgetdata *widget, int x, int y);
00680 void menu_set_say_filter(widgetdata *widget, int x, int y);
00681 void menu_set_shout_filter(widgetdata *widget, int x, int y);
00682 void menu_set_gsay_filter(widgetdata *widget, int x, int y);
00683 void menu_set_tell_filter(widgetdata *widget, int x, int y);
00684 void menu_set_channel_filter(widgetdata *widget, int x, int y);
00685 void submenu_chatwindow_filters(widgetdata *widget, int x, int y);
00686 void menu_inv_filter_all();
00687 void menu_inv_filter_applied();
00688 void menu_inv_filter_containers();
00689 void menu_inv_filter_magical();
00690 void menu_inv_filter_cursed();
00691 void menu_inv_filter_unidentified();
00692 void menu_inv_filter_locked();
00693 void menu_inv_filter_unapplied();
00694 #endif