don't stat bookmark files on load, can make blender hang on slow networks (eg, the...
[blender-staging.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 FileList;
41 struct FolderList;
42 struct direntry;
43 struct BlendHandle;
44 struct Scene;
45 struct Main;
46 struct rcti;
47 struct ReportList;
48 struct FileSelection;
49
50 typedef enum FileSelType {
51         FILE_SEL_REMOVE = 0,
52         FILE_SEL_ADD =  1,
53         FILE_SEL_TOGGLE  = 2
54 } FileSelType;
55
56 typedef enum FileCheckType
57 {
58         CHECK_DIRS = 1,
59         CHECK_FILES = 2,
60         CHECK_ALL = 3
61 } FileCheckType;
62
63 struct FileList *       filelist_new(short type);
64 void                            filelist_init_icons(void);
65 void                            filelist_free_icons(void);
66 int                                     filelist_find(struct FileList* filelist, const char *file);
67 void                            filelist_free(struct FileList* filelist);
68 void                            filelist_sort(struct FileList* filelist, short sort);
69 int                                     filelist_numfiles(struct FileList* filelist);
70 const char *            filelist_dir(struct FileList* filelist);
71 void                            filelist_setdir(struct FileList* filelist, const char *dir);
72 struct direntry *       filelist_file(struct FileList* filelist, int index);
73 void                            filelist_select(struct FileList* filelist, FileSelection* sel, FileSelType select, unsigned int flag, FileCheckType check);
74 void                            filelist_select_file(struct FileList* filelist, int index, FileSelType select, unsigned int flag, FileCheckType check);
75 int                                     filelist_is_selected(struct FileList* filelist, int index, FileCheckType check);
76 void                            filelist_hidedot(struct FileList* filelist, short hide);
77 void                            filelist_setfilter(struct FileList* filelist, unsigned int filter);
78 void                            filelist_setfilter_types(struct FileList* filelist, const char *filter_glob);
79 void                            filelist_filter(struct FileList* filelist);
80 void                            filelist_imgsize(struct FileList* filelist, short w, short h);
81 struct ImBuf *          filelist_getimage(struct FileList* filelist, int index);
82 struct ImBuf *          filelist_geticon(struct FileList* filelist, int index);
83 short                           filelist_changed(struct FileList* filelist);
84 void                            filelist_readdir(struct FileList* filelist);
85
86 int                                     filelist_empty(struct FileList* filelist);
87 void                            filelist_parent(struct FileList* filelist);
88
89 struct BlendHandle *filelist_lib(struct FileList* filelist);
90 int                                     filelist_islibrary (struct FileList* filelist, char* dir, char* group);
91 void                            filelist_from_main(struct FileList* filelist);
92 void                            filelist_from_library(struct FileList* filelist);
93 void                            filelist_freelib(struct FileList* filelist);
94 void                            filelist_hideparent(struct FileList* filelist, short hide);
95
96 struct ListBase *       folderlist_new(void);
97 void                            folderlist_free(struct ListBase* folderlist);
98 struct ListBase *       folderlist_duplicate(ListBase* folderlist);
99 void                            folderlist_popdir(struct ListBase* folderlist, char *dir);
100 void                            folderlist_pushdir(struct ListBase* folderlist, const char *dir);
101 int                                     folderlist_clear_next(struct SpaceFile* sfile);
102
103 void                            thumbnails_stop(struct FileList* filelist, const struct bContext* C);
104 void                            thumbnails_start(struct FileList* filelist, const struct bContext* C);
105 int                                     thumbnails_running(struct FileList* filelist, const struct bContext* C);
106
107 #ifdef __cplusplus
108 }
109 #endif
110
111 #endif
112