IDs: change FILTER_ID_* to 64 bit to make space for new ID types
authorBrecht Van Lommel <brecht>
Tue, 3 Mar 2020 16:21:28 +0000 (17:21 +0100)
committerBrecht Van Lommel <brecht@blender.org>
Tue, 3 Mar 2020 16:34:21 +0000 (17:34 +0100)
And change file browser to boolean from bitflag enum, which is only 32 bit.

Differential Revision: https://developer.blender.org/D7004

13 files changed:
release/scripts/startup/bl_ui/space_filebrowser.py
source/blender/blenkernel/BKE_blender_copybuffer.h
source/blender/blenkernel/BKE_idcode.h
source/blender/blenkernel/intern/blender_copybuffer.c
source/blender/blenkernel/intern/idcode.c
source/blender/blenloader/BLO_readfile.h
source/blender/blenloader/intern/readfile.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_file/filelist.h
source/blender/makesdna/DNA_ID.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/intern/rna_space.c

index 8ff85459d35d8d9b41f905742fed6eb895d324ab..95046678b2701bc9e74e66b06a5838ccb92b4189 100644 (file)
@@ -148,7 +148,12 @@ class FILEBROWSER_PT_filter(Panel):
             if params.use_filter_blendid:
                 row = col.row()
                 row.label(icon='BLANK1')  # Indentation
-                row.prop(params, "filter_id_category", text="")
+
+                sub = row.column(align=True)
+                filter_id = params.filter_id
+                for identifier in dir(filter_id):
+                    if identifier.startswith("category_"):
+                        sub.prop(filter_id, identifier, toggle=True)
 
                 col.separator()
 
@@ -314,8 +319,11 @@ class FILEBROWSER_PT_advanced_filter(Panel):
             layout.prop(params, "use_filter_blendid")
             if params.use_filter_blendid:
                 layout.separator()
-                col = layout.column()
-                col.prop(params, "filter_id")
+                col = layout.column(align=True)
+                filter_id = params.filter_id
+                for identifier in dir(filter_id):
+                    if identifier.startswith("filter_"):
+                        col.prop(filter_id, identifier, toggle=True)
 
 
 class FILEBROWSER_PT_directory_path(Panel):
index fcc30ffc20d55f921b57cb535a68c6493014be5b..ca20d3d9bbab03bc0eb9dc17c3a5f4cdd2947e58 100644 (file)
@@ -20,6 +20,8 @@
  * \ingroup bke
  */
 
+#include "BLI_sys_types.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -36,12 +38,12 @@ bool BKE_copybuffer_save(struct Main *bmain_src, const char *filename, struct Re
 bool BKE_copybuffer_read(struct Main *bmain_dst,
                          const char *libname,
                          struct ReportList *reports,
-                         const unsigned int id_types_mask);
+                         const uint64_t id_types_mask);
 int BKE_copybuffer_paste(struct bContext *C,
                          const char *libname,
                          const short flag,
                          struct ReportList *reports,
-                         const unsigned int id_types_mask);
+                         const uint64_t id_types_mask);
 
 #ifdef __cplusplus
 }
index dc58651b4e8b424a9cf79ee0c76f08052bea3d2a..067143e3253f6445879f436db242dce7940f63dc 100644 (file)
@@ -24,6 +24,8 @@
  * \ingroup bke
  */
 
+#include "BLI_sys_types.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -35,8 +37,8 @@ short BKE_idcode_from_name(const char *name);
 bool BKE_idcode_is_linkable(short idcode);
 bool BKE_idcode_is_valid(short idcode);
 
-int BKE_idcode_to_idfilter(const short idcode);
-short BKE_idcode_from_idfilter(const int idfilter);
+uint64_t BKE_idcode_to_idfilter(const short idcode);
+short BKE_idcode_from_idfilter(const uint64_t idfilter);
 
 int BKE_idcode_to_index(const short idcode);
 short BKE_idcode_from_index(const int index);
index f78eefa0a27fe2c817bee74ed60b57e69fd1a49b..8619db34d931a7ec5178291d51fc5129fec56676 100644 (file)
@@ -84,7 +84,7 @@ bool BKE_copybuffer_save(Main *bmain_src, const char *filename, ReportList *repo
 bool BKE_copybuffer_read(Main *bmain_dst,
                          const char *libname,
                          ReportList *reports,
-                         const unsigned int id_types_mask)
+                         const uint64_t id_types_mask)
 {
   BlendHandle *bh = BLO_blendhandle_from_file(libname, reports);
   if (bh == NULL) {
@@ -117,7 +117,7 @@ int BKE_copybuffer_paste(bContext *C,
                          const char *libname,
                          const short flag,
                          ReportList *reports,
-                         const unsigned int id_types_mask)
+                         const uint64_t id_types_mask)
 {
   Main *bmain = CTX_data_main(C);
   Scene *scene = CTX_data_scene(C);
index 6b7cb181374c5000f94048c00020ec2a3556b579..b9ca77ceb675a023d3e2764260ed998d6c8c92ed 100644 (file)
@@ -179,7 +179,7 @@ short BKE_idcode_from_name(const char *name)
 /**
  * Convert an idcode into an idfilter (e.g. ID_OB -> FILTER_ID_OB).
  */
-int BKE_idcode_to_idfilter(const short idcode)
+uint64_t BKE_idcode_to_idfilter(const short idcode)
 {
 #define CASE_IDFILTER(_id) \
   case ID_##_id: \
@@ -227,7 +227,7 @@ int BKE_idcode_to_idfilter(const short idcode)
 /**
  * Convert an idfilter into an idcode (e.g. FILTER_ID_OB -> ID_OB).
  */
-short BKE_idcode_from_idfilter(const int idfilter)
+short BKE_idcode_from_idfilter(const uint64_t idfilter)
 {
 #define CASE_IDFILTER(_id) \
   case FILTER_ID_##_id: \
index ee7877b1a5d8611176d6bd584593b011615d2ab2..00dbe3343567da1fd34cfdd6202d826dd4ca8f25 100644 (file)
@@ -19,6 +19,8 @@
 #ifndef __BLO_READFILE_H__
 #define __BLO_READFILE_H__
 
+#include "BLI_sys_types.h"
+
 /** \file
  * \ingroup blenloader
  * \brief external readfile function prototypes.
@@ -145,9 +147,7 @@ void BLO_library_link_end(struct Main *mainl,
                           struct ViewLayer *view_layer,
                           const struct View3D *v3d);
 
-int BLO_library_link_copypaste(struct Main *mainl,
-                               BlendHandle *bh,
-                               const unsigned int id_types_mask);
+int BLO_library_link_copypaste(struct Main *mainl, BlendHandle *bh, const uint64_t id_types_mask);
 
 void *BLO_library_read_struct(struct FileData *fd, struct BHead *bh, const char *blockname);
 
index d97fe900679f08b80a32a8a181437fd35632ada0..c1f61db27c38198115ceb4a91e6fb9ec2a200690 100644 (file)
@@ -11259,7 +11259,7 @@ static ID *link_named_part(
 /**
  * Simple reader for copy/paste buffers.
  */
-int BLO_library_link_copypaste(Main *mainl, BlendHandle *bh, const unsigned int id_types_mask)
+int BLO_library_link_copypaste(Main *mainl, BlendHandle *bh, const uint64_t id_types_mask)
 {
   FileData *fd = (FileData *)(bh);
   BHead *bhead;
index 9defff74c6f40d807157be9517c2d549b93c129c..11304d6ae466f1ee7f13ed2a25ff0fc66dbbc1b0 100644 (file)
@@ -269,8 +269,8 @@ typedef struct FileListEntryPreview {
 } FileListEntryPreview;
 
 typedef struct FileListFilter {
-  unsigned int filter;
-  unsigned int filter_id;
+  uint64_t filter;
+  uint64_t filter_id;
   char filter_glob[FILE_MAXFILE];
   char filter_search[66]; /* + 2 for heading/trailing implicit '*' wildcards. */
   short flags;
@@ -361,7 +361,7 @@ static void filelist_readjob_dir(
 
 /* helper, could probably go in BKE actually? */
 static int groupname_to_code(const char *group);
-static unsigned int groupname_to_filter_id(const char *group);
+static uint64_t groupname_to_filter_id(const char *group);
 
 static void filelist_filter_clear(FileList *filelist);
 static void filelist_cache_clear(FileListEntryCache *cache, size_t new_size);
@@ -746,7 +746,7 @@ static bool is_filtered_lib(FileListInternEntry *file, const char *root, FileLis
             is_filtered = false;
           }
           else {
-            unsigned int filter_id = groupname_to_filter_id(group);
+            uint64_t filter_id = groupname_to_filter_id(group);
             if (!(filter_id & filter->filter_id)) {
               is_filtered = false;
             }
@@ -835,8 +835,8 @@ void filelist_setfilter_options(FileList *filelist,
                                 const bool do_filter,
                                 const bool hide_dot,
                                 const bool hide_parent,
-                                const unsigned int filter,
-                                const unsigned int filter_id,
+                                const uint64_t filter,
+                                const uint64_t filter_id,
                                 const char *filter_glob,
                                 const char *filter_search)
 {
@@ -2422,7 +2422,7 @@ static int groupname_to_code(const char *group)
   return buf[0] ? BKE_idcode_from_name(buf) : 0;
 }
 
-static unsigned int groupname_to_filter_id(const char *group)
+static uint64_t groupname_to_filter_id(const char *group)
 {
   int id_code = groupname_to_code(group);
 
index 9b1107294ff6bc65017cdaf2b7d44b2eec29ad80..654a86b1702fd702973dbcb64df658f6fdfee918 100644 (file)
@@ -62,8 +62,8 @@ void filelist_setfilter_options(struct FileList *filelist,
                                 const bool do_filter,
                                 const bool hide_dot,
                                 const bool hide_parent,
-                                const unsigned int filter,
-                                const unsigned int filter_id,
+                                const uint64_t filter,
+                                const uint64_t filter_id,
                                 const char *filter_glob,
                                 const char *filter_search);
 void filelist_filter(struct FileList *filelist);
index d0ba2b0c4e58031d9d38d91b98de0cfaeaedd997..89af705d5eda18ee49106ba2ab6d64684ad5b2a7 100644 (file)
@@ -645,43 +645,39 @@ typedef enum IDRecalcFlag {
 
 } IDRecalcFlag;
 
-/* To filter ID types (filter_id) */
-/* XXX We cannot put all needed IDs inside an enum...
- *     We'll have to see whether we can fit all needed ones inside 32 values,
- *     or if we need to fallback to longlong defines :/
- */
+/* To filter ID types (filter_id). 64 bit to fit all types. */
 enum {
-  FILTER_ID_AC = (1 << 0),
-  FILTER_ID_AR = (1 << 1),
-  FILTER_ID_BR = (1 << 2),
-  FILTER_ID_CA = (1 << 3),
-  FILTER_ID_CU = (1 << 4),
-  FILTER_ID_GD = (1 << 5),
-  FILTER_ID_GR = (1 << 6),
-  FILTER_ID_IM = (1 << 7),
-  FILTER_ID_LA = (1 << 8),
-  FILTER_ID_LS = (1 << 9),
-  FILTER_ID_LT = (1 << 10),
-  FILTER_ID_MA = (1 << 11),
-  FILTER_ID_MB = (1 << 12),
-  FILTER_ID_MC = (1 << 13),
-  FILTER_ID_ME = (1 << 14),
-  FILTER_ID_MSK = (1 << 15),
-  FILTER_ID_NT = (1 << 16),
-  FILTER_ID_OB = (1 << 17),
-  FILTER_ID_PAL = (1 << 18),
-  FILTER_ID_PC = (1 << 19),
-  FILTER_ID_SCE = (1 << 20),
-  FILTER_ID_SPK = (1 << 21),
-  FILTER_ID_SO = (1 << 22),
-  FILTER_ID_TE = (1 << 23),
-  FILTER_ID_TXT = (1 << 24),
-  FILTER_ID_VF = (1 << 25),
-  FILTER_ID_WO = (1 << 26),
-  FILTER_ID_PA = (1 << 27),
-  FILTER_ID_CF = (1 << 28),
-  FILTER_ID_WS = (1 << 29),
-  FILTER_ID_LP = (1u << 31),
+  FILTER_ID_AC = (1ULL << 0),
+  FILTER_ID_AR = (1ULL << 1),
+  FILTER_ID_BR = (1ULL << 2),
+  FILTER_ID_CA = (1ULL << 3),
+  FILTER_ID_CU = (1ULL << 4),
+  FILTER_ID_GD = (1ULL << 5),
+  FILTER_ID_GR = (1ULL << 6),
+  FILTER_ID_IM = (1ULL << 7),
+  FILTER_ID_LA = (1ULL << 8),
+  FILTER_ID_LS = (1ULL << 9),
+  FILTER_ID_LT = (1ULL << 10),
+  FILTER_ID_MA = (1ULL << 11),
+  FILTER_ID_MB = (1ULL << 12),
+  FILTER_ID_MC = (1ULL << 13),
+  FILTER_ID_ME = (1ULL << 14),
+  FILTER_ID_MSK = (1ULL << 15),
+  FILTER_ID_NT = (1ULL << 16),
+  FILTER_ID_OB = (1ULL << 17),
+  FILTER_ID_PAL = (1ULL << 18),
+  FILTER_ID_PC = (1ULL << 19),
+  FILTER_ID_SCE = (1ULL << 20),
+  FILTER_ID_SPK = (1ULL << 21),
+  FILTER_ID_SO = (1ULL << 22),
+  FILTER_ID_TE = (1ULL << 23),
+  FILTER_ID_TXT = (1ULL << 24),
+  FILTER_ID_VF = (1ULL << 25),
+  FILTER_ID_WO = (1ULL << 26),
+  FILTER_ID_PA = (1ULL << 27),
+  FILTER_ID_CF = (1ULL << 28),
+  FILTER_ID_WS = (1ULL << 29),
+  FILTER_ID_LP = (1ULL << 31),
 };
 
 #define FILTER_ID_ALL \
index bdfe5040794e91d5685c8e8dbfa26489af824541..548212a2b0dbd67b359d779179ac638ec5b1afe2 100644 (file)
@@ -676,7 +676,8 @@ typedef struct FileSelectParams {
   /** Text items name must match to be shown. */
   char filter_search[64];
   /** Same as filter, but for ID types (aka library groups). */
-  int filter_id;
+  int _pad0;
+  uint64_t filter_id;
 
   /** Active file used for keyboard navigation. */
   int active_file;
index d40559bc19467a97772c089dcf1c8aa52af6f510..b3f82bc126972947d1bc1e0d3548f5649da74f01 100644 (file)
@@ -604,7 +604,8 @@ typedef struct UserDef_FileSpaceData {
   int sort_type;      /* FileSelectParams.sort */
   int details_flags;  /* FileSelectParams.details_flags */
   int flag;           /* FileSelectParams.flag */
-  int filter_id;      /* FileSelectParams.filter_id */
+  int _pad0;
+  uint64_t filter_id; /* FileSelectParams.filter_id */
 
   /** Info used when creating the file browser in a temporary window. */
   int temp_win_sizex;
index 762c1985fa914b4006b0b32dc6f282b5e13e8149..63817137a02ade2baccbc36f2ada37c7ccbd3cf3 100644 (file)
@@ -2329,6 +2329,11 @@ static void rna_FileSelectPrams_filter_glob_set(PointerRNA *ptr, const char *val
   BLI_path_extension_glob_validate(params->filter_glob);
 }
 
+static PointerRNA rna_FileSelectParams_filter_id_get(PointerRNA *ptr)
+{
+  return rna_pointer_inherit_refine(ptr, &RNA_FileSelectIDFilter, ptr->data);
+}
+
 static void rna_FileBrowser_FSMenuEntry_path_get(PointerRNA *ptr, char *value)
 {
   char *path = ED_fsmenu_entry_get_path(ptr->data);
@@ -5328,139 +5333,169 @@ static void rna_def_space_console(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "Output", "Command output");
 }
 
-static void rna_def_fileselect_params(BlenderRNA *brna)
+/* Filter for datablock types in link/append. */
+static void rna_def_fileselect_idfilter(BlenderRNA *brna)
 {
-  StructRNA *srna;
-  PropertyRNA *prop;
-
-  static const EnumPropertyItem file_display_items[] = {
-      {FILE_VERTICALDISPLAY,
-       "LIST_VERTICAL",
-       ICON_LONGDISPLAY,
-       "Vertical List",
-       "Display files as a vertical list"},
-      {FILE_HORIZONTALDISPLAY,
-       "LIST_HORIZONTAL",
-       ICON_SHORTDISPLAY,
-       "Horizontal List",
-       "Display files as a horizontal list"},
-      {FILE_IMGDISPLAY, "THUMBNAIL", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"},
-      {0, NULL, 0, NULL, NULL},
+  struct IDFilterBoolean {
+    /* 64 bit, so we can't use bitflag enum. */
+    const uint64_t flag;
+    const char *identifier;
+    const int icon;
+    const char *name;
+    const char *description;
   };
 
-  static const EnumPropertyItem display_size_items[] = {
-      {64, "TINY", 0, "Tiny", ""},
-      {96, "SMALL", 0, "Small", ""},
-      {128, "NORMAL", 0, "Regular", ""},
-      {192, "LARGE", 0, "Large", ""},
-      {0, NULL, 0, NULL, NULL},
-  };
-
-  static const EnumPropertyItem file_filter_idtypes_items[] = {
-      {FILTER_ID_AC, "ACTION", ICON_ANIM_DATA, "Actions", "Show/hide Action data-blocks"},
+  static const struct IDFilterBoolean booleans[] = {
+      /* Datablocks */
+      {FILTER_ID_AC, "filter_action", ICON_ANIM_DATA, "Actions", "Show Action data-blocks"},
       {FILTER_ID_AR,
-       "ARMATURE",
+       "filter_armature",
        ICON_ARMATURE_DATA,
        "Armatures",
-       "Show/hide Armature data-blocks"},
-      {FILTER_ID_BR, "BRUSH", ICON_BRUSH_DATA, "Brushes", "Show/hide Brushes data-blocks"},
-      {FILTER_ID_CA, "CAMERA", ICON_CAMERA_DATA, "Cameras", "Show/hide Camera data-blocks"},
-      {FILTER_ID_CF, "CACHEFILE", ICON_FILE, "Cache Files", "Show/hide Cache File data-blocks"},
-      {FILTER_ID_CU, "CURVE", ICON_CURVE_DATA, "Curves", "Show/hide Curve data-blocks"},
+       "Show Armature data-blocks"},
+      {FILTER_ID_BR, "filter_brush", ICON_BRUSH_DATA, "Brushes", "Show Brushes data-blocks"},
+      {FILTER_ID_CA, "filter_camera", ICON_CAMERA_DATA, "Cameras", "Show Camera data-blocks"},
+      {FILTER_ID_CF, "filter_cachefile", ICON_FILE, "Cache Files", "Show Cache File data-blocks"},
+      {FILTER_ID_CU, "filter_curve", ICON_CURVE_DATA, "Curves", "Show Curve data-blocks"},
       {FILTER_ID_GD,
-       "GREASE_PENCIL",
+       "filter_grease_pencil",
        ICON_GREASEPENCIL,
        "Grease Pencil",
-       "Show/hide Grease pencil data-blocks"},
-      {FILTER_ID_GR, "GROUP", ICON_GROUP, "Collections", "Show/hide Collection data-blocks"},
-      {FILTER_ID_IM, "IMAGE", ICON_IMAGE_DATA, "Images", "Show/hide Image data-blocks"},
-      {FILTER_ID_LA, "LIGHT", ICON_LIGHT_DATA, "Lights", "Show/hide Light data-blocks"},
+       "Show Grease pencil data-blocks"},
+      {FILTER_ID_GR, "filter_group", ICON_GROUP, "Collections", "Show Collection data-blocks"},
+      {FILTER_ID_IM, "filter_image", ICON_IMAGE_DATA, "Images", "Show Image data-blocks"},
+      {FILTER_ID_LA, "filter_light", ICON_LIGHT_DATA, "Lights", "Show Light data-blocks"},
       {FILTER_ID_LS,
-       "LINESTYLE",
+       "filter_linestyle",
        ICON_LINE_DATA,
        "Freestyle Linestyles",
-       "Show/hide Freestyle's Line Style data-blocks"},
-      {FILTER_ID_LT, "LATTICE", ICON_LATTICE_DATA, "Lattices", "Show/hide Lattice data-blocks"},
+       "Show Freestyle's Line Style data-blocks"},
+      {FILTER_ID_LT, "filter_lattice", ICON_LATTICE_DATA, "Lattices", "Show Lattice data-blocks"},
       {FILTER_ID_MA,
-       "MATERIAL",
+       "filter_material",
        ICON_MATERIAL_DATA,
        "Materials",
-       "Show/hide Material data-blocks"},
-      {FILTER_ID_MB, "METABALL", ICON_META_DATA, "Metaballs", "Show/hide Metaball data-blocks"},
+       "Show Material data-blocks"},
+      {FILTER_ID_MB, "filter_metaball", ICON_META_DATA, "Metaballs", "Show Metaball data-blocks"},
       {FILTER_ID_MC,
-       "MOVIE_CLIP",
+       "filter_movie_clip",
        ICON_TRACKER_DATA,
        "Movie Clips",
-       "Show/hide Movie Clip data-blocks"},
-      {FILTER_ID_ME, "MESH", ICON_MESH_DATA, "Meshes", "Show/hide Mesh data-blocks"},
-      {FILTER_ID_MSK, "MASK", ICON_MOD_MASK, "Masks", "Show/hide Mask data-blocks"},
-      {FILTER_ID_NT, "NODE_TREE", ICON_NODETREE, "Node Trees", "Show/hide Node Tree data-blocks"},
-      {FILTER_ID_OB, "OBJECT", ICON_OBJECT_DATA, "Objects", "Show/hide Object data-blocks"},
+       "Show Movie Clip data-blocks"},
+      {FILTER_ID_ME, "filter_mesh", ICON_MESH_DATA, "Meshes", "Show Mesh data-blocks"},
+      {FILTER_ID_MSK, "filter_mask", ICON_MOD_MASK, "Masks", "Show Mask data-blocks"},
+      {FILTER_ID_NT,
+       "filter_node_tree",
+       ICON_NODETREE,
+       "Node Trees",
+       "Show Node Tree data-blocks"},
+      {FILTER_ID_OB, "filter_object", ICON_OBJECT_DATA, "Objects", "Show Object data-blocks"},
       {FILTER_ID_PA,
-       "PARTICLE_SETTINGS",
+       "filter_particle_settings",
        ICON_PARTICLE_DATA,
        "Particles Settings",
-       "Show/hide Particle Settings data-blocks"},
-      {FILTER_ID_PAL, "PALETTE", ICON_COLOR, "Palettes", "Show/hide Palette data-blocks"},
+       "Show Particle Settings data-blocks"},
+      {FILTER_ID_PAL, "filter_palette", ICON_COLOR, "Palettes", "Show Palette data-blocks"},
       {FILTER_ID_PC,
-       "PAINT_CURVE",
+       "filter_paint_curve",
        ICON_CURVE_BEZCURVE,
        "Paint Curves",
-       "Show/hide Paint Curve data-blocks"},
+       "Show Paint Curve data-blocks"},
       {FILTER_ID_LP,
-       "LIGHT_PROBE",
+       "filter_light_probe",
        ICON_OUTLINER_DATA_LIGHTPROBE,
        "Light Probes",
-       "Show/hide Light Probe data-blocks"},
-      {FILTER_ID_SCE, "SCENE", ICON_SCENE_DATA, "Scenes", "Show/hide Scene data-blocks"},
-      {FILTER_ID_SPK, "SPEAKER", ICON_SPEAKER, "Speakers", "Show/hide Speaker data-blocks"},
-      {FILTER_ID_SO, "SOUND", ICON_SOUND, "Sounds", "Show/hide Sound data-blocks"},
-      {FILTER_ID_TE, "TEXTURE", ICON_TEXTURE_DATA, "Textures", "Show/hide Texture data-blocks"},
-      {FILTER_ID_TXT, "TEXT", ICON_TEXT, "Texts", "Show/hide Text data-blocks"},
-      {FILTER_ID_VF, "FONT", ICON_FONT_DATA, "Fonts", "Show/hide Font data-blocks"},
-      {FILTER_ID_WO, "WORLD", ICON_WORLD_DATA, "Worlds", "Show/hide World data-blocks"},
+       "Show Light Probe data-blocks"},
+      {FILTER_ID_SCE, "filter_scene", ICON_SCENE_DATA, "Scenes", "Show Scene data-blocks"},
+      {FILTER_ID_SPK, "filter_speaker", ICON_SPEAKER, "Speakers", "Show Speaker data-blocks"},
+      {FILTER_ID_SO, "filter_sound", ICON_SOUND, "Sounds", "Show Sound data-blocks"},
+      {FILTER_ID_TE, "filter_texture", ICON_TEXTURE_DATA, "Textures", "Show Texture data-blocks"},
+      {FILTER_ID_TXT, "filter_text", ICON_TEXT, "Texts", "Show Text data-blocks"},
+      {FILTER_ID_VF, "filter_font", ICON_FONT_DATA, "Fonts", "Show Font data-blocks"},
+      {FILTER_ID_WO, "filter_world", ICON_WORLD_DATA, "Worlds", "Show World data-blocks"},
       {FILTER_ID_WS,
-       "WORK_SPACE",
+       "filter_work_space",
        ICON_WORKSPACE,
        "Workspaces",
-       "Show/hide workspace data-blocks"},
-      {0, NULL, 0, NULL, NULL},
-  };
+       "Show workspace data-blocks"},
 
-  static const EnumPropertyItem file_filter_idcategories_items[] = {
-      {FILTER_ID_SCE, "SCENE", ICON_SCENE_DATA, "Scenes", "Show/hide scenes"},
-      {FILTER_ID_AC, "ANIMATION", ICON_ANIM_DATA, "Animations", "Show/hide animation data"},
+      /* Categories */
+      {FILTER_ID_SCE, "category_scene", ICON_SCENE_DATA, "Scenes", "Show scenes"},
+      {FILTER_ID_AC, "category_animation", ICON_ANIM_DATA, "Animations", "Show animation data"},
       {FILTER_ID_OB | FILTER_ID_GR,
-       "OBJECT",
+       "category_object",
        ICON_GROUP,
        "Objects & Collections",
-       "Show/hide objects and groups"},
+       "Show objects and groups"},
       {FILTER_ID_AR | FILTER_ID_CU | FILTER_ID_LT | FILTER_ID_MB | FILTER_ID_ME,
-       "GEOMETRY",
+       "category_geometry",
        ICON_MESH_DATA,
        "Geometry",
-       "Show/hide meshes, curves, lattice, armatures and metaballs data"},
+       "Show meshes, curves, lattice, armatures and metaballs data"},
       {FILTER_ID_LS | FILTER_ID_MA | FILTER_ID_NT | FILTER_ID_TE,
-       "SHADING",
+       "category_shading",
        ICON_MATERIAL_DATA,
        "Shading",
-       "Show/hide materials, nodetrees, textures and Freestyle's linestyles"},
+       "Show materials, nodetrees, textures and Freestyle's linestyles"},
       {FILTER_ID_IM | FILTER_ID_MC | FILTER_ID_MSK | FILTER_ID_SO,
-       "IMAGE",
+       "category_image",
        ICON_IMAGE_DATA,
        "Images & Sounds",
-       "Show/hide images, movie clips, sounds and masks"},
-      {FILTER_ID_CA | FILTER_ID_LA | FILTER_ID_SPK | FILTER_ID_WO | FILTER_ID_WS,
-       "ENVIRONMENT",
+       "Show images, movie clips, sounds and masks"},
+      {FILTER_ID_CA | FILTER_ID_LA | FILTER_ID_LP | FILTER_ID_SPK | FILTER_ID_WO | FILTER_ID_WS,
+       "category_environment",
        ICON_WORLD_DATA,
        "Environment",
-       "Show/hide worlds, lights, cameras and speakers"},
+       "Show worlds, lights, cameras and speakers"},
       {FILTER_ID_BR | FILTER_ID_GD | FILTER_ID_PA | FILTER_ID_PAL | FILTER_ID_PC | FILTER_ID_TXT |
            FILTER_ID_VF | FILTER_ID_CF,
-       "MISC",
+       "category_misc",
        ICON_GREASEPENCIL,
        "Miscellaneous",
-       "Show/hide other data types"},
+       "Show other data types"},
+
+      {0, NULL, 0, NULL, NULL}};
+
+  StructRNA *srna = RNA_def_struct(brna, "FileSelectIDFilter", NULL);
+  RNA_def_struct_sdna(srna, "FileSelectParams");
+  RNA_def_struct_nested(brna, srna, "FileSelectParams");
+  RNA_def_struct_ui_text(
+      srna, "File Select ID Filter", "Which ID types to show/hide, when browsing a library");
+
+  for (int i = 0; booleans[i].identifier; i++) {
+    PropertyRNA *prop = RNA_def_property(srna, booleans[i].identifier, PROP_BOOLEAN, PROP_NONE);
+    RNA_def_property_boolean_sdna(prop, NULL, "filter_id", booleans[i].flag);
+    RNA_def_property_ui_text(prop, booleans[i].name, booleans[i].description);
+    RNA_def_property_ui_icon(prop, booleans[i].icon, 0);
+    RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL);
+  }
+}
+
+static void rna_def_fileselect_params(BlenderRNA *brna)
+{
+  StructRNA *srna;
+  PropertyRNA *prop;
+
+  static const EnumPropertyItem file_display_items[] = {
+      {FILE_VERTICALDISPLAY,
+       "LIST_VERTICAL",
+       ICON_LONGDISPLAY,
+       "Vertical List",
+       "Display files as a vertical list"},
+      {FILE_HORIZONTALDISPLAY,
+       "LIST_HORIZONTAL",
+       ICON_SHORTDISPLAY,
+       "Horizontal List",
+       "Display files as a horizontal list"},
+      {FILE_IMGDISPLAY, "THUMBNAIL", ICON_IMGDISPLAY, "Thumbnails", "Display files as thumbnails"},
+      {0, NULL, 0, NULL, NULL},
+  };
+
+  static const EnumPropertyItem display_size_items[] = {
+      {64, "TINY", 0, "Tiny", ""},
+      {96, "SMALL", 0, "Small", ""},
+      {128, "NORMAL", 0, "Regular", ""},
+      {192, "LARGE", 0, "Large", ""},
       {0, NULL, 0, NULL, NULL},
   };
 
@@ -5602,21 +5637,12 @@ static void rna_def_fileselect_params(BlenderRNA *brna)
   RNA_def_property_ui_icon(prop, ICON_BLENDER, 0);
   RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL);
 
-  prop = RNA_def_property(srna, "filter_id", PROP_ENUM, PROP_NONE);
-  RNA_def_property_enum_sdna(prop, NULL, "filter_id");
-  RNA_def_property_enum_items(prop, file_filter_idtypes_items);
-  RNA_def_property_flag(prop, PROP_ENUM_FLAG);
+  prop = RNA_def_property(srna, "filter_id", PROP_POINTER, PROP_NONE);
+  RNA_def_property_flag(prop, PROP_NEVER_NULL);
+  RNA_def_property_struct_type(prop, "FileSelectIDFilter");
+  RNA_def_property_pointer_funcs(prop, "rna_FileSelectParams_filter_id_get", NULL, NULL, NULL);
   RNA_def_property_ui_text(
       prop, "Filter ID Types", "Which ID types to show/hide, when browsing a library");
-  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL);
-
-  prop = RNA_def_property(srna, "filter_id_category", PROP_ENUM, PROP_NONE);
-  RNA_def_property_enum_sdna(prop, NULL, "filter_id");
-  RNA_def_property_enum_items(prop, file_filter_idcategories_items);
-  RNA_def_property_flag(prop, PROP_ENUM_FLAG);
-  RNA_def_property_ui_text(
-      prop, "Filter ID Categories", "Which ID categories to show/hide, when browsing a library");
-  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL);
 
   prop = RNA_def_property(srna, "filter_glob", PROP_STRING, PROP_NONE);
   RNA_def_property_string_sdna(prop, NULL, "filter_glob");
@@ -6445,6 +6471,7 @@ void RNA_def_space(BlenderRNA *brna)
   rna_def_space_sequencer(brna);
   rna_def_space_text(brna);
   rna_def_fileselect_params(brna);
+  rna_def_fileselect_idfilter(brna);
   rna_def_filemenu_entry(brna);
   rna_def_space_filebrowser(brna);
   rna_def_space_outliner(brna);