28 |
|
|
29 |
#include <jni.h> |
#include <jni.h> |
30 |
|
|
|
#include <GLMosaicText.hxx> |
|
31 |
|
|
32 |
#include <vob/Vob.hxx> |
#include <vob/Vob.hxx> |
33 |
#include <vob/Types.hxx> |
#include <vob/Types.hxx> |
42 |
namespace GLMosaicText { |
namespace GLMosaicText { |
43 |
namespace Mosaic { |
namespace Mosaic { |
44 |
template<class Format> class GLMosaicText::Mosaic::Raster; |
template<class Format> class GLMosaicText::Mosaic::Raster; |
45 |
|
namespace Format { |
46 |
|
struct Alpha; |
47 |
|
struct RGBA; |
48 |
|
} |
49 |
} |
} |
50 |
|
template<class X, class Y> class DenseGlyphs; |
51 |
|
template<class X, class Y> class Renderer; |
52 |
} |
} |
53 |
|
|
54 |
namespace Vob { |
namespace Vob { |
75 |
namespace JNI { |
namespace JNI { |
76 |
struct TexAccum_JNI; |
struct TexAccum_JNI; |
77 |
} |
} |
78 |
|
namespace Font { |
79 |
|
struct RealFont; |
80 |
|
|
81 |
|
// XXX Copied from include/vob/vobs/Text.hxx |
82 |
|
typedef GLMosaicText::Renderer< |
83 |
|
GLMosaicText::DenseGlyphs<unsigned short, GLMosaicText::Mosaic::Format::Alpha>, |
84 |
|
unsigned short> |
85 |
|
DefaultTextRenderer; |
86 |
|
|
87 |
|
} |
88 |
|
|
89 |
namespace JNI { |
namespace JNI { |
90 |
PREDBGVAR(dbg); |
PREDBGVAR(dbg); |
119 |
// template param |
// template param |
120 |
extern ObjectStorer<P> papers; |
extern ObjectStorer<P> papers; |
121 |
|
|
122 |
// XXX Copied from include/vob/vobs/Text.hxx |
typedef ::Vob::Font::RealFont RF; |
123 |
typedef GLMosaicText::Renderer< |
extern ObjectStorer<RF> textrenderers; |
|
GLMosaicText::DenseGlyphs<unsigned short>, |
|
|
unsigned short> |
|
|
DefaultTextRenderer; |
|
|
|
|
|
// XXX MEMLEAK |
|
|
struct RealFont { |
|
|
GLMosaicText::Font *f; |
|
|
DefaultTextRenderer *rend; |
|
|
RealFont(GLMosaicText::Font *f) : f(f) { |
|
|
rend = new DefaultTextRenderer(f); |
|
|
} |
|
|
float getGlyphWidth(int c) { return rend->g.getGlyphWidth(c); } |
|
|
}; |
|
|
|
|
|
extern ObjectStorer<RealFont> textrenderers; |
|
124 |
|
|
125 |
#define START_VOB_JNI_CONVERSION(type, javaName_, jnitype_) \ |
#define START_VOB_JNI_CONVERSION(type, javaName_, jnitype_) \ |
126 |
struct JParameter<type> { \ |
struct JParameter<type> { \ |
257 |
out = in; |
out = in; |
258 |
END_VOB_JNI_CONVERSION |
END_VOB_JNI_CONVERSION |
259 |
|
|
260 |
START_VOB_JNI_CONVERSION_IDDED(DefaultTextRenderer *, |
START_VOB_JNI_CONVERSION_IDDED(Font::RealFont *, |
261 |
"GL.Font") |
"GL.Font") |
262 |
out = textrenderers[in]->rend; |
out = textrenderers[in]; |
263 |
END_VOB_JNI_CONVERSION |
END_VOB_JNI_CONVERSION |
264 |
|
|
265 |
START_VOB_JNI_CONVERSION_IDDED(::Vob::Paper::Paper *, |
START_VOB_JNI_CONVERSION_IDDED(::Vob::Paper::Paper *, |