diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2005-12-12 13:55:28 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2005-12-12 13:55:28 +0000 |
commit | b85f70523233c6c12ab8be4f0af61c8ef8e01ce0 (patch) | |
tree | 3fd4a92b58219e86da7213a5741084e0114f53f1 /externals/grill/py/source/pybundle.h | |
parent | 671f1403cf5755638217c59d3dead2c113ed4d58 (diff) |
fixed rich comparison method in Symbol class
added message bundle functionality (pyext.Bundle class)
small optimizations and fixes
added forgotten files
svn path=/trunk/; revision=4197
Diffstat (limited to 'externals/grill/py/source/pybundle.h')
-rw-r--r-- | externals/grill/py/source/pybundle.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/externals/grill/py/source/pybundle.h b/externals/grill/py/source/pybundle.h new file mode 100644 index 00000000..5978cc38 --- /dev/null +++ b/externals/grill/py/source/pybundle.h @@ -0,0 +1,60 @@ +/*
+
+py/pyext - python script object for PD and Max/MSP
+
+Copyright (c)2002-2005 Thomas Grill (gr@grrrr.org)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __PYBUNDLE_H
+#define __PYBUNDLE_H
+
+#include <flext.h> + +#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 500) +#error You need at least flext version 0.5.0 +#endif + +#if FLEXT_OS == FLEXT_OS_MAC +#include <Python/Python.h> +#else +#include <Python.h> +#endif + + +#ifdef _MSC_VER + #ifdef PY_EXPORTS + #define PY_EXPORT __declspec(dllexport) + #else + #define PY_EXPORT __declspec(dllimport) + #endif +#else + #define PY_EXPORT +#endif +
+typedef struct {
+ PyObject_HEAD
+ /* Type-specific fields go here. */
+ flext::MsgBundle *bundle;
+} pyBundle;
+
+PY_EXPORT extern PyTypeObject pyBundle_Type;
+
+#define pyBundle_Check(op) PyObject_TypeCheck(op, &pyBundle_Type) +#define pyBundle_CheckExact(op) ((op)->ob_type == &pyBundle_Type) + + +inline flext::MsgBundle *pyBundle_AS_BUNDLE(PyObject *op)
+{
+ return ((pyBundle *)op)->bundle;
+}
+
+inline flext::MsgBundle *pyBundle_AsBundle(PyObject *op)
+{
+ return pyBundle_Check(op)?pyBundle_AS_BUNDLE(op):NULL;
+}
+
+ +#endif
|