[libchamplain] Fix champlain.Marker.set_image to that image arg accept None
- From: Jiří Techet <jiritechet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libchamplain] Fix champlain.Marker.set_image to that image arg accept None
- Date: Wed, 16 Jun 2010 20:23:08 +0000 (UTC)
commit dbaed9dbe216d653c86f65d04e082bbffd382b2e
Author: Victor Godoy Poluceno <victorpoluceno gmail com>
Date: Sun May 30 21:21:07 2010 -0300
Fix champlain.Marker.set_image to that image arg accept None
bindings/python/champlain/pychamplain.override | 26 ++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/bindings/python/champlain/pychamplain.override b/bindings/python/champlain/pychamplain.override
index 2cb3b22..41252f5 100644
--- a/bindings/python/champlain/pychamplain.override
+++ b/bindings/python/champlain/pychamplain.override
@@ -615,6 +615,32 @@ _wrap_champlain_marker_new_with_text(PyObject *self, PyObject *args, PyObject *k
return pygobject_new((GObject *)ret);
}
%%
+override champlain_marker_set_image kwargs
+static PyObject *
+_wrap_champlain_marker_set_image(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = { "image", NULL };
+ PyObject *py_image = NULL;
+ ClutterActor *image = NULL;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"|O:Champlain.Marker.set_image", kwlist, &py_image))
+ return NULL;
+
+ if (py_image != NULL && py_image != Py_None){
+ if (pygobject_check(py_image, &PyClutterActor_Type)){
+ image = pyg_boxed_get(py_image, ClutterActor);
+ }else{
+ PyErr_SetString(PyExc_TypeError, "image should be a ClutterActor or None");
+ return NULL;
+ }
+ }
+
+ champlain_marker_set_image(CHAMPLAIN_MARKER(self->obj), CLUTTER_ACTOR(image));
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+%%
override-slot ChamplainPolygon.tp_dealloc
static void
_wrap_champlain_polygon_tp_dealloc (PyObject *self)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]