[pygobject] Remove cairo.RectangleInt from the foreign module
- From: Tomeu Vizoso <tomeuv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Remove cairo.RectangleInt from the foreign module
- Date: Tue, 18 Jan 2011 11:07:30 +0000 (UTC)
commit 69a78307f3762e3f54d28d98514cec7d31ff20db
Author: Tomeu Vizoso <tomeu vizoso collabora co uk>
Date: Tue Jan 18 10:21:03 2011 +0100
Remove cairo.RectangleInt from the foreign module
https://bugzilla.gnome.org/show_bug.cgi?id=639824
gi/pygi-foreign-cairo.c | 96 -----------------------------------------------
1 files changed, 0 insertions(+), 96 deletions(-)
---
diff --git a/gi/pygi-foreign-cairo.c b/gi/pygi-foreign-cairo.c
index babe8b4..f6a7567 100644
--- a/gi/pygi-foreign-cairo.c
+++ b/gi/pygi-foreign-cairo.c
@@ -112,102 +112,6 @@ cairo_surface_release (GIBaseInfo *base_info,
Py_RETURN_NONE;
}
-#define _PY_TUPLE_GET_INT(t, pos, i) \
-{ \
- PyObject *item; \
- long l; \
- item = PyTuple_GET_ITEM(t, pos); \
- if (!item) \
- goto err; \
- l = PYGLIB_PyLong_AsLong(item); \
- if (PyErr_Occurred()) { \
- Py_DECREF(item); \
- goto err; \
- } \
- if (l > INT_MAX || l < INT_MIN) { \
- Py_DECREF(item); \
- PyErr_Format(PyExc_ValueError, "integer %ld is out of range", l); \
- goto err; \
- } \
- i = (int)l; \
- Py_DECREF(item); \
-}
-
-#define _PY_TUPLE_SET_INT(t, pos, i) \
-{ \
- PyObject *item; \
- item = PYGLIB_PyLong_FromLong(i); \
- if (!item) \
- goto err; \
- PyTuple_SET_ITEM(t, pos, item); \
-}
-
-PyObject *
-cairo_rectangle_int_to_arg (PyObject *value,
- GITypeInfo *type_info,
- GITransfer transfer,
- GIArgument *arg)
-{
- cairo_rectangle_int_t *rect;
- Py_ssize_t seq_len;
-
- seq_len = PySequence_Size(value);
- if (!PySequence_Check(value) || (seq_len != 4)) {
- PyErr_Format(PyExc_TypeError, "expected a sequence of length 4");
- goto err;
- }
-
- rect = g_malloc(sizeof(cairo_rectangle_int_t));
- if (!rect)
- return PyErr_NoMemory();
-
- _PY_TUPLE_GET_INT(value, 0, rect->x);
- _PY_TUPLE_GET_INT(value, 1, rect->y);
- _PY_TUPLE_GET_INT(value, 2, rect->width);
- _PY_TUPLE_GET_INT(value, 3, rect->height);
-
- arg->v_pointer = rect;
- Py_RETURN_NONE;
-err:
- return NULL;
-}
-
-PyObject *
-cairo_rectangle_int_from_arg (GITypeInfo *type_info, GIArgument *arg)
-{
- PyObject *result;
- cairo_rectangle_int_t *rect = (cairo_rectangle_int_t*) arg;
-
- result = PyTuple_New(4);
- if (!result)
- return NULL;
-
- if (rect) {
- _PY_TUPLE_SET_INT(result, 0, rect->x);
- _PY_TUPLE_SET_INT(result, 1, rect->y);
- _PY_TUPLE_SET_INT(result, 2, rect->width);
- _PY_TUPLE_SET_INT(result, 3, rect->height);
- } else {
- _PY_TUPLE_SET_INT(result, 0, 0);
- _PY_TUPLE_SET_INT(result, 1, 0);
- _PY_TUPLE_SET_INT(result, 2, 0);
- _PY_TUPLE_SET_INT(result, 3, 0);
- }
-
- return result;
-err:
- Py_DECREF(result);
- return NULL;
-}
-
-PyObject *
-cairo_rectangle_int_release (GIBaseInfo *base_info,
- gpointer struct_)
-{
- g_free (struct_);
- Py_RETURN_NONE;
-}
-
static PyMethodDef _gi_cairo_functions[] = {};
PYGLIB_MODULE_START(_gi_cairo, "_gi_cairo")
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]