summaryrefslogtreecommitdiff
path: root/gio/gvolumemonitor.override
blob: 4ffedf34db5f4f82be704c612e4048bc382f665c (plain)
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
/* -*- 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;
}