Home | History | Annotate | Download | only in java
      1 /* -----------------------------------------------------------------------------
      2  * enumsimple.swg
      3  *
      4  * This file provides backwards compatible enum wrapping. SWIG versions 1.3.21
      5  * and earlier wrapped global enums with constant integers in the module class
      6  * or Constants interface. Enums declared within a C++ class were wrapped by
      7  * constant integers in the Java proxy class.
      8  * ----------------------------------------------------------------------------- */
      9 
     10 // const enum SWIGTYPE & typemaps
     11 %typemap(jni) const enum SWIGTYPE & "jint"
     12 %typemap(jtype) const enum SWIGTYPE & "int"
     13 %typemap(jstype) const enum SWIGTYPE & "int"
     14 
     15 %typemap(in) const enum SWIGTYPE & ($*1_ltype temp)
     16 %{ temp = ($*1_ltype)$input;
     17    $1 = &temp; %}
     18 %typemap(out) const enum SWIGTYPE &  %{ $result = (jint)*$1; %}
     19 
     20 %typemap(directorout,warning=SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG) const enum SWIGTYPE &
     21 %{ static $*1_ltype temp = ($*1_ltype)$input;
     22    $result = &temp; %}
     23 %typemap(directorin, descriptor="I") const enum SWIGTYPE & "$input = (jint)$1;"
     24 %typemap(javadirectorin) const enum SWIGTYPE & "$jniinput"
     25 %typemap(javadirectorout) const enum SWIGTYPE & "$javacall"
     26 
     27 %typecheck(SWIG_TYPECHECK_INT32) const enum SWIGTYPE & ""
     28 
     29 %typemap(throws) const enum SWIGTYPE &
     30 %{ (void)$1;
     31    SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %}
     32 
     33 %typemap(javain) const enum SWIGTYPE & "$javainput"
     34 %typemap(javaout) const enum SWIGTYPE & {
     35     return $jnicall;
     36   }
     37 
     38 
     39 // enum SWIGTYPE typemaps
     40 %typemap(jni) enum SWIGTYPE "jint"
     41 %typemap(jtype) enum SWIGTYPE "int"
     42 %typemap(jstype) enum SWIGTYPE "int"
     43 
     44 %typemap(in) enum SWIGTYPE  %{ $1 = ($1_ltype)$input; %}
     45 %typemap(out) enum SWIGTYPE  %{ $result = (jint)$1; %}
     46 
     47 %typemap(directorout) enum SWIGTYPE  %{ $result = ($1_ltype)$input; %}
     48 %typemap(directorin, descriptor="I") enum SWIGTYPE "$input = (jint) $1;"
     49 %typemap(javadirectorin) enum SWIGTYPE "$jniinput"
     50 %typemap(javadirectorout) enum SWIGTYPE "$javacall"
     51 
     52 %typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE ""
     53 
     54 %typemap(throws) enum SWIGTYPE
     55 %{ (void)$1;
     56    SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown"); %}
     57 
     58 %typemap(javain) enum SWIGTYPE "$javainput"
     59 %typemap(javaout) enum SWIGTYPE {
     60     return $jnicall;
     61   }
     62 
     63 %typemap(javaclassmodifiers) enum SWIGTYPE ""
     64 %typemap(javabase)           enum SWIGTYPE ""
     65 %typemap(javacode)           enum SWIGTYPE ""
     66 %typemap(javaimports)        enum SWIGTYPE ""
     67 %typemap(javainterfaces)     enum SWIGTYPE ""
     68 %typemap(javabody)           enum SWIGTYPE ""
     69 
     70 %javaenum(simple);
     71 
     72