View Single Post
Old 09-12-2008, 01:27 PM   #1
mkaluza
Member
mkaluza began at the beginning.
 
Posts: 20
Karma: 27
Join Date: Jul 2008
Device: PRS-505
Framework for integrating applications

Hi.
Finally after some time of writing it is ready enough to be released for preview.
What it provides:
- application-wide, unified, fast logger (I wouldn't get here without it)
* fast - has buffered and sync modes(sync - former trace() - takes ~0.1s per write, so its sloooow, but inevitable for situations where hard reset occurs and buffers are lost)
* appends object/function names into the log if desired
* shows timestamp - good for profiling/optimizing
future: automatic callstack tracing

- text input engine
* modular - T9 (tree index based - under developement) and dumb (no index, as in cellphones without dict) modules available

- object base controls for creating apps
* Edit and TextEdit (under developement) for text input
* TextView for multiline scrollable viewer (it even displays scrollbar )

- windows/modals management
* windows stack (closing one takes you back to the one that opened it)
* all you need to do is call MyDocument.openWindow/openModal/closeWindow/closeModal to change window/dialog box. Wherever you are.
* Modal dialog boxes - select, message, and input box with callbacks for interacting with the user.

- Shell object - all things for running scripts from Igorsk enclosed in an object
- Options object, for easy loading/keeping/saving options
- Few other small things that make life much easier.

Most important thing - my aim was reader integration, so almost everything works when patched into main.xml

It contains two applications - a dictionary, based on those components - actually it was the reason for me to write all this, because I didn't like the way text was input in the existing one.
Another feature of it is that it doesn't cover (most of) book's text(when it runs within the UI), and I plan to move the input to the status line, so that you can see the word you want to look up - after that the translation is displayed fullscreen.
The other app is Five Balls game. I took it (with Clemenseken's permission) to check, how other apps integrate. Apart from few minor path and name changes it was copy-paste job, so it it met one of it's goals quite nicely.

INSTALL:
unzip sd.tgz to the root of sd card, as usuall
rd.tgz must be unzipped to internal memory
wb.tgz and ita.tgz must be unzipped to internall memory (I'll explain why later) - these are indexes and at least one is necessary.

resources.tgz - it contains a patched main.xml and all the acompanying files. You can extract it onto internall memory, run sd autorun, press 1 and follow instructions.
WARNING - this is experimental. Backup internal memory contents before doing it. If you're done, run sd autostart and press2, or hold 9 in main reader menu until message appears or reboot the reader. If you don't do it and write something to internal memory, you end up with corrupted filesystem
WARNING2 - I still have old firmware. I don't suppose it makes any difference, but just for the record.
WARNING3 - if you're not sure what this does internally, don't do it! You have been warned - if you break something, I don't care.

Of course running it from the card it safe - in worst case scenario it'll hang/crash the reader for hard reset, but it should happen - it's fairly well debugged.

It generates quite large amount of logs - logger.log file will grow fast, but if you manage to crash it, it'll help me to determine what went wrong. To disable it, find Logger.prototype.disabled=0; in lib.js and change it to 1;

Of course the problem with the dictionaries/indexes is that they have to be generated. I've got a simple script, but it needs more work.

It's not yet final and it's not yet finished. Some interfaces may change a little when I work on them, and some features need to be added (multiline edit, adding words to t9 dictionaries). It's just to show you how it works and to discuss further development. Of course if someone has time and will, there are some things to do - "installer"-integration into PRScustomizer, a builder/checker for main.xml, dictionary generator (it's a python class now)

I decided to show it as is, because my college starts and I'll have much less time for development (apart from it, I work full time, sometimes sleep and sometimes have private life

If you want to start looking into it - start with dictionary/group.js, autorun.js - they're quite clean and contain the essence of using this stuff
Don't even look into autorun.xml code section. It's garbage, didn't have time to clean it up. The same with init.js - these Hold* functions are old, works 5,6,7 and 9. It's still a have-to-figure-it-out part.

But use mostly SD version...

Ufff... comments are welcome.

happy hacking
Martin.
Attached Files
File Type: gz ita.tar.gz (456.8 KB, 458 views)
File Type: gz wb.tar.gz (7.50 MB, 443 views)
File Type: gz sd.tar.gz (99.6 KB, 437 views)
File Type: gz resources.tar.gz (118.6 KB, 467 views)
mkaluza is offline   Reply With Quote