From 5752e4f06f61f9df72454b81f2d7e3f008dc40eb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 27 Apr 2018 08:23:16 +0200 Subject: WM: message bus rna utilkity macros --- source/blender/windowmanager/message_bus/wm_message_bus.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/blender/windowmanager/message_bus') diff --git a/source/blender/windowmanager/message_bus/wm_message_bus.h b/source/blender/windowmanager/message_bus/wm_message_bus.h index 8a800d18101..e0ccf0309f1 100644 --- a/source/blender/windowmanager/message_bus/wm_message_bus.h +++ b/source/blender/windowmanager/message_bus/wm_message_bus.h @@ -232,6 +232,21 @@ void WM_msg_subscribe_ID( void WM_msg_publish_ID( struct wmMsgBus *mbus, struct ID *id); +#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_) { \ + wmMsgParams_RNA msg_key_params_ = {{{0}}}; \ + extern PropertyRNA rna_##type_##_##prop_; \ + RNA_pointer_create(id_, &RNA_##type_, data_, &msg_key_params_.ptr); \ + msg_key_params_.prop = &rna_##type_##_##prop_; \ + WM_msg_publish_rna_params(mbus, &msg_key_params_); \ +} ((void)0) +#define WM_msg_subscribe_rna_prop(mbus, id_, data_, type_, prop_, value) { \ + wmMsgParams_RNA msg_key_params_ = {{{0}}}; \ + extern PropertyRNA rna_##type_##_##prop_; \ + RNA_pointer_create(id_, &RNA_##type_, data_, &msg_key_params_.ptr); \ + msg_key_params_.prop = &rna_##type_##_##prop_; \ + WM_msg_subscribe_rna_params(mbus, &msg_key_params_, value, __func__); \ +} ((void)0) + /* Anonymous variants (for convenience) */ #define WM_msg_subscribe_rna_anon_type(mbus, type_, value) { \ WM_msg_subscribe_rna_params( \ -- cgit v1.2.3