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) 2008 Blender Foundation.
19 * All rights reserved.
22 * Contributor(s): Blender Foundation
24 * ***** END GPL LICENSE BLOCK *****
27 /** \file blender/editors/space_file/file_intern.h
31 #ifndef __FILE_INTERN_H__
32 #define __FILE_INTERN_H__
34 /* internal exports only */
41 struct ARegion *file_buttons_region(struct ScrArea *sa);
44 #define TILE_BORDER_X (UI_UNIT_X / 4)
45 #define TILE_BORDER_Y (UI_UNIT_Y / 4)
48 #define IMASEL_BUTTONS_HEIGHT (UI_UNIT_Y * 2)
49 #define IMASEL_BUTTONS_MARGIN (UI_UNIT_Y / 6)
51 void file_draw_buttons(const bContext *C, ARegion *ar);
52 void file_calc_previews(const bContext *C, ARegion *ar);
53 void file_draw_list(const bContext *C, ARegion *ar);
55 void file_draw_check_cb(bContext *C, void *arg1, void *arg2);
56 bool file_draw_check_exists(SpaceFile *sfile);
59 struct wmOperatorType;
62 void FILE_OT_highlight(struct wmOperatorType *ot);
63 void FILE_OT_select(struct wmOperatorType *ot);
64 void FILE_OT_select_all_toggle(struct wmOperatorType *ot);
65 void FILE_OT_select_border(struct wmOperatorType *ot);
66 void FILE_OT_select_bookmark(struct wmOperatorType *ot);
67 void FILE_OT_bookmark_add(struct wmOperatorType *ot);
68 void FILE_OT_bookmark_delete(struct wmOperatorType *ot);
69 void FILE_OT_reset_recent(wmOperatorType *ot);
70 void FILE_OT_hidedot(struct wmOperatorType *ot);
71 void FILE_OT_execute(struct wmOperatorType *ot);
72 void FILE_OT_cancel(struct wmOperatorType *ot);
73 void FILE_OT_parent(struct wmOperatorType *ot);
74 void FILE_OT_directory_new(struct wmOperatorType *ot);
75 void FILE_OT_previous(struct wmOperatorType *ot);
76 void FILE_OT_next(struct wmOperatorType *ot);
77 void FILE_OT_refresh(struct wmOperatorType *ot);
78 void FILE_OT_bookmark_toggle(struct wmOperatorType *ot);
79 void FILE_OT_filenum(struct wmOperatorType *ot);
80 void FILE_OT_delete(struct wmOperatorType *ot);
81 void FILE_OT_rename(struct wmOperatorType *ot);
82 void FILE_OT_smoothscroll(struct wmOperatorType *ot);
84 int file_exec(bContext *C, struct wmOperator *exec_op);
85 int file_cancel_exec(bContext *C, struct wmOperator *unused);
86 int file_parent_exec(bContext *C, struct wmOperator *unused);
87 int file_previous_exec(bContext *C, struct wmOperator *unused);
88 int file_next_exec(bContext *C, struct wmOperator *unused);
89 int file_directory_new_exec(bContext *C, struct wmOperator *unused);
90 int file_delete_exec(bContext *C, struct wmOperator *unused);
92 void file_directory_enter_handle(bContext *C, void *arg_unused, void *arg_but);
93 void file_filename_enter_handle(bContext *C, void *arg_unused, void *arg_but);
95 int file_highlight_set(struct SpaceFile *sfile, struct ARegion *ar, int mx, int my);
97 void file_sfile_to_operator(struct wmOperator *op, struct SpaceFile *sfile, char *filepath);
98 void file_operator_to_sfile(struct SpaceFile *sfile, struct wmOperator *op);
102 float file_shorten_string(char *string, float w, int front);
103 float file_string_width(const char *str);
105 float file_font_pointsize(void);
106 void file_change_dir(bContext *C, int checkdir);
107 int file_select_match(struct SpaceFile *sfile, const char *pattern, char *matched_file);
108 int autocomplete_directory(struct bContext *C, char *str, void *arg_v);
109 int autocomplete_file(struct bContext *C, char *str, void *arg_v);
112 void file_panels_register(struct ARegionType *art);
114 #endif /* __FILE_INTERN_H__ */