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 /* text viewer layout parts functions */
28 #ifdef HAVE_LCD_BITMAP
31 void tv_show_header(void);
37 * the current position
39 void tv_show_footer(const struct tv_screen_pos
*pos
);
42 * initialize the scrollbar
48 * true: show the vertical scrollbar
49 * false: does not show the vertical scrollbar
51 void tv_init_scrollbar(off_t total
, bool show_scrollbar
);
54 * show horizontal/vertical scrollbar
63 * the current text position
66 * the size of text in displayed.
68 void tv_show_scrollbar(int window
, int col
, off_t cur_pos
, int size
);
75 * the array of row where the bookmark
78 * want to show bookmark count
80 void tv_show_bookmarks(const int *rows
, int count
);
82 /* common display functons */
84 /* initialized display functions */
85 void tv_init_display(void);
87 /* start the display processing */
88 void tv_start_display(void);
90 /* end the display processing */
91 void tv_end_display(void);
93 /*update the display */
94 void tv_update_display(void);
100 * the row that displays the text
106 * display the text that is since offset columns
108 void tv_draw_text(int row
, const unsigned char *text
, int offset
);
110 /* layout functions */
111 #ifdef HAVE_LCD_BITMAP
119 * [In] show_scrollbar
120 * true: show the vertical scrollbar
121 * false: does not show the vertical scrollbar
123 void tv_set_layout(int col_w
, bool show_scrollbar
);
133 void tv_set_layout(int col_w
);
138 * get the draw area info
141 * width of the draw area
144 * column count of the draw area
147 * row count of the draw area
149 void tv_get_drawarea_info(int *width
, int *cols
, int *rows
);
151 /* viewport functions */
153 /* change the viewport */
154 void tv_change_viewport(void);
156 /* undo the viewport */
157 void tv_undo_viewport(void);