Uses custom hash/equals functions so that we can actually fetch equivalent FileDatas...
[geeqie.git] / src / filecluster.h
1 /*
2  * Copyright (C) 2008 - 2016 The Geeqie Team
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18
19 #ifndef FILECLUSTER_H
20 #define FILECLUSTER_H
21
22 #include "main.h"
23
24 FileClusterList *fileclusterlist_new();
25 FileCluster *filecluster_new();  // internal?
26 void fileclusterlist_free(FileClusterList *fcl);
27 void filecluster_free(FileCluster *fc);
28
29 gboolean filecluster_toggle_show_children(FileCluster *fc);
30
31 // Creates a cluster with items that must already be in the cluster list.  Will fail (and make no
32 // changes) if any of the specified items isn't in the list, or if any of the items is already
33 // part of a different cluster.
34 FileCluster *fileclusterlist_create_cluster(FileClusterList *fcl, GList *fd_items);
35
36 gboolean fileclusterlist_has_head(FileClusterList *fcl, FileData *fd);
37 gboolean fileclusterlist_has_child(FileClusterList *fcl, FileData *fd);
38
39 GList *fileclusterlist_next_non_child(FileClusterList *fcl, GList *list);
40 GList *fileclusterlist_remove_children_from_list(FileClusterList *fcl, GList *list);
41
42 #endif  // FILECLUSTER_H