[Bf-blender-cvs] [caf600a] temp_widgets_update_tagging: Final cleanup before merge into wiggly-widgets branch

Julian Eisel noreply at git.blender.org
Wed May 18 17:44:18 CEST 2016


Commit: caf600aa9ce9a14915b989ace48b7f793d5eda4c
Author: Julian Eisel
Date:   Wed May 18 17:43:40 2016 +0200
Branches: temp_widgets_update_tagging
https://developer.blender.org/rBcaf600aa9ce9a14915b989ace48b7f793d5eda4c

Final cleanup before merge into wiggly-widgets branch

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

M	source/blender/editors/include/ED_view3d.h
M	source/blender/windowmanager/widgets/WM_widget_types.h
M	source/blender/windowmanager/widgets/intern/wm_widget.c
M	source/blender/windowmanager/widgets/intern/wm_widget_intern.h

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

diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index a3ed21d..69a7bb2 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -54,7 +54,6 @@ struct ScrArea;
 struct View3D;
 struct ViewContext;
 struct bContext;
-struct bFaceMap;
 struct bPoseChannel;
 struct bScreen;
 struct bglMats;
diff --git a/source/blender/windowmanager/widgets/WM_widget_types.h b/source/blender/windowmanager/widgets/WM_widget_types.h
index 67e4de9..3b50076 100644
--- a/source/blender/windowmanager/widgets/WM_widget_types.h
+++ b/source/blender/windowmanager/widgets/WM_widget_types.h
@@ -95,7 +95,7 @@ typedef struct wmWidgetMap {
 	struct wmWidgetMapType *type;
 	ListBase widgetgroups;
 
-	short update_flag; /* private, update tagging */
+	char update_flag; /* private, update tagging */
 
 	/**
 	 * \brief Widget map runtime context
@@ -127,7 +127,7 @@ struct wmWidgetMapType_Params {
 };
 
 /**
- * Simple utility wrapper for storing a single widget as wmWidgetGroup.customdata
+ * Simple utility wrapper for storing a single widget as wmWidgetGroup.customdata (which gets freed).
  */
 typedef struct wmWidgetWrapper {
 	struct wmWidget *widget;
diff --git a/source/blender/windowmanager/widgets/intern/wm_widget.c b/source/blender/windowmanager/widgets/intern/wm_widget.c
index 5687acc..759ecf7 100644
--- a/source/blender/windowmanager/widgets/intern/wm_widget.c
+++ b/source/blender/windowmanager/widgets/intern/wm_widget.c
@@ -178,21 +178,7 @@ bool wm_widget_register(wmWidgetGroup *wgroup, wmWidget *widget, const char *nam
 }
 
 /**
- * Free widget data, not widget itself.
- * TODO Not needed anymore?
- */
-void wm_widget_data_free(wmWidget *widget)
-{
-	if (widget->opptr.data) {
-		WM_operator_properties_free(&widget->opptr);
-	}
-
-	MEM_freeN(widget->props);
-	MEM_freeN(widget->ptr);
-}
-
-/**
- * Free and NULL \a widget.
+ * Free \a widget and unlink from \a widgetlist.
  * \a widgetlist is allowed to be NULL.
  */
 void WM_widget_delete(ListBase *widgetlist, wmWidgetMap *wmap, wmWidget *widget, bContext *C)
@@ -207,7 +193,12 @@ void WM_widget_delete(ListBase *widgetlist, wmWidgetMap *wmap, wmWidget *widget,
 		wm_widget_deselect(wmap, widget);
 	}
 
-	wm_widget_data_free(widget);
+	if (widget->opptr.data) {
+		WM_operator_properties_free(&widget->opptr);
+	}
+	MEM_freeN(widget->props);
+	MEM_freeN(widget->ptr);
+
 	if (widgetlist)
 		BLI_remlink(widgetlist, widget);
 	MEM_freeN(widget);
@@ -336,7 +327,7 @@ bool wm_widget_deselect(wmWidgetMap *wmap, wmWidget *widget)
 
 	/* remove widget from selected_widgets array */
 	for (int i = 0; i < (*tot_selected); i++) {
-		if (wm_widget_compare((*sel)[i], widget)) {
+		if ((*sel)[i] == widget) {
 			for (int j = i; j < ((*tot_selected) - 1); j++) {
 				(*sel)[j] = (*sel)[j + 1];
 			}
@@ -386,12 +377,6 @@ bool wm_widget_select(bContext *C, wmWidgetMap *wmap, wmWidget *widget)
 	return true;
 }
 
-/* XXX shouldn't be needed since we don't recreate widgets on redraw anymore? */
-bool wm_widget_compare(const wmWidget *a, const wmWidget *b)
-{
-	return STREQ(a->idname, b->idname);
-}
-
 void wm_widget_calculate_scale(wmWidget *widget, const bContext *C)
 {
 	const RegionView3D *rv3d = CTX_wm_region_view3d(C);
diff --git a/source/blender/windowmanager/widgets/intern/wm_widget_intern.h b/source/blender/windowmanager/widgets/intern/wm_widget_intern.h
index be66b75..a70105d 100644
--- a/source/blender/windowmanager/widgets/intern/wm_widget_intern.h
+++ b/source/blender/windowmanager/widgets/intern/wm_widget_intern.h
@@ -46,12 +46,10 @@ enum {
 };
 
 bool wm_widget_register(wmWidgetGroup *wgroup, struct wmWidget *widget, const char *name);
-void wm_widget_data_free(struct wmWidget *widget);
 
 bool wm_widget_deselect(struct wmWidgetMap *wmap, struct wmWidget *widget);
 bool wm_widget_select(bContext *C, struct wmWidgetMap *wmap, struct wmWidget *widget);
 
-bool wm_widget_compare(const struct wmWidget *a, const struct wmWidget *b);
 void wm_widget_calculate_scale(struct wmWidget *widget, const bContext *C);
 void wm_widget_update_prop_data(struct wmWidget *widget);




More information about the Bf-blender-cvs mailing list