[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44240] trunk/blender/source/blender: style cleanyp: split > 120 width lines.

Campbell Barton ideasman42 at gmail.com
Sun Feb 19 07:00:30 CET 2012


Revision: 44240
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44240
Author:   campbellbarton
Date:     2012-02-19 06:00:20 +0000 (Sun, 19 Feb 2012)
Log Message:
-----------
style cleanyp: split > 120 width lines.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/object/object_edit.c
    trunk/blender/source/blender/windowmanager/intern/wm_draw.c
    trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
    trunk/blender/source/blender/windowmanager/intern/wm_files.c
    trunk/blender/source/blender/windowmanager/intern/wm_gesture.c
    trunk/blender/source/blender/windowmanager/intern/wm_keymap.c
    trunk/blender/source/blender/windowmanager/intern/wm_operators.c
    trunk/blender/source/blender/windowmanager/intern/wm_window.c

Modified: trunk/blender/source/blender/editors/object/object_edit.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_edit.c	2012-02-19 05:17:55 UTC (rev 44239)
+++ trunk/blender/source/blender/editors/object/object_edit.c	2012-02-19 06:00:20 UTC (rev 44240)
@@ -1004,7 +1004,10 @@
 	 * view3d_edit_object_copyattrmenu() and in toolbox.c
 	 */
 	
-	strcpy(str, "Copy Attributes %t|Location%x1|Rotation%x2|Size%x3|Draw Options%x4|Time Offset%x5|Dupli%x6|Object Color%x31|%l|Mass%x7|Damping%x8|All Physical Attributes%x11|Properties%x9|Logic Bricks%x10|Protected Transform%x29|%l");
+	strcpy(str,
+	       "Copy Attributes %t|Location%x1|Rotation%x2|Size%x3|Draw Options%x4|"
+	       "Time Offset%x5|Dupli%x6|Object Color%x31|%l|Mass%x7|Damping%x8|All Physical Attributes%x11|Properties%x9|"
+	       "Logic Bricks%x10|Protected Transform%x29|%l");
 	
 	strcat (str, "|Object Constraints%x22");
 	strcat (str, "|NLA Strips%x26");

Modified: trunk/blender/source/blender/windowmanager/intern/wm_draw.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_draw.c	2012-02-19 05:17:55 UTC (rev 44239)
+++ trunk/blender/source/blender/windowmanager/intern/wm_draw.c	2012-02-19 06:00:20 UTC (rev 44240)
@@ -90,10 +90,17 @@
 					if (ELEM(win->grabcursor, GHOST_kGrabWrap, GHOST_kGrabHide)) {
 						int x = 0, y = 0;
 						wm_get_cursor_position(win, &x, &y);
-						pc->draw(C, x - ar_other->winrct.xmin, y - ar_other->winrct.ymin, pc->customdata);
-					} else {
-						pc->draw(C, win->eventstate->x - ar_other->winrct.xmin, win->eventstate->y - ar_other->winrct.ymin, pc->customdata);
+						pc->draw(C,
+						         x - ar_other->winrct.xmin,
+						         y - ar_other->winrct.ymin,
+						         pc->customdata);
 					}
+					else {
+						pc->draw(C,
+						         win->eventstate->x - ar_other->winrct.xmin,
+						         win->eventstate->y - ar_other->winrct.ymin,
+						         pc->customdata);
+					}
 				}
 			}
 		}
@@ -458,7 +465,8 @@
 
 			if(triple->x[x] > maxsize || triple->y[y] > maxsize) {
 				glBindTexture(triple->target, 0);
-				printf("WM: failed to allocate texture for triple buffer drawing (texture too large for graphics card).\n");
+				printf("WM: failed to allocate texture for triple buffer drawing "
+				       "(texture too large for graphics card).\n");
 				return 0;
 			}
 

Modified: trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_event_system.c	2012-02-19 05:17:55 UTC (rev 44239)
+++ trunk/blender/source/blender/windowmanager/intern/wm_event_system.c	2012-02-19 06:00:20 UTC (rev 44240)
@@ -82,7 +82,8 @@
 #  include "RNA_enum_types.h"
 #endif
 
-static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA *properties, ReportList *reports, short context, short poll_only);
+static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA *properties, ReportList *reports,
+                                     short context, short poll_only);
 
 /* ************ event management ************** */
 
@@ -223,7 +224,9 @@
 				}
 			}
 
-			if(note->window==win || (note->window == NULL && (note->reference == NULL || note->reference == CTX_data_scene(C)))) {
+			if (note->window == win ||
+				(note->window == NULL && (note->reference == NULL || note->reference == CTX_data_scene(C))))
+			{
 				if(note->category==NC_SCENE) {
 					if(note->data==ND_FRAME)
 						do_anim= 1;
@@ -637,7 +640,8 @@
 
 static wmOperator *wm_operator_create(wmWindowManager *wm, wmOperatorType *ot, PointerRNA *properties, ReportList *reports)
 {
-	wmOperator *op= MEM_callocN(sizeof(wmOperator), ot->idname);	/* XXX operatortype names are static still. for debug */
+	/* XXX operatortype names are static still. for debug */
+	wmOperator *op= MEM_callocN(sizeof(wmOperator), ot->idname);
 	
 	/* XXX adding new operator could be function, only happens here now */
 	op->type= ot;
@@ -818,8 +822,10 @@
 			if(op->type->flag & OPTYPE_UNDO && CTX_wm_manager(C) == wm)
 				wm->op_undo_depth--;
 		}
-		else
-			printf("invalid operator call %s\n", ot->idname); /* debug, important to leave a while, should never happen */
+		else {
+			/* debug, important to leave a while, should never happen */
+			printf("invalid operator call '%s'\n", ot->idname);
+		}
 		
 		/* Note, if the report is given as an argument then assume the caller will deal with displaying them
 		 * currently python only uses this */
@@ -842,10 +848,13 @@
 				int wrap;
 
 				if (op->opm) {
-					wrap = (U.uiflag & USER_CONTINUOUS_MOUSE) && ((op->opm->flag & OP_GRAB_POINTER) || (op->opm->type->flag & OPTYPE_GRAB_POINTER));
-				} else {
-					wrap = (U.uiflag & USER_CONTINUOUS_MOUSE) && ((op->flag & OP_GRAB_POINTER) || (ot->flag & OPTYPE_GRAB_POINTER));
+					wrap = (U.uiflag & USER_CONTINUOUS_MOUSE) &&
+					       ((op->opm->flag & OP_GRAB_POINTER) || (op->opm->type->flag & OPTYPE_GRAB_POINTER));
 				}
+				else {
+					wrap = (U.uiflag & USER_CONTINUOUS_MOUSE) &&
+					       ((op->flag & OP_GRAB_POINTER) || (ot->flag & OPTYPE_GRAB_POINTER));
+				}
 
 				/* exception, cont. grab in header is annoying */
 				if(wrap) {
@@ -860,7 +869,9 @@
 					ARegion *ar= CTX_wm_region(C);
 					ScrArea *sa= CTX_wm_area(C);
 
-					if(ar && ar->regiontype == RGN_TYPE_WINDOW && event && BLI_in_rcti(&ar->winrct, event->x, event->y)) {
+					if (ar && ar->regiontype == RGN_TYPE_WINDOW && event &&
+					    BLI_in_rcti(&ar->winrct, event->x, event->y))
+					{
 						winrect= &ar->winrct;
 					}
 					else if(sa) {
@@ -895,7 +906,8 @@
  * this is for python to access since its done the operator lookup
  * 
  * invokes operator in context */
-static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA *properties, ReportList *reports, short context, short poll_only)
+static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, PointerRNA *properties, ReportList *reports,
+                                     short context, short poll_only)
 {
 	wmWindow *window= CTX_wm_window(C);
 	wmEvent *event;
@@ -1297,7 +1309,8 @@
 }
 
 /* Warning: this function removes a modal handler, when finished */
-static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHandler *handler, wmEvent *event, PointerRNA *properties)
+static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHandler *handler,
+                                    wmEvent *event, PointerRNA *properties)
 {
 	int retval= OPERATOR_PASS_THROUGH;
 	
@@ -1615,9 +1628,10 @@
 				if(!keymap->poll || keymap->poll(C)) {
 					for(kmi= keymap->items.first; kmi; kmi= kmi->next) {
 						if(wm_eventmatch(event, kmi)) {
-							
-							event->keymap_idname= kmi->idname;	/* weak, but allows interactive callback to not use rawkey */
-							
+
+							/* weak, but allows interactive callback to not use rawkey */
+							event->keymap_idname = kmi->idname;
+
 							action |= wm_handler_operator_call(C, handlers, handler, event, kmi->ptr);
 							if(action & WM_HANDLER_BREAK)  /* not always_pass here, it denotes removed handler */
 								break;
@@ -1716,7 +1730,8 @@
 			) {
 				event->val = KM_DBL_CLICK;
 				/* removed this because in cases where we're this is used as a single click
-				 * event, this will give old coords, since the distance is checked above, using new coords should be ok. */
+				 * event, this will give old coords,
+				 * since the distance is checked above, using new coords should be ok. */
 				//   event->x = win->eventstate->prevclickx;
 				//   event->y = win->eventstate->prevclicky;
 				action |= wm_handlers_do(C, event, handlers);
@@ -2233,7 +2248,8 @@
 	}
 }
 
-wmEventHandler *WM_event_add_ui_handler(const bContext *C, ListBase *handlers, wmUIHandlerFunc func, wmUIHandlerRemoveFunc remove, void *userdata)
+wmEventHandler *WM_event_add_ui_handler(const bContext *C, ListBase *handlers,
+                                        wmUIHandlerFunc func, wmUIHandlerRemoveFunc remove, void *userdata)
 {
 	wmEventHandler *handler= MEM_callocN(sizeof(wmEventHandler), "event ui handler");
 	handler->ui_handle= func;
@@ -2249,7 +2265,8 @@
 }
 
 /* set "postpone" for win->modalhandlers, this is in a running for() loop in wm_handlers_do() */
-void WM_event_remove_ui_handler(ListBase *handlers, wmUIHandlerFunc func, wmUIHandlerRemoveFunc remove, void *userdata, int postpone)
+void WM_event_remove_ui_handler(ListBase *handlers,
+                                wmUIHandlerFunc func, wmUIHandlerRemoveFunc remove, void *userdata, int postpone)
 {
 	wmEventHandler *handler;
 	
@@ -2629,7 +2646,9 @@
 		case GHOST_kEventButtonDown:
 		case GHOST_kEventButtonUp: {
 			GHOST_TEventButtonData *bd= customdata;
-			event.val= (type==GHOST_kEventButtonDown) ? KM_PRESS:KM_RELEASE; /* Note!, this starts as 0/1 but later is converted to KM_PRESS/KM_RELEASE by tweak */
+
+			/* Note!, this starts as 0/1 but later is converted to KM_PRESS/KM_RELEASE by tweak */
+			event.val= (type==GHOST_kEventButtonDown) ? KM_PRESS:KM_RELEASE;
 			
 			if (bd->button == GHOST_kButtonMaskLeft)
 				event.type= LEFTMOUSE;
@@ -2700,7 +2719,8 @@
 
 			if (event.utf8_buf[0]) {
 				if (BLI_str_utf8_size(event.utf8_buf) == -1) {
-					printf("%s: ghost detected an invalid unicode character '%d'!\n", __func__, (int)(unsigned char)event.utf8_buf[0]);
+					printf("%s: ghost detected an invalid unicode character '%d'!\n",
+					       __func__, (int)(unsigned char)event.utf8_buf[0]);
 					event.utf8_buf[0]= '\0';
 				}
 			}
@@ -2709,19 +2729,27 @@
 			/* assigning both first and second is strange - campbell */
 			switch(event.type) {
 			case LEFTSHIFTKEY: case RIGHTSHIFTKEY:
-				event.shift= evt->shift= (event.val==KM_PRESS) ? ((evt->ctrl || evt->alt || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) : FALSE;
+				event.shift = evt->shift = (event.val == KM_PRESS) ?
+						((evt->ctrl || evt->alt || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) :
+						FALSE;
 				break;
 			case LEFTCTRLKEY: case RIGHTCTRLKEY:
-				event.ctrl= evt->ctrl= (event.val==KM_PRESS) ? ((evt->shift || evt->alt || evt->oskey) ? (KM_MOD_FIRST | KM_MOD_SECOND) : KM_MOD_FIRST) : FALSE;

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list