[libchamplain] champlain_view_ensure_markers_visible are now covered by python binding
- From: Pierre-Luc Beaudoin <plbeaudoin src gnome org>
- To: svn-commits-list gnome org
- Subject: [libchamplain] champlain_view_ensure_markers_visible are now covered by python binding
- Date: Sat, 25 Jul 2009 00:20:52 +0000 (UTC)
commit bb597b9b32556bf86bf9d3909f6a757311f06041
Author: Victor Godoy Poluceno <victorpoluceno gmail com>
Date: Mon Jul 20 15:38:32 2009 -0300
champlain_view_ensure_markers_visible are now covered by python binding
bindings/python/champlain/pychamplain.override | 37 ++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
---
diff --git a/bindings/python/champlain/pychamplain.override b/bindings/python/champlain/pychamplain.override
index 824821f..1e1165c 100644
--- a/bindings/python/champlain/pychamplain.override
+++ b/bindings/python/champlain/pychamplain.override
@@ -188,3 +188,40 @@ _wrap_champlain_view_get_coords_at(PyGObject *self, PyObject *args)
return Py_BuildValue("(dd)", lat, lon);
}
%%
+override champlain_view_ensure_markers_visible kwargs
+static PyObject *
+_wrap_champlain_view_ensure_markers_visible(PyGObject *self, PyObject *args)
+{
+ PyObject *pymarkers, *pyanimate=0;
+ gboolean animate = 1;
+ long i = 0;
+ ChamplainBaseMarker **markers = NULL;
+
+ if (!PyArg_ParseTuple(args, "O|O:ChamplainView.ensure_markers_visible",
+ &pymarkers, &pyanimate)){
+ return NULL;
+ }
+
+ if (!PySequence_Check(pymarkers)){
+ PyErr_SetString(PyExc_TypeError, "must be called with a list of markers as first argument");
+ return NULL;
+ }
+
+ if (pyanimate){
+ if (!PyObject_IsTrue(pyanimate))
+ animate = 0;
+ }
+
+ markers = g_new0(ChamplainBaseMarker*, PyList_Size(pymarkers)+2);
+ for (i=0; i < PyList_Size(pymarkers); i++){
+ ChamplainBaseMarker *marker = pyg_boxed_get(PyList_GetItem(pymarkers, i), ChamplainBaseMarker);
+ markers[i] = marker;
+ }
+
+ champlain_view_ensure_markers_visible(CHAMPLAIN_VIEW(self->obj), markers, animate);
+ g_free(markers);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+%%
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]