swig/SWIG/Lib/java/enumsimple.swg
William S Fulton e7777f2adb Enum typemaps taken out of java.swg
New typemap files for the different C/C++ to Java enum wrapping approaches.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5921 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-05-24 20:09:17 +00:00

39 lines
1.3 KiB
Text

/* -----------------------------------------------------------------------------
* This file provides backwards compatible enum wrapping. SWIG versions 1.3.21
* and earlier wrapped global enums with constant integers in the module class
* or Constants interface. Enums declared within a C++ class were wrapped by
* constant integers in the Java proxy class.
* ----------------------------------------------------------------------------- */
%typemap(jni) enum SWIGTYPE "jint"
%typemap(jtype) enum SWIGTYPE "int"
%typemap(jstype) enum SWIGTYPE "int"
%typemap(in) enum SWIGTYPE %{ $1 = ($1_ltype)$input; %}
%typemap(out) enum SWIGTYPE %{ $result = (jint)$1; %}
%typemap(directorin, descriptor="I") enum SWIGTYPE "$input = (jint) $1;"
%typemap(javadirectorin) enum SWIGTYPE "$jniinput"
%typemap(javadirectorout) enum SWIGTYPE "$javacall"
%typecheck(SWIG_TYPECHECK_INT32) enum SWIGTYPE ""
%typemap(javain) enum SWIGTYPE "$javainput.swigValue()"
%typemap(javaout) enum SWIGTYPE {
return $javaclassname.swigToEnum($jnicall);
}
%typemap(throws) enum SWIGTYPE {
SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, "C++ $1_type exception thrown");
}
%typemap(javain) enum SWIGTYPE "$javainput"
%typemap(javaout) enum SWIGTYPE {
return $jnicall;
}
%typemap(javaclassmodifiers) enum SWIGTYPE ""
%typemap(javagetcptr) enum SWIGTYPE ""
%javaenum(simple);