1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
/* -*- Mode: C; c-basic-offset: 4 -*- */
%%
headers
#include <Python.h>
#define NO_IMPORT_PYGOBJECT
#include "pygobject.h"
#include <gsf/gsf-input.h>
#include <gsf-gnome/gsf-input-bonobo.h>
#include <gsf-gnome/gsf-input-gnomevfs.h>
#include <gsf/gsf-output.h>
#include <gsf-gnome/gsf-output-bonobo.h>
#include <gsf-gnome/gsf-output-gnomevfs.h>
#define GSF_TYPE_INPUT_BONOBO GSF_INPUT_BONOBO_TYPE
#define GSF_TYPE_INPUT_GNOME_VFS GSF_INPUT_GNOMEVFS_TYPE
#define GSF_TYPE_OUTPUT_BONOBO GSF_OUTPUT_BONOBO_TYPE
#define GSF_TYPE_OUTPUT_GNOME_VFS GSF_OUTPUT_GNOMEVFS_TYPE
%%
modulename gnome
%%
import gsf.Input as PyGsfInput_Type
import gsf.Output as PyGsfOutput_Type
%%
init
#ifndef LIBGSF_GNOMEVFS_VIA_GIO
gnome_vfs_init();
#endif
%%
ignore-glob
_*
gsf_input_set_*
*_get_type
gsf_*_error
%%
override gsf_input_bonobo_new kwargs
static int
_wrap_gsf_input_bonobo_new(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { (char *) "stream", NULL };
PyObject *stream;
GError *err = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
(char *) "O:GsfInputBonobo.__init__",
kwlist, &stream))
return -1;
#if 1
/* See http://bugzilla.gnome.org/show_bug.cgi?id=382254 */
return -1;
#else
if (!PyORBit_Object_Check(stream)) {
PyErr_SetString(PyExc_TypeError, "stream must be a CORBA.Object");
return -1;
}
self->obj = (GObject *)gsf_input_bonobo_new((CORBA_Object)PyORBit_Object_Get(stream), &err);
if (pyg_error_check(&err))
return -1;
if (!self->obj) {
PyErr_SetString(PyExc_RuntimeError, "could not create GsfInputBonobo object");
return -1;
}
pygobject_register_wrapper((PyObject *)self);
return 0;
#endif
}
%%
override gsf_output_bonobo_new kwargs
static int
_wrap_gsf_output_bonobo_new(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "stream", NULL };
PyObject *stream;
GError *err = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:GsfOutputBonobo.__init__", kwlist, &stream))
return -1;
#if 1
/* See http://bugzilla.gnome.org/show_bug.cgi?id=382254 */
return -1;
#else
if (!PyORBit_Object_Check(stream)) {
PyErr_SetString(PyExc_TypeError, "stream must be a CORBA.Object");
return -1;
}
self->obj = (GObject *)gsf_output_bonobo_new((CORBA_Object)PyORBit_Object_Get(stream), &err);
if (pyg_error_check(&err))
return -1;
if (!self->obj) {
PyErr_SetString(PyExc_RuntimeError, "could not create GsfOutputBonobo object");
return -1;
}
pygobject_register_wrapper((PyObject *)self);
return 0;
#endif
}
|