diff options
author | Johan Dahlin <johan@gnome.org> | 2008-01-19 19:12:11 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2008-01-19 19:12:11 +0000 |
commit | 8c1524ece22446d75b9f41e34b8281179dab1bee (patch) | |
tree | 63c1c3394be71f144e7c6b7f8bdd6af02b882fe6 | |
parent | bdb049a85bd76db64f75752a95c500920456f547 (diff) | |
download | pygobject-8c1524ece22446d75b9f41e34b8281179dab1bee.tar.gz pygobject-8c1524ece22446d75b9f41e34b8281179dab1bee.tar.xz pygobject-8c1524ece22446d75b9f41e34b8281179dab1bee.zip |
Implement.
2008-01-19 Johan Dahlin <johan@gnome.org>
* gio/gio.override (_wrap_g_app_info_get_all_for_type),
(_wrap_g_app_info_get_all),
(_wrap_g_drive_get_volumes): Implement.
svn path=/trunk/; revision=736
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | gio/gio.override | 72 |
2 files changed, 75 insertions, 4 deletions
@@ -1,9 +1,12 @@ 2008-01-19 Johan Dahlin <johan@gnome.org> + * gio/gio.override (_wrap_g_app_info_get_all_for_type), + (_wrap_g_app_info_get_all), + (_wrap_g_drive_get_volumes): Implement. + * gio/gio.override (async_result_callback_marshal): New marshaller for async results - (_wrap_g_input_stream_read_async): impl. - + (_wrap_g_input_stream_read_async): Impl. * gio/gio-types.defs: Add SimpleAsyncRequest * gio/giomodule.c: Register enums/constants diff --git a/gio/gio.override b/gio/gio.override index 11cbbaa..78b83ed 100644 --- a/gio/gio.override +++ b/gio/gio.override @@ -32,10 +32,11 @@ async_result_callback_marshal(GObject *source_object, pygobject_new(source_object), pygobject_new((GObject *)result)); - if (ret == NULL) { + if (ret == NULL) + { PyErr_Print(); PyErr_Clear(); - } + } Py_XDECREF(ret); @@ -118,6 +119,73 @@ _wrap_g_volume_monitor_get_mounts (PyGObject *self) return ret; } %% +override g_drive_get_volumes noargs +static PyObject * +_wrap_g_drive_get_volumes (PyGObject *self) +{ + GList *list, *l; + PyObject *ret; + + list = g_drive_get_volumes (G_DRIVE (self->obj)); + + ret = PyList_New(0); + for (l = list; l; l = l->next) { + GVolume *volume = l->data; + PyObject *item = pygobject_new((GObject *)volume); + PyList_Append(ret, item); + Py_DECREF(item); + } + g_list_free(list); + + return ret; +} +%% +override g_app_info_get_all noargs +static PyObject * +_wrap_g_app_info_get_all (PyGObject *self) +{ + GList *list, *l; + PyObject *ret; + + list = g_app_info_get_all (); + + ret = PyList_New(0); + for (l = list; l; l = l->next) { + GObject *obj = l->data; + PyObject *item = pygobject_new(obj); + PyList_Append(ret, item); + Py_DECREF(item); + } + g_list_free(list); + + return ret; +} +%% +override g_app_info_get_all_for_type args +static PyObject * +_wrap_g_app_info_get_all_for_type (PyGObject *self, PyObject *args) +{ + GList *list, *l; + PyObject *ret; + gchar *type; + + if (!PyArg_ParseTuple (args, "s:app_info_get_all_for_type", &type)) + return NULL; + + list = g_app_info_get_all_for_type (type); + + ret = PyList_New(0); + for (l = list; l; l = l->next) { + GObject *obj = l->data; + PyObject *item = pygobject_new(obj); + PyList_Append(ret, item); + Py_DECREF(item); + } + g_list_free(list); + + return ret; +} +%% override g_input_stream_read kwargs static PyObject * _wrap_g_input_stream_read(PyGObject *self, PyObject *args, PyObject *kwargs) |