*VERY* IMPORTANT: please read at least the ones marked with !: they are incompatibilities between this and the last versions. Changes in SuperWaba version 2.0 beta 3 ! Note: you MUST run exegen again in your app. . Fixed fatal error when running VPFinance in PalmOS 2.0. Just set the "far String Constants" in 68k Processor panel of CodeWarrior 6. . Converted project to 3.5 support. Note: its still compatible with 2.0. . Added Mathias Ringwald enhancements for Serial: support for IrCOMM, SIR and USB. you use the serial port class as before. Here are the requirements: . To use ircomm on palm 3.1 devices, you'll need the SerIrCOMM Lib from the ir enhancement pack from palm. the vm uses the new serial manager if it is present. adds to SerialPort.java: . i just added new constants to the serial port class these are used in the creator . public static final int DEFAULT = 0; /** Default Port (cradle) */ . public static final int IRCOMM = 0x1000; /** IrCOMM Port (Serial Connection on top of IrDA Stack) */ . public static final int SIR = 0x1001; /** SIR Port (Physical Layer of IrDA Stack) */ . public static final int USB = 0x1002; /** USB Endpoint 2 Port (Visor Handspring Devices only) */ . Removed nmpalm_d.* and placed all in nmpalm_c.*. added nmpalm_c.c to a new segment. . Modified the VmGetSettings and removed the private constructor in Settings.java. removed Settings.getString() from the device dir. . extra.io.builtin.Mail class updated: Constants made public and documented, some sanity checking. Thanks to Mr. Tines. . Fixed edit when the height is above PREFERRED. thanks to ymbezeq to point this out. Note: if height is below PREFERRED, the letters will be truncated. . Fixed edit in oldStyle mode. simplified edit using eraseRect. . Note: to ensure compatibility and portability, use the PREFERRED as the height for the controls. It is calculated based in the height of the current font. . corrected make.bat files ("not defined" in environment variables dont work in old M$Dos). thanks to Didier Clerc. ps: in cmd.exe of Windows2000 it works. . updated IntVector to support stack and the compatible java Vector methods. added IntVector.qsort that does a QuickSort in the elements. . changed desktop's fillPolygon algorithm. taked from gd 2.0.1 beta (http://www.boutell.com/gd/manual2.0.html) from Thomas Boutell (oh god, why i didnt found this in the beginning of this year!) . fixed desktop's graphics.fillHatchedRect and also the Button in oldStyle mode (that was using that method to paint itself when filled) . changed Graphics.draw3dRect. . changed the pixels order of desktop/waba.fx.[Graphics/Image]. now they are [y][x] instead of [x][y]. created a drawScanLine at drawBitmap to speedup the paint . fixed double and long support bugs pointed out by Michael Brereton. . fixed MessageBox width when the title was greater than the text. thanks to Yehuda. . rearranged the graphics files, separated the palm stuff from the rest. . device/waba.sys.Vm.getMaxColors now is native, and returns the real max colors of the device. Palm OS < 3.5 always return 4. . new method waba.fx.Sound.setEnabled to turn on/off the device's sound and isEnabled to get the current status. The default volume is setted back at the vm exit. At the desktop, it only disables the beep, since tones are not supported. . added destroyHashTables and xfree(mainGrHandle) to correct some memory leaks. . fixes some bugs that Bjoern Knafla pointed out in the Vector class (and also in IntVector class) : . creating a Vector too small wont grow it . declaring Vector as final wont make it possible to implement the Stack of java (although, the Vector class already acts like a Stack!) . inserting a element greater than the current Vector size isnt checked. . notes regarding the color support: . if palm OS is below version 3.5, i use my assembly routines. if is >= 3.5, i use the internal (PalmOS Winxxx routines) ones. obviously, they are slower than mines. . automatic dithering is used when you load an 256 color bitmap in a (up to 16 shades of ) gray scale device. the dithering in color devices is unfeasible, bc it takes about 5 minutes to do the dithering (in a PalmIIIc) . there is a way of use my faster assembly routines in palm os >= 3.5. to do that, you just need to use double buffering or create a bitmap and draw in it. bitmaps use the assembler routines, and so they are faster. then the bitmap is displayed using the standard PalmOS routines. very fast. . for simplification, if palm os >= 3.5, each bitmap pixel is stored in one byte, even if in devices with 4 bpp (like PalmV). Since those devices have more memory, this is not a pain. . in color devices, when you draw a bitmap it palette is applied before drawing and is not removed after this. if you used the default system palette (also known as WebSafePalette, and listed in org/wabavm/palm/WebSafePalette.txt), then theres no problem. but if you dont use that palette and the display only supports 256 colors simultaneously, then youre in trouble *if* the first color of the palette (index 0) is not WHITE. This does not occurs in displays that supports 16k colors. . corrected bug in desktop/Graphics.drawText if text was null. thanks to Humphrey Bien . Control constructor: fixed an incompatibility between SW and Waba that Scott Cytacky pointed out regarding font initialization. . Putted some debug messages in the bitmap loading. . Vm change: xfree now is a macro that calls xfree_ and set the pointer to null after releasing the memory. . corrected some bugs when a palm popup was called (like the contrast dialog). after calling the popup, a redraw() event is throwed. ! new method interceptSystemKeys, in where you can select which system keys you want to intercept. use the Vm.SK_xxx constants. the setSystemKeysUse is deprecated and will be removed in beta 4. now in the desktop, it uses this settings in the emulation with Fn keys. . added corrections by Daniel Tauschke of ComboBox with zero-sized elements. . added desktop/MainWindow.getCommandLine. it is now setted by the Vm.exec method. . new class waba.fx.Palette. used to get the system or the bitmap palette and manipulate it. ! changes in class Color . GS_PAL from Color moved to class Palette as GrayPalette. . removed constants GS_ . changed the values of Color.BRIGHT from 224 to 191. . getGray now returns index values from 0 to 15 depending on the device capabilities. . now rgb value is pre-computed to speed up process. . getPixel returns the index of the palette (as it already works). to get the color, use myAppliedPalette.getColor(g.getPixel()). . changes in Image class: . new method saveTo(Catalog): saves the image to a catalog . new method createBmp(DataStream): saves the image to a stream (like a serial or socket stream). . note: currently, the bitmap is device-dependent bitmap. this happens bc when a bitmap is load into the device, it is converted to the device's format (and dithered if necessary). so, when saving, it will be saved in this format. the bitmap is always saved using an 256 color palette: if the device is color, it will be used the (palette that came with bitmap) or (websafe palette); if the device is grayscale, the websafe palette is always used and the bitmap is stored as grayscale with dithering. . new method setPalette, getPalette and applyPalette. ! getPixels was removed (it was deprecated). . new methods in DataStream: readIntLE, writeIntLE, readShortLE, writeShortLE where LE stands for little endian (intel format). used in the image saveTo method. . new method Vm.attachLibrary(name) to attach at runtime a library. name must be the name of the catalog, case sensitive, without type and creatorID. . Vm.getScreenSize now is native. . new method String.compareTo to do a lexicographical comparision. . note: the maximum available screen depth will be 8bpp. in my tests, for some reason, the palette is not being correctly applied in VisorPrism at emulator. in beta 4 i will fix this. . changes in the vm memory manager: . now all the heaps are stored in only one catalog. . the xmalloc function now is smart: if the chunk is greater than 1024 (1k), then alloc in the storage heap. otherwise, alloc in the normal heap . the xfree function is smart too: if the chunk is from the storage heap, release and shrink it to 8 bytes. . new method xmallocAtLeast(desired, minimum), used by the object and class heaps (eg: although the usual size of the heap is 64000 bytes, in palm os 2.0 we cant allocate that much, so, allocate the much as possible to let the program run) ! new memory parameters . parameters /L, /S and /T dont exist anymore. old programs passing them is harmless and the Large memory model is assumed . the parameter /m now can receive 4 values: . S (small): 16000 for class/object/hos, and 1500 for each stack . M (medium): 32000 for class/object/hos, and 2000 for each stack . L (large): 64000 for class/object/hos, and 4000 for each stack . H (huge): chunks allocated dinamically, limited by the ammount available in the device, starting from 64000 for class/object/hos and 8000 for each stack (NOT IMPLEMENTED YET) . note that each class/object/hos allocates the desired size, so, in the small memory model, the total allocated is 16000 * 3 + 1500 * 2 = 51000 bytes . ps: i really dont know if any sw program can run using the Small memory model. ! changes in exegen . now the /L, /S and /T give fatal errors . /M must have one of the following: small/medium/large/huge ; you can specify only the first letter and lowercase/uppercase dont matter. a number (like using the old format) will give fatal error. . corrected negative value convertions in double2string. . corrected Hashtable.getKeys method thanks to Erik Bågfors . now Graphics.drawImage can receive CENTER as x and/or y, to let it center the image on screen. . new example added, Clock: "this is a small demo drawing a clock on screen. it also reads from a memo locations and time offset and shows that time in those places if requested.". thanks to Yehuda Miron. . changed timeout of socket connection to 5000 instead of 1500; mathias ringwald asked for that change to correct some problems in some springboard cards. . new classes for String and StringBuffer. Here are the release notes of David Gecawich . Here are the optimized versions of String and StringBuffer, which we have been running in a production application for over 2 months. Our application is currently in use by fortune 500 companies in the United States. . They allow an app to scale much better. The intern() method was added to String as it allows for SIGNIFICANTLY faster and more efficient XML parsing. There are way too many changes between the 1.21 String/StringBuffer and my String/StringBuffer. . I have spent days optimizing these classes to a point where they allow a data access application (database and XML) to grow without bombing out on memory problems. A trivial change or omission can make a huge difference. . new parameter to the desktop Applet class (if running as application with java.exe) /bpp and new parameter 'bpp' (if running as applet). this lets you emulate all the possible bpp of the real device. you can use the parameters 2,4,8,16,24. no other is permitted. 2 and 4 means gray scale devices; 8 and up means color devices. this . parameter must not be used with the /color parameter (color is automatic calculated). When using color images in grayscale (2 or 4 bpp), the image is dithered. . new method Catalog.getRecordPos to return the current record. . changed Hashtable.getKeys so that the vector will be created with the current hashtable size. . new class IntHashtable whose key and value are int. . updated desktop classes to match device classes. the palette class will be enhanced in beta 4. . changed steps of Color.brighter and darker. now instead of 25%, it uses constant increments depending on the current bpp. . the default bpp at the desktop is 2bpp (gray scale). note also that there's no difference between 8,16 or 24 bpp. . at the desktop classes, if you save a bitmap to a catalog, theres no way to load it through the Image constructor (attachLibrary dont work at the desktop classes). this may change in the future. . now if gray mode was active when starting sw, it is left that way when exiting sw. . corrected debug size of memo for PalmProfessional from 400 to 4000. . now the hos memory can be smaller than the heap memory. Important note: the palette was not heavily tested, so please be aware that there can be lots of bugs when dealing with it, specially if you have plenty bitmaps with different palettes being shown at the same time and saving those bitmaps. I'm open for suggestions for enhancing the palette support. Note: the file GraphicPort.c may be implemented by who want to port the graphics routines to other platforms. Known bugs: . due to a change in the way sw use memSemaphore, running superwaba applications in POSE with roms 2.0 and 3.1 (IIIx and IIIe), the screen isnt redrawed. This bug was not removed to help Keith Rollin fix it. In roms >= 3.5 all works fine. in the device too, all works fine. . not all draw modes were tested at the color device. so, maybe someone can not work. please tell me any difference that occured. Beta4 Todo list: . re-implement Image.setPixels. . improve bat files so it automatically finds the %jarfile% env var. . translated grayscale drawBitmap to assembler, but i had no time to debug it. . speedup erasePixel and invertPixel operations and collisionDetect . check problem in catalog/memo that yehuda pointed out in the ng. . fix paint problem when pressing the cancel button in f12 in the desktop welcome app in the $$$ field. . verify if the new fillPolygon is faster than the current one at device. . add the Random class as soon as noel and sean fix the bugs... . implement growable stacks . add introspection . fix a bug in the desktop when you open a messagebox and minimize the window pointed out by imran zahid. PS: After beta5, 2.0 final will be released.