cd4c22df418dc0688da8da0d4826faa31817e93a
[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. The Blender
8  * Foundation also sells licenses for use in proprietary software under
9  * the Blender License.  See http://www.blender.org/BL/ for information
10  * about this.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  * The Original Code is Copyright (C) 2007 Blender Foundation.
22  * All rights reserved.
23  *
24  * The Original Code is: all of this file.
25  *
26  * Contributor(s): none yet.
27  *
28  * ***** END GPL LICENSE BLOCK *****
29  */
30
31 /** \file blender/editors/space_file/filelist.h
32  *  \ingroup spfile
33  */
34
35
36 #ifndef FILELIST_H
37 #define FILELIST_H
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 struct FileList;
44 struct FolderList;
45 struct direntry;
46 struct BlendHandle;
47 struct Scene;
48 struct Main;
49 struct rcti;
50 struct ReportList;
51 struct FileSelection;
52
53 typedef enum FileSelType {
54         FILE_SEL_REMOVE = 0,
55         FILE_SEL_ADD =  1,
56         FILE_SEL_TOGGLE  = 2
57 } FileSelType;
58
59 typedef enum FileCheckType
60 {
61         CHECK_DIRS = 1,
62         CHECK_FILES = 2,
63         CHECK_ALL = 3
64 } FileCheckType;
65
66 struct FileList *       filelist_new(short type);
67 void                            filelist_init_icons(void);
68 void                            filelist_free_icons(void);
69 int                                     filelist_find(struct FileList* filelist, const char *file);
70 void                            filelist_free(struct FileList* filelist);
71 void                            filelist_sort(struct FileList* filelist, short sort);
72 int                                     filelist_numfiles(struct FileList* filelist);
73 const char *            filelist_dir(struct FileList* filelist);
74 void                            filelist_setdir(struct FileList* filelist, const char *dir);
75 struct direntry *       filelist_file(struct FileList* filelist, int index);
76 void                            filelist_select(struct FileList* filelist, FileSelection* sel, FileSelType select, unsigned int flag, FileCheckType check);
77 void                            filelist_select_file(struct FileList* filelist, int index, FileSelType select, unsigned int flag, FileCheckType check);
78 int                                     filelist_is_selected(struct FileList* filelist, int index, FileCheckType check);
79 void                            filelist_hidedot(struct FileList* filelist, short hide);
80 void                            filelist_setfilter(struct FileList* filelist, unsigned int filter);
81 void                            filelist_setfilter_types(struct FileList* filelist, const char *filter_glob);
82 void                            filelist_filter(struct FileList* filelist);
83 void                            filelist_imgsize(struct FileList* filelist, short w, short h);
84 struct ImBuf *          filelist_getimage(struct FileList* filelist, int index);
85 struct ImBuf *          filelist_geticon(struct FileList* filelist, int index);
86 short                           filelist_changed(struct FileList* filelist);
87 void                            filelist_readdir(struct FileList* filelist);
88
89 int                                     filelist_empty(struct FileList* filelist);
90 void                            filelist_parent(struct FileList* filelist);
91
92 struct BlendHandle *filelist_lib(struct FileList* filelist);
93 int                                     filelist_islibrary (struct FileList* filelist, char* dir, char* group);
94 void                            filelist_from_main(struct FileList* filelist);
95 void                            filelist_from_library(struct FileList* filelist);
96 void                            filelist_freelib(struct FileList* filelist);
97 void                            filelist_hideparent(struct FileList* filelist, short hide);
98
99 struct ListBase *       folderlist_new(void);
100 void                            folderlist_free(struct ListBase* folderlist);
101 struct ListBase *       folderlist_duplicate(ListBase* folderlist);
102 void                            folderlist_popdir(struct ListBase* folderlist, char *dir);
103 void                            folderlist_pushdir(struct ListBase* folderlist, const char *dir);
104 int                                     folderlist_clear_next(struct SpaceFile* sfile);
105
106 void                            thumbnails_stop(struct FileList* filelist, const struct bContext* C);
107 void                            thumbnails_start(struct FileList* filelist, const struct bContext* C);
108 int                                     thumbnails_running(struct FileList* filelist, const struct bContext* C);
109
110 #ifdef __cplusplus
111 }
112 #endif
113
114 #endif
115