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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2008-11-24 18:51:55 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-11-24 18:51:55 +0300
commit2a8484bc24f0ac31bcc48c96d2ea12c03c257dab (patch)
treed4f39e9f940cb9f9ef49191794998463a1185a53 /source/blender/editors
parent0c625e20ad070560ce4ea8fb78096a3119a8357e (diff)
RNA
* Disable editable pointers for now, difficult to support well. * Swap parameters in RNA_access.h functions to make it more consistent. * Rename rna members for operators to wmOperatorType.srna, and wmOperator.ptr, to make the distincton a bit clearer. • Removed the RNA_int_default and similar functions, they're too confusing. RNA_property_is_set can still be used to achieve the same goal. * Add functions to create RNA pointers. Some example code for RNA data access and operator properties: http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNAExampleCode
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface.c86
-rw-r--r--source/blender/editors/screen/screen_ops.c70
-rw-r--r--source/blender/editors/space_outliner/space_outliner.c47
-rw-r--r--source/blender/editors/space_time/time_ops.c8
4 files changed, 105 insertions, 106 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 4e14916e396..9ffd252c231 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1058,7 +1058,7 @@ int ui_is_but_float(uiBut *but)
if(but->pointype==FLO && but->poin)
return 1;
- if(but->rnaprop && RNA_property_type(but->rnaprop, &but->rnapoin) == PROP_FLOAT)
+ if(but->rnaprop && RNA_property_type(&but->rnapoin, but->rnaprop) == PROP_FLOAT)
return 1;
return 0;
@@ -1075,27 +1075,27 @@ double ui_get_but_val(uiBut *but)
if(but->rnaprop) {
prop= but->rnaprop;
- switch(RNA_property_type(prop, &but->rnapoin)) {
+ switch(RNA_property_type(&but->rnapoin, prop)) {
case PROP_BOOLEAN:
- if(RNA_property_array_length(prop, &but->rnapoin))
- value= RNA_property_boolean_get_array(prop, &but->rnapoin, but->rnaindex);
+ if(RNA_property_array_length(&but->rnapoin, prop))
+ value= RNA_property_boolean_get_array(&but->rnapoin, prop, but->rnaindex);
else
- value= RNA_property_boolean_get(prop, &but->rnapoin);
+ value= RNA_property_boolean_get(&but->rnapoin, prop);
break;
case PROP_INT:
- if(RNA_property_array_length(prop, &but->rnapoin))
- value= RNA_property_int_get_array(prop, &but->rnapoin, but->rnaindex);
+ if(RNA_property_array_length(&but->rnapoin, prop))
+ value= RNA_property_int_get_array(&but->rnapoin, prop, but->rnaindex);
else
- value= RNA_property_int_get(prop, &but->rnapoin);
+ value= RNA_property_int_get(&but->rnapoin, prop);
break;
case PROP_FLOAT:
- if(RNA_property_array_length(prop, &but->rnapoin))
- value= RNA_property_float_get_array(prop, &but->rnapoin, but->rnaindex);
+ if(RNA_property_array_length(&but->rnapoin, prop))
+ value= RNA_property_float_get_array(&but->rnapoin, prop, but->rnaindex);
else
- value= RNA_property_float_get(prop, &but->rnapoin);
+ value= RNA_property_float_get(&but->rnapoin, prop);
break;
case PROP_ENUM:
- value= RNA_property_enum_get(prop, &but->rnapoin);
+ value= RNA_property_enum_get(&but->rnapoin, prop);
break;
default:
value= 0.0;
@@ -1138,28 +1138,28 @@ void ui_set_but_val(uiBut *but, double value)
if(but->rnaprop) {
prop= but->rnaprop;
- if(RNA_property_editable(prop, &but->rnapoin)) {
- switch(RNA_property_type(prop, &but->rnapoin)) {
+ if(RNA_property_editable(&but->rnapoin, prop)) {
+ switch(RNA_property_type(&but->rnapoin, prop)) {
case PROP_BOOLEAN:
- if(RNA_property_array_length(prop, &but->rnapoin))
- RNA_property_boolean_set_array(prop, &but->rnapoin, but->rnaindex, value);
+ if(RNA_property_array_length(&but->rnapoin, prop))
+ RNA_property_boolean_set_array(&but->rnapoin, prop, but->rnaindex, value);
else
- RNA_property_boolean_set(prop, &but->rnapoin, value);
+ RNA_property_boolean_set(&but->rnapoin, prop, value);
break;
case PROP_INT:
- if(RNA_property_array_length(prop, &but->rnapoin))
- RNA_property_int_set_array(prop, &but->rnapoin, but->rnaindex, value);
+ if(RNA_property_array_length(&but->rnapoin, prop))
+ RNA_property_int_set_array(&but->rnapoin, prop, but->rnaindex, value);
else
- RNA_property_int_set(prop, &but->rnapoin, value);
+ RNA_property_int_set(&but->rnapoin, prop, value);
break;
case PROP_FLOAT:
- if(RNA_property_array_length(prop, &but->rnapoin))
- RNA_property_float_set_array(prop, &but->rnapoin, but->rnaindex, value);
+ if(RNA_property_array_length(&but->rnapoin, prop))
+ RNA_property_float_set_array(&but->rnapoin, prop, but->rnaindex, value);
else
- RNA_property_float_set(prop, &but->rnapoin, value);
+ RNA_property_float_set(&but->rnapoin, prop, value);
break;
case PROP_ENUM:
- RNA_property_enum_set(prop, &but->rnapoin, value);
+ RNA_property_enum_set(&but->rnapoin, prop, value);
break;
default:
break;
@@ -1225,7 +1225,7 @@ void ui_get_but_string(uiBut *but, char *str, int maxlen)
if(but->rnaprop) {
char *buf;
- buf= RNA_property_string_get_alloc(but->rnaprop, &but->rnapoin, str, maxlen);
+ buf= RNA_property_string_get_alloc(&but->rnapoin, but->rnaprop, str, maxlen);
if(buf != str) {
/* string was too long, we have to truncate */
@@ -1241,7 +1241,7 @@ void ui_get_but_string(uiBut *but, char *str, int maxlen)
void ui_set_but_string(uiBut *but, const char *str)
{
if(but->rnaprop)
- RNA_property_string_set(but->rnaprop, &but->rnapoin, str);
+ RNA_property_string_set(&but->rnapoin, but->rnaprop, str);
else
BLI_strncpy(but->poin, str, but->max);
}
@@ -2237,32 +2237,32 @@ uiBut *uiDefRNABut(uiBlock *block, int retval, PointerRNA *ptr, PropertyRNA *pro
{
uiBut *but;
- switch(RNA_property_type(prop, ptr)) {
+ switch(RNA_property_type(ptr, prop)) {
case PROP_BOOLEAN: {
int value, length;
- length= RNA_property_array_length(prop, ptr);
+ length= RNA_property_array_length(ptr, prop);
if(length)
- value= RNA_property_boolean_get_array(prop, ptr, index);
+ value= RNA_property_boolean_get_array(ptr, prop, index);
else
- value= RNA_property_boolean_get(prop, ptr);
+ value= RNA_property_boolean_get(ptr, prop);
- but= ui_def_but(block, TOG, 0, (value)? "True": "False", x1, y1, x2, y2, NULL, 0, 0, 0, 0, (char*)RNA_property_ui_description(prop, ptr));
+ but= ui_def_but(block, TOG, 0, (value)? "True": "False", x1, y1, x2, y2, NULL, 0, 0, 0, 0, (char*)RNA_property_ui_description(ptr, prop));
break;
}
case PROP_INT: {
int softmin, softmax, step;
- RNA_property_int_ui_range(prop, ptr, &softmin, &softmax, &step);
- but= ui_def_but(block, NUM, 0, "", x1, y1, x2, y2, NULL, softmin, softmax, step, 0, (char*)RNA_property_ui_description(prop, ptr));
+ RNA_property_int_ui_range(ptr, prop, &softmin, &softmax, &step);
+ but= ui_def_but(block, NUM, 0, "", x1, y1, x2, y2, NULL, softmin, softmax, step, 0, (char*)RNA_property_ui_description(ptr, prop));
break;
}
case PROP_FLOAT: {
float softmin, softmax, step, precision;
- RNA_property_float_ui_range(prop, ptr, &softmin, &softmax, &step, &precision);
- but= ui_def_but(block, NUM, 0, "", x1, y1, x2, y2, NULL, softmin, softmax, step, precision, (char*)RNA_property_ui_description(prop, ptr));
+ RNA_property_float_ui_range(ptr, prop, &softmin, &softmax, &step, &precision);
+ but= ui_def_but(block, NUM, 0, "", x1, y1, x2, y2, NULL, softmin, softmax, step, precision, (char*)RNA_property_ui_description(ptr, prop));
break;
}
case PROP_ENUM: {
@@ -2271,28 +2271,28 @@ uiBut *uiDefRNABut(uiBlock *block, int retval, PointerRNA *ptr, PropertyRNA *pro
char *menu;
int i, totitem;
- RNA_property_enum_items(prop, ptr, &item, &totitem);
+ RNA_property_enum_items(ptr, prop, &item, &totitem);
dynstr= BLI_dynstr_new();
- BLI_dynstr_appendf(dynstr, "%s%%t", RNA_property_ui_name(prop, ptr));
+ BLI_dynstr_appendf(dynstr, "%s%%t", RNA_property_ui_name(ptr, prop));
for(i=0; i<totitem; i++)
BLI_dynstr_appendf(dynstr, "|%s %%x%d", item[i].name, item[i].value);
menu= BLI_dynstr_get_cstring(dynstr);
BLI_dynstr_free(dynstr);
- but= ui_def_but(block, MENU, 0, menu, x1, y1, x2, y2, NULL, 0, 0, 0, 0, (char*)RNA_property_ui_description(prop, ptr));
+ but= ui_def_but(block, MENU, 0, menu, x1, y1, x2, y2, NULL, 0, 0, 0, 0, (char*)RNA_property_ui_description(ptr, prop));
MEM_freeN(menu);
break;
}
case PROP_STRING: {
int maxlength;
- maxlength= RNA_property_string_maxlength(prop, ptr);
+ maxlength= RNA_property_string_maxlength(ptr, prop);
if(maxlength == 0)
/* interface code should ideally support unlimited length */
maxlength= UI_MAX_DRAW_STR;
- but= ui_def_but(block, TEX, 0, "", x1, y1, x2, y2, NULL, 0, maxlength, 0, 0, (char*)RNA_property_ui_description(prop, ptr));
+ but= ui_def_but(block, TEX, 0, "", x1, y1, x2, y2, NULL, 0, maxlength, 0, 0, (char*)RNA_property_ui_description(ptr, prop));
break;
}
case PROP_POINTER: {
@@ -2300,17 +2300,17 @@ uiBut *uiDefRNABut(uiBlock *block, int retval, PointerRNA *ptr, PropertyRNA *pro
PropertyRNA *nameprop;
char name[256]= "", *nameptr= name;
- RNA_property_pointer_get(prop, ptr, &pptr);
+ RNA_property_pointer_get(ptr, prop, &pptr);
if(pptr.data) {
nameprop= RNA_struct_name_property(&pptr);
if(pptr.type && nameprop)
- nameptr= RNA_property_string_get_alloc(nameprop, &pptr, name, sizeof(name));
+ nameptr= RNA_property_string_get_alloc(&pptr, nameprop, name, sizeof(name));
else
strcpy(nameptr, "->");
}
- but= ui_def_but(block, BUT, 0, nameptr, x1, y1, x2, y2, NULL, 0, 0, 0, 0, (char*)RNA_property_ui_description(prop, ptr));
+ but= ui_def_but(block, BUT, 0, nameptr, x1, y1, x2, y2, NULL, 0, 0, 0, 0, (char*)RNA_property_ui_description(ptr, prop));
but->flag |= UI_TEXT_LEFT;
if(nameptr != name)
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 5e74badb21d..f129a225aa2 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -466,8 +466,8 @@ static int area_move_init (bContext *C, wmOperator *op)
int x, y;
/* required properties */
- x= RNA_int_get(op->rna, "x");
- y= RNA_int_get(op->rna, "y");
+ x= RNA_int_get(op->ptr, "x");
+ y= RNA_int_get(op->ptr, "y");
/* setup */
actedge= screen_find_active_scredge(C->screen, x, y);
@@ -523,7 +523,7 @@ static void area_move_apply(bContext *C, wmOperator *op)
sAreaMoveData *md= op->customdata;
int delta;
- delta= RNA_int_get(op->rna, "delta");
+ delta= RNA_int_get(op->ptr, "delta");
area_move_apply_do(C, md->origval, delta, md->dir, md->bigger, md->smaller);
}
@@ -552,8 +552,8 @@ static int area_move_exec(bContext *C, wmOperator *op)
/* interaction callback */
static int area_move_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- RNA_int_default(op->rna, "x", event->x);
- RNA_int_default(op->rna, "y", event->y);
+ RNA_int_set(op->ptr, "x", event->x);
+ RNA_int_set(op->ptr, "y", event->y);
if(!area_move_init(C, op))
return OPERATOR_PASS_THROUGH;
@@ -568,7 +568,7 @@ static int area_move_cancel(bContext *C, wmOperator *op)
{
WM_event_remove_modal_handler(&C->window->handlers, op);
- RNA_int_set(op->rna, "delta", 0);
+ RNA_int_set(op->ptr, "delta", 0);
area_move_apply(C, op);
area_move_exit(C, op);
@@ -583,14 +583,14 @@ static int area_move_modal(bContext *C, wmOperator *op, wmEvent *event)
md= op->customdata;
- x= RNA_int_get(op->rna, "x");
- y= RNA_int_get(op->rna, "y");
+ x= RNA_int_get(op->ptr, "x");
+ y= RNA_int_get(op->ptr, "y");
/* execute the events */
switch(event->type) {
case MOUSEMOVE:
delta= (md->dir == 'v')? event->x - x: event->y - y;
- RNA_int_set(op->rna, "delta", delta);
+ RNA_int_set(op->ptr, "delta", delta);
area_move_apply(C, op);
break;
@@ -626,9 +626,9 @@ void ED_SCR_OT_area_move(wmOperatorType *ot)
ot->poll= ED_operator_screen_mainwinactive; /* when mouse is over area-edge */
/* rna */
- prop= RNA_def_property(ot->rna, "x", PROP_INT, PROP_NONE);
- prop= RNA_def_property(ot->rna, "y", PROP_INT, PROP_NONE);
- prop= RNA_def_property(ot->rna, "delta", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "x", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "y", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "delta", PROP_INT, PROP_NONE);
}
/* ************** split area operator *********************************** */
@@ -694,7 +694,7 @@ static int area_split_init(bContext *C, wmOperator *op)
if(C->area==NULL) return 0;
/* required properties */
- dir= RNA_enum_get(op->rna, "dir");
+ dir= RNA_enum_get(op->ptr, "dir");
/* minimal size */
if(dir=='v' && C->area->winx < 2*AREAMINX) return 0;
@@ -746,8 +746,8 @@ static void area_split_apply(bContext *C, wmOperator *op)
float fac;
int dir;
- fac= RNA_float_get(op->rna, "fac");
- dir= RNA_enum_get(op->rna, "dir");
+ fac= RNA_float_get(op->ptr, "fac");
+ dir= RNA_enum_get(op->ptr, "dir");
sd->narea= area_split(C->window, C->screen, sd->sarea, dir, fac);
@@ -807,13 +807,13 @@ static int area_split_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* prepare operator state vars */
if(sad->gesture_dir==AZONE_N || sad->gesture_dir==AZONE_S) {
dir= 'h';
- RNA_float_set(op->rna, "fac", ((float)(event->x - sad->sa1->v1->vec.x)) / (float)sad->sa1->winx);
+ RNA_float_set(op->ptr, "fac", ((float)(event->x - sad->sa1->v1->vec.x)) / (float)sad->sa1->winx);
}
else {
dir= 'v';
- RNA_float_set(op->rna, "fac", ((float)(event->y - sad->sa1->v1->vec.y)) / (float)sad->sa1->winy);
+ RNA_float_set(op->ptr, "fac", ((float)(event->y - sad->sa1->v1->vec.y)) / (float)sad->sa1->winy);
}
- RNA_enum_set(op->rna, "dir", dir);
+ RNA_enum_set(op->ptr, "dir", dir);
/* general init, also non-UI case, adds customdata, sets area and defaults */
if(!area_split_init(C, op))
@@ -881,7 +881,7 @@ static int area_split_modal(bContext *C, wmOperator *op, wmEvent *event)
/* execute the events */
switch(event->type) {
case MOUSEMOVE:
- dir= RNA_enum_get(op->rna, "dir");
+ dir= RNA_enum_get(op->ptr, "dir");
sd->delta= (dir == 'v')? event->x - sd->origval: event->y - sd->origval;
area_move_apply_do(C, sd->origval, sd->delta, dir, sd->bigger, sd->smaller);
@@ -922,11 +922,11 @@ void ED_SCR_OT_area_split(wmOperatorType *ot)
ot->poll= ED_operator_areaactive;
/* rna */
- prop= RNA_def_property(ot->rna, "dir", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "dir", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_direction_items);
RNA_def_property_enum_default(prop, 'h');
- prop= RNA_def_property(ot->rna, "fac", PROP_FLOAT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "fac", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_float_default(prop, 0.5f);
}
@@ -981,10 +981,10 @@ static int area_join_init(bContext *C, wmOperator *op)
int x2, y2;
/* required properties, make negative to get return 0 if not set by caller */
- x1= RNA_int_get(op->rna, "x1");
- y1= RNA_int_get(op->rna, "y1");
- x2= RNA_int_get(op->rna, "x2");
- y2= RNA_int_get(op->rna, "y2");
+ x1= RNA_int_get(op->ptr, "x1");
+ y1= RNA_int_get(op->ptr, "y1");
+ x2= RNA_int_get(op->ptr, "x2");
+ y2= RNA_int_get(op->ptr, "y2");
sa1 = screen_areahascursor(C->screen, x1, y1);
sa2 = screen_areahascursor(C->screen, x2, y2);
@@ -1060,10 +1060,10 @@ static int area_join_invoke(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_PASS_THROUGH;
/* prepare operator state vars */
- RNA_int_set(op->rna, "x1", sad->x);
- RNA_int_set(op->rna, "y1", sad->y);
- RNA_int_set(op->rna, "x2", event->x);
- RNA_int_set(op->rna, "y2", event->y);
+ RNA_int_set(op->ptr, "x1", sad->x);
+ RNA_int_set(op->ptr, "y1", sad->y);
+ RNA_int_set(op->ptr, "x2", event->x);
+ RNA_int_set(op->ptr, "y2", event->y);
if(!area_join_init(C, op))
return OPERATOR_PASS_THROUGH;
@@ -1202,13 +1202,13 @@ void ED_SCR_OT_area_join(wmOperatorType *ot)
ot->poll= ED_operator_screenactive;
/* rna */
- prop= RNA_def_property(ot->rna, "x1", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "x1", PROP_INT, PROP_NONE);
RNA_def_property_int_default(prop, -100);
- prop= RNA_def_property(ot->rna, "y1", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "y1", PROP_INT, PROP_NONE);
RNA_def_property_int_default(prop, -100);
- prop= RNA_def_property(ot->rna, "x2", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "x2", PROP_INT, PROP_NONE);
RNA_def_property_int_default(prop, -100);
- prop= RNA_def_property(ot->rna, "y2", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "y2", PROP_INT, PROP_NONE);
RNA_def_property_int_default(prop, -100);
}
@@ -1235,7 +1235,7 @@ callbacks:
static int border_select_do(bContext *C, wmOperator *op)
{
- int event_type= RNA_int_get(op->rna, "event_type");
+ int event_type= RNA_int_get(op->ptr, "event_type");
if(event_type==LEFTMOUSE)
printf("border select do select\n");
@@ -1261,7 +1261,7 @@ void ED_SCR_OT_border_select(wmOperatorType *ot)
ot->poll= ED_operator_areaactive;
/* rna */
- RNA_def_property(ot->rna, "event_type", PROP_INT, PROP_NONE);
+ RNA_def_property(ot->srna, "event_type", PROP_INT, PROP_NONE);
}
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index e272864d163..2445e02fbee 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -153,7 +153,6 @@ typedef struct CellRNA {
int lastrow, index;
CollectionPropertyIterator iter;
- PropertyRNA *iterprop;
} CellRNA;
static void rna_back_cb(void *arg_buts, void *arg_unused)
@@ -192,12 +191,12 @@ static void rna_label(CellRNA *cell, rcti *rct, uiBlock *block)
int arraylength;
prop= cell->prop;
- type= RNA_property_type(prop, &cell->ptr);
- subtype= RNA_property_subtype(prop, &cell->ptr);
- arraylength= RNA_property_array_length(prop, &cell->ptr);
+ type= RNA_property_type(&cell->ptr, prop);
+ subtype= RNA_property_subtype(&cell->ptr, prop);
+ arraylength= RNA_property_array_length(&cell->ptr, prop);
if(cell->index == -1) {
- uiDefBut(block, LABEL, 0, (char*)RNA_property_ui_name(prop, &cell->ptr), rct->xmin, rct->ymin, rct->xmax-rct->xmin, rct->ymax-rct->ymin, 0, 0, 0, 0, 0, (char*)RNA_property_ui_description(prop, &cell->ptr));
+ uiDefBut(block, LABEL, 0, (char*)RNA_property_ui_name(&cell->ptr, prop), rct->xmin, rct->ymin, rct->xmax-rct->xmin, rct->ymax-rct->ymin, 0, 0, 0, 0, 0, (char*)RNA_property_ui_description(&cell->ptr, prop));
}
else if (type != PROP_COLLECTION) {
if(arraylength == 4 && subtype == PROP_ROTATION)
@@ -220,13 +219,13 @@ static void rna_collection_but(CellRNA *cell, rcti *rct, uiBlock *block)
PropertyRNA *nameprop;
char name[256]= "", *nameptr= name;
- RNA_property_collection_lookup_int(cell->prop, &cell->ptr, cell->index, &lookup);
+ RNA_property_collection_lookup_int(&cell->ptr, cell->prop, cell->index, &lookup);
if(lookup.data) {
nameprop= RNA_struct_name_property(&lookup);
if(nameprop)
- nameptr= RNA_property_string_get_alloc(nameprop, &lookup, name, sizeof(name));
+ nameptr= RNA_property_string_get_alloc(&lookup, nameprop, name, sizeof(name));
else
sprintf(nameptr, "%d", cell->index+1);
}
@@ -248,8 +247,8 @@ static void rna_but(CellRNA *cell, rcti *rct, uiBlock *block)
int arraylength, index;
prop= cell->prop;
- type= RNA_property_type(prop, &cell->ptr);
- arraylength= RNA_property_array_length(prop, &cell->ptr);
+ type= RNA_property_type(&cell->ptr, prop);
+ arraylength= RNA_property_array_length(&cell->ptr, prop);
if(type == PROP_COLLECTION) {
/* item in a collection */
@@ -297,17 +296,17 @@ static void rna_table_cell_func(void *userdata, int row, int col, rcti *rct, uiB
if(cell->prop) {
cell->index++;
- type= RNA_property_type(cell->prop, &cell->ptr);
+ type= RNA_property_type(&cell->ptr, cell->prop);
if(type == PROP_COLLECTION)
- length= RNA_property_collection_length(cell->prop, &cell->ptr);
+ length= RNA_property_collection_length(&cell->ptr, cell->prop);
else
- length= RNA_property_array_length(cell->prop, &cell->ptr);
+ length= RNA_property_array_length(&cell->ptr, cell->prop);
/* verify if we need to go to the next property */
if(type == PROP_COLLECTION && cell->index < length);
else if(length && cell->index < length);
else {
- RNA_property_collection_next(cell->iterprop, &cell->iter);
+ RNA_property_collection_next(&cell->iter);
cell->prop= cell->iter.ptr.data;
cell->index= -1;
}
@@ -333,7 +332,7 @@ static void outliner_main_area_draw(const bContext *C, ARegion *ar)
uiTable *table;
rcti rct;
CellRNA cell;
- PropertyRNA *prop;
+ PropertyRNA *prop, *iterprop;
PointerRNA newptr;
float col[3];
int rows, cols, width, height;
@@ -355,7 +354,7 @@ static void outliner_main_area_draw(const bContext *C, ARegion *ar)
cell.space= soutliner;
cell.lastrow= -1;
- RNA_pointer_main_get(G.main, &cell.ptr);
+ RNA_main_pointer_create(G.main, &cell.ptr);
cell.prop= NULL;
/* solve RNA path or reset if fails */
@@ -378,25 +377,25 @@ static void outliner_main_area_draw(const bContext *C, ARegion *ar)
rows= 1;
cols= 2;
- cell.iterprop= RNA_struct_iterator_property(&cell.ptr);
- RNA_property_collection_begin(cell.iterprop, &cell.iter, &cell.ptr);
+ iterprop= RNA_struct_iterator_property(&cell.ptr);
+ RNA_property_collection_begin(&cell.ptr, iterprop, &cell.iter);
- for(; cell.iter.valid; RNA_property_collection_next(cell.iterprop, &cell.iter)) {
+ for(; cell.iter.valid; RNA_property_collection_next(&cell.iter)) {
prop= cell.iter.ptr.data;
- rows += 1 + RNA_property_array_length(prop, &cell.ptr);
- if(RNA_property_type(prop, &cell.ptr) == PROP_COLLECTION)
- rows += RNA_property_collection_length(prop, &cell.ptr);
+ rows += 1 + RNA_property_array_length(&cell.ptr, prop);
+ if(RNA_property_type(&cell.ptr, prop) == PROP_COLLECTION)
+ rows += RNA_property_collection_length(&cell.ptr, prop);
}
- RNA_property_collection_end(cell.iterprop, &cell.iter);
+ RNA_property_collection_end(&cell.iter);
/* create and draw table */
table= UI_table_create(rows, 2, &rct, rna_table_cell_func, &cell);
- RNA_property_collection_begin(cell.iterprop, &cell.iter, &cell.ptr);
+ RNA_property_collection_begin(&cell.ptr, iterprop, &cell.iter);
UI_table_draw(C->window, ar, table);
- RNA_property_collection_end(cell.iterprop, &cell.iter);
+ RNA_property_collection_end(&cell.iter);
UI_table_free(table);
}
diff --git a/source/blender/editors/space_time/time_ops.c b/source/blender/editors/space_time/time_ops.c
index e95f0238ab5..41a65fc20ee 100644
--- a/source/blender/editors/space_time/time_ops.c
+++ b/source/blender/editors/space_time/time_ops.c
@@ -63,7 +63,7 @@ static void change_frame_apply(bContext *C, wmOperator *op)
{
int cfra;
- cfra= RNA_int_get(op->rna, "frame");
+ cfra= RNA_int_get(op->ptr, "frame");
if(cfra < MINFRAME)
cfra= MINFRAME;
@@ -119,7 +119,7 @@ static int frame_from_event(bContext *C, wmEvent *event)
static int change_frame_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- RNA_int_default(op->rna, "frame", frame_from_event(C, event));
+ RNA_int_set(op->ptr, "frame", frame_from_event(C, event));
change_frame_init(C, op);
change_frame_apply(C, op);
@@ -140,7 +140,7 @@ static int change_frame_modal(bContext *C, wmOperator *op, wmEvent *event)
/* execute the events */
switch(event->type) {
case MOUSEMOVE:
- RNA_int_set(op->rna, "frame", frame_from_event(C, event));
+ RNA_int_set(op->ptr, "frame", frame_from_event(C, event));
change_frame_apply(C, op);
break;
@@ -171,7 +171,7 @@ void ED_TIME_OT_change_frame(wmOperatorType *ot)
ot->modal= change_frame_modal;
/* rna */
- prop= RNA_def_property(ot->rna, "frame", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(ot->srna, "frame", PROP_INT, PROP_NONE);
}
/* ************************** registration **********************************/