import source from 1.3.40
[external/swig.git] / Lib / csharp / enums.swg
1 /* -----------------------------------------------------------------------------
2  * See the LICENSE file for information on copyright, usage and redistribution
3  * of SWIG, and the README file for authors - http://www.swig.org/release.html.
4  *
5  * enums.swg
6  *
7  * Include this file in order for C/C++ enums to be wrapped by proper C# enums.
8  * Note that the PINVOKE layer handles the enum as an int.
9  * ----------------------------------------------------------------------------- */
10
11 // const enum SWIGTYPE & typemaps
12 %typemap(ctype) const enum SWIGTYPE & "int"
13 %typemap(imtype) const enum SWIGTYPE & "int"
14 %typemap(cstype) const enum SWIGTYPE & "$*csclassname"
15
16 %typemap(in) const enum SWIGTYPE & ($*1_ltype temp)
17 %{ temp = ($*1_ltype)$input; 
18    $1 = &temp; %}
19 %typemap(out) const enum SWIGTYPE & %{ $result = *$1; %}
20
21 %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE &
22 %{ static $*1_ltype temp = ($*1_ltype)$input; 
23    $result = &temp; %}
24 %typemap(directorin) const enum SWIGTYPE &    "$input = $1_name;"
25 %typemap(csdirectorin) const enum SWIGTYPE & "($*csclassname)$iminput"
26 %typemap(csdirectorout) const enum SWIGTYPE & "(int)$cscall"
27
28 %typecheck(SWIG_TYPECHECK_POINTER) const enum SWIGTYPE & ""
29
30 %typemap(throws, canthrow=1) const enum SWIGTYPE &
31 %{ (void)$1;
32    SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown");
33    return $null; %}
34
35 %typemap(csin) const enum SWIGTYPE & "(int)$csinput"
36 %typemap(csout, excode=SWIGEXCODE) const enum SWIGTYPE & {
37     $*csclassname ret = ($*csclassname)$imcall;$excode
38     return ret;
39   }
40
41 %typemap(csvarout, excode=SWIGEXCODE2) const enum SWIGTYPE & %{
42     get {
43       $*csclassname ret = ($*csclassname)$imcall;$excode
44       return ret;
45     } %}
46
47
48 // enum SWIGTYPE typemaps
49 %typemap(ctype) enum SWIGTYPE "int"
50 %typemap(imtype) enum SWIGTYPE "int"
51 %typemap(cstype) enum SWIGTYPE "$csclassname"
52
53 %typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %}
54 %typemap(out) enum SWIGTYPE %{ $result = $1; %}
55
56 %typemap(directorout) enum SWIGTYPE  %{ $result = ($1_ltype)$input; %}
57 %typemap(directorin) enum SWIGTYPE    "$input = $1;"
58 %typemap(csdirectorin) enum SWIGTYPE "($csclassname)$iminput"
59 %typemap(csdirectorout) enum SWIGTYPE "(int)$cscall"
60
61 %typecheck(SWIG_TYPECHECK_POINTER) enum SWIGTYPE ""
62
63 %typemap(throws, canthrow=1) enum SWIGTYPE
64 %{ (void)$1;
65    SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, "C++ $1_type exception thrown");
66    return $null; %}
67
68 %typemap(csin) enum SWIGTYPE "(int)$csinput"
69 %typemap(csout, excode=SWIGEXCODE) enum SWIGTYPE {
70     $csclassname ret = ($csclassname)$imcall;$excode
71     return ret;
72   }
73
74 %typemap(csvarout, excode=SWIGEXCODE2) enum SWIGTYPE %{
75     get {
76       $csclassname ret = ($csclassname)$imcall;$excode
77       return ret;
78     } %}
79
80 %typemap(csbase)           enum SWIGTYPE ""
81 %typemap(csclassmodifiers) enum SWIGTYPE "public enum"
82 %typemap(cscode)           enum SWIGTYPE ""
83 %typemap(csimports)        enum SWIGTYPE ""
84 %typemap(csinterfaces)     enum SWIGTYPE ""
85
86 %typemap(csbody) enum SWIGTYPE ""
87
88 %csenum(proper);
89