005011c756e625794187fc10394e56fc4431ef6c
[kugel-rb.git] / apps / plugins / text_viewer / tv_display.h
blob005011c756e625794187fc10394e56fc4431ef6c
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
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 "plugin.h"
25 #include "tv_screen_pos.h"
27 /* text viewer layout parts functions */
28 #ifdef HAVE_LCD_BITMAP
30 /* show headaer */
31 void tv_show_header(void);
34 * show footer
36 * [In] pos
37 * the current position
39 void tv_show_footer(const struct tv_screen_pos *pos);
42 * initialize the scrollbar
44 * [In] total
45 * total text size
47 * [In] show_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
56 * [In] window
57 * the current window
59 * [In] col
60 * the current column
62 * [In] cur_pos
63 * the current text position
65 * [In] size
66 * the size of text in displayed.
68 void tv_show_scrollbar(int window, int col, off_t cur_pos, int size);
70 #else
73 * put the bookmark icon
75 * [In] row
76 * the row where the bookmark icon is put
78 void tv_put_bookmark_icon(int row);
80 #endif
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 /* clear the display */
94 void tv_clear_display(void);
96 /*update the display */
97 void tv_update_display(void);
99 #ifdef HAVE_LCD_BITMAP
102 * set the drawmode
104 * [In] mode
105 * new drawmode
107 void tv_set_drawmode(int mode);
110 * draw the rectangle that paints out inside
112 * [In] col
113 * the column of the upper left
115 * [In] row
116 * the row of the upper left
118 * [In] row
119 * draw rows
121 void tv_fillrect(int col, int row, int rows);
123 #endif
126 * draw the text
128 * [In] row
129 * the row that displays the text
131 * [In] text
132 * text
134 * [In] offset
135 * display the text that is since offset columns
137 void tv_draw_text(int row, const unsigned char *text, int offset);
139 /* layout functions */
140 #ifdef HAVE_LCD_BITMAP
143 * set the layout
145 * [In] col_w
146 * width per column
148 * [In] show_scrollbar
149 * true: show the vertical scrollbar
150 * false: does not show the vertical scrollbar
152 void tv_set_layout(int col_w, bool show_scrollbar);
154 #else
157 * set the layout
159 * [In] col_w
160 * width per column
162 void tv_set_layout(int col_w);
164 #endif
165 void tv_get_drawarea_info(int *width, int *cols, int *rows);
167 /* viewport functions */
169 /* change the viewport */
170 void tv_change_viewport(void);
172 /* undo the viewport */
173 void tv_undo_viewport(void);
175 #endif