zathura
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
database.c
Go to the documentation of this file.
1 /* See LICENSE file for license and copyright information */
2 
3 #include "database.h"
4 
5 G_DEFINE_INTERFACE(ZathuraDatabase, zathura_database, G_TYPE_OBJECT)
6 
7 static void
8 zathura_database_default_init(ZathuraDatabaseInterface* GIRARA_UNUSED(iface))
9 {
10 }
11 
12 bool
14  zathura_bookmark_t* bookmark)
15 {
16  g_return_val_if_fail(ZATHURA_IS_DATABASE(db) && file != NULL && bookmark != NULL, false);
17 
18  return ZATHURA_DATABASE_GET_INTERFACE(db)->add_bookmark(db, file, bookmark);
19 }
20 
21 bool
22 zathura_db_remove_bookmark(zathura_database_t* db, const char* file, const char*
23  id)
24 {
25  g_return_val_if_fail(ZATHURA_IS_DATABASE(db) && file != NULL && id != NULL, false);
26 
27  return ZATHURA_DATABASE_GET_INTERFACE(db)->remove_bookmark(db, file, id);
28 }
29 
30 girara_list_t*
32 {
33  g_return_val_if_fail(ZATHURA_IS_DATABASE(db) && file != NULL, NULL);
34 
35  return ZATHURA_DATABASE_GET_INTERFACE(db)->load_bookmarks(db, file);
36 }
37 
38 girara_list_t*
40 {
41  g_return_val_if_fail(ZATHURA_IS_DATABASE(db) && file != NULL, NULL);
42 
43  return ZATHURA_DATABASE_GET_INTERFACE(db)->load_jumplist(db, file);
44 }
45 
46 bool
47 zathura_db_save_jumplist(zathura_database_t* db, const char* file, girara_list_t* jumplist)
48 {
49  g_return_val_if_fail(ZATHURA_IS_DATABASE(db) && file != NULL && jumplist != NULL, NULL);
50 
51  return ZATHURA_DATABASE_GET_INTERFACE(db)->save_jumplist(db, file, jumplist);
52 }
53 
54 bool
56  zathura_fileinfo_t* file_info)
57 {
58  g_return_val_if_fail(ZATHURA_IS_DATABASE(db) && file != NULL && file_info != NULL, false);
59 
60  return ZATHURA_DATABASE_GET_INTERFACE(db)->set_fileinfo(db, file, file_info);
61 }
62 
63 bool
65  zathura_fileinfo_t* file_info)
66 {
67  g_return_val_if_fail(ZATHURA_IS_DATABASE(db) && file != NULL && file_info != NULL, false);
68 
69  return ZATHURA_DATABASE_GET_INTERFACE(db)->get_fileinfo(db, file, file_info);
70 }