67709f825db2bc38db8f13828f227b06d6070d0b
[kugel-rb.git] / apps / plugins / text_viewer / tv_display.h
blob67709f825db2bc38db8f13828f227b06d6070d0b
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 /* stuff for the screen access */
30 * initialize the display module
32 * [In/Out] buf
33 * the start pointer of the buffer
35 * [In/Out] size
36 * buffer size
38 * return
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
52 /* show headaer */
53 void tv_show_header(void);
56 * show footer
58 * [In] pos
59 * the current position
61 void tv_show_footer(const struct tv_screen_pos *pos);
64 * initialize the scrollbar
66 * [In] total
67 * total text size
69 * [In] show_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
78 * [In] window
79 * the current window
81 * [In] col
82 * the current column
84 * [In] cur_pos
85 * the current text position
87 * [In] size
88 * the size of text in displayed.
90 void tv_show_scrollbar(int window, int col, off_t cur_pos, int size);
93 * show bookmark
95 * [In] rows
96 * the array of row where the bookmark
98 * [In] count
99 * want to show bookmark count
101 void tv_show_bookmarks(const int *rows, int count);
103 #endif
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);
117 * draw the text
119 * [In] row
120 * the row that displays the text
122 * [In] text
123 * text
125 * [In] offset
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 */
134 * set the layout
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
145 * [Out] width
146 * width of the draw area
148 * [Out] cols
149 * column count of the draw area
151 * [Out] width
152 * row count of the draw area
154 void tv_get_drawarea_info(int *width, int *cols, int *rows);
156 #endif