7
#include "FL/fl_draw.H"
10
%typemap(in) const uchar * {
11
/* Check if the input support the buffer protocol */
14
int failure = PyObject_AsReadBuffer($input,&buffer,&size_buffer);
16
// work with array object
17
$1 = (uchar *) buffer;
19
// work with list object
20
// clear the error from PyObject_AsReadBuffer
24
/* Check if is a list */
25
if (PyList_Check($input)) {
26
int size = PyList_Size($input);
28
$1 = (uchar *) malloc((size+1)*sizeof(char));
29
for (i = 0; i < size; i++) {
30
PyObject *o = PyList_GetItem($input,i);
32
$1[i] = (char)PyInt_AsLong(o);
34
PyErr_SetString(PyExc_TypeError,"list must contain ints");
41
PyErr_SetString(PyExc_TypeError,"not a list or does not support single-segment readable buffer interface");
48
%ignore fl_color(int c);
49
%ignore fl_draw_pixmap(const char* const* data, int x,int y,Fl_Color=FL_GRAY);
50
%ignore fl_measure_pixmap(const char* const* data, int &w, int &h);
51
%ignore fl_chord(int x, int y, int w, int h, double a1, double a2);
52
%ignore fl_read_image(uchar *p, int x,int y, int w, int h, int alpha=0);
53
%ignore fl_draw_image(Fl_Draw_Image_Cb, void*, int,int,int,int, int delta=3);
54
%ignore fl_draw_image_mono(Fl_Draw_Image_Cb, void*, int,int,int,int, int delta=1);
56
%apply int* OUTPUT { int& };
58
%include "FL/fl_draw.H"