diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm_gizmo.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_wm_gizmo.c | 97 |
1 files changed, 49 insertions, 48 deletions
diff --git a/source/blender/makesrna/intern/rna_wm_gizmo.c b/source/blender/makesrna/intern/rna_wm_gizmo.c index 104ad4c5e25..eb3de008e4c 100644 --- a/source/blender/makesrna/intern/rna_wm_gizmo.c +++ b/source/blender/makesrna/intern/rna_wm_gizmo.c @@ -78,12 +78,12 @@ static void rna_gizmo_draw_cb(const struct bContext *C, struct wmGizmo *gz) PointerRNA gz_ptr; ParameterList list; 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"); */ func = &rna_Gizmo_draw_func; RNA_parameter_list_create(&list, &gz_ptr, func); 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); } @@ -94,13 +94,13 @@ static void rna_gizmo_draw_select_cb(const struct bContext *C, struct wmGizmo *g PointerRNA gz_ptr; ParameterList list; 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"); */ func = &rna_Gizmo_draw_select_func; RNA_parameter_list_create(&list, &gz_ptr, func); RNA_parameter_set_lookup(&list, "context", &C); 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); } @@ -111,13 +111,13 @@ static int rna_gizmo_test_select_cb(struct bContext *C, struct wmGizmo *gz, cons PointerRNA gz_ptr; ParameterList list; 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"); */ func = &rna_Gizmo_test_select_func; RNA_parameter_list_create(&list, &gz_ptr, func); RNA_parameter_set_lookup(&list, "context", &C); 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; RNA_parameter_get_lookup(&list, "intersect_id", &ret); @@ -138,14 +138,14 @@ static int rna_gizmo_modal_cb(struct bContext *C, ParameterList list; FunctionRNA *func; 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"); */ func = &rna_Gizmo_modal_func; RNA_parameter_list_create(&list, &gz_ptr, func); RNA_parameter_set_lookup(&list, "context", &C); RNA_parameter_set_lookup(&list, "event", &event); 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; RNA_parameter_get_lookup(&list, "result", &ret); @@ -162,11 +162,11 @@ static void rna_gizmo_setup_cb(struct wmGizmo *gz) PointerRNA gz_ptr; ParameterList list; 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"); */ func = &rna_Gizmo_setup_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); } @@ -177,13 +177,13 @@ static int rna_gizmo_invoke_cb(struct bContext *C, struct wmGizmo *gz, const str PointerRNA gz_ptr; ParameterList list; 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"); */ func = &rna_Gizmo_invoke_func; RNA_parameter_list_create(&list, &gz_ptr, func); RNA_parameter_set_lookup(&list, "context", &C); 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; 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; ParameterList list; 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"); */ func = &rna_Gizmo_exit_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; 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); } @@ -220,11 +220,11 @@ static void rna_gizmo_select_refresh_cb(struct wmGizmo *gz) PointerRNA gz_ptr; ParameterList list; 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"); */ func = &rna_Gizmo_select_refresh_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); } @@ -475,8 +475,8 @@ static StructRNA *rna_Gizmo_register(Main *bmain, /* check if we have registered this gizmo type before, and remove it */ { const wmGizmoType *gzt = WM_gizmotype_find(dummygt.idname, true); - if (gzt && gzt->ext.srna) { - rna_Gizmo_unregister(bmain, gzt->ext.srna); + if (gzt && gzt->rna_ext.srna) { + rna_Gizmo_unregister(bmain, gzt->rna_ext.srna); } } 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 */ - 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 */ - RNA_def_struct_flag(dummygt.ext.srna, STRUCT_NO_IDPROPERTIES); - dummygt.ext.data = data; - dummygt.ext.call = call; - dummygt.ext.free = free; + RNA_def_struct_flag(dummygt.rna_ext.srna, STRUCT_NO_IDPROPERTIES); + dummygt.rna_ext.data = data; + dummygt.rna_ext.call = call; + dummygt.rna_ext.free = free; { int i = 0; @@ -517,7 +517,7 @@ static StructRNA *rna_Gizmo_register(Main *bmain, /* update while blender is running */ 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) @@ -528,7 +528,7 @@ static void rna_Gizmo_unregister(struct Main *bmain, StructRNA *type) return; } - RNA_struct_free_extension(type, &gzt->ext); + RNA_struct_free_extension(type, &gzt->rna_ext); RNA_struct_free(&BLENDER_RNA, type); 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) { 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; 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"); */ RNA_parameter_list_create(&list, &ptr, func); 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); visible = *(bool *)ret; @@ -688,12 +688,12 @@ static void rna_gizmogroup_setup_cb(const bContext *C, wmGizmoGroup *gzgroup) ParameterList list; 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"); */ RNA_parameter_list_create(&list, &gzgroup_ptr, func); 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); } @@ -707,13 +707,13 @@ static wmKeyMap *rna_gizmogroup_setup_keymap_cb(const wmGizmoGroupType *gzgt, wm ParameterList list; FunctionRNA *func; - RNA_pointer_create(NULL, gzgt->ext.srna, NULL, &ptr); /* dummy */ + RNA_pointer_create(NULL, gzgt->rna_ext.srna, NULL, &ptr); /* dummy */ func = &rna_GizmoGroup_setup_keymap_func; /* RNA_struct_find_function(&wgroupr, "setup_keymap"); */ RNA_parameter_list_create(&list, &ptr, func); 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); wmKeyMap *keymap = *(wmKeyMap **)ret; @@ -731,12 +731,12 @@ static void rna_gizmogroup_refresh_cb(const bContext *C, wmGizmoGroup *gzgroup) ParameterList list; 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"); */ RNA_parameter_list_create(&list, &gzgroup_ptr, func); 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); } @@ -749,13 +749,13 @@ static void rna_gizmogroup_draw_prepare_cb(const bContext *C, wmGizmoGroup *gzgr ParameterList list; 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_draw_prepare_func; /* RNA_struct_find_function(&wgroupr, "draw_prepare"); */ RNA_parameter_list_create(&list, &gzgroup_ptr, func); 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); } @@ -771,7 +771,7 @@ static void rna_gizmogroup_invoke_prepare_cb(const bContext *C, ParameterList list; 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"); */ 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, "gizmo", &gz); 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); } @@ -846,8 +846,8 @@ static StructRNA *rna_GizmoGroup_register(Main *bmain, /* check if we have registered this gizmogroup type before, and remove it */ { wmGizmoGroupType *gzgt = WM_gizmogrouptype_find(dummywgt.idname, true); - if (gzgt && gzgt->ext.srna) { - rna_GizmoGroup_unregister(bmain, gzgt->ext.srna); + if (gzgt && gzgt->rna_ext.srna) { + rna_GizmoGroup_unregister(bmain, gzgt->rna_ext.srna); } } 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 */ - 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. */ - 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.ext.call = call; - dummywgt.ext.free = free; + dummywgt.rna_ext.data = data; + dummywgt.rna_ext.call = call; + dummywgt.rna_ext.free = free; /* 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. */ @@ -904,7 +904,7 @@ static StructRNA *rna_GizmoGroup_register(Main *bmain, 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) @@ -915,7 +915,7 @@ static void rna_GizmoGroup_unregister(struct Main *bmain, StructRNA *type) return; } - RNA_struct_free_extension(type, &gzgt->ext); + RNA_struct_free_extension(type, &gzgt->rna_ext); RNA_struct_free(&BLENDER_RNA, type); 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) { 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) |