![]() |
#1 |
Member
![]() 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 ![]() 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. |
![]() |
![]() |
![]() |
#2 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 780
Karma: 1416
Join Date: Jan 2008
Device: Kobo Clara 2E/HD, Kindle PW
|
Quote:
I hope you're going to update your firmware...I just did a diff between old and new main.xml and there are lots of changes. I'm afraid dropping an old main.xml into a new firmware would cause breakage ![]() |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 20
Karma: 27
Join Date: Jul 2008
Device: PRS-505
|
And does the sd version works for you? if so, it's very likely that simply generating a diff with my changes (which are actually very minor - just a bootstrap code and a patch into modelChanged, but I suppose I know how to get rid it) against the old fw and applying it to new main.xml would do the job (and there are two unessential lines in applicationStart.xml)
I didn't do the update since I wanted to reach some stable version first, so than I can chase just incompatibility bugs - 5k lines of code makes a lot of space for errors :/ But now I'll probably do the update as soon as I find some windoze pc here ![]() My point in making all this (apart from wanting a notepad on my sony ![]() ![]() Actually, since it's xml, I think that using xslt stylesheets (and some js code) it would be possible to load main.xml into mozilla and display it more-less correctly. I'm only guessing now because I don't really know xslt yet, but this along with some adaptation code (both mozilla to sony(FileSystem object) and sony to mozilla) could create quite a useful emulator... and mozilla has js debugger, which would help a lot... ;] By the way, I didn't know that so many cool (from programmer's point of view) things can be done in js ![]() greetz Martin PS My dream is to have a sony port of freemind, or something similar ![]() |
![]() |
![]() |
![]() |
#4 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 780
Karma: 1416
Join Date: Jan 2008
Device: Kobo Clara 2E/HD, Kindle PW
|
I'm new to js as well. I've coded over the years in many languages, but somehow avoided javascript
![]() I haven't run the sdcard version yet. I'm working on an update to PRSCustomizer, so I hope to play with your app next week. Looking forward to it. |
![]() |
![]() |
![]() |
#5 |
Member
![]() Posts: 20
Karma: 27
Join Date: Jul 2008
Device: PRS-505
|
Cool. Before you start, PM me and I'll send you latest stable code - especially if you're going to look into libUI.js or dict2.js - I'm unifying all interfaces now and constantly make changes, so it is hard to keep this version here up to date, since I'd have to do it like twice a day.
BTW, I forgot to include the manual ![]() The only thing about the dictionary is that pressing Mark button displays a window with all possible words you can get from this key combination, and holding the Mark button shows change language window. The cool thing about it is, that it's done by the framework - the dict app only specifies when creating an UIEdit object, that it wants to use just those indexes, that have contents connected (well, its not implemented yet and now it just uses all of them, but soon it will be - anyway, both supplied have contents, so there's no problem ![]() |
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bible Framework | ProDigit | Workshop | 46 | 12-18-2015 04:39 AM |
Ebook reader integrating translation | blyde | Which one should I buy? | 18 | 08-26-2010 07:08 AM |
Integrating Content Server with existing webserver? | mmseng | Calibre | 3 | 01-14-2010 10:08 PM |
Automatic Downloaders Framework | -Thomas- | iRex | 41 | 10-19-2009 04:55 PM |
Integrating Readability/TidyRead with calibre news fetching | strico | Calibre | 1 | 09-18-2009 12:54 PM |