Blender  V3.3
filesel.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2008 Blender Foundation. All rights reserved. */
3 
8 #include <math.h>
9 #include <stdio.h>
10 #include <string.h>
11 
12 #include <sys/stat.h>
13 #include <sys/types.h>
14 
15 /* path/file handling stuff */
16 #ifdef WIN32
17 # include "BLI_winstuff.h"
18 # include <direct.h>
19 # include <io.h>
20 #else
21 # include <dirent.h>
22 # include <sys/times.h>
23 # include <unistd.h>
24 #endif
25 
26 #include "DNA_screen_types.h"
27 #include "DNA_space_types.h"
28 #include "DNA_userdef_types.h"
29 
30 #include "MEM_guardedalloc.h"
31 
32 #include "BLI_blenlib.h"
33 #include "BLI_fnmatch.h"
34 #include "BLI_math_base.h"
35 #include "BLI_utildefines.h"
36 
37 #include "BLO_readfile.h"
38 
39 #include "BLT_translation.h"
40 
41 #include "BKE_appdir.h"
42 #include "BKE_context.h"
43 #include "BKE_idtype.h"
44 #include "BKE_main.h"
45 #include "BKE_preferences.h"
46 
47 #include "BLF_api.h"
48 
49 #include "ED_fileselect.h"
50 #include "ED_screen.h"
51 
52 #include "WM_api.h"
53 #include "WM_types.h"
54 
55 #include "RNA_access.h"
56 
57 #include "UI_interface.h"
58 #include "UI_interface_icons.h"
59 #include "UI_view2d.h"
60 
61 #include "file_intern.h"
62 #include "filelist.h"
63 
64 #define VERTLIST_MAJORCOLUMN_WIDTH (25 * UI_UNIT_X)
65 
67 {
68  const char *blendfile_path = BKE_main_blendfile_path_from_global();
69 
70  /* operator has no setting for this */
71  params->active_file = -1;
72 
73  if (!params->dir[0]) {
74  if (blendfile_path[0] != '\0') {
75  BLI_split_dir_part(blendfile_path, params->dir, sizeof(params->dir));
76  }
77  else {
78  const char *doc_path = BKE_appdir_folder_default();
79  if (doc_path) {
80  BLI_strncpy(params->dir, doc_path, sizeof(params->dir));
81  }
82  }
83  }
84 
87 
88  /* Switching thumbnails needs to recalc layout T28809. */
89  if (sfile->layout) {
90  sfile->layout->dirty = true;
91  }
92 }
93 
95 {
97  BLI_assert(sfile->op == NULL);
98 
99  FileAssetSelectParams *asset_params = sfile->asset_params;
100 
101  if (!asset_params) {
102  asset_params = sfile->asset_params = MEM_callocN(sizeof(*asset_params),
103  "FileAssetSelectParams");
106  asset_params->asset_library_ref.custom_library_index = -1;
108  }
109 
110  FileSelectParams *base_params = &asset_params->base_params;
111  base_params->file[0] = '\0';
112  base_params->filter_glob[0] = '\0';
114  base_params->flag &= ~FILE_DIRSEL_ONLY;
115  base_params->filter |= FILE_TYPE_BLENDERLIB;
116  base_params->filter_id = FILTER_ID_ALL;
117  base_params->display = FILE_IMGDISPLAY;
118  base_params->sort = FILE_SORT_ALPHA;
119  /* Asset libraries include all sub-directories, so enable maximal recursion. */
121  /* 'SMALL' size by default. More reasonable since this is typically used as regular editor,
122  * space is more of an issue here. */
123  base_params->thumbnail_size = 96;
124 
125  fileselect_initialize_params_common(sfile, base_params);
126 }
127 
132 {
134 
136  wmOperator *op = sfile->op;
137 
138  const char *blendfile_path = BKE_main_blendfile_path_from_global();
139 
140  /* create new parameters if necessary */
141  if (!sfile->params) {
142  sfile->params = MEM_callocN(sizeof(FileSelectParams), "fileselparams");
143  /* set path to most recently opened .blend */
144  BLI_split_dirfile(blendfile_path,
145  sfile->params->dir,
146  sfile->params->file,
147  sizeof(sfile->params->dir),
148  sizeof(sfile->params->file));
149  sfile->params->filter_glob[0] = '\0';
153  }
154 
155  params = sfile->params;
156 
157  /* set the parameters from the operator, if it exists */
158  if (op) {
159  PropertyRNA *prop;
160  const bool is_files = (RNA_struct_find_property(op->ptr, "files") != NULL);
161  const bool is_filepath = (RNA_struct_find_property(op->ptr, "filepath") != NULL);
162  const bool is_filename = (RNA_struct_find_property(op->ptr, "filename") != NULL);
163  const bool is_directory = (RNA_struct_find_property(op->ptr, "directory") != NULL);
164  const bool is_relative_path = (RNA_struct_find_property(op->ptr, "relative_path") != NULL);
165 
167  params->title, WM_operatortype_name(op->type, op->ptr), sizeof(params->title));
168 
169  if ((prop = RNA_struct_find_property(op->ptr, "filemode"))) {
170  params->type = RNA_property_int_get(op->ptr, prop);
171  }
172  else {
173  params->type = FILE_SPECIAL;
174  }
175 
176  if (is_filepath && RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) {
177  char name[FILE_MAX];
178  RNA_string_get(op->ptr, "filepath", name);
179  if (params->type == FILE_LOADLIB) {
180  BLI_strncpy(params->dir, name, sizeof(params->dir));
181  params->file[0] = '\0';
182  }
183  else {
185  name, params->dir, params->file, sizeof(params->dir), sizeof(params->file));
186  }
187  }
188  else {
189  if (is_directory && RNA_struct_property_is_set_ex(op->ptr, "directory", false)) {
190  RNA_string_get(op->ptr, "directory", params->dir);
191  params->file[0] = '\0';
192  }
193 
194  if (is_filename && RNA_struct_property_is_set_ex(op->ptr, "filename", false)) {
195  RNA_string_get(op->ptr, "filename", params->file);
196  }
197  }
198 
199  if (params->dir[0]) {
200  BLI_path_normalize_dir(blendfile_path, params->dir);
201  BLI_path_abs(params->dir, blendfile_path);
202  }
203 
204  params->flag = 0;
205  if (is_directory == true && is_filename == false && is_filepath == false &&
206  is_files == false) {
207  params->flag |= FILE_DIRSEL_ONLY;
208  }
209  if ((prop = RNA_struct_find_property(op->ptr, "check_existing"))) {
210  params->flag |= RNA_property_boolean_get(op->ptr, prop) ? FILE_CHECK_EXISTING : 0;
211  }
212  if ((prop = RNA_struct_find_property(op->ptr, "hide_props_region"))) {
213  params->flag |= RNA_property_boolean_get(op->ptr, prop) ? FILE_HIDE_TOOL_PROPS : 0;
214  }
215 
216  params->filter = 0;
217  if ((prop = RNA_struct_find_property(op->ptr, "filter_blender"))) {
218  params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_BLENDER : 0;
219  }
220  if ((prop = RNA_struct_find_property(op->ptr, "filter_blenlib"))) {
221  params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_BLENDERLIB : 0;
222  }
223  if ((prop = RNA_struct_find_property(op->ptr, "filter_backup"))) {
224  params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_BLENDER_BACKUP : 0;
225  }
226  if ((prop = RNA_struct_find_property(op->ptr, "filter_image"))) {
227  params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_IMAGE : 0;
228  }
229  if ((prop = RNA_struct_find_property(op->ptr, "filter_movie"))) {
230  params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_MOVIE : 0;
231  }
232  if ((prop = RNA_struct_find_property(op->ptr, "filter_python"))) {
233  params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_PYSCRIPT : 0;
234  }
235  if ((prop = RNA_struct_find_property(op->ptr, "filter_font"))) {
236  params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_FTFONT : 0;
237  }
238  if ((prop = RNA_struct_find_property(op->ptr, "filter_sound"))) {
239  params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_SOUND : 0;
240  }
241  if ((prop = RNA_struct_find_property(op->ptr, "filter_text"))) {
242  params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_TEXT : 0;
243  }
244  if ((prop = RNA_struct_find_property(op->ptr, "filter_archive"))) {
245  params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_ARCHIVE : 0;
246  }
247  if ((prop = RNA_struct_find_property(op->ptr, "filter_folder"))) {
248  params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_FOLDER : 0;
249  }
250  if ((prop = RNA_struct_find_property(op->ptr, "filter_btx"))) {
251  params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_BTX : 0;
252  }
253  if ((prop = RNA_struct_find_property(op->ptr, "filter_collada"))) {
254  params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_COLLADA : 0;
255  }
256  if ((prop = RNA_struct_find_property(op->ptr, "filter_alembic"))) {
257  params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_ALEMBIC : 0;
258  }
259  if ((prop = RNA_struct_find_property(op->ptr, "filter_usd"))) {
260  params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_USD : 0;
261  }
262  if ((prop = RNA_struct_find_property(op->ptr, "filter_obj"))) {
263  params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_OBJECT_IO : 0;
264  }
265  if ((prop = RNA_struct_find_property(op->ptr, "filter_volume"))) {
266  params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_VOLUME : 0;
267  }
268  if ((prop = RNA_struct_find_property(op->ptr, "filter_glob"))) {
269  /* Protection against Python scripts not setting proper size limit. */
270  char *tmp = RNA_property_string_get_alloc(
271  op->ptr, prop, params->filter_glob, sizeof(params->filter_glob), NULL);
272  if (tmp != params->filter_glob) {
273  BLI_strncpy(params->filter_glob, tmp, sizeof(params->filter_glob));
274  MEM_freeN(tmp);
275 
276  /* Fix stupid things that truncating might have generated,
277  * like last group being a 'match everything' wildcard-only one... */
279  }
281  }
282  else {
283  params->filter_glob[0] = '\0';
284  }
285 
286  if (params->filter != 0) {
287  if (U.uiflag & USER_FILTERFILEEXTS) {
288  params->flag |= FILE_FILTER;
289  }
290  else {
291  params->flag &= ~FILE_FILTER;
292  }
293  }
294 
295  if (U.uiflag & USER_HIDE_DOT) {
296  params->flag |= FILE_HIDE_DOT;
297  }
298  else {
299  params->flag &= ~FILE_HIDE_DOT;
300  }
301 
302  if (params->type == FILE_LOADLIB) {
303  params->flag |= RNA_boolean_get(op->ptr, "link") ? FILE_LINK : 0;
304  params->flag |= RNA_boolean_get(op->ptr, "autoselect") ? FILE_AUTOSELECT : 0;
305  params->flag |= RNA_boolean_get(op->ptr, "active_collection") ? FILE_ACTIVE_COLLECTION : 0;
306  }
307 
308  if ((prop = RNA_struct_find_property(op->ptr, "allow_path_tokens"))) {
309  params->flag |= RNA_property_boolean_get(op->ptr, prop) ? FILE_PATH_TOKENS_ALLOW : 0;
310  }
311 
312  if ((prop = RNA_struct_find_property(op->ptr, "display_type"))) {
313  params->display = RNA_property_enum_get(op->ptr, prop);
314  }
315 
316  if (params->display == FILE_DEFAULTDISPLAY) {
318  }
319 
320  if ((prop = RNA_struct_find_property(op->ptr, "sort_method"))) {
321  params->sort = RNA_property_enum_get(op->ptr, prop);
322  }
323 
324  if (params->sort == FILE_SORT_DEFAULT) {
326  }
327 
328  if (is_relative_path) {
329  if ((prop = RNA_struct_find_property(op->ptr, "relative_path"))) {
330  if (!RNA_property_is_set_ex(op->ptr, prop, false)) {
331  RNA_property_boolean_set(op->ptr, prop, (U.flag & USER_RELPATHS) != 0);
332  }
333  }
334  }
335  }
336  else {
337  /* default values, if no operator */
338  params->type = FILE_UNIX;
340  params->flag &= ~FILE_DIRSEL_ONLY;
341  params->display = FILE_VERTICALDISPLAY;
342  params->sort = FILE_SORT_ALPHA;
343  params->filter = 0;
344  params->filter_glob[0] = '\0';
345  }
346 
348 
349  return params;
350 }
351 
353 {
354  switch ((eFileBrowse_Mode)sfile->browse_mode) {
356  if (!sfile->params) {
358  }
359  return sfile->params;
361  if (!sfile->asset_params) {
363  }
364  return &sfile->asset_params->base_params;
365  }
366 
367  BLI_assert_msg(0, "Invalid browse mode set in file space.");
368  return NULL;
369 }
370 
372 {
373  if (!sfile) {
374  /* Sometimes called in poll before space type was checked. */
375  return NULL;
376  }
377 
378  switch ((eFileBrowse_Mode)sfile->browse_mode) {
380  return sfile->params;
382  return (FileSelectParams *)sfile->asset_params;
383  }
384 
385  BLI_assert_msg(0, "Invalid browse mode set in file space.");
386  return NULL;
387 }
388 
390 {
391  return (sfile->browse_mode == FILE_BROWSE_MODE_FILES) ? sfile->params : NULL;
392 }
393 
395 {
396  return (sfile->browse_mode == FILE_BROWSE_MODE_ASSETS) ? sfile->asset_params : NULL;
397 }
398 
400 {
401  const FileAssetSelectParams *asset_params = ED_fileselect_get_asset_params(sfile);
402  if (asset_params == NULL) {
403  return false;
404  }
405  return asset_params->asset_library_ref.type == ASSET_LIBRARY_LOCAL;
406 }
407 
409 {
411  FileSelectParams *base_params = &asset_params->base_params;
412  bUserAssetLibrary *user_library = NULL;
413 
414  /* Ensure valid repository, or fall-back to local one. */
415  if (library->type == ASSET_LIBRARY_CUSTOM) {
416  BLI_assert(library->custom_library_index >= 0);
417 
419  library->custom_library_index);
420  if (!user_library) {
422  }
423  }
424 
425  switch (library->type) {
426  case ASSET_LIBRARY_LOCAL:
427  base_params->dir[0] = '\0';
428  break;
430  BLI_assert(user_library);
431  BLI_strncpy(base_params->dir, user_library->path, sizeof(base_params->dir));
432  break;
433  }
434  base_params->type = (library->type == ASSET_LIBRARY_LOCAL) ? FILE_MAIN_ASSET :
436 }
437 
439 {
441  if (asset_params) {
442  fileselect_refresh_asset_params(asset_params);
443  }
444 }
445 
447 {
448  return (sfile->browse_mode == FILE_BROWSE_MODE_FILES);
449 }
450 
452 {
453  return (sfile->browse_mode == FILE_BROWSE_MODE_ASSETS);
454 }
455 
457 {
458  if (!ED_fileselect_is_asset_browser(sfile) || !sfile->files) {
459  return NULL;
460  }
461 
462  return filelist_asset_library(sfile->files);
463 }
464 
466 {
467  if (!ED_fileselect_is_asset_browser(sfile)) {
468  return NULL;
469  }
470 
472  const FileDirEntry *file = filelist_file(sfile->files, params->active_file);
473  if (file == NULL) {
474  return NULL;
475  }
476 
477  return filelist_file_get_id(file);
478 }
479 
480 void ED_fileselect_activate_asset_catalog(const SpaceFile *sfile, const bUUID catalog_id)
481 {
482  if (!ED_fileselect_is_asset_browser(sfile)) {
483  return;
484  }
485 
487  params->asset_catalog_visibility = FILE_SHOW_ASSETS_FROM_CATALOG;
488  params->catalog_id = catalog_id;
490 }
491 
492 static void on_reload_activate_by_id(SpaceFile *sfile, onReloadFnData custom_data)
493 {
494  ID *asset_id = (ID *)custom_data;
495  ED_fileselect_activate_by_id(sfile, asset_id, false);
496 }
497 
498 void ED_fileselect_activate_by_id(SpaceFile *sfile, ID *asset_id, const bool deferred)
499 {
500  if (!ED_fileselect_is_asset_browser(sfile)) {
501  return;
502  }
503 
504  /* If there are filelist operations running now ("pending" true) or soon ("force reset" true),
505  * there is a fair chance that the to-be-activated ID will only be present after these operations
506  * have completed. Defer activation until then. */
507  if (deferred || filelist_pending(sfile->files) || filelist_needs_force_reset(sfile->files)) {
508  /* This should be thread-safe, as this function is likely called from the main thread, and
509  * notifiers (which cause a call to the on-reload callback function) are handled on the main
510  * thread as well. */
512  return;
513  }
514 
516  struct FileList *files = sfile->files;
517 
518  const int file_index = filelist_file_find_id(files, asset_id);
519  const FileDirEntry *file = filelist_file_ex(files, file_index, true);
520  if (file == NULL) {
521  return;
522  }
523 
524  params->active_file = file_index;
526 
529 }
530 
531 static void on_reload_select_by_relpath(SpaceFile *sfile, onReloadFnData custom_data)
532 {
533  const char *relative_path = custom_data;
534  ED_fileselect_activate_by_relpath(sfile, relative_path);
535 }
536 
537 void ED_fileselect_activate_by_relpath(SpaceFile *sfile, const char *relative_path)
538 {
539  /* If there are filelist operations running now ("pending" true) or soon ("force reset" true),
540  * there is a fair chance that the to-be-activated file at relative_path will only be present
541  * after these operations have completed. Defer activation until then. */
542  struct FileList *files = sfile->files;
543  if (files == NULL || filelist_pending(files) || filelist_needs_force_reset(files)) {
544  /* Casting away the constness of `relative_path` is safe here, because eventually it just ends
545  * up in another call to this function, and then it's a const char* again. */
546  file_on_reload_callback_register(sfile, on_reload_select_by_relpath, (char *)relative_path);
547  return;
548  }
549 
551  const int num_files_filtered = filelist_files_ensure(files);
552 
553  for (int file_index = 0; file_index < num_files_filtered; ++file_index) {
554  const FileDirEntry *file = filelist_file(files, file_index);
555 
556  if (STREQ(file->relpath, relative_path)) {
557  params->active_file = file_index;
559  }
560  }
562 }
563 
565 {
568 }
569 
570 /* The subset of FileSelectParams.flag items we store into preferences. Note that FILE_SORT_ALPHA
571  * may also be remembered, but only conditionally. */
572 #define PARAMS_FLAGS_REMEMBERED (FILE_HIDE_DOT)
573 
574 void ED_fileselect_window_params_get(const wmWindow *win, int win_size[2], bool *is_maximized)
575 {
576  /* Get DPI/pixel-size independent size to be stored in preferences. */
577  WM_window_set_dpi(win); /* Ensure the DPI is taken from the right window. */
578 
579  win_size[0] = WM_window_pixels_x(win) / UI_DPI_FAC;
580  win_size[1] = WM_window_pixels_y(win) / UI_DPI_FAC;
581 
582  *is_maximized = WM_window_is_maximized(win);
583 }
584 
586 {
587  PropertyRNA *prop;
588  return (sfile->op == NULL) ||
589  !(prop = RNA_struct_find_property(sfile->op->ptr, "display_type")) ||
590  (RNA_property_enum_get(sfile->op->ptr, prop) == FILE_DEFAULTDISPLAY);
591 }
592 
594 {
595  PropertyRNA *prop;
596  return (sfile->op == NULL) ||
597  !(prop = RNA_struct_find_property(sfile->op->ptr, "sort_method")) ||
598  (RNA_property_enum_get(sfile->op->ptr, prop) == FILE_SORT_DEFAULT);
599 }
600 
602 {
603  wmOperator *op = sfile->op;
604  UserDef_FileSpaceData *sfile_udata = &U.file_space_data;
605 
607 
609  if (!op) {
610  return;
611  }
612 
613  params->thumbnail_size = sfile_udata->thumbnail_size;
614  params->details_flags = sfile_udata->details_flags;
615  params->filter_id = sfile_udata->filter_id;
616 
617  /* Combine flags we take from params with the flags we take from userdef. */
618  params->flag = (params->flag & ~PARAMS_FLAGS_REMEMBERED) |
619  (sfile_udata->flag & PARAMS_FLAGS_REMEMBERED);
620 
622  params->display = sfile_udata->display_type;
623  }
625  params->sort = sfile_udata->sort_type;
626  /* For the default sorting, also take invert flag from userdef. */
627  params->flag = (params->flag & ~FILE_SORT_INVERT) | (sfile_udata->flag & FILE_SORT_INVERT);
628  }
629 }
630 
632  const int temp_win_size[2],
633  const bool is_maximized)
634 {
636  UserDef_FileSpaceData *sfile_udata_new = &U.file_space_data;
637  UserDef_FileSpaceData sfile_udata_old = U.file_space_data;
638 
639  sfile_udata_new->thumbnail_size = params->thumbnail_size;
640  sfile_udata_new->details_flags = params->details_flags;
641  sfile_udata_new->flag = params->flag & PARAMS_FLAGS_REMEMBERED;
642  sfile_udata_new->filter_id = params->filter_id;
643 
644  /* In some rare cases, operators ask for a specific display or sort type (e.g. chronological
645  * sorting for "Recover Auto Save"). So the settings are optimized for a specific operation.
646  * Don't let that change the userdef memory for more general cases. */
648  sfile_udata_new->display_type = params->display;
649  }
651  sfile_udata_new->sort_type = params->sort;
652  /* In this case also remember the invert flag. */
653  sfile_udata_new->flag = (sfile_udata_new->flag & ~FILE_SORT_INVERT) |
654  (params->flag & FILE_SORT_INVERT);
655  }
656 
657  if (temp_win_size && !is_maximized) {
658  sfile_udata_new->temp_win_sizex = temp_win_size[0];
659  sfile_udata_new->temp_win_sizey = temp_win_size[1];
660  }
661 
662  /* Tag prefs as dirty if something has changed. */
663  if (memcmp(sfile_udata_new, &sfile_udata_old, sizeof(sfile_udata_old)) != 0) {
664  U.runtime.is_dirty = true;
665  }
666 }
667 
668 void fileselect_file_set(SpaceFile *sfile, const int index)
669 {
670  const struct FileDirEntry *file = filelist_file(sfile->files, index);
671  if (file && file->relpath && file->relpath[0] && !(file->typeflag & FILE_TYPE_DIR)) {
673  BLI_strncpy(params->file, file->relpath, FILE_MAXFILE);
674  }
675 }
676 
678 {
679  int numfiles;
680 
681  /* Values in pixels.
682  *
683  * - *_item: size of each (row|col), (including padding)
684  * - *_view: (x|y) size of the view.
685  * - *_over: extra pixels, to take into account, when the fit isn't exact
686  * (needed since you may see the end of the previous column and the beginning of the next).
687  *
688  * Could be more clever and take scrolling into account,
689  * but for now don't bother.
690  */
691  if (layout->flag & FILE_LAYOUT_HOR) {
692  const int x_item = layout->tile_w + (2 * layout->tile_border_x);
693  const int x_view = (int)(BLI_rctf_size_x(&region->v2d.cur));
694  const int x_over = x_item - (x_view % x_item);
695  numfiles = (int)((float)(x_view + x_over) / (float)(x_item));
696  return numfiles * layout->rows;
697  }
698 
699  const int y_item = layout->tile_h + (2 * layout->tile_border_y);
700  const int y_view = (int)(BLI_rctf_size_y(&region->v2d.cur)) - layout->offset_top;
701  const int y_over = y_item - (y_view % y_item);
702  numfiles = (int)((float)(y_view + y_over) / (float)(y_item));
703  return numfiles * layout->flow_columns;
704 }
705 
706 static bool is_inside(int x, int y, int cols, int rows)
707 {
708  return ((x >= 0) && (x < cols) && (y >= 0) && (y < rows));
709 }
710 
712 {
713  int colmin, colmax, rowmin, rowmax;
714  FileSelection sel;
715  sel.first = sel.last = -1;
716 
717  if (layout == NULL) {
718  return sel;
719  }
720 
721  colmin = (rect->xmin) / (layout->tile_w + 2 * layout->tile_border_x);
722  rowmin = (rect->ymin - layout->offset_top) / (layout->tile_h + 2 * layout->tile_border_y);
723  colmax = (rect->xmax) / (layout->tile_w + 2 * layout->tile_border_x);
724  rowmax = (rect->ymax - layout->offset_top) / (layout->tile_h + 2 * layout->tile_border_y);
725 
726  if (is_inside(colmin, rowmin, layout->flow_columns, layout->rows) ||
727  is_inside(colmax, rowmax, layout->flow_columns, layout->rows)) {
728  CLAMP(colmin, 0, layout->flow_columns - 1);
729  CLAMP(rowmin, 0, layout->rows - 1);
730  CLAMP(colmax, 0, layout->flow_columns - 1);
731  CLAMP(rowmax, 0, layout->rows - 1);
732  }
733 
734  if ((colmin > layout->flow_columns - 1) || (rowmin > layout->rows - 1)) {
735  sel.first = -1;
736  }
737  else {
738  if (layout->flag & FILE_LAYOUT_HOR) {
739  sel.first = layout->rows * colmin + rowmin;
740  }
741  else {
742  sel.first = colmin + layout->flow_columns * rowmin;
743  }
744  }
745  if ((colmax > layout->flow_columns - 1) || (rowmax > layout->rows - 1)) {
746  sel.last = -1;
747  }
748  else {
749  if (layout->flag & FILE_LAYOUT_HOR) {
750  sel.last = layout->rows * colmax + rowmax;
751  }
752  else {
753  sel.last = colmax + layout->flow_columns * rowmax;
754  }
755  }
756 
757  return sel;
758 }
759 
761 {
762  int offsetx, offsety;
763  int active_file;
764 
765  if (layout == NULL) {
766  return -1;
767  }
768 
769  offsetx = (x) / (layout->tile_w + 2 * layout->tile_border_x);
770  offsety = (y - layout->offset_top) / (layout->tile_h + 2 * layout->tile_border_y);
771 
772  if (offsetx > layout->flow_columns - 1) {
773  return -1;
774  }
775  if (offsety > layout->rows - 1) {
776  return -1;
777  }
778 
779  if (layout->flag & FILE_LAYOUT_HOR) {
780  active_file = layout->rows * offsetx + offsety;
781  }
782  else {
783  active_file = offsetx + layout->flow_columns * offsety;
784  }
785  return active_file;
786 }
787 
788 void ED_fileselect_layout_maskrect(const FileLayout *layout, const View2D *v2d, rcti *r_rect)
789 {
790  *r_rect = v2d->mask;
791  r_rect->ymax -= layout->offset_top;
792 }
793 
794 bool ED_fileselect_layout_is_inside_pt(const FileLayout *layout, const View2D *v2d, int x, int y)
795 {
796  rcti maskrect;
797  ED_fileselect_layout_maskrect(layout, v2d, &maskrect);
798  return BLI_rcti_isect_pt(&maskrect, x, y);
799 }
800 
802  const View2D *v2d,
803  const rcti *rect,
804  rcti *r_dst)
805 {
806  rcti maskrect;
807  ED_fileselect_layout_maskrect(layout, v2d, &maskrect);
808  return BLI_rcti_isect(&maskrect, rect, r_dst);
809 }
810 
811 void ED_fileselect_layout_tilepos(const FileLayout *layout, int tile, int *x, int *y)
812 {
813  if (layout->flag == FILE_LAYOUT_HOR) {
814  *x = layout->tile_border_x +
815  (tile / layout->rows) * (layout->tile_w + 2 * layout->tile_border_x);
816  *y = layout->offset_top + layout->tile_border_y +
817  (tile % layout->rows) * (layout->tile_h + 2 * layout->tile_border_y);
818  }
819  else {
820  *x = layout->tile_border_x +
821  ((tile) % layout->flow_columns) * (layout->tile_w + 2 * layout->tile_border_x);
822  *y = layout->offset_top + layout->tile_border_y +
823  ((tile) / layout->flow_columns) * (layout->tile_h + 2 * layout->tile_border_y);
824  }
825 }
826 
828  const FileLayout *layout,
829  int x,
830  int y)
831 {
832  rcti header_rect = v2d->mask;
833  header_rect.ymin = header_rect.ymax - layout->attribute_column_header_h;
834  return BLI_rcti_isect_pt(&header_rect, x, y);
835 }
836 
839 {
840  switch (column) {
841  case COLUMN_NAME:
842  /* Always enabled */
843  return true;
844  case COLUMN_DATETIME:
845  return (params->details_flags & FILE_DETAILS_DATETIME) != 0;
846  case COLUMN_SIZE:
847  return (params->details_flags & FILE_DETAILS_SIZE) != 0;
848  default:
849  return false;
850  }
851 }
852 
854  const FileSelectParams *params,
855  FileLayout *layout,
856  int x)
857 {
858  float mx, my;
859  int offset_tile;
860 
861  UI_view2d_region_to_view(v2d, x, v2d->mask.ymax - layout->offset_top - 1, &mx, &my);
862  offset_tile = ED_fileselect_layout_offset(
863  layout, (int)(v2d->tot.xmin + mx), (int)(v2d->tot.ymax - my));
864  if (offset_tile > -1) {
865  int tile_x, tile_y;
866  int pos_x = 0;
867  int rel_x; /* x relative to the hovered tile */
868 
869  ED_fileselect_layout_tilepos(layout, offset_tile, &tile_x, &tile_y);
870  /* Column header drawing doesn't use left tile border, so subtract it. */
871  rel_x = mx - (tile_x - layout->tile_border_x);
872 
873  for (FileAttributeColumnType column = 0; column < ATTRIBUTE_COLUMN_MAX; column++) {
875  continue;
876  }
877  const int width = layout->attribute_columns[column].width;
878 
879  if (IN_RANGE(rel_x, pos_x, pos_x + width)) {
880  return column;
881  }
882 
883  pos_x += width;
884  }
885  }
886 
887  return COLUMN_NONE;
888 }
889 
890 float file_string_width(const char *str)
891 {
892  const uiStyle *style = UI_style_get();
893  UI_fontstyle_set(&style->widget);
895 }
896 
898 {
899 #if 0
900  float s;
901  char tmp[2] = "X";
902  const uiStyle *style = UI_style_get();
903  UI_fontstyle_set(&style->widget);
904  s = BLF_height(style->widget.uifont_id, tmp);
905  return style->widget.points;
906 #else
907  const uiStyle *style = UI_style_get();
908  UI_fontstyle_set(&style->widget);
909  return style->widget.points * UI_DPI_FAC;
910 #endif
911 }
912 
914 {
915  FileAttributeColumn *columns = layout->attribute_columns;
916  const bool small_size = SMALL_SIZE_CHECK(params->thumbnail_size);
917  const int pad = small_size ? 0 : ATTRIBUTE_COLUMN_PADDING * 2;
918 
919  for (int i = 0; i < ATTRIBUTE_COLUMN_MAX; i++) {
920  layout->attribute_columns[i].width = 0;
921  }
922 
923  /* Biggest possible reasonable values... */
924  columns[COLUMN_DATETIME].width = file_string_width(small_size ? "23/08/89" :
925  "23 Dec 6789, 23:59") +
926  pad;
927  columns[COLUMN_SIZE].width = file_string_width(small_size ? "98.7 M" : "098.7 MiB") + pad;
928  if (params->display == FILE_IMGDISPLAY) {
929  columns[COLUMN_NAME].width = ((float)params->thumbnail_size / 8.0f) * UI_UNIT_X;
930  }
931  /* Name column uses remaining width */
932  else {
933  int remwidth = layout->tile_w;
934  for (FileAttributeColumnType column_type = ATTRIBUTE_COLUMN_MAX - 1; column_type >= 0;
935  column_type--) {
936  if ((column_type == COLUMN_NAME) ||
938  continue;
939  }
940  remwidth -= columns[column_type].width;
941  }
942  columns[COLUMN_NAME].width = remwidth;
943  }
944 }
945 
947 {
949 
950  layout->attribute_columns[COLUMN_NAME].name = N_("Name");
953  layout->attribute_columns[COLUMN_DATETIME].name = N_("Date Modified");
956  layout->attribute_columns[COLUMN_SIZE].name = N_("Size");
959 }
960 
961 void ED_fileselect_init_layout(struct SpaceFile *sfile, ARegion *region)
962 {
964  /* Request a slightly more compact layout for asset browsing. */
965  const bool compact = ED_fileselect_is_asset_browser(sfile);
966  FileLayout *layout = NULL;
967  View2D *v2d = &region->v2d;
968  int numfiles;
969  int textheight;
970 
971  if (sfile->layout == NULL) {
972  sfile->layout = MEM_callocN(sizeof(struct FileLayout), "file_layout");
973  sfile->layout->dirty = true;
974  }
975  else if (sfile->layout->dirty == false) {
976  return;
977  }
978 
979  numfiles = filelist_files_ensure(sfile->files);
980  textheight = (int)file_font_pointsize();
981  layout = sfile->layout;
982  layout->textheight = textheight;
983 
984  if (params->display == FILE_IMGDISPLAY) {
985  const float pad_fac = compact ? 0.15f : 0.3f;
986  /* Matches UI_preview_tile_size_x()/_y() by default. */
987  layout->prv_w = ((float)params->thumbnail_size / 20.0f) * UI_UNIT_X;
988  layout->prv_h = ((float)params->thumbnail_size / 20.0f) * UI_UNIT_Y;
989  layout->tile_border_x = pad_fac * UI_UNIT_X;
990  layout->tile_border_y = pad_fac * UI_UNIT_X;
991  layout->prv_border_x = pad_fac * UI_UNIT_X;
992  layout->prv_border_y = pad_fac * UI_UNIT_Y;
993  layout->tile_w = layout->prv_w + 2 * layout->prv_border_x;
994  layout->tile_h = layout->prv_h + 2 * layout->prv_border_y + textheight;
995  layout->width = (int)(BLI_rctf_size_x(&v2d->cur) - 2 * layout->tile_border_x);
996  layout->flow_columns = layout->width / (layout->tile_w + 2 * layout->tile_border_x);
997  layout->attribute_column_header_h = 0;
998  layout->offset_top = 0;
999  if (layout->flow_columns > 0) {
1000  layout->rows = divide_ceil_u(numfiles, layout->flow_columns);
1001  }
1002  else {
1003  layout->flow_columns = 1;
1004  layout->rows = numfiles;
1005  }
1006  layout->height = sfile->layout->rows * (layout->tile_h + 2 * layout->tile_border_y) +
1007  layout->tile_border_y * 2 - layout->offset_top;
1008  layout->flag = FILE_LAYOUT_VER;
1009  }
1010  else if (params->display == FILE_VERTICALDISPLAY) {
1011  int rowcount;
1012 
1013  /* Matches UI_preview_tile_size_x()/_y() by default. */
1014  layout->prv_w = ((float)params->thumbnail_size / 20.0f) * UI_UNIT_X;
1015  layout->prv_h = ((float)params->thumbnail_size / 20.0f) * UI_UNIT_Y;
1016  layout->tile_border_x = 0.4f * UI_UNIT_X;
1017  layout->tile_border_y = 0.1f * UI_UNIT_Y;
1018  layout->tile_h = textheight * 3 / 2;
1019  layout->width = (int)(BLI_rctf_size_x(&v2d->cur) - 2 * layout->tile_border_x);
1020  layout->tile_w = layout->width;
1021  layout->flow_columns = 1;
1022  layout->attribute_column_header_h = layout->tile_h * 1.2f + 2 * layout->tile_border_y;
1023  layout->offset_top = layout->attribute_column_header_h;
1024  rowcount = (int)(BLI_rctf_size_y(&v2d->cur) - layout->offset_top - 2 * layout->tile_border_y) /
1025  (layout->tile_h + 2 * layout->tile_border_y);
1027 
1028  layout->rows = MAX2(rowcount, numfiles);
1029  BLI_assert(layout->rows != 0);
1030  layout->height = sfile->layout->rows * (layout->tile_h + 2 * layout->tile_border_y) +
1031  layout->tile_border_y * 2 + layout->offset_top;
1032  layout->flag = FILE_LAYOUT_VER;
1033  }
1034  else if (params->display == FILE_HORIZONTALDISPLAY) {
1035  /* Matches UI_preview_tile_size_x()/_y() by default. */
1036  layout->prv_w = ((float)params->thumbnail_size / 20.0f) * UI_UNIT_X;
1037  layout->prv_h = ((float)params->thumbnail_size / 20.0f) * UI_UNIT_Y;
1038  layout->tile_border_x = 0.4f * UI_UNIT_X;
1039  layout->tile_border_y = 0.1f * UI_UNIT_Y;
1040  layout->tile_h = textheight * 3 / 2;
1041  layout->attribute_column_header_h = 0;
1042  layout->offset_top = layout->attribute_column_header_h;
1043  layout->height = (int)(BLI_rctf_size_y(&v2d->cur) - 2 * layout->tile_border_y);
1044  /* Padding by full scrollbar H is too much, can overlap tile border Y. */
1045  layout->rows = (layout->height - V2D_SCROLL_HEIGHT + layout->tile_border_y) /
1046  (layout->tile_h + 2 * layout->tile_border_y);
1049 
1050  if (layout->rows > 0) {
1051  layout->flow_columns = divide_ceil_u(numfiles, layout->rows);
1052  }
1053  else {
1054  layout->rows = 1;
1055  layout->flow_columns = numfiles;
1056  }
1057  layout->width = sfile->layout->flow_columns * (layout->tile_w + 2 * layout->tile_border_x) +
1058  layout->tile_border_x * 2;
1059  layout->flag = FILE_LAYOUT_HOR;
1060  }
1061  layout->dirty = false;
1062 }
1063 
1065 {
1066  if (!sfile->layout) {
1067  ED_fileselect_init_layout(sfile, region);
1068  }
1069  return sfile->layout;
1070 }
1071 
1073 {
1074  /* May happen when manipulating non-active spaces. */
1075  if (UNLIKELY(area->spacetype != SPACE_FILE)) {
1076  return;
1077  }
1078  SpaceFile *sfile = area->spacedata.first;
1080  if (params) {
1082  ED_fileselect_clear(wm, sfile);
1083 
1084  /* Clear search string, it is very rare to want to keep that filter while changing dir,
1085  * and usually very annoying to keep it actually! */
1086  params->filter_search[0] = '\0';
1087  params->active_file = -1;
1088 
1089  if (!filelist_is_dir(sfile->files, params->dir)) {
1090  BLI_strncpy(params->dir, filelist_dir(sfile->files), sizeof(params->dir));
1091  /* could return but just refresh the current dir */
1092  }
1093  filelist_setdir(sfile->files, params->dir);
1094 
1095  if (folderlist_clear_next(sfile)) {
1096  folderlist_free(sfile->folders_next);
1097  }
1098 
1099  folderlist_pushdir(sfile->folders_prev, params->dir);
1100 
1102  }
1103 }
1104 
1106 {
1107  ScrArea *area = CTX_wm_area(C);
1109 }
1110 
1112 {
1113  FileSelection sel;
1114  sel.first = 0;
1115  sel.last = filelist_files_ensure(sfile->files) - 1;
1116 
1118 }
1119 
1120 int file_select_match(struct SpaceFile *sfile, const char *pattern, char *matched_file)
1121 {
1122  int match = 0;
1123 
1124  int n = filelist_files_ensure(sfile->files);
1125 
1126  /* select any file that matches the pattern, this includes exact match
1127  * if the user selects a single file by entering the filename
1128  */
1129  for (int i = 0; i < n; i++) {
1130  FileDirEntry *file = filelist_file(sfile->files, i);
1131  /* Do not check whether file is a file or dir here! Causes: T44243
1132  * (we do accept directories at this stage). */
1133  if (fnmatch(pattern, file->relpath, 0) == 0) {
1135  if (!match) {
1136  BLI_strncpy(matched_file, file->relpath, FILE_MAX);
1137  }
1138  match++;
1139  }
1140  }
1141 
1142  return match;
1143 }
1144 
1145 int autocomplete_directory(struct bContext *C, char *str, void *UNUSED(arg_v))
1146 {
1147  SpaceFile *sfile = CTX_wm_space_file(C);
1148  int match = AUTOCOMPLETE_NO_MATCH;
1149 
1150  /* search if str matches the beginning of name */
1151  if (str[0] && sfile->files) {
1152  char dirname[FILE_MAX];
1153 
1154  DIR *dir;
1155  struct dirent *de;
1156 
1158 
1159  dir = opendir(dirname);
1160 
1161  if (dir) {
1163 
1164  while ((de = readdir(dir)) != NULL) {
1165  if (FILENAME_IS_CURRPAR(de->d_name)) {
1166  /* pass */
1167  }
1168  else {
1169  char path[FILE_MAX];
1170  BLI_stat_t status;
1171 
1172  BLI_join_dirfile(path, sizeof(path), dirname, de->d_name);
1173 
1174  if (BLI_stat(path, &status) == 0) {
1175  if (S_ISDIR(status.st_mode)) { /* is subdir */
1176  UI_autocomplete_update_name(autocpl, path);
1177  }
1178  }
1179  }
1180  }
1181  closedir(dir);
1182 
1183  match = UI_autocomplete_end(autocpl, str);
1184  if (match == AUTOCOMPLETE_FULL_MATCH) {
1186  }
1187  }
1188  }
1189 
1190  return match;
1191 }
1192 
1193 int autocomplete_file(struct bContext *C, char *str, void *UNUSED(arg_v))
1194 {
1195  SpaceFile *sfile = CTX_wm_space_file(C);
1196  int match = AUTOCOMPLETE_NO_MATCH;
1197 
1198  /* search if str matches the beginning of name */
1199  if (str[0] && sfile->files) {
1201  int nentries = filelist_files_ensure(sfile->files);
1202 
1203  for (int i = 0; i < nentries; i++) {
1204  FileDirEntry *file = filelist_file(sfile->files, i);
1205  UI_autocomplete_update_name(autocpl, file->relpath);
1206  }
1207  match = UI_autocomplete_end(autocpl, str);
1208  }
1209 
1210  return match;
1211 }
1212 
1214 {
1215  /* only NULL in rare cases - T29734. */
1216  if (sfile->files) {
1217  filelist_readjob_stop(sfile->files, wm);
1218  filelist_freelib(sfile->files);
1219  filelist_clear(sfile->files);
1220  }
1221 
1223  params->highlight_file = -1;
1225 }
1226 
1228 {
1229  if (!sfile) {
1230  return;
1231  }
1232  if (sfile->op) {
1233  wmWindow *temp_win = (wm->winactive && WM_window_is_temp_screen(wm->winactive)) ?
1234  wm->winactive :
1235  NULL;
1236  if (temp_win) {
1237  int win_size[2];
1238  bool is_maximized;
1239 
1240  ED_fileselect_window_params_get(temp_win, win_size, &is_maximized);
1241  ED_fileselect_params_to_userdef(sfile, win_size, is_maximized);
1242  }
1243  else {
1244  ED_fileselect_params_to_userdef(sfile, NULL, false);
1245  }
1246 
1248  sfile->op = NULL;
1249  }
1250 
1251  folder_history_list_free(sfile);
1252 
1253  if (sfile->files) {
1254  ED_fileselect_clear(wm, sfile);
1255  filelist_free(sfile->files);
1256  MEM_freeN(sfile->files);
1257  sfile->files = NULL;
1258  }
1259 }
1260 
1262 {
1263  WM_event_remove_timer(wm, win, sfile->smoothscroll_timer);
1264  sfile->smoothscroll_timer = NULL;
1265 }
1266 
1268 {
1270 
1272 
1273  if (sfile->smoothscroll_timer != NULL) {
1274  file_params_smoothscroll_timer_clear(wm, win, sfile);
1275  }
1276  sfile->smoothscroll_timer = WM_event_add_timer(wm, win, TIMER1, 1.0 / 1000.0);
1277  sfile->scroll_offset = 0;
1278 }
1279 
1281  wmWindow *win,
1282  SpaceFile *sfile,
1283  FileDirEntry *rename_file)
1284 {
1286 
1288  sfile->files, rename_file, FILE_SEL_REMOVE, FILE_SEL_EDITING, CHECK_ALL);
1289 
1290  /* Ensure smooth-scroll timer is active, even if not needed, because that way rename state is
1291  * handled properly. */
1292  file_params_invoke_rename_postscroll(wm, win, sfile);
1293  /* Also always activate the rename file, even if renaming was canceled. */
1295 }
1296 
1298 {
1299  params->renamefile[0] = '\0';
1300  params->rename_id = NULL;
1301  params->rename_flag = 0;
1302 }
1303 
1304 static int file_params_find_renamed(const FileSelectParams *params, struct FileList *filelist)
1305 {
1306  /* Find the file either through the local ID/asset it represents or its relative path. */
1307  return (params->rename_id != NULL) ? filelist_file_find_id(filelist, params->rename_id) :
1308  filelist_file_find_path(filelist, params->renamefile);
1309 }
1310 
1312 {
1313  BLI_assert(params->rename_flag != 0);
1314 
1316  0) {
1317  return;
1318  }
1319 
1320  BLI_assert(params->renamefile[0] != '\0' || params->rename_id != NULL);
1321 
1322  int idx = file_params_find_renamed(params, sfile->files);
1323  if (idx >= 0) {
1324  FileDirEntry *file = filelist_file(sfile->files, idx);
1325  BLI_assert(file != NULL);
1326 
1327  params->active_file = idx;
1329 
1330  if ((params->rename_flag & FILE_PARAMS_RENAME_PENDING) != 0) {
1332  params->rename_flag = FILE_PARAMS_RENAME_ACTIVE;
1333  }
1334  else if ((params->rename_flag & FILE_PARAMS_RENAME_POSTSCROLL_PENDING) != 0) {
1335  /* file_select_deselect_all() will resort and re-filter, so `idx` will probably have changed.
1336  * Need to get the correct #FileDirEntry again. */
1338  idx = file_params_find_renamed(params, sfile->files);
1339  file = filelist_file(sfile->files, idx);
1342  params->active_file = idx;
1345  }
1346  }
1347  /* File listing is now async, only reset renaming if matching entry is not found
1348  * when file listing is not done. */
1349  else if (filelist_is_ready(sfile->files)) {
1351  }
1352 }
1353 
1355 {
1356  bScreen *screen = WM_window_get_active_screen(win);
1357 
1358  ED_screen_areas_iter (win, screen, area) {
1359  if (area->spacetype == SPACE_FILE) {
1360  SpaceFile *sfile = area->spacedata.first;
1361 
1362  if (sfile->op == file_operator) {
1363  return area;
1364  }
1365  }
1366  }
1367 
1368  return NULL;
1369 }
1370 
1372 {
1373  const bScreen *screen = WM_window_get_active_screen(win);
1374 
1375  ED_screen_areas_iter (win, screen, area) {
1376  if (area->spacetype != SPACE_FILE) {
1377  continue;
1378  }
1379 
1380  const SpaceFile *sfile = area->spacedata.first;
1381  if (sfile->op) {
1382  return area;
1383  }
1384  }
1385 
1386  return NULL;
1387 }
typedef float(TangentPoint)[2]
const char * BKE_appdir_folder_default(void) ATTR_WARN_UNUSED_RESULT
Definition: appdir.c:127
struct AssetLibrary AssetLibrary
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:738
struct wmWindowManager * CTX_wm_manager(const bContext *C)
Definition: context.c:713
struct SpaceFile * CTX_wm_space_file(const bContext *C)
Definition: context.c:842
const char * BKE_main_blendfile_path_from_global(void)
Definition: main.c:562
struct bUserAssetLibrary * BKE_preferences_asset_library_find_from_index(const struct UserDef *userdef, int index) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
float BLF_height(int fontid, const char *str, size_t str_len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition: blf.c:717
#define BLF_DRAW_STR_DUMMY_MAX
Definition: BLF_api.h:356
float BLF_width(int fontid, const char *str, size_t str_len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition: blf.c:688
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define BLI_assert_msg(a, msg)
Definition: BLI_assert.h:53
int BLI_stat(const char *path, BLI_stat_t *buffer) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
struct stat BLI_stat_t
Definition: BLI_fileops.h:73
MINLINE uint divide_ceil_u(uint a, uint b)
void BLI_split_dir_part(const char *string, char *dir, size_t dirlen)
Definition: path_util.c:1490
void BLI_path_normalize_dir(const char *relabase, char *dir) ATTR_NONNULL(2)
Definition: path_util.c:221
#define FILE_MAXFILE
void BLI_split_dirfile(const char *string, char *dir, char *file, size_t dirlen, size_t filelen)
Definition: path_util.c:1465
bool BLI_path_extension_glob_validate(char *ext_fnmatch) ATTR_NONNULL()
Definition: path_util.c:1367
#define FILE_MAX
#define FILENAME_IS_CURRPAR(_n)
int BLI_path_slash_ensure(char *string) ATTR_NONNULL()
Definition: path_util.c:1780
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
Definition: path_util.c:897
void BLI_join_dirfile(char *__restrict dst, size_t maxlen, const char *__restrict dir, const char *__restrict file) ATTR_NONNULL()
Definition: path_util.c:1531
bool BLI_rcti_isect_pt(const struct rcti *rect, int x, int y)
bool BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition: BLI_rect.h:194
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition: BLI_rect.h:198
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL(1
unsigned int uint
Definition: BLI_sys_types.h:67
#define IN_RANGE(a, b, c)
#define UNUSED(x)
#define MAX2(a, b)
#define UNLIKELY(x)
#define STREQ(a, b)
Compatibility-like things for windows.
struct __dirstream DIR
Definition: BLI_winstuff.h:84
int closedir(DIR *dp)
#define S_ISDIR(x)
Definition: BLI_winstuff.h:48
const char * dirname(char *path)
struct dirent * readdir(DIR *dp)
DIR * opendir(const char *path)
external readfile function prototypes.
const struct UserDef U_default
#define FILTER_ID_ALL
Definition: DNA_ID.h:939
@ ASSET_LIBRARY_CUSTOM
@ ASSET_LIBRARY_LOCAL
@ FILE_SORT_DEFAULT
@ FILE_SORT_ALPHA
@ FILE_SORT_TIME
@ FILE_SORT_SIZE
@ FILE_LOADLIB
@ FILE_ASSET_LIBRARY
@ FILE_SPECIAL
@ FILE_UNIX
@ FILE_MAIN_ASSET
@ FILE_TYPE_BTX
@ FILE_TYPE_BLENDER
@ FILE_TYPE_ALEMBIC
@ FILE_TYPE_ARCHIVE
@ FILE_TYPE_TEXT
@ FILE_TYPE_COLLADA
@ FILE_TYPE_PYSCRIPT
@ FILE_TYPE_BLENDER_BACKUP
@ FILE_TYPE_VOLUME
@ FILE_TYPE_MOVIE
@ FILE_TYPE_SOUND
@ FILE_TYPE_OBJECT_IO
@ FILE_TYPE_FOLDER
@ FILE_TYPE_FTFONT
@ FILE_TYPE_BLENDERLIB
@ FILE_TYPE_OPERATOR
@ FILE_TYPE_USD
@ FILE_TYPE_IMAGE
@ FILE_TYPE_DIR
@ SPACE_FILE
@ FILE_PARAMS_RENAME_POSTSCROLL_PENDING
@ FILE_PARAMS_RENAME_ACTIVE
@ FILE_PARAMS_RENAME_POSTSCROLL_ACTIVE
@ FILE_PARAMS_RENAME_PENDING
@ FILE_DETAILS_DATETIME
@ FILE_DETAILS_SIZE
@ FILE_SHOW_ASSETS_FROM_CATALOG
eFileBrowse_Mode
@ FILE_BROWSE_MODE_ASSETS
@ FILE_BROWSE_MODE_FILES
@ FILE_SEL_EDITING
@ FILE_SEL_HIGHLIGHTED
@ FILE_SEL_SELECTED
@ FILE_ASSET_IMPORT_APPEND_REUSE
@ FILE_VERTICALDISPLAY
@ FILE_IMGDISPLAY
@ FILE_HORIZONTALDISPLAY
@ FILE_DEFAULTDISPLAY
@ FILE_ACTIVE_COLLECTION
@ FILE_HIDE_TOOL_PROPS
@ FILE_CHECK_EXISTING
@ FILE_AUTOSELECT
@ FILE_FILTER
@ FILE_SORT_INVERT
@ FILE_DIRSEL_ONLY
@ FILE_LINK
@ FILE_ASSETS_ONLY
@ FILE_HIDE_DOT
@ FILE_PATH_TOKENS_ALLOW
#define FILE_SELECT_MAX_RECURSIONS
@ USER_HIDE_DOT
@ USER_FILTERFILEEXTS
@ USER_RELPATHS
#define FILE_LAYOUT_HOR
Definition: ED_fileselect.h:30
#define FILE_LAYOUT_VER
Definition: ED_fileselect.h:31
FileAttributeColumnType
Definition: ED_fileselect.h:33
@ COLUMN_DATETIME
Definition: ED_fileselect.h:36
@ ATTRIBUTE_COLUMN_MAX
Definition: ED_fileselect.h:39
@ COLUMN_NAME
Definition: ED_fileselect.h:35
@ COLUMN_NONE
Definition: ED_fileselect.h:34
@ COLUMN_SIZE
Definition: ED_fileselect.h:37
#define ED_screen_areas_iter(win, screen, area_name)
Definition: ED_screen.h:267
_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
_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 GLsizei width
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
#define C
Definition: RandGen.cpp:25
#define UI_UNIT_Y
#define AUTOCOMPLETE_FULL_MATCH
void UI_fontstyle_set(const struct uiFontStyle *fs)
const struct uiStyle * UI_style_get(void)
#define AUTOCOMPLETE_NO_MATCH
AutoComplete * UI_autocomplete_begin(const char *startname, size_t maxlen)
Definition: interface.cc:4901
@ UI_STYLE_TEXT_LEFT
@ UI_STYLE_TEXT_RIGHT
int UI_autocomplete_end(AutoComplete *autocpl, char *autoname)
Definition: interface.cc:4948
#define UI_DPI_FAC
Definition: UI_interface.h:305
#define UI_UNIT_X
void UI_autocomplete_update_name(AutoComplete *autocpl, const char *name)
Definition: interface.cc:4914
#define V2D_SCROLL_HEIGHT
Definition: UI_view2d.h:54
void UI_view2d_region_to_view(const struct View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
#define NA_ACTIVATED
Definition: WM_types.h:529
#define ND_SPACE_ASSET_PARAMS
Definition: WM_types.h:468
#define NC_ASSET
Definition: WM_types.h:354
#define ND_SPACE_FILE_PARAMS
Definition: WM_types.h:466
#define NC_SPACE
Definition: WM_types.h:342
#define NA_SELECTED
Definition: WM_types.h:528
#define ND_SPACE_FILE_LIST
Definition: WM_types.h:467
int pad[32 - sizeof(int)]
unsigned int U
Definition: btGjkEpa3.h:78
FILE * file
#define str(s)
void file_on_reload_callback_register(struct SpaceFile *sfile, onReloadFn callback, onReloadFnData custom_data)
Definition: space_file.c:407
#define SMALL_SIZE_CHECK(_size)
Definition: file_intern.h:33
#define ATTRIBUTE_COLUMN_PADDING
Definition: file_intern.h:30
void * onReloadFnData
Definition: file_intern.h:168
void file_draw_check_ex(bContext *C, struct ScrArea *area)
Definition: file_ops.c:1711
void filelist_free(struct FileList *filelist)
Definition: filelist.c:2019
bool filelist_is_ready(struct FileList *filelist)
Definition: filelist.c:2158
void folder_history_list_ensure_for_active_browse_mode(SpaceFile *sfile)
Definition: filelist.c:202
int filelist_file_find_path(struct FileList *filelist, const char *filename)
Definition: filelist.c:2285
void filelist_freelib(struct FileList *filelist)
Definition: filelist.c:2047
void filelist_entries_select_index_range_set(FileList *filelist, FileSelection *sel, FileSelType select, uint flag, FileCheckType check)
Definition: filelist.c:2936
void folder_history_list_free(SpaceFile *sfile)
Definition: filelist.c:229
void filelist_setdir(struct FileList *filelist, char *r_dir)
Definition: filelist.c:2116
int folderlist_clear_next(struct SpaceFile *sfile)
Definition: filelist.c:145
void filelist_clear(FileList *filelist)
Definition: filelist.c:2000
void folderlist_pushdir(ListBase *folderlist, const char *dir)
Definition: filelist.c:109
ID * filelist_file_get_id(const FileDirEntry *file)
Definition: filelist.c:2321
AssetLibrary * filelist_asset_library(FileList *filelist)
Definition: filelist.c:2042
void folderlist_free(ListBase *folderlist)
Definition: filelist.c:166
int filelist_file_find_id(const FileList *filelist, const ID *id)
Definition: filelist.c:2305
void filelist_readjob_stop(FileList *filelist, wmWindowManager *wm)
Definition: filelist.c:4118
uint filelist_entry_select_set(const FileList *filelist, const FileDirEntry *entry, FileSelType select, uint flag, FileCheckType check)
Definition: filelist.c:2879
FileDirEntry * filelist_file(struct FileList *filelist, int index)
Definition: filelist.c:2280
bool filelist_pending(struct FileList *filelist)
Definition: filelist.c:2163
int filelist_files_ensure(FileList *filelist)
Definition: filelist.c:2173
FileDirEntry * filelist_file_ex(struct FileList *filelist, const int index, const bool use_request)
Definition: filelist.c:2232
bool filelist_needs_force_reset(FileList *filelist)
Definition: filelist.c:2140
bool filelist_is_dir(struct FileList *filelist, const char *path)
Definition: filelist.c:2111
const char * filelist_dir(struct FileList *filelist)
Definition: filelist.c:2106
@ FILE_SEL_REMOVE
Definition: filelist.h:27
@ FILE_SEL_ADD
Definition: filelist.h:28
@ CHECK_ALL
Definition: filelist.h:35
void ED_fileselect_params_to_userdef(SpaceFile *sfile, const int temp_win_size[2], const bool is_maximized)
Definition: filesel.c:631
void file_params_smoothscroll_timer_clear(wmWindowManager *wm, wmWindow *win, SpaceFile *sfile)
Definition: filesel.c:1261
bool ED_fileselect_is_file_browser(const SpaceFile *sfile)
Definition: filesel.c:446
struct ID * ED_fileselect_active_asset_get(const SpaceFile *sfile)
Definition: filesel.c:465
int autocomplete_file(struct bContext *C, char *str, void *UNUSED(arg_v))
Definition: filesel.c:1193
int file_select_match(struct SpaceFile *sfile, const char *pattern, char *matched_file)
Definition: filesel.c:1120
void ED_fileselect_activate_by_relpath(SpaceFile *sfile, const char *relative_path)
Definition: filesel.c:537
int ED_fileselect_layout_numfiles(FileLayout *layout, ARegion *region)
Definition: filesel.c:677
int autocomplete_directory(struct bContext *C, char *str, void *UNUSED(arg_v))
Definition: filesel.c:1145
bool ED_fileselect_is_local_asset_library(const SpaceFile *sfile)
Definition: filesel.c:399
FileSelectParams * ED_fileselect_get_active_params(const SpaceFile *sfile)
Definition: filesel.c:371
static int file_params_find_renamed(const FileSelectParams *params, struct FileList *filelist)
Definition: filesel.c:1304
void ED_file_change_dir_ex(bContext *C, ScrArea *area)
Definition: filesel.c:1072
void file_params_invoke_rename_postscroll(wmWindowManager *wm, wmWindow *win, SpaceFile *sfile)
Definition: filesel.c:1267
int ED_fileselect_layout_offset(FileLayout *layout, int x, int y)
Definition: filesel.c:760
FileSelectParams * ED_fileselect_get_file_params(const SpaceFile *sfile)
Definition: filesel.c:389
float file_string_width(const char *str)
Definition: filesel.c:890
static void fileselect_ensure_updated_asset_params(SpaceFile *sfile)
Definition: filesel.c:94
bool file_attribute_column_header_is_inside(const View2D *v2d, const FileLayout *layout, int x, int y)
Definition: filesel.c:827
#define VERTLIST_MAJORCOLUMN_WIDTH
Definition: filesel.c:64
void ED_fileselect_activate_asset_catalog(const SpaceFile *sfile, const bUUID catalog_id)
Definition: filesel.c:480
void file_params_renamefile_clear(FileSelectParams *params)
Definition: filesel.c:1297
static bool is_inside(int x, int y, int cols, int rows)
Definition: filesel.c:706
static void fileselect_initialize_params_common(SpaceFile *sfile, FileSelectParams *params)
Definition: filesel.c:66
ScrArea * ED_fileselect_handler_area_find_any_with_op(const wmWindow *win)
Definition: filesel.c:1371
void fileselect_refresh_params(SpaceFile *sfile)
Definition: filesel.c:438
FileAttributeColumnType file_attribute_column_type_find_isect(const View2D *v2d, const FileSelectParams *params, FileLayout *layout, int x)
Definition: filesel.c:853
struct AssetLibrary * ED_fileselect_active_asset_library_get(const SpaceFile *sfile)
Definition: filesel.c:456
FileLayout * ED_fileselect_get_layout(struct SpaceFile *sfile, ARegion *region)
Definition: filesel.c:1064
FileSelectParams * ED_fileselect_ensure_active_params(SpaceFile *sfile)
Definition: filesel.c:352
void ED_fileselect_exit(wmWindowManager *wm, SpaceFile *sfile)
Definition: filesel.c:1227
bool ED_fileselect_is_asset_browser(const SpaceFile *sfile)
Definition: filesel.c:451
void ED_fileselect_deselect_all(SpaceFile *sfile)
Definition: filesel.c:564
FileSelection ED_fileselect_layout_offset_rect(FileLayout *layout, const rcti *rect)
Definition: filesel.c:711
void ED_fileselect_activate_by_id(SpaceFile *sfile, ID *asset_id, const bool deferred)
Definition: filesel.c:498
bool file_attribute_column_type_enabled(const FileSelectParams *params, FileAttributeColumnType column)
Definition: filesel.c:837
void ED_fileselect_set_params_from_userdef(SpaceFile *sfile)
Definition: filesel.c:601
static void file_attribute_columns_init(const FileSelectParams *params, FileLayout *layout)
Definition: filesel.c:946
float file_font_pointsize(void)
Definition: filesel.c:897
void fileselect_file_set(SpaceFile *sfile, const int index)
Definition: filesel.c:668
bool ED_fileselect_layout_is_inside_pt(const FileLayout *layout, const View2D *v2d, int x, int y)
Definition: filesel.c:794
void file_params_rename_end(wmWindowManager *wm, wmWindow *win, SpaceFile *sfile, FileDirEntry *rename_file)
Definition: filesel.c:1280
#define PARAMS_FLAGS_REMEMBERED
Definition: filesel.c:572
static void on_reload_select_by_relpath(SpaceFile *sfile, onReloadFnData custom_data)
Definition: filesel.c:531
static void fileselect_refresh_asset_params(FileAssetSelectParams *asset_params)
Definition: filesel.c:408
void file_select_deselect_all(SpaceFile *sfile, uint flag)
Definition: filesel.c:1111
void file_params_renamefile_activate(SpaceFile *sfile, FileSelectParams *params)
Definition: filesel.c:1311
FileAssetSelectParams * ED_fileselect_get_asset_params(const SpaceFile *sfile)
Definition: filesel.c:394
void ED_fileselect_init_layout(struct SpaceFile *sfile, ARegion *region)
Definition: filesel.c:961
static bool file_select_use_default_display_type(const SpaceFile *sfile)
Definition: filesel.c:585
static void on_reload_activate_by_id(SpaceFile *sfile, onReloadFnData custom_data)
Definition: filesel.c:492
static void file_attribute_columns_widths(const FileSelectParams *params, FileLayout *layout)
Definition: filesel.c:913
static FileSelectParams * fileselect_ensure_updated_file_params(SpaceFile *sfile)
Definition: filesel.c:131
bool ED_fileselect_layout_isect_rect(const FileLayout *layout, const View2D *v2d, const rcti *rect, rcti *r_dst)
Definition: filesel.c:801
void ED_fileselect_window_params_get(const wmWindow *win, int win_size[2], bool *is_maximized)
Definition: filesel.c:574
void ED_fileselect_clear(wmWindowManager *wm, SpaceFile *sfile)
Definition: filesel.c:1213
void ED_fileselect_layout_maskrect(const FileLayout *layout, const View2D *v2d, rcti *r_rect)
Definition: filesel.c:788
void ED_fileselect_layout_tilepos(const FileLayout *layout, int tile, int *x, int *y)
Definition: filesel.c:811
void ED_file_change_dir(bContext *C)
Definition: filesel.c:1105
static bool file_select_use_default_sort_type(const SpaceFile *sfile)
Definition: filesel.c:593
ScrArea * ED_fileselect_handler_area_find(const wmWindow *win, const wmOperator *file_operator)
Definition: filesel.c:1354
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
ccl_global const KernelWorkTile * tile
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
static void area(int d1, int d2, int e1, int e2, float weights[2])
bool RNA_property_is_set_ex(PointerRNA *ptr, PropertyRNA *prop, bool use_ghost)
Definition: rna_access.c:5261
bool RNA_struct_property_is_set_ex(PointerRNA *ptr, const char *identifier, bool use_ghost)
Definition: rna_access.c:5289
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:717
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:2153
char * RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fixedbuf, int fixedlen, int *r_len)
Definition: rna_access.c:3178
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:2429
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
Definition: rna_access.c:5116
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
Definition: rna_access.c:2180
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:3402
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4863
AssetLibraryReference asset_library_ref
FileSelectParams base_params
const char * name
Definition: ED_fileselect.h:44
int prv_border_x
Definition: ED_fileselect.h:65
int prv_border_y
Definition: ED_fileselect.h:66
FileAttributeColumn attribute_columns[ATTRIBUTE_COLUMN_MAX]
Definition: ED_fileselect.h:78
int attribute_column_header_h
Definition: ED_fileselect.h:58
int tile_border_y
Definition: ED_fileselect.h:64
int flow_columns
Definition: ED_fileselect.h:70
int tile_border_x
Definition: ED_fileselect.h:63
unsigned short thumbnail_size
Definition: DNA_ID.h:368
struct wmTimer * smoothscroll_timer
struct FileLayout * layout
struct wmOperator * op
ListBase * folders_prev
struct FileList * files
FileSelectParams * params
FileAssetSelectParams * asset_params
ListBase * folders_next
UserDef_FileSpaceData file_space_data
Universally Unique Identifier according to RFC4122.
char * d_name
Definition: BLI_winstuff.h:80
float xmin
Definition: DNA_vec_types.h:69
float ymax
Definition: DNA_vec_types.h:70
int ymin
Definition: DNA_vec_types.h:64
int ymax
Definition: DNA_vec_types.h:64
int xmin
Definition: DNA_vec_types.h:63
int xmax
Definition: DNA_vec_types.h:63
uiFontStyle widget
struct wmOperatorType * type
struct PointerRNA * ptr
struct wmWindow * winactive
#define N_(msgid)
static FT_Library library
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_fileselect_event(wmWindowManager *wm, void *ophandle, int eventval)
@ TIMER1
@ EVT_FILESELECT_EXTERNAL_CANCEL
const char * WM_operatortype_name(struct wmOperatorType *ot, struct PointerRNA *properties)
void WM_event_remove_timer(wmWindowManager *wm, wmWindow *UNUSED(win), wmTimer *timer)
Definition: wm_window.c:1682
int WM_window_pixels_y(const wmWindow *win)
Definition: wm_window.c:2082
void WM_window_set_dpi(const wmWindow *win)
Definition: wm_window.c:447
bScreen * WM_window_get_active_screen(const wmWindow *win)
Definition: wm_window.c:2300
bool WM_window_is_temp_screen(const wmWindow *win)
Definition: wm_window.c:2311
bool WM_window_is_maximized(const wmWindow *win)
Definition: wm_window.c:2131
int WM_window_pixels_x(const wmWindow *win)
Definition: wm_window.c:2076
wmTimer * WM_event_add_timer(wmWindowManager *wm, wmWindow *win, int event_type, double timestep)
Definition: wm_window.c:1630