~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/blender/python/intern/bpy_util.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-07-23 08:54:18 UTC
  • mfrom: (14.2.16 sid)
  • mto: (14.2.19 sid)
  • mto: This revision was merged to the branch mainline in revision 42.
  • Revision ID: package-import@ubuntu.com-20120723085418-9foz30v6afaf5ffs
Tags: 2.63a-2
* debian/: Cycles support added (Closes: #658075)
  For now, this top feature has been enabled only
  on [any-amd64 any-i386] architectures because
  of OpenImageIO failing on all others
* debian/: scripts installation path changed
  from /usr/lib to /usr/share:
  + debian/patches/: patchset re-worked for path changing
  + debian/control: "Breaks" field added on yafaray-exporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 * $Id: bpy_util.h 27655 2010-03-22 09:30:00Z campbellbarton $
3
 
 *
 
1
/*
4
2
 * ***** BEGIN GPL LICENSE BLOCK *****
5
3
 *
6
4
 * This program is free software; you can redistribute it and/or
22
20
 * ***** END GPL LICENSE BLOCK *****
23
21
 */
24
22
 
25
 
#include <Python.h>
26
 
 
27
 
#ifndef BPY_UTIL_H
28
 
#define BPY_UTIL_H
29
 
 
30
 
#if PY_VERSION_HEX <  0x03010000
31
 
#error "Python versions below 3.1 are not supported anymore, you'll need to update your python."
 
23
/** \file blender/python/intern/bpy_util.h
 
24
 *  \ingroup pythonintern
 
25
 */
 
26
 
 
27
 
 
28
#ifndef __BPY_UTIL_H__
 
29
#define __BPY_UTIL_H__
 
30
 
 
31
#if PY_VERSION_HEX <  0x03020000
 
32
#error "Python 3.2 or greater is required, you'll need to update your python."
32
33
#endif
33
34
 
34
35
#include "RNA_types.h" /* for EnumPropertyItem only */
36
37
struct EnumPropertyItem;
37
38
struct ReportList;
38
39
 
39
 
void PyObSpit(char *name, PyObject *var);
40
 
void PyLineSpit(void);
41
 
void BPY_getFileAndNum(char **filename, int *lineno);
42
 
 
43
 
PyObject *BPY_exception_buffer(void);
44
 
 
45
 
/* own python like utility function */
46
 
PyObject *PyObject_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...);
47
 
 
48
 
 
49
 
 
50
 
/* Class type checking, use for checking classes can be added as operators, panels etc */
51
 
typedef struct BPY_class_attr_check {
52
 
        const char      *name;          /* name of the class attribute */
53
 
        char            type;           /* 's' = string, 'f' = function, 'l' = list, (add as needed) */
54
 
        int                     arg_count;      /* only for function types, -1 for undefined, includes self arg */
55
 
        int             len;            /* only for string types currently */
56
 
        int                     flag;           /* other options */
57
 
} BPY_class_attr_check;
58
 
 
59
 
/* BPY_class_attr_check, flag */
60
 
#define BPY_CLASS_ATTR_OPTIONAL 1
61
 
#define BPY_CLASS_ATTR_NONE_OK  2
62
 
 
63
 
int BPY_class_validate(const char *class_type, PyObject *class, PyObject *base_class, BPY_class_attr_check* class_attrs, PyObject **py_class_attrs);
64
 
 
65
40
char *BPy_enum_as_string(struct EnumPropertyItem *item);
66
41
 
67
 
 
68
 
#define BLANK_PYTHON_TYPE {PyVarObject_HEAD_INIT(NULL, 0) 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
 
42
#define BLANK_PYTHON_TYPE {PyVarObject_HEAD_INIT(NULL, 0) NULL}
69
43
 
70
44
/* error reporting */
71
 
int BPy_reports_to_error(struct ReportList *reports);
72
 
int BPy_errors_to_report(struct ReportList *reports);
 
45
short BPy_reports_to_error(struct ReportList *reports, PyObject *exception, const short clear);
 
46
short BPy_errors_to_report(struct ReportList *reports);
73
47
 
74
48
/* TODO - find a better solution! */
75
49
struct bContext *BPy_GetContext(void);
76
50
void BPy_SetContext(struct bContext *C);
77
51
 
 
52
extern void bpy_context_update(struct bContext *C);
78
53
extern void bpy_context_set(struct bContext *C, PyGILState_STATE *gilstate);
79
54
extern void bpy_context_clear(struct bContext *C, PyGILState_STATE *gilstate);
80
 
 
81
 
int BPyAsPrimitiveArray(void *array, PyObject *value, int length, PyTypeObject *type, char *error_prefix);
82
55
#endif