diff options
author | Gian Mario Tagliaretti <gianmt@gnome.org> | 2010-01-03 11:02:57 +0100 |
---|---|---|
committer | Gian Mario Tagliaretti <gianmt@gnome.org> | 2010-01-03 11:02:57 +0100 |
commit | 284a1e1c0143c95d3007cf58e6c248b5d11fb4d1 (patch) | |
tree | e99b08e7c68333f322980d039a9375b7641df65f /gio | |
parent | 82d7bcbf37200ee2ef5892dd12bebd2f39965c56 (diff) | |
download | pygobject-284a1e1c0143c95d3007cf58e6c248b5d11fb4d1.tar.gz pygobject-284a1e1c0143c95d3007cf58e6c248b5d11fb4d1.tar.xz pygobject-284a1e1c0143c95d3007cf58e6c248b5d11fb4d1.zip |
Wrap gio.Cancellable.make_pollfd() and add a test
Diffstat (limited to 'gio')
-rw-r--r-- | gio/Makefile.am | 1 | ||||
-rw-r--r-- | gio/gcancellable.override | 37 | ||||
-rw-r--r-- | gio/gio.override | 3 |
3 files changed, 41 insertions, 0 deletions
diff --git a/gio/Makefile.am b/gio/Makefile.am index a734928..a34fd19 100644 --- a/gio/Makefile.am +++ b/gio/Makefile.am @@ -39,6 +39,7 @@ GIO_OVERRIDES = \ gappinfo.override \ gapplaunchcontext.override \ gbufferedinputstream.override \ + gcancellable.override \ gdatainputstream.override \ gdrive.override \ gfile.override \ diff --git a/gio/gcancellable.override b/gio/gcancellable.override new file mode 100644 index 0000000..7b5a14e --- /dev/null +++ b/gio/gcancellable.override @@ -0,0 +1,37 @@ +/* -*- Mode: C; c-basic-offset: 4 -*- + * pygobject - Python bindings for GObject + * Copyright (C) 2009 Gian Mario Tagliaretti + * + * gcancellable.override: module overrides for GCancellable + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + +%% +override g_cancellable_make_pollfd noargs +static PyObject * +_wrap_g_cancellable_make_pollfd (PyGObject *self) +{ + GPollFD pollfd; + gboolean ret; + PyGPollFD *pypollfd; + + ret = g_cancellable_make_pollfd(G_CANCELLABLE(self->obj), &pollfd); + + pypollfd = PyObject_NEW(PyGPollFD, &PyGPollFD_Type); + pypollfd->pollfd = pollfd; + return (PyObject *) pypollfd; +} diff --git a/gio/gio.override b/gio/gio.override index d5ef514..6d001b9 100644 --- a/gio/gio.override +++ b/gio/gio.override @@ -23,6 +23,7 @@ modulename gio %% import gobject.GObject as PyGObject_Type +import glib.PollFD as PyGPollFD_Type %% headers #define NO_IMPORT_PYGOBJECT @@ -30,6 +31,7 @@ headers #include <gio/gio.h> #include "pygio-utils.h" #include "pyglib.h" +#include "pygsource.h" #define BUFSIZE 8192 @@ -231,6 +233,7 @@ include gappinfo.override gapplaunchcontext.override gbufferedinputstream.override + gcancellable.override gdatainputstream.override gdrive.override gfile.override |