Cleanup: commas at the end of enums
[blender.git] / source / blender / editors / space_file / filelist.h
1 /*
2  * ***** BEGIN GPL LICENSE BLOCK *****
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (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
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  * The Original Code is Copyright (C) 2007 Blender Foundation.
19  * All rights reserved.
20  *
21  * The Original Code is: all of this file.
22  *
23  * Contributor(s): none yet.
24  *
25  * ***** END GPL LICENSE BLOCK *****
26  */
27
28 /** \file blender/editors/space_file/filelist.h
29  *  \ingroup spfile
30  */
31
32
33 #ifndef __FILELIST_H__
34 #define __FILELIST_H__
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 struct BlendHandle;
41 struct FileList;
42 struct FileSelection;
43 struct wmWindowManager;
44
45 struct FileDirEntry;
46
47 typedef enum FileSelType {
48         FILE_SEL_REMOVE = 0,
49         FILE_SEL_ADD    = 1,
50         FILE_SEL_TOGGLE = 2,
51 } FileSelType;
52
53 typedef enum FileCheckType {
54         CHECK_DIRS = 1,
55         CHECK_FILES = 2,
56         CHECK_ALL = 3,
57 } FileCheckType;
58
59 struct ListBase    *folderlist_new(void);
60 void                folderlist_free(struct ListBase *folderlist);
61 struct ListBase    *folderlist_duplicate(ListBase *folderlist);
62 void                folderlist_popdir(struct ListBase *folderlist, char *dir);
63 void                folderlist_pushdir(struct ListBase *folderlist, const char *dir);
64 const char         *folderlist_peeklastdir(struct ListBase *folderdist);
65 int                 folderlist_clear_next(struct SpaceFile *sfile);
66
67
68 void                filelist_setsorting(struct FileList *filelist, const short sort);
69 void                filelist_sort(struct FileList *filelist);
70
71 void                filelist_setfilter_options(struct FileList *filelist, const bool do_filter,
72                                                const bool hide_dot, const bool hide_parent,
73                                                const unsigned int filter, const unsigned int filter_id,
74                                                const char *filter_glob, const char *filter_search);
75 void                filelist_filter(struct FileList *filelist);
76
77 void                filelist_init_icons(void);
78 void                filelist_free_icons(void);
79 void                filelist_imgsize(struct FileList *filelist, short w, short h);
80 struct ImBuf       *filelist_getimage(struct FileList *filelist, const int index);
81 struct ImBuf       *filelist_geticon_image(struct FileList *filelist, const int index);
82 int                 filelist_geticon(struct FileList *filelist, const int index, const bool is_main);
83
84 struct FileList    *filelist_new(short type);
85 void                filelist_clear(struct FileList *filelist);
86 void                filelist_clear_ex(struct FileList *filelist, const bool do_cache, const bool do_selection);
87 void                filelist_free(struct FileList *filelist);
88
89 const char         *filelist_dir(struct FileList *filelist);
90 bool                filelist_is_dir(struct FileList *filelist, const char *path);
91 void                filelist_setdir(struct FileList *filelist, char *r_dir);
92
93 int                 filelist_files_ensure(struct FileList *filelist);
94 int                 filelist_empty(struct FileList *filelist);
95 FileDirEntry       *filelist_file(struct FileList *filelist, int index);
96 int                 filelist_file_findpath(struct FileList *filelist, const char *file);
97 FileDirEntry       *filelist_entry_find_uuid(struct FileList *filelist, const int uuid[4]);
98 void                filelist_file_cache_slidingwindow_set(struct FileList *filelist, size_t window_size);
99 bool                filelist_file_cache_block(struct FileList *filelist, const int index);
100
101 bool                filelist_force_reset(struct FileList *filelist);
102 bool                filelist_pending(struct FileList *filelist);
103 bool                filelist_is_ready(struct FileList *filelist);
104
105 unsigned int        filelist_entry_select_set(const struct FileList *filelist, const struct FileDirEntry *entry, FileSelType select, unsigned int flag, FileCheckType check);
106 void                filelist_entry_select_index_set(struct FileList *filelist, const int index, FileSelType select, unsigned int flag, FileCheckType check);
107 void                filelist_entries_select_index_range_set(struct FileList *filelist, FileSelection *sel, FileSelType select, unsigned int flag, FileCheckType check);
108 unsigned int        filelist_entry_select_get(struct FileList *filelist, struct FileDirEntry *entry, FileCheckType check);
109 unsigned int        filelist_entry_select_index_get(struct FileList *filelist, const int index, FileCheckType check);
110
111 void                filelist_setrecursion(struct FileList *filelist, const int recursion_level);
112
113 struct BlendHandle *filelist_lib(struct FileList *filelist);
114 bool                filelist_islibrary(struct FileList *filelist, char *dir, char **group);
115 void                filelist_freelib(struct FileList *filelist);
116
117 void                filelist_readjob_start(struct FileList *filelist, const struct bContext *C);
118 void                filelist_readjob_stop(struct wmWindowManager *wm, struct ScrArea *sa);
119 int                 filelist_readjob_running(struct wmWindowManager *wm, struct ScrArea *sa);
120
121 bool                filelist_cache_previews_update(struct FileList *filelist);
122 void                filelist_cache_previews_set(struct FileList *filelist, const bool use_previews);
123 bool                filelist_cache_previews_running(struct FileList *filelist);
124
125 #ifdef __cplusplus
126 }
127 #endif
128
129 #endif