python api renaming and added headers for some files which didnt have one, no functionality change.

This commit is contained in:
Campbell Barton 2011-02-14 04:15:25 +00:00
parent 54190dd8e5
commit 72bc3f22b7
40 changed files with 134 additions and 71 deletions

View File

@ -34,13 +34,13 @@ set(SRC
blf_py_api.c
bpy_internal_import.c
mathutils.c
mathutils_color.c
mathutils_euler.c
mathutils_Color.c
mathutils_Euler.c
mathutils_Matrix.c
mathutils_Quaternion.c
mathutils_Vector.c
mathutils_geometry.c
mathutils_matrix.c
mathutils_quat.c
mathutils_vector.c
noise.c
noise_py_api.c
py_capi_utils.c
IDProp.h
@ -48,13 +48,15 @@ set(SRC
blf_py_api.h
bpy_internal_import.h
mathutils.h
mathutils_color.h
mathutils_euler.h
mathutils_Color.h
mathutils_Euler.h
mathutils_Matrix.h
mathutils_Quaternion.h
mathutils_Vector.h
mathutils_geometry.h
mathutils_matrix.h
mathutils_quat.h
mathutils_vector.h
noise_py_api.h
py_capi_utils.h
)
blender_add_lib(bf_python_ext "${SRC}" "${INC}")

View File

@ -23,6 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
#include "IDProp.h"
#include "MEM_guardedalloc.h"

View File

@ -22,7 +22,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
#ifndef IDPROP_H
#define IDPROP_H
struct ID;
struct IDProperty;
@ -62,3 +63,5 @@ void IDProp_Init_Types(void);
#define IDPROP_ITER_KEYS 0
#define IDPROP_ITER_ITEMS 1
#endif /* IDPROP_H */

View File

@ -31,6 +31,8 @@
* The BGL submodule "wraps" OpenGL functions and constants,
* allowing script writers to make OpenGL calls in their Python scripts. */
#include <Python.h>
#include "bgl.h" /*This must come first */
#include <GL/glew.h>
#include "MEM_guardedalloc.h"
@ -38,7 +40,6 @@
#include "BLI_utildefines.h"
static char Method_Buffer_doc[] =
"(type, dimensions, [template]) - Create a new Buffer object\n\n\
(type) - The format to store data in\n\

View File

@ -36,8 +36,6 @@
#ifndef BGL_H
#define BGL_H
#include <Python.h>
PyObject *BPyInit_bgl(void);
/*@ Create a buffer object */

View File

@ -87,6 +87,8 @@
* - geometry.BarycentricTransform -> barycentric_transform
*/
#include <Python.h>
#include "mathutils.h"
#include "BLI_math.h"

View File

@ -31,8 +31,6 @@
#ifndef MATHUTILS_H
#define MATHUTILS_H
#include <Python.h>
/* Can cast different mathutils types to this, use for generic funcs */
extern char BaseMathObject_Wrapped_doc[];
@ -50,11 +48,11 @@ typedef struct {
BASE_MATH_MEMBERS(data)
} BaseMathObject;
#include "mathutils_vector.h"
#include "mathutils_matrix.h"
#include "mathutils_quat.h"
#include "mathutils_euler.h"
#include "mathutils_color.h"
#include "mathutils_Vector.h"
#include "mathutils_Matrix.h"
#include "mathutils_Quaternion.h"
#include "mathutils_Euler.h"
#include "mathutils_Color.h"
#include "mathutils_geometry.h"
PyObject *BaseMathObject_getOwner( BaseMathObject * self, void * );

View File

@ -22,13 +22,13 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
#include "mathutils.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#define COLOR_SIZE 3
//----------------------------------mathutils.Color() -------------------

View File

@ -31,8 +31,6 @@
#ifndef MATHUTILS_COLOR_H
#define MATHUTILS_COLOR_H
#include <Python.h>
extern PyTypeObject color_Type;
#define ColorObject_Check(_v) PyObject_TypeCheck((_v), &color_Type)

View File

@ -26,13 +26,13 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
#include "mathutils.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#ifndef int32_t
#include "BLO_sys_types.h"
#endif

View File

@ -31,8 +31,6 @@
#ifndef MATHUTILS_EULER_H
#define MATHUTILS_EULER_H
#include <Python.h>
extern PyTypeObject euler_Type;
#define EulerObject_Check(_v) PyObject_TypeCheck((_v), &euler_Type)

View File

@ -25,6 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
#include "mathutils.h"
#include "BLI_math.h"

View File

@ -30,8 +30,6 @@
#ifndef MATHUTILS_MATRIX_H
#define MATHUTILS_MATRIX_H
#include <Python.h>
extern PyTypeObject matrix_Type;
#define MatrixObject_Check(_v) PyObject_TypeCheck((_v), &matrix_Type)
#define MATRIX_MAX_DIM 4

View File

@ -26,6 +26,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
#include "mathutils.h"
#include "BLI_math.h"

View File

@ -31,8 +31,6 @@
#ifndef MATHUTILS_QUAT_H
#define MATHUTILS_QUAT_H
#include <Python.h>
extern PyTypeObject quaternion_Type;
#define QuaternionObject_Check(_v) PyObject_TypeCheck((_v), &quaternion_Type)

View File

@ -25,6 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
#include "mathutils.h"
#include "BLI_blenlib.h"

View File

@ -31,8 +31,6 @@
#ifndef MATHUTILS_VECTOR_H
#define MATHUTILS_VECTOR_H
#include <Python.h>
extern PyTypeObject vector_Type;
#define VectorObject_Check(_v) PyObject_TypeCheck((_v), &vector_Type)

View File

@ -27,6 +27,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
#include "mathutils_geometry.h"
/* Used for PolyFill */

View File

@ -31,7 +31,6 @@
#ifndef MATHUTILS_GEOMETRY_H
#define MATHUTILS_GEOMETRY_H
#include <Python.h>
#include "mathutils.h"
PyMODINIT_FUNC BPyInit_mathutils_geometry(void);

View File

@ -35,6 +35,7 @@
/************************/
#include <Python.h>
#include "structseq.h"
#include "BLI_blenlib.h"
@ -42,6 +43,7 @@
#include "DNA_texture_types.h"
#include "noise_py_api.h"
/*-----------------------------------------*/
/* 'mersenne twister' random number generator */

View File

@ -0,0 +1,29 @@
/**
* $Id:
*
* ***** 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 NOISE_PY_API_H
#define NOISE_PY_API_H
PyObject *BPyInit_noise(void);
#endif // NOISE_PY_API_H

View File

@ -21,6 +21,7 @@
*/
#include <Python.h>
#include "py_capi_utils.h"
/* for debugging */

View File

@ -52,6 +52,7 @@ set(SRC
bpy.h
bpy_app.h
bpy_driver.h
bpy_operator.h
bpy_operator_wrap.h
bpy_props.h

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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[]= {

View File

@ -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.");

View File

@ -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))

View File

@ -23,6 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
#include "bpy_operator_wrap.h"
#include "WM_api.h"
#include "WM_types.h"

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -21,6 +21,9 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
#include <float.h> /* FLT_MIN/MAX */
#include "bpy_rna.h"

View File

@ -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"

View File

@ -21,6 +21,7 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
#include "bpy_rna.h"
#include "BKE_global.h"

View File

@ -22,6 +22,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
#include "bpy_rna.h"
#include "bpy_rna_callback.h"

View File

@ -22,6 +22,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
#include "bpy_util.h"
#include "BLI_dynstr.h"
#include "MEM_guardedalloc.h"

View File

@ -22,8 +22,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
#ifndef BPY_UTIL_H
#define BPY_UTIL_H