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
24 #include "tv_screen_pos.h"
26 /* stuff for the screen access */
29 * initialize the display module
32 * the start pointer of the buffer
38 * true initialize success
39 * false initialize failure
41 bool tv_init_display(unsigned char **buf
, size_t *size
);
43 /* finalize the display module */
44 void tv_finalize_display(void);
50 * the row that displays the text
56 * display the text that is since offset columns
58 void tv_draw_text(int row
, const unsigned char *text
, int offset
);
64 * the array of row where the bookmark
67 * want to show bookmark count
69 void tv_show_bookmarks(const int *rows
, int count
);
72 * update extra parts (header, footer, scrollbar, etc.)
81 * current screen position (file position, page, line)
84 * the size of text which is displayed.
86 void tv_update_extra(int window
, int col
, const struct tv_screen_pos
*pos
, int size
);
89 * initialize the scrollbar
95 * true: show the vertical scrollbar
96 * false: does not show the vertical scrollbar
98 void tv_init_scrollbar(off_t total
, bool show_scrollbar
);
100 /* start the display processing */
101 void tv_start_display(void);
103 /* end the display processing */
104 void tv_end_display(void);
107 /* layout functions */
112 * [In] show_scrollbar
113 * true: show the vertical scrollbar
114 * false: does not show the vertical scrollbar
116 void tv_set_layout(bool show_scrollbar
);
119 * get the draw area info
122 * width of the draw area
125 * column count of the draw area
128 * row count of the draw area
130 void tv_get_drawarea_info(int *width
, int *cols
, int *rows
);
133 * whether exist scrollbar
136 * true exist scrollbar
137 * false does not exist scrollbar
139 bool tv_exist_scrollbar(void);