19-Nov-2000
Ralf Kleberhoff ( kleberhoff@aol.com
)
based on Jump 1.0 by Greg Hewgill ( greg@hewgill.com )
Watch the newsgroup pilot.programmer.jump on the server news.massena.com.
The current version can be found at http://sourceforge.net/projects/jump
Jump2 is distributed under the GNU GENERAL PUBLIC LICENSE (version 2),
Copyright (C) 1996/97 by Greg Hewgill
Copyright (C) 2000 by Ralf Kleberhoff
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Jump2 is in an Alpha state of development. Don't expect a stable development environment. Probably, Jump2 will NOT work as expected. Don't blame me if something goes wrong - you have been warned...
WARNING: If you think that some PalmOS system trap is missing for Jump2, then MkApi helps you interfacing to that function. Otherwise, DO NOT USE MkApi! |
If you read and fully understood this warning, the rest of this page explains how to do it.
Jump interfaces to PalmOS via classes and methods in the 'palmos' package. PalmOS system traps are accessed as static native methods in the class 'palmos.Palm'. Both, the 'Palm.java' source file declaring that class and the 'native-palmos.asm' assembly source file containing the native implementations are auto-generated by the tools.MkApi java program.
MkApi takes as its input a file named 'palmos.api' containing the definitions of all PalmOS system traps that Jump should implement. Its syntax is very close to the C syntax found in PalmOS header files. MkApi uses tables to translate from C types (including predefined types of PalmOS) to Java types and built-in rules to prepare arguments and receive return-values.
Files expected/produced by MkApi (relative to the current directory):
Add the definition of the new trap to the palmos.api file.
Make sure that the trap number is defined in Pila's Pilot.inc file. If not, Pila will complain when you try to translate programs.
Run MkApi by typing
Have a close look at the results. MkApi's translations from C types to Java types contain a lot of assumptions that might prove false in some cases.
Compile the resulting Palm.java file.
Make sure, '.' (the current directory) is contained in your CLASSPATH before the jumpxxx.jar file.
Run Jump as usual. The new traps will be available.
After testing, send me the new palmos.api file to include it into the next distribution.
The translations for parameter types and return types are inconsistent, e.g. VoidPtr as a parameter accepts Objects, but VoidPtr as a return value translates to 'int'.
xxxPtr types are normally translated to Java ints. This is useful only if you don't intend to access structure elements of the corresponding type.
But you can have VoidPtr, this one translates to java.lang.Object, and you can pass in anything as argument.
And you can have ByteArray, translating to byte[].
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.