]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/gtk/streams.cpp
Newly SWIGged sources for wxGTK
[wxWidgets.git] / wxPython / src / gtk / streams.cpp
1 /*
2 * FILE : src/gtk/streams.cpp
3 *
4 * This file was automatically generated by :
5 * Simplified Wrapper and Interface Generator (SWIG)
6 * Version 1.1 (Build 883)
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
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);
51 #ifdef __cplusplus
52 }
53 #endif
54 #define SWIG_init initstreamsc
55
56 #define SWIG_name "streamsc"
57
58 #include "helpers.h"
59 #include "pyistream.h"
60 #include <wx/stream.h>
61 #include <wx/list.h>
62
63
64 static PyObject* t_output_helper(PyObject* target, PyObject* o) {
65 PyObject* o2;
66 PyObject* o3;
67
68 if (!target) {
69 target = o;
70 } else if (target == Py_None) {
71 Py_DECREF(Py_None);
72 target = o;
73 } else {
74 if (!PyTuple_Check(target)) {
75 o2 = target;
76 target = PyTuple_New(1);
77 PyTuple_SetItem(target, 0, o2);
78 }
79 o3 = PyTuple_New(1);
80 PyTuple_SetItem(o3, 0, o);
81
82 o2 = target;
83 target = PySequence_Concat(o2, o3);
84 Py_DECREF(o2);
85 Py_DECREF(o3);
86 }
87 return target;
88 }
89 #ifdef __cplusplus
90 extern "C" {
91 #endif
92 static wxPyInputStream *new_wxPyInputStream(PyObject *p) {
93 wxInputStream* wxis = wxPyCBInputStream::create(p);
94 if (wxis)
95 return new wxPyInputStream(wxis);
96 else
97 return NULL;
98 }
99
100 static PyObject *_wrap_new_wxInputStream(PyObject *self, PyObject *args, PyObject *kwargs) {
101 PyObject * _resultobj;
102 wxPyInputStream * _result;
103 PyObject * _arg0;
104 PyObject * _obj0 = 0;
105 char *_kwnames[] = { "p", NULL };
106 char _ptemp[128];
107
108 self = self;
109 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:new_wxInputStream",_kwnames,&_obj0))
110 return NULL;
111 {
112 _arg0 = _obj0;
113 }
114 {
115 PyThreadState* __tstate = wxPyBeginAllowThreads();
116 _result = (wxPyInputStream *)new_wxPyInputStream(_arg0);
117
118 wxPyEndAllowThreads(__tstate);
119 if (PyErr_Occurred()) return NULL;
120 } if (_result) {
121 SWIG_MakePtr(_ptemp, (char *) _result,"_wxPyInputStream_p");
122 _resultobj = Py_BuildValue("s",_ptemp);
123 } else {
124 Py_INCREF(Py_None);
125 _resultobj = Py_None;
126 }
127 return _resultobj;
128 }
129
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 };
136
137 self = self;
138 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxInputStream_close",_kwnames,&_argo0))
139 return NULL;
140 if (_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.");
144 return NULL;
145 }
146 }
147 {
148 PyThreadState* __tstate = wxPyBeginAllowThreads();
149 wxInputStream_close(_arg0);
150
151 wxPyEndAllowThreads(__tstate);
152 if (PyErr_Occurred()) return NULL;
153 } Py_INCREF(Py_None);
154 _resultobj = Py_None;
155 return _resultobj;
156 }
157
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 };
164
165 self = self;
166 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxInputStream_flush",_kwnames,&_argo0))
167 return NULL;
168 if (_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.");
172 return NULL;
173 }
174 }
175 {
176 PyThreadState* __tstate = wxPyBeginAllowThreads();
177 wxInputStream_flush(_arg0);
178
179 wxPyEndAllowThreads(__tstate);
180 if (PyErr_Occurred()) return NULL;
181 } Py_INCREF(Py_None);
182 _resultobj = Py_None;
183 return _resultobj;
184 }
185
186 #define wxInputStream_eof(_swigobj) (_swigobj->eof())
187 static PyObject *_wrap_wxInputStream_eof(PyObject *self, PyObject *args, PyObject *kwargs) {
188 PyObject * _resultobj;
189 bool _result;
190 wxPyInputStream * _arg0;
191 PyObject * _argo0 = 0;
192 char *_kwnames[] = { "self", NULL };
193
194 self = self;
195 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxInputStream_eof",_kwnames,&_argo0))
196 return NULL;
197 if (_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.");
201 return NULL;
202 }
203 }
204 {
205 PyThreadState* __tstate = wxPyBeginAllowThreads();
206 _result = (bool )wxInputStream_eof(_arg0);
207
208 wxPyEndAllowThreads(__tstate);
209 if (PyErr_Occurred()) return NULL;
210 } _resultobj = Py_BuildValue("i",_result);
211 return _resultobj;
212 }
213
214 #define wxInputStream_read(_swigobj,_swigarg0) (_swigobj->read(_swigarg0))
215 static PyObject *_wrap_wxInputStream_read(PyObject *self, PyObject *args, PyObject *kwargs) {
216 PyObject * _resultobj;
217 PyObject * _result;
218 wxPyInputStream * _arg0;
219 int _arg1 = (int ) -1;
220 PyObject * _argo0 = 0;
221 char *_kwnames[] = { "self","size", NULL };
222
223 self = self;
224 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxInputStream_read",_kwnames,&_argo0,&_arg1))
225 return NULL;
226 if (_argo0) {
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.");
230 return NULL;
231 }
232 }
233 {
234 PyThreadState* __tstate = wxPyBeginAllowThreads();
235 _result = (PyObject *)wxInputStream_read(_arg0,_arg1);
236
237 wxPyEndAllowThreads(__tstate);
238 if (PyErr_Occurred()) return NULL;
239 }{
240 _resultobj = _result;
241 }
242 return _resultobj;
243 }
244
245 #define wxInputStream_readline(_swigobj,_swigarg0) (_swigobj->readline(_swigarg0))
246 static PyObject *_wrap_wxInputStream_readline(PyObject *self, PyObject *args, PyObject *kwargs) {
247 PyObject * _resultobj;
248 PyObject * _result;
249 wxPyInputStream * _arg0;
250 int _arg1 = (int ) -1;
251 PyObject * _argo0 = 0;
252 char *_kwnames[] = { "self","size", NULL };
253
254 self = self;
255 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxInputStream_readline",_kwnames,&_argo0,&_arg1))
256 return NULL;
257 if (_argo0) {
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.");
261 return NULL;
262 }
263 }
264 {
265 PyThreadState* __tstate = wxPyBeginAllowThreads();
266 _result = (PyObject *)wxInputStream_readline(_arg0,_arg1);
267
268 wxPyEndAllowThreads(__tstate);
269 if (PyErr_Occurred()) return NULL;
270 }{
271 _resultobj = _result;
272 }
273 return _resultobj;
274 }
275
276 #define wxInputStream_readlines(_swigobj,_swigarg0) (_swigobj->readlines(_swigarg0))
277 static PyObject *_wrap_wxInputStream_readlines(PyObject *self, PyObject *args, PyObject *kwargs) {
278 PyObject * _resultobj;
279 PyObject * _result;
280 wxPyInputStream * _arg0;
281 int _arg1 = (int ) -1;
282 PyObject * _argo0 = 0;
283 char *_kwnames[] = { "self","sizehint", NULL };
284
285 self = self;
286 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxInputStream_readlines",_kwnames,&_argo0,&_arg1))
287 return NULL;
288 if (_argo0) {
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.");
292 return NULL;
293 }
294 }
295 {
296 PyThreadState* __tstate = wxPyBeginAllowThreads();
297 _result = (PyObject *)wxInputStream_readlines(_arg0,_arg1);
298
299 wxPyEndAllowThreads(__tstate);
300 if (PyErr_Occurred()) return NULL;
301 }{
302 _resultobj = _result;
303 }
304 return _resultobj;
305 }
306
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;
311 int _arg1;
312 int _arg2 = (int ) 0;
313 PyObject * _argo0 = 0;
314 char *_kwnames[] = { "self","offset","whence", NULL };
315
316 self = self;
317 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|i:wxInputStream_seek",_kwnames,&_argo0,&_arg1,&_arg2))
318 return NULL;
319 if (_argo0) {
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.");
323 return NULL;
324 }
325 }
326 {
327 PyThreadState* __tstate = wxPyBeginAllowThreads();
328 wxInputStream_seek(_arg0,_arg1,_arg2);
329
330 wxPyEndAllowThreads(__tstate);
331 if (PyErr_Occurred()) return NULL;
332 } Py_INCREF(Py_None);
333 _resultobj = Py_None;
334 return _resultobj;
335 }
336
337 #define wxInputStream_tell(_swigobj) (_swigobj->tell())
338 static PyObject *_wrap_wxInputStream_tell(PyObject *self, PyObject *args, PyObject *kwargs) {
339 PyObject * _resultobj;
340 int _result;
341 wxPyInputStream * _arg0;
342 PyObject * _argo0 = 0;
343 char *_kwnames[] = { "self", NULL };
344
345 self = self;
346 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxInputStream_tell",_kwnames,&_argo0))
347 return NULL;
348 if (_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.");
352 return NULL;
353 }
354 }
355 {
356 PyThreadState* __tstate = wxPyBeginAllowThreads();
357 _result = (int )wxInputStream_tell(_arg0);
358
359 wxPyEndAllowThreads(__tstate);
360 if (PyErr_Occurred()) return NULL;
361 } _resultobj = Py_BuildValue("i",_result);
362 return _resultobj;
363 }
364
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);
368 if (! str) {
369 PyErr_SetString(PyExc_TypeError, "Unable to convert to string");
370 return;
371 }
372 self->Write(PyString_AS_STRING(str),
373 PyString_GET_SIZE(str));
374 Py_DECREF(str);
375 }
376 static PyObject *_wrap_wxOutputStream_write(PyObject *self, PyObject *args, PyObject *kwargs) {
377 PyObject * _resultobj;
378 wxOutputStream * _arg0;
379 PyObject * _arg1;
380 PyObject * _argo0 = 0;
381 PyObject * _obj1 = 0;
382 char *_kwnames[] = { "self","obj", NULL };
383
384 self = self;
385 if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxOutputStream_write",_kwnames,&_argo0,&_obj1))
386 return NULL;
387 if (_argo0) {
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.");
391 return NULL;
392 }
393 }
394 {
395 _arg1 = _obj1;
396 }
397 {
398 PyThreadState* __tstate = wxPyBeginAllowThreads();
399 wxOutputStream_write(_arg0,_arg1);
400
401 wxPyEndAllowThreads(__tstate);
402 if (PyErr_Occurred()) return NULL;
403 } Py_INCREF(Py_None);
404 _resultobj = Py_None;
405 return _resultobj;
406 }
407
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 },
419 { NULL, NULL }
420 };
421 #ifdef __cplusplus
422 }
423 #endif
424 /*
425 * This table is used by the pointer type-checker
426 */
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},
453 { "_uint","_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},
500 { "_int","_uint",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},
520 {0,0,0}};
521
522 static PyObject *SWIG_globals;
523 #ifdef __cplusplus
524 extern "C"
525 #endif
526 SWIGEXPORT(void) initstreamsc() {
527 PyObject *m, *d;
528 SWIG_globals = SWIG_newvarlink();
529 m = Py_InitModule("streamsc", streamscMethods);
530 d = PyModule_GetDict(m);
531
532 wxPyPtrTypeMap_Add("wxInputStream", "wxPyInputStream");
533 {
534 int i;
535 for (i = 0; _swig_mapping[i].n1; i++)
536 SWIG_RegisterMapping(_swig_mapping[i].n1,_swig_mapping[i].n2,_swig_mapping[i].pcnv);
537 }
538 }