* Put a few wrapper functions into extern "C++" braces because they return references to C++ objects.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
diff --git a/src/FTFont/FTFontGlue.cpp b/src/FTFont/FTFontGlue.cpp
index f316875..67f43b8 100644
--- a/src/FTFont/FTFontGlue.cpp
+++ b/src/FTFont/FTFontGlue.cpp
@@ -221,9 +221,11 @@ C_FUN(float, ftglGetFontLineHeight, (FTGLfont *f), return 0.f, LineHeight, ());
// void FTFont::BBox(const char* string, float& llx, float& lly, float& llz,
// float& urx, float& ury, float& urz);
+extern "C++" {
C_FUN(static FTBBox, _ftglGetFontBBox, (FTGLfont *f, char const *s,
int start, int end),
return static_ftbbox, BBox, (s, start, end));
+}
void ftglGetFontBBox(FTGLfont *f, const char* s, int start, int end,
float c[6])
diff --git a/src/FTGlyph/FTGlyphGlue.cpp b/src/FTGlyph/FTGlyphGlue.cpp
index 73e9cc4..be9241e 100644
--- a/src/FTGlyph/FTGlyphGlue.cpp
+++ b/src/FTGlyph/FTGlyphGlue.cpp
@@ -193,9 +193,11 @@ void ftglDestroyGlyph(FTGLglyph *g)
}
// const FTPoint& FTGlyph::Render(const FTPoint& pen, int renderMode);
+extern "C++" {
C_FUN(static const FTPoint&, _ftglRenderGlyph, (FTGLglyph *g,
const FTPoint& pen, int renderMode),
return static_ftpoint, Render, (pen, renderMode));
+}
void ftglRenderGlyph(FTGLglyph *g, FTGL_DOUBLE penx, FTGL_DOUBLE peny,
int renderMode, FTGL_DOUBLE *advancex,
@@ -208,8 +210,10 @@ void ftglRenderGlyph(FTGLglyph *g, FTGL_DOUBLE penx, FTGL_DOUBLE peny,
}
// const FTPoint& FTGlyph::Advance() const;
+extern "C++" {
C_FUN(static const FTPoint&, _ftglGetGlyphAdvance, (FTGLglyph *g),
return static_ftpoint, Advance, ());
+}
void ftglGetGlyphAdvance(FTGLglyph *g, FTGL_DOUBLE *advancex,
FTGL_DOUBLE *advancey)
@@ -220,8 +224,10 @@ void ftglGetGlyphAdvance(FTGLglyph *g, FTGL_DOUBLE *advancex,
}
// const FTBBox& FTGlyph::BBox() const;
+extern "C++" {
C_FUN(static const FTBBox&, _ftglGetGlyphBBox, (FTGLglyph *g),
return static_ftbbox, BBox, ());
+}
void ftglGetGlyphBBox(FTGLglyph *g, float bounds[6])
{
diff --git a/src/FTLayout/FTLayoutGlue.cpp b/src/FTLayout/FTLayoutGlue.cpp
index d3b3411..e37d11e 100644
--- a/src/FTLayout/FTLayoutGlue.cpp
+++ b/src/FTLayout/FTLayoutGlue.cpp
@@ -88,9 +88,11 @@ void ftglDestroyLayout(FTGLlayout *l)
free(l);
}
-// virtual void BBox(const char* string, float& llx, float& lly, float& llz, float& urx, float& ury, float& urz)
+// virtual FTBBox FTLayout::BBox(const char* string)
+extern "C++" {
C_FUN(static FTBBox, _ftgGetlLayoutBBox, (FTGLlayout *l, const char *s),
return static_ftbbox, BBox, (s));
+}
void ftgGetlLayoutBBox(FTGLlayout *l, const char * s, float c[6])
{
@@ -100,11 +102,11 @@ void ftgGetlLayoutBBox(FTGLlayout *l, const char * s, float c[6])
c[3] = upper.Xf(); c[4] = upper.Yf(); c[5] = upper.Zf();
}
-// virtual void Render(const char* string, int renderMode);
+// virtual void FTLayout::Render(const char* string, int renderMode);
C_FUN(void, ftglRenderLayout, (FTGLlayout *l, const char *s, int r),
return, Render, (s, r));
-// void RenderSpace(const char *string, const float ExtraSpace = 0.0)
+// void FTSimpleLayout::RenderSpace(const char *string, const float ExtraSpace = 0.0)
C_FUN(void, ftglRenderLayoutSpace, (FTGLlayout *l, const char *s, float e),
return, RenderSpace, (s, e));
@@ -126,7 +128,7 @@ void ftglSetLayoutFont(FTGLlayout *l, FTGLfont *font)
__FUNCTION__, l->type);
}
-// FTFont *GetFont()
+// FTFont *FTSimpleLayout::GetFont()
FTGLfont *ftglGetLayoutFont(FTGLlayout *l)
{
if(!l || !l->ptr)
@@ -137,27 +139,27 @@ FTGLfont *ftglGetLayoutFont(FTGLlayout *l)
return l->font;
}
-// void SetLineLength(const float LineLength);
+// void FTSimpleLayout::SetLineLength(const float LineLength);
C_FUN(void, ftglSetLayoutLineLength, (FTGLlayout *l, const float length),
return, SetLineLength, (length));
-// float GetLineLength() const
+// float FTSimpleLayout::GetLineLength() const
C_FUN(float, ftglGetLayoutLineLength, (FTGLlayout *l),
return 0.0f, GetLineLength, ());
-// void SetAlignment(const TextAlignment Alignment)
+// void FTSimpleLayout::SetAlignment(const TextAlignment Alignment)
C_FUN(void, ftglSetLayoutAlignment, (FTGLlayout *l, const int a),
return, SetAlignment, ((FTGL::TextAlignment)a));
-// TextAlignment GetAlignment() const
+// TextAlignment FTSimpleLayout::GetAlignment() const
C_FUN(int, ftglGetLayoutAlignement, (FTGLlayout *l),
return FTGL::ALIGN_LEFT, GetAlignment, ());
-// void SetLineSpacing(const float LineSpacing)
+// void FTSimpleLayout::SetLineSpacing(const float LineSpacing)
C_FUN(void, ftglSetLayoutLineSpacing, (FTGLlayout *l, const float f),
return, SetLineSpacing, (f));
-// float GetLineSpacing() const
+// float FTSimpleLayout::GetLineSpacing() const
C_FUN(float, ftglGetLayoutLineSpacing, (FTGLlayout *l),
return 0.0f, GetLineSpacing, ());