Blender  V2.93
file_intern.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2008 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 /* internal exports only */
27 
28 struct ARegion;
29 struct ARegionType;
30 struct FileSelectParams;
31 struct SpaceFile;
32 struct View2D;
33 
34 /* file_draw.c */
35 #define ATTRIBUTE_COLUMN_PADDING (0.5f * UI_UNIT_X)
36 
37 #define SMALL_SIZE_CHECK(_size) ((_size) < 64) /* Related to FileSelectParams.thumbnail_size. */
38 
39 void file_calc_previews(const bContext *C, ARegion *region);
40 void file_draw_list(const bContext *C, ARegion *region);
41 bool file_draw_hint_if_invalid(const SpaceFile *sfile, const ARegion *region);
42 
43 void file_draw_check_ex(bContext *C, struct ScrArea *area);
45 void file_draw_check_cb(bContext *C, void *arg1, void *arg2);
47 
48 /* file_ops.h */
49 struct wmOperator;
50 struct wmOperatorType;
51 
52 void FILE_OT_highlight(struct wmOperatorType *ot);
54 void FILE_OT_select(struct wmOperatorType *ot);
64 void FILE_OT_hidedot(struct wmOperatorType *ot);
65 void FILE_OT_execute(struct wmOperatorType *ot);
66 void FILE_OT_cancel(struct wmOperatorType *ot);
67 void FILE_OT_parent(struct wmOperatorType *ot);
69 void FILE_OT_previous(struct wmOperatorType *ot);
70 void FILE_OT_next(struct wmOperatorType *ot);
71 void FILE_OT_refresh(struct wmOperatorType *ot);
72 void FILE_OT_filenum(struct wmOperatorType *ot);
73 void FILE_OT_delete(struct wmOperatorType *ot);
74 void FILE_OT_rename(struct wmOperatorType *ot);
79 
80 void file_directory_enter_handle(bContext *C, void *arg_unused, void *arg_but);
81 void file_filename_enter_handle(bContext *C, void *arg_unused, void *arg_but);
82 
83 int file_highlight_set(struct SpaceFile *sfile, struct ARegion *region, int mx, int my);
84 
85 void file_sfile_filepath_set(struct SpaceFile *sfile, const char *filepath);
86 void file_sfile_to_operator_ex(struct Main *bmain,
87  struct wmOperator *op,
88  struct SpaceFile *sfile,
89  char *filepath);
90 void file_sfile_to_operator(struct Main *bmain, struct wmOperator *op, struct SpaceFile *sfile);
91 
92 void file_operator_to_sfile(struct Main *bmain, struct SpaceFile *sfile, struct wmOperator *op);
93 
94 /* filesel.c */
95 void fileselect_refresh_params(struct SpaceFile *sfile);
96 void fileselect_file_set(SpaceFile *sfile, const int index);
100  const FileLayout *layout,
101  int x,
102  int y);
104  const FileSelectParams *params,
105  FileLayout *layout,
106  int x);
107 float file_string_width(const char *str);
108 
109 float file_font_pointsize(void);
110 int file_select_match(struct SpaceFile *sfile, const char *pattern, char *matched_file);
111 int autocomplete_directory(struct bContext *C, char *str, void *arg_v);
112 int autocomplete_file(struct bContext *C, char *str, void *arg_v);
113 
115 
116 typedef void *onReloadFnData;
117 typedef void (*onReloadFn)(struct SpaceFile *space_data, onReloadFnData custom_data);
118 typedef struct SpaceFile_Runtime {
119  /* Called once after the file browser has reloaded. Reset to NULL after calling.
120  * Use file_on_reload_callback_register() to register a callback. */
124 
125 /* Register an on-reload callback function. Note that there can only be one such function at a
126  * time; registering a new one will overwrite the previous one. */
129  onReloadFnData custom_data);
130 
131 /* file_panels.c */
134 
135 /* file_utils.c */
136 void file_tile_boundbox(const ARegion *region, FileLayout *layout, const int file, rcti *r_bounds);
137 
138 void file_path_to_ui_path(const char *path, char *r_pathi, int max_size);
FileAttributeColumnType
Definition: ED_fileselect.h:47
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
#define C
Definition: RandGen.cpp:39
FILE * file
DEGForeachIDComponentCallback callback
#define str(s)
void FILE_OT_bookmark_move(struct wmOperatorType *ot)
Definition: file_ops.c:1290
void FILE_OT_filenum(struct wmOperatorType *ot)
Definition: file_ops.c:2671
void file_operator_to_sfile(struct Main *bmain, struct SpaceFile *sfile, struct wmOperator *op)
Definition: file_ops.c:1614
void(* onReloadFn)(struct SpaceFile *space_data, onReloadFnData custom_data)
Definition: file_intern.h:117
void file_draw_check(bContext *C)
Definition: file_ops.c:1688
int autocomplete_directory(struct bContext *C, char *str, void *arg_v)
void file_tile_boundbox(const ARegion *region, FileLayout *layout, const int file, rcti *r_bounds)
Definition: file_utils.c:36
void FILE_OT_rename(struct wmOperatorType *ot)
Definition: file_ops.c:2741
bool file_draw_hint_if_invalid(const SpaceFile *sfile, const ARegion *region)
Definition: file_draw.c:1060
int file_select_match(struct SpaceFile *sfile, const char *pattern, char *matched_file)
Definition: filesel.c:1092
void file_on_reload_callback_register(struct SpaceFile *sfile, onReloadFn callback, onReloadFnData custom_data)
Definition: space_file.c:403
void FILE_OT_bookmark_delete(struct wmOperatorType *ot)
Definition: file_ops.c:1141
void file_calc_previews(const bContext *C, ARegion *region)
Definition: file_draw.c:293
void FILE_OT_sort_column_ui_context(struct wmOperatorType *ot)
Definition: file_ops.c:1469
void FILE_OT_cancel(struct wmOperatorType *ot)
Definition: file_ops.c:1514
int autocomplete_file(struct bContext *C, char *str, void *arg_v)
void FILE_OT_highlight(struct wmOperatorType *ot)
Definition: file_ops.c:1418
void FILE_OT_select(struct wmOperatorType *ot)
Definition: file_ops.c:600
float file_string_width(const char *str)
Definition: filesel.c:857
void FILE_OT_directory_new(struct wmOperatorType *ot)
Definition: file_ops.c:2346
void FILE_OT_view_selected(struct wmOperatorType *ot)
Definition: file_ops.c:999
void file_params_renamefile_activate(struct SpaceFile *sfile, struct FileSelectParams *params)
Definition: filesel.c:1237
void FILE_OT_parent(struct wmOperatorType *ot)
Definition: file_ops.c:1910
void FILE_OT_bookmark_add(struct wmOperatorType *ot)
Definition: file_ops.c:1089
bool file_attribute_column_header_is_inside(const struct View2D *v2d, const FileLayout *layout, int x, int y)
void file_sfile_to_operator(struct Main *bmain, struct wmOperator *op, struct SpaceFile *sfile)
Definition: file_ops.c:1607
void file_directory_enter_handle(bContext *C, void *arg_unused, void *arg_but)
FileAttributeColumnType file_attribute_column_type_find_isect(const View2D *v2d, const FileSelectParams *params, FileLayout *layout, int x)
Definition: filesel.c:820
void FILE_OT_hidedot(struct wmOperatorType *ot)
Definition: file_ops.c:2592
void FILE_OT_refresh(struct wmOperatorType *ot)
Definition: file_ops.c:1870
void file_path_to_ui_path(const char *path, char *r_pathi, int max_size)
Definition: file_utils.c:52
void FILE_OT_reset_recent(wmOperatorType *ot)
Definition: file_ops.c:1345
void FILE_OT_select_all(struct wmOperatorType *ot)
Definition: file_ops.c:947
void file_sfile_filepath_set(struct SpaceFile *sfile, const char *filepath)
Definition: file_ops.c:1645
void fileselect_refresh_params(struct SpaceFile *sfile)
Definition: filesel.c:444
void file_tool_props_region_panels_register(struct ARegionType *art)
Definition: file_panels.c:98
void FILE_OT_delete(struct wmOperatorType *ot)
Definition: file_ops.c:2851
void FILE_OT_execute(struct wmOperatorType *ot)
Definition: file_ops.c:1818
void * onReloadFnData
Definition: file_intern.h:116
bool file_attribute_column_type_enabled(const FileSelectParams *params, FileAttributeColumnType column)
Definition: filesel.c:801
void FILE_OT_select_bookmark(struct wmOperatorType *ot)
Definition: file_ops.c:1041
float file_font_pointsize(void)
Definition: filesel.c:876
void fileselect_file_set(SpaceFile *sfile, const int index)
Definition: filesel.c:625
void FILE_OT_start_filter(struct wmOperatorType *ot)
Definition: file_ops.c:2892
int file_highlight_set(struct SpaceFile *sfile, struct ARegion *region, int mx, int my)
Definition: file_ops.c:1363
void FILE_OT_select_box(struct wmOperatorType *ot)
Definition: file_ops.c:514
void FILE_OT_select_walk(struct wmOperatorType *ot)
Definition: file_ops.c:858
void file_filename_enter_handle(bContext *C, void *arg_unused, void *arg_but)
bool file_draw_check_exists(SpaceFile *sfile)
Definition: file_ops.c:1700
void file_execute_region_panels_register(struct ARegionType *art)
Definition: file_panels.c:212
void file_draw_check_cb(bContext *C, void *arg1, void *arg2)
struct SpaceFile_Runtime SpaceFile_Runtime
void FILE_OT_next(struct wmOperatorType *ot)
Definition: file_ops.c:1981
void file_sfile_to_operator_ex(struct Main *bmain, struct wmOperator *op, struct SpaceFile *sfile, char *filepath)
Definition: file_ops.c:1532
void FILE_OT_filepath_drop(struct wmOperatorType *ot)
Definition: file_ops.c:2220
void file_draw_check_ex(bContext *C, struct ScrArea *area)
Definition: file_ops.c:1664
void FILE_OT_smoothscroll(struct wmOperatorType *ot)
Definition: file_ops.c:2173
void FILE_OT_bookmark_cleanup(struct wmOperatorType *ot)
Definition: file_ops.c:1201
void file_draw_list(const bContext *C, ARegion *region)
Definition: file_draw.c:793
void FILE_OT_previous(struct wmOperatorType *ot)
Definition: file_ops.c:1945
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
static void area(int d1, int d2, int e1, int e2, float weights[2])
Definition: BKE_main.h:116
onReloadFnData on_reload_custom_data
Definition: file_intern.h:122
onReloadFn on_reload
Definition: file_intern.h:121
wmOperatorType * ot
Definition: wm_files.c:3156