Blender  V2.93
bpy_capi_utils.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #pragma once
22 
23 #if PY_VERSION_HEX < 0x03090000
24 # error "Python 3.9 or greater is required, you'll need to update your Python."
25 #endif
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 struct EnumPropertyItem;
32 struct ReportList;
33 
34 char *BPy_enum_as_string(const struct EnumPropertyItem *item);
35 
36 /* error reporting */
37 short BPy_reports_to_error(struct ReportList *reports, PyObject *exception, const bool clear);
38 void BPy_reports_write_stdout(const struct ReportList *reports, const char *header);
39 bool BPy_errors_to_report_ex(struct ReportList *reports,
40  const char *error_prefix,
41  const bool use_full,
42  const bool use_location);
43 bool BPy_errors_to_report_brief_with_prefix(struct ReportList *reports, const char *error_prefix);
44 bool BPy_errors_to_report(struct ReportList *reports);
45 
46 struct bContext *BPY_context_get(void);
47 
48 extern void bpy_context_set(struct bContext *C, PyGILState_STATE *gilstate);
49 extern void bpy_context_clear(struct bContext *C, const PyGILState_STATE *gilstate);
50 
51 #ifdef __cplusplus
52 }
53 #endif
#define C
Definition: RandGen.cpp:39
bool BPy_errors_to_report_ex(struct ReportList *reports, const char *error_prefix, const bool use_full, const bool use_location)
struct bContext * BPY_context_get(void)
short BPy_reports_to_error(struct ReportList *reports, PyObject *exception, const bool clear)
bool BPy_errors_to_report_brief_with_prefix(struct ReportList *reports, const char *error_prefix)
void bpy_context_clear(struct bContext *C, const PyGILState_STATE *gilstate)
char * BPy_enum_as_string(const struct EnumPropertyItem *item)
void bpy_context_set(struct bContext *C, PyGILState_STATE *gilstate)
bool BPy_errors_to_report(struct ReportList *reports)
void BPy_reports_write_stdout(const struct ReportList *reports, const char *header)
static void clear(Message *msg)
Definition: msgfmt.c:294