[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39299] branches/soc-2011-pepper: svn merge -r39286:39298 https://svn.blender.org/svnroot/bf-blender/trunk/ blender, ensure some edits in trunk dont get merged back into pepper

Campbell Barton ideasman42 at gmail.com
Thu Aug 11 11:28:08 CEST 2011


Revision: 39299
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39299
Author:   campbellbarton
Date:     2011-08-11 09:28:07 +0000 (Thu, 11 Aug 2011)
Log Message:
-----------
svn merge -r39286:39298 https://svn.blender.org/svnroot/bf-blender/trunk/blender, ensure some edits in trunk dont get merged back into pepper

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39286

Modified Paths:
--------------
    branches/soc-2011-pepper/source/blender/blenkernel/intern/unit.c
    branches/soc-2011-pepper/source/blender/editors/interface/interface_templates.c
    branches/soc-2011-pepper/source/blender/editors/space_outliner/outliner_draw.c
    branches/soc-2011-pepper/source/blender/editors/space_view3d/view3d_toolbar.c
    branches/soc-2011-pepper/source/blender/python/intern/bpy_operator.c
    branches/soc-2011-pepper/source/blender/windowmanager/WM_api.h
    branches/soc-2011-pepper/source/blender/windowmanager/WM_types.h
    branches/soc-2011-pepper/source/blender/windowmanager/intern/wm.c
    branches/soc-2011-pepper/source/blender/windowmanager/intern/wm_init_exit.c
    branches/soc-2011-pepper/source/blender/windowmanager/intern/wm_operators.c
    branches/soc-2011-pepper/source/blenderplayer/bad_level_call_stubs/stubs.c

Property Changed:
----------------
    branches/soc-2011-pepper/


Property changes on: branches/soc-2011-pepper
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/blender:36830-39286
   + /trunk/blender:36830-39298

Modified: branches/soc-2011-pepper/source/blender/blenkernel/intern/unit.c
===================================================================
--- branches/soc-2011-pepper/source/blender/blenkernel/intern/unit.c	2011-08-11 08:35:06 UTC (rev 39298)
+++ branches/soc-2011-pepper/source/blender/blenkernel/intern/unit.c	2011-08-11 09:28:07 UTC (rev 39299)
@@ -136,7 +136,7 @@
 	{"yard", "yards",		"yd", NULL, "Yards",	UN_SC_YD, 0.0,	B_UNIT_DEF_NONE},
 	{"foot", "feet",		"'", "ft", "Feet",		UN_SC_FT, 0.0,	B_UNIT_DEF_NONE}, /* base unit */
 	{"inch", "inches",		"\"", "in", "Inches",	UN_SC_IN, 0.0,	B_UNIT_DEF_NONE},
-	{"thou", "thous",		"mil", NULL, "Thous",	UN_SC_MIL, 0.0,	B_UNIT_DEF_NONE},
+	{"thou", "thou",		"thou", "mil", "Thou",	UN_SC_MIL, 0.0,	B_UNIT_DEF_NONE}, /* plural for thou has no 's' */
 	{NULL, NULL, NULL, NULL, NULL, 0.0, 0.0}
 };
 static struct bUnitCollection buImperialLenCollecton = {buImperialLenDef, 4, 0, sizeof(buImperialLenDef)/sizeof(bUnitDef)};

Modified: branches/soc-2011-pepper/source/blender/editors/interface/interface_templates.c
===================================================================
--- branches/soc-2011-pepper/source/blender/editors/interface/interface_templates.c	2011-08-11 08:35:06 UTC (rev 39298)
+++ branches/soc-2011-pepper/source/blender/editors/interface/interface_templates.c	2011-08-11 09:28:07 UTC (rev 39299)
@@ -40,6 +40,7 @@
 
 #include "BLI_string.h"
 #include "BLI_utildefines.h"
+#include "BLI_ghash.h"
 
 #include "BKE_animsys.h"
 #include "BKE_colortools.h"
@@ -2326,10 +2327,11 @@
 
 static void operator_search_cb(const bContext *C, void *UNUSED(arg), const char *str, uiSearchItems *items)
 {
-	wmOperatorType *ot = WM_operatortype_first();
-	
-	for(; ot; ot= ot->next) {
-		
+	GHashIterator *iter= WM_operatortype_iter();
+
+	for( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+		wmOperatorType *ot= BLI_ghashIterator_getValue(iter);
+
 		if(BLI_strcasestr(ot->name, str)) {
 			if(WM_operator_poll((bContext*)C, ot)) {
 				char name[256];
@@ -2349,6 +2351,7 @@
 			}
 		}
 	}
+	BLI_ghashIterator_free(iter);
 }
 
 void uiTemplateOperatorSearch(uiLayout *layout)

Modified: branches/soc-2011-pepper/source/blender/editors/space_outliner/outliner_draw.c
===================================================================
--- branches/soc-2011-pepper/source/blender/editors/space_outliner/outliner_draw.c	2011-08-11 08:35:06 UTC (rev 39298)
+++ branches/soc-2011-pepper/source/blender/editors/space_outliner/outliner_draw.c	2011-08-11 09:28:07 UTC (rev 39299)
@@ -66,6 +66,8 @@
 #include "BKE_scene.h"
 #include "BKE_sequencer.h"
 
+#include "BLI_ghash.h"
+
 #include "ED_armature.h"
 #include "ED_object.h"
 #include "ED_screen.h"
@@ -584,9 +586,10 @@
 
 static void operator_search_cb(const struct bContext *UNUSED(C), void *UNUSED(arg_kmi), const char *str, uiSearchItems *items)
 {
-	wmOperatorType *ot = WM_operatortype_first();
-	
-	for(; ot; ot= ot->next) {
+	GHashIterator *iter= WM_operatortype_iter();
+
+	for( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+		wmOperatorType *ot= BLI_ghashIterator_getValue(iter);
 		
 		if(BLI_strcasestr(ot->idname, str)) {
 			char name[OP_MAX_TYPENAME];
@@ -598,6 +601,7 @@
 				break;
 		}
 	}
+	BLI_ghashIterator_free(iter);
 }
 
 /* operator Search browse menu, open */

Modified: branches/soc-2011-pepper/source/blender/editors/space_view3d/view3d_toolbar.c
===================================================================
--- branches/soc-2011-pepper/source/blender/editors/space_view3d/view3d_toolbar.c	2011-08-11 08:35:06 UTC (rev 39298)
+++ branches/soc-2011-pepper/source/blender/editors/space_view3d/view3d_toolbar.c	2011-08-11 09:28:07 UTC (rev 39299)
@@ -46,6 +46,7 @@
 #include "BLI_editVert.h"
 #include "BLI_rand.h"
 #include "BLI_utildefines.h"
+#include "BLI_ghash.h"
 
 #include "BKE_context.h"
 #include "BKE_idprop.h"
@@ -140,10 +141,11 @@
 
 static void operator_search_cb(const struct bContext *C, void *UNUSED(arg), const char *str, uiSearchItems *items)
 {
-	wmOperatorType *ot = WM_operatortype_first();
-	
-	for(; ot; ot= ot->next) {
-		
+	GHashIterator *iter= WM_operatortype_iter();
+
+	for( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+		wmOperatorType *ot= BLI_ghashIterator_getValue(iter);
+
 		if(BLI_strcasestr(ot->name, str)) {
 			if(WM_operator_poll((bContext*)C, ot)) {
 				
@@ -152,6 +154,7 @@
 			}
 		}
 	}
+	BLI_ghashIterator_free(iter);
 }
 
 

Modified: branches/soc-2011-pepper/source/blender/python/intern/bpy_operator.c
===================================================================
--- branches/soc-2011-pepper/source/blender/python/intern/bpy_operator.c	2011-08-11 08:35:06 UTC (rev 39298)
+++ branches/soc-2011-pepper/source/blender/python/intern/bpy_operator.c	2011-08-11 09:28:07 UTC (rev 39299)
@@ -52,6 +52,9 @@
 #include "WM_types.h"
 
 #include "MEM_guardedalloc.h"
+
+#include "BLI_ghash.h"
+
 #include "BKE_report.h"
 #include "BKE_context.h"
 
@@ -359,15 +362,18 @@
 
 static PyObject *pyop_dir(PyObject *UNUSED(self))
 {
+	GHashIterator *iter= WM_operatortype_iter();
 	PyObject *list= PyList_New(0), *name;
-	wmOperatorType *ot;
-	
-	for(ot= WM_operatortype_first(); ot; ot= ot->next) {
+
+	for( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+		wmOperatorType *ot= BLI_ghashIterator_getValue(iter);
+
 		name= PyUnicode_FromString(ot->idname);
 		PyList_Append(list, name);
 		Py_DECREF(name);
 	}
-	
+	BLI_ghashIterator_free(iter);
+
 	return list;
 }
 

Modified: branches/soc-2011-pepper/source/blender/windowmanager/WM_api.h
===================================================================
--- branches/soc-2011-pepper/source/blender/windowmanager/WM_api.h	2011-08-11 08:35:06 UTC (rev 39298)
+++ branches/soc-2011-pepper/source/blender/windowmanager/WM_api.h	2011-08-11 09:28:07 UTC (rev 39299)
@@ -179,7 +179,7 @@
 void		WM_operator_stack_clear(struct wmWindowManager *wm);
 
 struct wmOperatorType *WM_operatortype_find(const char *idnamem, int quiet);
-struct wmOperatorType *WM_operatortype_first(void);
+struct GHashIterator *WM_operatortype_iter(void);
 void		WM_operatortype_append	(void (*opfunc)(struct wmOperatorType*));
 void		WM_operatortype_append_ptr	(void (*opfunc)(struct wmOperatorType*, void *), void *userdata);
 void		WM_operatortype_append_macro_ptr	(void (*opfunc)(struct wmOperatorType*, void *), void *userdata);
@@ -230,6 +230,7 @@
 void		WM_operator_py_idname(char *to, const char *from);
 
 /* *************** menu types ******************** */
+void				WM_menutype_init(void);
 struct MenuType		*WM_menutype_find(const char *idname, int quiet);
 int					WM_menutype_add(struct MenuType* mt);
 int					WM_menutype_contains(struct MenuType* mt);

Modified: branches/soc-2011-pepper/source/blender/windowmanager/WM_types.h
===================================================================
--- branches/soc-2011-pepper/source/blender/windowmanager/WM_types.h	2011-08-11 08:35:06 UTC (rev 39298)
+++ branches/soc-2011-pepper/source/blender/windowmanager/WM_types.h	2011-08-11 09:28:07 UTC (rev 39299)
@@ -423,8 +423,6 @@
 
 
 typedef struct wmOperatorType {
-	struct wmOperatorType *next, *prev;
-
 	const char *name;		/* text for ui, undo */
 	const char *idname;		/* unique identifier */
 	const char *description;	/* tooltips and python docs */

Modified: branches/soc-2011-pepper/source/blender/windowmanager/intern/wm.c
===================================================================
--- branches/soc-2011-pepper/source/blender/windowmanager/intern/wm.c	2011-08-11 08:35:06 UTC (rev 39298)
+++ branches/soc-2011-pepper/source/blender/windowmanager/intern/wm.c	2011-08-11 09:28:07 UTC (rev 39299)
@@ -40,7 +40,11 @@
 
 #include "GHOST_C-api.h"
 
+#include "MEM_guardedalloc.h"
+
+#include "BLI_utildefines.h"
 #include "BLI_blenlib.h"
+#include "BLI_ghash.h"
 
 #include "BKE_blender.h"
 #include "BKE_context.h"
@@ -59,8 +63,6 @@
 #include "wm_draw.h"
 #include "wm.h"
 
-#include "MEM_guardedalloc.h"
-
 #include "ED_screen.h"
 
 #ifdef WITH_PYTHON
@@ -151,14 +153,14 @@
 
 /* ****************************************** */
 
-static ListBase menutypes = {NULL, NULL}; /* global menutype list */
+static GHash *menutypes_hash= NULL;
 
 MenuType *WM_menutype_find(const char *idname, int quiet)
 {
 	MenuType* mt;
 
 	if (idname[0]) {
-		mt= BLI_findstring(&menutypes, idname, offsetof(MenuType, idname));
+		mt= BLI_ghash_lookup(menutypes_hash, idname);
 		if(mt)
 			return mt;
 	}
@@ -171,35 +173,55 @@
 
 int WM_menutype_add(MenuType* mt)
 {
-	BLI_addtail(&menutypes, mt);
+	BLI_ghash_insert(menutypes_hash, (void *)mt->idname, mt);
 	return 1;
 }
 
 /* inefficient but only used for tooltip code */
 int WM_menutype_contains(MenuType* mt)
 {
-	return (mt != NULL && BLI_findindex(&menutypes, mt) != -1);
+	int found= FALSE;
+
+	if(mt) {
+		GHashIterator *iter= BLI_ghashIterator_new(menutypes_hash);
+
+		for( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+			if(mt == BLI_ghashIterator_getValue(iter)) {
+				found= TRUE;
+				break;
+			}
+		}
+		BLI_ghashIterator_free(iter);
+	}
+
+	return found;
 }
 
 void WM_menutype_freelink(MenuType* mt)
 {
-	BLI_freelinkN(&menutypes, mt);
+	BLI_ghash_remove(menutypes_hash, mt->idname, NULL, (GHashValFreeFP)MEM_freeN);
 }
 
+/* called on initialize WM_init() */
+void WM_menutype_init(void)
+{
+	menutypes_hash= BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp, "menutypes_hash gh");
+}
+
 void WM_menutype_free(void)
 {
-	MenuType* mt= menutypes.first, *mt_next;
+	GHashIterator *iter= BLI_ghashIterator_new(menutypes_hash);
 
-	while(mt) {
-		mt_next= mt->next;
-
-		if(mt->ext.free)
+	for( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
+		MenuType *mt= BLI_ghashIterator_getValue(iter);
+		if(mt->ext.free) {
 			mt->ext.free(mt->ext.data);
+		}
+	}
+	BLI_ghashIterator_free(iter);
 
-		WM_menutype_freelink(mt);
-
-		mt= mt_next;
-	}
+	BLI_ghash_free(menutypes_hash, NULL, (GHashValFreeFP)MEM_freeN);
+	menutypes_hash= NULL;
 }
 
 /* ****************************************** */

Modified: branches/soc-2011-pepper/source/blender/windowmanager/intern/wm_init_exit.c
===================================================================

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list