summaryrefslogtreecommitdiff
path: root/apps/plugins/text_viewer/tv_display.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/text_viewer/tv_display.h')
-rw-r--r--apps/plugins/text_viewer/tv_display.h175
1 files changed, 175 insertions, 0 deletions
diff --git a/apps/plugins/text_viewer/tv_display.h b/apps/plugins/text_viewer/tv_display.h
new file mode 100644
index 0000000000..005011c756
--- /dev/null
+++ b/apps/plugins/text_viewer/tv_display.h
@@ -0,0 +1,175 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2010 Yoshihisa Uchida
11 *
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.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef PLUGIN_TEXT_VIEWER_DISPLAY_H
22#define PLUGIN_TEXT_VIEWER_DISPLAY_H
23
24#include "plugin.h"
25#include "tv_screen_pos.h"
26
27/* text viewer layout parts functions */
28#ifdef HAVE_LCD_BITMAP
29
30/* show headaer */
31void tv_show_header(void);
32
33/*
34 * show footer
35 *
36 * [In] pos
37 * the current position
38 */
39void tv_show_footer(const struct tv_screen_pos *pos);
40
41/*
42 * initialize the scrollbar
43 *
44 * [In] total
45 * total text size
46 *
47 * [In] show_scrollbar
48 * true: show the vertical scrollbar
49 * false: does not show the vertical scrollbar
50 */
51void tv_init_scrollbar(off_t total, bool show_scrollbar);
52
53/*
54 * show horizontal/vertical scrollbar
55 *
56 * [In] window
57 * the current window
58 *
59 * [In] col
60 * the current column
61 *
62 * [In] cur_pos
63 * the current text position
64 *
65 * [In] size
66 * the size of text in displayed.
67 */
68void tv_show_scrollbar(int window, int col, off_t cur_pos, int size);
69
70#else
71
72/*
73 * put the bookmark icon
74 *
75 * [In] row
76 * the row where the bookmark icon is put
77 */
78void tv_put_bookmark_icon(int row);
79
80#endif
81
82/* common display functons */
83
84/* initialized display functions */
85void tv_init_display(void);
86
87/* start the display processing */
88void tv_start_display(void);
89
90/* end the display processing */
91void tv_end_display(void);
92
93/* clear the display */
94void tv_clear_display(void);
95
96/*update the display */
97void tv_update_display(void);
98
99#ifdef HAVE_LCD_BITMAP
100
101/*
102 * set the drawmode
103 *
104 * [In] mode
105 * new drawmode
106 */
107void tv_set_drawmode(int mode);
108
109/*
110 * draw the rectangle that paints out inside
111 *
112 * [In] col
113 * the column of the upper left
114 *
115 * [In] row
116 * the row of the upper left
117 *
118 * [In] row
119 * draw rows
120 */
121void tv_fillrect(int col, int row, int rows);
122
123#endif
124
125/*
126 * draw the text
127 *
128 * [In] row
129 * the row that displays the text
130 *
131 * [In] text
132 * text
133 *
134 * [In] offset
135 * display the text that is since offset columns
136 */
137void tv_draw_text(int row, const unsigned char *text, int offset);
138
139/* layout functions */
140#ifdef HAVE_LCD_BITMAP
141
142/*
143 * set the layout
144 *
145 * [In] col_w
146 * width per column
147 *
148 * [In] show_scrollbar
149 * true: show the vertical scrollbar
150 * false: does not show the vertical scrollbar
151 */
152void tv_set_layout(int col_w, bool show_scrollbar);
153
154#else
155
156/*
157 * set the layout
158 *
159 * [In] col_w
160 * width per column
161 */
162void tv_set_layout(int col_w);
163
164#endif
165void tv_get_drawarea_info(int *width, int *cols, int *rows);
166
167/* viewport functions */
168
169/* change the viewport */
170void tv_change_viewport(void);
171
172/* undo the viewport */
173void tv_undo_viewport(void);
174
175#endif