/* -*- Mode: C; c-basic-offset: 4 -*- * pygobject - Python bindings for GObject * Copyright (C) 2008 Johan Dahlin * * gvolumemonitor.override: module overrides for GVolumeMonitor * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA */ %% override-slot GVolumeMonitor.tp_new static PyObject * _wrap_g_volume_monitor_tp_new(PyObject *type, PyObject *args, PyObject *kwargs) { return pygobject_new(G_OBJECT(g_volume_monitor_get())); } %% override g_volume_monitor_get_connected_drives noargs static PyObject * _wrap_g_volume_monitor_get_connected_drives (PyGObject *self) { GList *list, *l; PyObject *ret; list = g_volume_monitor_get_connected_drives (G_VOLUME_MONITOR (self->obj)); ret = PyList_New(0); for (l = list; l; l = l->next) { GDrive *drive = l->data; PyObject *item = pygobject_new((GObject *)drive); PyList_Append(ret, item); Py_DECREF(item); g_object_unref(drive); } g_list_free(list); return ret; } %% override g_volume_monitor_get_volumes noargs static PyObject * _wrap_g_volume_monitor_get_volumes (PyGObject *self) { GList *list, *l; PyObject *ret; list = g_volume_monitor_get_volumes (G_VOLUME_MONITOR (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_object_unref(volume); } g_list_free(list); return ret; } %% override g_volume_monitor_get_mounts noargs static PyObject * _wrap_g_volume_monitor_get_mounts (PyGObject *self) { GList *list, *l; PyObject *ret; list = g_volume_monitor_get_mounts (G_VOLUME_MONITOR (self->obj)); ret = PyList_New(0); for (l = list; l; l = l->next) { GMount *mount = l->data; PyObject *item = pygobject_new((GObject *)mount); PyList_Append(ret, item); Py_DECREF(item); g_object_unref(mount); } g_list_free(list); return ret; }