aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/py/source/main.h
diff options
context:
space:
mode:
Diffstat (limited to 'externals/grill/py/source/main.h')
-rw-r--r--externals/grill/py/source/main.h47
1 files changed, 15 insertions, 32 deletions
diff --git a/externals/grill/py/source/main.h b/externals/grill/py/source/main.h
index 7079dc2f..c76d43fa 100644
--- a/externals/grill/py/source/main.h
+++ b/externals/grill/py/source/main.h
@@ -41,23 +41,25 @@ public:
typedef PooledFifo<FifoEl> PyFifo;
-class py:
- public flext_base
-{
- FLEXT_HEADER_S(py,flext_base,Setup)
+class pybase
+ : public flext
+{
public:
- py();
- ~py();
- static void lib_setup();
+ pybase();
+ virtual ~pybase();
- virtual void Exit();
+ void Exit();
static PyObject *MakePyArgs(const t_symbol *s,int argc,const t_atom *argv,int inlet = -1,bool withself = false);
static AtomList *GetPyArgs(PyObject *pValue,PyObject **self = NULL);
+ static void lib_setup();
+
protected:
+ virtual void DumpOut(const t_symbol *sym,int argc,const t_atom *argv) = 0;
+
void m__dir(PyObject *obj);
void m__doc(PyObject *obj);
@@ -83,12 +85,15 @@ protected:
void Reregister(const char *reg);
virtual void Reload() = 0;
+ void OpenEditor();
void Respond(bool b);
static bool IsAnything(const t_symbol *s) { return s && s != sym_float && s != sym_int && s != sym_symbol && s != sym_list && s != sym_pointer; }
enum retval { nothing,atom,sequ };
+ static PyObject *emptytuple;
+
// --- module stuff -----
static PyObject *module_obj,*module_dict;
@@ -131,6 +136,7 @@ protected:
int detach;
bool gencall(PyObject *fun,PyObject *args);
+ virtual bool thrcall(void *data) = 0;
virtual bool callpy(PyObject *fun,PyObject *args) = 0;
#if FLEXT_SYS == FLEXT_SYS_MAX
@@ -139,7 +145,7 @@ protected:
static bool collect();
-private:
+protected:
void work_wrapper(void *data);
@@ -151,10 +157,6 @@ private:
static PyThreadState *FindThreadState();
static void FreeThreadState();
-
- FLEXT_THREAD_X(work_wrapper)
-#else
- FLEXT_CALLBACK_X(work_wrapper)
#endif
public:
@@ -189,25 +191,6 @@ public:
#endif
static PyObject* StdOut_Write(PyObject* Self, PyObject* Args);
-
-protected:
-
- virtual void m_click();
-
- static void Setup(t_classid c);
-
- // callbacks
- FLEXT_ATTRVAR_I(detach)
- FLEXT_ATTRVAR_B(respond)
- FLEXT_CALLBACK_V(m_stop)
- FLEXT_CALLBACK(m_dir)
- FLEXT_CALLGET_V(mg_dir)
- FLEXT_CALLBACK(m_doc)
-
-#ifdef FLEXT_THREADS
- FLEXT_CALLBACK_T(tick)
- FLEXT_THREAD(threadworker)
-#endif
};
#endif