diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-14 07:15:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-14 07:15:25 +0300 |
commit | 72bc3f22b7d01349eaa82b58f8b03a1a26b738ba (patch) | |
tree | 2ad1f687b487dea019aa0cb4e9cf885e6df06cd1 /source/blender/python/intern | |
parent | 54190dd8e5562cf5f964e6bb60be170c9063c616 (diff) |
python api renaming and added headers for some files which didnt have one, no functionality change.
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r-- | source/blender/python/intern/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/python/intern/bpy.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_app.c | 3 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_app.h | 12 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_driver.h | 30 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 13 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_operator.c | 7 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_operator.h | 7 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_operator_wrap.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_operator_wrap.h | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_props.c | 4 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_props.h | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 3 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.h | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna_array.c | 1 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna_callback.c | 1 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_util.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_util.h | 2 |
18 files changed, 62 insertions, 34 deletions
diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt index 3c7804ab7e3..5d1a086bc75 100644 --- a/source/blender/python/intern/CMakeLists.txt +++ b/source/blender/python/intern/CMakeLists.txt @@ -52,6 +52,7 @@ set(SRC bpy.h bpy_app.h + bpy_driver.h bpy_operator.h bpy_operator_wrap.h bpy_props.h diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 15b705fd374..51e30d75e56 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -27,6 +27,8 @@ #define WITH_PYTHON /* for AUD_PyInit.h, possibly others */ +#include <Python.h> + #include "bpy.h" #include "bpy_util.h" #include "bpy_rna.h" diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index 422563776f4..bc7e981df98 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -22,7 +22,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include <Python.h> + #include "bpy_app.h" +#include "bpy_driver.h" #include "BLI_path_util.h" #include "BLI_utildefines.h" diff --git a/source/blender/python/intern/bpy_app.h b/source/blender/python/intern/bpy_app.h index 02cadc66f48..cb71880ee7e 100644 --- a/source/blender/python/intern/bpy_app.h +++ b/source/blender/python/intern/bpy_app.h @@ -21,15 +21,9 @@ * * ***** END GPL LICENSE BLOCK ***** */ -#ifndef BPY_APP_H__ -#define BPY_APP_H__ - -#include <Python.h> +#ifndef BPY_APP_H +#define BPY_APP_H PyObject *BPY_app_struct( void ); -/* bpy_driver.c */ -int bpy_pydriver_create_dict(void); -extern PyObject *bpy_pydriver_Dict; - -#endif +#endif // BPY_APP_H diff --git a/source/blender/python/intern/bpy_driver.h b/source/blender/python/intern/bpy_driver.h new file mode 100644 index 00000000000..b9aa1b54b74 --- /dev/null +++ b/source/blender/python/intern/bpy_driver.h @@ -0,0 +1,30 @@ +/** + * $Id: bpy_app.h 33348 2010-11-27 02:39:51Z campbellbarton $ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contributor(s): Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + */ +#ifndef BPY_DRIVER_H +#define BPY_DRIVER_H + +int bpy_pydriver_create_dict(void); +extern PyObject *bpy_pydriver_Dict; + +#endif // BPY_DRIVER_H diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index cf47e40c2ed..0e9532aa726 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -56,6 +56,12 @@ #include "../generic/bpy_internal_import.h" // our own imports #include "../generic/py_capi_utils.h" +/* inittab initialization functions */ +#include "../generic/noise_py_api.h" +#include "../generic/mathutils.h" +#include "../generic/bgl.h" +#include "../generic/blf_py_api.h" + /* for internal use, when starting and ending python scripts */ /* incase a python script triggers another python call, stop bpy_context_clear from invalidating */ @@ -197,12 +203,7 @@ void BPY_context_set(bContext *C) BPy_SetContext(C); } -/* init-tab */ -extern PyObject *BPyInit_noise(void); -extern PyObject *BPyInit_mathutils(void); -// extern PyObject *BPyInit_mathutils_geometry(void); // BPyInit_mathutils calls, py doesnt work with thos :S -extern PyObject *BPyInit_bgl(void); -extern PyObject *BPyInit_blf(void); +/* defined in AUD_C-API.cpp */ extern PyObject *AUD_initPython(void); static struct _inittab bpy_internal_modules[]= { diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index 70aa46c1302..bdf4027e509 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -24,9 +24,11 @@ */ /* Note, this module is not to be used directly by the user. - * its accessed from blender with bpy.__ops__ + * Internally its exposed as '_bpy.ops', which provides functions for 'bpy.ops', a python package. * */ +#include <Python.h> + #include "bpy_operator.h" #include "bpy_operator_wrap.h" #include "bpy_rna.h" /* for setting arg props only - pyrna_py_to_prop() */ @@ -41,6 +43,7 @@ #include "MEM_guardedalloc.h" #include "BKE_report.h" +#include "BKE_context.h" static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject *args) { @@ -255,7 +258,7 @@ static PyObject *pyop_as_string(PyObject *UNUSED(self), PyObject *args) char *buf = NULL; PyObject *pybuf; - bContext *C = (bContext *)BPy_GetContext(); + bContext *C= (bContext *)BPy_GetContext(); if(C==NULL) { PyErr_SetString(PyExc_SystemError, "Context is None, cant get the string representation of this object."); diff --git a/source/blender/python/intern/bpy_operator.h b/source/blender/python/intern/bpy_operator.h index 1a73b3eee55..f45f91dbe1f 100644 --- a/source/blender/python/intern/bpy_operator.h +++ b/source/blender/python/intern/bpy_operator.h @@ -25,13 +25,6 @@ #ifndef BPY_OPERATOR_H #define BPY_OPERATOR_H -#include <Python.h> - -#include "RNA_access.h" -#include "RNA_types.h" -#include "DNA_windowmanager_types.h" -#include "BKE_context.h" - extern PyTypeObject pyop_base_Type; #define BPy_OperatorBase_Check(v) (PyObject_TypeCheck(v, &pyop_base_Type)) diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index 12c67f9e03f..51ab889e321 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -23,6 +23,8 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include <Python.h> + #include "bpy_operator_wrap.h" #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/python/intern/bpy_operator_wrap.h b/source/blender/python/intern/bpy_operator_wrap.h index b61fd1323f1..1aae06c302a 100644 --- a/source/blender/python/intern/bpy_operator_wrap.h +++ b/source/blender/python/intern/bpy_operator_wrap.h @@ -25,8 +25,6 @@ #ifndef BPY_OPERATOR_WRAP_H #define BPY_OPERATOR_WRAP_H -#include <Python.h> - /* these are used for operator methods, used by bpy_operator.c */ PyObject *PYOP_wrap_macro_define(PyObject *self, PyObject *args); #endif diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 7ed5db6e6dc..e685be2238f 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -22,14 +22,14 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include <Python.h> + #include "bpy_props.h" #include "bpy_rna.h" #include "bpy_util.h" #include "BLI_utildefines.h" - - #include "RNA_define.h" /* for defining our own rna */ #include "RNA_enum_types.h" diff --git a/source/blender/python/intern/bpy_props.h b/source/blender/python/intern/bpy_props.h index fc295ccdf5d..136dd2b5b2f 100644 --- a/source/blender/python/intern/bpy_props.h +++ b/source/blender/python/intern/bpy_props.h @@ -25,8 +25,6 @@ #ifndef BPY_PROPS_H #define BPY_PROPS_H -#include <Python.h> - PyObject *BPY_rna_props( void ); #define PYRNA_STACK_ARRAY 32 diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index f3626c5f6b7..184e20a9a4b 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -21,6 +21,9 @@ * * ***** END GPL LICENSE BLOCK ***** */ + +#include <Python.h> + #include <float.h> /* FLT_MIN/MAX */ #include "bpy_rna.h" diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h index bbcc85581b2..c599ab5c95e 100644 --- a/source/blender/python/intern/bpy_rna.h +++ b/source/blender/python/intern/bpy_rna.h @@ -24,8 +24,6 @@ #ifndef BPY_RNA_H #define BPY_RNA_H -#include <Python.h> - #include "RNA_access.h" #include "RNA_types.h" #include "BKE_idprop.h" diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c index 32efa387196..b4eef666279 100644 --- a/source/blender/python/intern/bpy_rna_array.c +++ b/source/blender/python/intern/bpy_rna_array.c @@ -21,6 +21,7 @@ * * ***** END GPL LICENSE BLOCK ***** */ +#include <Python.h> #include "bpy_rna.h" #include "BKE_global.h" diff --git a/source/blender/python/intern/bpy_rna_callback.c b/source/blender/python/intern/bpy_rna_callback.c index 28b540ba418..0ff67430520 100644 --- a/source/blender/python/intern/bpy_rna_callback.c +++ b/source/blender/python/intern/bpy_rna_callback.c @@ -22,6 +22,7 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include <Python.h> #include "bpy_rna.h" #include "bpy_rna_callback.h" diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c index 8ea5e646482..0e030170a25 100644 --- a/source/blender/python/intern/bpy_util.c +++ b/source/blender/python/intern/bpy_util.c @@ -22,6 +22,8 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include <Python.h> + #include "bpy_util.h" #include "BLI_dynstr.h" #include "MEM_guardedalloc.h" diff --git a/source/blender/python/intern/bpy_util.h b/source/blender/python/intern/bpy_util.h index e89c8212e1b..e1473a563a6 100644 --- a/source/blender/python/intern/bpy_util.h +++ b/source/blender/python/intern/bpy_util.h @@ -22,8 +22,6 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include <Python.h> - #ifndef BPY_UTIL_H #define BPY_UTIL_H |