[Bf-blender-cvs] [d911287d91d] greasepencil-object: Revert whitespace edits in interface_utils.c

Joshua Leung noreply at git.blender.org
Fri Oct 6 06:07:05 CEST 2017


Commit: d911287d91de72b326b12423dd884b748e95f95f
Author: Joshua Leung
Date:   Fri Oct 6 16:55:36 2017 +1300
Branches: greasepencil-object
https://developer.blender.org/rBd911287d91de72b326b12423dd884b748e95f95f

Revert whitespace edits in interface_utils.c

These appear to be accidental, and are unrelated to the purpose of this branch.

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

M	source/blender/editors/interface/interface_utils.c

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

diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index 74a46cb4532..f0317087ddc 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -1,31 +1,31 @@
 /*
-* ***** BEGIN GPL LICENSE BLOCK *****
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software Foundation,
-* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* The Original Code is Copyright (C) 2009 Blender Foundation.
-* All rights reserved.
-*
-* Contributor(s): Blender Foundation
-*
-* ***** END GPL LICENSE BLOCK *****
-*/
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. 
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2009 Blender Foundation.
+ * All rights reserved.
+ * 
+ * Contributor(s): Blender Foundation
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
 
 /** \file blender/editors/interface/interface_utils.c
-*  \ingroup edinterface
-*/
+ *  \ingroup edinterface
+ */
 
 
 #include <stdio.h>
@@ -65,102 +65,102 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind
 	uiBut *but = NULL;
 
 	switch (RNA_property_type(prop)) {
-	case PROP_BOOLEAN:
-	{
-		int arraylen = RNA_property_array_length(ptr, prop);
-
-		if (arraylen && index == -1)
-			return NULL;
-
-		if (icon && name && name[0] == '\0')
-			but = uiDefIconButR_prop(block, UI_BTYPE_ICON_TOGGLE, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
-		else if (icon)
-			but = uiDefIconTextButR_prop(block, UI_BTYPE_ICON_TOGGLE, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
-		else
-			but = uiDefButR_prop(block, UI_BTYPE_CHECKBOX, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
-		break;
-	}
-	case PROP_INT:
-	case PROP_FLOAT:
-	{
-		int arraylen = RNA_property_array_length(ptr, prop);
+		case PROP_BOOLEAN:
+		{
+			int arraylen = RNA_property_array_length(ptr, prop);
 
-		if (arraylen && index == -1) {
-			if (ELEM(RNA_property_subtype(prop), PROP_COLOR, PROP_COLOR_GAMMA)) {
-				but = uiDefButR_prop(block, UI_BTYPE_COLOR, 0, name, x1, y1, x2, y2, ptr, prop, -1, 0, 0, -1, -1, NULL);
-			}
-			else {
+			if (arraylen && index == -1)
 				return NULL;
-			}
+			
+			if (icon && name && name[0] == '\0')
+				but = uiDefIconButR_prop(block, UI_BTYPE_ICON_TOGGLE, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+			else if (icon)
+				but = uiDefIconTextButR_prop(block, UI_BTYPE_ICON_TOGGLE, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+			else
+				but = uiDefButR_prop(block, UI_BTYPE_CHECKBOX, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+			break;
 		}
-		else if (RNA_property_subtype(prop) == PROP_PERCENTAGE || RNA_property_subtype(prop) == PROP_FACTOR)
-			but = uiDefButR_prop(block, UI_BTYPE_NUM_SLIDER, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
-		else
-			but = uiDefButR_prop(block, UI_BTYPE_NUM, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+		case PROP_INT:
+		case PROP_FLOAT:
+		{
+			int arraylen = RNA_property_array_length(ptr, prop);
+
+			if (arraylen && index == -1) {
+				if (ELEM(RNA_property_subtype(prop), PROP_COLOR, PROP_COLOR_GAMMA)) {
+					but = uiDefButR_prop(block, UI_BTYPE_COLOR, 0, name, x1, y1, x2, y2, ptr, prop, -1, 0, 0, -1, -1, NULL);
+				}
+				else {
+					return NULL;
+				}
+			}
+			else if (RNA_property_subtype(prop) == PROP_PERCENTAGE || RNA_property_subtype(prop) == PROP_FACTOR)
+				but = uiDefButR_prop(block, UI_BTYPE_NUM_SLIDER, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+			else
+				but = uiDefButR_prop(block, UI_BTYPE_NUM, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
 
-		if (RNA_property_flag(prop) & PROP_TEXTEDIT_UPDATE) {
-			UI_but_flag_enable(but, UI_BUT_TEXTEDIT_UPDATE);
+			if (RNA_property_flag(prop) & PROP_TEXTEDIT_UPDATE) {
+				UI_but_flag_enable(but, UI_BUT_TEXTEDIT_UPDATE);
+			}
+			break;
 		}
-		break;
-	}
-	case PROP_ENUM:
-		if (icon && name && name[0] == '\0')
-			but = uiDefIconButR_prop(block, UI_BTYPE_MENU, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
-		else if (icon)
-			but = uiDefIconTextButR_prop(block, UI_BTYPE_MENU, 0, icon, NULL, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
-		else
-			but = uiDefButR_prop(block, UI_BTYPE_MENU, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
-		break;
-	case PROP_STRING:
-		if (icon && name && name[0] == '\0')
-			but = uiDefIconButR_prop(block, UI_BTYPE_TEXT, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
-		else if (icon)
-			but = uiDefIconTextButR_prop(block, UI_BTYPE_TEXT, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
-		else
-			but = uiDefButR_prop(block, UI_BTYPE_TEXT, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+		case PROP_ENUM:
+			if (icon && name && name[0] == '\0')
+				but = uiDefIconButR_prop(block, UI_BTYPE_MENU, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+			else if (icon)
+				but = uiDefIconTextButR_prop(block, UI_BTYPE_MENU, 0, icon, NULL, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+			else
+				but = uiDefButR_prop(block, UI_BTYPE_MENU, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+			break;
+		case PROP_STRING:
+			if (icon && name && name[0] == '\0')
+				but = uiDefIconButR_prop(block, UI_BTYPE_TEXT, 0, icon, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+			else if (icon)
+				but = uiDefIconTextButR_prop(block, UI_BTYPE_TEXT, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+			else
+				but = uiDefButR_prop(block, UI_BTYPE_TEXT, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+
+			if (RNA_property_flag(prop) & PROP_TEXTEDIT_UPDATE) {
+				/* TEXTEDIT_UPDATE is usally used for search buttons. For these we also want
+				 * the 'x' icon to clear search string, so setting VALUE_CLEAR flag, too. */
+				UI_but_flag_enable(but, UI_BUT_TEXTEDIT_UPDATE | UI_BUT_VALUE_CLEAR);
+			}
+			break;
+		case PROP_POINTER:
+		{
+			if (icon == 0) {
+				PointerRNA pptr = RNA_property_pointer_get(ptr, prop);
+				icon = RNA_struct_ui_icon(pptr.type ? pptr.type : RNA_property_pointer_type(ptr, prop));
+			}
+			if (icon == ICON_DOT)
+				icon = 0;
 
-		if (RNA_property_flag(prop) & PROP_TEXTEDIT_UPDATE) {
-			/* TEXTEDIT_UPDATE is usally used for search buttons. For these we also want
-			* the 'x' icon to clear search string, so setting VALUE_CLEAR flag, too. */
-			UI_but_flag_enable(but, UI_BUT_TEXTEDIT_UPDATE | UI_BUT_VALUE_CLEAR);
+			but = uiDefIconTextButR_prop(block, UI_BTYPE_SEARCH_MENU, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
+			break;
 		}
-		break;
-	case PROP_POINTER:
-	{
-		if (icon == 0) {
-			PointerRNA pptr = RNA_property_pointer_get(ptr, prop);
-			icon = RNA_struct_ui_icon(pptr.type ? pptr.type : RNA_property_pointer_type(ptr, prop));
+		case PROP_COLLECTION:
+		{
+			char text[256];
+			BLI_snprintf(text, sizeof(text), IFACE_("%d items"), RNA_property_collection_length(ptr, prop));
+			but = uiDefBut(block, UI_BTYPE_LABEL, 0, text, x1, y1, x2, y2, NULL, 0, 0, 0, 0, NULL);
+			UI_but_flag_enable(but, UI_BUT_DISABLED);
+			break;
 		}
-		if (icon == ICON_DOT)
-			icon = 0;
-
-		but = uiDefIconTextButR_prop(block, UI_BTYPE_SEARCH_MENU, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL);
-		break;
-	}
-	case PROP_COLLECTION:
-	{
-		char text[256];
-		BLI_snprintf(text, sizeof(text), IFACE_("%d items"), RNA_property_collection_length(ptr, prop));
-		but = uiDefBut(block, UI_BTYPE_LABEL, 0, text, x1, y1, x2, y2, NULL, 0, 0, 0, 0, NULL);
-		UI_but_flag_enable(but, UI_BUT_DISABLED);
-		break;
-	}
-	default:
-		but = NULL;
-		break;
+		default:
+			but = NULL;
+			break;
 	}
 
 	return but;
 }
 
 /**
-* \a check_prop callback filters functions to avoid drawing certain properties,
-* in cases where PROP_HIDDEN flag can't be used for a property.
-*/
+ * \a check_prop callback filters functions to avoid drawing certain properties,
+ * in cases where PROP_HIDDEN flag can't be used for a property.
+ */
 int uiDefAutoButsRNA(
-	uiLayout *layout, PointerRNA *ptr,
-	bool(*check_prop)(PointerRNA *, PropertyRNA *),
-	const char label_align)
+        uiLayout *layout, PointerRNA *ptr,
+        bool (*check_prop)(PointerRNA *, PropertyRNA *),
+        const char label_align)
 {
 	uiLayout *split, *col;
 	int flag;
@@ -169,7 +169,7 @@ int uiDefAutoButsRNA(
 
 	assert(ELEM(label_align, '\0', 'H', 'V'));
 
-	RNA_STRUCT_BEGIN(ptr, prop)
+	RNA_STRUCT_BEGIN (ptr, prop)
 	{
 		flag = RNA_property_flag(prop);
 		if (flag & PROP_HIDDEN || (check_prop && check_prop(ptr, prop) == 0))
@@ -197,7 +197,7 @@ int uiDefAutoButsRNA(
 			}
 
 			/* may meed to add more cases here.
-			* don't override enum flag names */
+			 * don't override

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list