9351e1c37c233ec4857948994ea5f441fcf7bd55
[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 // FileCluster methods.
25 FileCluster *filecluster_new();  // internal?
26 void filecluster_free(FileCluster *fc);
27
28 gboolean filecluster_toggle_show_children(FileCluster *fc);
29 gboolean filecluster_has_head(FileCluster *fc, FileData *fd);
30 gboolean filecluster_has_child(FileCluster *fc, FileData *fd);
31
32
33 // FileClusterList methods.
34
35 FileClusterList *fileclusterlist_new();
36 void fileclusterlist_free(FileClusterList *fcl);
37
38 // Creates a cluster with items that must already be in the cluster list.  Will fail (and make no
39 // changes) if any of the specified items isn't in the list, or if any of the items is already
40 // part of a different cluster.
41 FileCluster *fileclusterlist_create_cluster(FileClusterList *fcl, GList *fd_items);
42
43 gboolean fileclusterlist_has_head(FileClusterList *fcl, FileData *fd);
44 gboolean fileclusterlist_has_child(FileClusterList *fcl, FileData *fd);
45
46 GList *fileclusterlist_next_non_child(FileClusterList *fcl, GList *list);
47 GList *fileclusterlist_remove_children_from_list(FileClusterList *fcl, GList *list);
48
49 #endif  // FILECLUSTER_H