From d0a8f300c13dd01658f79ddf201bd5344320c60f Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Mon, 14 Mar 2022 16:39:42 +0100 Subject: RNA: Generate property declerations header, solving msg-bus C++ incompatibility Lets `makesrna` generate a `RNA_prototypes.h` header with declarations for all RNA properties. This can be included in regular source files when needing to reference RNA properties statically. This solves an issue on MSVC with adding such declarations in functions, like we used to do. See 800fc1736748. Removes any such declarations and the related FIXME comments. Reviewed By: campbellbarton, LazyDodo, brecht Differential Revision: https://developer.blender.org/D13837 --- source/blender/editors/space_outliner/CMakeLists.txt | 5 +++++ source/blender/editors/space_outliner/outliner_collections.cc | 3 --- source/blender/editors/space_outliner/outliner_draw.cc | 3 --- source/blender/editors/space_outliner/outliner_tools.cc | 3 --- source/blender/editors/space_outliner/space_outliner.cc | 3 --- 5 files changed, 5 insertions(+), 12 deletions(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/CMakeLists.txt b/source/blender/editors/space_outliner/CMakeLists.txt index a91de37fa76..b57525854d6 100644 --- a/source/blender/editors/space_outliner/CMakeLists.txt +++ b/source/blender/editors/space_outliner/CMakeLists.txt @@ -15,6 +15,8 @@ set(INC ../../../../intern/clog ../../../../intern/glew-mx ../../../../intern/guardedalloc + # RNA_prototypes.h + ${CMAKE_BINARY_DIR}/source/blender/makesrna ) @@ -82,3 +84,6 @@ set(LIB blender_add_lib(bf_editor_space_outliner "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") + +# RNA_prototypes.h +add_dependencies(bf_editor_space_outliner bf_rna) diff --git a/source/blender/editors/space_outliner/outliner_collections.cc b/source/blender/editors/space_outliner/outliner_collections.cc index 7c0ccd7b14c..716d5b67fe3 100644 --- a/source/blender/editors/space_outliner/outliner_collections.cc +++ b/source/blender/editors/space_outliner/outliner_collections.cc @@ -391,8 +391,6 @@ void outliner_collection_delete( BLI_gset_free(data.collections_to_edit, nullptr); } -/* FIXME: See comment above #WM_msg_publish_rna_prop(). */ -extern "C" { static int collection_hierarchy_delete_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); @@ -416,7 +414,6 @@ static int collection_hierarchy_delete_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -} void OUTLINER_OT_collection_hierarchy_delete(wmOperatorType *ot) { diff --git a/source/blender/editors/space_outliner/outliner_draw.cc b/source/blender/editors/space_outliner/outliner_draw.cc index 7b62b28abc5..4ef0bbbcde8 100644 --- a/source/blender/editors/space_outliner/outliner_draw.cc +++ b/source/blender/editors/space_outliner/outliner_draw.cc @@ -660,8 +660,6 @@ static void scenes__collection_set_flag_recursive_fn(bContext *C, void *poin, vo outliner_collection_set_flag_recursive_fn(C, nullptr, collection, propname); } -/* FIXME: See comment above #WM_msg_publish_rna_prop(). */ -extern "C" { static void namebutton_fn(bContext *C, void *tsep, char *oldname) { Main *bmain = CTX_data_main(C); @@ -859,7 +857,6 @@ static void namebutton_fn(bContext *C, void *tsep, char *oldname) tselem->flag &= ~TSE_TEXTBUT; } } -} struct RestrictProperties { bool initialized; diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc index 8fe40dde118..77336dc1867 100644 --- a/source/blender/editors/space_outliner/outliner_tools.cc +++ b/source/blender/editors/space_outliner/outliner_tools.cc @@ -1712,8 +1712,6 @@ static TreeTraversalAction outliner_find_objects_to_delete(TreeElement *te, void return TRAVERSE_CONTINUE; } -/* FIXME: See comment above #WM_msg_publish_rna_prop(). */ -extern "C" { static int outliner_delete_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); @@ -1773,7 +1771,6 @@ static int outliner_delete_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -} void OUTLINER_OT_delete(wmOperatorType *ot) { diff --git a/source/blender/editors/space_outliner/space_outliner.cc b/source/blender/editors/space_outliner/space_outliner.cc index 655010bb59f..f75182d25a0 100644 --- a/source/blender/editors/space_outliner/space_outliner.cc +++ b/source/blender/editors/space_outliner/space_outliner.cc @@ -259,8 +259,6 @@ static void outliner_main_region_listener(const wmRegionListenerParams *params) } } -/* FIXME: See comment above #WM_msg_publish_rna_prop(). */ -extern "C" { static void outliner_main_region_message_subscribe(const wmRegionMessageSubscribeParams *params) { struct wmMsgBus *mbus = params->message_bus; @@ -277,7 +275,6 @@ static void outliner_main_region_message_subscribe(const wmRegionMessageSubscrib WM_msg_subscribe_rna_anon_prop(mbus, Window, view_layer, &msg_sub_value_region_tag_redraw); } } -} /* ************************ header outliner area region *********************** */ -- cgit v1.2.3