Blender V4.3
wm_message_bus.hh File Reference
#include "RNA_prototypes.hh"
#include "RNA_types.hh"
#include <stdio.h>

Go to the source code of this file.

Classes

struct  wmMsgTypeInfo
 
struct  wmMsg
 
struct  wmMsgSubscribeKey
 
struct  wmMsgSubscribeValue
 
struct  wmMsgSubscribeValueLink
 
struct  wmMsgParams_Static
 
struct  wmMsg_Static
 
struct  wmMsgSubscribeKey_Static
 
struct  wmMsgParams_RNA
 
struct  wmMsg_RNA
 
struct  wmMsgSubscribeKey_RNA
 

Macros

#define WM_MSG_TYPE_NUM   2
 
#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_)
 
#define WM_msg_subscribe_rna_prop(mbus, id_, data_, type_, prop_, value)
 
#define WM_msg_subscribe_rna_anon_type(mbus, type_, value)
 
#define WM_msg_subscribe_rna_anon_prop(mbus, type_, prop_, value)
 

Typedefs

using wmMsgNotifyFn
 
using wmMsgSubscribeValueFreeDataFn
 
using wmMsgSubscribeValueUpdateIdFn
 

Enumerations

enum  { WM_MSG_TYPE_RNA = 0 , WM_MSG_TYPE_STATIC = 1 }
 
enum  { WM_MSG_STATICTYPE_WINDOW_DRAW = 0 , WM_MSG_STATICTYPE_SCREEN_EDIT = 1 , WM_MSG_STATICTYPE_FILE_READ = 2 }
 

Functions

void WM_msgbus_types_init ()
 
wmMsgBusWM_msgbus_create ()
 
void WM_msgbus_destroy (wmMsgBus *mbus)
 
void WM_msgbus_clear_by_owner (wmMsgBus *mbus, void *owner)
 
void WM_msg_dump (wmMsgBus *mbus, const char *info_str)
 
void WM_msgbus_handle (wmMsgBus *mbus, bContext *C)
 
void WM_msg_publish_with_key (wmMsgBus *mbus, wmMsgSubscribeKey *msg_key)
 
wmMsgSubscribeKeyWM_msg_subscribe_with_key (wmMsgBus *mbus, const wmMsgSubscribeKey *msg_key_test, const wmMsgSubscribeValue *msg_val_params)
 
void WM_msg_id_update (wmMsgBus *mbus, ID *id_src, ID *id_dst)
 
void WM_msg_id_remove (wmMsgBus *mbus, const ID *id)
 
void WM_msgtypeinfo_init_static (wmMsgTypeInfo *msgtype_info)
 
wmMsgSubscribeKey_StaticWM_msg_lookup_static (wmMsgBus *mbus, const wmMsgParams_Static *msg_key_params)
 
void WM_msg_publish_static_params (wmMsgBus *mbus, const wmMsgParams_Static *msg_key_params)
 
void WM_msg_publish_static (wmMsgBus *mbus, int event)
 
void WM_msg_subscribe_static_params (wmMsgBus *mbus, const wmMsgParams_Static *msg_key_params, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)
 
void WM_msg_subscribe_static (wmMsgBus *mbus, int event, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)
 
void WM_msgtypeinfo_init_rna (wmMsgTypeInfo *msgtype_info)
 
wmMsgSubscribeKey_RNAWM_msg_lookup_rna (wmMsgBus *mbus, const wmMsgParams_RNA *msg_key_params)
 
void WM_msg_publish_rna_params (wmMsgBus *mbus, const wmMsgParams_RNA *msg_key_params)
 
void WM_msg_publish_rna (wmMsgBus *mbus, PointerRNA *ptr, PropertyRNA *prop)
 
void WM_msg_subscribe_rna_params (wmMsgBus *mbus, const wmMsgParams_RNA *msg_key_params, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)
 
void WM_msg_subscribe_rna (wmMsgBus *mbus, PointerRNA *ptr, const PropertyRNA *prop, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)
 
void WM_msg_subscribe_ID (wmMsgBus *mbus, ID *id, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)
 
void WM_msg_publish_ID (wmMsgBus *mbus, ID *id)
 

Macro Definition Documentation

◆ WM_msg_publish_rna_prop

#define WM_msg_publish_rna_prop ( mbus,
id_,
data_,
type_,
prop_ )
Value:
{ \
wmMsgParams_RNA msg_key_params_ = {{0}}; \
msg_key_params_.ptr = RNA_pointer_create(id_, &RNA_##type_, data_); \
msg_key_params_.prop = &rna_##type_##_##prop_; \
WM_msg_publish_rna_params(mbus, &msg_key_params_); \
} \
((void)0)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
const PropertyRNA * prop

Definition at line 217 of file wm_message_bus.hh.

Referenced by blender::ed::object::base_active_refresh(), click_select_channel_grease_pencil_layer(), blender::ed::outliner::collection_hierarchy_delete_exec(), create_orientation_exec(), blender::ed::sculpt_paint::curves_sculptmode_enter(), blender::ed::sculpt_paint::curves_sculptmode_toggle_exec(), delete_orientation_exec(), blender::ed::object::editmode_toggle_exec(), blender::ed::greasepencil::grease_pencil_layer_active_exec(), blender::ed::greasepencil::grease_pencil_layer_add_exec(), blender::ed::greasepencil::grease_pencil_layer_duplicate_exec(), blender::ed::greasepencil::grease_pencil_layer_group_add_exec(), blender::ed::greasepencil::grease_pencil_layer_group_remove_exec(), blender::ed::greasepencil::grease_pencil_layer_move_exec(), blender::ed::greasepencil::grease_pencil_layer_remove_exec(), blender::ed::greasepencil::grease_pencil_layer_reorder_exec(), blender::ed::greasepencil::grease_pencil_merge_layer_exec(), blender::ed::outliner::namebutton_fn(), blender::ui::greasepencil::LayerGroupViewItem::on_activate(), blender::ui::greasepencil::LayerViewItem::on_activate(), blender::ui::greasepencil::LayerNodeDropTarget::on_drop(), blender::ed::outliner::outliner_delete_exec(), blender::ed::greasepencil::paintmode_toggle_exec(), particle_edit_toggle_exec(), blender::ed::object::posemode_exec(), blender::ed::sculpt_paint::sculpt_mode_toggle_exec(), blender::ed::greasepencil::sculptmode_toggle_exec(), select_orientation_exec(), texture_paint_toggle_exec(), blender::ed::outliner::tree_element_grease_pencil_node_activate(), uv_set_2d_cursor_exec(), blender::ed::greasepencil::vertexmode_toggle_exec(), view3d_all_exec(), vpaint_mode_toggle_exec(), blender::ed::greasepencil::weightmode_toggle_exec(), WM_toolsystem_ref_set_from_runtime(), and wpaint_mode_toggle_exec().

◆ WM_msg_subscribe_rna_anon_prop

#define WM_msg_subscribe_rna_anon_prop ( mbus,
type_,
prop_,
value )

◆ WM_msg_subscribe_rna_anon_type

#define WM_msg_subscribe_rna_anon_type ( mbus,
type_,
value )
Value:
{ \
PointerRNA msg_ptr_ = {0, &RNA_##type_}; \
wmMsgParams_RNA msg_key_params_ = {{0}}; \
msg_key_params_.ptr = msg_ptr_; \
\
WM_msg_subscribe_rna_params(mbus, &msg_key_params_, value, __func__); \
} \
((void)0)

Definition at line 235 of file wm_message_bus.hh.

Referenced by view3d_main_region_message_subscribe().

◆ WM_msg_subscribe_rna_prop

#define WM_msg_subscribe_rna_prop ( mbus,
id_,
data_,
type_,
prop_,
value )
Value:
{ \
wmMsgParams_RNA msg_key_params_ = {{0}}; \
msg_key_params_.ptr = RNA_pointer_create(id_, &RNA_##type_, data_); \
msg_key_params_.prop = &rna_##type_##_##prop_; \
WM_msg_subscribe_rna_params(mbus, &msg_key_params_, value, __func__); \
} \
((void)0)

Definition at line 225 of file wm_message_bus.hh.

Referenced by ED_area_do_mgs_subscribe_for_tool_header(), ED_area_do_mgs_subscribe_for_tool_ui(), blender::ed::asset::shelf::region_message_subscribe(), and topbar_header_region_message_subscribe().

◆ WM_MSG_TYPE_NUM

#define WM_MSG_TYPE_NUM   2

Typedef Documentation

◆ wmMsgNotifyFn

Initial value:

Definition at line 24 of file wm_message_bus.hh.

◆ wmMsgSubscribeValueFreeDataFn

Initial value:
void (*)(wmMsgSubscribeKey *msg_key,

Definition at line 27 of file wm_message_bus.hh.

◆ wmMsgSubscribeValueUpdateIdFn

Initial value:
void (*)(bContext *C, wmMsgBus *mbus, ID *id_src, ID *id_dst, wmMsgSubscribeValue *msg_val)
Definition DNA_ID.h:413

Definition at line 31 of file wm_message_bus.hh.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
WM_MSG_TYPE_RNA 
WM_MSG_TYPE_STATIC 

Definition at line 33 of file wm_message_bus.hh.

◆ anonymous enum

anonymous enum
Enumerator
WM_MSG_STATICTYPE_WINDOW_DRAW 
WM_MSG_STATICTYPE_SCREEN_EDIT 
WM_MSG_STATICTYPE_FILE_READ 

Definition at line 128 of file wm_message_bus.hh.

Function Documentation

◆ WM_msg_dump()

void WM_msg_dump ( wmMsgBus * mbus,
const char * info_str )

◆ WM_msg_id_remove()

void WM_msg_id_remove ( wmMsgBus * mbus,
const ID * id )

◆ WM_msg_id_update()

void WM_msg_id_update ( wmMsgBus * mbus,
ID * id_src,
ID * id_dst )

◆ WM_msg_lookup_rna()

wmMsgSubscribeKey_RNA * WM_msg_lookup_rna ( wmMsgBus * mbus,
const wmMsgParams_RNA * msg_key_params )

◆ WM_msg_lookup_static()

◆ WM_msg_publish_ID()

void WM_msg_publish_ID ( wmMsgBus * mbus,
ID * id )

◆ WM_msg_publish_rna()

void WM_msg_publish_rna ( wmMsgBus * mbus,
PointerRNA * ptr,
PropertyRNA * prop )

Definition at line 282 of file wm_message_bus_rna.cc.

References params, ptr, and WM_msg_publish_rna_params().

Referenced by rna_property_update().

◆ WM_msg_publish_rna_params()

◆ WM_msg_publish_static()

void WM_msg_publish_static ( wmMsgBus * mbus,
int event )

Definition at line 97 of file wm_message_bus_static.cc.

References params, and WM_msg_publish_static_params().

Referenced by wm_file_read_post().

◆ WM_msg_publish_static_params()

void WM_msg_publish_static_params ( wmMsgBus * mbus,
const wmMsgParams_Static * msg_key_params )

◆ WM_msg_publish_with_key()

◆ WM_msg_subscribe_ID()

void WM_msg_subscribe_ID ( wmMsgBus * mbus,
ID * id,
const wmMsgSubscribeValue * msg_val_params,
const char * id_repr )

◆ WM_msg_subscribe_rna()

◆ WM_msg_subscribe_rna_params()

◆ WM_msg_subscribe_static()

void WM_msg_subscribe_static ( wmMsgBus * mbus,
int event,
const wmMsgSubscribeValue * msg_val_params,
const char * id_repr )

Definition at line 120 of file wm_message_bus_static.cc.

References params, and WM_msg_subscribe_static_params().

◆ WM_msg_subscribe_static_params()

void WM_msg_subscribe_static_params ( wmMsgBus * mbus,
const wmMsgParams_Static * msg_key_params,
const wmMsgSubscribeValue * msg_val_params,
const char * id_repr )

◆ WM_msg_subscribe_with_key()

wmMsgSubscribeKey * WM_msg_subscribe_with_key ( wmMsgBus * mbus,
const wmMsgSubscribeKey * msg_key_test,
const wmMsgSubscribeValue * msg_val_params )
Parameters
msg_key_testNeeds following wmMsgSubscribeKey fields filled in:
  • msg.params
  • msg.head.type
  • msg.head.id .. other values should be zeroed.
Returns
The key for this subscription. note that this is only needed in rare cases when the key needs further manipulation.

Definition at line 143 of file wm_message_bus.cc.

References BLI_addtail(), BLI_assert, BLI_gset_ensure_p_ex(), LISTBASE_FOREACH, MEM_mallocN, wmMsgBus::messages, wmMsgBus::messages_gset, wmMsgTypeInfo::msg_key_size, wmMsgSubscribeValue::notify, wmMsgSubscribeValue::owner, wmMsgSubscribeValueLink::params, wmMsg::type, wmMsgSubscribeValue::user_data, wmMsgSubscribeKey::values, wm_msg_subscribe_value_msg_cast(), and wm_msg_types.

Referenced by WM_msg_subscribe_rna_params(), and WM_msg_subscribe_static_params().

◆ WM_msgbus_clear_by_owner()

◆ WM_msgbus_create()

◆ WM_msgbus_destroy()

◆ WM_msgbus_handle()

void WM_msgbus_handle ( wmMsgBus * mbus,
bContext * C )

◆ WM_msgbus_types_init()

void WM_msgbus_types_init ( )

Definition at line 38 of file wm_message_bus.cc.

References wm_msg_init_fn, WM_MSG_TYPE_NUM, and wm_msg_types.

Referenced by WM_init().

◆ WM_msgtypeinfo_init_rna()

◆ WM_msgtypeinfo_init_static()