~ubuntu-branches/ubuntu/saucy/blender/saucy-proposed

« back to all changes in this revision

Viewing changes to source/blender/makesrna/RNA_types.h

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
 
81
81
/* also update rna_property_subtype_unit when you change this */
82
82
typedef enum PropertyUnit {
83
 
        PROP_UNIT_NONE = (0<<16),
84
 
        PROP_UNIT_LENGTH = (1<<16),                     /* m */
85
 
        PROP_UNIT_AREA = (2<<16),                       /* m^2 */
86
 
        PROP_UNIT_VOLUME = (3<<16),                     /* m^3 */
87
 
        PROP_UNIT_MASS = (4<<16),                       /* kg */
88
 
        PROP_UNIT_ROTATION = (5<<16),           /* radians */
89
 
        PROP_UNIT_TIME = (6<<16),                       /* frame */
90
 
        PROP_UNIT_VELOCITY = (7<<16),           /* m/s */
91
 
        PROP_UNIT_ACCELERATION = (8<<16)        /* m/(s^2) */
 
83
        PROP_UNIT_NONE = (0 << 16),
 
84
        PROP_UNIT_LENGTH = (1 << 16),         /* m */
 
85
        PROP_UNIT_AREA = (2 << 16),           /* m^2 */
 
86
        PROP_UNIT_VOLUME = (3 << 16),         /* m^3 */
 
87
        PROP_UNIT_MASS = (4 << 16),           /* kg */
 
88
        PROP_UNIT_ROTATION = (5 << 16),       /* radians */
 
89
        PROP_UNIT_TIME = (6 << 16),           /* frame */
 
90
        PROP_UNIT_VELOCITY = (7 << 16),       /* m/s */
 
91
        PROP_UNIT_ACCELERATION = (8 << 16)    /* m/(s^2) */
92
92
} PropertyUnit;
93
93
 
94
94
#define RNA_SUBTYPE_UNIT(subtype)       ((subtype) &  0x00FF0000)
110
110
        PROP_FILEPATH = 1,
111
111
        PROP_DIRPATH = 2,
112
112
        PROP_FILENAME = 3,
113
 
        PROP_BYTESTRING = 4, /* a string which should be represented as bytes
114
 
                              * in python, still NULL terminated though. */
115
 
        PROP_TRANSLATE = 5, /* a string which should be translated */
 
113
        PROP_BYTESTRING = 4, /* a string which should be represented as bytes in python, still NULL terminated though. */
 
114
        /* 5 was used by "PROP_TRANSLATE" sub-type, which is now a flag. */
 
115
        PROP_PASSWORD = 6, /* a string which should not be displayed in UI */
116
116
 
117
117
        /* numbers */
118
118
        PROP_UNSIGNED = 13,
119
119
        PROP_PERCENTAGE = 14,
120
120
        PROP_FACTOR = 15,
121
 
        PROP_ANGLE = 16|PROP_UNIT_ROTATION,
122
 
        PROP_TIME = 17|PROP_UNIT_TIME,
123
 
        PROP_DISTANCE = 18|PROP_UNIT_LENGTH,
 
121
        PROP_ANGLE = 16 | PROP_UNIT_ROTATION,
 
122
        PROP_TIME = 17 | PROP_UNIT_TIME,
 
123
        /* distance in 3d space, don't use for pixel distance for eg. */
 
124
        PROP_DISTANCE = 18 | PROP_UNIT_LENGTH,
124
125
 
125
126
        /* number arrays */
126
127
        PROP_COLOR = 20,
127
 
        PROP_TRANSLATION = 21|PROP_UNIT_LENGTH,
 
128
        PROP_TRANSLATION = 21 | PROP_UNIT_LENGTH,
128
129
        PROP_DIRECTION = 22,
129
 
        PROP_VELOCITY = 23|PROP_UNIT_VELOCITY,
130
 
        PROP_ACCELERATION = 24|PROP_UNIT_ACCELERATION,
 
130
        PROP_VELOCITY = 23 | PROP_UNIT_VELOCITY,
 
131
        PROP_ACCELERATION = 24 | PROP_UNIT_ACCELERATION,
131
132
        PROP_MATRIX = 25,
132
 
        PROP_EULER = 26|PROP_UNIT_ROTATION,
 
133
        PROP_EULER = 26 | PROP_UNIT_ROTATION,
133
134
        PROP_QUATERNION = 27,
134
135
        PROP_AXISANGLE = 28,
135
136
        PROP_XYZ = 29,
136
 
        PROP_XYZ_LENGTH = 29|PROP_UNIT_LENGTH,
137
 
        PROP_COLOR_GAMMA = 30,
 
137
        PROP_XYZ_LENGTH = 29 | PROP_UNIT_LENGTH,
 
138
        PROP_COLOR_GAMMA = 30, /* used for colors which would be color managed before display */
138
139
        PROP_COORDS = 31, /* generic array, no units applied, only that x/y/z/w are used (python vec) */
139
140
 
140
141
        /* booleans */
143
144
} PropertySubType;
144
145
 
145
146
/* Make sure enums are updated with thses */
 
147
/* HIGHEST FLAG IN USE: 1 << 28 */
146
148
typedef enum PropertyFlag {
147
149
        /* editable means the property is editable in the user
148
150
         * interface, properties are editable by default except
149
151
         * for pointers and collections. */
150
 
        PROP_EDITABLE = 1<<0,
 
152
        PROP_EDITABLE = (1 << 0),
151
153
 
152
154
        /* this property is editable even if it is lib linked,
153
155
         * meaning it will get lost on reload, but it's useful
154
156
         * for editing. */
155
 
        PROP_LIB_EXCEPTION = 1<<16,
 
157
        PROP_LIB_EXCEPTION = (1 << 16),
156
158
 
157
159
        /* animatable means the property can be driven by some
158
160
         * other input, be it animation curves, expressions, ..
159
161
         * properties are animatable by default except for pointers
160
162
         * and collections */
161
 
        PROP_ANIMATABLE = 1<<1,
 
163
        PROP_ANIMATABLE = (1 << 1),
162
164
 
163
165
        /* icon */
164
 
        PROP_ICONS_CONSECUTIVE = 1<<12,
 
166
        PROP_ICONS_CONSECUTIVE = (1 << 12),
165
167
 
166
168
        /* hidden in  the user interface */
167
 
        PROP_HIDDEN = 1<<19,
 
169
        PROP_HIDDEN = (1 << 19),
168
170
        /* do not write in presets */
169
 
        PROP_SKIP_SAVE = 1<<28,
 
171
        PROP_SKIP_SAVE = (1 << 28),
170
172
 
171
173
        /* function paramater flags */
172
 
        PROP_REQUIRED = 1<<2,
173
 
        PROP_OUTPUT = 1<<3,
174
 
        PROP_RNAPTR = 1<<11,
 
174
        PROP_REQUIRED = (1 << 2),
 
175
        PROP_OUTPUT = (1 << 3),
 
176
        PROP_RNAPTR = (1 << 11),
175
177
        /* registering */
176
 
        PROP_REGISTER = 1<<4,
177
 
        PROP_REGISTER_OPTIONAL = (1<<4)|(1<<5),
 
178
        PROP_REGISTER = (1 << 4),
 
179
        PROP_REGISTER_OPTIONAL = (1 << 4) | (1 << 5),
178
180
 
179
181
        /* pointers */
180
 
        PROP_ID_REFCOUNT = 1<<6,
 
182
        PROP_ID_REFCOUNT = (1 << 6),
181
183
 
182
184
        /* disallow assigning a variable to its self, eg an object tracking its self
183
185
         * only apply this to types that are derived from an ID ()*/
184
 
        PROP_ID_SELF_CHECK = 1<<20,
 
186
        PROP_ID_SELF_CHECK = (1 << 20),
185
187
        /* use for...
186
188
         * - pointers: in the UI and python so unsetting or setting to None won't work
187
189
         * - strings: so our internal generated get/length/set functions know to do NULL checks before access [#30865] */
188
 
        PROP_NEVER_NULL = 1<<18,
 
190
        PROP_NEVER_NULL = (1 << 18),
189
191
        /* currently only used for UI, this is similar to PROP_NEVER_NULL
190
192
         * except that the value may be NULL at times, used for ObData, where an Empty's will be NULL
191
193
         * but setting NULL on a mesh object is not possible. So, if its not NULL, setting NULL cant be done! */
192
 
        PROP_NEVER_UNLINK = 1<<25,
 
194
        PROP_NEVER_UNLINK = (1 << 25),
193
195
 
194
196
        /* flag contains multiple enums.
195
197
         * note: not to be confused with prop->enumbitflags
197
199
         *
198
200
         * note: these can't be animated so use with care.
199
201
         */
200
 
        PROP_ENUM_FLAG = 1<<21,
 
202
        PROP_ENUM_FLAG = (1 << 21),
201
203
 
202
204
        /* need context for update function */
203
 
        PROP_CONTEXT_UPDATE = 1<<22,
204
 
        PROP_CONTEXT_PROPERTY_UPDATE = (1<<22)|(1<<27),
 
205
        PROP_CONTEXT_UPDATE = (1 << 22),
 
206
        PROP_CONTEXT_PROPERTY_UPDATE = (1 << 22) | (1 << 27),
205
207
 
206
 
        /* Use for arrays or for any data that should not have a referene kept
 
208
        /* Use for arrays or for any data that should not have a reference kept
207
209
         * most common case is functions that return arrays where the array */
208
 
        PROP_THICK_WRAP = 1<<23,
 
210
        PROP_THICK_WRAP = (1 << 23),
209
211
 
210
212
        /* Reject values outside limits, use for python api only so far
211
213
         * this is for use when silently clamping string length will give
212
214
         * bad behavior later. Could also enforce this for INT's and other types.
213
215
         * note: currently no support for function arguments or non utf8 paths (filepaths) */
214
 
        PROP_NEVER_CLAMP = 1<<26,
 
216
        PROP_NEVER_CLAMP = (1 << 26),
215
217
 
216
218
        /* internal flags */
217
 
        PROP_BUILTIN = 1<<7,
218
 
        PROP_EXPORT = 1<<8,
219
 
        PROP_RUNTIME = 1<<9,
220
 
        PROP_IDPROPERTY = 1<<10,
221
 
        PROP_RAW_ACCESS = 1<<13,
222
 
        PROP_RAW_ARRAY = 1<<14,
223
 
        PROP_FREE_POINTERS = 1<<15,
224
 
        PROP_DYNAMIC = 1<<17, /* for dynamic arrays, and retvals of type string */
225
 
        PROP_ENUM_NO_CONTEXT = 1<<24 /* for enum that shouldn't be contextual */
 
219
        PROP_BUILTIN = (1 << 7),
 
220
        PROP_EXPORT = (1 << 8),
 
221
        PROP_RUNTIME = (1 << 9),
 
222
        PROP_IDPROPERTY = (1 << 10),
 
223
        PROP_RAW_ACCESS = (1 << 13),
 
224
        PROP_RAW_ARRAY = (1 << 14),
 
225
        PROP_FREE_POINTERS = (1 << 15),
 
226
        PROP_DYNAMIC = (1 << 17), /* for dynamic arrays, and retvals of type string */
 
227
        PROP_ENUM_NO_CONTEXT = (1 << 24) /* for enum that shouldn't be contextual */
226
228
} PropertyFlag;
227
229
 
228
230
typedef struct CollectionPropertyIterator {
245
247
} CollectionPointerLink;
246
248
 
247
249
typedef enum RawPropertyType {
248
 
        PROP_RAW_UNSET=-1,
 
250
        PROP_RAW_UNSET = -1,
249
251
        PROP_RAW_INT, // XXX - abused for types that are not set, eg. MFace.verts, needs fixing.
250
252
        PROP_RAW_SHORT,
251
253
        PROP_RAW_CHAR,
268
270
        const char *description;
269
271
} EnumPropertyItem;
270
272
 
271
 
/* this is a copy of 'PropEnumItemFunc' defined in rna_internal_types.h */
 
273
/* extended versions with PropertyRNA argument */
 
274
typedef int (*BooleanPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop);
 
275
typedef void (*BooleanPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, int value);
 
276
typedef void (*BooleanArrayPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, int *values);
 
277
typedef void (*BooleanArrayPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, const int *values);
 
278
typedef int (*IntPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop);
 
279
typedef void (*IntPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, int value);
 
280
typedef void (*IntArrayPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, int *values);
 
281
typedef void (*IntArrayPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, const int *values);
 
282
typedef void (*IntPropertyRangeFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, int *min, int *max, int *softmin, int *softmax);
 
283
typedef float (*FloatPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop);
 
284
typedef void (*FloatPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, float value);
 
285
typedef void (*FloatArrayPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, float *values);
 
286
typedef void (*FloatArrayPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, const float *values);
 
287
typedef void (*FloatPropertyRangeFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, float *min, float *max, float *softmin, float *softmax);
 
288
typedef void (*StringPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, char *value);
 
289
typedef int (*StringPropertyLengthFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop);
 
290
typedef void (*StringPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, const char *value);
 
291
typedef int (*EnumPropertyGetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop);
 
292
typedef void (*EnumPropertySetFunc)(struct PointerRNA *ptr, struct PropertyRNA *prop, int value);
 
293
/* same as PropEnumItemFunc */
272
294
typedef EnumPropertyItem *(*EnumPropertyItemFunc)(struct bContext *C, PointerRNA *ptr, struct PropertyRNA *prop, int *free);
273
295
 
274
296
typedef struct PropertyRNA PropertyRNA;
308
330
 
309
331
typedef enum FunctionFlag {
310
332
        FUNC_NO_SELF = 1, /* for static functions */
311
 
        FUNC_USE_MAIN = 2,
312
 
        FUNC_USE_CONTEXT = 4,
313
 
        FUNC_USE_REPORTS = 8,
 
333
        FUNC_USE_SELF_TYPE = 2, /* for class methods, only used when FUNC_NO_SELF is set */
 
334
        FUNC_USE_MAIN = 4,
 
335
        FUNC_USE_CONTEXT = 8,
 
336
        FUNC_USE_REPORTS = 16,
314
337
        FUNC_USE_SELF_ID = 2048,
 
338
        FUNC_ALLOW_WRITE = 4096,
315
339
 
316
340
        /* registering */
317
 
        FUNC_REGISTER = 16,
318
 
        FUNC_REGISTER_OPTIONAL = 16|32,
 
341
        FUNC_REGISTER = 32,
 
342
        FUNC_REGISTER_OPTIONAL = 32 | 64,
319
343
 
320
344
        /* internal flags */
321
345
        FUNC_BUILTIN = 128,