1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 Gilles Roux
12 * 2010 Yoshihisa Uchida
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
22 ****************************************************************************/
23 #ifndef PLUGIN_TEXT_VIEWER_BOOKMARK_H
24 #define PLUGIN_TEXT_VIEWER_BOOKMARK_H
26 #include "tv_screen_pos.h"
28 /* stuff for the bookmarking */
30 /* Maximum amount of register possible bookmarks */
31 #define TV_MAX_BOOKMARKS 16
32 #define SERIALIZE_BOOKMARK_SIZE 8
35 * initialize the bookmark module
38 * the start pointer of the buffer
44 * true initialize success
45 * false initialize failure
47 bool tv_init_bookmark(unsigned char **buf
, size_t *size
);
49 /* finalize the bookmark module */
50 void tv_finalize_bookmark(void);
53 * get the positions which registered bookmarks
56 * the array which store positions of all bookmarks
61 int tv_get_bookmark_positions(struct tv_screen_pos
*pos_array
);
64 * the function that a bookmark add when there is not a bookmark in the given position
65 * or the bookmark remove when there exist a bookmark in the given position.
67 void tv_toggle_bookmark(void);
70 * The menu that can select registered bookmarks is displayed, one is selected from
71 * among them, and moves to the page which selected bookmarks.
73 void tv_select_bookmark(void);
75 /* creates system bookmark */
76 void tv_create_system_bookmark(void);
79 * serialize the bookmark array
82 * the file descripter which is stored the result.
85 * the size of the result
87 int tv_serialize_bookmarks(unsigned char *buf
);
90 * deserialize the bookmark array
93 * the file descripter which is stored the serialization of the bookmark array.
99 bool tv_deserialize_bookmarks(int fd
);