[Bf-blender-cvs] [44f78c95be1] blender2.8: Cleanup: move toolsystem into own include

Campbell Barton noreply at git.blender.org
Wed May 23 08:24:22 CEST 2018


Commit: 44f78c95be133db75d439d4e4d5d6fdd5720f463
Author: Campbell Barton
Date:   Wed May 23 08:20:46 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB44f78c95be133db75d439d4e4d5d6fdd5720f463

Cleanup: move toolsystem into own include

Many files using the window manager don't access the tool-system.

This avoids rebuilding many files when the tool-system changes.

===================================================================

M	source/blender/editors/object/object_edit.c
M	source/blender/editors/physics/particle_edit.c
M	source/blender/editors/screen/area.c
M	source/blender/editors/screen/workspace_edit.c
M	source/blender/editors/sculpt_paint/paint_image.c
M	source/blender/editors/sculpt_paint/paint_vertex.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/editors/space_view3d/view3d_manipulator_ruler.c
M	source/blender/editors/transform/transform_manipulator_3d.c
M	source/blender/makesrna/intern/rna_workspace.c
M	source/blender/windowmanager/CMakeLists.txt
M	source/blender/windowmanager/WM_api.h
A	source/blender/windowmanager/WM_toolsystem.h
M	source/blender/windowmanager/intern/wm_event_system.c
M	source/blender/windowmanager/intern/wm_files.c
M	source/blender/windowmanager/intern/wm_toolsystem.c
M	source/creator/creator.c

===================================================================

diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 364a85c4248..7a4898ec287 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -112,6 +112,7 @@
 #include "WM_api.h"
 #include "WM_types.h"
 #include "WM_message.h"
+#include "WM_toolsystem.h"
 
 #include "object_intern.h"  // own include
 
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 6197457293f..7fc3cb8863f 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -82,6 +82,7 @@
 #include "WM_api.h"
 #include "WM_types.h"
 #include "WM_message.h"
+#include "WM_toolsystem.h"
 
 #include "RNA_access.h"
 #include "RNA_define.h"
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 1688e45d98c..dc5c9be04c8 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -52,6 +52,7 @@
 #include "WM_api.h"
 #include "WM_types.h"
 #include "WM_message.h"
+#include "WM_toolsystem.h"
 
 #include "ED_screen.h"
 #include "ED_screen_types.h"
diff --git a/source/blender/editors/screen/workspace_edit.c b/source/blender/editors/screen/workspace_edit.c
index 35d916e403d..a054949df22 100644
--- a/source/blender/editors/screen/workspace_edit.c
+++ b/source/blender/editors/screen/workspace_edit.c
@@ -65,6 +65,7 @@
 
 #include "WM_api.h"
 #include "WM_types.h"
+#include "WM_toolsystem.h"
 
 #include "screen_intern.h"
 
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 6a32fdecfad..0479af3c58f 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -74,6 +74,7 @@
 #include "WM_api.h"
 #include "WM_types.h"
 #include "WM_message.h"
+#include "WM_toolsystem.h"
 
 #include "RNA_access.h"
 #include "RNA_define.h"
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 3c3df2067ab..311587d6b53 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -69,6 +69,7 @@
 #include "WM_api.h"
 #include "WM_types.h"
 #include "WM_message.h"
+#include "WM_toolsystem.h"
 
 #include "ED_object.h"
 #include "ED_mesh.h"
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 709d6d4c690..5acc1cd0c6a 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -77,6 +77,7 @@
 #include "WM_api.h"
 #include "WM_types.h"
 #include "WM_message.h"
+#include "WM_toolsystem.h"
 
 #include "ED_sculpt.h"
 #include "ED_object.h"
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index d52ff1259cf..d8bcc9de2e2 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -69,6 +69,7 @@
 #include "WM_api.h"
 #include "WM_types.h"
 #include "WM_message.h"
+#include "WM_toolsystem.h"
 
 #include "RE_engine.h"
 #include "RE_pipeline.h"
diff --git a/source/blender/editors/space_view3d/view3d_manipulator_ruler.c b/source/blender/editors/space_view3d/view3d_manipulator_ruler.c
index 909b5ed11ca..8c3b28ffdd8 100644
--- a/source/blender/editors/space_view3d/view3d_manipulator_ruler.c
+++ b/source/blender/editors/space_view3d/view3d_manipulator_ruler.c
@@ -54,6 +54,7 @@
 
 #include "WM_api.h"
 #include "WM_types.h"
+#include "WM_toolsystem.h"
 
 #include "view3d_intern.h"  /* own include */
 
diff --git a/source/blender/editors/transform/transform_manipulator_3d.c b/source/blender/editors/transform/transform_manipulator_3d.c
index 863ec1af15b..891d9cf67f1 100644
--- a/source/blender/editors/transform/transform_manipulator_3d.c
+++ b/source/blender/editors/transform/transform_manipulator_3d.c
@@ -65,6 +65,7 @@
 #include "WM_api.h"
 #include "WM_types.h"
 #include "WM_message.h"
+#include "WM_toolsystem.h"
 
 #include "ED_armature.h"
 #include "ED_curve.h"
diff --git a/source/blender/makesrna/intern/rna_workspace.c b/source/blender/makesrna/intern/rna_workspace.c
index 53056c6cc5d..af9a200c3b9 100644
--- a/source/blender/makesrna/intern/rna_workspace.c
+++ b/source/blender/makesrna/intern/rna_workspace.c
@@ -53,6 +53,8 @@
 
 #include "RNA_access.h"
 
+#include "WM_toolsystem.h"
+
 static void rna_window_update_all(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
 {
 	WM_main_add_notifier(NC_WINDOW, NULL);
diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt
index d74cf15d78b..8fc46b6ce3f 100644
--- a/source/blender/windowmanager/CMakeLists.txt
+++ b/source/blender/windowmanager/CMakeLists.txt
@@ -87,6 +87,7 @@ set(SRC
 
 	WM_api.h
 	WM_keymap.h
+	WM_toolsystem.h
 	WM_types.h
 	wm.h
 	wm_cursors.h
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index bda22929ce8..9e47179c615 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -69,7 +69,6 @@ struct ImageFormatData;
 struct ARegion;
 struct ScrArea;
 struct Main;
-struct bToolDef;
 struct ViewLayer;
 struct GPUViewport;
 
@@ -602,57 +601,6 @@ bool        WM_event_is_tablet(const struct wmEvent *event);
 bool        WM_event_is_ime_switch(const struct wmEvent *event);
 #endif
 
-/* wm_toolsystem.c  */
-
-/* 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_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 *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(
-        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(struct bToolRef *tref, struct wmOperatorType *ot, struct PointerRNA *ptr);
-
-void WM_toolsystem_ref_properties_init_for_keymap(
-        struct bToolRef *tref, struct PointerRNA *dst_ptr, struct PointerRNA *src_ptr, struct wmOperatorType *ot);
-
 /* wm_tooltip.c */
 typedef struct ARegion *(*wmTooltipInitFn)(struct bContext *, struct ARegion *, bool *);
 
@@ -664,9 +612,6 @@ void WM_tooltip_clear(struct bContext *C, struct wmWindow *win);
 void WM_tooltip_init(struct bContext *C, struct wmWindow *win);
 void WM_tooltip_refresh(struct bContext *C, struct wmWindow *win);
 
-void WM_toolsystem_refresh_screen_area(struct WorkSpace *workspace, struct Scene *scene, struct ScrArea *sa);
-void WM_toolsystem_refresh_screen_all(struct Main *bmain);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/windowmanager/WM_toolsystem.h b/source/blender/windowmanager/WM_toolsystem.h
new file mode 100644
index 00000000000..2eb07d68afa
--- /dev/null
+++ b/source/blender/windowmanager/WM_toolsystem.h
@@ -0,0 +1,102 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef __WM_TOOLSYSTEM_H__
+#define __WM_TOOLSYSTEM_H__
+
+/** \file blender/windowmanager/WM_toolsystem.h
+ *  \ingroup wm
+ */
+
+/* dna-savable wmStructs here */
+#include "BLI_compiler_attrs.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bContext;
+struct bToolRef_Runtime;
+struct IDProperty;
+struct wmMsgSubscribeKey;
+struct wmMsgSubscribeValue;
+struct wmOperatorType;
+struct PointerRNA;
+struct ScrArea;
+struct Main;
+
+/* wm_toolsystem.c  */
+
+/* Values that define a categoey of active tool. */
+typedef struct bToolKey

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list