1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2010 Yoshihisa Uchida
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #ifndef PLUGIN_TEXT_VIEWER_DISPLAY_H
22 #define PLUGIN_TEXT_VIEWER_DISPLAY_H
25 #include "tv_screen_pos.h"
27 /* stuff for the screen access */
30 * initialize the display module
33 * the start pointer of the buffer
39 * true initialize success
40 * false initialize failure
42 bool tv_init_display(unsigned char **buf
, size_t *size
);
44 /* finalize the display module */
45 void tv_finalize_display(void);
48 /* layout parts accessing functions */
50 #ifdef HAVE_LCD_BITMAP
53 void tv_show_header(void);
59 * the current position
61 void tv_show_footer(const struct tv_screen_pos
*pos
);
64 * initialize the scrollbar
70 * true: show the vertical scrollbar
71 * false: does not show the vertical scrollbar
73 void tv_init_scrollbar(off_t total
, bool show_scrollbar
);
76 * show horizontal/vertical scrollbar
85 * the current text position
88 * the size of text in displayed.
90 void tv_show_scrollbar(int window
, int col
, off_t cur_pos
, int size
);
98 * the array of row where the bookmark
101 * want to show bookmark count
103 void tv_show_bookmarks(const int *rows
, int count
);
105 /* common display functons */
107 /* start the display processing */
108 void tv_start_display(void);
110 /* end the display processing */
111 void tv_end_display(void);
113 /*update the display */
114 void tv_update_display(void);
120 * the row that displays the text
126 * display the text that is since offset columns
128 void tv_draw_text(int row
, const unsigned char *text
, int offset
);
131 /* layout functions */
136 * [In] show_scrollbar
137 * true: show the vertical scrollbar
138 * false: does not show the vertical scrollbar
140 void tv_set_layout(bool show_scrollbar
);
143 * get the draw area info
146 * width of the draw area
149 * column count of the draw area
152 * row count of the draw area
154 void tv_get_drawarea_info(int *width
, int *cols
, int *rows
);