2 * Project Info: http://jcae.sourceforge.net
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License as published by the Free
6 * Software Foundation; either version 2.1 of the License, or (at your option)
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
18 * (C) Copyright 2005, by EADS CRC
21 //Refine the catch keywoard
22 %{#include <Standard_ErrorHandler.hxx>%}
30 catch(Standard_Failure)
32 SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, Standard_Failure::Caught()->DynamicType()->Name());
36 // Now we bind Opencascade types with Java types.
37 // /usr/share/swig1.3/java/java.swg contains many simple example to do that.
41 %typemap(jni) Standard_CString "jstring"
42 %typemap(jtype) Standard_CString "String"
43 %typemap(jstype) Standard_CString "String"
45 %typemap(in) Standard_CString
47 $1 = const_cast<$1_ltype>(JCALL2(GetStringUTFChars, jenv, $input, 0));
50 %typemap(out) Standard_CString %{ #error TODO %}
52 %typemap(javain) Standard_CString "$javainput"
53 %typemap(javaout) Standard_CString
61 %typemap(jni) Standard_Boolean "jboolean"
62 %typemap(jtype) Standard_Boolean "boolean"
63 %typemap(jstype) Standard_Boolean "boolean"
65 %typemap(in) Standard_Boolean
70 %typemap(out) Standard_Boolean %{ $result = (jboolean)$1; %}
72 %typemap(javain) Standard_Boolean "$javainput"
73 %typemap(javaout) Standard_Boolean
78 %typedef double Standard_Real;
79 %typedef int Standard_Integer;
80 //%typedef double Quantity_Length;
81 //%typedef double Quantity_Parameter;
86 %{ #include "jnistream.hxx" %}
87 %typemap(jni) Standard_OStream& "jobject"
88 %typemap(jtype) Standard_OStream& "java.nio.channels.WritableByteChannel"
89 %typemap(jstype) Standard_OStream& "java.nio.channels.WritableByteChannel"
91 %typemap(in) Standard_OStream&
93 jnistreambuf buf(jenv, $input);
94 Standard_OStream os(&buf);
98 %typemap(freearg) Standard_OStream&
103 %typemap(javain) Standard_OStream& "$javainput"
104 %typemap(javaout) Standard_OStream&
112 %typemap(jni) Standard_IStream& "jobject"
113 %typemap(jtype) Standard_IStream& "java.nio.channels.ReadableByteChannel"
114 %typemap(jstype) Standard_IStream& "java.nio.channels.ReadableByteChannel"
116 %typemap(in) Standard_IStream&
118 jnistreambuf buf(jenv, $input);
119 Standard_IStream is(&buf);
123 %typemap(javain) Standard_IStream& "$javainput"
124 %typemap(javaout) Standard_IStream&