1 /* Copyright (C) 2010-2012 by Cristian Henzel <oss@rspwn.com>
2  *
3  * forked from parcellite, which is
4  * Copyright (C) 2007-2008 by Xyhthyx <xyhthyx@gmail.com>
5  *
6  * This file is part of ClipIt.
7  *
8  * ClipIt is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * ClipIt is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef HISTORY_H
23 #define HISTORY_H
24 
25 G_BEGIN_DECLS
26 
27 #define HISTORY_FILE "clipit/history"
28 
29 /* Set maximum size of one clipboard entry to 1024KB (1MB)
30  * 1024 pages × 2000 characters per page - should be more than enough.
31  * WARNING: if you use all 1000 history items, clipit could use up to
32  * 1 GB of RAM. If you don't want that, set this lower.      */
33 #define ENTRY_MAX_SIZE 1048576
34 
35 typedef struct {
36 	gboolean is_static;
37 	gpointer content;
38 } history_item;
39 
40 extern GList *history;
41 
42 void read_history();
43 
44 void save_history();
45 
46 void check_and_append(gchar *item);
47 
48 void append_item(gchar *item);
49 
50 void truncate_history();
51 
52 gpointer get_last_item();
53 
54 void delete_duplicate(gchar *item);
55 
56 G_END_DECLS
57 
58 #endif
59