[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59662] trunk/blender/source/blender/ makesrna/RNA_types.h: Cleanup, bitflags as bitshift ops, and some formating ...

Bastien Montagne montagne29 at wanadoo.fr
Fri Aug 30 15:24:16 CEST 2013


Revision: 59662
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59662
Author:   mont29
Date:     2013-08-30 13:24:16 +0000 (Fri, 30 Aug 2013)
Log Message:
-----------
Cleanup, bitflags as bitshift ops, and some formating...

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/RNA_types.h

Modified: trunk/blender/source/blender/makesrna/RNA_types.h
===================================================================
--- trunk/blender/source/blender/makesrna/RNA_types.h	2013-08-30 12:48:39 UTC (rev 59661)
+++ trunk/blender/source/blender/makesrna/RNA_types.h	2013-08-30 13:24:16 UTC (rev 59662)
@@ -69,27 +69,27 @@
 /* Property */
 
 typedef enum PropertyType {
-	PROP_BOOLEAN = 0,
-	PROP_INT = 1,
-	PROP_FLOAT = 2,
-	PROP_STRING = 3,
-	PROP_ENUM = 4,
-	PROP_POINTER = 5,
-	PROP_COLLECTION = 6
+	PROP_BOOLEAN      = 0,
+	PROP_INT          = 1,
+	PROP_FLOAT        = 2,
+	PROP_STRING       = 3,
+	PROP_ENUM         = 4,
+	PROP_POINTER      = 5,
+	PROP_COLLECTION   = 6,
 } PropertyType;
 
 /* also update rna_property_subtype_unit when you change this */
 typedef enum PropertyUnit {
-	PROP_UNIT_NONE = (0 << 16),
-	PROP_UNIT_LENGTH = (1 << 16),         /* m */
-	PROP_UNIT_AREA = (2 << 16),           /* m^2 */
-	PROP_UNIT_VOLUME = (3 << 16),         /* m^3 */
-	PROP_UNIT_MASS = (4 << 16),           /* kg */
-	PROP_UNIT_ROTATION = (5 << 16),       /* radians */
-	PROP_UNIT_TIME = (6 << 16),           /* frame */
-	PROP_UNIT_VELOCITY = (7 << 16),       /* m/s */
+	PROP_UNIT_NONE         = (0 << 16),
+	PROP_UNIT_LENGTH       = (1 << 16),   /* m */
+	PROP_UNIT_AREA         = (2 << 16),   /* m^2 */
+	PROP_UNIT_VOLUME       = (3 << 16),   /* m^3 */
+	PROP_UNIT_MASS         = (4 << 16),   /* kg */
+	PROP_UNIT_ROTATION     = (5 << 16),   /* radians */
+	PROP_UNIT_TIME         = (6 << 16),   /* frame */
+	PROP_UNIT_VELOCITY     = (7 << 16),   /* m/s */
 	PROP_UNIT_ACCELERATION = (8 << 16),   /* m/(s^2) */
-	PROP_UNIT_CAMERA = (9 << 16)       /* mm */
+	PROP_UNIT_CAMERA       = (9 << 16),   /* mm */
 } PropertyUnit;
 
 #define RNA_SUBTYPE_UNIT(subtype)       ((subtype) &  0x00FF0000)
@@ -105,101 +105,101 @@
  * node socket button subtypes!
  */
 typedef enum PropertySubType {
-	PROP_NONE = 0,
+	PROP_NONE              = 0,
 
 	/* strings */
-	PROP_FILEPATH = 1,
-	PROP_DIRPATH = 2,
-	PROP_FILENAME = 3,
-	PROP_BYTESTRING = 4, /* a string which should be represented as bytes in python, still NULL terminated though. */
+	PROP_FILEPATH          = 1,
+	PROP_DIRPATH           = 2,
+	PROP_FILENAME          = 3,
+	PROP_BYTESTRING        = 4, /* a string which should be represented as bytes in python, NULL terminated though. */
 	/* 5 was used by "PROP_TRANSLATE" sub-type, which is now a flag. */
-	PROP_PASSWORD = 6, /* a string which should not be displayed in UI */
+	PROP_PASSWORD          = 6, /* a string which should not be displayed in UI */
 
 	/* numbers */
-	PROP_UNSIGNED = 13,
-	PROP_PERCENTAGE = 14,
-	PROP_FACTOR = 15,
-	PROP_ANGLE = 16 | PROP_UNIT_ROTATION,
-	PROP_TIME = 17 | PROP_UNIT_TIME,
+	PROP_UNSIGNED          = 13,
+	PROP_PERCENTAGE        = 14,
+	PROP_FACTOR            = 15,
+	PROP_ANGLE             = 16 | PROP_UNIT_ROTATION,
+	PROP_TIME              = 17 | PROP_UNIT_TIME,
 	/* distance in 3d space, don't use for pixel distance for eg. */
-	PROP_DISTANCE = 18 | PROP_UNIT_LENGTH,
-	PROP_DISTANCE_CAMERA = 19 | PROP_UNIT_CAMERA,
+	PROP_DISTANCE          = 18 | PROP_UNIT_LENGTH,
+	PROP_DISTANCE_CAMERA   = 19 | PROP_UNIT_CAMERA,
 
 	/* number arrays */
-	PROP_COLOR = 20,
-	PROP_TRANSLATION = 21 | PROP_UNIT_LENGTH,
-	PROP_DIRECTION = 22,
-	PROP_VELOCITY = 23 | PROP_UNIT_VELOCITY,
-	PROP_ACCELERATION = 24 | PROP_UNIT_ACCELERATION,
-	PROP_MATRIX = 25,
-	PROP_EULER = 26 | PROP_UNIT_ROTATION,
-	PROP_QUATERNION = 27,
-	PROP_AXISANGLE = 28,
-	PROP_XYZ = 29,
-	PROP_XYZ_LENGTH = 29 | PROP_UNIT_LENGTH,
-	PROP_COLOR_GAMMA = 30, /* used for colors which would be color managed before display */
-	PROP_COORDS = 31, /* generic array, no units applied, only that x/y/z/w are used (python vec) */
+	PROP_COLOR             = 20,
+	PROP_TRANSLATION       = 21 | PROP_UNIT_LENGTH,
+	PROP_DIRECTION         = 22,
+	PROP_VELOCITY          = 23 | PROP_UNIT_VELOCITY,
+	PROP_ACCELERATION      = 24 | PROP_UNIT_ACCELERATION,
+	PROP_MATRIX            = 25,
+	PROP_EULER             = 26 | PROP_UNIT_ROTATION,
+	PROP_QUATERNION        = 27,
+	PROP_AXISANGLE         = 28,
+	PROP_XYZ               = 29,
+	PROP_XYZ_LENGTH        = 29 | PROP_UNIT_LENGTH,
+	PROP_COLOR_GAMMA       = 30, /* used for colors which would be color managed before display */
+	PROP_COORDS            = 31, /* generic array, no units applied, only that x/y/z/w are used (python vec) */
 
 	/* booleans */
-	PROP_LAYER = 40,
-	PROP_LAYER_MEMBER = 41
+	PROP_LAYER             = 40,
+	PROP_LAYER_MEMBER      = 41,
 } PropertySubType;
 
-/* Make sure enums are updated with thses */
+/* Make sure enums are updated with these */
 /* HIGHEST FLAG IN USE: 1 << 30 */
 typedef enum PropertyFlag {
 	/* editable means the property is editable in the user
 	 * interface, properties are editable by default except
 	 * for pointers and collections. */
-	PROP_EDITABLE = (1 << 0),
+	PROP_EDITABLE                = (1 << 0),
 
 	/* this property is editable even if it is lib linked,
 	 * meaning it will get lost on reload, but it's useful
 	 * for editing. */
-	PROP_LIB_EXCEPTION = (1 << 16),
+	PROP_LIB_EXCEPTION           = (1 << 16),
 
 	/* animatable means the property can be driven by some
 	 * other input, be it animation curves, expressions, ..
 	 * properties are animatable by default except for pointers
 	 * and collections */
-	PROP_ANIMATABLE = (1 << 1),
+	PROP_ANIMATABLE              = (1 << 1),
 
 	/* icon */
-	PROP_ICONS_CONSECUTIVE = (1 << 12),
+	PROP_ICONS_CONSECUTIVE       = (1 << 12),
 
 	/* hidden in  the user interface */
-	PROP_HIDDEN = (1 << 19),
+	PROP_HIDDEN                  = (1 << 19),
 	/* do not write in presets */
-	PROP_SKIP_SAVE = (1 << 28),
+	PROP_SKIP_SAVE               = (1 << 28),
 
 	/* function parameter flags */
-	PROP_REQUIRED = (1 << 2),
-	PROP_OUTPUT = (1 << 3),
-	PROP_RNAPTR = (1 << 11),
+	PROP_REQUIRED                = (1 << 2),
+	PROP_OUTPUT                  = (1 << 3),
+	PROP_RNAPTR                  = (1 << 11),
 	/* This allows for non-breaking API updates, when adding non-critical new parameter to a callback function.
 	 * This way, old py code defining funcs without that parameter would still work.
 	 * WARNING: any parameter after the first PYFUNC_OPTIONAL one will be considered as optional!
 	 * NOTE: only for input parameters!
 	 */
-	PROP_PYFUNC_OPTIONAL = (1 << 30),
+	PROP_PYFUNC_OPTIONAL         = (1 << 30),
 	/* registering */
-	PROP_REGISTER = (1 << 4),
-	PROP_REGISTER_OPTIONAL = (1 << 4) | (1 << 5),
+	PROP_REGISTER                = (1 << 4),
+	PROP_REGISTER_OPTIONAL       = PROP_REGISTER | (1 << 5),
 
 	/* pointers */
-	PROP_ID_REFCOUNT = (1 << 6),
+	PROP_ID_REFCOUNT             = (1 << 6),
 
 	/* disallow assigning a variable to its self, eg an object tracking its self
 	 * only apply this to types that are derived from an ID ()*/
-	PROP_ID_SELF_CHECK = (1 << 20),
+	PROP_ID_SELF_CHECK           = (1 << 20),
 	/* use for...
 	 * - pointers: in the UI and python so unsetting or setting to None won't work
 	 * - strings: so our internal generated get/length/set functions know to do NULL checks before access [#30865] */
-	PROP_NEVER_NULL = (1 << 18),
+	PROP_NEVER_NULL              = (1 << 18),
 	/* currently only used for UI, this is similar to PROP_NEVER_NULL
 	 * except that the value may be NULL at times, used for ObData, where an Empty's will be NULL
 	 * but setting NULL on a mesh object is not possible. So, if its not NULL, setting NULL cant be done! */
-	PROP_NEVER_UNLINK = (1 << 25),
+	PROP_NEVER_UNLINK            = (1 << 25),
 
 	/* flag contains multiple enums.
 	 * note: not to be confused with prop->enumbitflags
@@ -207,33 +207,33 @@
 	 *
 	 * note: these can't be animated so use with care.
 	 */
-	PROP_ENUM_FLAG = (1 << 21),
+	PROP_ENUM_FLAG               = (1 << 21),
 
 	/* need context for update function */
-	PROP_CONTEXT_UPDATE = (1 << 22),
+	PROP_CONTEXT_UPDATE          = (1 << 22),
 	PROP_CONTEXT_PROPERTY_UPDATE = (1 << 22) | (1 << 27),
 
 	/* Use for arrays or for any data that should not have a reference kept
 	 * most common case is functions that return arrays where the array */
-	PROP_THICK_WRAP = (1 << 23),
+	PROP_THICK_WRAP              = (1 << 23),
 
 	/* Reject values outside limits, use for python api only so far
 	 * this is for use when silently clamping string length will give
 	 * bad behavior later. Could also enforce this for INT's and other types.
 	 * note: currently no support for function arguments or non utf8 paths (filepaths) */
-	PROP_NEVER_CLAMP = (1 << 26),
+	PROP_NEVER_CLAMP             = (1 << 26),
 
 	/* internal flags */
-	PROP_BUILTIN = (1 << 7),
-	PROP_EXPORT = (1 << 8),
-	PROP_RUNTIME = (1 << 9),
-	PROP_IDPROPERTY = (1 << 10),
-	PROP_RAW_ACCESS = (1 << 13),
-	PROP_RAW_ARRAY = (1 << 14),
-	PROP_FREE_POINTERS = (1 << 15),
-	PROP_DYNAMIC = (1 << 17), /* for dynamic arrays, and retvals of type string */
-	PROP_ENUM_NO_CONTEXT = (1 << 24), /* for enum that shouldn't be contextual */
-	PROP_ENUM_NO_TRANSLATE = (1 << 29), /* for enums that shouldn't be translated (e.g. renderlayers' names in nodes) */
+	PROP_BUILTIN                 = (1 << 7),
+	PROP_EXPORT                  = (1 << 8),
+	PROP_RUNTIME                 = (1 << 9),
+	PROP_IDPROPERTY              = (1 << 10),
+	PROP_RAW_ACCESS              = (1 << 13),
+	PROP_RAW_ARRAY               = (1 << 14),
+	PROP_FREE_POINTERS           = (1 << 15),
+	PROP_DYNAMIC                 = (1 << 17), /* for dynamic arrays, and retvals of type string */
+	PROP_ENUM_NO_CONTEXT         = (1 << 24), /* for enum that shouldn't be contextual */
+	PROP_ENUM_NO_TRANSLATE       = (1 << 29), /* for enums not to be translated (e.g. renderlayers' names in nodes) */
 } PropertyFlag;
 
 typedef struct CollectionPropertyIterator {
@@ -338,23 +338,23 @@
 /* Function */
 
 typedef enum FunctionFlag {
-	FUNC_NO_SELF = 1, /* for static functions */
-	FUNC_USE_SELF_TYPE = 2, /* for class methods, only used when FUNC_NO_SELF is set */
-	FUNC_USE_MAIN = 4,
-	FUNC_USE_CONTEXT = 8,
-	FUNC_USE_REPORTS = 16,
-	FUNC_USE_SELF_ID = 2048,
-	FUNC_ALLOW_WRITE = 4096,
+	FUNC_NO_SELF           = (1 << 0), /* for static functions */
+	FUNC_USE_SELF_TYPE     = (1 << 1), /* for class methods, only used when FUNC_NO_SELF is set */
+	FUNC_USE_MAIN          = (1 << 2),
+	FUNC_USE_CONTEXT       = (1 << 3),
+	FUNC_USE_REPORTS       = (1 << 4),
+	FUNC_USE_SELF_ID       = (1 << 11),
+	FUNC_ALLOW_WRITE       = (1 << 12),
 
 	/* registering */
-	FUNC_REGISTER = 32,
-	FUNC_REGISTER_OPTIONAL = 32 | 64,

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list