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

rna_internal.h « intern « makesrna « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 90d2fdd88f990635b1ccaa1837afcfda581374a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/**
 * $Id$
 *
 * ***** 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Contributor(s): Blender Foundation (2008).
 *
 * ***** END GPL LICENSE BLOCK *****
 */

#ifndef RNA_INTERNAL_H
#define RNA_INTERNAL_H

struct StructRNA;
struct PropertyRNA;
struct SDNA;
struct ListBase;

/* Data structures used during define */

typedef struct PropertyDefRNA {
	struct PropertyDefRNA *next, *prev;

	struct StructRNA *srna;
	struct PropertyRNA *prop;

	const char *dnastructname;
	const char *dnaname;
	const char *dnalengthstructname;
	const char *dnalengthname;
	const char *dnatype;
	int dnaarraylength;

	int booleanbit;
} PropertyDefRNA;

typedef struct StructDefRNA {
	struct StructDefRNA *next, *prev;

	struct StructRNA *srna;

	const char *dnaname;
	ListBase properties;
} StructDefRNA;

typedef struct AllocDefRNA {
	struct AllocDefRNA *next, *prev;
	void *mem;
} AllocDefRNA;

typedef struct BlenderDefRNA {
	struct SDNA *sdna;
	ListBase structs;
	ListBase allocs;
	int error, silent;
} BlenderDefRNA;

extern BlenderDefRNA DefRNA;

/* Define functions for all types */

extern StructRNA RNA_Main;
extern StructRNA RNA_Mesh;
extern StructRNA RNA_Object;
extern StructRNA RNA_Scene;
extern StructRNA RNA_Struct;

void RNA_def_ID(struct StructRNA *srna);

void RNA_def_main(struct BlenderRNA *brna);
void RNA_def_mesh(struct BlenderRNA *brna);
void RNA_def_object(struct BlenderRNA *brna);
void RNA_def_rna(struct BlenderRNA *brna);
void RNA_def_scene(struct BlenderRNA *brna);

void rna_def_builtin_properties(struct StructRNA *srna);

/* Standard iterator functions */

void rna_iterator_listbase_begin(struct CollectionPropertyIterator *iter, struct ListBase *lb);
void rna_iterator_listbase_next(struct CollectionPropertyIterator *iter);
void *rna_iterator_listbase_get(struct CollectionPropertyIterator *iter);

typedef struct ArrayIterator {
	char *ptr;
	char *endptr;
	int itemsize;
} ArrayIterator;

void rna_iterator_array_begin(struct CollectionPropertyIterator *iter, void *ptr, int itemsize, int length);
void rna_iterator_array_next(struct CollectionPropertyIterator *iter);
void *rna_iterator_array_get(struct CollectionPropertyIterator *iter);
void rna_iterator_array_end(struct CollectionPropertyIterator *iter);

/* Duplicated code since we can't link in blenlib */

void rna_addtail(struct ListBase *listbase, void *vlink);
void rna_freelistN(struct ListBase *listbase);

#endif /* RNA_INTERNAL_H */