diff options
author | Yoshihisa Uchida <uchida@rockbox.org> | 2010-06-05 10:30:08 +0000 |
---|---|---|
committer | Yoshihisa Uchida <uchida@rockbox.org> | 2010-06-05 10:30:08 +0000 |
commit | fdba8404503af0448586615330a7b27f2ced531c (patch) | |
tree | bb15677a7a720675ac2666f11e62042f3b2639ad /apps/plugins/text_viewer/tv_pager.h | |
parent | 991e92fd3dc15f1e365761264c26305559ddb0a4 (diff) | |
download | rockbox-fdba8404503af0448586615330a7b27f2ced531c.tar.gz rockbox-fdba8404503af0448586615330a7b27f2ced531c.zip |
reworks text viewer plugin. (FS#11209)
new text viewer plugin: text_viewer.rock.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26571 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/text_viewer/tv_pager.h')
-rw-r--r-- | apps/plugins/text_viewer/tv_pager.h | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/apps/plugins/text_viewer/tv_pager.h b/apps/plugins/text_viewer/tv_pager.h new file mode 100644 index 0000000000..798d694ce5 --- /dev/null +++ b/apps/plugins/text_viewer/tv_pager.h | |||
@@ -0,0 +1,104 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 Gilles Roux | ||
11 | * 2003 Garrett Derner | ||
12 | * 2010 Yoshihisa Uchida | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or | ||
15 | * modify it under the terms of the GNU General Public License | ||
16 | * as published by the Free Software Foundation; either version 2 | ||
17 | * of the License, or (at your option) any later version. | ||
18 | * | ||
19 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
20 | * KIND, either express or implied. | ||
21 | * | ||
22 | ****************************************************************************/ | ||
23 | #ifndef PLUGIN_TEXT_VIEWER_PAGER_H | ||
24 | #define PLUGIN_TEXT_VIEWER_PAGER_H | ||
25 | |||
26 | #include "tv_screen_pos.h" | ||
27 | |||
28 | /* stuff for the paging */ | ||
29 | |||
30 | /* | ||
31 | * initialize the pager module | ||
32 | * | ||
33 | * [In] buf | ||
34 | * the start pointer of the buffer | ||
35 | * | ||
36 | * [In] size | ||
37 | * enabled buffer size | ||
38 | * | ||
39 | * [Out] used_size | ||
40 | * the size of the buffer which the pager uses | ||
41 | * | ||
42 | * return | ||
43 | * true initialize success | ||
44 | * false initialize failure | ||
45 | */ | ||
46 | bool tv_init_pager(unsigned char *buf, size_t bufsize, size_t *used_size); | ||
47 | |||
48 | /* finalize the pager module */ | ||
49 | void tv_finalize_pager(void); | ||
50 | |||
51 | /* reset the stored line positions */ | ||
52 | void tv_reset_line_positions(void); | ||
53 | |||
54 | /* | ||
55 | * move to the next line | ||
56 | * | ||
57 | * [In] size | ||
58 | * the current line size | ||
59 | */ | ||
60 | void tv_move_next_line(int size); | ||
61 | |||
62 | /* | ||
63 | * return the distance from the top of the current page | ||
64 | * | ||
65 | * [In] offset | ||
66 | * the difference between the current line | ||
67 | * | ||
68 | * return | ||
69 | * difference between the current line + offset from the top of the current page | ||
70 | */ | ||
71 | int tv_get_line_positions(int offset); | ||
72 | |||
73 | /* change the new page */ | ||
74 | void tv_new_page(void); | ||
75 | |||
76 | /* | ||
77 | * convert the given file position to the nearest the position (page, line) | ||
78 | * | ||
79 | * [In] fpos | ||
80 | * the file position which want to convert | ||
81 | * | ||
82 | * [Out] pos | ||
83 | * result | ||
84 | */ | ||
85 | void tv_convert_fpos(off_t fpos, struct tv_screen_pos *pos); | ||
86 | |||
87 | /* | ||
88 | * move to the given page and line | ||
89 | * | ||
90 | * [In] page_offset | ||
91 | * page offset | ||
92 | * | ||
93 | * [In] line_offset | ||
94 | * line offset | ||
95 | * | ||
96 | * [In] whence | ||
97 | * SEEK_CUR seek to the current page + offset page, the current line + offset line. | ||
98 | * SEEK_SET seek to the offset page, offset line. | ||
99 | * SEEK_END seek to the reading last page + offset page, | ||
100 | * the last line of the reading last page + offset line. | ||
101 | */ | ||
102 | void tv_move_screen(int page_offset, int line_offset, int whence); | ||
103 | |||
104 | #endif | ||