[Bf-blender-cvs] [157bd82] temp_manipulators_core: Move structs to lower level, avoid storing manipulator-group pointers, naming, etc

Julian Eisel noreply at git.blender.org
Thu Sep 15 12:50:48 CEST 2016


Commit: 157bd82fdecb46708d1d2cc041a4930db2cb40b2
Author: Julian Eisel
Date:   Thu Sep 15 12:49:00 2016 +0200
Branches: temp_manipulators_core
https://developer.blender.org/rB157bd82fdecb46708d1d2cc041a4930db2cb40b2

Move structs to lower level, avoid storing manipulator-group pointers, naming, etc

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

M	source/blender/windowmanager/WM_api.h
M	source/blender/windowmanager/intern/wm_event_system.c
M	source/blender/windowmanager/intern/wm_init_exit.c
M	source/blender/windowmanager/manipulators/WM_manipulator_api.h
M	source/blender/windowmanager/manipulators/WM_manipulator_types.h
M	source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c
M	source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
M	source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c
M	source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c
M	source/blender/windowmanager/manipulators/intern/manipulator_library/manipulator_library_utils.c
M	source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c
M	source/blender/windowmanager/manipulators/intern/wm_manipulator.c
M	source/blender/windowmanager/manipulators/intern/wm_manipulator_intern.h
M	source/blender/windowmanager/manipulators/intern/wm_manipulatorgroup.c
M	source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
M	source/blender/windowmanager/manipulators/wm_manipulator_wmapi.h

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

diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index f2df6c0..006f1b7 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -75,6 +75,7 @@ struct wmNDOFMotionData;
 
 typedef struct wmJob wmJob;
 typedef struct wmManipulator wmManipulator;
+typedef struct wmManipulatorMap wmManipulatorMap;
 typedef struct wmManipulatorMapType wmManipulatorMapType;
 
 /* general API */
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 97f2d2b..d9cdb07 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2123,9 +2123,10 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers
 					}
 				}
 				/* handle user configurable manipulator-map keymap */
-				else if (manipulator && mmap->mmap_context.activegroup) {
+				else if (manipulator) {
 					/* get user customized keymap from default one */
-					const wmKeyMap *keymap = WM_keymap_active(wm, mmap->mmap_context.activegroup->type->keymap);
+					const wmManipulatorGroup *highlightgroup = wm_manipulator_group_find(mmap, manipulator);
+					const wmKeyMap *keymap = WM_keymap_active(wm, highlightgroup->type->keymap);
 					wmKeyMapItem *kmi;
 
 					PRINT("%s:   checking '%s' ...", __func__, keymap->idname);
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 57f7fde..0070c87 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -532,7 +532,7 @@ void WM_exit_ext(bContext *C, const bool do_python)
 	BKE_node_clipboard_clear();
 
 	/* free manipulator-maps after freeing blender, so no deleted data get accessed during cleaning up of areas */
-	WM_manipulatormaptypes_free();
+	wm_manipulatormaptypes_free();
 
 	BLF_exit();
 
diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_api.h b/source/blender/windowmanager/manipulators/WM_manipulator_api.h
index 3b4eace..f9d3a5b 100644
--- a/source/blender/windowmanager/manipulators/WM_manipulator_api.h
+++ b/source/blender/windowmanager/manipulators/WM_manipulator_api.h
@@ -97,13 +97,11 @@ struct wmManipulatorMapType *WM_manipulatormaptype_find(
         const struct wmManipulatorMapType_Params *mmap_params);
 struct wmManipulatorMapType *WM_manipulatormaptype_ensure(
         const struct wmManipulatorMapType_Params *mmap_params);
-struct wmManipulatorMap *WM_manipulatormap_from_type(
+struct wmManipulatorMap *WM_manipulatormap_new_from_type(
         const struct wmManipulatorMapType_Params *mmap_params);
 struct wmManipulatorMap *WM_manipulatormap_find(
         const struct ARegion *ar, const struct wmManipulatorMapType_Params *mmap_params);
 
-void WM_manipulatormaptypes_free(void);
-
 void WM_manipulatormap_tag_refresh(struct wmManipulatorMap *mmap);
 void WM_manipulatormap_update(const struct bContext *C, struct wmManipulatorMap *mmap);
 void WM_manipulatormap_draw(
diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_types.h b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
index 6fc748f..f97e46d 100644
--- a/source/blender/windowmanager/manipulators/WM_manipulator_types.h
+++ b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
@@ -88,37 +88,6 @@ typedef struct wmManipulatorGroupType {
 	char mapidname[64];
 } wmManipulatorGroupType;
 
-
-typedef struct wmManipulatorMap {
-	struct wmManipulatorMap *next, *prev;
-
-	struct wmManipulatorMapType *type;
-	ListBase manipulator_groups;
-
-	char update_flag; /* private, update tagging */
-
-	/**
-	 * \brief Manipulator map runtime context
-	 *
-	 * Contains information about this manipulator-map. Currently
-	 * highlighted manipulator, currently selected manipulators, ...
-	 */
-	struct {
-		/* we redraw the manipulator-map when this changes */
-		struct wmManipulator *highlighted_manipulator;
-		/* user has clicked this manipulator and it gets all input */
-		struct wmManipulator *active_manipulator;
-		/* array for all selected manipulators
-		 * TODO  check on using BLI_array */
-		struct wmManipulator **selected_manipulator;
-		int tot_selected;
-
-		/* set while manipulator is highlighted/active */
-		struct wmManipulatorGroup *activegroup;
-	} mmap_context;
-} wmManipulatorMap;
-
-
 struct wmManipulatorMapType_Params {
 	const char *idname;
 	const int spaceid;
diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c
index d8e5d39..b6ae239 100644
--- a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c
+++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow2d_manipulator.c
@@ -193,7 +193,7 @@ wmManipulator *MANIPULATOR_arrow2d_new(wmManipulatorGroup *mgroup, const char *n
 
 	arrow->line_len = 1.0f;
 
-	WM_manipulator_register(mgroup, &arrow->manipulator, name);
+	wm_manipulator_register(mgroup, &arrow->manipulator, name);
 
 	return (wmManipulator *)arrow;
 }
diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
index a9503ce..78e8cc1 100644
--- a/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
+++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/arrow_manipulator.c
@@ -66,9 +66,9 @@
 //#define MANIPULATOR_USE_CUSTOM_ARROWS
 
 #ifdef MANIPULATOR_USE_CUSTOM_ARROWS
-ManipulatorDrawInfo arrow_head_draw_info = {0};
+ManipulatorGeometryInfo arrow_head_draw_info = {0};
 #endif
-ManipulatorDrawInfo cube_draw_info = {0};
+ManipulatorGeometryInfo cube_draw_info = {0};
 
 /* ArrowManipulator->flag */
 enum {
@@ -134,7 +134,7 @@ static void arrow_draw_geom(const ArrowManipulator *arrow, const bool select)
 	}
 	else {
 #ifdef MANIPULATOR_USE_CUSTOM_ARROWS
-		manipulator_drawinfo_draw(&arrow_head_draw_info, select);
+		wm_manipulator_geometryinfo_draw(&arrow_head_draw_info, select);
 #else
 		const float vec[2][3] = {
 			{0.0f, 0.0f, 0.0f},
@@ -162,7 +162,7 @@ static void arrow_draw_geom(const ArrowManipulator *arrow, const bool select)
 			glScalef(size, size, size);
 
 			/* draw cube */
-			manipulator_drawinfo_draw(&cube_draw_info, select);
+			wm_manipulator_geometryinfo_draw(&cube_draw_info, select);
 		}
 		else {
 			const float len = 0.25f;
@@ -482,7 +482,7 @@ wmManipulator *MANIPULATOR_arrow_new(wmManipulatorGroup *mgroup, const char *nam
 	arrow->data.range_fac = 1.0f;
 	copy_v3_v3(arrow->direction, dir_default);
 
-	WM_manipulator_register(mgroup, &arrow->manipulator, name);
+	wm_manipulator_register(mgroup, &arrow->manipulator, name);
 
 	return (wmManipulator *)arrow;
 }
diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c
index 96c1f85..a22ccfa 100644
--- a/source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c
+++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/cage_manipulator.c
@@ -541,7 +541,7 @@ wmManipulator *MANIPULATOR_rect_transform_new(wmManipulatorGroup *mgroup, const
 	cage->scale[0] = cage->scale[1] = 1.0f;
 	cage->style = style;
 
-	WM_manipulator_register(mgroup, &cage->manipulator, name);
+	wm_manipulator_register(mgroup, &cage->manipulator, name);
 
 	return (wmManipulator *)cage;
 }
diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c
index ef1c955..287fd55 100644
--- a/source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c
+++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/dial_manipulator.c
@@ -65,7 +65,7 @@
 //#define MANIPULATOR_USE_CUSTOM_DIAS
 
 #ifdef MANIPULATOR_USE_CUSTOM_DIAS
-ManipulatorDrawInfo dial_draw_info = {0};
+ManipulatorGeometryInfo dial_draw_info = {0};
 #endif
 
 typedef struct DialManipulator {
@@ -92,7 +92,7 @@ typedef struct DialInteraction {
 static void dial_geom_draw(const DialManipulator *dial, const float col[4], const bool select)
 {
 #ifdef MANIPULATOR_USE_CUSTOM_DIAS
-	manipulator_drawinfo_draw(&dial_draw_info, select);
+	wm_manipulator_geometryinfo_draw(&dial_draw_info, select);
 #else
 	const bool filled = (dial->style == MANIPULATOR_DIAL_STYLE_RING_FILLED);
 
@@ -325,7 +325,7 @@ wmManipulator *MANIPULATOR_dial_new(wmManipulatorGroup *mgroup, const char *name
 	/* defaults */
 	copy_v3_v3(dial->direction, dir_default);
 
-	WM_manipulator_register(mgroup, &dial->manipulator, name);
+	wm_manipulator_register(mgroup, &dial->manipulator, name);
 
 	return (wmManipulator *)dial;
 }
diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/manipulator_library_utils.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/manipulator_library_utils.c
index fdea67d..0617e9e 100644
--- a/source/blender/windowmanager/manipulators/intern/manipulator_library/manipulator_library_utils.c
+++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/manipulator_library_utils.c
@@ -42,6 +42,7 @@
 /* own includes */
 #include "WM_manipulator_types.h"
 #include "wm_manipulator_wmapi.h"
+#include "wm_manipulator_intern.h"
 #include "manipulator_library_intern.h"
 
 /* factor for precision tweaking */
diff --git a/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c b/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c
index b6a19ef..8293be6 100644
--- a/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c
+++ b/source/blender/windowmanager/manipulators/intern/manipulator_library/primitive_manipulator.c
@@ -208,7 +208,7 @@ wmManipulator *MANIPULATOR_primitive_new(

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list