Prepare new maemo release
[maemo-rb.git] / apps / plugins / text_viewer / tv_display.h
blobf6a3d19b7858f33d99ebd144059db8c702e6611b
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 "tv_screen_pos.h"
26 /* stuff for the screen access */
29 * initialize the display module
31 * [In/Out] buf
32 * the start pointer of the buffer
34 * [In/Out] size
35 * buffer size
37 * return
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);
47 * draw the text
49 * [In] row
50 * the row that displays the text
52 * [In] text
53 * text
55 * [In] offset
56 * display the text that is since offset columns
58 void tv_draw_text(int row, const unsigned char *text, int offset);
61 * show bookmark
63 * [In] rows
64 * the array of row where the bookmark
66 * [In] count
67 * want to show bookmark count
69 void tv_show_bookmarks(const int *rows, int count);
72 * update extra parts (header, footer, scrollbar, etc.)
74 * [In] window
75 * current window
77 * [In] col
78 * current column
80 * [In] pos
81 * current screen position (file position, page, line)
83 * [In] size
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
91 * [In] total
92 * total text size
94 * [In] show_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 */
110 * set the layout
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
121 * [Out] width
122 * width of the draw area
124 * [Out] cols
125 * column count of the draw area
127 * [Out] width
128 * row count of the draw area
130 void tv_get_drawarea_info(int *width, int *cols, int *rows);
133 * whether exist scrollbar
135 * return
136 * true exist scrollbar
137 * false does not exist scrollbar
139 bool tv_exist_scrollbar(void);
141 #endif