Blender V2.61 - r43446
|
#include <math.h>
#include <string.h>
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
#include "BLI_dynstr.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BLF_api.h"
#include "BLF_translation.h"
#include "IMB_imbuf_types.h"
#include "MEM_guardedalloc.h"
#include "DNA_userdef_types.h"
#include "RNA_access.h"
#include "ED_fileselect.h"
#include "ED_screen.h"
#include "UI_interface.h"
#include "UI_interface_icons.h"
#include "UI_resources.h"
#include "UI_view2d.h"
#include "WM_types.h"
#include "fsmenu.h"
#include "filelist.h"
#include "file_intern.h"
Go to the source code of this file.
Enumerations | |
enum | { B_FS_DIRNAME, B_FS_FILENAME } |
Functions | |
static void | do_file_buttons (bContext *C, void *UNUSED(arg), int event) |
void | file_draw_buttons (const bContext *C, ARegion *ar) |
static void | draw_tile (int sx, int sy, int width, int height, int colorid, int shade) |
static int | get_file_icon (struct direntry *file) |
static void | file_draw_icon (uiBlock *block, char *path, int sx, int sy, int icon, int width, int height) |
static void | file_draw_string (int sx, int sy, const char *string, float width, int height, short align) |
void | file_calc_previews (const bContext *C, ARegion *ar) |
static void | file_draw_preview (uiBlock *block, struct direntry *file, int sx, int sy, ImBuf *imb, FileLayout *layout, short dropshadow) |
static void | renamebutton_cb (bContext *C, void *UNUSED(arg1), char *oldname) |
static void | draw_background (FileLayout *layout, View2D *v2d) |
static void | draw_dividers (FileLayout *layout, View2D *v2d) |
void | file_draw_list (const bContext *C, ARegion *ar) |
Definition in file file_draw.c.
anonymous enum |
Definition at line 76 of file file_draw.c.
static void do_file_buttons | ( | bContext * | C, |
void * | UNUSEDarg, | ||
int | event | ||
) | [static] |
Definition at line 82 of file file_draw.c.
References B_FS_DIRNAME, B_FS_FILENAME, file_directory_exec(), file_filename_exec(), and NULL.
Referenced by file_draw_buttons().
static void draw_background | ( | FileLayout * | layout, |
View2D * | v2d | ||
) | [static] |
Definition at line 412 of file file_draw.c.
References View2D::cur, i, FileLayout::rows, TH_BACK, FileLayout::tile_border_y, FileLayout::tile_h, UI_ThemeColorShade(), rctf::xmax, rctf::xmin, and rctf::ymax.
Referenced by file_draw_list().
static void draw_dividers | ( | FileLayout * | layout, |
View2D * | v2d | ||
) | [static] |
Definition at line 428 of file file_draw.c.
References View2D::cur, sdrawline(), TH_BACK, FileLayout::tile_border_x, FileLayout::tile_border_y, FileLayout::tile_w, View2D::tot, UI_ThemeColorShade(), rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by file_draw_list().
static void draw_tile | ( | int | sx, |
int | sy, | ||
int | width, | ||
int | height, | ||
int | colorid, | ||
int | shade | ||
) | [static] |
Definition at line 237 of file file_draw.c.
References UI_CNR_ALL, UI_ThemeColorShade(), uiRoundBox(), and uiSetRoundBox().
Referenced by file_draw_list().
Definition at line 315 of file file_draw.c.
References CTX_wm_space_file(), ED_fileselect_init_layout(), FileLayout::height, SpaceFile::layout, UI_view2d_totRect_set(), ARegion::v2d, V2D_SCROLL_HEIGHT, and FileLayout::width.
Referenced by file_main_area_draw().
Definition at line 107 of file file_draw.c.
References autocomplete_directory(), autocomplete_file(), B_FS_FILENAME, BLI_snprintf(), BUT, CTX_wm_area(), CTX_wm_space_file(), FileSelectParams::dir, do_file_buttons(), ED_fileselect_get_params(), FileSelectParams::file, FILE_DIRSEL_ONLY, file_draw_check_cb(), file_draw_check_exists(), FILE_MAX, FILE_MAXFILE, ARegion::flag, FileSelectParams::flag, IFACE_, IMASEL_BUTTONS_HEIGHT, IMASEL_BUTTONS_MARGIN, MAX2, N_, ARegion::next, NULL, SpaceFile::params, ARegion::regiontype, RGN_FLAG_HIDDEN, RGN_TYPE_CHANNELS, RNA_int_set(), TEX, TIP_, FileSelectParams::title, UI_BUT_NO_UTF8, UI_BUT_REDALERT, UI_EMBOSS, UI_GetStringWidth(), UI_UNIT_X, UI_UNIT_Y, uiBeginBlock(), uiBlockBeginAlign(), uiBlockEndAlign(), uiBlockSetFunc(), uiBlockSetHandleFunc(), uiButGetOperatorPtrRNA(), uiButSetCompleteFunc(), uiButSetFlag(), uiDefBut(), uiDefButO(), uiDefButTextO(), uiDefIconButO(), uiDrawBlock(), uiEndBlock(), ARegion::winx, ARegion::winy, and WM_OP_EXEC_REGION_WIN.
Referenced by file_ui_area_draw().
static void file_draw_icon | ( | uiBlock * | block, |
char * | path, | ||
int | sx, | ||
int | sy, | ||
int | icon, | ||
int | width, | ||
int | height | ||
) | [static] |
Definition at line 278 of file file_draw.c.
References LABEL, NULL, uiButSetDragPath(), and uiDefIconBut().
Referenced by file_draw_list().
Definition at line 444 of file file_draw.c.
References FileSelectParams::active_file, COLUMN_DATE, COLUMN_MODE1, COLUMN_MODE2, COLUMN_MODE3, COLUMN_NAME, COLUMN_OWNER, COLUMN_SIZE, COLUMN_TIME, FileLayout::column_widths, FileLayout::columns, CTX_wm_space_file(), View2D::cur, direntry::date, FileSelectParams::display, draw_background(), draw_dividers(), draw_tile(), ED_fileselect_get_layout(), ED_fileselect_get_params(), ED_fileselect_layout_numfiles(), ED_fileselect_layout_offset(), ED_fileselect_layout_tilepos(), EDITING_FILE, file_draw_icon(), file_draw_preview(), file_draw_string(), FILE_IMGDISPLAY, FILE_LAYOUT_HOR, FILE_LONGDISPLAY, FILE_SHORTDISPLAY, filelist_file(), filelist_geticon(), filelist_getimage(), filelist_numfiles(), SpaceFile::files, files, FileLayout::flag, direntry::flags, get_file_icon(), HILITED_FILE, i, ICON_DEFAULT_HEIGHT_SCALE, ICON_DEFAULT_WIDTH_SCALE, if(), IMAGEFILE, SpaceFile::layout, direntry::mode1, direntry::mode2, direntry::mode3, direntry::owner, SpaceFile::params, direntry::path, direntry::relname, renamebutton_cb(), FileSelectParams::renameedit, FileLayout::rows, SELECTED_FILE, direntry::selflag, direntry::size, TEX, FileLayout::textheight, TH_BACK, TH_HILITE, TH_TEXT, FileLayout::tile_border_y, FileLayout::tile_h, FileLayout::tile_w, direntry::time, View2D::tot, direntry::type, UI_BUT_NO_UTF8, UI_CNR_NONE, UI_EMBOSS, UI_STYLE_TEXT_CENTER, UI_STYLE_TEXT_LEFT, UI_ThemeColor4(), UI_UNIT_Y, uiBeginBlock(), uiButActiveOnly(), uiButSetFlag(), uiButSetRenameFunc(), uiDefBut(), uiDrawBlock(), uiEndBlock(), uiSetRoundBox(), ARegion::v2d, rctf::xmin, and rctf::ymax.
Referenced by file_main_area_draw().
static void file_draw_preview | ( | uiBlock * | block, |
struct direntry * | file, | ||
int | sx, | ||
int | sy, | ||
ImBuf * | imb, | ||
FileLayout * | layout, | ||
short | dropshadow | ||
) | [static] |
Definition at line 325 of file file_draw.c.
References fdrawbox(), get_file_icon(), glaDrawPixelsTexScaled(), LABEL, NULL, direntry::path, FileLayout::prv_border_x, FileLayout::prv_border_y, FileLayout::prv_h, FileLayout::prv_w, ImBuf::rect, uiButSetDragImage(), uiDefBut(), uiDrawBoxShadow(), ImBuf::x, and ImBuf::y.
Referenced by file_draw_list().
static void file_draw_string | ( | int | sx, |
int | sy, | ||
const char * | string, | ||
float | width, | ||
int | height, | ||
short | align | ||
) | [static] |
Definition at line 294 of file file_draw.c.
References uiFontStyle::align, BLI_strncpy(), FILE_MAXFILE, file_shorten_string(), UI_GetStyle(), uiStyleFontDraw(), uiStyle::widgetlabel, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by file_draw_list().
static int get_file_icon | ( | struct direntry * | file | ) | [static] |
Definition at line 245 of file file_draw.c.
References BLENDERFILE, BLENDERFILE_BACKUP, BTXFILE, COLLADAFILE, direntry::flags, FTFONTFILE, IMAGEFILE, MOVIEFILE, PYSCRIPTFILE, direntry::relname, SOUNDFILE, and direntry::type.
Referenced by file_draw_list(), and file_draw_preview().
static void renamebutton_cb | ( | bContext * | C, |
void * | UNUSEDarg1, | ||
char * | oldname | ||
) | [static] |
Definition at line 388 of file file_draw.c.
References BLI_exists(), BLI_make_file_string(), BLI_rename(), BLI_strncpy(), CTX_wm_region(), CTX_wm_space_data(), FileSelectParams::dir, ED_fileselect_clear(), ED_region_tag_redraw(), FILE_MAX, G, SpaceFile::params, and FileSelectParams::renameedit.
Referenced by file_draw_list().