[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48068] branches/soc-2012-swiss_cheese/ source/blender: * refactor of variable name in WM for readability

Nicholas Rishel rishel.nick at gmail.com
Tue Jun 19 07:41:34 CEST 2012


Revision: 48068
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48068
Author:   nicholas_rishel
Date:     2012-06-19 05:41:22 +0000 (Tue, 19 Jun 2012)
Log Message:
-----------
* refactor of variable name in WM for readability
* minor error in touch code corrected

Modified Paths:
--------------
    branches/soc-2012-swiss_cheese/source/blender/editors/gpencil/gpencil_paint.c
    branches/soc-2012-swiss_cheese/source/blender/editors/sculpt_paint/paint_image.c
    branches/soc-2012-swiss_cheese/source/blender/editors/sculpt_paint/paint_stroke.c
    branches/soc-2012-swiss_cheese/source/blender/windowmanager/WM_types.h
    branches/soc-2012-swiss_cheese/source/blender/windowmanager/intern/wm_event_system.c
    branches/soc-2012-swiss_cheese/source/blender/windowmanager/intern/wm_window.c
    branches/soc-2012-swiss_cheese/source/blender/windowmanager/wm_event_types.h

Modified: branches/soc-2012-swiss_cheese/source/blender/editors/gpencil/gpencil_paint.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/editors/gpencil/gpencil_paint.c	2012-06-19 05:01:14 UTC (rev 48067)
+++ branches/soc-2012-swiss_cheese/source/blender/editors/gpencil/gpencil_paint.c	2012-06-19 05:41:22 UTC (rev 48068)
@@ -1556,7 +1556,7 @@
 	p->mval[1] = event->mval[1] + 1;
 
 	/* handle pressure sensitivity (which is supplied by tablets) */
-	if (event->custom == EVT_DATA_TABLET) {
+	if (event->customdatatype == EVT_DATA_TABLET) {
 		wmTabletData *wmtab = event->customdata;
 		
 		tablet = (wmtab->Active != EVT_TABLET_NONE);

Modified: branches/soc-2012-swiss_cheese/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/editors/sculpt_paint/paint_image.c	2012-06-19 05:01:14 UTC (rev 48067)
+++ branches/soc-2012-swiss_cheese/source/blender/editors/sculpt_paint/paint_image.c	2012-06-19 05:41:22 UTC (rev 48068)
@@ -5072,7 +5072,7 @@
 	tablet = 0;
 	pop->s.blend = pop->s.brush->blend;
 
-	if (event->custom == EVT_DATA_TABLET) {
+	if (event->customdatatype == EVT_DATA_TABLET) {
 		wmtab = event->customdata;
 
 		tablet = (wmtab->Active != EVT_TABLET_NONE);

Modified: branches/soc-2012-swiss_cheese/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/editors/sculpt_paint/paint_stroke.c	2012-06-19 05:01:14 UTC (rev 48067)
+++ branches/soc-2012-swiss_cheese/source/blender/editors/sculpt_paint/paint_stroke.c	2012-06-19 05:41:22 UTC (rev 48068)
@@ -124,7 +124,7 @@
 	int erasor = 0;
 	float pressure = 1;
 
-	if (event->custom == EVT_DATA_TABLET) {
+	if (event->customdatatype == EVT_DATA_TABLET) {
 		wmTabletData *wmtab = event->customdata;
 
 		erasor = (wmtab->Active == EVT_TABLET_ERASER);

Modified: branches/soc-2012-swiss_cheese/source/blender/windowmanager/WM_types.h
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/windowmanager/WM_types.h	2012-06-19 05:01:14 UTC (rev 48067)
+++ branches/soc-2012-swiss_cheese/source/blender/windowmanager/WM_types.h	2012-06-19 05:41:22 UTC (rev 48068)
@@ -369,7 +369,7 @@
 	const char *keymap_idname;
 	
 	/* custom data */
-	short custom;		/* custom data type, stylus, 6dof, see wm_event_types.h */
+	short customdatatype;		/* custom data type, stylus, 6dof, see wm_event_types.h */
 	short customdatafree;
 	int pad2;
 	void *customdata;	/* ascii, unicode, mouse coords, angles, vectors, dragdrop info */

Modified: branches/soc-2012-swiss_cheese/source/blender/windowmanager/intern/wm_event_system.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/windowmanager/intern/wm_event_system.c	2012-06-19 05:01:14 UTC (rev 48067)
+++ branches/soc-2012-swiss_cheese/source/blender/windowmanager/intern/wm_event_system.c	2012-06-19 05:41:22 UTC (rev 48068)
@@ -100,7 +100,7 @@
 	if (event->customdata) {
 		if (event->customdatafree) {
 			/* note: pointer to listbase struct elsewhere */
-			if (event->custom == EVT_DATA_LISTBASE)
+			if (event->customdatatype == EVT_DATA_LISTBASE)
 				BLI_freelistN(event->customdata);
 			else
 				MEM_freeN(event->customdata);
@@ -1713,7 +1713,7 @@
 					wmDropBox *drop = handler->dropboxes->first;
 					for (; drop; drop = drop->next) {
 						/* other drop custom types allowed */
-						if (event->custom == EVT_DATA_LISTBASE) {
+						if (event->customdatatype == EVT_DATA_LISTBASE) {
 							ListBase *lb = (ListBase *)event->customdata;
 							wmDrag *drag;
 							
@@ -1725,7 +1725,7 @@
 									/* free the drags before calling operator */
 									BLI_freelistN(event->customdata);
 									event->customdata = NULL;
-									event->custom = 0;
+									event->customdatatype = 0;
 									
 									WM_operator_name_call(C, drop->ot->idname, drop->opcontext, drop->ptr);
 									action |= WM_HANDLER_BREAK;
@@ -1917,7 +1917,7 @@
 				MEM_freeN(event->customdata);
 		}
 		
-		event->custom = EVT_DATA_LISTBASE;
+		event->customdatatype = EVT_DATA_LISTBASE;
 		event->customdata = &wm->drags;
 		event->customdatafree = 1;
 		
@@ -2537,7 +2537,7 @@
 		wmtab->Xtilt = td->Xtilt;
 		wmtab->Ytilt = td->Ytilt;
 		
-		event->custom = EVT_DATA_TABLET;
+		event->customdatatype = EVT_DATA_TABLET;
 		event->customdata = wmtab;
 		event->customdatafree = 1;
 	} 
@@ -2580,7 +2580,7 @@
 
 	data->progress = (wmProgress) ghost->progress;
 
-	event->custom = EVT_DATA_NDOF_MOTION;
+	event->customdatatype = EVT_DATA_NDOF_MOTION;
 	event->customdata = data;
 	event->customdatafree = 1;
 }
@@ -2861,7 +2861,7 @@
 		}
 		case GHOST_kEventTimer: {
 			event.type = TIMER;
-			event.custom = EVT_DATA_TIMER;
+			event.customdatatype = EVT_DATA_TIMER;
 			event.customdata = customdata;
 			wm_event_add(win, &event);
 
@@ -2892,7 +2892,7 @@
 					break;
 			}
 
-			event.custom = 0;
+			event.customdatatype = 0;
 			event.customdata = NULL;
 
 			wm_event_add(win, &event);
@@ -2910,7 +2910,7 @@
 			data->y = (int)e->y;
 
 			event.type = TOUCH;
-			event.custom = EVT_DATA_TOUCH;
+			event.customdatatype = EVT_DATA_TOUCH;
 			event.customdata = data;
 			event.customdatafree = 1;
 

Modified: branches/soc-2012-swiss_cheese/source/blender/windowmanager/intern/wm_window.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/windowmanager/intern/wm_window.c	2012-06-19 05:01:14 UTC (rev 48067)
+++ branches/soc-2012-swiss_cheese/source/blender/windowmanager/intern/wm_window.c	2012-06-19 05:41:22 UTC (rev 48068)
@@ -874,7 +874,7 @@
 				/* make blender drop event with custom data pointing to wm drags */
 				event.type = EVT_DROP;
 				event.val = KM_RELEASE;
-				event.custom = EVT_DATA_LISTBASE;
+				event.customdatatype = EVT_DATA_LISTBASE;
 				event.customdata = &wm->drags;
 				event.customdatafree = 1;
 				
@@ -947,7 +947,7 @@
 					wmEvent event = *(win->eventstate);
 					
 					event.type = wt->event_type;
-					event.custom = EVT_DATA_TIMER;
+					event.customdatatype = EVT_DATA_TIMER;
 					event.customdata = wt;
 					wm_event_add(win, &event);
 

Modified: branches/soc-2012-swiss_cheese/source/blender/windowmanager/wm_event_types.h
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/windowmanager/wm_event_types.h	2012-06-19 05:01:14 UTC (rev 48067)
+++ branches/soc-2012-swiss_cheese/source/blender/windowmanager/wm_event_types.h	2012-06-19 05:41:22 UTC (rev 48068)
@@ -305,7 +305,7 @@
 #define ISNDOF(event)	(event >= NDOF_MOTION && event < NDOF_LAST)
 
 	/* test whether the event is a touch event */
-#define ISTOUCH(event)	(event = TOUCH)
+#define ISTOUCH(event)	(event == TOUCH)
 
 /* test whether event type is acceptable as hotkey, excluding modifiers */
 #define ISHOTKEY(event)	((ISKEYBOARD(event) || ISMOUSE(event) || ISNDOF(event) || ISTOUCH(event)) && event!=ESCKEY && !(event>=LEFTCTRLKEY && event<=LEFTSHIFTKEY) && !(event>=UNKNOWNKEY && event<=GRLESSKEY))




More information about the Bf-blender-cvs mailing list