Blender V4.3
wm_message_bus.cc File Reference
#include <cstring>
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "WM_types.hh"
#include "message_bus/intern/wm_message_bus_intern.hh"
#include "message_bus/wm_message_bus.hh"

Go to the source code of this file.

Functions

Internal API
Note
While we could have a separate type for ID's, use RNA since there is enough overlap.
void wm_msg_subscribe_value_free (wmMsgSubscribeKey *msg_key, wmMsgSubscribeValueLink *msg_lnk)
 

Public API

using wmMsgTypeInitFn = void (*)(wmMsgTypeInfo *)
 
static wmMsgTypeInfo wm_msg_types [WM_MSG_TYPE_NUM] = {{{nullptr}}}
 
static wmMsgTypeInitFn wm_msg_init_fn [WM_MSG_TYPE_NUM]
 
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)
 
wmMsgSubscribeKeyWM_msg_subscribe_with_key (wmMsgBus *mbus, const wmMsgSubscribeKey *msg_key_test, const wmMsgSubscribeValue *msg_val_params)
 
void WM_msg_publish_with_key (wmMsgBus *mbus, wmMsgSubscribeKey *msg_key)
 
void WM_msg_id_update (wmMsgBus *mbus, ID *id_src, ID *id_dst)
 
void WM_msg_id_remove (wmMsgBus *mbus, const ID *id)
 

Typedef Documentation

◆ wmMsgTypeInitFn

using wmMsgTypeInitFn = void (*)(wmMsgTypeInfo *)

Definition at line 31 of file wm_message_bus.cc.

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_publish_with_key()

◆ wm_msg_subscribe_value_free()

◆ 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().

Variable Documentation

◆ wm_msg_init_fn

wmMsgTypeInitFn wm_msg_init_fn[WM_MSG_TYPE_NUM]
static
Initial value:
= {
}
void WM_msgtypeinfo_init_rna(wmMsgTypeInfo *msgtype_info)
void WM_msgtypeinfo_init_static(wmMsgTypeInfo *msgtype_info)

Definition at line 33 of file wm_message_bus.cc.

Referenced by WM_msgbus_types_init().

◆ wm_msg_types