2  * FILE : src/mac/streams.cpp 
   4  * This file was automatically generated by : 
   5  * Simplified Wrapper and Interface Generator (SWIG) 
   6  * Version 1.1 (Build 883) 
   8  * Portions Copyright (c) 1995-1998 
   9  * The University of Utah and The Regents of the University of California. 
  10  * Permission is granted to distribute this file in any manner provided 
  11  * this notice remains intact. 
  13  * Do not make changes to this file--changes will be lost! 
  19 /* Implementation : PYTHON */ 
  24 /* Definitions for Windows/Unix exporting */ 
  25 #if defined(__WIN32__) 
  26 #   if defined(_MSC_VER) 
  27 #       define SWIGEXPORT(a) __declspec(dllexport) a 
  29 #       if defined(__BORLANDC__) 
  30 #           define SWIGEXPORT(a) a _export 
  32 #           define SWIGEXPORT(a) a 
  36 #   define SWIGEXPORT(a) a 
  45 extern void SWIG_MakePtr(char *, void *, char *); 
  46 extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *)); 
  47 extern char *SWIG_GetPtr(char *, void **, char *); 
  48 extern char *SWIG_GetPtrObj(PyObject 
*, void **, char *); 
  49 extern void SWIG_addvarlink(PyObject 
*, char *, PyObject 
*(*)(void), int (*)(PyObject 
*)); 
  50 extern PyObject 
*SWIG_newvarlink(void); 
  54 #define SWIG_init    initstreamsc 
  56 #define SWIG_name    "streamsc" 
  59 #include "pyistream.h" 
  60 #include <wx/stream.h> 
  64 static PyObject
* t_output_helper(PyObject
* target
, PyObject
* o
) { 
  70     } else if (target 
== Py_None
) { 
  74         if (!PyTuple_Check(target
)) { 
  76             target 
= PyTuple_New(1); 
  77             PyTuple_SetItem(target
, 0, o2
); 
  80         PyTuple_SetItem(o3
, 0, o
); 
  83         target 
= PySequence_Concat(o2
, o3
); 
  92 static wxPyInputStream 
*new_wxPyInputStream(PyObject 
*p
) { 
  93             wxInputStream
* wxis 
= wxPyCBInputStream::create(p
); 
  95                 return new wxPyInputStream(wxis
); 
 100 static PyObject 
*_wrap_new_wxInputStream(PyObject 
*self
, PyObject 
*args
, PyObject 
*kwargs
) { 
 101     PyObject 
* _resultobj
; 
 102     wxPyInputStream 
* _result
; 
 104     PyObject 
* _obj0 
= 0; 
 105     char *_kwnames
[] = { "p", NULL 
}; 
 109     if(!PyArg_ParseTupleAndKeywords(args
,kwargs
,"O:new_wxInputStream",_kwnames
,&_obj0
))  
 115     PyThreadState
* __tstate 
= wxPyBeginAllowThreads(); 
 116     _result 
= (wxPyInputStream 
*)new_wxPyInputStream(_arg0
); 
 118     wxPyEndAllowThreads(__tstate
); 
 119     if (PyErr_Occurred()) return NULL
; 
 121         SWIG_MakePtr(_ptemp
, (char *) _result
,"_wxPyInputStream_p"); 
 122         _resultobj 
= Py_BuildValue("s",_ptemp
); 
 125         _resultobj 
= Py_None
; 
 130 #define wxInputStream_close(_swigobj)  (_swigobj->close()) 
 131 static PyObject 
*_wrap_wxInputStream_close(PyObject 
*self
, PyObject 
*args
, PyObject 
*kwargs
) { 
 132     PyObject 
* _resultobj
; 
 133     wxPyInputStream 
* _arg0
; 
 134     PyObject 
* _argo0 
= 0; 
 135     char *_kwnames
[] = { "self", NULL 
}; 
 138     if(!PyArg_ParseTupleAndKeywords(args
,kwargs
,"O:wxInputStream_close",_kwnames
,&_argo0
))  
 141         if (_argo0 
== Py_None
) { _arg0 
= NULL
; } 
 142         else if (SWIG_GetPtrObj(_argo0
,(void **) &_arg0
,"_wxPyInputStream_p")) { 
 143             PyErr_SetString(PyExc_TypeError
,"Type error in argument 1 of wxInputStream_close. Expected _wxPyInputStream_p."); 
 148     PyThreadState
* __tstate 
= wxPyBeginAllowThreads(); 
 149     wxInputStream_close(_arg0
); 
 151     wxPyEndAllowThreads(__tstate
); 
 152     if (PyErr_Occurred()) return NULL
; 
 153 }    Py_INCREF(Py_None
); 
 154     _resultobj 
= Py_None
; 
 158 #define wxInputStream_flush(_swigobj)  (_swigobj->flush()) 
 159 static PyObject 
*_wrap_wxInputStream_flush(PyObject 
*self
, PyObject 
*args
, PyObject 
*kwargs
) { 
 160     PyObject 
* _resultobj
; 
 161     wxPyInputStream 
* _arg0
; 
 162     PyObject 
* _argo0 
= 0; 
 163     char *_kwnames
[] = { "self", NULL 
}; 
 166     if(!PyArg_ParseTupleAndKeywords(args
,kwargs
,"O:wxInputStream_flush",_kwnames
,&_argo0
))  
 169         if (_argo0 
== Py_None
) { _arg0 
= NULL
; } 
 170         else if (SWIG_GetPtrObj(_argo0
,(void **) &_arg0
,"_wxPyInputStream_p")) { 
 171             PyErr_SetString(PyExc_TypeError
,"Type error in argument 1 of wxInputStream_flush. Expected _wxPyInputStream_p."); 
 176     PyThreadState
* __tstate 
= wxPyBeginAllowThreads(); 
 177     wxInputStream_flush(_arg0
); 
 179     wxPyEndAllowThreads(__tstate
); 
 180     if (PyErr_Occurred()) return NULL
; 
 181 }    Py_INCREF(Py_None
); 
 182     _resultobj 
= Py_None
; 
 186 #define wxInputStream_eof(_swigobj)  (_swigobj->eof()) 
 187 static PyObject 
*_wrap_wxInputStream_eof(PyObject 
*self
, PyObject 
*args
, PyObject 
*kwargs
) { 
 188     PyObject 
* _resultobj
; 
 190     wxPyInputStream 
* _arg0
; 
 191     PyObject 
* _argo0 
= 0; 
 192     char *_kwnames
[] = { "self", NULL 
}; 
 195     if(!PyArg_ParseTupleAndKeywords(args
,kwargs
,"O:wxInputStream_eof",_kwnames
,&_argo0
))  
 198         if (_argo0 
== Py_None
) { _arg0 
= NULL
; } 
 199         else if (SWIG_GetPtrObj(_argo0
,(void **) &_arg0
,"_wxPyInputStream_p")) { 
 200             PyErr_SetString(PyExc_TypeError
,"Type error in argument 1 of wxInputStream_eof. Expected _wxPyInputStream_p."); 
 205     PyThreadState
* __tstate 
= wxPyBeginAllowThreads(); 
 206     _result 
= (bool )wxInputStream_eof(_arg0
); 
 208     wxPyEndAllowThreads(__tstate
); 
 209     if (PyErr_Occurred()) return NULL
; 
 210 }    _resultobj 
= Py_BuildValue("i",_result
); 
 214 #define wxInputStream_read(_swigobj,_swigarg0)  (_swigobj->read(_swigarg0)) 
 215 static PyObject 
*_wrap_wxInputStream_read(PyObject 
*self
, PyObject 
*args
, PyObject 
*kwargs
) { 
 216     PyObject 
* _resultobj
; 
 218     wxPyInputStream 
* _arg0
; 
 219     int  _arg1 
= (int ) -1; 
 220     PyObject 
* _argo0 
= 0; 
 221     char *_kwnames
[] = { "self","size", NULL 
}; 
 224     if(!PyArg_ParseTupleAndKeywords(args
,kwargs
,"O|i:wxInputStream_read",_kwnames
,&_argo0
,&_arg1
))  
 227         if (_argo0 
== Py_None
) { _arg0 
= NULL
; } 
 228         else if (SWIG_GetPtrObj(_argo0
,(void **) &_arg0
,"_wxPyInputStream_p")) { 
 229             PyErr_SetString(PyExc_TypeError
,"Type error in argument 1 of wxInputStream_read. Expected _wxPyInputStream_p."); 
 234     PyThreadState
* __tstate 
= wxPyBeginAllowThreads(); 
 235     _result 
= (PyObject 
*)wxInputStream_read(_arg0
,_arg1
); 
 237     wxPyEndAllowThreads(__tstate
); 
 238     if (PyErr_Occurred()) return NULL
; 
 240   _resultobj 
= _result
; 
 245 #define wxInputStream_readline(_swigobj,_swigarg0)  (_swigobj->readline(_swigarg0)) 
 246 static PyObject 
*_wrap_wxInputStream_readline(PyObject 
*self
, PyObject 
*args
, PyObject 
*kwargs
) { 
 247     PyObject 
* _resultobj
; 
 249     wxPyInputStream 
* _arg0
; 
 250     int  _arg1 
= (int ) -1; 
 251     PyObject 
* _argo0 
= 0; 
 252     char *_kwnames
[] = { "self","size", NULL 
}; 
 255     if(!PyArg_ParseTupleAndKeywords(args
,kwargs
,"O|i:wxInputStream_readline",_kwnames
,&_argo0
,&_arg1
))  
 258         if (_argo0 
== Py_None
) { _arg0 
= NULL
; } 
 259         else if (SWIG_GetPtrObj(_argo0
,(void **) &_arg0
,"_wxPyInputStream_p")) { 
 260             PyErr_SetString(PyExc_TypeError
,"Type error in argument 1 of wxInputStream_readline. Expected _wxPyInputStream_p."); 
 265     PyThreadState
* __tstate 
= wxPyBeginAllowThreads(); 
 266     _result 
= (PyObject 
*)wxInputStream_readline(_arg0
,_arg1
); 
 268     wxPyEndAllowThreads(__tstate
); 
 269     if (PyErr_Occurred()) return NULL
; 
 271   _resultobj 
= _result
; 
 276 #define wxInputStream_readlines(_swigobj,_swigarg0)  (_swigobj->readlines(_swigarg0)) 
 277 static PyObject 
*_wrap_wxInputStream_readlines(PyObject 
*self
, PyObject 
*args
, PyObject 
*kwargs
) { 
 278     PyObject 
* _resultobj
; 
 280     wxPyInputStream 
* _arg0
; 
 281     int  _arg1 
= (int ) -1; 
 282     PyObject 
* _argo0 
= 0; 
 283     char *_kwnames
[] = { "self","sizehint", NULL 
}; 
 286     if(!PyArg_ParseTupleAndKeywords(args
,kwargs
,"O|i:wxInputStream_readlines",_kwnames
,&_argo0
,&_arg1
))  
 289         if (_argo0 
== Py_None
) { _arg0 
= NULL
; } 
 290         else if (SWIG_GetPtrObj(_argo0
,(void **) &_arg0
,"_wxPyInputStream_p")) { 
 291             PyErr_SetString(PyExc_TypeError
,"Type error in argument 1 of wxInputStream_readlines. Expected _wxPyInputStream_p."); 
 296     PyThreadState
* __tstate 
= wxPyBeginAllowThreads(); 
 297     _result 
= (PyObject 
*)wxInputStream_readlines(_arg0
,_arg1
); 
 299     wxPyEndAllowThreads(__tstate
); 
 300     if (PyErr_Occurred()) return NULL
; 
 302   _resultobj 
= _result
; 
 307 #define wxInputStream_seek(_swigobj,_swigarg0,_swigarg1)  (_swigobj->seek(_swigarg0,_swigarg1)) 
 308 static PyObject 
*_wrap_wxInputStream_seek(PyObject 
*self
, PyObject 
*args
, PyObject 
*kwargs
) { 
 309     PyObject 
* _resultobj
; 
 310     wxPyInputStream 
* _arg0
; 
 312     int  _arg2 
= (int ) 0; 
 313     PyObject 
* _argo0 
= 0; 
 314     char *_kwnames
[] = { "self","offset","whence", NULL 
}; 
 317     if(!PyArg_ParseTupleAndKeywords(args
,kwargs
,"Oi|i:wxInputStream_seek",_kwnames
,&_argo0
,&_arg1
,&_arg2
))  
 320         if (_argo0 
== Py_None
) { _arg0 
= NULL
; } 
 321         else if (SWIG_GetPtrObj(_argo0
,(void **) &_arg0
,"_wxPyInputStream_p")) { 
 322             PyErr_SetString(PyExc_TypeError
,"Type error in argument 1 of wxInputStream_seek. Expected _wxPyInputStream_p."); 
 327     PyThreadState
* __tstate 
= wxPyBeginAllowThreads(); 
 328     wxInputStream_seek(_arg0
,_arg1
,_arg2
); 
 330     wxPyEndAllowThreads(__tstate
); 
 331     if (PyErr_Occurred()) return NULL
; 
 332 }    Py_INCREF(Py_None
); 
 333     _resultobj 
= Py_None
; 
 337 #define wxInputStream_tell(_swigobj)  (_swigobj->tell()) 
 338 static PyObject 
*_wrap_wxInputStream_tell(PyObject 
*self
, PyObject 
*args
, PyObject 
*kwargs
) { 
 339     PyObject 
* _resultobj
; 
 341     wxPyInputStream 
* _arg0
; 
 342     PyObject 
* _argo0 
= 0; 
 343     char *_kwnames
[] = { "self", NULL 
}; 
 346     if(!PyArg_ParseTupleAndKeywords(args
,kwargs
,"O:wxInputStream_tell",_kwnames
,&_argo0
))  
 349         if (_argo0 
== Py_None
) { _arg0 
= NULL
; } 
 350         else if (SWIG_GetPtrObj(_argo0
,(void **) &_arg0
,"_wxPyInputStream_p")) { 
 351             PyErr_SetString(PyExc_TypeError
,"Type error in argument 1 of wxInputStream_tell. Expected _wxPyInputStream_p."); 
 356     PyThreadState
* __tstate 
= wxPyBeginAllowThreads(); 
 357     _result 
= (int )wxInputStream_tell(_arg0
); 
 359     wxPyEndAllowThreads(__tstate
); 
 360     if (PyErr_Occurred()) return NULL
; 
 361 }    _resultobj 
= Py_BuildValue("i",_result
); 
 365 static void  wxOutputStream_write(wxOutputStream 
*self
,PyObject 
* obj
) { 
 366             // We use only strings for the streams, not unicode 
 367             PyObject
* str 
= PyObject_Str(obj
); 
 369                 PyErr_SetString(PyExc_TypeError
, "Unable to convert to string"); 
 372             self
->Write(PyString_AS_STRING(str
), 
 373                         PyString_GET_SIZE(str
)); 
 376 static PyObject 
*_wrap_wxOutputStream_write(PyObject 
*self
, PyObject 
*args
, PyObject 
*kwargs
) { 
 377     PyObject 
* _resultobj
; 
 378     wxOutputStream 
* _arg0
; 
 380     PyObject 
* _argo0 
= 0; 
 381     PyObject 
* _obj1 
= 0; 
 382     char *_kwnames
[] = { "self","obj", NULL 
}; 
 385     if(!PyArg_ParseTupleAndKeywords(args
,kwargs
,"OO:wxOutputStream_write",_kwnames
,&_argo0
,&_obj1
))  
 388         if (_argo0 
== Py_None
) { _arg0 
= NULL
; } 
 389         else if (SWIG_GetPtrObj(_argo0
,(void **) &_arg0
,"_wxOutputStream_p")) { 
 390             PyErr_SetString(PyExc_TypeError
,"Type error in argument 1 of wxOutputStream_write. Expected _wxOutputStream_p."); 
 398     PyThreadState
* __tstate 
= wxPyBeginAllowThreads(); 
 399     wxOutputStream_write(_arg0
,_arg1
); 
 401     wxPyEndAllowThreads(__tstate
); 
 402     if (PyErr_Occurred()) return NULL
; 
 403 }    Py_INCREF(Py_None
); 
 404     _resultobj 
= Py_None
; 
 408 static PyMethodDef streamscMethods
[] = { 
 409          { "wxOutputStream_write", (PyCFunction
) _wrap_wxOutputStream_write
, METH_VARARGS 
| METH_KEYWORDS 
}, 
 410          { "wxInputStream_tell", (PyCFunction
) _wrap_wxInputStream_tell
, METH_VARARGS 
| METH_KEYWORDS 
}, 
 411          { "wxInputStream_seek", (PyCFunction
) _wrap_wxInputStream_seek
, METH_VARARGS 
| METH_KEYWORDS 
}, 
 412          { "wxInputStream_readlines", (PyCFunction
) _wrap_wxInputStream_readlines
, METH_VARARGS 
| METH_KEYWORDS 
}, 
 413          { "wxInputStream_readline", (PyCFunction
) _wrap_wxInputStream_readline
, METH_VARARGS 
| METH_KEYWORDS 
}, 
 414          { "wxInputStream_read", (PyCFunction
) _wrap_wxInputStream_read
, METH_VARARGS 
| METH_KEYWORDS 
}, 
 415          { "wxInputStream_eof", (PyCFunction
) _wrap_wxInputStream_eof
, METH_VARARGS 
| METH_KEYWORDS 
}, 
 416          { "wxInputStream_flush", (PyCFunction
) _wrap_wxInputStream_flush
, METH_VARARGS 
| METH_KEYWORDS 
}, 
 417          { "wxInputStream_close", (PyCFunction
) _wrap_wxInputStream_close
, METH_VARARGS 
| METH_KEYWORDS 
}, 
 418          { "new_wxInputStream", (PyCFunction
) _wrap_new_wxInputStream
, METH_VARARGS 
| METH_KEYWORDS 
}, 
 425  * This table is used by the pointer type-checker 
 427 static struct { char *n1
; char *n2
; void *(*pcnv
)(void *); } _swig_mapping
[] = { 
 428     { "_signed_long","_long",0}, 
 429     { "_wxPrintQuality","_wxCoord",0}, 
 430     { "_wxPrintQuality","_int",0}, 
 431     { "_wxPrintQuality","_signed_int",0}, 
 432     { "_wxPrintQuality","_unsigned_int",0}, 
 433     { "_wxPrintQuality","_wxWindowID",0}, 
 434     { "_wxPrintQuality","_uint",0}, 
 435     { "_wxPrintQuality","_EBool",0}, 
 436     { "_wxPrintQuality","_size_t",0}, 
 437     { "_wxPrintQuality","_time_t",0}, 
 438     { "_byte","_unsigned_char",0}, 
 439     { "_long","_unsigned_long",0}, 
 440     { "_long","_signed_long",0}, 
 441     { "_size_t","_wxCoord",0}, 
 442     { "_size_t","_wxPrintQuality",0}, 
 443     { "_size_t","_time_t",0}, 
 444     { "_size_t","_unsigned_int",0}, 
 445     { "_size_t","_int",0}, 
 446     { "_size_t","_wxWindowID",0}, 
 447     { "_size_t","_uint",0}, 
 448     { "_uint","_wxCoord",0}, 
 449     { "_uint","_wxPrintQuality",0}, 
 450     { "_uint","_time_t",0}, 
 451     { "_uint","_size_t",0}, 
 452     { "_uint","_unsigned_int",0}, 
 454     { "_uint","_wxWindowID",0}, 
 455     { "_wxChar","_char",0}, 
 456     { "_char","_wxChar",0}, 
 457     { "_EBool","_wxCoord",0}, 
 458     { "_EBool","_wxPrintQuality",0}, 
 459     { "_EBool","_signed_int",0}, 
 460     { "_EBool","_int",0}, 
 461     { "_EBool","_wxWindowID",0}, 
 462     { "_unsigned_long","_long",0}, 
 463     { "_signed_int","_wxCoord",0}, 
 464     { "_signed_int","_wxPrintQuality",0}, 
 465     { "_signed_int","_EBool",0}, 
 466     { "_signed_int","_wxWindowID",0}, 
 467     { "_signed_int","_int",0}, 
 468     { "_WXTYPE","_short",0}, 
 469     { "_WXTYPE","_signed_short",0}, 
 470     { "_WXTYPE","_unsigned_short",0}, 
 471     { "_unsigned_short","_WXTYPE",0}, 
 472     { "_unsigned_short","_short",0}, 
 473     { "_signed_short","_WXTYPE",0}, 
 474     { "_signed_short","_short",0}, 
 475     { "_unsigned_char","_byte",0}, 
 476     { "_unsigned_int","_wxCoord",0}, 
 477     { "_unsigned_int","_wxPrintQuality",0}, 
 478     { "_unsigned_int","_time_t",0}, 
 479     { "_unsigned_int","_size_t",0}, 
 480     { "_unsigned_int","_uint",0}, 
 481     { "_unsigned_int","_wxWindowID",0}, 
 482     { "_unsigned_int","_int",0}, 
 483     { "_short","_WXTYPE",0}, 
 484     { "_short","_unsigned_short",0}, 
 485     { "_short","_signed_short",0}, 
 486     { "_wxWindowID","_wxCoord",0}, 
 487     { "_wxWindowID","_wxPrintQuality",0}, 
 488     { "_wxWindowID","_time_t",0}, 
 489     { "_wxWindowID","_size_t",0}, 
 490     { "_wxWindowID","_EBool",0}, 
 491     { "_wxWindowID","_uint",0}, 
 492     { "_wxWindowID","_int",0}, 
 493     { "_wxWindowID","_signed_int",0}, 
 494     { "_wxWindowID","_unsigned_int",0}, 
 495     { "_int","_wxCoord",0}, 
 496     { "_int","_wxPrintQuality",0}, 
 497     { "_int","_time_t",0}, 
 498     { "_int","_size_t",0}, 
 499     { "_int","_EBool",0}, 
 501     { "_int","_wxWindowID",0}, 
 502     { "_int","_unsigned_int",0}, 
 503     { "_int","_signed_int",0}, 
 504     { "_time_t","_wxCoord",0}, 
 505     { "_time_t","_wxPrintQuality",0}, 
 506     { "_time_t","_unsigned_int",0}, 
 507     { "_time_t","_int",0}, 
 508     { "_time_t","_wxWindowID",0}, 
 509     { "_time_t","_uint",0}, 
 510     { "_time_t","_size_t",0}, 
 511     { "_wxCoord","_int",0}, 
 512     { "_wxCoord","_signed_int",0}, 
 513     { "_wxCoord","_unsigned_int",0}, 
 514     { "_wxCoord","_wxWindowID",0}, 
 515     { "_wxCoord","_uint",0}, 
 516     { "_wxCoord","_EBool",0}, 
 517     { "_wxCoord","_size_t",0}, 
 518     { "_wxCoord","_time_t",0}, 
 519     { "_wxCoord","_wxPrintQuality",0}, 
 522 static PyObject 
*SWIG_globals
; 
 526 SWIGEXPORT(void) initstreamsc() { 
 528          SWIG_globals 
= SWIG_newvarlink(); 
 529          m 
= Py_InitModule("streamsc", streamscMethods
); 
 530          d 
= PyModule_GetDict(m
); 
 532     wxPyPtrTypeMap_Add("wxInputStream", "wxPyInputStream"); 
 535    for (i 
= 0; _swig_mapping
[i
].n1
; i
++) 
 536         SWIG_RegisterMapping(_swig_mapping
[i
].n1
,_swig_mapping
[i
].n2
,_swig_mapping
[i
].pcnv
);