Blender V2.61 - r43446

bpy_util.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * Contributor(s): Campbell Barton
00019  *
00020  * ***** END GPL LICENSE BLOCK *****
00021  */
00022 
00028 #ifndef BPY_UTIL_H
00029 #define BPY_UTIL_H
00030 
00031 #if PY_VERSION_HEX <  0x03020000
00032 #error "Python 3.2 or greater is required, you'll need to update your python."
00033 #endif
00034 
00035 #include "RNA_types.h" /* for EnumPropertyItem only */
00036 
00037 struct EnumPropertyItem;
00038 struct ReportList;
00039 
00040 char *BPy_enum_as_string(struct EnumPropertyItem *item);
00041 
00042 #define BLANK_PYTHON_TYPE {PyVarObject_HEAD_INIT(NULL, 0) NULL}
00043 
00044 /* error reporting */
00045 short BPy_reports_to_error(struct ReportList *reports, PyObject *exception, const short clear);
00046 short BPy_errors_to_report(struct ReportList *reports);
00047 
00048 /* TODO - find a better solution! */
00049 struct bContext *BPy_GetContext(void);
00050 void BPy_SetContext(struct bContext *C);
00051 
00052 extern void bpy_context_update(struct bContext *C);
00053 extern void bpy_context_set(struct bContext *C, PyGILState_STATE *gilstate);
00054 extern void bpy_context_clear(struct bContext *C, PyGILState_STATE *gilstate);
00055 #endif