1 /*  Copyright (C) 2001-2004  Kenichi Suto
2  *
3  *  This program is free software; you can redistribute it and/or modify
4  *  it under the terms of the GNU General Public License as published by
5  *  the Free Software Foundation; either version 2 of the License, or
6  *  (at your option) any later version.
7  *
8  *  This program is distributed in the hope that it will be useful,
9  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  *  GNU General Public License for more details.
12  *
13  *  You should have received a copy of the GNU General Public License
14  *  along with this program; if not, write to the Free Software
15  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16 */
17 
18 #ifndef __EB_H_
19 #define __EB_H_
20 
21 #include "defs.h"
22 
23 BOOK_INFO *load_book(const char *book_path, int subbook_no, gchar *appendix_path, gint appendix_subbook_no, gchar *fg, gchar *bg);
24 void unload_book(BOOK_INFO *binfo);
25 void check_search_method();
26 gint ebook_start();
27 gint ebook_end();
28 void split_word(const gchar *word, gchar **keywords);
29 void cat_word(char *string, char **words);
30 void free_words(char **words);
31 gint ebook_search(const char *g_word, gint method);
32 gint ebook_search_auto(char *g_word, gint method);
33 gint ebook_simple_search(BOOK_INFO *binfo, char *word, gint method, gchar *title);
34 gint ebook_search_method();
35 
36 gchar *ebook_get_heading(BOOK_INFO *binfo, int page, int offset);
37 gchar *ebook_get_text(BOOK_INFO *binfo, int page, int offset);
38 gchar *ebook_get_candidate(BOOK_INFO *binfo, int page, int offset);
39 EB_Error_Code ebook_forward_text(BOOK_INFO *binfo);
40 EB_Error_Code ebook_backward_text(BOOK_INFO *binfo);
41 void ebook_tell_text(BOOK_INFO *binfo, gint *page, gint *offset);
42 EB_Error_Code ebook_menu(BOOK_INFO *binfo, EB_Position *pos);
43 EB_Error_Code ebook_copyright(BOOK_INFO *binfo, EB_Position *pos);
44 gchar *ebook_error_message(EB_Error_Code error_code);
45 
46 guchar *read_gaiji_as_bitmap(BOOK_INFO *binfo, gchar *name, gint size, gint *width, gint *height);
47 guchar *read_gaiji_as_xbm(BOOK_INFO *binfo, gchar *name, gchar *fname, guint fg, guint bg);
48 gchar **read_gaiji_as_xpm(BOOK_INFO *binfo, gchar *name, gint size, gint *width, gint *height, gchar *color);
49 gint check_gaiji_size(BOOK_INFO *binfo, gint prefered_size);
50 EB_Error_Code ebook_output_wave(BOOK_INFO *binfo, gchar *filename, gint page, gint offset, gint size);
51 EB_Error_Code ebook_output_mpeg(BOOK_INFO *binfo, gchar *srcname, gchar *destname);
52 EB_Error_Code ebook_output_color(BOOK_INFO *binfo, gchar *filename, gint page, gint offset);
53 EB_Error_Code ebook_output_gray(BOOK_INFO *binfo, gchar *filename, gint page, gint offset, gint width, gint height);
54 EB_Error_Code ebook_output_mono(BOOK_INFO *binfo, gchar *filename, gint page, gint offset, gint width, gint height);
55 gchar *ebook_get_rawtext(BOOK_INFO *binfo, gint page, gint offset);
56 EB_Error_Code ebook_set_subbook(BOOK_INFO *binfo);
57 
58 #endif /* __EB_H_ */
59 
60