2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2008-12-18 19:21:30 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2011-11-29 10:54:47 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2008-12-18 19:21:30 +00:00
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-12-18 19:21:30 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2007 Blender Foundation.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
2011-02-27 20:29:51 +00:00
|
|
|
/** \file blender/editors/space_file/filelist.h
|
|
|
|
|
* \ingroup spfile
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __FILELIST_H__
|
|
|
|
|
#define __FILELIST_H__
|
2008-12-18 19:21:30 +00:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2013-03-15 19:56:29 +00:00
|
|
|
struct BlendHandle;
|
2008-12-18 19:21:30 +00:00
|
|
|
struct FileList;
|
2013-03-15 19:56:29 +00:00
|
|
|
struct FileSelection;
|
2009-07-07 07:25:44 +00:00
|
|
|
struct FolderList;
|
2009-09-12 19:54:39 +00:00
|
|
|
struct Main;
|
|
|
|
|
struct ReportList;
|
2013-03-15 19:56:29 +00:00
|
|
|
struct Scene;
|
|
|
|
|
struct direntry;
|
|
|
|
|
struct rcti;
|
|
|
|
|
struct wmWindowManager;
|
2011-03-14 19:56:13 +00:00
|
|
|
|
2011-03-20 10:22:51 +00:00
|
|
|
typedef enum FileSelType {
|
|
|
|
|
FILE_SEL_REMOVE = 0,
|
2012-06-18 13:01:24 +00:00
|
|
|
FILE_SEL_ADD = 1,
|
|
|
|
|
FILE_SEL_TOGGLE = 2
|
2011-03-20 10:22:51 +00:00
|
|
|
} FileSelType;
|
2009-03-14 18:15:28 +00:00
|
|
|
|
2012-06-06 22:38:39 +00:00
|
|
|
typedef enum FileCheckType {
|
2011-03-20 15:15:05 +00:00
|
|
|
CHECK_DIRS = 1,
|
|
|
|
|
CHECK_FILES = 2,
|
|
|
|
|
CHECK_ALL = 3
|
|
|
|
|
} FileCheckType;
|
|
|
|
|
|
2014-12-31 19:17:20 +01:00
|
|
|
struct ListBase * folderlist_new(void);
|
|
|
|
|
void folderlist_free(struct ListBase *folderlist);
|
|
|
|
|
struct ListBase * folderlist_duplicate(ListBase *folderlist);
|
|
|
|
|
void folderlist_popdir(struct ListBase *folderlist, char *dir);
|
|
|
|
|
void folderlist_pushdir(struct ListBase *folderlist, const char *dir);
|
|
|
|
|
const char * folderlist_peeklastdir(struct ListBase *folderdist);
|
|
|
|
|
int folderlist_clear_next(struct SpaceFile *sfile);
|
|
|
|
|
|
|
|
|
|
|
2014-12-31 20:13:21 +01:00
|
|
|
void filelist_setsorting(struct FileList *filelist, const short sort);
|
|
|
|
|
bool filelist_need_sorting(struct FileList *filelist);
|
|
|
|
|
void filelist_sort(struct FileList *filelist);
|
2014-12-31 19:17:20 +01:00
|
|
|
|
2014-12-31 20:13:21 +01:00
|
|
|
void filelist_setfilter_options(struct FileList *filelist, const bool hide_dot, const bool hide_parent,
|
|
|
|
|
const unsigned int filter, const char *filter_glob);
|
2012-06-18 13:01:24 +00:00
|
|
|
void filelist_filter(struct FileList *filelist);
|
2014-12-31 19:17:20 +01:00
|
|
|
|
|
|
|
|
void filelist_init_icons(void);
|
|
|
|
|
void filelist_free_icons(void);
|
2012-06-18 13:01:24 +00:00
|
|
|
void filelist_imgsize(struct FileList *filelist, short w, short h);
|
2014-12-31 19:17:20 +01:00
|
|
|
struct ImBuf * filelist_getimage(struct FileList *filelist, const int index);
|
|
|
|
|
struct ImBuf * filelist_geticon(struct FileList *filelist, const int index);
|
|
|
|
|
|
|
|
|
|
struct FileList * filelist_new(short type);
|
|
|
|
|
void filelist_free(struct FileList *filelist);
|
|
|
|
|
|
|
|
|
|
const char * filelist_dir(struct FileList *filelist);
|
2012-06-18 13:01:24 +00:00
|
|
|
void filelist_readdir(struct FileList *filelist);
|
2014-12-31 19:17:20 +01:00
|
|
|
void filelist_setdir(struct FileList *filelist, const char *dir);
|
2008-12-18 19:21:30 +00:00
|
|
|
|
2012-06-18 13:01:24 +00:00
|
|
|
int filelist_empty(struct FileList *filelist);
|
2014-12-31 19:17:20 +01:00
|
|
|
int filelist_numfiles(struct FileList *filelist);
|
|
|
|
|
struct direntry * filelist_file(struct FileList *filelist, int index);
|
|
|
|
|
int filelist_find(struct FileList *filelist, const char *file);
|
|
|
|
|
|
|
|
|
|
short filelist_changed(struct FileList *filelist);
|
|
|
|
|
|
|
|
|
|
void filelist_select(struct FileList *filelist, FileSelection *sel, FileSelType select, unsigned int flag, FileCheckType check);
|
|
|
|
|
void filelist_select_file(struct FileList *filelist, int index, FileSelType select, unsigned int flag, FileCheckType check);
|
|
|
|
|
bool filelist_is_selected(struct FileList *filelist, int index, FileCheckType check);
|
2009-06-04 20:07:06 +00:00
|
|
|
|
2012-06-18 13:01:24 +00:00
|
|
|
struct BlendHandle *filelist_lib(struct FileList *filelist);
|
2014-02-03 18:55:59 +11:00
|
|
|
bool filelist_islibrary(struct FileList *filelist, char *dir, char *group);
|
2012-06-18 13:01:24 +00:00
|
|
|
void filelist_freelib(struct FileList *filelist);
|
2008-12-18 19:21:30 +00:00
|
|
|
|
2014-12-31 20:45:39 +01:00
|
|
|
bool filelist_need_thumbnails(struct FileList *filelist);
|
2012-06-18 13:01:24 +00:00
|
|
|
void thumbnails_start(struct FileList *filelist, const struct bContext *C);
|
2013-03-15 19:56:29 +00:00
|
|
|
void thumbnails_stop(struct wmWindowManager *wm, struct FileList *filelist);
|
|
|
|
|
int thumbnails_running(struct wmWindowManager *wm, struct FileList *filelist);
|
2010-03-10 19:30:20 +00:00
|
|
|
|
2008-12-18 19:21:30 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|