summaryrefslogtreecommitdiffstats
path: root/src/java/com/sun/gluegen/JavaEmitter.java
Commit message (Collapse)AuthorAgeFilesLines
* Renamed com.sun.gluegen -> com.jogamp.gluegenSven Gothel2010-11-061-1950/+0
|
* Fix native type representation; Retain typedef declName in resulting Type ↵Sven Gothel2010-11-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for variables; Misc Fix native type representation ---------------------------------- The following custom types were previously build-in: __int32, __int64 Adding the following native build-in types (necessary): ptrdiff_t, size_t These compiler/platform specific types shall not be typedef'ed via header files. Hence we provide proper typing for such, as the compiler would do. Adding the following native build-in types (convenience): int32_t, uint32_t, int64_t, uint64_t These are provided due to their lack of support on certain platforms, and probable source of bugs, when defined by the user. Retain typedef declName in resulting Type for variables. -------------------------------------------------------- Adding Clonable to all cgram Type derivations. Assume use case: typedef khronos_ssize_t GLsizeiptr typedef size_t khronos_ssize_t The previous code picked a one level depth type in the dictionary if exists. Hence it made khronos_ssize_t visible in the javadoc and native code. It is our believe that the generated native code, as well as the javadoc comments shall reflect the original GlueGen'ed API and it's types. Also, aliasing or reducing native types via GlueGen could result in plattorm dependencies and in worst cases, incompatible native types. This patch clones the 1 level depth Type (typedef), clones it and sets the declName, so it's visible to the GlueGen layers. Misc ------- GlueGen's debug flag is passed to HeaderParser, where it traces misc information.
* added 'intptr_t' to the list of PointerBuffer candidates.Michael Bien2010-06-181-2/+2
| | | | TODO consider making this configurable.
* fixed handling of size_t which was broken since the introduction of Int64Buffer.Michael Bien2010-05-311-0/+4
|
* Fix: Prepare CMethodBindingEmitter for struct methods as wellSven Gothel2010-05-251-25/+22
|
* gluegen imports now com.jogamp.common.nio.* and java.nio.* instead of using ↵Michael Bien2010-04-081-0/+2
| | | | FQCN in emitted files.
* fixed a bug introduced in commit 2fe517b9a2e1a680b50c7e1273897495800c5350 / ↵Michael Bien2010-04-011-7/+8
| | | | | | | hudson build 42. Object local PrintWriter was used instead of method local after an attempt to prevent the very same bug...
* fixed generated imports rudimentary (not DRY).. cleanup in work.Michael Bien2010-03-311-4/+11
|
* introduced com.jogamp.common.{nio,os} packages and moved some classes.Michael Bien2010-03-311-0/+4
|
* refactoring and code cleanup in gluegen.opengl and gluegen.procaddress package.Michael Bien2010-03-311-3/+5
|
* replaced int-flags with enums + code cleanup.Michael Bien2010-03-311-24/+12
|
* implemented better logging using java.util.logging.Michael Bien2010-03-311-21/+23
|
* http://www.jogamp.org/bugzilla/show_bug.cgi?id=389Sven Gothel2010-03-301-9/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 32bit/64bit values and arrays are misrepresented - PointerBuffer is used to map 64bit integer values, which is illegal due to the latest PointerBuffer changes, where the underlying ByteBuffer is either 32bit wide or 64bit wide (in respect to the pointer size). The PointerBuffer semantic itself is correct, but no more suitable to represent 64bit values and arrays. A Int64Buffer (LongBuffer does not exist in CDC/CVM patch) should be used instead. - Determine use of Int64Buffer and PointerBuffer Assuming the 1st step being solved, it has to determined for which cases gluegen shall map a type to a PointerBuffer. All pointer pointer types, regardless of a Opaque mapping, ie: +++ typedef struct __MYAPIConfig * MYAPIConfig; Opaque long MYAPIConfig void foo(MYAPIConfig * ptrarray); +++ The argument 'ptrarray' must be represented as a PointerBuffer otherwise data is misrepresented in case: - 32bit machines _and_ - array semantics - more than one value is being used Impl: java/com/sun/gluegen/JavaEmitter.java: - Checks ptr-ptr for Opaque values - Returns PointerBuffer mapping for ptr-ptr types - Allow PointerBuffer being mapped as String[] Very elaborated tests .. :) ++++++++++++ Misc Changes: - Added <Type>.put(<Type>Buffer src) for Int64Buffer/PointerBuffer
* Resolved conflictsSven Gothel2010-03-291-4/+4
|\
| * renamed BufferFactory into Buffers.Michael Bien2010-03-291-4/+4
| |
* | New Int64Buffer type, which is being used for gluegen 'long *'Sven Gothel2010-03-291-10/+12
| |
* | Merge CPU to PlatformSven Gothel2010-03-281-2/+2
|/
* http://www.jogamp.org/bugzilla/show_bug.cgi?id=389Sven Gothel2010-03-281-76/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mixed types in generated code are functioning now, even though not all permutations are generated - still. However, this patch merges the indirect object passing, wheather it is a primitive array or an indirect NIO buffer, incl. PointerBuffer. This allows the usage of only one JNI functions for all combinations. Only in case of NIODirectOnly, the simplified direct only '0' variation is created - otherwise the parametrized '1' variant. The junit tests proves the implementation and almost completes the gluegen junit tests coverage for JavaEmitter and ProcAddressEmitter. Impact/Result: - Working mixed array types - JOGL GL2 native library shrunk around 30% - Simplified gluegen code - Almost complete gluegen junit tests TODO: Complete permutations of array/NIO arguments, if desired. ++++ Misc changes: - NativeLibrary implements DynamicLookupHelper: lookupFunction() -> dynamicLookupFunction()
* fixed regression in constant emission where a type suffix (e.g. 'f') was ↵Michael Bien2010-03-221-4/+6
| | | | | | illegally added after a closing bracket. added testcase.
* fixed JavaEmitter to support unsigned defines.Michael Bien2010-03-121-1/+9
|
* added support for arrays in generated StructAccessors.Michael Bien2010-02-121-38/+89
| | | | | Specifying JavaClass or JavaImplClass is no longer a requirement. It is now possible to generate StructAccessors from c headers without emitting any other binding code (force with EmitStruct <name>).
* fixed emitted code for buffer-array mixing.Michael Bien2010-01-121-12/+8
| | | | | removed workaround in BufferFactory since it is no longer needed. small code cleanup (generator java 5 migration).
* Code cleanup. Ported package com.sun.gluegen to java 5 language level.Michael Bien2009-12-011-103/+83
|
* modified JavaEmitter to generate struct accessor objects with better java ↵Michael Bien2009-11-111-69/+85
| | | | naming conventions.
* String isEmpty() is Java 1.6 - replacedSven Gothel2009-10-131-1/+1
|
* defines with constant but more complex expressions are now no longer ignored ↵Michael Bien2009-10-081-28/+63
| | | | (e.g #define CL_FP_FMA (1 << 5)).
* Cleanup for a better OpenGL 3.2 integration,Sven Gothel2009-08-051-10/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for subsuming extensions: - Allow RenameExtensionIntoCore generate duplicate names, ie those will not be generated. - Add proper comment showing the extension of the symbol. - Fail if no 'GLHeader' is specified, but we are processing a GL/ProcAddress config - Fail if a GL function is not part of an extension MethodBinding, ConstantDefinition cleanup: - getName() returns the renamed name - getOrigName() returns the original - getAliasedNames() returns the aliased ones MethodBinding: - Change: equals() operates on renamed name - Add: hashCode() function - same criteria as equals() Impact: - All config options etc shall trigger with the renamed name, but ignore, rename etc. - Generated Java impl. uses the renamed base name as well Change: emitDefine() uses the ConstantDefinition Add: JavaConfiguration: dumpRenames() Change JavaConfiguration.shouldIgnoreInInterface/Impl(): - respect the renamed symbol name as well Change JavaEmitter.emitFunctions(): - only emit a generated MethodBinding once, therefor store emitted method bindings in a HashSet Fix BuildStaticGLInfo: - Allow white space at the end of #ifndef and #define - Trim strings - Allow 'const' qualifier in function pattern Fix GLEmitter: - Fail if no 'GLHeader' is specified, but a RenameIntoCore option .. - Don't emit marker defines, marking an extension (ie not part of an extension) Fix GLJavaMethodBindingEmitter: - Fail if a GL function is not part of an extension Fix PCPP: - Pass constant type qualifiers for hex-constants: 'l' 'L' ... Fix ProcAddressEmitter: - Operate on the aliased/renamed name for querying ProcAddress usage and generating code.
* Add missing changessg2158892009-07-131-2/+2
|
* Copied JOGL_2_SANDBOX r145 on to trunk; JOGL_2_SANDBOX branch is now closedKenneth Russel2009-06-151-0/+1836
| | | | git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@147 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* Deleted obsolete source code in preparation for copying JOGL_2_SANDBOXKenneth Russel2009-06-151-1698/+0
| | | | | | | on to trunk git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@146 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* Changed implementation of ArgumentIsString to work with wide-character Kenneth Russel2008-05-271-8/+16
| | | | | | | | | | | | | | null-terminated strings on Windows. Changed Windows dynamic linker to use LoadLibraryW which is the only variant available on Windows CE. Changed GetProcAddress to explicitly named GetProcAddressA; this is implicitly the only variant available on Windows XP. Tested by compiling gluegen-rt.dll for both Windows XP and Windows CE. Also brought dynlink-unix-CustomJavaCode.java in line with modifications that were apparently hand made to the UnixDynamicLinkerImpl and MacOSXDynamicLinkerImpl classes. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@79 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* Added support for passing outgoing arrays of compound types, including Kenneth Russel2008-05-261-2/+2
| | | | | | | | | | | non-const arrays of compound types and the associated copies back to Java, in support of constructs like eglChooseConfig. Generated code has been compiled but not yet tested. Refactorings to allow generated glue code using StructAccessors to work on Java ME / CDC / FP + JSR-239 NIO, as well as Java SE. Bug fix to ForceProcAddressGen. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@77 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* Fixed Issue 6: unqualified class names in generated java code Kenneth Russel2008-04-191-4/+4
| | | | | | | | | | Applied and expanded patch from user tck to fully qualify all references to New I/O classes in generated code. Tested by removing Import of java.nio.* from JOGL and JOAL; required modification of the custom Java code for those packages, but otherwise working well. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@73 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* Added GlueGenRuntimePackage to allow people to rename and incorporate Kenneth Russel2007-06-041-1/+3
| | | | | | | those helper classes into their apps git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@62 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* Fixed Issue 212: Incorporate patch to add URL links to GL javadoc Kenneth Russel2006-04-171-0/+5
| | | | | | | | | | | | | Incorporated patch from user cylab on javagaming.org forums to generate @native tags in GL javadoc which are postprocessed using a taglet: http://www.javagaming.org/forums/index.php?topic=12629.0 Modified supplied patch to restrict the @native designation to only the function name, and to understand OpenGL data type-related suffixes (i.e., glVertex -> glVertex3f). git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@29 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* Intermediate checkin for FBO support in Java2D/JOGL bridge. Needed to Kenneth Russel2006-02-051-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | keep track of server-side OpenGL objects, like textures and display lists, created by the end user to preserve the illusion of independent contexts even though they will all share textures and display lists with the Java2D OpenGL context in order to access its FBO. Added GLObjectTracker class to track creation and destruction of these objects and to support cleanup when the last referring context has been destroyed. Modified GLContextShareSet to create and install GLObjectTrackers when necessary and GLContext to ref and unref tracker appropriately. Changed GlueGen's JavaPrologue and JavaEpilogue directives (and their documentation) to perform argument name substitution. Wrote documentation section on argument name substitution and specified behavior for primitive arrays (converts to string "array_name, array_name_offset" in substitution). Rephrased GlueGen's RangeCheck directives in terms of JavaPrologue directives and deleted old specialized code. Fixed bug in handling of VBO support in GLConfiguration when JavaPrologue was present for affected functions. Added JavaPrologue and JavaEpilogue directives to all existing OpenGL routines creating server-side objects (though it's possible some were missed) to call GLObjectTracker when necessary. Added RangeCheck directives for these routines as well. Worked around bug in JOGL demos where shutdownDemo() was being called more than once. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@13 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* Moved GlueGen out of the JOGL workspace and into its own project. Kenneth Russel2006-01-151-0/+1689
Restructured JOGL and JOAL build processes to separately invoke GlueGen's main build.xml before using it to generate their code. Refactored OS/CPU detection code into gluegen-cpptasks.xml build file in GlueGen workspace, which is now imported by both the JOGL and JOAL build processes. Unfortunately it seems to be somewhat difficult to completely factor out the C compiler configuration into the GlueGen workspace so this has been left for a later date. Added missed ALProcAddressLookup file to JOAL workspace. Updated JOGL and JOAL build documentation. More documentation for the GlueGen workspace is forthcoming. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@3 a78bb65f-1512-4460-ba86-f6dc96a7bf27