Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2008-12-31 16:16:37 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-12-31 16:16:37 +0300
commitba91587183105fb7edcab3d4f4e37ce0078bd86e (patch)
tree5c07e3461a6c1aaea30397c6d1bbc2e88b588dc9 /source/blender/blenkernel/BKE_idprop.h
parent28d0bab8ed913629fc02463156bb8fade7dfe886 (diff)
RNA
* Store RNA collections different in ID properties, using a generic ID property array, using the patch provided by Joe. * Fix bug accessing registered operator properties in the wm from the outliner. * In the outliner, only use the RNA icon for RNA data, and use dot again for unknown icon. * Also, show pointer properties data in the second column, and auto expand two levels when opening them. * Added small RNA_struct_defined_properties function to get only the defined properties without builtin and undefined id properties (for py operators).
Diffstat (limited to 'source/blender/blenkernel/BKE_idprop.h')
-rw-r--r--source/blender/blenkernel/BKE_idprop.h30
1 files changed, 23 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h
index 0021d531c85..4f57e1d6d14 100644
--- a/source/blender/blenkernel/BKE_idprop.h
+++ b/source/blender/blenkernel/BKE_idprop.h
@@ -49,7 +49,22 @@ typedef union {
} matrix_or_vector;
} IDPropertyTemplate;
-/* ----------- Array Type ----------- */
+/* ----------- Property Array Type ---------- */
+
+/*note: as a start to move away from the stupid IDP_New function, this type
+ has it's own allocation function.*/
+IDProperty *IDP_NewIDPArray(const char *name);
+IDProperty *IDP_CopyIDPArray(IDProperty *array);
+
+void IDP_FreeIDPArray(IDProperty *prop);
+
+/* shallow copies item */
+void IDP_SetIndexArray(struct IDProperty *prop, int index, struct IDProperty *item);
+struct IDProperty *IDP_GetIndexArray(struct IDProperty *prop, int index);
+struct IDProperty *IDP_AppendArray(struct IDProperty *prop, struct IDProperty *item);
+void IDP_ResizeIDPArray(struct IDProperty *prop, int len);
+
+/* ----------- Numeric Array Type ----------- */
/*this function works for strings too!*/
void IDP_ResizeArray(struct IDProperty *prop, int newlen);
void IDP_FreeArray(struct IDProperty *prop);
@@ -152,7 +167,7 @@ Note that you MUST either attach the id property to an id property group with
IDP_AddToGroup or MEM_freeN the property, doing anything else might result in
a memory leak.
*/
-struct IDProperty *IDP_New(int type, IDPropertyTemplate val, char *name);
+struct IDProperty *IDP_New(int type, IDPropertyTemplate val, const char *name);
\
/*NOTE: this will free all child properties of list arrays and groups!
Also, note that this does NOT unlink anything! Plus it doesn't free
@@ -162,10 +177,11 @@ void IDP_FreeProperty(struct IDProperty *prop);
/*Unlinks any struct IDProperty<->ID linkage that might be going on.*/
void IDP_UnlinkProperty(struct IDProperty *prop);
-#define IDP_Int(prop) (prop->data.val)
-#define IDP_Float(prop) (*(float*)&prop->data.val)
-#define IDP_String(prop) ((char*)prop->data.pointer)
-#define IDP_Array(prop) (prop->data.pointer)
-#define IDP_Double(prop) (*(double*)&prop->data.val)
+#define IDP_Int(prop) ((prop)->data.val)
+#define IDP_Float(prop) (*(float*)&(prop)->data.val)
+#define IDP_String(prop) ((char*)(prop)->data.pointer)
+#define IDP_Array(prop) ((prop)->data.pointer)
+#define IDP_IDPArray(prop) ((IDProperty*)(prop)->data.pointer)
+#define IDP_Double(prop) (*(double*)&(prop)->data.val)
#endif /* _BKE_IDPROP_H */