Debian Codegraph @

swig/Fl_Grid.i

raw
1 /* File : Fl_Grid.i */
2 //%module Fl_Grid
3 %feature("docstring") ::Fl_Grid
4 """
5
6 """ ;
7
8 // Ignore the following methods:
9 //%rename("$ignore", regextarget=1, fullname=1) operator==;
10 //%rename("$ignore", regextarget=1, fullname=1) operator!=;
11
12 %{
13 #include "FL/Fl_Grid.H"
14 %}
15
16 %include "macros.i"
17
18 CHANGE_OWNERSHIP(Fl_Grid)
19
20 %typemap(in,numinputs=1) (const int *value, size_t size) {
21 size_t i;
22 if (!PyList_Check($input)) {
23 PyErr_SetString(PyExc_ValueError, "Expecting a list");
24 return NULL;
25 }
26 $2 = PyList_Size($input);
27 $1 = (int *) malloc(($2)*sizeof(int));
28 for (i = 0; i < $2; i++) {
29 PyObject *s = PyList_GetItem($input,i);
30 if (!PyInt_Check(s)) {
31 free($1);
32 PyErr_SetString(PyExc_ValueError, "List items must be integers");
33 return NULL;
34 }
35 $1[i] = PyInt_AsLong(s);
36 }
37 }
38
39 %typecheck(SWIG_TYPECHECK_POINTER) (const int *value, size_t size) {
40 $1 = PyList_Check($input) ? 1 : 0;
41 }
42
43 %typemap(freearg) (const int *value, size_t size) {
44 if ($1) free($1);
45 }
46
47 %include "FL/Fl_Grid.H"