text viewer: simplify display functions.
[kugel-rb.git] / apps / plugins / text_viewer / tv_display.h
blobaa30436c4c52079a27f75933ef704b57e6e05222
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);
69 #endif
72 * show bookmark
74 * [In] rows
75 * the array of row where the bookmark
77 * [In] count
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);
97 * draw the text
99 * [In] row
100 * the row that displays the text
102 * [In] text
103 * text
105 * [In] offset
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
114 * set the layout
116 * [In] col_w
117 * width per column
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);
125 #else
128 * set the layout
130 * [In] col_w
131 * width per column
133 void tv_set_layout(int col_w);
135 #endif
138 * get the draw area info
140 * [Out] width
141 * width of the draw area
143 * [Out] cols
144 * column count of the draw area
146 * [Out] width
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);
159 #endif