#define SWIG_name "oglc"
-#include "helpers.h"
+#include "export.h"
#include "oglhelpers.h"
static PyObject* l_output_helper(PyObject* target, PyObject* o) {
static char* wxStringErrorMsg = "string type is required for parameter";
+//---------------------------------------------------------------------------
+// This one will work for any class for the VERY generic cases, but beyond that
+// the helper needs to know more about the type.
+
+wxList* wxPy_wxListHelper(PyObject* pyList, char* className) {
+ bool doSave = wxPyRestoreThread();
+ if (!PyList_Check(pyList)) {
+ PyErr_SetString(PyExc_TypeError, "Expected a list object.");
+ wxPySaveThread(doSave);
+ return NULL;
+ }
+ int count = PyList_Size(pyList);
+ wxList* list = new wxList;
+ if (! list) {
+ PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
+ wxPySaveThread(doSave);
+ return NULL;
+ }
+ for (int x=0; x<count; x++) {
+ PyObject* pyo = PyList_GetItem(pyList, x);
+ wxObject* wxo = NULL;
+
+ if (SWIG_GetPtrObj(pyo, (void **)&wxo, className)) {
+ char errmsg[1024];
+ sprintf(errmsg, "Type error, expected list of %s objects", className);
+ PyErr_SetString(PyExc_TypeError, errmsg);
+ wxPySaveThread(doSave);
+ return NULL;
+ }
+ list->Append(wxo);
+ }
+ wxPySaveThread(doSave);
+ return list;
+}
+
+//---------------------------------------------------------------------------
+
+wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList) {
+ bool doSave = wxPyRestoreThread();
+ if (!PyList_Check(pyList)) {
+ PyErr_SetString(PyExc_TypeError, "Expected a list object.");
+ wxPySaveThread(doSave);
+ return NULL;
+ }
+ int count = PyList_Size(pyList);
+ wxList* list = new wxList;
+ if (! list) {
+ PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
+ wxPySaveThread(doSave);
+ return NULL;
+ }
+ for (int x=0; x<count; x++) {
+ PyObject* pyo = PyList_GetItem(pyList, x);
+
+ if (PyTuple_Check(pyo)) {
+ PyObject* o1 = PyNumber_Float(PyTuple_GetItem(pyo, 0));
+ PyObject* o2 = PyNumber_Float(PyTuple_GetItem(pyo, 1));
+
+ double val1 = (o1 ? PyFloat_AsDouble(o1) : 0.0);
+ double val2 = (o2 ? PyFloat_AsDouble(o2) : 0.0);
+
+ list->Append((wxObject*) new wxRealPoint(val1, val2));
+
+ } else {
+ wxRealPoint* wxo = NULL;
+ if (SWIG_GetPtrObj(pyo, (void **)&wxo, "_wxRealPoint_p")) {
+ PyErr_SetString(PyExc_TypeError, "Type error, expected list of wxRealPoint objects or 2-tuples");
+ wxPySaveThread(doSave);
+ return NULL;
+ }
+ list->Append((wxObject*) new wxRealPoint(*wxo));
+ }
+ }
+ wxPySaveThread(doSave);
+ return list;
+}
+
+
+//---------------------------------------------------------------------------
+
+
extern "C" SWIGEXPORT(void) initoglbasicc();
extern "C" SWIGEXPORT(void) initoglshapesc();
extern "C" SWIGEXPORT(void) initoglshapes2c();
{ "_class_wxRealPoint","_wxRealPoint",0},
{ "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0},
{ "_wxPNMHandler","_class_wxPNMHandler",0},
+ { "_wxPrinterDC","_class_wxPrinterDC",0},
{ "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0},
{ "_wxLogGui","_class_wxLogGui",0},
{ "_class_wxPyShapeEvtHandler","_wxPyShapeEvtHandler",0},
{ "_class_wxPySizer","_wxPySizer",0},
{ "_class_wxPyCompositeShape","_wxPyCompositeShape",0},
{ "_wxPyPolygonShape","_class_wxPyPolygonShape",0},
- { "_class_wxPostScriptDC","_wxPostScriptDC",0},
{ "_wxPanel","_class_wxPanel",0},
{ "_wxInitDialogEvent","_class_wxInitDialogEvent",0},
{ "_wxCheckBox","_class_wxCheckBox",0},
{ "_class_wxZipFSHandler","_wxZipFSHandler",0},
{ "_char","_wxChar",0},
{ "_wxBitmap","_class_wxBitmap",0},
+ { "_wxTaskBarIcon","_class_wxTaskBarIcon",0},
{ "_wxPrintDialog","_class_wxPrintDialog",0},
{ "_wxPyControlPoint","_class_wxPyControlPoint",0},
{ "_wxWindowDC","_class_wxWindowDC",0},
{ "_class_wxTextCtrl","_wxTextCtrl",0},
{ "_class_wxListItemAttr","_wxListItemAttr",0},
{ "_wxLayoutConstraints","_class_wxLayoutConstraints",0},
+ { "_wxMetaFileDC","_class_wxMetaFileDC",0},
{ "_class_wxTextDataObject","_wxTextDataObject",0},
{ "_wxMenu","_class_wxMenu",0},
{ "_class_wxMoveEvent","_wxMoveEvent",0},
{ "_signed_short","_short",0},
{ "_wxMemoryDC","_class_wxMemoryDC",0},
{ "_wxPyTextDataObject","_class_wxPyTextDataObject",0},
+ { "_class_wxTaskBarIcon","_wxTaskBarIcon",0},
{ "_class_wxPrintDialog","_wxPrintDialog",0},
{ "_wxPyFileSystemHandler","_class_wxPyFileSystemHandler",0},
{ "_class_wxPyControlPoint","_wxPyControlPoint",0},
{ "_wxStatusBar","_class_wxStatusBar",0},
{ "_class_wxAcceleratorEntry","_wxAcceleratorEntry",0},
{ "_class_wxCursor","_wxCursor",0},
- { "_wxPostScriptDC","_class_wxPostScriptDC",0},
{ "_wxPyFileDropTarget","_class_wxPyFileDropTarget",0},
{ "_class_wxPyProcess","_wxPyProcess",0},
{ "_class_wxImageHandler","_wxImageHandler",0},
{ "_class_wxLog","_wxLog",0},
{ "_wxTreeItemId","_class_wxTreeItemId",0},
{ "_unsigned_char","_byte",0},
+ { "_class_wxMetaFileDC","_wxMetaFileDC",0},
{ "_class_wxMenu","_wxMenu",0},
{ "_wxControl","_class_wxControl",0},
{ "_class_wxListBox","_wxListBox",0},
{ "_class_wxPyApp","_wxPyApp",0},
{ "_wxSize","_class_wxSize",0},
{ "_wxRegionIterator","_class_wxRegionIterator",0},
+ { "_class_wxPrinterDC","_wxPrinterDC",0},
{ "_class_wxPyTextDataObject","_wxPyTextDataObject",0},
{ "_class_wxLogTextCtrl","_wxLogTextCtrl",0},
{ "_class_wxLogGui","_wxLogGui",0},
initoglcanvasc();
- wxClassInfo::CleanUpClasses();
- wxClassInfo::InitializeClasses();
+// wxClassInfo::CleanUpClasses();
+// wxClassInfo::InitializeClasses();
{
int i;