Blender  V2.93
Classes | Macros | Typedefs | Functions
WM_toolsystem.h File Reference
#include "BLI_compiler_attrs.h"

Go to the source code of this file.

Classes

struct  bToolKey
 

Macros

#define WM_TOOLSYSTEM_SPACE_MASK    ((1 << SPACE_IMAGE) | (1 << SPACE_NODE) | (1 << SPACE_VIEW3D) | (1 << SPACE_SEQ))
 
#define WM_toolsystem_ref_properties_ensure_from_operator(tref, ot, r_ptr)    WM_toolsystem_ref_properties_ensure_ex(tref, (ot)->idname, (ot)->srna, r_ptr)
 
#define WM_toolsystem_ref_properties_ensure_from_gizmo_group(tref, gzgroup, r_ptr)    WM_toolsystem_ref_properties_ensure_ex(tref, (gzgroup)->idname, (gzgroup)->srna, r_ptr)
 
#define WM_toolsystem_ref_properties_get_from_operator(tref, ot, r_ptr)    WM_toolsystem_ref_properties_get_ex(tref, (ot)->idname, (ot)->srna, r_ptr)
 
#define WM_toolsystem_ref_properties_get_from_gizmo_group(tref, gzgroup, r_ptr)    WM_toolsystem_ref_properties_get_ex(tref, (gzgroup)->idname, (gzgroup)->srna, r_ptr)
 

Typedefs

typedef struct bToolKey bToolKey
 

Functions

struct bToolRef * WM_toolsystem_ref_from_context (struct bContext *C)
 
struct bToolRef * WM_toolsystem_ref_find (struct WorkSpace *workspace, const bToolKey *tkey)
 
bool WM_toolsystem_ref_ensure (struct WorkSpace *workspace, const bToolKey *tkey, struct bToolRef **r_tref)
 
struct bToolRef * WM_toolsystem_ref_set_by_id_ex (struct bContext *C, struct WorkSpace *workspace, const bToolKey *tkey, const char *name, bool cycle)
 
struct bToolRef * WM_toolsystem_ref_set_by_id (struct bContext *C, const char *name)
 
struct bToolRef_Runtime * WM_toolsystem_runtime_from_context (struct bContext *C)
 
struct bToolRef_Runtime * WM_toolsystem_runtime_find (struct WorkSpace *workspace, const bToolKey *tkey)
 
void WM_toolsystem_unlink (struct bContext *C, struct WorkSpace *workspace, const bToolKey *tkey)
 
void WM_toolsystem_refresh (struct bContext *C, struct WorkSpace *workspace, const bToolKey *tkey)
 
void WM_toolsystem_reinit (struct bContext *C, struct WorkSpace *workspace, const bToolKey *tkey)
 
void WM_toolsystem_unlink_all (struct bContext *C, struct WorkSpace *workspace)
 
void WM_toolsystem_refresh_all (struct bContext *C, struct WorkSpace *workspace)
 
void WM_toolsystem_reinit_all (struct bContext *C, struct wmWindow *win)
 
void WM_toolsystem_ref_set_from_runtime (struct bContext *C, struct WorkSpace *workspace, struct bToolRef *tref, const struct bToolRef_Runtime *tref_rt, const char *idname)
 
void WM_toolsystem_ref_sync_from_context (struct Main *bmain, struct WorkSpace *workspace, struct bToolRef *tref)
 
void WM_toolsystem_init (struct bContext *C)
 
int WM_toolsystem_mode_from_spacetype (struct ViewLayer *view_layer, struct ScrArea *area, int space_type)
 
bool WM_toolsystem_key_from_context (struct ViewLayer *view_layer, struct ScrArea *area, bToolKey *tkey)
 
void WM_toolsystem_update_from_context_view3d (struct bContext *C)
 
void WM_toolsystem_update_from_context (struct bContext *C, struct WorkSpace *workspace, struct ViewLayer *view_layer, struct ScrArea *area)
 
bool WM_toolsystem_active_tool_is_brush (const struct bContext *C)
 
void WM_toolsystem_do_msg_notify_tag_refresh (struct bContext *C, struct wmMsgSubscribeKey *msg_key, struct wmMsgSubscribeValue *msg_val)
 
struct IDProperty * WM_toolsystem_ref_properties_ensure_idprops (struct bToolRef *tref)
 
void WM_toolsystem_ref_properties_ensure_ex (struct bToolRef *tref, const char *idname, struct StructRNA *type, struct PointerRNA *r_ptr)
 
bool WM_toolsystem_ref_properties_get_ex (struct bToolRef *tref, const char *idname, struct StructRNA *type, struct PointerRNA *r_ptr)
 
void WM_toolsystem_ref_properties_init_for_keymap (struct bToolRef *tref, struct PointerRNA *dst_ptr, struct PointerRNA *src_ptr, struct wmOperatorType *ot)
 
void WM_toolsystem_refresh_active (struct bContext *C)
 
void WM_toolsystem_refresh_screen_area (struct WorkSpace *workspace, struct ViewLayer *view_layer, struct ScrArea *area)
 
void WM_toolsystem_refresh_screen_all (struct Main *bmain)
 

Macro Definition Documentation

◆ WM_toolsystem_ref_properties_ensure_from_gizmo_group

#define WM_toolsystem_ref_properties_ensure_from_gizmo_group (   tref,
  gzgroup,
  r_ptr 
)     WM_toolsystem_ref_properties_ensure_ex(tref, (gzgroup)->idname, (gzgroup)->srna, r_ptr)

Definition at line 115 of file WM_toolsystem.h.

◆ WM_toolsystem_ref_properties_ensure_from_operator

#define WM_toolsystem_ref_properties_ensure_from_operator (   tref,
  ot,
  r_ptr 
)     WM_toolsystem_ref_properties_ensure_ex(tref, (ot)->idname, (ot)->srna, r_ptr)

Definition at line 113 of file WM_toolsystem.h.

◆ WM_toolsystem_ref_properties_get_from_gizmo_group

#define WM_toolsystem_ref_properties_get_from_gizmo_group (   tref,
  gzgroup,
  r_ptr 
)     WM_toolsystem_ref_properties_get_ex(tref, (gzgroup)->idname, (gzgroup)->srna, r_ptr)

Definition at line 124 of file WM_toolsystem.h.

◆ WM_toolsystem_ref_properties_get_from_operator

#define WM_toolsystem_ref_properties_get_from_operator (   tref,
  ot,
  r_ptr 
)     WM_toolsystem_ref_properties_get_ex(tref, (ot)->idname, (ot)->srna, r_ptr)

Definition at line 122 of file WM_toolsystem.h.

◆ WM_TOOLSYSTEM_SPACE_MASK

#define WM_TOOLSYSTEM_SPACE_MASK    ((1 << SPACE_IMAGE) | (1 << SPACE_NODE) | (1 << SPACE_VIEW3D) | (1 << SPACE_SEQ))

Definition at line 43 of file WM_toolsystem.h.

Typedef Documentation

◆ bToolKey

typedef struct bToolKey bToolKey

Function Documentation

◆ WM_toolsystem_active_tool_is_brush()

bool WM_toolsystem_active_tool_is_brush ( const struct bContext *  C)

◆ WM_toolsystem_do_msg_notify_tag_refresh()

void WM_toolsystem_do_msg_notify_tag_refresh ( struct bContext *  C,
struct wmMsgSubscribeKey *  msg_key,
struct wmMsgSubscribeValue *  msg_val 
)

◆ WM_toolsystem_init()

void WM_toolsystem_init ( struct bContext *  C)

◆ WM_toolsystem_key_from_context()

bool WM_toolsystem_key_from_context ( struct ViewLayer *  view_layer,
struct ScrArea *  area,
bToolKey *  tkey 
)

◆ WM_toolsystem_mode_from_spacetype()

int WM_toolsystem_mode_from_spacetype ( struct ViewLayer *  view_layer,
struct ScrArea *  area,
int  space_type 
)

◆ WM_toolsystem_ref_ensure()

bool WM_toolsystem_ref_ensure ( struct WorkSpace *  workspace,
const bToolKey *  tkey,
struct bToolRef **  r_tref 
)

◆ WM_toolsystem_ref_find()

struct bToolRef* WM_toolsystem_ref_find ( struct WorkSpace *  workspace,
const bToolKey *  tkey 
)

◆ WM_toolsystem_ref_from_context()

struct bToolRef* WM_toolsystem_ref_from_context ( struct bContext *  C)

◆ WM_toolsystem_ref_properties_ensure_ex()

void WM_toolsystem_ref_properties_ensure_ex ( struct bToolRef *  tref,
const char *  idname,
struct StructRNA *  type,
struct PointerRNA *  r_ptr 
)

◆ WM_toolsystem_ref_properties_ensure_idprops()

struct IDProperty* WM_toolsystem_ref_properties_ensure_idprops ( struct bToolRef *  tref)

Definition at line 833 of file wm_toolsystem.c.

References IDP_GROUP, IDP_New(), NULL, and bToolRef::properties.

Referenced by WM_toolsystem_ref_properties_ensure_ex().

◆ WM_toolsystem_ref_properties_get_ex()

bool WM_toolsystem_ref_properties_get_ex ( struct bToolRef *  tref,
const char *  idname,
struct StructRNA *  type,
struct PointerRNA *  r_ptr 
)

◆ WM_toolsystem_ref_properties_init_for_keymap()

void WM_toolsystem_ref_properties_init_for_keymap ( struct bToolRef *  tref,
struct PointerRNA *  dst_ptr,
struct PointerRNA *  src_ptr,
struct wmOperatorType *  ot 
)

◆ WM_toolsystem_ref_set_by_id()

struct bToolRef* WM_toolsystem_ref_set_by_id ( struct bContext *  C,
const char *  name 
)

◆ WM_toolsystem_ref_set_by_id_ex()

struct bToolRef* WM_toolsystem_ref_set_by_id_ex ( struct bContext *  C,
struct WorkSpace *  workspace,
const bToolKey *  tkey,
const char *  name,
bool  cycle 
)

◆ WM_toolsystem_ref_set_from_runtime()

void WM_toolsystem_ref_set_from_runtime ( struct bContext *  C,
struct WorkSpace *  workspace,
struct bToolRef *  tref,
const struct bToolRef_Runtime *  tref_rt,
const char *  idname 
)

◆ WM_toolsystem_ref_sync_from_context()

void WM_toolsystem_ref_sync_from_context ( Main *  bmain,
WorkSpace *  workspace,
bToolRef *  tref 
)

◆ WM_toolsystem_refresh()

void WM_toolsystem_refresh ( struct bContext *  C,
struct WorkSpace *  workspace,
const bToolKey *  tkey 
)

◆ WM_toolsystem_refresh_active()

void WM_toolsystem_refresh_active ( bContext *  C)

Use to update the active tool (shown in the top bar) in the least disruptive way.

This is a little involved since there may be multiple valid active tools depending on the mode and space type.

Used when undoing since the active mode may have changed.

Definition at line 513 of file wm_toolsystem.c.

References blender::compositor::area(), bScreen::areabase, BKE_workspace_id_tag_all_visible(), C, CTX_data_main(), ListBase::first, LIB_TAG_DOIT, LISTBASE_FOREACH, NULL, bToolKey::space_type, toolsystem_refresh_ref(), toolsystem_reinit_ensure_toolref(), Main::wm, WM_toolsystem_mode_from_spacetype(), WM_toolsystem_ref_find(), WM_TOOLSYSTEM_SPACE_MASK, WM_window_get_active_screen(), WM_window_get_active_view_layer(), WM_window_get_active_workspace(), and Main::workspaces.

Referenced by ed_undo_step_post().

◆ WM_toolsystem_refresh_all()

void WM_toolsystem_refresh_all ( struct bContext *  C,
struct WorkSpace *  workspace 
)

◆ WM_toolsystem_refresh_screen_all()

void WM_toolsystem_refresh_screen_all ( struct Main *  bmain)

◆ WM_toolsystem_refresh_screen_area()

void WM_toolsystem_refresh_screen_area ( struct WorkSpace *  workspace,
struct ViewLayer *  view_layer,
struct ScrArea *  area 
)

◆ WM_toolsystem_reinit()

void WM_toolsystem_reinit ( struct bContext *  C,
struct WorkSpace *  workspace,
const bToolKey *  tkey 
)

Definition at line 246 of file wm_toolsystem.c.

References C, toolsystem_reinit_ref(), and WM_toolsystem_ref_find().

◆ WM_toolsystem_reinit_all()

void WM_toolsystem_reinit_all ( struct bContext *  C,
struct wmWindow *  win 
)

◆ WM_toolsystem_runtime_find()

struct bToolRef_Runtime* WM_toolsystem_runtime_find ( struct WorkSpace *  workspace,
const bToolKey *  tkey 
)

Definition at line 108 of file wm_toolsystem.c.

References NULL, bToolRef::runtime, and WM_toolsystem_ref_find().

◆ WM_toolsystem_runtime_from_context()

struct bToolRef_Runtime* WM_toolsystem_runtime_from_context ( struct bContext *  C)

◆ WM_toolsystem_unlink()

void WM_toolsystem_unlink ( struct bContext *  C,
struct WorkSpace *  workspace,
const bToolKey *  tkey 
)

◆ WM_toolsystem_unlink_all()

void WM_toolsystem_unlink_all ( struct bContext *  C,
struct WorkSpace *  workspace 
)

Definition at line 255 of file wm_toolsystem.c.

References C, LISTBASE_FOREACH, WorkSpace::tools, and toolsystem_unlink_ref().

◆ WM_toolsystem_update_from_context()

void WM_toolsystem_update_from_context ( struct bContext *  C,
struct WorkSpace *  workspace,
struct ViewLayer *  view_layer,
struct ScrArea *  area 
)

◆ WM_toolsystem_update_from_context_view3d()

void WM_toolsystem_update_from_context_view3d ( struct bContext *  C)