rm the old code including the .pys and the c++ shit
[mikachu/openbox.git] / wrap / otk_ustring.i
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2
3 %module otk_rendertexture
4
5 %{
6 #include "otk/ustring.hh"
7 %}
8
9 namespace otk {
10     class ustring;
11
12     /* Overloading check */
13
14     %typemap(typecheck) ustring = char *;
15     %typemap(typecheck) const ustring & = char *;
16
17     %typemap(in) ustring {
18         if (PyString_Check($input))
19             $1 = otk::ustring(PyString_AsString($input));
20         else
21             SWIG_exception(SWIG_TypeError, "string expected");
22     }
23
24     %typemap(in) const ustring & (otk::ustring temp) {
25         if (PyString_Check($input)) {
26             temp = otk::ustring(PyString_AsString($input));
27             $1 = &temp;
28         } else {
29             SWIG_exception(SWIG_TypeError, "string expected");
30         }
31     }
32
33     %typemap(out) ustring {
34         $result = PyString_FromString($1.c_str());
35     }
36
37     %typemap(out) const ustring & {
38         $result = PyString_FromString($1->c_str());
39     }
40 }