PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Lib/csharp/enums.swg

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