gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] libvob ./rules.mk include/vob/Types.hxx include...


From: Tuomas J. Lukka
Subject: [Gzz-commits] libvob ./rules.mk include/vob/Types.hxx include...
Date: Sun, 16 Mar 2003 12:58:49 -0500

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Changes by:     Tuomas J. Lukka <address@hidden>        03/03/16 12:58:49

Modified files:
        .              : rules.mk 
        include/vob    : Types.hxx Vob.hxx 
        include/vob/jni: Strings.hxx Types.hxx 
        org/nongnu/libvob/gl: GLRen.java 
        src/jni        : Gen.cxx Strings.cxx 
Added files:
        include/vob/vobs: Text.hxx 
        src/jni        : jnivobs.hxx 

Log message:
        First cut at gl text

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/rules.mk.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/Types.hxx.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/Vob.hxx.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/jni/Strings.hxx.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/jni/Types.hxx.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/include/vob/vobs/Text.hxx?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/gl/GLRen.java.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/jnivobs.hxx?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/Gen.cxx.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/src/jni/Strings.cxx.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: libvob/include/vob/Types.hxx
diff -u libvob/include/vob/Types.hxx:1.2 libvob/include/vob/Types.hxx:1.3
--- libvob/include/vob/Types.hxx:1.2    Tue Mar 11 07:10:31 2003
+++ libvob/include/vob/Types.hxx        Sun Mar 16 12:58:49 2003
@@ -3,6 +3,8 @@
 #ifndef VOB_TYPES_HXX
 #define VOB_TYPES_HXX
 
+#include <vector>
+
 #include <GL/gl.h>
 
 namespace Vob {
@@ -28,6 +30,9 @@
 
     typedef GLIndex<GL_LIST_MODE> DisplayListID;
     typedef GLIndex<GL_INVALID_ENUM> Token;
+
+    typedef std::vector<unsigned short> unicodecharvector;
+    
 }
 
 #endif
Index: libvob/include/vob/Vob.hxx
diff -u libvob/include/vob/Vob.hxx:1.5 libvob/include/vob/Vob.hxx:1.6
--- libvob/include/vob/Vob.hxx:1.5      Sat Mar  8 14:45:47 2003
+++ libvob/include/vob/Vob.hxx  Sun Mar 16 12:58:49 2003
@@ -38,6 +38,7 @@
     };
 
     struct Vob0 {
+       virtual ~Vob0() {}
        virtual int nCoordsys() const { return 0; };
        virtual void render(const Transform **t, int n) const { render0(); }
        virtual void render0() const = 0;
@@ -45,12 +46,14 @@
 
 
     struct Vob1 {
+       virtual ~Vob1() {}
        virtual int nCoordsys() const { return 1; };
        virtual void render(const Transform **t, int n) const { 
render1(*(t[0])); }
        virtual void render1(const Transform &t) const = 0;
     };
 
     struct Vob2 {
+       virtual ~Vob2() {}
        virtual int nCoordsys() const { return 2; };
        virtual void render(const Transform **t, int n) const { 
            render2(*(t[0]), *(t[1])); 
Index: libvob/include/vob/jni/Strings.hxx
diff -u libvob/include/vob/jni/Strings.hxx:1.1 
libvob/include/vob/jni/Strings.hxx:1.2
--- libvob/include/vob/jni/Strings.hxx:1.1      Tue Mar 11 07:10:31 2003
+++ libvob/include/vob/jni/Strings.hxx  Sun Mar 16 12:58:49 2003
@@ -44,4 +44,6 @@
  */
 GLenum tokenFromJstring(JNIEnv *env, jstring token) ;
 
+unicodecharvector jstr2unistr(JNIEnv *env, jstring jstr) ;
+
 }
Index: libvob/include/vob/jni/Types.hxx
diff -u libvob/include/vob/jni/Types.hxx:1.15 
libvob/include/vob/jni/Types.hxx:1.16
--- libvob/include/vob/jni/Types.hxx:1.15       Tue Mar 11 07:57:04 2003
+++ libvob/include/vob/jni/Types.hxx    Sun Mar 16 12:58:49 2003
@@ -34,6 +34,8 @@
 
 #include <vob/jni/Strings.hxx>
 
+#include <GLMosaicText.hxx>
+
 
 namespace Vob {
 namespace JNI {
@@ -58,6 +60,14 @@
     extern ObjectStorer<Os::RenderingSurface> windows;
     extern ObjectStorer<ByteVector> bytevectors;
 
+    // XXX Copied from include/vob/vobs/Text.hxx
+    typedef GLMosaicText::Renderer<
+               GLMosaicText::DenseGlyphs<unsigned short>, 
+               unsigned short> 
+           DefaultTextRenderer;
+
+    extern ObjectStorer<DefaultTextRenderer> textrenderers;
+
 #define START_VOB_JNI_CONVERSION(type, javaName_, jnitype_)    \
     struct JParameter<type> {                                  \
        typedef jnitype_ jniType;                               \
@@ -134,6 +144,10 @@
        DBG(dbg_convert) << "Converted token "<<out<<"\n";
     END_VOB_JNI_CONVERSION
 
+    START_VOB_JNI_CONVERSION(unicodecharvector, "String", jstring)
+       out = jstr2unistr(env, in);
+    END_VOB_JNI_CONVERSION
+
 
     START_VOB_JNI_CONVERSION_IDDED(GLubyte *, "GL.ByteVector")
        DBG(dbg_convert) << "Converting bytevec "<<in<<"\n";
@@ -145,6 +159,11 @@
 
     START_VOB_JNI_CONVERSION_IDDED(DisplayListID, "GL.DisplayList")
            out = in;
+    END_VOB_JNI_CONVERSION
+
+    START_VOB_JNI_CONVERSION_IDDED(DefaultTextRenderer *, 
+               "GL.Font")
+       out = textrenderers[in];
     END_VOB_JNI_CONVERSION
 
 }
Index: libvob/org/nongnu/libvob/gl/GLRen.java
diff -u libvob/org/nongnu/libvob/gl/GLRen.java:1.4 
libvob/org/nongnu/libvob/gl/GLRen.java:1.5
--- libvob/org/nongnu/libvob/gl/GLRen.java:1.4  Tue Mar 11 07:10:32 2003
+++ libvob/org/nongnu/libvob/gl/GLRen.java      Sun Mar 16 12:58:49 2003
@@ -102,6 +102,17 @@
  return _; }
 
 static private native int implcreateDrawPixels(int p0, int p1, String p2, 
String p3, int p4) ; 
+static public class Text1 extends GL.Renderable1JavaObject  { private 
Text1(int i) { super(i); }
+GL.Font p0;
+}
+static public Text1 createText1(GL.Font p0, String p1, int p2) { 
+Text1 _ = new Text1(
+implcreateText1(p0.getId(), p1, p2));
+_.p0 = p0;
+
+ return _; }
+
+static private native int implcreateText1(int p0, String p1, int p2) ; 
 
 
 }
Index: libvob/rules.mk
diff -u libvob/rules.mk:1.6 libvob/rules.mk:1.7
--- libvob/rules.mk:1.6 Tue Mar 11 07:10:31 2003
+++ libvob/rules.mk     Sun Mar 16 12:58:48 2003
@@ -11,7 +11,7 @@
 # OPTIMIZE =  -O3 -ffast-math $(ARCH) -fomit-frame-pointer 
-foptimize-sibling-calls
 OPTIMIZE = -O0
 
-CPPFLAGS = -I../include -I../../libvob-depends -I../../include $(EXTRAINCLUDE) 
-I../../callgl/include -I../../../callgl/include 
-I../../callgl/include/glwrapper -I../../../callgl/include/glwrapper
+CPPFLAGS = -I../include -I../../libvob-depends -I../../include $(EXTRAINCLUDE) 
-I../../callgl/include -I../../../callgl/include 
-I../../callgl/include/glwrapper -I../../../callgl/include/glwrapper 
-I../../glmosaictext/include -I../../../glmosaictext/include 
-I/usr/include/freetype2
 CXXFLAGS = -g -Wall $(OPTIMIZE) $(CPPFLAGS) 
 CCFLAGS = -g -Wall
 
Index: libvob/src/jni/Gen.cxx
diff -u libvob/src/jni/Gen.cxx:1.13 libvob/src/jni/Gen.cxx:1.14
--- libvob/src/jni/Gen.cxx:1.13 Thu Mar 13 12:41:39 2003
+++ libvob/src/jni/Gen.cxx      Sun Mar 16 12:58:49 2003
@@ -36,14 +36,7 @@
 std::ostringstream VOB_TRANSCSTREAM;
 
 #include <vob/jni/Generate.hxx>
-
-// These are the include files that contain
-// the actual vobs and transforms
-#include <vob/vobs/Trivial.hxx>
-#include <vob/vobs/Pixel.hxx>
-#include <vob/LinearPrimitives.hxx>
-#include <vob/FunctionalPrimitives.hxx>
-#include <vob/DisablablePrimitives.hxx>
+#include "jnivobs.hxx"
 
 int main() {
     std::ifstream templ("src/jni/GLRen.template.java");
@@ -75,11 +68,7 @@
     jni << "//COMPUTER GENERATED DO NOT EDIT\n";
     jni << "#include <vob/jni/Types.hxx>\n";
     jni << "#include <vob/jni/Define.hxx>\n";
-    jni << "#include <vob/vobs/Trivial.hxx>\n";
-    jni << "#include <vob/vobs/Pixel.hxx>\n";
-    jni << "#include <vob/LinearPrimitives.hxx>\n";
-    jni << "#include <vob/FunctionalPrimitives.hxx>\n";
-    jni << "#include <vob/DisablablePrimitives.hxx>\n";
+    jni << "#include \"jnivobs.hxx\"\n";
     jni << "#include \"org_nongnu_libvob_gl_GLRen.h\"\n";
     jni << "using namespace Vob::JNI;\n";
     jni << "using namespace Vob::Primitives;\n";
Index: libvob/src/jni/Strings.cxx
diff -u libvob/src/jni/Strings.cxx:1.2 libvob/src/jni/Strings.cxx:1.3
--- libvob/src/jni/Strings.cxx:1.2      Tue Mar 11 07:57:04 2003
+++ libvob/src/jni/Strings.cxx  Sun Mar 16 12:58:49 2003
@@ -51,4 +51,18 @@
     return ret;
 }
 
+/** Converts jstring to unistring
+ *
+ * Unistring type currently defined at 
+ * gzz/gfx/librenderables/Renderables.hxx
+ * 
+ * @param env the JNI interface pointer
+ */
+unicodecharvector jstr2unistr(JNIEnv *env, jstring jstr) {
+  const jchar *strptr = env->GetStringChars(jstr, 0);
+  unicodecharvector unistr(strptr, strptr + env->GetStringLength(jstr));
+  env->ReleaseStringChars(jstr, strptr);
+  return unistr;
+}
+
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]