Blender V2.61 - r43446
Defines | Typedefs | Functions

bpy_rna_array.c File Reference

#include <Python.h>
#include "RNA_types.h"
#include "bpy_rna.h"
#include "BKE_global.h"
#include "MEM_guardedalloc.h"
#include "RNA_access.h"

Go to the source code of this file.

Defines

#define USE_MATHUTILS
#define MAX_ARRAY_DIMENSION   10

Typedefs

typedef void(* ItemConvertFunc )(PyObject *, char *)
typedef int(* ItemTypeCheckFunc )(PyObject *)
typedef void(* RNA_SetArrayFunc )(PointerRNA *, PropertyRNA *, const char *)
typedef void(* RNA_SetIndexFunc )(PointerRNA *, PropertyRNA *, int index, void *)

Functions

static int validate_array_type (PyObject *seq, int dim, int totdim, int dimsize[], ItemTypeCheckFunc check_item_type, const char *item_type_str, const char *error_prefix)
static int count_items (PyObject *seq, int dim)
static int validate_array_length (PyObject *rvalue, PointerRNA *ptr, PropertyRNA *prop, int lvalue_dim, int *totitem, const char *error_prefix)
static int validate_array (PyObject *rvalue, PointerRNA *ptr, PropertyRNA *prop, int lvalue_dim, ItemTypeCheckFunc check_item_type, const char *item_type_str, int *totitem, const char *error_prefix)
static char * copy_value_single (PyObject *item, PointerRNA *ptr, PropertyRNA *prop, char *data, unsigned int item_size, int *index, ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index)
static char * copy_values (PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, int dim, char *data, unsigned int item_size, int *index, ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index)
static int py_to_array (PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, char *param_data, ItemTypeCheckFunc check_item_type, const char *item_type_str, int item_size, ItemConvertFunc convert_item, RNA_SetArrayFunc rna_set_array, const char *error_prefix)
static int py_to_array_index (PyObject *py, PointerRNA *ptr, PropertyRNA *prop, int lvalue_dim, int arrayoffset, int index, ItemTypeCheckFunc check_item_type, const char *item_type_str, ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index, const char *error_prefix)
static void py_to_float (PyObject *py, char *data)
static void py_to_int (PyObject *py, char *data)
static void py_to_bool (PyObject *py, char *data)
static int py_float_check (PyObject *py)
static int py_int_check (PyObject *py)
static int py_bool_check (PyObject *py)
static void float_set_index (PointerRNA *ptr, PropertyRNA *prop, int index, void *value)
static void int_set_index (PointerRNA *ptr, PropertyRNA *prop, int index, void *value)
static void bool_set_index (PointerRNA *ptr, PropertyRNA *prop, int index, void *value)
int pyrna_py_to_array (PointerRNA *ptr, PropertyRNA *prop, char *param_data, PyObject *py, const char *error_prefix)
int pyrna_py_to_array_index (PointerRNA *ptr, PropertyRNA *prop, int arraydim, int arrayoffset, int index, PyObject *py, const char *error_prefix)
PyObject * pyrna_array_index (PointerRNA *ptr, PropertyRNA *prop, int index)
PyObject * pyrna_py_from_array_index (BPy_PropertyArrayRNA *self, PointerRNA *ptr, PropertyRNA *prop, int index)
PyObject * pyrna_py_from_array (PointerRNA *ptr, PropertyRNA *prop)
int pyrna_array_contains_py (PointerRNA *ptr, PropertyRNA *prop, PyObject *value)

Detailed Description

This file deals with array access for 'BPy_PropertyArrayRNA' from bpy_rna.c

Definition in file bpy_rna_array.c.


Define Documentation

#define MAX_ARRAY_DIMENSION   10
#define USE_MATHUTILS

Definition at line 39 of file bpy_rna_array.c.


Typedef Documentation

typedef void(* ItemConvertFunc)(PyObject *, char *)

Definition at line 47 of file bpy_rna_array.c.

typedef int(* ItemTypeCheckFunc)(PyObject *)

Definition at line 48 of file bpy_rna_array.c.

typedef void(* RNA_SetArrayFunc)(PointerRNA *, PropertyRNA *, const char *)

Definition at line 49 of file bpy_rna_array.c.

typedef void(* RNA_SetIndexFunc)(PointerRNA *, PropertyRNA *, int index, void *)

Definition at line 50 of file bpy_rna_array.c.


Function Documentation

static void bool_set_index ( PointerRNA ptr,
PropertyRNA prop,
int  index,
void *  value 
) [static]

Definition at line 543 of file bpy_rna_array.c.

References RNA_property_boolean_set_index().

Referenced by pyrna_py_to_array_index().

static char* copy_value_single ( PyObject *  item,
PointerRNA ptr,
PropertyRNA prop,
char *  data,
unsigned int  item_size,
int *  index,
ItemConvertFunc  convert_item,
RNA_SetIndexFunc  rna_set_index 
) [static]

Definition at line 316 of file bpy_rna_array.c.

References data.

Referenced by copy_values(), and py_to_array_index().

static char* copy_values ( PyObject *  seq,
PointerRNA ptr,
PropertyRNA prop,
int  dim,
char *  data,
unsigned int  item_size,
int *  index,
ItemConvertFunc  convert_item,
RNA_SetIndexFunc  rna_set_index 
) [static]
static int count_items ( PyObject *  seq,
int  dim 
) [static]

Definition at line 154 of file bpy_rna_array.c.

References i.

Referenced by validate_array_length().

static void float_set_index ( PointerRNA ptr,
PropertyRNA prop,
int  index,
void *  value 
) [static]

Definition at line 533 of file bpy_rna_array.c.

References RNA_property_float_set_index().

Referenced by pyrna_py_to_array_index().

static void int_set_index ( PointerRNA ptr,
PropertyRNA prop,
int  index,
void *  value 
) [static]

Definition at line 538 of file bpy_rna_array.c.

References RNA_property_int_set_index().

Referenced by pyrna_py_to_array_index().

static int py_bool_check ( PyObject *  py) [static]

Definition at line 528 of file bpy_rna_array.c.

Referenced by pyrna_py_to_array(), and pyrna_py_to_array_index().

static int py_float_check ( PyObject *  py) [static]

Definition at line 516 of file bpy_rna_array.c.

Referenced by pyrna_py_to_array(), and pyrna_py_to_array_index().

static int py_int_check ( PyObject *  py) [static]

Definition at line 522 of file bpy_rna_array.c.

Referenced by pyrna_py_to_array(), and pyrna_py_to_array_index().

static int py_to_array ( PyObject *  seq,
PointerRNA ptr,
PropertyRNA prop,
char *  param_data,
ItemTypeCheckFunc  check_item_type,
const char *  item_type_str,
int  item_size,
ItemConvertFunc  convert_item,
RNA_SetArrayFunc  rna_set_array,
const char *  error_prefix 
) [static]
static int py_to_array_index ( PyObject *  py,
PointerRNA ptr,
PropertyRNA prop,
int  lvalue_dim,
int  arrayoffset,
int  index,
ItemTypeCheckFunc  check_item_type,
const char *  item_type_str,
ItemConvertFunc  convert_item,
RNA_SetIndexFunc  rna_set_index,
const char *  error_prefix 
) [static]
static void py_to_bool ( PyObject *  py,
char *  data 
) [static]

Definition at line 511 of file bpy_rna_array.c.

Referenced by pyrna_py_to_array(), and pyrna_py_to_array_index().

static void py_to_float ( PyObject *  py,
char *  data 
) [static]

Definition at line 501 of file bpy_rna_array.c.

Referenced by pyrna_py_to_array(), and pyrna_py_to_array_index().

static void py_to_int ( PyObject *  py,
char *  data 
) [static]

Definition at line 506 of file bpy_rna_array.c.

Referenced by pyrna_py_to_array(), and pyrna_py_to_array_index().

int pyrna_array_contains_py ( PointerRNA ptr,
PropertyRNA prop,
PyObject *  value 
)
PyObject* pyrna_array_index ( PointerRNA ptr,
PropertyRNA prop,
int  index 
)
PyObject* pyrna_py_from_array ( PointerRNA ptr,
PropertyRNA prop 
)

Definition at line 700 of file bpy_rna_array.c.

References pyrna_math_object_from_array(), and pyrna_prop_CreatePyObject().

Referenced by pyrna_prop_to_py().

PyObject* pyrna_py_from_array_index ( BPy_PropertyArrayRNA self,
PointerRNA ptr,
PropertyRNA prop,
int  index 
)
int pyrna_py_to_array ( PointerRNA ptr,
PropertyRNA prop,
char *  param_data,
PyObject *  py,
const char *  error_prefix 
)
int pyrna_py_to_array_index ( PointerRNA ptr,
PropertyRNA prop,
int  arraydim,
int  arrayoffset,
int  index,
PyObject *  py,
const char *  error_prefix 
)
static int validate_array ( PyObject *  rvalue,
PointerRNA ptr,
PropertyRNA prop,
int  lvalue_dim,
ItemTypeCheckFunc  check_item_type,
const char *  item_type_str,
int *  totitem,
const char *  error_prefix 
) [static]
static int validate_array_length ( PyObject *  rvalue,
PointerRNA ptr,
PropertyRNA prop,
int  lvalue_dim,
int *  totitem,
const char *  error_prefix 
) [static]
static int validate_array_type ( PyObject *  seq,
int  dim,
int  totdim,
int  dimsize[],
ItemTypeCheckFunc  check_item_type,
const char *  item_type_str,
const char *  error_prefix 
) [static]

Definition at line 67 of file bpy_rna_array.c.

References i, and NULL.

Referenced by validate_array().