diff options
author | Yoshihisa Uchida <uchida@rockbox.org> | 2010-06-26 09:14:53 +0000 |
---|---|---|
committer | Yoshihisa Uchida <uchida@rockbox.org> | 2010-06-26 09:14:53 +0000 |
commit | ac622c6d673c708d48527db8a189401422a5d03c (patch) | |
tree | fb6bbde022027ccf24b2cb1be49a3c7369cf45e0 /apps/plugins/text_viewer/tv_display.h | |
parent | be70fd89be787e2b24604f9ba785b87c1f8f1d22 (diff) | |
download | rockbox-ac622c6d673c708d48527db8a189401422a5d03c.tar.gz rockbox-ac622c6d673c708d48527db8a189401422a5d03c.zip |
text viewer: reworks screen access logics and some bugs fix.
- screen access logics separte from tv_window. (new tv_display.[ch])
- using multi screen api.
- (bug fix) the head of the each line is not normally displayed when the alignment is RIGHT.
- (bug fix) unnecessary blank line is not displayed. (a part of FS#11400).
- (bug fix) the order by which callback functions were called was not correct. (FIFO->FILO)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27138 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/text_viewer/tv_display.h')
-rw-r--r-- | apps/plugins/text_viewer/tv_display.h | 175 |
1 files changed, 175 insertions, 0 deletions
diff --git a/apps/plugins/text_viewer/tv_display.h b/apps/plugins/text_viewer/tv_display.h new file mode 100644 index 0000000000..005011c756 --- /dev/null +++ b/apps/plugins/text_viewer/tv_display.h | |||
@@ -0,0 +1,175 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2010 Yoshihisa Uchida | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #ifndef PLUGIN_TEXT_VIEWER_DISPLAY_H | ||
22 | #define PLUGIN_TEXT_VIEWER_DISPLAY_H | ||
23 | |||
24 | #include "plugin.h" | ||
25 | #include "tv_screen_pos.h" | ||
26 | |||
27 | /* text viewer layout parts functions */ | ||
28 | #ifdef HAVE_LCD_BITMAP | ||
29 | |||
30 | /* show headaer */ | ||
31 | void tv_show_header(void); | ||
32 | |||
33 | /* | ||
34 | * show footer | ||
35 | * | ||
36 | * [In] pos | ||
37 | * the current position | ||
38 | */ | ||
39 | void tv_show_footer(const struct tv_screen_pos *pos); | ||
40 | |||
41 | /* | ||
42 | * initialize the scrollbar | ||
43 | * | ||
44 | * [In] total | ||
45 | * total text size | ||
46 | * | ||
47 | * [In] show_scrollbar | ||
48 | * true: show the vertical scrollbar | ||
49 | * false: does not show the vertical scrollbar | ||
50 | */ | ||
51 | void tv_init_scrollbar(off_t total, bool show_scrollbar); | ||
52 | |||
53 | /* | ||
54 | * show horizontal/vertical scrollbar | ||
55 | * | ||
56 | * [In] window | ||
57 | * the current window | ||
58 | * | ||
59 | * [In] col | ||
60 | * the current column | ||
61 | * | ||
62 | * [In] cur_pos | ||
63 | * the current text position | ||
64 | * | ||
65 | * [In] size | ||
66 | * the size of text in displayed. | ||
67 | */ | ||
68 | void tv_show_scrollbar(int window, int col, off_t cur_pos, int size); | ||
69 | |||
70 | #else | ||
71 | |||
72 | /* | ||
73 | * put the bookmark icon | ||
74 | * | ||
75 | * [In] row | ||
76 | * the row where the bookmark icon is put | ||
77 | */ | ||
78 | void tv_put_bookmark_icon(int row); | ||
79 | |||
80 | #endif | ||
81 | |||
82 | /* common display functons */ | ||
83 | |||
84 | /* initialized display functions */ | ||
85 | void tv_init_display(void); | ||
86 | |||
87 | /* start the display processing */ | ||
88 | void tv_start_display(void); | ||
89 | |||
90 | /* end the display processing */ | ||
91 | void tv_end_display(void); | ||
92 | |||
93 | /* clear the display */ | ||
94 | void tv_clear_display(void); | ||
95 | |||
96 | /*update the display */ | ||
97 | void tv_update_display(void); | ||
98 | |||
99 | #ifdef HAVE_LCD_BITMAP | ||
100 | |||
101 | /* | ||
102 | * set the drawmode | ||
103 | * | ||
104 | * [In] mode | ||
105 | * new drawmode | ||
106 | */ | ||
107 | void tv_set_drawmode(int mode); | ||
108 | |||
109 | /* | ||
110 | * draw the rectangle that paints out inside | ||
111 | * | ||
112 | * [In] col | ||
113 | * the column of the upper left | ||
114 | * | ||
115 | * [In] row | ||
116 | * the row of the upper left | ||
117 | * | ||
118 | * [In] row | ||
119 | * draw rows | ||
120 | */ | ||
121 | void tv_fillrect(int col, int row, int rows); | ||
122 | |||
123 | #endif | ||
124 | |||
125 | /* | ||
126 | * draw the text | ||
127 | * | ||
128 | * [In] row | ||
129 | * the row that displays the text | ||
130 | * | ||
131 | * [In] text | ||
132 | * text | ||
133 | * | ||
134 | * [In] offset | ||
135 | * display the text that is since offset columns | ||
136 | */ | ||
137 | void tv_draw_text(int row, const unsigned char *text, int offset); | ||
138 | |||
139 | /* layout functions */ | ||
140 | #ifdef HAVE_LCD_BITMAP | ||
141 | |||
142 | /* | ||
143 | * set the layout | ||
144 | * | ||
145 | * [In] col_w | ||
146 | * width per column | ||
147 | * | ||
148 | * [In] show_scrollbar | ||
149 | * true: show the vertical scrollbar | ||
150 | * false: does not show the vertical scrollbar | ||
151 | */ | ||
152 | void tv_set_layout(int col_w, bool show_scrollbar); | ||
153 | |||
154 | #else | ||
155 | |||
156 | /* | ||
157 | * set the layout | ||
158 | * | ||
159 | * [In] col_w | ||
160 | * width per column | ||
161 | */ | ||
162 | void tv_set_layout(int col_w); | ||
163 | |||
164 | #endif | ||
165 | void tv_get_drawarea_info(int *width, int *cols, int *rows); | ||
166 | |||
167 | /* viewport functions */ | ||
168 | |||
169 | /* change the viewport */ | ||
170 | void tv_change_viewport(void); | ||
171 | |||
172 | /* undo the viewport */ | ||
173 | void tv_undo_viewport(void); | ||
174 | |||
175 | #endif | ||