2 * ***** BEGIN GPL LICENSE BLOCK *****
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.
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.
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.
18 * The Original Code is Copyright (C) 2007 Blender Foundation.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL LICENSE BLOCK *****
28 /** \file blender/editors/space_file/filelist.h
33 #ifndef __FILELIST_H__
34 #define __FILELIST_H__
49 struct wmWindowManager;
51 typedef enum FileSelType {
57 typedef enum FileCheckType {
63 struct ListBase * folderlist_new(void);
64 void folderlist_free(struct ListBase *folderlist);
65 struct ListBase * folderlist_duplicate(ListBase *folderlist);
66 void folderlist_popdir(struct ListBase *folderlist, char *dir);
67 void folderlist_pushdir(struct ListBase *folderlist, const char *dir);
68 const char * folderlist_peeklastdir(struct ListBase *folderdist);
69 int folderlist_clear_next(struct SpaceFile *sfile);
72 void filelist_setsorting(struct FileList *filelist, const short sort);
73 bool filelist_need_sorting(struct FileList *filelist);
74 void filelist_sort(struct FileList *filelist);
76 void filelist_setfilter_options(struct FileList *filelist, const bool hide_dot, const bool hide_parent,
77 const unsigned int filter,
78 const char *filter_glob, const char *filter_search);
79 void filelist_filter(struct FileList *filelist);
81 void filelist_init_icons(void);
82 void filelist_free_icons(void);
83 void filelist_imgsize(struct FileList *filelist, short w, short h);
84 struct ImBuf * filelist_getimage(struct FileList *filelist, const int index);
85 struct ImBuf * filelist_geticon(struct FileList *filelist, const int index);
87 struct FileList * filelist_new(short type);
88 void filelist_free(struct FileList *filelist);
90 const char * filelist_dir(struct FileList *filelist);
91 void filelist_readdir(struct FileList *filelist);
92 void filelist_setdir(struct FileList *filelist, const char *dir);
94 int filelist_empty(struct FileList *filelist);
95 int filelist_numfiles(struct FileList *filelist);
96 struct direntry * filelist_file(struct FileList *filelist, int index);
97 int filelist_find(struct FileList *filelist, const char *file);
99 short filelist_changed(struct FileList *filelist);
101 void filelist_select(struct FileList *filelist, FileSelection *sel, FileSelType select, unsigned int flag, FileCheckType check);
102 void filelist_select_file(struct FileList *filelist, int index, FileSelType select, unsigned int flag, FileCheckType check);
103 bool filelist_is_selected(struct FileList *filelist, int index, FileCheckType check);
105 struct BlendHandle *filelist_lib(struct FileList *filelist);
106 bool filelist_islibrary(struct FileList *filelist, char *dir, char *group);
107 void filelist_freelib(struct FileList *filelist);
109 bool filelist_need_thumbnails(struct FileList *filelist);
110 void thumbnails_start(struct FileList *filelist, const struct bContext *C);
111 void thumbnails_stop(struct wmWindowManager *wm, struct FileList *filelist);
112 int thumbnails_running(struct wmWindowManager *wm, struct FileList *filelist);