1
/* -*- Mode: C; c-basic-offset: 4 -*- */
3
/* cplplotcanvas.override - C python wrapper override for plplotcanvas
5
Copyright (C) 2004, 2005 Thomas J. Duck
8
Thomas J. Duck <tom.duck@dal.ca>
9
Department of Physics and Atmospheric Science,
10
Dalhousie University, Halifax, Nova Scotia, Canada, B3H 3J5
15
This library is free software; you can redistribute it and/or
16
modify it under the terms of the GNU Lesser General Public
17
License as published by the Free Software Foundation; either
18
version 2.1 of the License, or (at your option) any later version.
20
This library is distributed in the hope that it will be useful,
21
but WITHOUT ANY WARRANTY; without even the implied warranty of
22
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23
Lesser General Public License for more details.
25
You should have received a copy of the GNU Lesser General Public
26
License along with this library; if not, write to the Free Software
27
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
31
/*-------------------------------------------------------------------------*/
35
/* ignore-glob section: */
37
/* Methods in the plplot common library that can be wrapped have */
38
/* been removed from the list. */
40
/* Plplot methods with constant arguments are wrapped automatically. */
42
/* Commonly-used routines with non-constant arguments are wrapped using */
43
/* overrides, below, if required for speed. */
45
/* Routines that cannot be automatically wrapped are called from python */
46
/* code in plplotcanvas.Canvas using __getattr__. */
48
/*-------------------------------------------------------------------------*/
54
#include "pygobject.h"
56
#include "plplotcanvas.h"
58
#define PY_ARRAY_UNIQUE_SYMBOL plplotcanvasapi
59
#include "Numeric/arrayobject.h"
61
%%modulename c_plplotcanvas
63
import gnome.canvas.Canvas as PyGnomeCanvas_Type
74
plplot_canvas_calc_world
86
plplot_canvas_gcompression
93
plplot_canvas_griddata
105
plplot_canvas_meridians
110
plplot_canvas_plot3dc
111
plplot_canvas_plot3dcl
118
plplot_canvas_gcmap0n
120
plplot_canvas_scmap1l
128
plplot_canvas_surf3dl
132
override plplot_canvas_new args, kwargs
134
_wrap_plplot_canvas_new(PyGObject *self, PyObject *args, PyObject *kwargs)
136
GType obj_type = pyg_type_from_object((PyObject *) self);
138
self->obj = g_object_new(obj_type, "aa", TRUE, NULL);
140
PyErr_SetString(PyExc_RuntimeError, "could not create %(typename)s object");
144
pygobject_register_wrapper((PyObject *)self);
148
override plplot_canvas_line args
149
static PyObject* _wrap_plplot_canvas_line(PyGObject *self,
153
PyArrayObject *x, *y;
155
if(!PyArg_UnpackTuple(args,"ref",2,2,&x_,&y_))
158
if(!PyArray_Check(x_)) return NULL;
159
if( (x = (PyArrayObject *)
160
PyArray_ContiguousFromObject(x_, PyArray_DOUBLE, 1, 1)) == NULL)
163
if(!PyArray_Check(y_)) return NULL;
164
if( (y = (PyArrayObject *)
165
PyArray_ContiguousFromObject(y_, PyArray_DOUBLE, 1, 1)) == NULL)
168
plplot_canvas_line(PLPLOT_CANVAS(self->obj),
169
x->dimensions[0],(double*)x->data,(double*)y->data);
171
return Py_BuildValue("");