]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/msw/streams.cpp
Merged wxPython 2.2.2 over to the main branch
[wxWidgets.git] / wxPython / src / msw / streams.cpp
1 /*
2 * FILE : src/msw/streams.cpp
3 *
4 * This file was automatically generated by :
5 * Simplified Wrapper and Interface Generator (SWIG)
6 * Version 1.1 (Build 810)
7 *
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.
12 *
13 * Do not make changes to this file--changes will be lost!
14 *
15 */
16
17
18 #define SWIGCODE
19 /* Implementation : PYTHON */
20
21 #define SWIGPYTHON
22 #include <string.h>
23 #include <stdlib.h>
24 /* Definitions for Windows/Unix exporting */
25 #if defined(__WIN32__)
26 # if defined(_MSC_VER)
27 # define SWIGEXPORT(a) __declspec(dllexport) a
28 # else
29 # if defined(__BORLANDC__)
30 # define SWIGEXPORT(a) a _export
31 # else
32 # define SWIGEXPORT(a) a
33 # endif
34 # endif
35 #else
36 # define SWIGEXPORT(a) a
37 #endif
38
39 #include "Python.h"
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 extern void SWIG_MakePtr(char *, void *, char *);
45 extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
46 extern char *SWIG_GetPtr(char *, void **, char *);
47 extern char *SWIG_GetPtrObj(PyObject *, void **, char *);
48 extern void SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
49 extern PyObject *SWIG_newvarlink(void);
50 #ifdef __cplusplus
51 }
52 #endif
53 #define SWIG_init initstreamsc
54
55 #define SWIG_name "streamsc"
56
57 #include "helpers.h"
58 #include <wx/stream.h>
59 #include <wx/list.h>
60
61 static PyObject* l_output_helper(PyObject* target, PyObject* o) {
62 PyObject* o2;
63 if (!target) {
64 target = o;
65 } else if (target == Py_None) {
66 Py_DECREF(Py_None);
67 target = o;
68 } else {
69 if (!PyList_Check(target)) {
70 o2 = target;
71 target = PyList_New(0);
72 PyList_Append(target, o2);
73 Py_XDECREF(o2);
74 }
75 PyList_Append(target,o);
76 Py_XDECREF(o);
77 }
78 return target;
79 }
80
81 static PyObject* t_output_helper(PyObject* target, PyObject* o) {
82 PyObject* o2;
83 PyObject* o3;
84
85 if (!target) {
86 target = o;
87 } else if (target == Py_None) {
88 Py_DECREF(Py_None);
89 target = o;
90 } else {
91 if (!PyTuple_Check(target)) {
92 o2 = target;
93 target = PyTuple_New(1);
94 PyTuple_SetItem(target, 0, o2);
95 }
96 o3 = PyTuple_New(1);
97 PyTuple_SetItem(o3, 0, o);
98
99 o2 = target;
100 target = PySequence_Concat(o2, o3);
101 Py_DECREF(o2);
102 Py_DECREF(o3);
103 }
104 return target;
105 }
106
107 static char* wxStringErrorMsg = "string type is required for parameter";
108 // C++
109 // definitions of wxStringPtrList and wxPyInputStream
110 #include <wx/listimpl.cpp>
111 WX_DEFINE_LIST(wxStringPtrList);
112
113
114 void wxPyInputStream::close() {
115 /* do nothing */
116 }
117
118 void wxPyInputStream::flush() {
119 /*do nothing*/
120 }
121
122 bool wxPyInputStream::eof() {
123 if (wxi)
124 return wxi->Eof();
125 else
126 return TRUE;
127 }
128
129 wxPyInputStream::~wxPyInputStream() {
130 /*do nothing*/
131 }
132
133 wxString* wxPyInputStream::read(int size) {
134 wxString* s = NULL;
135 const int BUFSIZE = 1024;
136
137 // check if we have a real wxInputStream to work with
138 if (!wxi) {
139 PyErr_SetString(PyExc_IOError,"no valid C-wxInputStream below");
140 return NULL;
141 }
142
143 if (size < 0) {
144 // init buffers
145 char * buf = new char[BUFSIZE];
146 if (!buf) {
147 PyErr_NoMemory();
148 return NULL;
149 }
150
151 s = new wxString();
152 if (!s) {
153 delete buf;
154 PyErr_NoMemory();
155 return NULL;
156 }
157
158 // read until EOF
159 wxPy_BEGIN_ALLOW_THREADS;
160 while (! wxi->Eof()) {
161 wxi->Read(buf, BUFSIZE);
162 //*s += wxString(buf, wxi->LastRead());
163 s->Append(buf, wxi->LastRead());
164 }
165 delete buf;
166 wxPy_END_ALLOW_THREADS;
167
168 // error check
169 if (wxi->LastError() == wxSTREAM_READ_ERROR) {
170 delete s;
171 PyErr_SetString(PyExc_IOError,"IOError in wxInputStream");
172 return NULL;
173 }
174
175 } else { // Read only size number of characters
176 s = new wxString;
177 if (!s) {
178 PyErr_NoMemory();
179 return NULL;
180 }
181
182 // read size bytes
183 wxPy_BEGIN_ALLOW_THREADS;
184 wxi->Read(s->GetWriteBuf(size+1), size);
185 s->UngetWriteBuf(wxi->LastRead());
186 wxPy_END_ALLOW_THREADS;
187
188 // error check
189 if (wxi->LastError() == wxSTREAM_READ_ERROR) {
190 delete s;
191 PyErr_SetString(PyExc_IOError,"IOError in wxInputStream");
192 return NULL;
193 }
194 }
195 return s;
196 }
197
198
199 wxString* wxPyInputStream::readline (int size) {
200 // check if we have a real wxInputStream to work with
201 if (!wxi) {
202 PyErr_SetString(PyExc_IOError,"no valid C-wxInputStream below");
203 return NULL;
204 }
205
206 // init buffer
207 int i;
208 char ch;
209 wxString* s = new wxString;
210 if (!s) {
211 PyErr_NoMemory();
212 return NULL;
213 }
214
215 // read until \n or byte limit reached
216 wxPy_BEGIN_ALLOW_THREADS;
217 for (i=ch=0; (ch != '\n') && (!wxi->Eof()) && ((size < 0) || (i < size)); i++) {
218 *s += ch = wxi->GetC();
219 }
220 wxPy_END_ALLOW_THREADS;
221
222 // errorcheck
223 if (wxi->LastError() == wxSTREAM_READ_ERROR) {
224 delete s;
225 PyErr_SetString(PyExc_IOError,"IOError in wxInputStream");
226 return NULL;
227 }
228 return s;
229 }
230
231
232 wxStringPtrList* wxPyInputStream::readlines (int sizehint) {
233 // check if we have a real wxInputStream to work with
234 if (!wxi) {
235 PyErr_SetString(PyExc_IOError,"no valid C-wxInputStream below");
236 return NULL;
237 }
238
239 // init list
240 wxStringPtrList* l = new wxStringPtrList();
241 if (!l) {
242 PyErr_NoMemory();
243 return NULL;
244 }
245
246 // read sizehint bytes or until EOF
247 wxPy_BEGIN_ALLOW_THREADS;
248 int i;
249 for (i=0; (!wxi->Eof()) && ((sizehint < 0) || (i < sizehint));) {
250 wxString* s = readline();
251 if (s == NULL) {
252 l->DeleteContents(TRUE);
253 l->Clear();
254 return NULL;
255 }
256 l->Append(s);
257 i = i + s->Length();
258 }
259 wxPy_END_ALLOW_THREADS;
260
261 // error check
262 if (wxi->LastError() == wxSTREAM_READ_ERROR) {
263 l->DeleteContents(TRUE);
264 l->Clear();
265 PyErr_SetString(PyExc_IOError,"IOError in wxInputStream");
266 return NULL;
267 }
268 return l;
269 }
270
271
272 void wxPyInputStream::seek(int offset, int whence) {
273 if (wxi)
274 wxi->SeekI(offset, wxSeekMode(whence));
275 }
276
277 int wxPyInputStream::tell(){
278 if (wxi)
279 return wxi->TellI();
280 }
281
282
283
284 // wxInputStream which operates on a Python file-like object
285 class wxPyCBInputStream : public wxInputStream {
286 protected:
287 PyObject* read;
288 PyObject* seek;
289 PyObject* tell;
290 PyObject* py;
291
292 virtual size_t OnSysRead(void *buffer, size_t bufsize) {
293 if (bufsize == 0)
294 return 0;
295
296 bool doSave = wxPyRestoreThread();
297 PyObject* arglist = Py_BuildValue("(i)", bufsize);
298 PyObject* result = PyEval_CallObject(read, arglist);
299 Py_DECREF(arglist);
300
301 size_t o = 0;
302 if ((result != NULL) && PyString_Check(result)) {
303 o = PyString_Size(result);
304 if (o == 0)
305 m_lasterror = wxSTREAM_EOF;
306 if (o > bufsize)
307 o = bufsize;
308 strncpy((char*)buffer, PyString_AsString(result), o);
309 Py_DECREF(result);
310
311 }
312 else
313 m_lasterror = wxSTREAM_READ_ERROR;
314 wxPySaveThread(doSave);
315 m_lastcount = o;
316 return o;
317 }
318
319 virtual size_t OnSysWrite(const void *buffer, size_t bufsize){
320 m_lasterror = wxSTREAM_WRITE_ERROR;
321 return 0;
322 }
323
324 virtual off_t OnSysSeek(off_t off, wxSeekMode mode){
325 bool doSave = wxPyRestoreThread();
326 PyObject*arglist = Py_BuildValue("(ii)", off, mode);
327 PyObject*result = PyEval_CallObject(seek, arglist);
328 Py_DECREF(arglist);
329 Py_XDECREF(result);
330 wxPySaveThread(doSave);
331 return OnSysTell();
332 }
333
334 virtual off_t OnSysTell() const{
335 bool doSave = wxPyRestoreThread();
336 PyObject* arglist = Py_BuildValue("()");
337 PyObject* result = PyEval_CallObject(tell, arglist);
338 Py_DECREF(arglist);
339 off_t o = 0;
340 if (result != NULL) {
341 o = PyInt_AsLong(result);
342 Py_DECREF(result);
343 };
344 wxPySaveThread(doSave);
345 return o;
346 }
347
348 wxPyCBInputStream(PyObject *p, PyObject *r, PyObject *s, PyObject *t)
349 : py(p), read(r), seek(s), tell(t)
350 {}
351
352 public:
353 ~wxPyCBInputStream() {
354 bool doSave = wxPyRestoreThread();
355 Py_XDECREF(py);
356 Py_XDECREF(read);
357 Py_XDECREF(seek);
358 Py_XDECREF(tell);
359 wxPySaveThread(doSave);
360 }
361
362 virtual size_t GetSize() {
363 if (seek && tell) {
364 off_t temp = OnSysTell();
365 off_t ret = OnSysSeek(0, wxFromEnd);
366 OnSysSeek(temp, wxFromStart);
367 return ret;
368 }
369 else
370 return 0;
371 }
372
373 static wxPyCBInputStream* create(PyObject *py) {
374 PyObject* read;
375 PyObject* seek;
376 PyObject* tell;
377
378 if (!PyInstance_Check(py) && !PyFile_Check(py)) {
379 PyErr_SetString(PyExc_TypeError, "Not a file-like object");
380 Py_XDECREF(py);
381 return NULL;
382 }
383 read = getMethod(py, "read");
384 seek = getMethod(py, "seek");
385 tell = getMethod(py, "tell");
386
387 if (!read) {
388 PyErr_SetString(PyExc_TypeError, "Not a file-like object");
389 Py_XDECREF(py);
390 Py_XDECREF(read);
391 Py_XDECREF(seek);
392 Py_XDECREF(tell);
393 return NULL;
394 }
395 return new wxPyCBInputStream(py, read, seek, tell);
396 }
397
398 static PyObject* getMethod(PyObject* py, char* name) {
399 if (!PyObject_HasAttrString(py, name))
400 return NULL;
401 PyObject* o = PyObject_GetAttrString(py, name);
402 if (!PyMethod_Check(o) && !PyCFunction_Check(o))
403 return NULL;
404 return o;
405 }
406
407 protected:
408
409 };
410
411 #ifdef __cplusplus
412 extern "C" {
413 #endif
414 static wxPyInputStream *new_wxPyInputStream(PyObject *p) {
415 wxInputStream* wxi = wxPyCBInputStream::create(p);
416 if (wxi)
417 return new wxPyInputStream(wxi);
418 else
419 return NULL;
420 }
421
422 static PyObject *_wrap_new_wxInputStream(PyObject *self, PyObject *args, PyObject *kwargs) {
423 PyObject * _resultobj;
424 wxPyInputStream * _result;
425 PyObject * _arg0;
426 PyObject * _obj0 = 0;
427 char *_kwnames[] = { "p", NULL };
428
429 self = self;
430 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:new_wxInputStream",_kwnames,&_obj0))
431 return NULL;
432 {
433 _arg0 = _obj0;
434 }
435 {
436 _result = (wxPyInputStream *)new_wxPyInputStream(_arg0);
437
438 }{
439 char _ptemp[128];
440 if (_result) {
441 SWIG_MakePtr(_ptemp, (char *) _result,"_wxPyInputStream_p");
442 _resultobj = Py_BuildValue("s",_ptemp);
443 }
444 else
445 _resultobj=0;
446 }
447 return _resultobj;
448 }
449
450 #define wxInputStream_close(_swigobj) (_swigobj->close())
451 static PyObject *_wrap_wxInputStream_close(PyObject *self, PyObject *args, PyObject *kwargs) {
452 PyObject * _resultobj;
453 wxPyInputStream * _arg0;
454 PyObject * _argo0 = 0;
455 char *_kwnames[] = { "self", NULL };
456
457 self = self;
458 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxInputStream_close",_kwnames,&_argo0))
459 return NULL;
460 if (_argo0) {
461 if (_argo0 == Py_None) { _arg0 = NULL; }
462 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyInputStream_p")) {
463 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxInputStream_close. Expected _wxPyInputStream_p.");
464 return NULL;
465 }
466 }
467 {
468 wxInputStream_close(_arg0);
469
470 } Py_INCREF(Py_None);
471 _resultobj = Py_None;
472 return _resultobj;
473 }
474
475 #define wxInputStream_flush(_swigobj) (_swigobj->flush())
476 static PyObject *_wrap_wxInputStream_flush(PyObject *self, PyObject *args, PyObject *kwargs) {
477 PyObject * _resultobj;
478 wxPyInputStream * _arg0;
479 PyObject * _argo0 = 0;
480 char *_kwnames[] = { "self", NULL };
481
482 self = self;
483 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxInputStream_flush",_kwnames,&_argo0))
484 return NULL;
485 if (_argo0) {
486 if (_argo0 == Py_None) { _arg0 = NULL; }
487 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyInputStream_p")) {
488 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxInputStream_flush. Expected _wxPyInputStream_p.");
489 return NULL;
490 }
491 }
492 {
493 wxInputStream_flush(_arg0);
494
495 } Py_INCREF(Py_None);
496 _resultobj = Py_None;
497 return _resultobj;
498 }
499
500 #define wxInputStream_eof(_swigobj) (_swigobj->eof())
501 static PyObject *_wrap_wxInputStream_eof(PyObject *self, PyObject *args, PyObject *kwargs) {
502 PyObject * _resultobj;
503 bool _result;
504 wxPyInputStream * _arg0;
505 PyObject * _argo0 = 0;
506 char *_kwnames[] = { "self", NULL };
507
508 self = self;
509 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxInputStream_eof",_kwnames,&_argo0))
510 return NULL;
511 if (_argo0) {
512 if (_argo0 == Py_None) { _arg0 = NULL; }
513 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyInputStream_p")) {
514 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxInputStream_eof. Expected _wxPyInputStream_p.");
515 return NULL;
516 }
517 }
518 {
519 _result = (bool )wxInputStream_eof(_arg0);
520
521 } _resultobj = Py_BuildValue("i",_result);
522 return _resultobj;
523 }
524
525 #define wxInputStream_read(_swigobj,_swigarg0) (_swigobj->read(_swigarg0))
526 static PyObject *_wrap_wxInputStream_read(PyObject *self, PyObject *args, PyObject *kwargs) {
527 PyObject * _resultobj;
528 wxString * _result;
529 wxPyInputStream * _arg0;
530 int _arg1 = (int ) -1;
531 PyObject * _argo0 = 0;
532 char *_kwnames[] = { "self","size", NULL };
533
534 self = self;
535 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxInputStream_read",_kwnames,&_argo0,&_arg1))
536 return NULL;
537 if (_argo0) {
538 if (_argo0 == Py_None) { _arg0 = NULL; }
539 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyInputStream_p")) {
540 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxInputStream_read. Expected _wxPyInputStream_p.");
541 return NULL;
542 }
543 }
544 {
545 _result = (wxString *)wxInputStream_read(_arg0,_arg1);
546
547 }{
548 if (_result) {
549 _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
550 delete _result;
551 }
552 else
553 _resultobj=0;
554 }
555 return _resultobj;
556 }
557
558 #define wxInputStream_readline(_swigobj,_swigarg0) (_swigobj->readline(_swigarg0))
559 static PyObject *_wrap_wxInputStream_readline(PyObject *self, PyObject *args, PyObject *kwargs) {
560 PyObject * _resultobj;
561 wxString * _result;
562 wxPyInputStream * _arg0;
563 int _arg1 = (int ) -1;
564 PyObject * _argo0 = 0;
565 char *_kwnames[] = { "self","size", NULL };
566
567 self = self;
568 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxInputStream_readline",_kwnames,&_argo0,&_arg1))
569 return NULL;
570 if (_argo0) {
571 if (_argo0 == Py_None) { _arg0 = NULL; }
572 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyInputStream_p")) {
573 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxInputStream_readline. Expected _wxPyInputStream_p.");
574 return NULL;
575 }
576 }
577 {
578 _result = (wxString *)wxInputStream_readline(_arg0,_arg1);
579
580 }{
581 if (_result) {
582 _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
583 delete _result;
584 }
585 else
586 _resultobj=0;
587 }
588 return _resultobj;
589 }
590
591 #define wxInputStream_readlines(_swigobj,_swigarg0) (_swigobj->readlines(_swigarg0))
592 static PyObject *_wrap_wxInputStream_readlines(PyObject *self, PyObject *args, PyObject *kwargs) {
593 PyObject * _resultobj;
594 wxStringPtrList * _result;
595 wxPyInputStream * _arg0;
596 int _arg1 = (int ) -1;
597 PyObject * _argo0 = 0;
598 char *_kwnames[] = { "self","sizehint", NULL };
599
600 self = self;
601 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxInputStream_readlines",_kwnames,&_argo0,&_arg1))
602 return NULL;
603 if (_argo0) {
604 if (_argo0 == Py_None) { _arg0 = NULL; }
605 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyInputStream_p")) {
606 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxInputStream_readlines. Expected _wxPyInputStream_p.");
607 return NULL;
608 }
609 }
610 {
611 _result = (wxStringPtrList *)wxInputStream_readlines(_arg0,_arg1);
612
613 }{
614 if (_result) {
615 _resultobj = PyList_New(_result->GetCount());
616 wxStringPtrList::Node *node = _result->GetFirst();
617 for (int i=0; node; i++) {
618 wxString *s = node->GetData();
619 PyList_SetItem(_resultobj, i, PyString_FromStringAndSize(s->c_str(), s->Len()));
620 node = node->GetNext();
621 delete s;
622 }
623 delete _result;
624 }
625 else
626 _resultobj=0;
627 }
628 return _resultobj;
629 }
630
631 #define wxInputStream_seek(_swigobj,_swigarg0,_swigarg1) (_swigobj->seek(_swigarg0,_swigarg1))
632 static PyObject *_wrap_wxInputStream_seek(PyObject *self, PyObject *args, PyObject *kwargs) {
633 PyObject * _resultobj;
634 wxPyInputStream * _arg0;
635 int _arg1;
636 int _arg2 = (int ) 0;
637 PyObject * _argo0 = 0;
638 char *_kwnames[] = { "self","offset","whence", NULL };
639
640 self = self;
641 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|i:wxInputStream_seek",_kwnames,&_argo0,&_arg1,&_arg2))
642 return NULL;
643 if (_argo0) {
644 if (_argo0 == Py_None) { _arg0 = NULL; }
645 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyInputStream_p")) {
646 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxInputStream_seek. Expected _wxPyInputStream_p.");
647 return NULL;
648 }
649 }
650 {
651 wxInputStream_seek(_arg0,_arg1,_arg2);
652
653 } Py_INCREF(Py_None);
654 _resultobj = Py_None;
655 return _resultobj;
656 }
657
658 #define wxInputStream_tell(_swigobj) (_swigobj->tell())
659 static PyObject *_wrap_wxInputStream_tell(PyObject *self, PyObject *args, PyObject *kwargs) {
660 PyObject * _resultobj;
661 int _result;
662 wxPyInputStream * _arg0;
663 PyObject * _argo0 = 0;
664 char *_kwnames[] = { "self", NULL };
665
666 self = self;
667 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxInputStream_tell",_kwnames,&_argo0))
668 return NULL;
669 if (_argo0) {
670 if (_argo0 == Py_None) { _arg0 = NULL; }
671 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyInputStream_p")) {
672 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxInputStream_tell. Expected _wxPyInputStream_p.");
673 return NULL;
674 }
675 }
676 {
677 _result = (int )wxInputStream_tell(_arg0);
678
679 } _resultobj = Py_BuildValue("i",_result);
680 return _resultobj;
681 }
682
683 static void wxOutputStream_write(wxOutputStream *self,const wxString & str) {
684 self->Write(str.c_str(), str.Length());
685 }
686 static PyObject *_wrap_wxOutputStream_write(PyObject *self, PyObject *args, PyObject *kwargs) {
687 PyObject * _resultobj;
688 wxOutputStream * _arg0;
689 wxString * _arg1;
690 PyObject * _argo0 = 0;
691 PyObject * _obj1 = 0;
692 char *_kwnames[] = { "self","str", NULL };
693
694 self = self;
695 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxOutputStream_write",_kwnames,&_argo0,&_obj1))
696 return NULL;
697 if (_argo0) {
698 if (_argo0 == Py_None) { _arg0 = NULL; }
699 else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxOutputStream_p")) {
700 PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxOutputStream_write. Expected _wxOutputStream_p.");
701 return NULL;
702 }
703 }
704 {
705 if (!PyString_Check(_obj1)) {
706 PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
707 return NULL;
708 }
709 _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1));
710 }
711 {
712 wxOutputStream_write(_arg0,*_arg1);
713
714 } Py_INCREF(Py_None);
715 _resultobj = Py_None;
716 {
717 if (_obj1)
718 delete _arg1;
719 }
720 return _resultobj;
721 }
722
723 static PyMethodDef streamscMethods[] = {
724 { "wxOutputStream_write", (PyCFunction) _wrap_wxOutputStream_write, METH_VARARGS | METH_KEYWORDS },
725 { "wxInputStream_tell", (PyCFunction) _wrap_wxInputStream_tell, METH_VARARGS | METH_KEYWORDS },
726 { "wxInputStream_seek", (PyCFunction) _wrap_wxInputStream_seek, METH_VARARGS | METH_KEYWORDS },
727 { "wxInputStream_readlines", (PyCFunction) _wrap_wxInputStream_readlines, METH_VARARGS | METH_KEYWORDS },
728 { "wxInputStream_readline", (PyCFunction) _wrap_wxInputStream_readline, METH_VARARGS | METH_KEYWORDS },
729 { "wxInputStream_read", (PyCFunction) _wrap_wxInputStream_read, METH_VARARGS | METH_KEYWORDS },
730 { "wxInputStream_eof", (PyCFunction) _wrap_wxInputStream_eof, METH_VARARGS | METH_KEYWORDS },
731 { "wxInputStream_flush", (PyCFunction) _wrap_wxInputStream_flush, METH_VARARGS | METH_KEYWORDS },
732 { "wxInputStream_close", (PyCFunction) _wrap_wxInputStream_close, METH_VARARGS | METH_KEYWORDS },
733 { "new_wxInputStream", (PyCFunction) _wrap_new_wxInputStream, METH_VARARGS | METH_KEYWORDS },
734 { NULL, NULL }
735 };
736 #ifdef __cplusplus
737 }
738 #endif
739 /*
740 * This table is used by the pointer type-checker
741 */
742 static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
743 { "_signed_long","_long",0},
744 { "_wxPrintQuality","_wxCoord",0},
745 { "_wxPrintQuality","_int",0},
746 { "_wxPrintQuality","_signed_int",0},
747 { "_wxPrintQuality","_unsigned_int",0},
748 { "_wxPrintQuality","_wxWindowID",0},
749 { "_wxPrintQuality","_uint",0},
750 { "_wxPrintQuality","_EBool",0},
751 { "_wxPrintQuality","_size_t",0},
752 { "_wxPrintQuality","_time_t",0},
753 { "_byte","_unsigned_char",0},
754 { "_long","_unsigned_long",0},
755 { "_long","_signed_long",0},
756 { "_size_t","_wxCoord",0},
757 { "_size_t","_wxPrintQuality",0},
758 { "_size_t","_time_t",0},
759 { "_size_t","_unsigned_int",0},
760 { "_size_t","_int",0},
761 { "_size_t","_wxWindowID",0},
762 { "_size_t","_uint",0},
763 { "_uint","_wxCoord",0},
764 { "_uint","_wxPrintQuality",0},
765 { "_uint","_time_t",0},
766 { "_uint","_size_t",0},
767 { "_uint","_unsigned_int",0},
768 { "_uint","_int",0},
769 { "_uint","_wxWindowID",0},
770 { "_wxChar","_char",0},
771 { "_char","_wxChar",0},
772 { "_EBool","_wxCoord",0},
773 { "_EBool","_wxPrintQuality",0},
774 { "_EBool","_signed_int",0},
775 { "_EBool","_int",0},
776 { "_EBool","_wxWindowID",0},
777 { "_unsigned_long","_long",0},
778 { "_wxPyInputStream","_class_wxPyInputStream",0},
779 { "_class_wxOutputStream","_wxOutputStream",0},
780 { "_signed_int","_wxCoord",0},
781 { "_signed_int","_wxPrintQuality",0},
782 { "_signed_int","_EBool",0},
783 { "_signed_int","_wxWindowID",0},
784 { "_signed_int","_int",0},
785 { "_WXTYPE","_short",0},
786 { "_WXTYPE","_signed_short",0},
787 { "_WXTYPE","_unsigned_short",0},
788 { "_unsigned_short","_WXTYPE",0},
789 { "_unsigned_short","_short",0},
790 { "_class_wxPyInputStream","_wxPyInputStream",0},
791 { "_signed_short","_WXTYPE",0},
792 { "_signed_short","_short",0},
793 { "_unsigned_char","_byte",0},
794 { "_unsigned_int","_wxCoord",0},
795 { "_unsigned_int","_wxPrintQuality",0},
796 { "_unsigned_int","_time_t",0},
797 { "_unsigned_int","_size_t",0},
798 { "_unsigned_int","_uint",0},
799 { "_unsigned_int","_wxWindowID",0},
800 { "_unsigned_int","_int",0},
801 { "_short","_WXTYPE",0},
802 { "_short","_unsigned_short",0},
803 { "_short","_signed_short",0},
804 { "_wxWindowID","_wxCoord",0},
805 { "_wxWindowID","_wxPrintQuality",0},
806 { "_wxWindowID","_time_t",0},
807 { "_wxWindowID","_size_t",0},
808 { "_wxWindowID","_EBool",0},
809 { "_wxWindowID","_uint",0},
810 { "_wxWindowID","_int",0},
811 { "_wxWindowID","_signed_int",0},
812 { "_wxWindowID","_unsigned_int",0},
813 { "_int","_wxCoord",0},
814 { "_int","_wxPrintQuality",0},
815 { "_int","_time_t",0},
816 { "_int","_size_t",0},
817 { "_int","_EBool",0},
818 { "_int","_uint",0},
819 { "_int","_wxWindowID",0},
820 { "_int","_unsigned_int",0},
821 { "_int","_signed_int",0},
822 { "_time_t","_wxCoord",0},
823 { "_time_t","_wxPrintQuality",0},
824 { "_time_t","_unsigned_int",0},
825 { "_time_t","_int",0},
826 { "_time_t","_wxWindowID",0},
827 { "_time_t","_uint",0},
828 { "_time_t","_size_t",0},
829 { "_wxCoord","_int",0},
830 { "_wxCoord","_signed_int",0},
831 { "_wxCoord","_unsigned_int",0},
832 { "_wxCoord","_wxWindowID",0},
833 { "_wxCoord","_uint",0},
834 { "_wxCoord","_EBool",0},
835 { "_wxCoord","_size_t",0},
836 { "_wxCoord","_time_t",0},
837 { "_wxCoord","_wxPrintQuality",0},
838 { "_wxOutputStream","_class_wxOutputStream",0},
839 {0,0,0}};
840
841 static PyObject *SWIG_globals;
842 #ifdef __cplusplus
843 extern "C"
844 #endif
845 SWIGEXPORT(void) initstreamsc() {
846 PyObject *m, *d;
847 SWIG_globals = SWIG_newvarlink();
848 m = Py_InitModule("streamsc", streamscMethods);
849 d = PyModule_GetDict(m);
850 {
851 int i;
852 for (i = 0; _swig_mapping[i].n1; i++)
853 SWIG_RegisterMapping(_swig_mapping[i].n1,_swig_mapping[i].n2,_swig_mapping[i].pcnv);
854 }
855 }