/[libvob]/libvob/include/vob/jni/Types.hxx
ViewVC logotype

Diff of /libvob/include/vob/jni/Types.hxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13 by tjl, Mon Mar 10 05:38:19 2003 UTC revision 1.14 by tjl, Tue Mar 11 12:10:31 2003 UTC
# Line 31  Types.hxx Line 31  Types.hxx
31  #include <vob/util/ObjectStorer.hxx>  #include <vob/util/ObjectStorer.hxx>
32  #include <vob/os/Os.hxx>  #include <vob/os/Os.hxx>
33    
34    #include <vob/jni/Strings.hxx>
35    
36  namespace Vob {  namespace Vob {
37  namespace JNI {  namespace JNI {
38    
# Line 44  namespace JNI { Line 46  namespace JNI {
46       */       */
47      template<class T> class JParameter ;      template<class T> class JParameter ;
48    
49        typedef std::vector<GLubyte> ByteVector;
50    
51      extern ObjectStorer<Vob0> vob0s;      extern ObjectStorer<Vob0> vob0s;
52      extern ObjectStorer<Vob1> vob1s;      extern ObjectStorer<Vob1> vob1s;
53      extern ObjectStorer<Vob2> vob2s;      extern ObjectStorer<Vob2> vob2s;
54      extern ObjectStorer<Vob> vob3s;      extern ObjectStorer<Vob> vob3s;
55      extern ObjectStorer<Os::RenderingSurface> windows;      extern ObjectStorer<Os::RenderingSurface> windows;
56        extern ObjectStorer<ByteVector> bytevectors;
57    
58  #define START_VOB_JNI_CONVERSION(type, javaName_, jnitype_)     \  #define START_VOB_JNI_CONVERSION(type, javaName_, jnitype_)     \
59      struct JParameter<type> {                                   \      struct JParameter<type> {                                   \
# Line 87  namespace JNI { Line 92  namespace JNI {
92                  out = in;                                       \                  out = in;                                       \
93              END_VOB_JNI_CONVERSION              END_VOB_JNI_CONVERSION
94    
95  #define VOB_JNI_CONVERSION_IDDED(type, javaName_)               \  #define START_VOB_JNI_CONVERSION_IDDED(type, javaName_)         \
96      struct JParameter<type> {                                   \      struct JParameter<type> {                                   \
97          typedef jint jniType;                           \          typedef jint jniType;                           \
98          static std::string javaParam(std::string paramPrefix) {         \          static std::string javaParam(std::string paramPrefix) {         \
# Line 114  namespace JNI { Line 119  namespace JNI {
119          static std::string jniStructCode(std::string paramPrefix) {     \          static std::string jniStructCode(std::string paramPrefix) {     \
120              return "_."+paramPrefix+"="+paramPrefix+";\n";                      \              return "_."+paramPrefix+"="+paramPrefix+";\n";                      \
121          }                                                       \          }                                                       \
122          static void convert(JNIEnv *env, jint &in, type &out) {         \          static void convert(JNIEnv *env, jint &in, type &out) {        
             out = type(in);                                     \  
             }};  
123    
124    
125      VOB_JNI_CONVERSION_ASSIGN(float, "float", jfloat)      VOB_JNI_CONVERSION_ASSIGN(float, "float", jfloat)
126      VOB_JNI_CONVERSION_ASSIGN(int, "int", jint)      VOB_JNI_CONVERSION_ASSIGN(int, "int", jint)
127    
128      VOB_JNI_CONVERSION_IDDED(DisplayListID, "GL.DisplayList")      START_VOB_JNI_CONVERSION(Token, "String", jstring)
129            out = tokenFromJstring(env, in);
130        END_VOB_JNI_CONVERSION
131    
132    
133        START_VOB_JNI_CONVERSION_IDDED(GLubyte *, "GL.ByteVector")
134            ByteVector *bv = bytevectors[in];
135            out = &((*bv)[0]);
136        END_VOB_JNI_CONVERSION
137    
138        START_VOB_JNI_CONVERSION_IDDED(DisplayListID, "GL.DisplayList")
139                out = in;
140        END_VOB_JNI_CONVERSION
141    
142  }  }
143  }  }

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26