Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2022-03-14 18:39:42 +0300
committerJulian Eisel <julian@blender.org>2022-03-14 18:50:49 +0300
commit9b298cf3dbec9e246748448cc635a5055fe90c19 (patch)
treec9fb6ddaf16bec463d9d4dd5a65a8c9d285afc8f /source/blender/editors/interface
parentcff6eb65804da3a06bde3c9152bec26e01a24992 (diff)
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
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/CMakeLists.txt5
-rw-r--r--source/blender/editors/interface/interface_eyedropper_colorband.c2
-rw-r--r--source/blender/editors/interface/interface_handlers.c3
3 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt
index 6033aaf9105..100be2c10c9 100644
--- a/source/blender/editors/interface/CMakeLists.txt
+++ b/source/blender/editors/interface/CMakeLists.txt
@@ -20,6 +20,8 @@ set(INC
../../windowmanager
../../../../intern/glew-mx
../../../../intern/guardedalloc
+ # RNA_prototypes.h
+ ${CMAKE_BINARY_DIR}/source/blender/makesrna
)
set(SRC
@@ -104,3 +106,6 @@ endif()
blender_add_lib(bf_editor_interface "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
+
+# RNA_prototypes.h
+add_dependencies(bf_editor_interface bf_rna)
diff --git a/source/blender/editors/interface/interface_eyedropper_colorband.c b/source/blender/editors/interface/interface_eyedropper_colorband.c
index 8eb7dc24b83..a69c36fefbd 100644
--- a/source/blender/editors/interface/interface_eyedropper_colorband.c
+++ b/source/blender/editors/interface/interface_eyedropper_colorband.c
@@ -26,6 +26,7 @@
#include "BKE_context.h"
#include "RNA_access.h"
+#include "RNA_prototypes.h"
#include "UI_interface.h"
@@ -98,7 +99,6 @@ static bool eyedropper_colorband_init(bContext *C, wmOperator *op)
band = ptr.data;
/* Set this to a sub-member of the property to trigger an update. */
- extern PropertyRNA rna_ColorRamp_color_mode;
rna_update_ptr = ptr;
rna_update_prop = &rna_ColorRamp_color_mode;
is_undo = RNA_struct_undo_check(ptr.type);
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index a8b21bebb2b..8677b1ed78a 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -59,6 +59,7 @@
#include "interface_intern.h"
#include "RNA_access.h"
+#include "RNA_prototypes.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -922,10 +923,8 @@ static void ui_apply_but_undo(uiBut *but)
if (but->rnapoin.owner_id) {
/* Exception for renaming ID data, we always need undo pushes in this case,
* because undo systems track data by their ID, see: T67002. */
- extern PropertyRNA rna_ID_name;
/* Exception for active shape-key, since changing this in edit-mode updates
* the shape key from object mode data. */
- extern PropertyRNA rna_Object_active_shape_key_index;
if (ELEM(but->rnaprop, &rna_ID_name, &rna_Object_active_shape_key_index)) {
/* pass */
}