Cleanup: Rename ExtensionRNA variables from ext to rna_ext

Makes it more clear that code using this is related to the RNA
integration of a type.
Part of T74432.

Also ran clang-format on affected files.
This commit is contained in:
Julian Eisel 2020-04-03 18:24:08 +02:00
parent 70b061b4fd
commit 63922c5056
38 changed files with 345 additions and 342 deletions

View File

@ -33,7 +33,7 @@ typedef struct bAddonPrefType {
char idname[64]; // best keep the same size as BKE_ST_MAXNAME char idname[64]; // best keep the same size as BKE_ST_MAXNAME
/* RNA integration */ /* RNA integration */
ExtensionRNA ext; ExtensionRNA rna_ext;
} bAddonPrefType; } bAddonPrefType;
#else #else

View File

@ -37,7 +37,7 @@ typedef struct wmKeyConfigPrefType_Runtime {
char idname[64]; char idname[64];
/* RNA integration */ /* RNA integration */
ExtensionRNA ext; ExtensionRNA rna_ext;
} wmKeyConfigPrefType_Runtime; } wmKeyConfigPrefType_Runtime;
#else #else

View File

@ -268,7 +268,7 @@ typedef struct bNodeType {
NodeGPUExecFunction gpufunc; NodeGPUExecFunction gpufunc;
/* RNA integration */ /* RNA integration */
ExtensionRNA ext; ExtensionRNA rna_ext;
} bNodeType; } bNodeType;
/* nodetype->nclass, for add-menu and themes */ /* nodetype->nclass, for add-menu and themes */
@ -350,7 +350,7 @@ typedef struct bNodeTreeType {
void (*node_add_init)(struct bNodeTree *ntree, struct bNode *bnode); void (*node_add_init)(struct bNodeTree *ntree, struct bNode *bnode);
/* RNA integration */ /* RNA integration */
ExtensionRNA ext; ExtensionRNA rna_ext;
} bNodeTreeType; } bNodeTreeType;
/** \} */ /** \} */

View File

@ -233,7 +233,7 @@ typedef struct PanelType {
ListBase children; ListBase children;
/* RNA integration */ /* RNA integration */
ExtensionRNA ext; ExtensionRNA rna_ext;
} PanelType; } PanelType;
/* uilist types */ /* uilist types */
@ -271,7 +271,7 @@ typedef struct uiListType {
uiListFilterItemsFunc filter_items; uiListFilterItemsFunc filter_items;
/* RNA integration */ /* RNA integration */
ExtensionRNA ext; ExtensionRNA rna_ext;
} uiListType; } uiListType;
/* header types */ /* header types */
@ -288,7 +288,7 @@ typedef struct HeaderType {
void (*draw)(const struct bContext *C, struct Header *header); void (*draw)(const struct bContext *C, struct Header *header);
/* RNA integration */ /* RNA integration */
ExtensionRNA ext; ExtensionRNA rna_ext;
} HeaderType; } HeaderType;
typedef struct Header { typedef struct Header {
@ -313,7 +313,7 @@ typedef struct MenuType {
void (*draw)(const struct bContext *C, struct Menu *menu); void (*draw)(const struct bContext *C, struct Menu *menu);
/* RNA integration */ /* RNA integration */
ExtensionRNA ext; ExtensionRNA rna_ext;
} MenuType; } MenuType;
typedef struct Menu { typedef struct Menu {

View File

@ -3625,9 +3625,9 @@ void node_type_base(bNodeType *ntype, int type, const char *name, short nclass,
#define DefNode(Category, ID, DefFunc, EnumName, StructName, UIName, UIDesc) \ #define DefNode(Category, ID, DefFunc, EnumName, StructName, UIName, UIDesc) \
case ID: \ case ID: \
BLI_strncpy(ntype->idname, #Category #StructName, sizeof(ntype->idname)); \ BLI_strncpy(ntype->idname, #Category #StructName, sizeof(ntype->idname)); \
ntype->ext.srna = RNA_struct_find(#Category #StructName); \ ntype->rna_ext.srna = RNA_struct_find(#Category #StructName); \
BLI_assert(ntype->ext.srna != NULL); \ BLI_assert(ntype->rna_ext.srna != NULL); \
RNA_struct_blender_type_set(ntype->ext.srna, ntype); \ RNA_struct_blender_type_set(ntype->rna_ext.srna, ntype); \
break; break;
switch (type) { switch (type) {
@ -4142,8 +4142,8 @@ void free_nodesystem(void)
{ {
if (nodetypes_hash) { if (nodetypes_hash) {
NODE_TYPES_BEGIN (nt) { NODE_TYPES_BEGIN (nt) {
if (nt->ext.free) { if (nt->rna_ext.free) {
nt->ext.free(nt->ext.data); nt->rna_ext.free(nt->rna_ext.data);
} }
} }
NODE_TYPES_END; NODE_TYPES_END;
@ -4169,8 +4169,8 @@ void free_nodesystem(void)
if (nodetreetypes_hash) { if (nodetreetypes_hash) {
NODE_TREE_TYPES_BEGIN (nt) { NODE_TREE_TYPES_BEGIN (nt) {
if (nt->ext.free) { if (nt->rna_ext.free) {
nt->ext.free(nt->ext.data); nt->rna_ext.free(nt->rna_ext.data);
} }
} }
NODE_TREE_TYPES_END; NODE_TREE_TYPES_END;

View File

@ -104,16 +104,16 @@ static void spacetype_free(SpaceType *st)
BLI_freelistN(&art->drawcalls); BLI_freelistN(&art->drawcalls);
for (pt = art->paneltypes.first; pt; pt = pt->next) { for (pt = art->paneltypes.first; pt; pt = pt->next) {
if (pt->ext.free) { if (pt->rna_ext.free) {
pt->ext.free(pt->ext.data); pt->rna_ext.free(pt->rna_ext.data);
} }
BLI_freelistN(&pt->children); BLI_freelistN(&pt->children);
} }
for (ht = art->headertypes.first; ht; ht = ht->next) { for (ht = art->headertypes.first; ht; ht = ht->next) {
if (ht->ext.free) { if (ht->rna_ext.free) {
ht->ext.free(ht->ext.data); ht->rna_ext.free(ht->rna_ext.data);
} }
} }

View File

@ -646,8 +646,8 @@ void ANIM_keyingset_infos_exit(void)
next = ksi->next; next = ksi->next;
/* free extra RNA data, and remove from list */ /* free extra RNA data, and remove from list */
if (ksi->ext.free) { if (ksi->rna_ext.free) {
ksi->ext.free(ksi->ext.data); ksi->rna_ext.free(ksi->rna_ext.data);
} }
BLI_freelinkN(&keyingset_type_infos, ksi); BLI_freelinkN(&keyingset_type_infos, ksi);
} }

View File

@ -198,7 +198,7 @@ typedef struct KeyingSetInfo {
cbKeyingSet_Generate generate; cbKeyingSet_Generate generate;
/* RNA integration */ /* RNA integration */
struct ExtensionRNA ext; struct ExtensionRNA rna_ext;
} KeyingSetInfo; } KeyingSetInfo;
/* -------- */ /* -------- */

View File

@ -6607,8 +6607,8 @@ void UI_but_string_info_get(bContext *C, uiBut *but, ...)
} }
else { else {
/* Not all menus are from Python. */ /* Not all menus are from Python. */
if (mt->ext.srna) { if (mt->rna_ext.srna) {
const char *t = RNA_struct_ui_description(mt->ext.srna); const char *t = RNA_struct_ui_description(mt->rna_ext.srna);
if (t && t[0]) { if (t && t[0]) {
tmp = BLI_strdup(t); tmp = BLI_strdup(t);
} }
@ -6625,7 +6625,7 @@ void UI_but_string_info_get(bContext *C, uiBut *but, ...)
} }
else { else {
/* Not all panels are from Python. */ /* Not all panels are from Python. */
if (pt->ext.srna) { if (pt->rna_ext.srna) {
/* Panels don't yet have descriptions, this may be added. */ /* Panels don't yet have descriptions, this may be added. */
} }
} }
@ -6644,7 +6644,7 @@ void UI_but_string_info_get(bContext *C, uiBut *but, ...)
else if (ELEM(but->type, UI_BTYPE_MENU, UI_BTYPE_PULLDOWN)) { else if (ELEM(but->type, UI_BTYPE_MENU, UI_BTYPE_PULLDOWN)) {
MenuType *mt = UI_but_menutype_get(but); MenuType *mt = UI_but_menutype_get(but);
if (mt) { if (mt) {
_tmp = RNA_struct_translation_context(mt->ext.srna); _tmp = RNA_struct_translation_context(mt->rna_ext.srna);
} }
} }
if (BLT_is_default_context(_tmp)) { if (BLT_is_default_context(_tmp)) {

View File

@ -3133,7 +3133,7 @@ static void node_property_update_default(Main *bmain, Scene *UNUSED(scene), Poin
static void node_socket_template_properties_update(bNodeType *ntype, bNodeSocketTemplate *stemp) static void node_socket_template_properties_update(bNodeType *ntype, bNodeSocketTemplate *stemp)
{ {
StructRNA *srna = ntype->ext.srna; StructRNA *srna = ntype->rna_ext.srna;
PropertyRNA *prop = RNA_struct_type_find_property(srna, stemp->identifier); PropertyRNA *prop = RNA_struct_type_find_property(srna, stemp->identifier);
if (prop) { if (prop) {

View File

@ -92,7 +92,7 @@ static bool script_test_modal_operators(bContext *C)
wmEventHandler_Op *handler = (wmEventHandler_Op *)handler_base; wmEventHandler_Op *handler = (wmEventHandler_Op *)handler_base;
if (handler->op != NULL) { if (handler->op != NULL) {
wmOperatorType *ot = handler->op->type; wmOperatorType *ot = handler->op->type;
if (ot->ext.srna) { if (ot->rna_ext.srna) {
return true; return true;
} }
} }

View File

@ -76,7 +76,7 @@ void RNA_def_struct_identifier_no_struct_map(StructRNA *srna, const char *identi
void RNA_def_struct_identifier(BlenderRNA *brna, StructRNA *srna, const char *identifier); void RNA_def_struct_identifier(BlenderRNA *brna, StructRNA *srna, const char *identifier);
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description); void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description);
void RNA_def_struct_ui_icon(StructRNA *srna, int icon); void RNA_def_struct_ui_icon(StructRNA *srna, int icon);
void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *ext); void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *rna_ext);
void RNA_struct_free(BlenderRNA *brna, StructRNA *srna); void RNA_struct_free(BlenderRNA *brna, StructRNA *srna);
void RNA_def_struct_translation_context(StructRNA *srna, const char *context); void RNA_def_struct_translation_context(StructRNA *srna, const char *context);

View File

@ -194,7 +194,7 @@ static bool RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C)
void *ret; void *ret;
int ok; int ok;
RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr); RNA_pointer_create(NULL, ksi->rna_ext.srna, ksi, &ptr);
func = &rna_KeyingSetInfo_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */ func = &rna_KeyingSetInfo_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
@ -204,7 +204,7 @@ static bool RKS_POLL_rna_internal(KeyingSetInfo *ksi, bContext *C)
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
/* execute the function */ /* execute the function */
ksi->ext.call(C, &ptr, func, &list); ksi->rna_ext.call(C, &ptr, func, &list);
/* read the result */ /* read the result */
RNA_parameter_get_lookup(&list, "ok", &ret); RNA_parameter_get_lookup(&list, "ok", &ret);
@ -224,7 +224,7 @@ static void RKS_ITER_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr); RNA_pointer_create(NULL, ksi->rna_ext.srna, ksi, &ptr);
func = &rna_KeyingSetInfo_iterator_func; /* RNA_struct_find_function(&ptr, "poll"); */ func = &rna_KeyingSetInfo_iterator_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
@ -235,7 +235,7 @@ static void RKS_ITER_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks
RNA_parameter_set_lookup(&list, "ks", &ks); RNA_parameter_set_lookup(&list, "ks", &ks);
/* execute the function */ /* execute the function */
ksi->ext.call(C, &ptr, func, &list); ksi->rna_ext.call(C, &ptr, func, &list);
} }
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -249,7 +249,7 @@ static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks,
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, ksi->ext.srna, ksi, &ptr); RNA_pointer_create(NULL, ksi->rna_ext.srna, ksi, &ptr);
func = &rna_KeyingSetInfo_generate_func; /* RNA_struct_find_generate(&ptr, "poll"); */ func = &rna_KeyingSetInfo_generate_func; /* RNA_struct_find_generate(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
@ -261,7 +261,7 @@ static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks,
RNA_parameter_set_lookup(&list, "data", data); RNA_parameter_set_lookup(&list, "data", data);
/* execute the function */ /* execute the function */
ksi->ext.call(C, &ptr, func, &list); ksi->rna_ext.call(C, &ptr, func, &list);
} }
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -273,7 +273,7 @@ static void RKS_GEN_rna_internal(KeyingSetInfo *ksi, bContext *C, KeyingSet *ks,
static StructRNA *rna_KeyingSetInfo_refine(PointerRNA *ptr) static StructRNA *rna_KeyingSetInfo_refine(PointerRNA *ptr)
{ {
KeyingSetInfo *ksi = (KeyingSetInfo *)ptr->data; KeyingSetInfo *ksi = (KeyingSetInfo *)ptr->data;
return (ksi->ext.srna) ? ksi->ext.srna : &RNA_KeyingSetInfo; return (ksi->rna_ext.srna) ? ksi->rna_ext.srna : &RNA_KeyingSetInfo;
} }
static void rna_KeyingSetInfo_unregister(Main *bmain, StructRNA *type) static void rna_KeyingSetInfo_unregister(Main *bmain, StructRNA *type)
@ -285,7 +285,7 @@ static void rna_KeyingSetInfo_unregister(Main *bmain, StructRNA *type)
} }
/* free RNA data referencing this */ /* free RNA data referencing this */
RNA_struct_free_extension(type, &ksi->ext); RNA_struct_free_extension(type, &ksi->rna_ext);
RNA_struct_free(&BLENDER_RNA, type); RNA_struct_free(&BLENDER_RNA, type);
WM_main_add_notifier(NC_WINDOW, NULL); WM_main_add_notifier(NC_WINDOW, NULL);
@ -328,8 +328,8 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain,
/* check if we have registered this info before, and remove it */ /* check if we have registered this info before, and remove it */
ksi = ANIM_keyingset_info_find_name(dummyksi.idname); ksi = ANIM_keyingset_info_find_name(dummyksi.idname);
if (ksi && ksi->ext.srna) { if (ksi && ksi->rna_ext.srna) {
rna_KeyingSetInfo_unregister(bmain, ksi->ext.srna); rna_KeyingSetInfo_unregister(bmain, ksi->rna_ext.srna);
} }
/* create a new KeyingSetInfo type */ /* create a new KeyingSetInfo type */
@ -337,11 +337,11 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain,
memcpy(ksi, &dummyksi, sizeof(KeyingSetInfo)); memcpy(ksi, &dummyksi, sizeof(KeyingSetInfo));
/* set RNA-extensions info */ /* set RNA-extensions info */
ksi->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, ksi->idname, &RNA_KeyingSetInfo); ksi->rna_ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, ksi->idname, &RNA_KeyingSetInfo);
ksi->ext.data = data; ksi->rna_ext.data = data;
ksi->ext.call = call; ksi->rna_ext.call = call;
ksi->ext.free = free; ksi->rna_ext.free = free;
RNA_struct_blender_type_set(ksi->ext.srna, ksi); RNA_struct_blender_type_set(ksi->rna_ext.srna, ksi);
/* set callbacks */ /* set callbacks */
/* NOTE: we really should have all of these... */ /* NOTE: we really should have all of these... */
@ -355,7 +355,7 @@ static StructRNA *rna_KeyingSetInfo_register(Main *bmain,
WM_main_add_notifier(NC_WINDOW, NULL); WM_main_add_notifier(NC_WINDOW, NULL);
/* return the struct-rna added */ /* return the struct-rna added */
return ksi->ext.srna; return ksi->rna_ext.srna;
} }
/* ****************************** */ /* ****************************** */

View File

@ -760,10 +760,10 @@ void RNA_define_fallback_property_update(int noteflag, const char *updatefunc)
} }
#endif #endif
void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *ext) void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *rna_ext)
{ {
#ifdef RNA_RUNTIME #ifdef RNA_RUNTIME
ext->free(ext->data); /* decref's the PyObject that the srna owns */ rna_ext->free(rna_ext->data); /* decref's the PyObject that the srna owns */
RNA_struct_blender_type_set(srna, NULL); /* this gets accessed again - XXX fixme */ RNA_struct_blender_type_set(srna, NULL); /* this gets accessed again - XXX fixme */
/* NULL the srna's value so RNA_struct_free wont complain of a leak */ /* NULL the srna's value so RNA_struct_free wont complain of a leak */
@ -771,7 +771,7 @@ void RNA_struct_free_extension(StructRNA *srna, ExtensionRNA *ext)
#else #else
(void)srna; (void)srna;
(void)ext; (void)rna_ext;
#endif #endif
} }

View File

@ -681,8 +681,8 @@ static StructRNA *rna_NodeTree_refine(struct PointerRNA *ptr)
{ {
bNodeTree *ntree = (bNodeTree *)ptr->data; bNodeTree *ntree = (bNodeTree *)ptr->data;
if (ntree->typeinfo->ext.srna) { if (ntree->typeinfo->rna_ext.srna) {
return ntree->typeinfo->ext.srna; return ntree->typeinfo->rna_ext.srna;
} }
else { else {
return &RNA_NodeTree; return &RNA_NodeTree;
@ -699,12 +699,12 @@ static bool rna_NodeTree_poll(const bContext *C, bNodeTreeType *ntreetype)
void *ret; void *ret;
bool visible; bool visible;
RNA_pointer_create(NULL, ntreetype->ext.srna, NULL, &ptr); /* dummy */ RNA_pointer_create(NULL, ntreetype->rna_ext.srna, NULL, &ptr); /* dummy */
func = &rna_NodeTree_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */ func = &rna_NodeTree_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
ntreetype->ext.call((bContext *)C, &ptr, func, &list); ntreetype->rna_ext.call((bContext *)C, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret); RNA_parameter_get_lookup(&list, "visible", &ret);
visible = *(bool *)ret; visible = *(bool *)ret;
@ -726,7 +726,7 @@ static void rna_NodeTree_update_reg(bNodeTree *ntree)
func = &rna_NodeTree_update_func; /* RNA_struct_find_function(&ptr, "update"); */ func = &rna_NodeTree_update_func; /* RNA_struct_find_function(&ptr, "update"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
ntree->typeinfo->ext.call(NULL, &ptr, func, &list); ntree->typeinfo->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -741,13 +741,13 @@ static void rna_NodeTree_get_from_context(
FunctionRNA *func; FunctionRNA *func;
void *ret1, *ret2, *ret3; void *ret1, *ret2, *ret3;
RNA_pointer_create(NULL, ntreetype->ext.srna, NULL, &ptr); /* dummy */ RNA_pointer_create(NULL, ntreetype->rna_ext.srna, NULL, &ptr); /* dummy */
/* RNA_struct_find_function(&ptr, "get_from_context"); */ /* RNA_struct_find_function(&ptr, "get_from_context"); */
func = &rna_NodeTree_get_from_context_func; func = &rna_NodeTree_get_from_context_func;
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
ntreetype->ext.call((bContext *)C, &ptr, func, &list); ntreetype->rna_ext.call((bContext *)C, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "result_1", &ret1); RNA_parameter_get_lookup(&list, "result_1", &ret1);
RNA_parameter_get_lookup(&list, "result_2", &ret2); RNA_parameter_get_lookup(&list, "result_2", &ret2);
@ -767,7 +767,7 @@ static void rna_NodeTree_unregister(Main *UNUSED(bmain), StructRNA *type)
return; return;
} }
RNA_struct_free_extension(type, &nt->ext); RNA_struct_free_extension(type, &nt->rna_ext);
RNA_struct_free(&BLENDER_RNA, type); RNA_struct_free(&BLENDER_RNA, type);
ntreeTypeFreeLink(nt); ntreeTypeFreeLink(nt);
@ -812,7 +812,7 @@ static StructRNA *rna_NodeTree_register(Main *bmain,
/* check if we have registered this tree type before, and remove it */ /* check if we have registered this tree type before, and remove it */
nt = ntreeTypeFind(dummynt.idname); nt = ntreeTypeFind(dummynt.idname);
if (nt) { if (nt) {
rna_NodeTree_unregister(bmain, nt->ext.srna); rna_NodeTree_unregister(bmain, nt->rna_ext.srna);
} }
/* create a new node tree type */ /* create a new node tree type */
@ -821,14 +821,14 @@ static StructRNA *rna_NodeTree_register(Main *bmain,
nt->type = NTREE_CUSTOM; nt->type = NTREE_CUSTOM;
nt->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, nt->idname, &RNA_NodeTree); nt->rna_ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, nt->idname, &RNA_NodeTree);
nt->ext.data = data; nt->rna_ext.data = data;
nt->ext.call = call; nt->rna_ext.call = call;
nt->ext.free = free; nt->rna_ext.free = free;
RNA_struct_blender_type_set(nt->ext.srna, nt); RNA_struct_blender_type_set(nt->rna_ext.srna, nt);
RNA_def_struct_ui_text(nt->ext.srna, nt->ui_name, nt->ui_description); RNA_def_struct_ui_text(nt->rna_ext.srna, nt->ui_name, nt->ui_description);
RNA_def_struct_ui_icon(nt->ext.srna, nt->ui_icon); RNA_def_struct_ui_icon(nt->rna_ext.srna, nt->ui_icon);
nt->poll = (have_function[0]) ? rna_NodeTree_poll : NULL; nt->poll = (have_function[0]) ? rna_NodeTree_poll : NULL;
nt->update = (have_function[1]) ? rna_NodeTree_update_reg : NULL; nt->update = (have_function[1]) ? rna_NodeTree_update_reg : NULL;
@ -839,7 +839,7 @@ static StructRNA *rna_NodeTree_register(Main *bmain,
/* update while blender is running */ /* update while blender is running */
WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); WM_main_add_notifier(NC_NODE | NA_EDITED, NULL);
return nt->ext.srna; return nt->rna_ext.srna;
} }
static bool rna_NodeTree_check(bNodeTree *ntree, ReportList *reports) static bool rna_NodeTree_check(bNodeTree *ntree, ReportList *reports)
@ -1323,8 +1323,8 @@ static StructRNA *rna_Node_refine(struct PointerRNA *ptr)
{ {
bNode *node = (bNode *)ptr->data; bNode *node = (bNode *)ptr->data;
if (node->typeinfo->ext.srna) { if (node->typeinfo->rna_ext.srna) {
return node->typeinfo->ext.srna; return node->typeinfo->rna_ext.srna;
} }
else { else {
return ptr->type; return ptr->type;
@ -1380,12 +1380,12 @@ static bool rna_Node_poll(bNodeType *ntype, bNodeTree *ntree)
void *ret; void *ret;
bool visible; bool visible;
RNA_pointer_create(NULL, ntype->ext.srna, NULL, &ptr); /* dummy */ RNA_pointer_create(NULL, ntype->rna_ext.srna, NULL, &ptr); /* dummy */
func = &rna_Node_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */ func = &rna_Node_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "node_tree", &ntree); RNA_parameter_set_lookup(&list, "node_tree", &ntree);
ntype->ext.call(NULL, &ptr, func, &list); ntype->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret); RNA_parameter_get_lookup(&list, "visible", &ret);
visible = *(bool *)ret; visible = *(bool *)ret;
@ -1405,12 +1405,12 @@ static bool rna_Node_poll_instance(bNode *node, bNodeTree *ntree)
void *ret; void *ret;
bool visible; bool visible;
RNA_pointer_create(NULL, node->typeinfo->ext.srna, node, &ptr); /* dummy */ RNA_pointer_create(NULL, node->typeinfo->rna_ext.srna, node, &ptr); /* dummy */
func = &rna_Node_poll_instance_func; /* RNA_struct_find_function(&ptr, "poll_instance"); */ func = &rna_Node_poll_instance_func; /* RNA_struct_find_function(&ptr, "poll_instance"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "node_tree", &ntree); RNA_parameter_set_lookup(&list, "node_tree", &ntree);
node->typeinfo->ext.call(NULL, &ptr, func, &list); node->typeinfo->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret); RNA_parameter_get_lookup(&list, "visible", &ret);
visible = *(bool *)ret; visible = *(bool *)ret;
@ -1434,11 +1434,11 @@ static void rna_Node_update_reg(bNodeTree *ntree, bNode *node)
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create((ID *)ntree, node->typeinfo->ext.srna, node, &ptr); RNA_pointer_create((ID *)ntree, node->typeinfo->rna_ext.srna, node, &ptr);
func = &rna_Node_update_func; /* RNA_struct_find_function(&ptr, "update"); */ func = &rna_Node_update_func; /* RNA_struct_find_function(&ptr, "update"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
node->typeinfo->ext.call(NULL, &ptr, func, &list); node->typeinfo->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -1451,12 +1451,12 @@ static void rna_Node_insert_link(bNodeTree *ntree, bNode *node, bNodeLink *link)
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create((ID *)ntree, node->typeinfo->ext.srna, node, &ptr); RNA_pointer_create((ID *)ntree, node->typeinfo->rna_ext.srna, node, &ptr);
func = &rna_Node_insert_link_func; func = &rna_Node_insert_link_func;
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "link", &link); RNA_parameter_set_lookup(&list, "link", &link);
node->typeinfo->ext.call(NULL, &ptr, func, &list); node->typeinfo->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -1472,7 +1472,7 @@ static void rna_Node_init(const bContext *C, PointerRNA *ptr)
func = &rna_Node_init_func; /* RNA_struct_find_function(&ptr, "init"); */ func = &rna_Node_init_func; /* RNA_struct_find_function(&ptr, "init"); */
RNA_parameter_list_create(&list, ptr, func); RNA_parameter_list_create(&list, ptr, func);
node->typeinfo->ext.call((bContext *)C, ptr, func, &list); node->typeinfo->rna_ext.call((bContext *)C, ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -1489,7 +1489,7 @@ static void rna_Node_copy(PointerRNA *ptr, const struct bNode *copynode)
RNA_parameter_list_create(&list, ptr, func); RNA_parameter_list_create(&list, ptr, func);
RNA_parameter_set_lookup(&list, "node", &copynode); RNA_parameter_set_lookup(&list, "node", &copynode);
node->typeinfo->ext.call(NULL, ptr, func, &list); node->typeinfo->rna_ext.call(NULL, ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -1505,7 +1505,7 @@ static void rna_Node_free(PointerRNA *ptr)
func = &rna_Node_free_func; /* RNA_struct_find_function(&ptr, "free"); */ func = &rna_Node_free_func; /* RNA_struct_find_function(&ptr, "free"); */
RNA_parameter_list_create(&list, ptr, func); RNA_parameter_list_create(&list, ptr, func);
node->typeinfo->ext.call(NULL, ptr, func, &list); node->typeinfo->rna_ext.call(NULL, ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -1523,7 +1523,7 @@ static void rna_Node_draw_buttons(struct uiLayout *layout, bContext *C, PointerR
RNA_parameter_list_create(&list, ptr, func); RNA_parameter_list_create(&list, ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
RNA_parameter_set_lookup(&list, "layout", &layout); RNA_parameter_set_lookup(&list, "layout", &layout);
node->typeinfo->ext.call(C, ptr, func, &list); node->typeinfo->rna_ext.call(C, ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -1541,7 +1541,7 @@ static void rna_Node_draw_buttons_ext(struct uiLayout *layout, bContext *C, Poin
RNA_parameter_list_create(&list, ptr, func); RNA_parameter_list_create(&list, ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
RNA_parameter_set_lookup(&list, "layout", &layout); RNA_parameter_set_lookup(&list, "layout", &layout);
node->typeinfo->ext.call(C, ptr, func, &list); node->typeinfo->rna_ext.call(C, ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -1560,7 +1560,7 @@ static void rna_Node_draw_label(bNodeTree *ntree, bNode *node, char *label, int
RNA_pointer_create(&ntree->id, &RNA_Node, node, &ptr); RNA_pointer_create(&ntree->id, &RNA_Node, node, &ptr);
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
node->typeinfo->ext.call(NULL, &ptr, func, &list); node->typeinfo->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "label", &ret); RNA_parameter_get_lookup(&list, "label", &ret);
rlabel = (char *)ret; rlabel = (char *)ret;
@ -1591,7 +1591,7 @@ static void rna_Node_unregister(Main *UNUSED(bmain), StructRNA *type)
return; return;
} }
RNA_struct_free_extension(type, &nt->ext); RNA_struct_free_extension(type, &nt->rna_ext);
RNA_struct_free(&BLENDER_RNA, type); RNA_struct_free(&BLENDER_RNA, type);
/* this also frees the allocated nt pointer, no MEM_free call needed! */ /* this also frees the allocated nt pointer, no MEM_free call needed! */
@ -1646,7 +1646,7 @@ static bNodeType *rna_Node_register_base(Main *bmain,
/* check if we have registered this node type before, and remove it */ /* check if we have registered this node type before, and remove it */
nt = nodeTypeFind(dummynt.idname); nt = nodeTypeFind(dummynt.idname);
if (nt) { if (nt) {
rna_Node_unregister(bmain, nt->ext.srna); rna_Node_unregister(bmain, nt->rna_ext.srna);
} }
/* create a new node type */ /* create a new node type */
@ -1654,17 +1654,17 @@ static bNodeType *rna_Node_register_base(Main *bmain,
memcpy(nt, &dummynt, sizeof(dummynt)); memcpy(nt, &dummynt, sizeof(dummynt));
nt->free_self = (void (*)(bNodeType *))MEM_freeN; nt->free_self = (void (*)(bNodeType *))MEM_freeN;
nt->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, nt->idname, basetype); nt->rna_ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, nt->idname, basetype);
nt->ext.data = data; nt->rna_ext.data = data;
nt->ext.call = call; nt->rna_ext.call = call;
nt->ext.free = free; nt->rna_ext.free = free;
RNA_struct_blender_type_set(nt->ext.srna, nt); RNA_struct_blender_type_set(nt->rna_ext.srna, nt);
RNA_def_struct_ui_text(nt->ext.srna, nt->ui_name, nt->ui_description); RNA_def_struct_ui_text(nt->rna_ext.srna, nt->ui_name, nt->ui_description);
RNA_def_struct_ui_icon(nt->ext.srna, nt->ui_icon); RNA_def_struct_ui_icon(nt->rna_ext.srna, nt->ui_icon);
func = RNA_def_function_runtime( func = RNA_def_function_runtime(
nt->ext.srna, "is_registered_node_type", rna_Node_is_registered_node_type_runtime); nt->rna_ext.srna, "is_registered_node_type", rna_Node_is_registered_node_type_runtime);
RNA_def_function_ui_description(func, "True if a registered node type"); RNA_def_function_ui_description(func, "True if a registered node type");
RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_SELF_TYPE); RNA_def_function_flag(func, FUNC_NO_SELF | FUNC_USE_SELF_TYPE);
parm = RNA_def_boolean(func, "result", false, "Result", ""); parm = RNA_def_boolean(func, "result", false, "Result", "");
@ -1716,7 +1716,7 @@ static StructRNA *rna_Node_register(Main *bmain,
/* update while blender is running */ /* update while blender is running */
WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); WM_main_add_notifier(NC_NODE | NA_EDITED, NULL);
return nt->ext.srna; return nt->rna_ext.srna;
} }
static StructRNA *rna_ShaderNode_register(Main *bmain, static StructRNA *rna_ShaderNode_register(Main *bmain,
@ -1738,7 +1738,7 @@ static StructRNA *rna_ShaderNode_register(Main *bmain,
/* update while blender is running */ /* update while blender is running */
WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); WM_main_add_notifier(NC_NODE | NA_EDITED, NULL);
return nt->ext.srna; return nt->rna_ext.srna;
} }
static StructRNA *rna_CompositorNode_register(Main *bmain, static StructRNA *rna_CompositorNode_register(Main *bmain,
@ -1760,7 +1760,7 @@ static StructRNA *rna_CompositorNode_register(Main *bmain,
/* update while blender is running */ /* update while blender is running */
WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); WM_main_add_notifier(NC_NODE | NA_EDITED, NULL);
return nt->ext.srna; return nt->rna_ext.srna;
} }
static StructRNA *rna_TextureNode_register(Main *bmain, static StructRNA *rna_TextureNode_register(Main *bmain,
@ -1782,7 +1782,7 @@ static StructRNA *rna_TextureNode_register(Main *bmain,
/* update while blender is running */ /* update while blender is running */
WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); WM_main_add_notifier(NC_NODE | NA_EDITED, NULL);
return nt->ext.srna; return nt->rna_ext.srna;
} }
static IDProperty *rna_Node_idprops(PointerRNA *ptr, bool create) static IDProperty *rna_Node_idprops(PointerRNA *ptr, bool create)
@ -2845,7 +2845,7 @@ static StructRNA *rna_NodeCustomGroup_register(Main *bmain,
/* update while blender is running */ /* update while blender is running */
WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); WM_main_add_notifier(NC_NODE | NA_EDITED, NULL);
return nt->ext.srna; return nt->rna_ext.srna;
} }
static StructRNA *rna_ShaderNodeCustomGroup_register(Main *bmain, static StructRNA *rna_ShaderNodeCustomGroup_register(Main *bmain,
@ -2872,7 +2872,7 @@ static StructRNA *rna_ShaderNodeCustomGroup_register(Main *bmain,
WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); WM_main_add_notifier(NC_NODE | NA_EDITED, NULL);
return nt->ext.srna; return nt->rna_ext.srna;
} }
static StructRNA *rna_CompositorNodeCustomGroup_register(Main *bmain, static StructRNA *rna_CompositorNodeCustomGroup_register(Main *bmain,
@ -2898,7 +2898,7 @@ static StructRNA *rna_CompositorNodeCustomGroup_register(Main *bmain,
WM_main_add_notifier(NC_NODE | NA_EDITED, NULL); WM_main_add_notifier(NC_NODE | NA_EDITED, NULL);
return nt->ext.srna; return nt->rna_ext.srna;
} }
static void rna_CompositorNode_tag_need_exec(bNode *node) static void rna_CompositorNode_tag_need_exec(bNode *node)

View File

@ -148,13 +148,13 @@ static void engine_update(RenderEngine *engine, Main *bmain, Depsgraph *depsgrap
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr); RNA_pointer_create(NULL, engine->type->rna_ext.srna, engine, &ptr);
func = &rna_RenderEngine_update_func; func = &rna_RenderEngine_update_func;
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "data", &bmain); RNA_parameter_set_lookup(&list, "data", &bmain);
RNA_parameter_set_lookup(&list, "depsgraph", &depsgraph); RNA_parameter_set_lookup(&list, "depsgraph", &depsgraph);
engine->type->ext.call(NULL, &ptr, func, &list); engine->type->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -166,12 +166,12 @@ static void engine_render(RenderEngine *engine, Depsgraph *depsgraph)
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr); RNA_pointer_create(NULL, engine->type->rna_ext.srna, engine, &ptr);
func = &rna_RenderEngine_render_func; func = &rna_RenderEngine_render_func;
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "depsgraph", &depsgraph); RNA_parameter_set_lookup(&list, "depsgraph", &depsgraph);
engine->type->ext.call(NULL, &ptr, func, &list); engine->type->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -192,7 +192,7 @@ static void engine_bake(RenderEngine *engine,
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr); RNA_pointer_create(NULL, engine->type->rna_ext.srna, engine, &ptr);
func = &rna_RenderEngine_bake_func; func = &rna_RenderEngine_bake_func;
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
@ -205,7 +205,7 @@ static void engine_bake(RenderEngine *engine,
RNA_parameter_set_lookup(&list, "num_pixels", &num_pixels); RNA_parameter_set_lookup(&list, "num_pixels", &num_pixels);
RNA_parameter_set_lookup(&list, "depth", &depth); RNA_parameter_set_lookup(&list, "depth", &depth);
RNA_parameter_set_lookup(&list, "result", &result); RNA_parameter_set_lookup(&list, "result", &result);
engine->type->ext.call(NULL, &ptr, func, &list); engine->type->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -219,13 +219,13 @@ static void engine_view_update(RenderEngine *engine,
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr); RNA_pointer_create(NULL, engine->type->rna_ext.srna, engine, &ptr);
func = &rna_RenderEngine_view_update_func; func = &rna_RenderEngine_view_update_func;
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &context); RNA_parameter_set_lookup(&list, "context", &context);
RNA_parameter_set_lookup(&list, "depsgraph", &depsgraph); RNA_parameter_set_lookup(&list, "depsgraph", &depsgraph);
engine->type->ext.call(NULL, &ptr, func, &list); engine->type->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -239,13 +239,13 @@ static void engine_view_draw(RenderEngine *engine,
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr); RNA_pointer_create(NULL, engine->type->rna_ext.srna, engine, &ptr);
func = &rna_RenderEngine_view_draw_func; func = &rna_RenderEngine_view_draw_func;
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &context); RNA_parameter_set_lookup(&list, "context", &context);
RNA_parameter_set_lookup(&list, "depsgraph", &depsgraph); RNA_parameter_set_lookup(&list, "depsgraph", &depsgraph);
engine->type->ext.call(NULL, &ptr, func, &list); engine->type->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -259,13 +259,13 @@ static void engine_update_script_node(RenderEngine *engine,
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr); RNA_pointer_create(NULL, engine->type->rna_ext.srna, engine, &ptr);
RNA_pointer_create((ID *)ntree, &RNA_Node, node, &nodeptr); RNA_pointer_create((ID *)ntree, &RNA_Node, node, &nodeptr);
func = &rna_RenderEngine_update_script_node_func; func = &rna_RenderEngine_update_script_node_func;
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "node", &nodeptr); RNA_parameter_set_lookup(&list, "node", &nodeptr);
engine->type->ext.call(NULL, &ptr, func, &list); engine->type->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -279,13 +279,13 @@ static void engine_update_render_passes(RenderEngine *engine,
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, engine->type->ext.srna, engine, &ptr); RNA_pointer_create(NULL, engine->type->rna_ext.srna, engine, &ptr);
func = &rna_RenderEngine_update_render_passes_func; func = &rna_RenderEngine_update_render_passes_func;
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "scene", &scene); RNA_parameter_set_lookup(&list, "scene", &scene);
RNA_parameter_set_lookup(&list, "renderlayer", &view_layer); RNA_parameter_set_lookup(&list, "renderlayer", &view_layer);
engine->type->ext.call(NULL, &ptr, func, &list); engine->type->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -300,7 +300,7 @@ static void rna_RenderEngine_unregister(Main *bmain, StructRNA *type)
return; return;
} }
RNA_struct_free_extension(type, &et->ext); RNA_struct_free_extension(type, &et->rna_ext);
RNA_struct_free(&BLENDER_RNA, type); RNA_struct_free(&BLENDER_RNA, type);
BLI_freelinkN(&R_engines, et); BLI_freelinkN(&R_engines, et);
@ -343,8 +343,8 @@ static StructRNA *rna_RenderEngine_register(Main *bmain,
/* check if we have registered this engine type before, and remove it */ /* check if we have registered this engine type before, and remove it */
for (et = R_engines.first; et; et = et->next) { for (et = R_engines.first; et; et = et->next) {
if (STREQ(et->idname, dummyet.idname)) { if (STREQ(et->idname, dummyet.idname)) {
if (et->ext.srna) { if (et->rna_ext.srna) {
rna_RenderEngine_unregister(bmain, et->ext.srna); rna_RenderEngine_unregister(bmain, et->rna_ext.srna);
} }
break; break;
} }
@ -354,11 +354,11 @@ static StructRNA *rna_RenderEngine_register(Main *bmain,
et = MEM_mallocN(sizeof(RenderEngineType), "python render engine"); et = MEM_mallocN(sizeof(RenderEngineType), "python render engine");
memcpy(et, &dummyet, sizeof(dummyet)); memcpy(et, &dummyet, sizeof(dummyet));
et->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, et->idname, &RNA_RenderEngine); et->rna_ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, et->idname, &RNA_RenderEngine);
et->ext.data = data; et->rna_ext.data = data;
et->ext.call = call; et->rna_ext.call = call;
et->ext.free = free; et->rna_ext.free = free;
RNA_struct_blender_type_set(et->ext.srna, et); RNA_struct_blender_type_set(et->rna_ext.srna, et);
et->update = (have_function[0]) ? engine_update : NULL; et->update = (have_function[0]) ? engine_update : NULL;
et->render = (have_function[1]) ? engine_render : NULL; et->render = (have_function[1]) ? engine_render : NULL;
@ -370,7 +370,7 @@ static StructRNA *rna_RenderEngine_register(Main *bmain,
RE_engines_register(et); RE_engines_register(et);
return et->ext.srna; return et->rna_ext.srna;
} }
static void **rna_RenderEngine_instance(PointerRNA *ptr) static void **rna_RenderEngine_instance(PointerRNA *ptr)
@ -382,7 +382,8 @@ static void **rna_RenderEngine_instance(PointerRNA *ptr)
static StructRNA *rna_RenderEngine_refine(PointerRNA *ptr) static StructRNA *rna_RenderEngine_refine(PointerRNA *ptr)
{ {
RenderEngine *engine = (RenderEngine *)ptr->data; RenderEngine *engine = (RenderEngine *)ptr->data;
return (engine->type && engine->type->ext.srna) ? engine->type->ext.srna : &RNA_RenderEngine; return (engine->type && engine->type->rna_ext.srna) ? engine->type->rna_ext.srna :
&RNA_RenderEngine;
} }
static PointerRNA rna_RenderEngine_render_get(PointerRNA *ptr) static PointerRNA rna_RenderEngine_render_get(PointerRNA *ptr)

View File

@ -111,12 +111,12 @@ static bool panel_poll(const bContext *C, PanelType *pt)
void *ret; void *ret;
bool visible; bool visible;
RNA_pointer_create(NULL, pt->ext.srna, NULL, &ptr); /* dummy */ RNA_pointer_create(NULL, pt->rna_ext.srna, NULL, &ptr); /* dummy */
func = &rna_Panel_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */ func = &rna_Panel_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
pt->ext.call((bContext *)C, &ptr, func, &list); pt->rna_ext.call((bContext *)C, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret); RNA_parameter_get_lookup(&list, "visible", &ret);
visible = *(bool *)ret; visible = *(bool *)ret;
@ -134,12 +134,12 @@ static void panel_draw(const bContext *C, Panel *pnl)
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, pnl->type->ext.srna, pnl, &ptr); RNA_pointer_create(&CTX_wm_screen(C)->id, pnl->type->rna_ext.srna, pnl, &ptr);
func = &rna_Panel_draw_func; /* RNA_struct_find_function(&ptr, "draw"); */ func = &rna_Panel_draw_func; /* RNA_struct_find_function(&ptr, "draw"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
pnl->type->ext.call((bContext *)C, &ptr, func, &list); pnl->type->rna_ext.call((bContext *)C, &ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -152,12 +152,12 @@ static void panel_draw_header(const bContext *C, Panel *pnl)
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, pnl->type->ext.srna, pnl, &ptr); RNA_pointer_create(&CTX_wm_screen(C)->id, pnl->type->rna_ext.srna, pnl, &ptr);
func = &rna_Panel_draw_header_func; /* RNA_struct_find_function(&ptr, "draw_header"); */ func = &rna_Panel_draw_header_func; /* RNA_struct_find_function(&ptr, "draw_header"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
pnl->type->ext.call((bContext *)C, &ptr, func, &list); pnl->type->rna_ext.call((bContext *)C, &ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -170,12 +170,12 @@ static void panel_draw_header_preset(const bContext *C, Panel *pnl)
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, pnl->type->ext.srna, pnl, &ptr); RNA_pointer_create(&CTX_wm_screen(C)->id, pnl->type->rna_ext.srna, pnl, &ptr);
func = &rna_Panel_draw_header_preset_func; func = &rna_Panel_draw_header_preset_func;
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
pnl->type->ext.call((bContext *)C, &ptr, func, &list); pnl->type->rna_ext.call((bContext *)C, &ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -192,7 +192,7 @@ static void rna_Panel_unregister(Main *bmain, StructRNA *type)
return; return;
} }
RNA_struct_free_extension(type, &pt->ext); RNA_struct_free_extension(type, &pt->rna_ext);
RNA_struct_free(&BLENDER_RNA, type); RNA_struct_free(&BLENDER_RNA, type);
if (pt->parent) { if (pt->parent) {
@ -301,8 +301,8 @@ static StructRNA *rna_Panel_register(Main *bmain,
for (pt = art->paneltypes.first; pt; pt = pt->next) { for (pt = art->paneltypes.first; pt; pt = pt->next) {
if (STREQ(pt->idname, dummypt.idname)) { if (STREQ(pt->idname, dummypt.idname)) {
PanelType *pt_next = pt->next; PanelType *pt_next = pt->next;
if (pt->ext.srna) { if (pt->rna_ext.srna) {
rna_Panel_unregister(bmain, pt->ext.srna); rna_Panel_unregister(bmain, pt->rna_ext.srna);
} }
else { else {
BLI_freelinkN(&art->paneltypes, pt); BLI_freelinkN(&art->paneltypes, pt);
@ -345,13 +345,13 @@ static StructRNA *rna_Panel_register(Main *bmain,
pt = MEM_mallocN(sizeof(PanelType), "python buttons panel"); pt = MEM_mallocN(sizeof(PanelType), "python buttons panel");
memcpy(pt, &dummypt, sizeof(dummypt)); memcpy(pt, &dummypt, sizeof(dummypt));
pt->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, pt->idname, &RNA_Panel); pt->rna_ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, pt->idname, &RNA_Panel);
RNA_def_struct_translation_context(pt->ext.srna, pt->translation_context); RNA_def_struct_translation_context(pt->rna_ext.srna, pt->translation_context);
pt->ext.data = data; pt->rna_ext.data = data;
pt->ext.call = call; pt->rna_ext.call = call;
pt->ext.free = free; pt->rna_ext.free = free;
RNA_struct_blender_type_set(pt->ext.srna, pt); RNA_struct_blender_type_set(pt->rna_ext.srna, pt);
RNA_def_struct_flag(pt->ext.srna, STRUCT_NO_IDPROPERTIES); RNA_def_struct_flag(pt->rna_ext.srna, STRUCT_NO_IDPROPERTIES);
pt->poll = (have_function[0]) ? panel_poll : NULL; pt->poll = (have_function[0]) ? panel_poll : NULL;
pt->draw = (have_function[1]) ? panel_draw : NULL; pt->draw = (have_function[1]) ? panel_draw : NULL;
@ -391,13 +391,13 @@ static StructRNA *rna_Panel_register(Main *bmain,
/* update while blender is running */ /* update while blender is running */
WM_main_add_notifier(NC_WINDOW, NULL); WM_main_add_notifier(NC_WINDOW, NULL);
return pt->ext.srna; return pt->rna_ext.srna;
} }
static StructRNA *rna_Panel_refine(PointerRNA *ptr) static StructRNA *rna_Panel_refine(PointerRNA *ptr)
{ {
Panel *menu = (Panel *)ptr->data; Panel *menu = (Panel *)ptr->data;
return (menu->type && menu->type->ext.srna) ? menu->type->ext.srna : &RNA_Panel; return (menu->type && menu->type->rna_ext.srna) ? menu->type->rna_ext.srna : &RNA_Panel;
} }
/* UIList */ /* UIList */
@ -434,7 +434,7 @@ static void uilist_draw_item(uiList *ui_list,
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, ui_list->type->ext.srna, ui_list, &ul_ptr); RNA_pointer_create(&CTX_wm_screen(C)->id, ui_list->type->rna_ext.srna, ui_list, &ul_ptr);
func = &rna_UIList_draw_item_func; /* RNA_struct_find_function(&ul_ptr, "draw_item"); */ func = &rna_UIList_draw_item_func; /* RNA_struct_find_function(&ul_ptr, "draw_item"); */
RNA_parameter_list_create(&list, &ul_ptr, func); RNA_parameter_list_create(&list, &ul_ptr, func);
@ -447,7 +447,7 @@ static void uilist_draw_item(uiList *ui_list,
RNA_parameter_set_lookup(&list, "active_property", &active_propname); RNA_parameter_set_lookup(&list, "active_property", &active_propname);
RNA_parameter_set_lookup(&list, "index", &index); RNA_parameter_set_lookup(&list, "index", &index);
RNA_parameter_set_lookup(&list, "flt_flag", &flt_flag); RNA_parameter_set_lookup(&list, "flt_flag", &flt_flag);
ui_list->type->ext.call((bContext *)C, &ul_ptr, func, &list); ui_list->type->rna_ext.call((bContext *)C, &ul_ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -460,13 +460,13 @@ static void uilist_draw_filter(uiList *ui_list, bContext *C, uiLayout *layout)
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, ui_list->type->ext.srna, ui_list, &ul_ptr); RNA_pointer_create(&CTX_wm_screen(C)->id, ui_list->type->rna_ext.srna, ui_list, &ul_ptr);
func = &rna_UIList_draw_filter_func; /* RNA_struct_find_function(&ul_ptr, "draw_filter"); */ func = &rna_UIList_draw_filter_func; /* RNA_struct_find_function(&ul_ptr, "draw_filter"); */
RNA_parameter_list_create(&list, &ul_ptr, func); RNA_parameter_list_create(&list, &ul_ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
RNA_parameter_set_lookup(&list, "layout", &layout); RNA_parameter_set_lookup(&list, "layout", &layout);
ui_list->type->ext.call((bContext *)C, &ul_ptr, func, &list); ui_list->type->rna_ext.call((bContext *)C, &ul_ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -489,7 +489,7 @@ static void uilist_filter_items(uiList *ui_list,
int ret_len; int ret_len;
int len = flt_data->items_len = RNA_collection_length(dataptr, propname); int len = flt_data->items_len = RNA_collection_length(dataptr, propname);
RNA_pointer_create(&CTX_wm_screen(C)->id, ui_list->type->ext.srna, ui_list, &ul_ptr); RNA_pointer_create(&CTX_wm_screen(C)->id, ui_list->type->rna_ext.srna, ui_list, &ul_ptr);
func = &rna_UIList_filter_items_func; /* RNA_struct_find_function(&ul_ptr, "filter_items"); */ func = &rna_UIList_filter_items_func; /* RNA_struct_find_function(&ul_ptr, "filter_items"); */
RNA_parameter_list_create(&list, &ul_ptr, func); RNA_parameter_list_create(&list, &ul_ptr, func);
@ -497,7 +497,7 @@ static void uilist_filter_items(uiList *ui_list,
RNA_parameter_set_lookup(&list, "data", dataptr); RNA_parameter_set_lookup(&list, "data", dataptr);
RNA_parameter_set_lookup(&list, "property", &propname); RNA_parameter_set_lookup(&list, "property", &propname);
ui_list->type->ext.call((bContext *)C, &ul_ptr, func, &list); ui_list->type->rna_ext.call((bContext *)C, &ul_ptr, func, &list);
parm = RNA_function_find_parameter(NULL, func, "filter_flags"); parm = RNA_function_find_parameter(NULL, func, "filter_flags");
ret_len = RNA_parameter_dynamic_length_get(&list, parm); ret_len = RNA_parameter_dynamic_length_get(&list, parm);
@ -600,7 +600,7 @@ static void rna_UIList_unregister(Main *UNUSED(bmain), StructRNA *type)
return; return;
} }
RNA_struct_free_extension(type, &ult->ext); RNA_struct_free_extension(type, &ult->rna_ext);
RNA_struct_free(&BLENDER_RNA, type); RNA_struct_free(&BLENDER_RNA, type);
WM_uilisttype_freelink(ult); WM_uilisttype_freelink(ult);
@ -643,8 +643,8 @@ static StructRNA *rna_UIList_register(Main *bmain,
/* check if we have registered this uilist type before, and remove it */ /* check if we have registered this uilist type before, and remove it */
ult = WM_uilisttype_find(dummyult.idname, true); ult = WM_uilisttype_find(dummyult.idname, true);
if (ult && ult->ext.srna) { if (ult && ult->rna_ext.srna) {
rna_UIList_unregister(bmain, ult->ext.srna); rna_UIList_unregister(bmain, ult->rna_ext.srna);
} }
if (!RNA_struct_available_or_report(reports, dummyult.idname)) { if (!RNA_struct_available_or_report(reports, dummyult.idname)) {
return NULL; return NULL;
@ -657,11 +657,11 @@ static StructRNA *rna_UIList_register(Main *bmain,
ult = MEM_callocN(sizeof(uiListType) + over_alloc, "python uilist"); ult = MEM_callocN(sizeof(uiListType) + over_alloc, "python uilist");
memcpy(ult, &dummyult, sizeof(dummyult)); memcpy(ult, &dummyult, sizeof(dummyult));
ult->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, ult->idname, &RNA_UIList); ult->rna_ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, ult->idname, &RNA_UIList);
ult->ext.data = data; ult->rna_ext.data = data;
ult->ext.call = call; ult->rna_ext.call = call;
ult->ext.free = free; ult->rna_ext.free = free;
RNA_struct_blender_type_set(ult->ext.srna, ult); RNA_struct_blender_type_set(ult->rna_ext.srna, ult);
ult->draw_item = (have_function[0]) ? uilist_draw_item : NULL; ult->draw_item = (have_function[0]) ? uilist_draw_item : NULL;
ult->draw_filter = (have_function[1]) ? uilist_draw_filter : NULL; ult->draw_filter = (have_function[1]) ? uilist_draw_filter : NULL;
@ -672,13 +672,14 @@ static StructRNA *rna_UIList_register(Main *bmain,
/* update while blender is running */ /* update while blender is running */
WM_main_add_notifier(NC_WINDOW, NULL); WM_main_add_notifier(NC_WINDOW, NULL);
return ult->ext.srna; return ult->rna_ext.srna;
} }
static StructRNA *rna_UIList_refine(PointerRNA *ptr) static StructRNA *rna_UIList_refine(PointerRNA *ptr)
{ {
uiList *ui_list = (uiList *)ptr->data; uiList *ui_list = (uiList *)ptr->data;
return (ui_list->type && ui_list->type->ext.srna) ? ui_list->type->ext.srna : &RNA_UIList; return (ui_list->type && ui_list->type->rna_ext.srna) ? ui_list->type->rna_ext.srna :
&RNA_UIList;
} }
/* Header */ /* Header */
@ -691,12 +692,12 @@ static void header_draw(const bContext *C, Header *hdr)
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, hdr->type->ext.srna, hdr, &htr); RNA_pointer_create(&CTX_wm_screen(C)->id, hdr->type->rna_ext.srna, hdr, &htr);
func = &rna_Header_draw_func; /* RNA_struct_find_function(&htr, "draw"); */ func = &rna_Header_draw_func; /* RNA_struct_find_function(&htr, "draw"); */
RNA_parameter_list_create(&list, &htr, func); RNA_parameter_list_create(&list, &htr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
hdr->type->ext.call((bContext *)C, &htr, func, &list); hdr->type->rna_ext.call((bContext *)C, &htr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -713,7 +714,7 @@ static void rna_Header_unregister(Main *UNUSED(bmain), StructRNA *type)
return; return;
} }
RNA_struct_free_extension(type, &ht->ext); RNA_struct_free_extension(type, &ht->rna_ext);
RNA_struct_free(&BLENDER_RNA, type); RNA_struct_free(&BLENDER_RNA, type);
BLI_freelinkN(&art->headertypes, ht); BLI_freelinkN(&art->headertypes, ht);
@ -762,8 +763,8 @@ static StructRNA *rna_Header_register(Main *bmain,
/* check if we have registered this header type before, and remove it */ /* check if we have registered this header type before, and remove it */
for (ht = art->headertypes.first; ht; ht = ht->next) { for (ht = art->headertypes.first; ht; ht = ht->next) {
if (STREQ(ht->idname, dummyht.idname)) { if (STREQ(ht->idname, dummyht.idname)) {
if (ht->ext.srna) { if (ht->rna_ext.srna) {
rna_Header_unregister(bmain, ht->ext.srna); rna_Header_unregister(bmain, ht->rna_ext.srna);
} }
break; break;
} }
@ -779,11 +780,11 @@ static StructRNA *rna_Header_register(Main *bmain,
ht = MEM_mallocN(sizeof(HeaderType), "python buttons header"); ht = MEM_mallocN(sizeof(HeaderType), "python buttons header");
memcpy(ht, &dummyht, sizeof(dummyht)); memcpy(ht, &dummyht, sizeof(dummyht));
ht->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, ht->idname, &RNA_Header); ht->rna_ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, ht->idname, &RNA_Header);
ht->ext.data = data; ht->rna_ext.data = data;
ht->ext.call = call; ht->rna_ext.call = call;
ht->ext.free = free; ht->rna_ext.free = free;
RNA_struct_blender_type_set(ht->ext.srna, ht); RNA_struct_blender_type_set(ht->rna_ext.srna, ht);
ht->draw = (have_function[0]) ? header_draw : NULL; ht->draw = (have_function[0]) ? header_draw : NULL;
@ -792,13 +793,13 @@ static StructRNA *rna_Header_register(Main *bmain,
/* update while blender is running */ /* update while blender is running */
WM_main_add_notifier(NC_WINDOW, NULL); WM_main_add_notifier(NC_WINDOW, NULL);
return ht->ext.srna; return ht->rna_ext.srna;
} }
static StructRNA *rna_Header_refine(PointerRNA *htr) static StructRNA *rna_Header_refine(PointerRNA *htr)
{ {
Header *hdr = (Header *)htr->data; Header *hdr = (Header *)htr->data;
return (hdr->type && hdr->type->ext.srna) ? hdr->type->ext.srna : &RNA_Header; return (hdr->type && hdr->type->rna_ext.srna) ? hdr->type->rna_ext.srna : &RNA_Header;
} }
/* Menu */ /* Menu */
@ -813,12 +814,12 @@ static bool menu_poll(const bContext *C, MenuType *pt)
void *ret; void *ret;
bool visible; bool visible;
RNA_pointer_create(NULL, pt->ext.srna, NULL, &ptr); /* dummy */ RNA_pointer_create(NULL, pt->rna_ext.srna, NULL, &ptr); /* dummy */
func = &rna_Menu_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */ func = &rna_Menu_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
pt->ext.call((bContext *)C, &ptr, func, &list); pt->rna_ext.call((bContext *)C, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret); RNA_parameter_get_lookup(&list, "visible", &ret);
visible = *(bool *)ret; visible = *(bool *)ret;
@ -836,12 +837,12 @@ static void menu_draw(const bContext *C, Menu *menu)
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(&CTX_wm_screen(C)->id, menu->type->ext.srna, menu, &mtr); RNA_pointer_create(&CTX_wm_screen(C)->id, menu->type->rna_ext.srna, menu, &mtr);
func = &rna_Menu_draw_func; /* RNA_struct_find_function(&mtr, "draw"); */ func = &rna_Menu_draw_func; /* RNA_struct_find_function(&mtr, "draw"); */
RNA_parameter_list_create(&list, &mtr, func); RNA_parameter_list_create(&list, &mtr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
menu->type->ext.call((bContext *)C, &mtr, func, &list); menu->type->rna_ext.call((bContext *)C, &mtr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -854,7 +855,7 @@ static void rna_Menu_unregister(Main *UNUSED(bmain), StructRNA *type)
return; return;
} }
RNA_struct_free_extension(type, &mt->ext); RNA_struct_free_extension(type, &mt->rna_ext);
RNA_struct_free(&BLENDER_RNA, type); RNA_struct_free(&BLENDER_RNA, type);
WM_menutype_freelink(mt); WM_menutype_freelink(mt);
@ -904,8 +905,8 @@ static StructRNA *rna_Menu_register(Main *bmain,
/* check if we have registered this menu type before, and remove it */ /* check if we have registered this menu type before, and remove it */
mt = WM_menutype_find(dummymt.idname, true); mt = WM_menutype_find(dummymt.idname, true);
if (mt && mt->ext.srna) { if (mt && mt->rna_ext.srna) {
rna_Menu_unregister(bmain, mt->ext.srna); rna_Menu_unregister(bmain, mt->rna_ext.srna);
} }
if (!RNA_struct_available_or_report(reports, dummymt.idname)) { if (!RNA_struct_available_or_report(reports, dummymt.idname)) {
return NULL; return NULL;
@ -932,13 +933,13 @@ static StructRNA *rna_Menu_register(Main *bmain,
mt->description = NULL; mt->description = NULL;
} }
mt->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, mt->idname, &RNA_Menu); mt->rna_ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, mt->idname, &RNA_Menu);
RNA_def_struct_translation_context(mt->ext.srna, mt->translation_context); RNA_def_struct_translation_context(mt->rna_ext.srna, mt->translation_context);
mt->ext.data = data; mt->rna_ext.data = data;
mt->ext.call = call; mt->rna_ext.call = call;
mt->ext.free = free; mt->rna_ext.free = free;
RNA_struct_blender_type_set(mt->ext.srna, mt); RNA_struct_blender_type_set(mt->rna_ext.srna, mt);
RNA_def_struct_flag(mt->ext.srna, STRUCT_NO_IDPROPERTIES); RNA_def_struct_flag(mt->rna_ext.srna, STRUCT_NO_IDPROPERTIES);
mt->poll = (have_function[0]) ? menu_poll : NULL; mt->poll = (have_function[0]) ? menu_poll : NULL;
mt->draw = (have_function[1]) ? menu_draw : NULL; mt->draw = (have_function[1]) ? menu_draw : NULL;
@ -955,13 +956,13 @@ static StructRNA *rna_Menu_register(Main *bmain,
/* update while blender is running */ /* update while blender is running */
WM_main_add_notifier(NC_WINDOW, NULL); WM_main_add_notifier(NC_WINDOW, NULL);
return mt->ext.srna; return mt->rna_ext.srna;
} }
static StructRNA *rna_Menu_refine(PointerRNA *mtr) static StructRNA *rna_Menu_refine(PointerRNA *mtr)
{ {
Menu *menu = (Menu *)mtr->data; Menu *menu = (Menu *)mtr->data;
return (menu->type && menu->type->ext.srna) ? menu->type->ext.srna : &RNA_Menu; return (menu->type && menu->type->rna_ext.srna) ? menu->type->rna_ext.srna : &RNA_Menu;
} }
static void rna_Menu_bl_description_set(PointerRNA *ptr, const char *value) static void rna_Menu_bl_description_set(PointerRNA *ptr, const char *value)

View File

@ -793,7 +793,7 @@ static PointerRNA rna_Addon_preferences_get(PointerRNA *ptr)
IDPropertyTemplate val = {0}; IDPropertyTemplate val = {0};
addon->prop = IDP_New(IDP_GROUP, &val, addon->module); /* name is unimportant */ addon->prop = IDP_New(IDP_GROUP, &val, addon->module); /* name is unimportant */
} }
return rna_pointer_inherit_refine(ptr, apt->ext.srna, addon->prop); return rna_pointer_inherit_refine(ptr, apt->rna_ext.srna, addon->prop);
} }
else { else {
return PointerRNA_NULL; return PointerRNA_NULL;
@ -808,7 +808,7 @@ static void rna_AddonPref_unregister(Main *UNUSED(bmain), StructRNA *type)
return; return;
} }
RNA_struct_free_extension(type, &apt->ext); RNA_struct_free_extension(type, &apt->rna_ext);
RNA_struct_free(&BLENDER_RNA, type); RNA_struct_free(&BLENDER_RNA, type);
BKE_addon_pref_type_remove(apt); BKE_addon_pref_type_remove(apt);
@ -850,8 +850,8 @@ static StructRNA *rna_AddonPref_register(Main *bmain,
/* check if we have registered this addon-pref type before, and remove it */ /* check if we have registered this addon-pref type before, and remove it */
apt = BKE_addon_pref_type_find(dummy_addon.module, true); apt = BKE_addon_pref_type_find(dummy_addon.module, true);
if (apt && apt->ext.srna) { if (apt && apt->rna_ext.srna) {
rna_AddonPref_unregister(bmain, apt->ext.srna); rna_AddonPref_unregister(bmain, apt->rna_ext.srna);
} }
/* create a new addon-pref type */ /* create a new addon-pref type */
@ -859,18 +859,18 @@ static StructRNA *rna_AddonPref_register(Main *bmain,
memcpy(apt, &dummy_apt, sizeof(dummy_apt)); memcpy(apt, &dummy_apt, sizeof(dummy_apt));
BKE_addon_pref_type_add(apt); BKE_addon_pref_type_add(apt);
apt->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, identifier, &RNA_AddonPreferences); apt->rna_ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, identifier, &RNA_AddonPreferences);
apt->ext.data = data; apt->rna_ext.data = data;
apt->ext.call = call; apt->rna_ext.call = call;
apt->ext.free = free; apt->rna_ext.free = free;
RNA_struct_blender_type_set(apt->ext.srna, apt); RNA_struct_blender_type_set(apt->rna_ext.srna, apt);
// apt->draw = (have_function[0]) ? header_draw : NULL; // apt->draw = (have_function[0]) ? header_draw : NULL;
/* update while blender is running */ /* update while blender is running */
WM_main_add_notifier(NC_WINDOW, NULL); WM_main_add_notifier(NC_WINDOW, NULL);
return apt->ext.srna; return apt->rna_ext.srna;
} }
/* placeholder, doesn't do anything useful yet */ /* placeholder, doesn't do anything useful yet */

View File

@ -1085,7 +1085,7 @@ static PointerRNA rna_wmKeyConfig_preferences_get(PointerRNA *ptr)
wmKeyConfigPrefType_Runtime *kpt_rt = BKE_keyconfig_pref_type_find(kc->idname, true); wmKeyConfigPrefType_Runtime *kpt_rt = BKE_keyconfig_pref_type_find(kc->idname, true);
if (kpt_rt) { if (kpt_rt) {
wmKeyConfigPref *kpt = BKE_keyconfig_pref_ensure(&U, kc->idname); wmKeyConfigPref *kpt = BKE_keyconfig_pref_ensure(&U, kc->idname);
return rna_pointer_inherit_refine(ptr, kpt_rt->ext.srna, kpt->prop); return rna_pointer_inherit_refine(ptr, kpt_rt->rna_ext.srna, kpt->prop);
} }
else { else {
return PointerRNA_NULL; return PointerRNA_NULL;
@ -1109,7 +1109,7 @@ static void rna_wmKeyConfigPref_unregister(Main *UNUSED(bmain), StructRNA *type)
return; return;
} }
RNA_struct_free_extension(type, &kpt_rt->ext); RNA_struct_free_extension(type, &kpt_rt->rna_ext);
RNA_struct_free(&BLENDER_RNA, type); RNA_struct_free(&BLENDER_RNA, type);
/* Possible we're not in the preferences if they have been reset. */ /* Possible we're not in the preferences if they have been reset. */
@ -1152,8 +1152,8 @@ static StructRNA *rna_wmKeyConfigPref_register(Main *bmain,
/* check if we have registered this keyconf-prefs type before, and remove it */ /* check if we have registered this keyconf-prefs type before, and remove it */
kpt_rt = BKE_keyconfig_pref_type_find(dummy_kpt.idname, true); kpt_rt = BKE_keyconfig_pref_type_find(dummy_kpt.idname, true);
if (kpt_rt && kpt_rt->ext.srna) { if (kpt_rt && kpt_rt->rna_ext.srna) {
rna_wmKeyConfigPref_unregister(bmain, kpt_rt->ext.srna); rna_wmKeyConfigPref_unregister(bmain, kpt_rt->rna_ext.srna);
} }
/* create a new keyconf-prefs type */ /* create a new keyconf-prefs type */
@ -1162,18 +1162,18 @@ static StructRNA *rna_wmKeyConfigPref_register(Main *bmain,
BKE_keyconfig_pref_type_add(kpt_rt); BKE_keyconfig_pref_type_add(kpt_rt);
kpt_rt->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, identifier, &RNA_KeyConfigPreferences); kpt_rt->rna_ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, identifier, &RNA_KeyConfigPreferences);
kpt_rt->ext.data = data; kpt_rt->rna_ext.data = data;
kpt_rt->ext.call = call; kpt_rt->rna_ext.call = call;
kpt_rt->ext.free = free; kpt_rt->rna_ext.free = free;
RNA_struct_blender_type_set(kpt_rt->ext.srna, kpt_rt); RNA_struct_blender_type_set(kpt_rt->rna_ext.srna, kpt_rt);
// kpt_rt->draw = (have_function[0]) ? header_draw : NULL; // kpt_rt->draw = (have_function[0]) ? header_draw : NULL;
/* update while blender is running */ /* update while blender is running */
WM_main_add_notifier(NC_WINDOW, NULL); WM_main_add_notifier(NC_WINDOW, NULL);
return kpt_rt->ext.srna; return kpt_rt->rna_ext.srna;
} }
/* placeholder, doesn't do anything useful yet */ /* placeholder, doesn't do anything useful yet */
@ -1292,12 +1292,12 @@ static bool rna_operator_poll_cb(bContext *C, wmOperatorType *ot)
void *ret; void *ret;
bool visible; bool visible;
RNA_pointer_create(NULL, ot->ext.srna, NULL, &ptr); /* dummy */ RNA_pointer_create(NULL, ot->rna_ext.srna, NULL, &ptr); /* dummy */
func = &rna_Operator_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */ func = &rna_Operator_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
ot->ext.call(C, &ptr, func, &list); ot->rna_ext.call(C, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret); RNA_parameter_get_lookup(&list, "visible", &ret);
visible = *(bool *)ret; visible = *(bool *)ret;
@ -1317,12 +1317,12 @@ static int rna_operator_execute_cb(bContext *C, wmOperator *op)
void *ret; void *ret;
int result; int result;
RNA_pointer_create(NULL, op->type->ext.srna, op, &opr); RNA_pointer_create(NULL, op->type->rna_ext.srna, op, &opr);
func = &rna_Operator_execute_func; /* RNA_struct_find_function(&opr, "execute"); */ func = &rna_Operator_execute_func; /* RNA_struct_find_function(&opr, "execute"); */
RNA_parameter_list_create(&list, &opr, func); RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
op->type->ext.call(C, &opr, func, &list); op->type->rna_ext.call(C, &opr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret); RNA_parameter_get_lookup(&list, "result", &ret);
result = *(int *)ret; result = *(int *)ret;
@ -1343,12 +1343,12 @@ static bool rna_operator_check_cb(bContext *C, wmOperator *op)
void *ret; void *ret;
bool result; bool result;
RNA_pointer_create(NULL, op->type->ext.srna, op, &opr); RNA_pointer_create(NULL, op->type->rna_ext.srna, op, &opr);
func = &rna_Operator_check_func; /* RNA_struct_find_function(&opr, "check"); */ func = &rna_Operator_check_func; /* RNA_struct_find_function(&opr, "check"); */
RNA_parameter_list_create(&list, &opr, func); RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
op->type->ext.call(C, &opr, func, &list); op->type->rna_ext.call(C, &opr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret); RNA_parameter_get_lookup(&list, "result", &ret);
result = (*(bool *)ret) != 0; result = (*(bool *)ret) != 0;
@ -1368,13 +1368,13 @@ static int rna_operator_invoke_cb(bContext *C, wmOperator *op, const wmEvent *ev
void *ret; void *ret;
int result; int result;
RNA_pointer_create(NULL, op->type->ext.srna, op, &opr); RNA_pointer_create(NULL, op->type->rna_ext.srna, op, &opr);
func = &rna_Operator_invoke_func; /* RNA_struct_find_function(&opr, "invoke"); */ func = &rna_Operator_invoke_func; /* RNA_struct_find_function(&opr, "invoke"); */
RNA_parameter_list_create(&list, &opr, func); RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
RNA_parameter_set_lookup(&list, "event", &event); RNA_parameter_set_lookup(&list, "event", &event);
op->type->ext.call(C, &opr, func, &list); op->type->rna_ext.call(C, &opr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret); RNA_parameter_get_lookup(&list, "result", &ret);
result = *(int *)ret; result = *(int *)ret;
@ -1395,13 +1395,13 @@ static int rna_operator_modal_cb(bContext *C, wmOperator *op, const wmEvent *eve
void *ret; void *ret;
int result; int result;
RNA_pointer_create(NULL, op->type->ext.srna, op, &opr); RNA_pointer_create(NULL, op->type->rna_ext.srna, op, &opr);
func = &rna_Operator_modal_func; /* RNA_struct_find_function(&opr, "modal"); */ func = &rna_Operator_modal_func; /* RNA_struct_find_function(&opr, "modal"); */
RNA_parameter_list_create(&list, &opr, func); RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
RNA_parameter_set_lookup(&list, "event", &event); RNA_parameter_set_lookup(&list, "event", &event);
op->type->ext.call(C, &opr, func, &list); op->type->rna_ext.call(C, &opr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret); RNA_parameter_get_lookup(&list, "result", &ret);
result = *(int *)ret; result = *(int *)ret;
@ -1419,12 +1419,12 @@ static void rna_operator_draw_cb(bContext *C, wmOperator *op)
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, op->type->ext.srna, op, &opr); RNA_pointer_create(NULL, op->type->rna_ext.srna, op, &opr);
func = &rna_Operator_draw_func; /* RNA_struct_find_function(&opr, "draw"); */ func = &rna_Operator_draw_func; /* RNA_struct_find_function(&opr, "draw"); */
RNA_parameter_list_create(&list, &opr, func); RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
op->type->ext.call(C, &opr, func, &list); op->type->rna_ext.call(C, &opr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -1438,12 +1438,12 @@ static void rna_operator_cancel_cb(bContext *C, wmOperator *op)
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, op->type->ext.srna, op, &opr); RNA_pointer_create(NULL, op->type->rna_ext.srna, op, &opr);
func = &rna_Operator_cancel_func; /* RNA_struct_find_function(&opr, "cancel"); */ func = &rna_Operator_cancel_func; /* RNA_struct_find_function(&opr, "cancel"); */
RNA_parameter_list_create(&list, &opr, func); RNA_parameter_list_create(&list, &opr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
op->type->ext.call(C, &opr, func, &list); op->type->rna_ext.call(C, &opr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -1458,13 +1458,13 @@ static char *rna_operator_description_cb(bContext *C, wmOperatorType *ot, Pointe
void *ret; void *ret;
char *result; char *result;
RNA_pointer_create(NULL, ot->ext.srna, NULL, &ptr); /* dummy */ RNA_pointer_create(NULL, ot->rna_ext.srna, NULL, &ptr); /* dummy */
func = &rna_Operator_description_func; /* RNA_struct_find_function(&ptr, "description"); */ func = &rna_Operator_description_func; /* RNA_struct_find_function(&ptr, "description"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
RNA_parameter_set_lookup(&list, "properties", prop_ptr); RNA_parameter_set_lookup(&list, "properties", prop_ptr);
ot->ext.call(C, &ptr, func, &list); ot->rna_ext.call(C, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "result", &ret); RNA_parameter_get_lookup(&list, "result", &ret);
result = (char *)ret; result = (char *)ret;
@ -1532,8 +1532,8 @@ static StructRNA *rna_Operator_register(Main *bmain,
/* check if we have registered this operator type before, and remove it */ /* check if we have registered this operator type before, and remove it */
{ {
wmOperatorType *ot = WM_operatortype_find(dummyot.idname, true); wmOperatorType *ot = WM_operatortype_find(dummyot.idname, true);
if (ot && ot->ext.srna) { if (ot && ot->rna_ext.srna) {
rna_Operator_unregister(bmain, ot->ext.srna); rna_Operator_unregister(bmain, ot->rna_ext.srna);
} }
} }
@ -1574,16 +1574,16 @@ static StructRNA *rna_Operator_register(Main *bmain,
* for now just remove from dir(bpy.types) */ * for now just remove from dir(bpy.types) */
/* create a new operator type */ /* create a new operator type */
dummyot.ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummyot.idname, &RNA_Operator); dummyot.rna_ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummyot.idname, &RNA_Operator);
/* Operator properties are registered separately. */ /* Operator properties are registered separately. */
RNA_def_struct_flag(dummyot.ext.srna, STRUCT_NO_IDPROPERTIES); RNA_def_struct_flag(dummyot.rna_ext.srna, STRUCT_NO_IDPROPERTIES);
RNA_def_struct_property_tags(dummyot.ext.srna, rna_enum_operator_property_tags); RNA_def_struct_property_tags(dummyot.rna_ext.srna, rna_enum_operator_property_tags);
RNA_def_struct_translation_context(dummyot.ext.srna, dummyot.translation_context); RNA_def_struct_translation_context(dummyot.rna_ext.srna, dummyot.translation_context);
dummyot.ext.data = data; dummyot.rna_ext.data = data;
dummyot.ext.call = call; dummyot.rna_ext.call = call;
dummyot.ext.free = free; dummyot.rna_ext.free = free;
dummyot.pyop_poll = (have_function[0]) ? rna_operator_poll_cb : NULL; dummyot.pyop_poll = (have_function[0]) ? rna_operator_poll_cb : NULL;
dummyot.exec = (have_function[1]) ? rna_operator_execute_cb : NULL; dummyot.exec = (have_function[1]) ? rna_operator_execute_cb : NULL;
@ -1598,7 +1598,7 @@ static StructRNA *rna_Operator_register(Main *bmain,
/* update while blender is running */ /* update while blender is running */
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
return dummyot.ext.srna; return dummyot.rna_ext.srna;
} }
static void rna_Operator_unregister(struct Main *bmain, StructRNA *type) static void rna_Operator_unregister(struct Main *bmain, StructRNA *type)
@ -1620,7 +1620,7 @@ static void rna_Operator_unregister(struct Main *bmain, StructRNA *type)
} }
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
RNA_struct_free_extension(type, &ot->ext); RNA_struct_free_extension(type, &ot->rna_ext);
idname = ot->idname; idname = ot->idname;
WM_operatortype_remove_ptr(ot); WM_operatortype_remove_ptr(ot);
@ -1692,8 +1692,8 @@ static StructRNA *rna_MacroOperator_register(Main *bmain,
/* check if we have registered this operator type before, and remove it */ /* check if we have registered this operator type before, and remove it */
{ {
wmOperatorType *ot = WM_operatortype_find(dummyot.idname, true); wmOperatorType *ot = WM_operatortype_find(dummyot.idname, true);
if (ot && ot->ext.srna) { if (ot && ot->rna_ext.srna) {
rna_Operator_unregister(bmain, ot->ext.srna); rna_Operator_unregister(bmain, ot->rna_ext.srna);
} }
} }
@ -1734,11 +1734,11 @@ static StructRNA *rna_MacroOperator_register(Main *bmain,
* for now just remove from dir(bpy.types) */ * for now just remove from dir(bpy.types) */
/* create a new operator type */ /* create a new operator type */
dummyot.ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummyot.idname, &RNA_Operator); dummyot.rna_ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummyot.idname, &RNA_Operator);
RNA_def_struct_translation_context(dummyot.ext.srna, dummyot.translation_context); RNA_def_struct_translation_context(dummyot.rna_ext.srna, dummyot.translation_context);
dummyot.ext.data = data; dummyot.rna_ext.data = data;
dummyot.ext.call = call; dummyot.rna_ext.call = call;
dummyot.ext.free = free; dummyot.rna_ext.free = free;
dummyot.pyop_poll = (have_function[0]) ? rna_operator_poll_cb : NULL; dummyot.pyop_poll = (have_function[0]) ? rna_operator_poll_cb : NULL;
dummyot.ui = (have_function[3]) ? rna_operator_draw_cb : NULL; dummyot.ui = (have_function[3]) ? rna_operator_draw_cb : NULL;
@ -1748,20 +1748,20 @@ static StructRNA *rna_MacroOperator_register(Main *bmain,
/* update while blender is running */ /* update while blender is running */
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
return dummyot.ext.srna; return dummyot.rna_ext.srna;
} }
# endif /* WITH_PYTHON */ # endif /* WITH_PYTHON */
static StructRNA *rna_Operator_refine(PointerRNA *opr) static StructRNA *rna_Operator_refine(PointerRNA *opr)
{ {
wmOperator *op = (wmOperator *)opr->data; wmOperator *op = (wmOperator *)opr->data;
return (op->type && op->type->ext.srna) ? op->type->ext.srna : &RNA_Operator; return (op->type && op->type->rna_ext.srna) ? op->type->rna_ext.srna : &RNA_Operator;
} }
static StructRNA *rna_MacroOperator_refine(PointerRNA *opr) static StructRNA *rna_MacroOperator_refine(PointerRNA *opr)
{ {
wmOperator *op = (wmOperator *)opr->data; wmOperator *op = (wmOperator *)opr->data;
return (op->type && op->type->ext.srna) ? op->type->ext.srna : &RNA_Macro; return (op->type && op->type->rna_ext.srna) ? op->type->rna_ext.srna : &RNA_Macro;
} }
/* just to work around 'const char *' warning and to ensure this is a python op */ /* just to work around 'const char *' warning and to ensure this is a python op */

View File

@ -78,12 +78,12 @@ static void rna_gizmo_draw_cb(const struct bContext *C, struct wmGizmo *gz)
PointerRNA gz_ptr; PointerRNA gz_ptr;
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, gz->type->ext.srna, gz, &gz_ptr); RNA_pointer_create(NULL, gz->type->rna_ext.srna, gz, &gz_ptr);
/* RNA_struct_find_function(&gz_ptr, "draw"); */ /* RNA_struct_find_function(&gz_ptr, "draw"); */
func = &rna_Gizmo_draw_func; func = &rna_Gizmo_draw_func;
RNA_parameter_list_create(&list, &gz_ptr, func); RNA_parameter_list_create(&list, &gz_ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
gzgroup->type->ext.call((bContext *)C, &gz_ptr, func, &list); gzgroup->type->rna_ext.call((bContext *)C, &gz_ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -94,13 +94,13 @@ static void rna_gizmo_draw_select_cb(const struct bContext *C, struct wmGizmo *g
PointerRNA gz_ptr; PointerRNA gz_ptr;
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, gz->type->ext.srna, gz, &gz_ptr); RNA_pointer_create(NULL, gz->type->rna_ext.srna, gz, &gz_ptr);
/* RNA_struct_find_function(&gz_ptr, "draw_select"); */ /* RNA_struct_find_function(&gz_ptr, "draw_select"); */
func = &rna_Gizmo_draw_select_func; func = &rna_Gizmo_draw_select_func;
RNA_parameter_list_create(&list, &gz_ptr, func); RNA_parameter_list_create(&list, &gz_ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
RNA_parameter_set_lookup(&list, "select_id", &select_id); RNA_parameter_set_lookup(&list, "select_id", &select_id);
gzgroup->type->ext.call((bContext *)C, &gz_ptr, func, &list); gzgroup->type->rna_ext.call((bContext *)C, &gz_ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -111,13 +111,13 @@ static int rna_gizmo_test_select_cb(struct bContext *C, struct wmGizmo *gz, cons
PointerRNA gz_ptr; PointerRNA gz_ptr;
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, gz->type->ext.srna, gz, &gz_ptr); RNA_pointer_create(NULL, gz->type->rna_ext.srna, gz, &gz_ptr);
/* RNA_struct_find_function(&gz_ptr, "test_select"); */ /* RNA_struct_find_function(&gz_ptr, "test_select"); */
func = &rna_Gizmo_test_select_func; func = &rna_Gizmo_test_select_func;
RNA_parameter_list_create(&list, &gz_ptr, func); RNA_parameter_list_create(&list, &gz_ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
RNA_parameter_set_lookup(&list, "location", location); RNA_parameter_set_lookup(&list, "location", location);
gzgroup->type->ext.call((bContext *)C, &gz_ptr, func, &list); gzgroup->type->rna_ext.call((bContext *)C, &gz_ptr, func, &list);
void *ret; void *ret;
RNA_parameter_get_lookup(&list, "intersect_id", &ret); RNA_parameter_get_lookup(&list, "intersect_id", &ret);
@ -138,14 +138,14 @@ static int rna_gizmo_modal_cb(struct bContext *C,
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
const int tweak_flag_int = tweak_flag; const int tweak_flag_int = tweak_flag;
RNA_pointer_create(NULL, gz->type->ext.srna, gz, &gz_ptr); RNA_pointer_create(NULL, gz->type->rna_ext.srna, gz, &gz_ptr);
/* RNA_struct_find_function(&gz_ptr, "modal"); */ /* RNA_struct_find_function(&gz_ptr, "modal"); */
func = &rna_Gizmo_modal_func; func = &rna_Gizmo_modal_func;
RNA_parameter_list_create(&list, &gz_ptr, func); RNA_parameter_list_create(&list, &gz_ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
RNA_parameter_set_lookup(&list, "event", &event); RNA_parameter_set_lookup(&list, "event", &event);
RNA_parameter_set_lookup(&list, "tweak", &tweak_flag_int); RNA_parameter_set_lookup(&list, "tweak", &tweak_flag_int);
gzgroup->type->ext.call((bContext *)C, &gz_ptr, func, &list); gzgroup->type->rna_ext.call((bContext *)C, &gz_ptr, func, &list);
void *ret; void *ret;
RNA_parameter_get_lookup(&list, "result", &ret); RNA_parameter_get_lookup(&list, "result", &ret);
@ -162,11 +162,11 @@ static void rna_gizmo_setup_cb(struct wmGizmo *gz)
PointerRNA gz_ptr; PointerRNA gz_ptr;
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, gz->type->ext.srna, gz, &gz_ptr); RNA_pointer_create(NULL, gz->type->rna_ext.srna, gz, &gz_ptr);
/* RNA_struct_find_function(&gz_ptr, "setup"); */ /* RNA_struct_find_function(&gz_ptr, "setup"); */
func = &rna_Gizmo_setup_func; func = &rna_Gizmo_setup_func;
RNA_parameter_list_create(&list, &gz_ptr, func); RNA_parameter_list_create(&list, &gz_ptr, func);
gzgroup->type->ext.call((bContext *)NULL, &gz_ptr, func, &list); gzgroup->type->rna_ext.call((bContext *)NULL, &gz_ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -177,13 +177,13 @@ static int rna_gizmo_invoke_cb(struct bContext *C, struct wmGizmo *gz, const str
PointerRNA gz_ptr; PointerRNA gz_ptr;
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, gz->type->ext.srna, gz, &gz_ptr); RNA_pointer_create(NULL, gz->type->rna_ext.srna, gz, &gz_ptr);
/* RNA_struct_find_function(&gz_ptr, "invoke"); */ /* RNA_struct_find_function(&gz_ptr, "invoke"); */
func = &rna_Gizmo_invoke_func; func = &rna_Gizmo_invoke_func;
RNA_parameter_list_create(&list, &gz_ptr, func); RNA_parameter_list_create(&list, &gz_ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
RNA_parameter_set_lookup(&list, "event", &event); RNA_parameter_set_lookup(&list, "event", &event);
gzgroup->type->ext.call((bContext *)C, &gz_ptr, func, &list); gzgroup->type->rna_ext.call((bContext *)C, &gz_ptr, func, &list);
void *ret; void *ret;
RNA_parameter_get_lookup(&list, "result", &ret); RNA_parameter_get_lookup(&list, "result", &ret);
@ -200,7 +200,7 @@ static void rna_gizmo_exit_cb(struct bContext *C, struct wmGizmo *gz, bool cance
PointerRNA gz_ptr; PointerRNA gz_ptr;
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, gz->type->ext.srna, gz, &gz_ptr); RNA_pointer_create(NULL, gz->type->rna_ext.srna, gz, &gz_ptr);
/* RNA_struct_find_function(&gz_ptr, "exit"); */ /* RNA_struct_find_function(&gz_ptr, "exit"); */
func = &rna_Gizmo_exit_func; func = &rna_Gizmo_exit_func;
RNA_parameter_list_create(&list, &gz_ptr, func); RNA_parameter_list_create(&list, &gz_ptr, func);
@ -209,7 +209,7 @@ static void rna_gizmo_exit_cb(struct bContext *C, struct wmGizmo *gz, bool cance
int cancel_i = cancel; int cancel_i = cancel;
RNA_parameter_set_lookup(&list, "cancel", &cancel_i); RNA_parameter_set_lookup(&list, "cancel", &cancel_i);
} }
gzgroup->type->ext.call((bContext *)C, &gz_ptr, func, &list); gzgroup->type->rna_ext.call((bContext *)C, &gz_ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -220,11 +220,11 @@ static void rna_gizmo_select_refresh_cb(struct wmGizmo *gz)
PointerRNA gz_ptr; PointerRNA gz_ptr;
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, gz->type->ext.srna, gz, &gz_ptr); RNA_pointer_create(NULL, gz->type->rna_ext.srna, gz, &gz_ptr);
/* RNA_struct_find_function(&gz_ptr, "select_refresh"); */ /* RNA_struct_find_function(&gz_ptr, "select_refresh"); */
func = &rna_Gizmo_select_refresh_func; func = &rna_Gizmo_select_refresh_func;
RNA_parameter_list_create(&list, &gz_ptr, func); RNA_parameter_list_create(&list, &gz_ptr, func);
gzgroup->type->ext.call((bContext *)NULL, &gz_ptr, func, &list); gzgroup->type->rna_ext.call((bContext *)NULL, &gz_ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -475,8 +475,8 @@ static StructRNA *rna_Gizmo_register(Main *bmain,
/* check if we have registered this gizmo type before, and remove it */ /* check if we have registered this gizmo type before, and remove it */
{ {
const wmGizmoType *gzt = WM_gizmotype_find(dummygt.idname, true); const wmGizmoType *gzt = WM_gizmotype_find(dummygt.idname, true);
if (gzt && gzt->ext.srna) { if (gzt && gzt->rna_ext.srna) {
rna_Gizmo_unregister(bmain, gzt->ext.srna); rna_Gizmo_unregister(bmain, gzt->rna_ext.srna);
} }
} }
if (!RNA_struct_available_or_report(reports, dummygt.idname)) { if (!RNA_struct_available_or_report(reports, dummygt.idname)) {
@ -489,12 +489,12 @@ static StructRNA *rna_Gizmo_register(Main *bmain,
} }
/* create a new gizmo type */ /* create a new gizmo type */
dummygt.ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummygt.idname, &RNA_Gizmo); dummygt.rna_ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummygt.idname, &RNA_Gizmo);
/* gizmo properties are registered separately */ /* gizmo properties are registered separately */
RNA_def_struct_flag(dummygt.ext.srna, STRUCT_NO_IDPROPERTIES); RNA_def_struct_flag(dummygt.rna_ext.srna, STRUCT_NO_IDPROPERTIES);
dummygt.ext.data = data; dummygt.rna_ext.data = data;
dummygt.ext.call = call; dummygt.rna_ext.call = call;
dummygt.ext.free = free; dummygt.rna_ext.free = free;
{ {
int i = 0; int i = 0;
@ -517,7 +517,7 @@ static StructRNA *rna_Gizmo_register(Main *bmain,
/* update while blender is running */ /* update while blender is running */
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
return dummygt.ext.srna; return dummygt.rna_ext.srna;
} }
static void rna_Gizmo_unregister(struct Main *bmain, StructRNA *type) static void rna_Gizmo_unregister(struct Main *bmain, StructRNA *type)
@ -528,7 +528,7 @@ static void rna_Gizmo_unregister(struct Main *bmain, StructRNA *type)
return; return;
} }
RNA_struct_free_extension(type, &gzt->ext); RNA_struct_free_extension(type, &gzt->rna_ext);
RNA_struct_free(&BLENDER_RNA, type); RNA_struct_free(&BLENDER_RNA, type);
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
@ -547,7 +547,7 @@ static void **rna_Gizmo_instance(PointerRNA *ptr)
static StructRNA *rna_Gizmo_refine(PointerRNA *mnp_ptr) static StructRNA *rna_Gizmo_refine(PointerRNA *mnp_ptr)
{ {
wmGizmo *gz = mnp_ptr->data; wmGizmo *gz = mnp_ptr->data;
return (gz->type && gz->type->ext.srna) ? gz->type->ext.srna : &RNA_Gizmo; return (gz->type && gz->type->rna_ext.srna) ? gz->type->rna_ext.srna : &RNA_Gizmo;
} }
/** \} */ /** \} */
@ -665,12 +665,12 @@ static bool rna_gizmogroup_poll_cb(const bContext *C, wmGizmoGroupType *gzgt)
void *ret; void *ret;
bool visible; bool visible;
RNA_pointer_create(NULL, gzgt->ext.srna, NULL, &ptr); /* dummy */ RNA_pointer_create(NULL, gzgt->rna_ext.srna, NULL, &ptr); /* dummy */
func = &rna_GizmoGroup_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */ func = &rna_GizmoGroup_poll_func; /* RNA_struct_find_function(&ptr, "poll"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
gzgt->ext.call((bContext *)C, &ptr, func, &list); gzgt->rna_ext.call((bContext *)C, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "visible", &ret); RNA_parameter_get_lookup(&list, "visible", &ret);
visible = *(bool *)ret; visible = *(bool *)ret;
@ -688,12 +688,12 @@ static void rna_gizmogroup_setup_cb(const bContext *C, wmGizmoGroup *gzgroup)
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, gzgroup->type->ext.srna, gzgroup, &gzgroup_ptr); RNA_pointer_create(NULL, gzgroup->type->rna_ext.srna, gzgroup, &gzgroup_ptr);
func = &rna_GizmoGroup_setup_func; /* RNA_struct_find_function(&wgroupr, "setup"); */ func = &rna_GizmoGroup_setup_func; /* RNA_struct_find_function(&wgroupr, "setup"); */
RNA_parameter_list_create(&list, &gzgroup_ptr, func); RNA_parameter_list_create(&list, &gzgroup_ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
gzgroup->type->ext.call((bContext *)C, &gzgroup_ptr, func, &list); gzgroup->type->rna_ext.call((bContext *)C, &gzgroup_ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -707,13 +707,13 @@ static wmKeyMap *rna_gizmogroup_setup_keymap_cb(const wmGizmoGroupType *gzgt, wm
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, gzgt->ext.srna, NULL, &ptr); /* dummy */ RNA_pointer_create(NULL, gzgt->rna_ext.srna, NULL, &ptr); /* dummy */
func = func =
&rna_GizmoGroup_setup_keymap_func; /* RNA_struct_find_function(&wgroupr, "setup_keymap"); */ &rna_GizmoGroup_setup_keymap_func; /* RNA_struct_find_function(&wgroupr, "setup_keymap"); */
RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_list_create(&list, &ptr, func);
RNA_parameter_set_lookup(&list, "keyconfig", &config); RNA_parameter_set_lookup(&list, "keyconfig", &config);
gzgt->ext.call(NULL, &ptr, func, &list); gzgt->rna_ext.call(NULL, &ptr, func, &list);
RNA_parameter_get_lookup(&list, "keymap", &ret); RNA_parameter_get_lookup(&list, "keymap", &ret);
wmKeyMap *keymap = *(wmKeyMap **)ret; wmKeyMap *keymap = *(wmKeyMap **)ret;
@ -731,12 +731,12 @@ static void rna_gizmogroup_refresh_cb(const bContext *C, wmGizmoGroup *gzgroup)
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, gzgroup->type->ext.srna, gzgroup, &gzgroup_ptr); RNA_pointer_create(NULL, gzgroup->type->rna_ext.srna, gzgroup, &gzgroup_ptr);
func = &rna_GizmoGroup_refresh_func; /* RNA_struct_find_function(&wgroupr, "refresh"); */ func = &rna_GizmoGroup_refresh_func; /* RNA_struct_find_function(&wgroupr, "refresh"); */
RNA_parameter_list_create(&list, &gzgroup_ptr, func); RNA_parameter_list_create(&list, &gzgroup_ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
gzgroup->type->ext.call((bContext *)C, &gzgroup_ptr, func, &list); gzgroup->type->rna_ext.call((bContext *)C, &gzgroup_ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -749,13 +749,13 @@ static void rna_gizmogroup_draw_prepare_cb(const bContext *C, wmGizmoGroup *gzgr
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, gzgroup->type->ext.srna, gzgroup, &gzgroup_ptr); RNA_pointer_create(NULL, gzgroup->type->rna_ext.srna, gzgroup, &gzgroup_ptr);
func = func =
&rna_GizmoGroup_draw_prepare_func; /* RNA_struct_find_function(&wgroupr, "draw_prepare"); */ &rna_GizmoGroup_draw_prepare_func; /* RNA_struct_find_function(&wgroupr, "draw_prepare"); */
RNA_parameter_list_create(&list, &gzgroup_ptr, func); RNA_parameter_list_create(&list, &gzgroup_ptr, func);
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
gzgroup->type->ext.call((bContext *)C, &gzgroup_ptr, func, &list); gzgroup->type->rna_ext.call((bContext *)C, &gzgroup_ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -771,7 +771,7 @@ static void rna_gizmogroup_invoke_prepare_cb(const bContext *C,
ParameterList list; ParameterList list;
FunctionRNA *func; FunctionRNA *func;
RNA_pointer_create(NULL, gzgroup->type->ext.srna, gzgroup, &gzgroup_ptr); RNA_pointer_create(NULL, gzgroup->type->rna_ext.srna, gzgroup, &gzgroup_ptr);
/* RNA_struct_find_function(&wgroupr, "invoke_prepare"); */ /* RNA_struct_find_function(&wgroupr, "invoke_prepare"); */
func = &rna_GizmoGroup_invoke_prepare_func; func = &rna_GizmoGroup_invoke_prepare_func;
@ -779,7 +779,7 @@ static void rna_gizmogroup_invoke_prepare_cb(const bContext *C,
RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "context", &C);
RNA_parameter_set_lookup(&list, "gizmo", &gz); RNA_parameter_set_lookup(&list, "gizmo", &gz);
RNA_parameter_set_lookup(&list, "event", &event); RNA_parameter_set_lookup(&list, "event", &event);
gzgroup->type->ext.call((bContext *)C, &gzgroup_ptr, func, &list); gzgroup->type->rna_ext.call((bContext *)C, &gzgroup_ptr, func, &list);
RNA_parameter_list_free(&list); RNA_parameter_list_free(&list);
} }
@ -846,8 +846,8 @@ static StructRNA *rna_GizmoGroup_register(Main *bmain,
/* check if we have registered this gizmogroup type before, and remove it */ /* check if we have registered this gizmogroup type before, and remove it */
{ {
wmGizmoGroupType *gzgt = WM_gizmogrouptype_find(dummywgt.idname, true); wmGizmoGroupType *gzgt = WM_gizmogrouptype_find(dummywgt.idname, true);
if (gzgt && gzgt->ext.srna) { if (gzgt && gzgt->rna_ext.srna) {
rna_GizmoGroup_unregister(bmain, gzgt->ext.srna); rna_GizmoGroup_unregister(bmain, gzgt->rna_ext.srna);
} }
} }
if (!RNA_struct_available_or_report(reports, dummywgt.idname)) { if (!RNA_struct_available_or_report(reports, dummywgt.idname)) {
@ -869,14 +869,14 @@ static StructRNA *rna_GizmoGroup_register(Main *bmain,
} }
/* create a new gizmogroup type */ /* create a new gizmogroup type */
dummywgt.ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummywgt.idname, &RNA_GizmoGroup); dummywgt.rna_ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, dummywgt.idname, &RNA_GizmoGroup);
/* Gizmo group properties are registered separately. */ /* Gizmo group properties are registered separately. */
RNA_def_struct_flag(dummywgt.ext.srna, STRUCT_NO_IDPROPERTIES); RNA_def_struct_flag(dummywgt.rna_ext.srna, STRUCT_NO_IDPROPERTIES);
dummywgt.ext.data = data; dummywgt.rna_ext.data = data;
dummywgt.ext.call = call; dummywgt.rna_ext.call = call;
dummywgt.ext.free = free; dummywgt.rna_ext.free = free;
/* We used to register widget group types like this, now we do it similar to /* We used to register widget group types like this, now we do it similar to
* operator types. Thus we should be able to do the same as operator types now. */ * operator types. Thus we should be able to do the same as operator types now. */
@ -904,7 +904,7 @@ static StructRNA *rna_GizmoGroup_register(Main *bmain,
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
} }
return dummywgt.ext.srna; return dummywgt.rna_ext.srna;
} }
static void rna_GizmoGroup_unregister(struct Main *bmain, StructRNA *type) static void rna_GizmoGroup_unregister(struct Main *bmain, StructRNA *type)
@ -915,7 +915,7 @@ static void rna_GizmoGroup_unregister(struct Main *bmain, StructRNA *type)
return; return;
} }
RNA_struct_free_extension(type, &gzgt->ext); RNA_struct_free_extension(type, &gzgt->rna_ext);
RNA_struct_free(&BLENDER_RNA, type); RNA_struct_free(&BLENDER_RNA, type);
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL);
@ -934,7 +934,8 @@ static void **rna_GizmoGroup_instance(PointerRNA *ptr)
static StructRNA *rna_GizmoGroup_refine(PointerRNA *gzgroup_ptr) static StructRNA *rna_GizmoGroup_refine(PointerRNA *gzgroup_ptr)
{ {
wmGizmoGroup *gzgroup = gzgroup_ptr->data; wmGizmoGroup *gzgroup = gzgroup_ptr->data;
return (gzgroup->type && gzgroup->type->ext.srna) ? gzgroup->type->ext.srna : &RNA_GizmoGroup; return (gzgroup->type && gzgroup->type->rna_ext.srna) ? gzgroup->type->rna_ext.srna :
&RNA_GizmoGroup;
} }
static void rna_GizmoGroup_gizmos_begin(CollectionPropertyIterator *iter, PointerRNA *gzgroup_ptr) static void rna_GizmoGroup_gizmos_begin(CollectionPropertyIterator *iter, PointerRNA *gzgroup_ptr)

View File

@ -228,7 +228,7 @@ void register_node_tree_type_cmp(void)
tt->get_from_context = composite_get_from_context; tt->get_from_context = composite_get_from_context;
tt->node_add_init = composite_node_add_init; tt->node_add_init = composite_node_add_init;
tt->ext.srna = &RNA_CompositorNodeTree; tt->rna_ext.srna = &RNA_CompositorNodeTree;
ntreeTypeAdd(tt); ntreeTypeAdd(tt);
} }

View File

@ -46,9 +46,9 @@ void register_node_type_cmp_group(void)
ntype.poll_instance = node_group_poll_instance; ntype.poll_instance = node_group_poll_instance;
ntype.insert_link = node_insert_link_default; ntype.insert_link = node_insert_link_default;
ntype.update_internal_links = node_update_internal_links_default; ntype.update_internal_links = node_update_internal_links_default;
ntype.ext.srna = RNA_struct_find("CompositorNodeGroup"); ntype.rna_ext.srna = RNA_struct_find("CompositorNodeGroup");
BLI_assert(ntype.ext.srna != NULL); BLI_assert(ntype.rna_ext.srna != NULL);
RNA_struct_blender_type_set(ntype.ext.srna, &ntype); RNA_struct_blender_type_set(ntype.rna_ext.srna, &ntype);
node_type_socket_templates(&ntype, NULL, NULL); node_type_socket_templates(&ntype, NULL, NULL);
node_type_size(&ntype, 140, 60, 400); node_type_size(&ntype, 140, 60, 400);

View File

@ -206,7 +206,7 @@ void register_node_tree_type_sh(void)
tt->get_from_context = shader_get_from_context; tt->get_from_context = shader_get_from_context;
tt->validate_link = shader_validate_link; tt->validate_link = shader_validate_link;
tt->ext.srna = &RNA_ShaderNodeTree; tt->rna_ext.srna = &RNA_ShaderNodeTree;
ntreeTypeAdd(tt); ntreeTypeAdd(tt);
} }

View File

@ -238,9 +238,9 @@ void register_node_type_sh_group(void)
ntype.poll_instance = node_group_poll_instance; ntype.poll_instance = node_group_poll_instance;
ntype.insert_link = node_insert_link_default; ntype.insert_link = node_insert_link_default;
ntype.update_internal_links = node_update_internal_links_default; ntype.update_internal_links = node_update_internal_links_default;
ntype.ext.srna = RNA_struct_find("ShaderNodeGroup"); ntype.rna_ext.srna = RNA_struct_find("ShaderNodeGroup");
BLI_assert(ntype.ext.srna != NULL); BLI_assert(ntype.rna_ext.srna != NULL);
RNA_struct_blender_type_set(ntype.ext.srna, &ntype); RNA_struct_blender_type_set(ntype.rna_ext.srna, &ntype);
node_type_socket_templates(&ntype, NULL, NULL); node_type_socket_templates(&ntype, NULL, NULL);
node_type_size(&ntype, 140, 60, 400); node_type_size(&ntype, 140, 60, 400);

View File

@ -172,7 +172,7 @@ void register_node_tree_type_tex(void)
tt->local_merge = local_merge; tt->local_merge = local_merge;
tt->get_from_context = texture_get_from_context; tt->get_from_context = texture_get_from_context;
tt->ext.srna = &RNA_TextureNodeTree; tt->rna_ext.srna = &RNA_TextureNodeTree;
ntreeTypeAdd(tt); ntreeTypeAdd(tt);
} }

View File

@ -167,9 +167,9 @@ void register_node_type_tex_group(void)
ntype.poll_instance = node_group_poll_instance; ntype.poll_instance = node_group_poll_instance;
ntype.insert_link = node_insert_link_default; ntype.insert_link = node_insert_link_default;
ntype.update_internal_links = node_update_internal_links_default; ntype.update_internal_links = node_update_internal_links_default;
ntype.ext.srna = RNA_struct_find("TextureNodeGroup"); ntype.rna_ext.srna = RNA_struct_find("TextureNodeGroup");
BLI_assert(ntype.ext.srna != NULL); BLI_assert(ntype.rna_ext.srna != NULL);
RNA_struct_blender_type_set(ntype.ext.srna, &ntype); RNA_struct_blender_type_set(ntype.rna_ext.srna, &ntype);
node_type_socket_templates(&ntype, NULL, NULL); node_type_socket_templates(&ntype, NULL, NULL);
node_type_size(&ntype, 140, 60, 400); node_type_size(&ntype, 140, 60, 400);

View File

@ -101,8 +101,8 @@ fail:
static void gizmo_properties_init(wmGizmoType *gzt) static void gizmo_properties_init(wmGizmoType *gzt)
{ {
PyTypeObject *py_class = gzt->ext.data; PyTypeObject *py_class = gzt->rna_ext.data;
RNA_struct_blender_type_set(gzt->ext.srna, gzt); RNA_struct_blender_type_set(gzt->rna_ext.srna, gzt);
/* only call this so pyrna_deferred_register_class gives a useful error /* only call this so pyrna_deferred_register_class gives a useful error
* WM_operatortype_append_ptr will call RNA_def_struct_identifier * WM_operatortype_append_ptr will call RNA_def_struct_identifier
@ -160,9 +160,9 @@ void BPY_RNA_gizmo_wrapper(wmGizmoType *gzt, void *userdata)
/* don't do translations here yet */ /* don't do translations here yet */
#if 0 #if 0
/* Use i18n context from ext.srna if possible (py gizmogroups). */ /* Use i18n context from rna_ext.srna if possible (py gizmogroups). */
if (gt->ext.srna) { if (gt->rna_ext.srna) {
RNA_def_struct_translation_context(gt->srna, RNA_struct_translation_context(gt->ext.srna)); RNA_def_struct_translation_context(gt->srna, RNA_struct_translation_context(gt->rna_ext.srna));
} }
#endif #endif
@ -179,8 +179,8 @@ void BPY_RNA_gizmo_wrapper(wmGizmoType *gzt, void *userdata)
static void gizmogroup_properties_init(wmGizmoGroupType *gzgt) static void gizmogroup_properties_init(wmGizmoGroupType *gzgt)
{ {
PyTypeObject *py_class = gzgt->ext.data; PyTypeObject *py_class = gzgt->rna_ext.data;
RNA_struct_blender_type_set(gzgt->ext.srna, gzgt); RNA_struct_blender_type_set(gzgt->rna_ext.srna, gzgt);
/* only call this so pyrna_deferred_register_class gives a useful error /* only call this so pyrna_deferred_register_class gives a useful error
* WM_operatortype_append_ptr will call RNA_def_struct_identifier * WM_operatortype_append_ptr will call RNA_def_struct_identifier
@ -203,9 +203,9 @@ void BPY_RNA_gizmogroup_wrapper(wmGizmoGroupType *gzgt, void *userdata)
/* don't do translations here yet */ /* don't do translations here yet */
#if 0 #if 0
/* Use i18n context from ext.srna if possible (py gizmogroups). */ /* Use i18n context from rna_ext.srna if possible (py gizmogroups). */
if (gzgt->ext.srna) { if (gzgt->rna_ext.srna) {
RNA_def_struct_translation_context(gzgt->srna, RNA_struct_translation_context(gzgt->ext.srna)); RNA_def_struct_translation_context(gzgt->srna, RNA_struct_translation_context(gzgt->rna_ext.srna));
} }
#endif #endif

View File

@ -39,8 +39,8 @@
static void operator_properties_init(wmOperatorType *ot) static void operator_properties_init(wmOperatorType *ot)
{ {
PyTypeObject *py_class = ot->ext.data; PyTypeObject *py_class = ot->rna_ext.data;
RNA_struct_blender_type_set(ot->ext.srna, ot); RNA_struct_blender_type_set(ot->rna_ext.srna, ot);
/* Only call this so pyrna_deferred_register_class gives a useful error /* Only call this so pyrna_deferred_register_class gives a useful error
* WM_operatortype_append_ptr will call RNA_def_struct_identifier later. * WM_operatortype_append_ptr will call RNA_def_struct_identifier later.
@ -123,9 +123,9 @@ void BPY_RNA_operator_wrapper(wmOperatorType *ot, void *userdata)
*ot = *((wmOperatorType *)userdata); *ot = *((wmOperatorType *)userdata);
ot->srna = srna; /* restore */ ot->srna = srna; /* restore */
/* Use i18n context from ext.srna if possible (py operators). */ /* Use i18n context from rna_ext.srna if possible (py operators). */
if (ot->ext.srna) { if (ot->rna_ext.srna) {
RNA_def_struct_translation_context(ot->srna, RNA_struct_translation_context(ot->ext.srna)); RNA_def_struct_translation_context(ot->srna, RNA_struct_translation_context(ot->rna_ext.srna));
} }
operator_properties_init(ot); operator_properties_init(ot);
@ -142,11 +142,11 @@ void BPY_RNA_operator_macro_wrapper(wmOperatorType *ot, void *userdata)
ot->flag |= data->flag; /* append flags to the one set by registration */ ot->flag |= data->flag; /* append flags to the one set by registration */
ot->pyop_poll = data->pyop_poll; ot->pyop_poll = data->pyop_poll;
ot->ui = data->ui; ot->ui = data->ui;
ot->ext = data->ext; ot->rna_ext = data->rna_ext;
/* Use i18n context from ext.srna if possible (py operators). */ /* Use i18n context from rna_ext.srna if possible (py operators). */
if (ot->ext.srna) { if (ot->rna_ext.srna) {
RNA_def_struct_translation_context(ot->srna, RNA_struct_translation_context(ot->ext.srna)); RNA_def_struct_translation_context(ot->srna, RNA_struct_translation_context(ot->rna_ext.srna));
} }
operator_properties_init(ot); operator_properties_init(ot);

View File

@ -4091,7 +4091,7 @@ static PyObject *pyrna_struct_bl_rna_get_subclass(PyObject *cls, PyObject *args)
if (srna_base == &RNA_Node) { if (srna_base == &RNA_Node) {
bNodeType *nt = nodeTypeFind(id); bNodeType *nt = nodeTypeFind(id);
if (nt) { if (nt) {
RNA_pointer_create(NULL, &RNA_Struct, nt->ext.srna, &ptr); RNA_pointer_create(NULL, &RNA_Struct, nt->rna_ext.srna, &ptr);
return pyrna_struct_CreatePyObject(&ptr); return pyrna_struct_CreatePyObject(&ptr);
} }
} }

View File

@ -110,7 +110,7 @@ typedef struct RenderEngineType {
struct DrawEngineType *draw_engine; struct DrawEngineType *draw_engine;
/* RNA integration */ /* RNA integration */
ExtensionRNA ext; ExtensionRNA rna_ext;
} RenderEngineType; } RenderEngineType;
typedef void (*update_render_passes_cb_t)(void *userdata, typedef void (*update_render_passes_cb_t)(void *userdata,

View File

@ -87,8 +87,8 @@ void RE_engines_exit(void)
BLI_remlink(&R_engines, type); BLI_remlink(&R_engines, type);
if (!(type->flag & RE_INTERNAL)) { if (!(type->flag & RE_INTERNAL)) {
if (type->ext.free) { if (type->rna_ext.free) {
type->ext.free(type->ext.data); type->rna_ext.free(type->rna_ext.data);
} }
MEM_freeN(type); MEM_freeN(type);

View File

@ -760,7 +760,7 @@ typedef struct wmOperatorType {
bool (*pyop_poll)(struct bContext *, struct wmOperatorType *ot) ATTR_WARN_UNUSED_RESULT; bool (*pyop_poll)(struct bContext *, struct wmOperatorType *ot) ATTR_WARN_UNUSED_RESULT;
/** RNA integration */ /** RNA integration */
ExtensionRNA ext; ExtensionRNA rna_ext;
/** Flag last for padding */ /** Flag last for padding */
short flag; short flag;

View File

@ -381,7 +381,7 @@ typedef struct wmGizmoType {
struct StructRNA *srna; struct StructRNA *srna;
/** RNA integration. */ /** RNA integration. */
ExtensionRNA ext; ExtensionRNA rna_ext;
ListBase target_property_defs; ListBase target_property_defs;
int target_property_defs_len; int target_property_defs_len;
@ -436,7 +436,7 @@ typedef struct wmGizmoGroupType {
struct StructRNA *srna; struct StructRNA *srna;
/** RNA integration. */ /** RNA integration. */
ExtensionRNA ext; ExtensionRNA rna_ext;
eWM_GizmoFlagGroupTypeFlag flag; eWM_GizmoFlagGroupTypeFlag flag;

View File

@ -144,7 +144,7 @@ wmGizmoGroupTypeRef *WM_gizmogrouptype_append_and_link(wmGizmoMapType *gzmap_typ
*/ */
static void gizmogrouptype_free(wmGizmoGroupType *gzgt) static void gizmogrouptype_free(wmGizmoGroupType *gzgt)
{ {
if (gzgt->ext.srna) { /* python gizmo group, allocs own string */ if (gzgt->rna_ext.srna) { /* python gizmo group, allocs own string */
MEM_freeN((void *)gzgt->idname); MEM_freeN((void *)gzgt->idname);
} }

View File

@ -120,7 +120,7 @@ void WM_gizmotype_append_ptr(void (*gtfunc)(struct wmGizmoType *, void *), void
*/ */
static void gizmotype_free(wmGizmoType *gzt) static void gizmotype_free(wmGizmoType *gzt)
{ {
if (gzt->ext.srna) { /* python gizmo, allocs own string */ if (gzt->rna_ext.srna) { /* python gizmo, allocs own string */
MEM_freeN((void *)gzt->idname); MEM_freeN((void *)gzt->idname);
} }

View File

@ -87,8 +87,8 @@ void WM_menutype_free(void)
GHASH_ITER (gh_iter, menutypes_hash) { GHASH_ITER (gh_iter, menutypes_hash) {
MenuType *mt = BLI_ghashIterator_getValue(&gh_iter); MenuType *mt = BLI_ghashIterator_getValue(&gh_iter);
if (mt->ext.free) { if (mt->rna_ext.free) {
mt->ext.free(mt->ext.data); mt->rna_ext.free(mt->rna_ext.data);
} }
} }

View File

@ -199,7 +199,7 @@ static void operatortype_ghash_free_cb(wmOperatorType *ot)
wm_operatortype_free_macro(ot); wm_operatortype_free_macro(ot);
} }
if (ot->ext.srna) { if (ot->rna_ext.srna) {
/* python operator, allocs own string */ /* python operator, allocs own string */
MEM_freeN((void *)ot->idname); MEM_freeN((void *)ot->idname);
} }
@ -507,9 +507,9 @@ wmOperatorType *WM_operatortype_append_macro(const char *idname,
RNA_def_struct_ui_text(ot->srna, ot->name, ot->description); RNA_def_struct_ui_text(ot->srna, ot->name, ot->description);
RNA_def_struct_identifier(&BLENDER_RNA, ot->srna, ot->idname); RNA_def_struct_identifier(&BLENDER_RNA, ot->srna, ot->idname);
/* Use i18n context from ext.srna if possible (py operators). */ /* Use i18n context from rna_ext.srna if possible (py operators). */
i18n_context = ot->ext.srna ? RNA_struct_translation_context(ot->ext.srna) : i18n_context = ot->rna_ext.srna ? RNA_struct_translation_context(ot->rna_ext.srna) :
BLT_I18NCONTEXT_OPERATOR_DEFAULT; BLT_I18NCONTEXT_OPERATOR_DEFAULT;
RNA_def_struct_translation_context(ot->srna, i18n_context); RNA_def_struct_translation_context(ot->srna, i18n_context);
ot->translation_context = i18n_context; ot->translation_context = i18n_context;

View File

@ -82,8 +82,8 @@ void WM_uilisttype_free(void)
GHASH_ITER (gh_iter, uilisttypes_hash) { GHASH_ITER (gh_iter, uilisttypes_hash) {
uiListType *ult = BLI_ghashIterator_getValue(&gh_iter); uiListType *ult = BLI_ghashIterator_getValue(&gh_iter);
if (ult->ext.free) { if (ult->rna_ext.free) {
ult->ext.free(ult->ext.data); ult->rna_ext.free(ult->rna_ext.data);
} }
} }