2 * FILE : src/gtk/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
= (wxString
*)wxInputStream_read(_arg0
,_arg1
);
237 wxPyEndAllowThreads(__tstate
);
238 if (PyErr_Occurred()) return NULL
;
241 _resultobj
= PyUnicode_FromUnicode(_result
->c_str(), _result
->Len());
243 _resultobj
= PyString_FromStringAndSize(_result
->c_str(), _result
->Len());
249 #define wxInputStream_readline(_swigobj,_swigarg0) (_swigobj->readline(_swigarg0))
250 static PyObject
*_wrap_wxInputStream_readline(PyObject
*self
, PyObject
*args
, PyObject
*kwargs
) {
251 PyObject
* _resultobj
;
253 wxPyInputStream
* _arg0
;
254 int _arg1
= (int ) -1;
255 PyObject
* _argo0
= 0;
256 char *_kwnames
[] = { "self","size", NULL
};
259 if(!PyArg_ParseTupleAndKeywords(args
,kwargs
,"O|i:wxInputStream_readline",_kwnames
,&_argo0
,&_arg1
))
262 if (_argo0
== Py_None
) { _arg0
= NULL
; }
263 else if (SWIG_GetPtrObj(_argo0
,(void **) &_arg0
,"_wxPyInputStream_p")) {
264 PyErr_SetString(PyExc_TypeError
,"Type error in argument 1 of wxInputStream_readline. Expected _wxPyInputStream_p.");
269 PyThreadState
* __tstate
= wxPyBeginAllowThreads();
270 _result
= (wxString
*)wxInputStream_readline(_arg0
,_arg1
);
272 wxPyEndAllowThreads(__tstate
);
273 if (PyErr_Occurred()) return NULL
;
276 _resultobj
= PyUnicode_FromUnicode(_result
->c_str(), _result
->Len());
278 _resultobj
= PyString_FromStringAndSize(_result
->c_str(), _result
->Len());
284 #define wxInputStream_readlines(_swigobj,_swigarg0) (_swigobj->readlines(_swigarg0))
285 static PyObject
*_wrap_wxInputStream_readlines(PyObject
*self
, PyObject
*args
, PyObject
*kwargs
) {
286 PyObject
* _resultobj
;
287 wxStringPtrList
* _result
;
288 wxPyInputStream
* _arg0
;
289 int _arg1
= (int ) -1;
290 PyObject
* _argo0
= 0;
291 char *_kwnames
[] = { "self","sizehint", NULL
};
294 if(!PyArg_ParseTupleAndKeywords(args
,kwargs
,"O|i:wxInputStream_readlines",_kwnames
,&_argo0
,&_arg1
))
297 if (_argo0
== Py_None
) { _arg0
= NULL
; }
298 else if (SWIG_GetPtrObj(_argo0
,(void **) &_arg0
,"_wxPyInputStream_p")) {
299 PyErr_SetString(PyExc_TypeError
,"Type error in argument 1 of wxInputStream_readlines. Expected _wxPyInputStream_p.");
304 PyThreadState
* __tstate
= wxPyBeginAllowThreads();
305 _result
= (wxStringPtrList
*)wxInputStream_readlines(_arg0
,_arg1
);
307 wxPyEndAllowThreads(__tstate
);
308 if (PyErr_Occurred()) return NULL
;
311 _resultobj
= PyList_New(_result
->GetCount());
312 wxStringPtrList::Node
*node
= _result
->GetFirst();
313 for (int i
=0; node
; i
++) {
314 wxString
*s
= node
->GetData();
316 PyList_SetItem(_resultobj
, i
, PyUnicode_FromUnicode(s
->c_str(), s
->Len()));
318 PyList_SetItem(_resultobj
, i
, PyString_FromStringAndSize(s
->c_str(), s
->Len()));
320 node
= node
->GetNext();
331 #define wxInputStream_seek(_swigobj,_swigarg0,_swigarg1) (_swigobj->seek(_swigarg0,_swigarg1))
332 static PyObject
*_wrap_wxInputStream_seek(PyObject
*self
, PyObject
*args
, PyObject
*kwargs
) {
333 PyObject
* _resultobj
;
334 wxPyInputStream
* _arg0
;
336 int _arg2
= (int ) 0;
337 PyObject
* _argo0
= 0;
338 char *_kwnames
[] = { "self","offset","whence", NULL
};
341 if(!PyArg_ParseTupleAndKeywords(args
,kwargs
,"Oi|i:wxInputStream_seek",_kwnames
,&_argo0
,&_arg1
,&_arg2
))
344 if (_argo0
== Py_None
) { _arg0
= NULL
; }
345 else if (SWIG_GetPtrObj(_argo0
,(void **) &_arg0
,"_wxPyInputStream_p")) {
346 PyErr_SetString(PyExc_TypeError
,"Type error in argument 1 of wxInputStream_seek. Expected _wxPyInputStream_p.");
351 PyThreadState
* __tstate
= wxPyBeginAllowThreads();
352 wxInputStream_seek(_arg0
,_arg1
,_arg2
);
354 wxPyEndAllowThreads(__tstate
);
355 if (PyErr_Occurred()) return NULL
;
356 } Py_INCREF(Py_None
);
357 _resultobj
= Py_None
;
361 #define wxInputStream_tell(_swigobj) (_swigobj->tell())
362 static PyObject
*_wrap_wxInputStream_tell(PyObject
*self
, PyObject
*args
, PyObject
*kwargs
) {
363 PyObject
* _resultobj
;
365 wxPyInputStream
* _arg0
;
366 PyObject
* _argo0
= 0;
367 char *_kwnames
[] = { "self", NULL
};
370 if(!PyArg_ParseTupleAndKeywords(args
,kwargs
,"O:wxInputStream_tell",_kwnames
,&_argo0
))
373 if (_argo0
== Py_None
) { _arg0
= NULL
; }
374 else if (SWIG_GetPtrObj(_argo0
,(void **) &_arg0
,"_wxPyInputStream_p")) {
375 PyErr_SetString(PyExc_TypeError
,"Type error in argument 1 of wxInputStream_tell. Expected _wxPyInputStream_p.");
380 PyThreadState
* __tstate
= wxPyBeginAllowThreads();
381 _result
= (int )wxInputStream_tell(_arg0
);
383 wxPyEndAllowThreads(__tstate
);
384 if (PyErr_Occurred()) return NULL
;
385 } _resultobj
= Py_BuildValue("i",_result
);
389 static void wxOutputStream_write(wxOutputStream
*self
,const wxString
& str
) {
390 self
->Write(str
.c_str(), str
.Length());
392 static PyObject
*_wrap_wxOutputStream_write(PyObject
*self
, PyObject
*args
, PyObject
*kwargs
) {
393 PyObject
* _resultobj
;
394 wxOutputStream
* _arg0
;
396 PyObject
* _argo0
= 0;
397 PyObject
* _obj1
= 0;
398 char *_kwnames
[] = { "self","str", NULL
};
401 if(!PyArg_ParseTupleAndKeywords(args
,kwargs
,"OO:wxOutputStream_write",_kwnames
,&_argo0
,&_obj1
))
404 if (_argo0
== Py_None
) { _arg0
= NULL
; }
405 else if (SWIG_GetPtrObj(_argo0
,(void **) &_arg0
,"_wxOutputStream_p")) {
406 PyErr_SetString(PyExc_TypeError
,"Type error in argument 1 of wxOutputStream_write. Expected _wxOutputStream_p.");
411 _arg1
= wxString_in_helper(_obj1
);
416 PyThreadState
* __tstate
= wxPyBeginAllowThreads();
417 wxOutputStream_write(_arg0
,*_arg1
);
419 wxPyEndAllowThreads(__tstate
);
420 if (PyErr_Occurred()) return NULL
;
421 } Py_INCREF(Py_None
);
422 _resultobj
= Py_None
;
430 static PyMethodDef streamscMethods
[] = {
431 { "wxOutputStream_write", (PyCFunction
) _wrap_wxOutputStream_write
, METH_VARARGS
| METH_KEYWORDS
},
432 { "wxInputStream_tell", (PyCFunction
) _wrap_wxInputStream_tell
, METH_VARARGS
| METH_KEYWORDS
},
433 { "wxInputStream_seek", (PyCFunction
) _wrap_wxInputStream_seek
, METH_VARARGS
| METH_KEYWORDS
},
434 { "wxInputStream_readlines", (PyCFunction
) _wrap_wxInputStream_readlines
, METH_VARARGS
| METH_KEYWORDS
},
435 { "wxInputStream_readline", (PyCFunction
) _wrap_wxInputStream_readline
, METH_VARARGS
| METH_KEYWORDS
},
436 { "wxInputStream_read", (PyCFunction
) _wrap_wxInputStream_read
, METH_VARARGS
| METH_KEYWORDS
},
437 { "wxInputStream_eof", (PyCFunction
) _wrap_wxInputStream_eof
, METH_VARARGS
| METH_KEYWORDS
},
438 { "wxInputStream_flush", (PyCFunction
) _wrap_wxInputStream_flush
, METH_VARARGS
| METH_KEYWORDS
},
439 { "wxInputStream_close", (PyCFunction
) _wrap_wxInputStream_close
, METH_VARARGS
| METH_KEYWORDS
},
440 { "new_wxInputStream", (PyCFunction
) _wrap_new_wxInputStream
, METH_VARARGS
| METH_KEYWORDS
},
447 * This table is used by the pointer type-checker
449 static struct { char *n1
; char *n2
; void *(*pcnv
)(void *); } _swig_mapping
[] = {
450 { "_signed_long","_long",0},
451 { "_wxPrintQuality","_wxCoord",0},
452 { "_wxPrintQuality","_int",0},
453 { "_wxPrintQuality","_signed_int",0},
454 { "_wxPrintQuality","_unsigned_int",0},
455 { "_wxPrintQuality","_wxWindowID",0},
456 { "_wxPrintQuality","_uint",0},
457 { "_wxPrintQuality","_EBool",0},
458 { "_wxPrintQuality","_size_t",0},
459 { "_wxPrintQuality","_time_t",0},
460 { "_byte","_unsigned_char",0},
461 { "_long","_unsigned_long",0},
462 { "_long","_signed_long",0},
463 { "_size_t","_wxCoord",0},
464 { "_size_t","_wxPrintQuality",0},
465 { "_size_t","_time_t",0},
466 { "_size_t","_unsigned_int",0},
467 { "_size_t","_int",0},
468 { "_size_t","_wxWindowID",0},
469 { "_size_t","_uint",0},
470 { "_uint","_wxCoord",0},
471 { "_uint","_wxPrintQuality",0},
472 { "_uint","_time_t",0},
473 { "_uint","_size_t",0},
474 { "_uint","_unsigned_int",0},
476 { "_uint","_wxWindowID",0},
477 { "_wxChar","_char",0},
478 { "_char","_wxChar",0},
479 { "_EBool","_wxCoord",0},
480 { "_EBool","_wxPrintQuality",0},
481 { "_EBool","_signed_int",0},
482 { "_EBool","_int",0},
483 { "_EBool","_wxWindowID",0},
484 { "_unsigned_long","_long",0},
485 { "_signed_int","_wxCoord",0},
486 { "_signed_int","_wxPrintQuality",0},
487 { "_signed_int","_EBool",0},
488 { "_signed_int","_wxWindowID",0},
489 { "_signed_int","_int",0},
490 { "_WXTYPE","_short",0},
491 { "_WXTYPE","_signed_short",0},
492 { "_WXTYPE","_unsigned_short",0},
493 { "_unsigned_short","_WXTYPE",0},
494 { "_unsigned_short","_short",0},
495 { "_signed_short","_WXTYPE",0},
496 { "_signed_short","_short",0},
497 { "_unsigned_char","_byte",0},
498 { "_unsigned_int","_wxCoord",0},
499 { "_unsigned_int","_wxPrintQuality",0},
500 { "_unsigned_int","_time_t",0},
501 { "_unsigned_int","_size_t",0},
502 { "_unsigned_int","_uint",0},
503 { "_unsigned_int","_wxWindowID",0},
504 { "_unsigned_int","_int",0},
505 { "_short","_WXTYPE",0},
506 { "_short","_unsigned_short",0},
507 { "_short","_signed_short",0},
508 { "_wxWindowID","_wxCoord",0},
509 { "_wxWindowID","_wxPrintQuality",0},
510 { "_wxWindowID","_time_t",0},
511 { "_wxWindowID","_size_t",0},
512 { "_wxWindowID","_EBool",0},
513 { "_wxWindowID","_uint",0},
514 { "_wxWindowID","_int",0},
515 { "_wxWindowID","_signed_int",0},
516 { "_wxWindowID","_unsigned_int",0},
517 { "_int","_wxCoord",0},
518 { "_int","_wxPrintQuality",0},
519 { "_int","_time_t",0},
520 { "_int","_size_t",0},
521 { "_int","_EBool",0},
523 { "_int","_wxWindowID",0},
524 { "_int","_unsigned_int",0},
525 { "_int","_signed_int",0},
526 { "_time_t","_wxCoord",0},
527 { "_time_t","_wxPrintQuality",0},
528 { "_time_t","_unsigned_int",0},
529 { "_time_t","_int",0},
530 { "_time_t","_wxWindowID",0},
531 { "_time_t","_uint",0},
532 { "_time_t","_size_t",0},
533 { "_wxCoord","_int",0},
534 { "_wxCoord","_signed_int",0},
535 { "_wxCoord","_unsigned_int",0},
536 { "_wxCoord","_wxWindowID",0},
537 { "_wxCoord","_uint",0},
538 { "_wxCoord","_EBool",0},
539 { "_wxCoord","_size_t",0},
540 { "_wxCoord","_time_t",0},
541 { "_wxCoord","_wxPrintQuality",0},
544 static PyObject
*SWIG_globals
;
548 SWIGEXPORT(void) initstreamsc() {
550 SWIG_globals
= SWIG_newvarlink();
551 m
= Py_InitModule("streamsc", streamscMethods
);
552 d
= PyModule_GetDict(m
);
554 wxPyPtrTypeMap_Add("wxInputStream", "wxPyInputStream");
557 for (i
= 0; _swig_mapping
[i
].n1
; i
++)
558 SWIG_RegisterMapping(_swig_mapping
[i
].n1
,_swig_mapping
[i
].n2
,_swig_mapping
[i
].pcnv
);