#endif
struct bContext;
+struct bToolRef_Runtime;
struct GHashIterator;
struct IDProperty;
struct wmEvent;
#endif
/* wm_toolsystem.c */
-void WM_toolsystem_unlink(struct bContext *C, struct WorkSpace *workspace);
-void WM_toolsystem_link(struct bContext *C, struct WorkSpace *workspace);
-void WM_toolsystem_refresh(struct bContext *C, struct WorkSpace *workspace);
-void WM_toolsystem_set(struct bContext *C, const struct bToolDef *tool);
+/* Values that define a categoey of active tool. */
+typedef struct bToolKey { int space_type; int mode; } bToolKey;
+
+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_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_link(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_unlink_all(struct bContext *C, struct WorkSpace *workspace);
+void WM_toolsystem_link_all(struct bContext *C, struct WorkSpace *workspace);
+void WM_toolsystem_refresh_all(struct bContext *C, struct WorkSpace *workspace);
+
+void WM_toolsystem_ref_set_from_runtime(
+ struct bContext *C, struct WorkSpace *workspace, struct bToolRef *tref,
+ const struct bToolRef_Runtime *tool, const char *idname);
+
void WM_toolsystem_init(struct bContext *C);
+int WM_toolsystem_mode_from_spacetype(
+ struct WorkSpace *workspace, struct Scene *scene, struct ScrArea *sa,
+ int space_type);
+bool WM_toolsystem_key_from_context(
+ struct WorkSpace *workspace, struct Scene *scene, struct ScrArea *sa,
+ bToolKey *tkey);
+void WM_toolsystem_update_from_context(
+ struct bContext *C,
+ struct WorkSpace *workspace, struct Scene *scene, struct ScrArea *sa);
+
+void WM_toolsystem_update_from_context_view3d(struct bContext *C);
+
bool WM_toolsystem_active_tool_is_brush(const struct bContext *C);
void WM_toolsystem_do_msg_notify_tag_refresh(