Blender V2.61 - r43446

ED_fileselect.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version. 
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2008 Blender Foundation.
00019  * All rights reserved.
00020  *
00021  * 
00022  * Contributor(s): Blender Foundation
00023  *
00024  * ***** END GPL LICENSE BLOCK *****
00025  */
00026 
00031 #ifndef ED_FILES_H
00032 #define ED_FILES_H
00033 
00034 struct SpaceFile;
00035 struct ARegion;
00036 struct FileSelectParams;
00037 struct bContext;
00038 
00039 #define FILE_LAYOUT_HOR 1
00040 #define FILE_LAYOUT_VER 2
00041 
00042 #define MAX_FILE_COLUMN 8
00043 
00044 typedef enum FileListColumns {
00045     COLUMN_NAME = 0,
00046     COLUMN_DATE,
00047     COLUMN_TIME,
00048     COLUMN_SIZE,
00049     COLUMN_MODE1,
00050     COLUMN_MODE2,
00051     COLUMN_MODE3,
00052     COLUMN_OWNER
00053 } FileListColumns;
00054 
00055 typedef struct FileLayout
00056 {
00057     /* view settings - XXX - move into own struct */
00058     int prv_w;
00059     int prv_h;
00060     int tile_w;
00061     int tile_h;
00062     int tile_border_x;
00063     int tile_border_y;
00064     int prv_border_x;
00065     int prv_border_y;
00066     int rows;
00067     int columns;
00068     int width;
00069     int height;
00070     int flag;
00071     int dirty;
00072     int textheight;
00073     float column_widths[MAX_FILE_COLUMN];
00074 } FileLayout;
00075 
00076 typedef struct FileSelection {
00077     int first;
00078     int last;
00079 } FileSelection;
00080 
00081 struct rcti;
00082 
00083 struct FileSelectParams* ED_fileselect_get_params(struct SpaceFile *sfile);
00084 
00085 short ED_fileselect_set_params(struct SpaceFile *sfile);
00086 
00087 void ED_fileselect_reset_params(struct SpaceFile *sfile);
00088 
00089 
00090 void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar);
00091 
00092 
00093 FileLayout* ED_fileselect_get_layout(struct SpaceFile *sfile, struct ARegion *ar);
00094 
00095 int ED_fileselect_layout_numfiles(FileLayout* layout, struct ARegion *ar);
00096 int ED_fileselect_layout_offset(FileLayout* layout, int x, int y);
00097 FileSelection ED_fileselect_layout_offset_rect(FileLayout* layout, const struct rcti* rect);
00098 
00099 void ED_fileselect_layout_tilepos(FileLayout* layout, int tile, int *x, int *y);
00100 
00101 void ED_operatormacros_file(void);
00102 
00103 void ED_fileselect_clear(struct bContext *C, struct SpaceFile *sfile);
00104 
00105 void ED_fileselect_exit(struct bContext *C, struct SpaceFile *sfile);
00106 
00107 int ED_file_extension_icon(const char *relname);
00108 
00109 #endif /* ED_FILES_H */
00110