From 7bbf2f6754abce094115e36c0c972f3a4def7fe1 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Tue, 1 Aug 2023 12:19:47 +0200 Subject: [PATCH] Cleanup: Compile internal File/Asset Browser headers in C++ C++ Conversion Background: #103343 --- source/blender/editors/asset/intern/asset_list.cc | 4 ++-- source/blender/editors/space_file/CMakeLists.txt | 6 +++--- .../editors/space_file/asset_catalog_tree_view.cc | 4 ++-- source/blender/editors/space_file/file_context.cc | 4 ++-- source/blender/editors/space_file/file_draw.cc | 4 ++-- source/blender/editors/space_file/file_indexer.cc | 5 +---- .../space_file/{file_indexer.h => file_indexer.hh} | 8 -------- .../space_file/{file_intern.h => file_intern.hh} | 12 ------------ source/blender/editors/space_file/file_ops.cc | 4 ++-- source/blender/editors/space_file/file_panels.cc | 4 ++-- source/blender/editors/space_file/file_utils.cc | 2 +- source/blender/editors/space_file/filelist.cc | 6 +++--- .../editors/space_file/{filelist.h => filelist.hh} | 8 -------- source/blender/editors/space_file/filesel.cc | 4 ++-- source/blender/editors/space_file/folder_history.cc | 2 +- source/blender/editors/space_file/space_file.cc | 6 +++--- source/blender/makesdna/DNA_space_types.h | 2 +- 17 files changed, 27 insertions(+), 58 deletions(-) rename source/blender/editors/space_file/{file_indexer.h => file_indexer.hh} (85%) rename source/blender/editors/space_file/{file_intern.h => file_intern.hh} (99%) rename source/blender/editors/space_file/{filelist.h => filelist.hh} (99%) diff --git a/source/blender/editors/asset/intern/asset_list.cc b/source/blender/editors/asset/intern/asset_list.cc index 566db96ac2e..05c56e0e04f 100644 --- a/source/blender/editors/asset/intern/asset_list.cc +++ b/source/blender/editors/asset/intern/asset_list.cc @@ -30,8 +30,8 @@ #include "WM_api.h" /* XXX uses private header of file-space. */ -#include "../space_file/file_indexer.h" -#include "../space_file/filelist.h" +#include "../space_file/file_indexer.hh" +#include "../space_file/filelist.hh" #include "ED_asset_indexer.h" #include "ED_asset_list.h" diff --git a/source/blender/editors/space_file/CMakeLists.txt b/source/blender/editors/space_file/CMakeLists.txt index d8e2e1b9ea4..26688242eb8 100644 --- a/source/blender/editors/space_file/CMakeLists.txt +++ b/source/blender/editors/space_file/CMakeLists.txt @@ -38,9 +38,9 @@ set(SRC fsmenu.c space_file.cc - file_indexer.h - file_intern.h - filelist.h + file_indexer.hh + file_intern.hh + filelist.hh fsmenu.h ) diff --git a/source/blender/editors/space_file/asset_catalog_tree_view.cc b/source/blender/editors/space_file/asset_catalog_tree_view.cc index a172b9ae7d2..b915812fd91 100644 --- a/source/blender/editors/space_file/asset_catalog_tree_view.cc +++ b/source/blender/editors/space_file/asset_catalog_tree_view.cc @@ -32,8 +32,8 @@ #include "WM_api.h" #include "WM_types.h" -#include "file_intern.h" -#include "filelist.h" +#include "file_intern.hh" +#include "filelist.hh" #include diff --git a/source/blender/editors/space_file/file_context.cc b/source/blender/editors/space_file/file_context.cc index c2bde18325f..acc0681bf99 100644 --- a/source/blender/editors/space_file/file_context.cc +++ b/source/blender/editors/space_file/file_context.cc @@ -13,8 +13,8 @@ #include "RNA_prototypes.h" -#include "file_intern.h" -#include "filelist.h" +#include "file_intern.hh" +#include "filelist.hh" const char *file_context_dir[] = { "active_file", diff --git a/source/blender/editors/space_file/file_draw.cc b/source/blender/editors/space_file/file_draw.cc index e6c53bf8b98..7df72932a6e 100644 --- a/source/blender/editors/space_file/file_draw.cc +++ b/source/blender/editors/space_file/file_draw.cc @@ -55,9 +55,9 @@ #include "GPU_immediate_util.h" #include "GPU_state.h" -#include "filelist.h" +#include "filelist.hh" -#include "file_intern.h" /* own include */ +#include "file_intern.hh" /* own include */ void ED_file_path_button(bScreen *screen, const SpaceFile *sfile, diff --git a/source/blender/editors/space_file/file_indexer.cc b/source/blender/editors/space_file/file_indexer.cc index 3fb2376d83b..38e53468e86 100644 --- a/source/blender/editors/space_file/file_indexer.cc +++ b/source/blender/editors/space_file/file_indexer.cc @@ -8,7 +8,7 @@ * This file implements the default file browser indexer and has some helper function to work with * `FileIndexerEntries`. */ -#include "file_indexer.h" +#include "file_indexer.hh" #include "MEM_guardedalloc.h" @@ -55,8 +55,6 @@ static FileIndexerEntry *file_indexer_entry_create_from_datablock_info( } // namespace blender::ed::file::indexer -extern "C" { - void ED_file_indexer_entries_extend_from_datablock_infos( FileIndexerEntries *indexer_entries, LinkNode * /*BLODataBlockInfo*/ datablock_infos, @@ -83,4 +81,3 @@ void ED_file_indexer_entries_clear(FileIndexerEntries *indexer_entries) } const FileIndexerType file_indexer_noop = blender::ed::file::indexer::default_indexer(); -} diff --git a/source/blender/editors/space_file/file_indexer.h b/source/blender/editors/space_file/file_indexer.hh similarity index 85% rename from source/blender/editors/space_file/file_indexer.h rename to source/blender/editors/space_file/file_indexer.hh index d4ea0d43ade..9a15e5d7abe 100644 --- a/source/blender/editors/space_file/file_indexer.h +++ b/source/blender/editors/space_file/file_indexer.hh @@ -9,16 +9,8 @@ #include "ED_file_indexer.h" -#ifdef __cplusplus -extern "C" { -#endif - /** * Default indexer to use when listing files. The implementation is a no-operation indexing. When * set it won't use indexing. It is added to increase the code clarity. */ extern const FileIndexerType file_indexer_noop; - -#ifdef __cplusplus -} -#endif diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.hh similarity index 99% rename from source/blender/editors/space_file/file_intern.h rename to source/blender/editors/space_file/file_intern.hh index ab0b511c800..f65d440c46b 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.hh @@ -11,10 +11,6 @@ #include "DNA_space_types.h" #include "DNA_windowmanager_types.h" -#ifdef __cplusplus -extern "C" { -#endif - /* internal exports only */ struct ARegion; @@ -244,8 +240,6 @@ void file_create_asset_catalog_tree_view_in_layout(struct AssetLibrary *asset_li SpaceFile *space_file, FileAssetSelectParams *params); -#ifdef __cplusplus - namespace blender::asset_system { class AssetLibrary; } @@ -267,9 +261,3 @@ void file_ensure_updated_catalog_filter_data( bool file_is_asset_visible_in_catalog_filter_settings( const FileAssetCatalogFilterSettingsHandle *filter_settings_handle, const AssetMetaData *asset_data); - -#endif - -#ifdef __cplusplus -} -#endif diff --git a/source/blender/editors/space_file/file_ops.cc b/source/blender/editors/space_file/file_ops.cc index 0650f38b053..3984a074fd4 100644 --- a/source/blender/editors/space_file/file_ops.cc +++ b/source/blender/editors/space_file/file_ops.cc @@ -45,8 +45,8 @@ #include "WM_api.h" #include "WM_types.h" -#include "file_intern.h" -#include "filelist.h" +#include "file_intern.hh" +#include "filelist.hh" #include "fsmenu.h" #include diff --git a/source/blender/editors/space_file/file_panels.cc b/source/blender/editors/space_file/file_panels.cc index 29a014d8459..3ac57757cf2 100644 --- a/source/blender/editors/space_file/file_panels.cc +++ b/source/blender/editors/space_file/file_panels.cc @@ -33,8 +33,8 @@ #include "WM_api.h" #include "WM_types.h" -#include "file_intern.h" -#include "filelist.h" +#include "file_intern.hh" +#include "filelist.hh" #include "fsmenu.h" #include diff --git a/source/blender/editors/space_file/file_utils.cc b/source/blender/editors/space_file/file_utils.cc index 832af663ffd..72633150d2a 100644 --- a/source/blender/editors/space_file/file_utils.cc +++ b/source/blender/editors/space_file/file_utils.cc @@ -19,7 +19,7 @@ #include "WM_types.h" -#include "file_intern.h" +#include "file_intern.hh" void file_tile_boundbox(const ARegion *region, FileLayout *layout, const int file, rcti *r_bounds) { diff --git a/source/blender/editors/space_file/filelist.cc b/source/blender/editors/space_file/filelist.cc index 2814574604e..7afbd738958 100644 --- a/source/blender/editors/space_file/filelist.cc +++ b/source/blender/editors/space_file/filelist.cc @@ -80,9 +80,9 @@ #include "atomic_ops.h" -#include "file_indexer.h" -#include "file_intern.h" -#include "filelist.h" +#include "file_indexer.hh" +#include "file_intern.hh" +#include "filelist.hh" using namespace blender; diff --git a/source/blender/editors/space_file/filelist.h b/source/blender/editors/space_file/filelist.hh similarity index 99% rename from source/blender/editors/space_file/filelist.h rename to source/blender/editors/space_file/filelist.hh index 3b263e89035..24e37af3889 100644 --- a/source/blender/editors/space_file/filelist.h +++ b/source/blender/editors/space_file/filelist.hh @@ -8,10 +8,6 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - struct AssetLibraryReference; struct BlendHandle; struct FileIndexerType; @@ -220,7 +216,3 @@ bool filelist_cache_previews_update(struct FileList *filelist); void filelist_cache_previews_set(struct FileList *filelist, bool use_previews); bool filelist_cache_previews_running(struct FileList *filelist); bool filelist_cache_previews_done(struct FileList *filelist); - -#ifdef __cplusplus -} -#endif diff --git a/source/blender/editors/space_file/filesel.cc b/source/blender/editors/space_file/filesel.cc index 1e93b716a34..6b2e5096f8e 100644 --- a/source/blender/editors/space_file/filesel.cc +++ b/source/blender/editors/space_file/filesel.cc @@ -64,8 +64,8 @@ #include "AS_asset_representation.hh" #include "AS_essentials_library.hh" -#include "file_intern.h" -#include "filelist.h" +#include "file_intern.hh" +#include "filelist.hh" #define VERTLIST_MAJORCOLUMN_WIDTH (25 * UI_UNIT_X) diff --git a/source/blender/editors/space_file/folder_history.cc b/source/blender/editors/space_file/folder_history.cc index ccf68f582cd..24d49f59cfb 100644 --- a/source/blender/editors/space_file/folder_history.cc +++ b/source/blender/editors/space_file/folder_history.cc @@ -22,7 +22,7 @@ #include "MEM_guardedalloc.h" -#include "file_intern.h" +#include "file_intern.hh" /* -------------------------------------------------------------------- */ /** \name FOLDERLIST (previous/next) diff --git a/source/blender/editors/space_file/space_file.cc b/source/blender/editors/space_file/space_file.cc index 41952458d6a..b9b4a9cfef6 100644 --- a/source/blender/editors/space_file/space_file.cc +++ b/source/blender/editors/space_file/space_file.cc @@ -46,9 +46,9 @@ #include "BLO_read_write.h" #include "GPU_framebuffer.h" -#include "file_indexer.h" -#include "file_intern.h" /* own include */ -#include "filelist.h" +#include "file_indexer.hh" +#include "file_intern.hh" /* own include */ +#include "filelist.hh" #include "fsmenu.h" /* ******************** default callbacks for file space ***************** */ diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index da01c4bc9be..97b712bed42 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -76,7 +76,7 @@ typedef struct SpaceNode_Runtime SpaceNode_Runtime; typedef struct SpaceOutliner_Runtime SpaceOutliner_Runtime; #endif -/** Defined in `file_intern.h`. */ +/** Defined in `file_intern.hh`. */ typedef struct SpaceFile_Runtime SpaceFile_Runtime; /** Defined in `spreadsheet_intern.hh`. */