01-12-2010, 04:40 AM | #1 |
Junior Member
Posts: 5
Karma: 770
Join Date: Oct 2009
Device: hanlin
|
Leo's Hanlin V3 eBook SDK
After hard work, I've uploaded the first version of Leo's Hanlin eBook V3 SDK. This is the development environment was used for the development of Leo's Void (planetarium) and Leo's Wikipedia Reader. It also includes a programming language Script (similar to javascript) in order to develop applications quickly.
The sources include complete sources of Leo's Void and Leo's Wikipedia Reader. It is released as a GNU project under the GPL. So the code is open and is available for download at: http://sourceforge.net/projects/ebooksdk/ [size=14]Development philosophy.[/size] Native development. Development in this SDK is mainly done in windows with Visual Studio using an emulation of the device. Once developed and refined the code uses the cross compiler and SDK provided by Jinke (Tools that run on Linux) to compile ultimately for the Hanlin. The hello world program in this sdk is as native program: Code: Code:
//Include the sdk main include //This is all the code you make for a Helloword app. #include "../sdk/EBookApp.h" IMPLEMENT_EBOOKAPP //Include this macro in one cpp file to implement the main variables. //The hello world app is only a page object. class HelloPage : public EBookApp { public: //Every page (or control) has two abstract methods that must be overloaded. draw the page and onkey as key event handler. void draw(EBookPort *port) { port->begin(); port->clear(ColorWhite); port->setFont(50, TextStyleBold); port->drawString(50, 350, "Hello world!", ColorBlack); port->end(); } void onkey(EBookPort *port, int code) { if (code == KEY_BACK) port->terminate(); } }; //The main page object. static HelloPage page; //The startup application. In this case do nothing because the app is a static object. void ebookMain(EBookPort *port, int language, std::vector<std::string> ¶ms) { } //Return the current application EBookApp *ebookApp() { return &page; } //Terminate and cleanup application. In this case nothing void ebookTerminate() {} Ebookscript Development The development is done in Windows in the simulator to interpret and only needs to load in the Hanlin program source code and the interpreter of ebookscript own. The language has built sqlite SQL server and is able to control applications using linux inlet and outlet pipes (This is how the shell is controlled and gnuchess). The hello world program in script is: Code: Code:
//Include USPL constants and other stuff import "const.uspl"; //Include the debugger. import "debugger.uspl"; //The hello world program in EBookScript public class Hello extends Page { //Draw handler. Every page draw must do a port.begin and port.end. public function draw(port) { port.begin(); port.clear(Const.Color.White); port.setFont(50, Const.TextStyle.Bold); port.drawString(50, 350, "Hello world!", Const.Color.Black); port.end(); } //Key handler. If the key is back then terminate. public function onkey(port, code) { switch (code) { case Const.Key.Back: port.terminate(); break; //The intro key calls the debugger. The debugger is also invocated in error condition. case Const.Key.Intro: EReader.debugger("hello world!"); break; } } /* Main entry point. A static function named main on any class. Notice: every static member main is executed on startup but is not guaranteed the order execution of these functions. It is highly recomended to define only one main entry point. */ public static function main(args) { EReader.push(new Hello()); } } ebookscript has ability to call native functions in shared libraries or dlls. The library can be scheduled to compile as dll and a shared library. An example can be seen in the example of sudoku, in which the solution and generation of Sudoku is done in C and other scripting language. The language has a number of examples that are in turn useful applications. If all you're interested only in run samples download this file: ebookscript_hanlin_binaries_1_0.zip This file contains everything needed to test the examples including a dictionary and a map of Madrid. Extract the folder to a SD and run leoscript.exe Examples are: A Chess built as a frontend of gnuchess (It includes a compilation of chess) A caculator and other programming samples There is lack of documentation. Last edited by Nate the great; 01-12-2010 at 08:13 AM. |
01-12-2010, 08:44 AM | #2 |
Researcher and Consultant
Posts: 210
Karma: 364
Join Date: Nov 2008
Location: Bangkok, THAILAND
Device: MACBOOKPRO17" HP2400TX SONYUX27
|
We salute you, LEO....
|
Advert | |
|
01-12-2010, 11:13 AM | #3 |
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
|
01-12-2010, 11:15 AM | #4 |
Ad astra per aspera
Posts: 347
Karma: 724
Join Date: Aug 2008
Location: Mexico
Device: PRS-505, PRS-300 & HTC HD2
|
seems great new for V3 owners, but why put the whole post, including the code, on the front page? A small abstract + a link to this post would have been enough
|
01-12-2010, 11:19 AM | #5 |
Sir Penguin of Edinburgh
Posts: 12,375
Karma: 23555235
Join Date: Apr 2007
Location: DC Metro area
Device: Shake a stick plus 1
|
|
Advert | |
|
01-12-2010, 11:20 AM | #6 |
Nameless Being
|
I agree! This is not the kind of posting that should dominate the front page. Way too long and way too uninteresting for most readers.
|
01-12-2010, 11:48 AM | #7 |
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
I think eBook Developers need this kind of exposure and am glad it made Front Page News.
I do agree, though, that (unedited) it's a bit awkward for a Front Page post, but then again editing it to use spoiler tags to hide the code and images would detract from the original poster's enthusiasm. That's my take on this as a pseudo-developer. |
01-12-2010, 02:19 PM | #8 |
Addict
Posts: 316
Karma: 1021312
Join Date: Jun 2009
Device: Sony PRS-T1
|
Fantastic! Thank you for setting book readers free!
|
01-13-2010, 01:29 PM | #9 |
Junior Member
Posts: 2
Karma: 10
Join Date: Jan 2010
Device: Hanlin V3
|
Great job, Leo! Congrats!
I tried your SDK, looks like the applications are implemented via file parsers plugins for the 'viewer' application? There is a way to install plugins via a special .lib or .libs folder on a flash disk, so script applications can be installed as a plugin to run .uspl files from the 'bookshelf' application without the need for .exe.fb2 approach. It is also possible to embed scripts parser into the firmware. I tried writing programs as standalone applications for the Hanlin V3 using a mix of V2 SDK, V3 SDK and OpeninkPot tools, but created only a simple program. There is now Java VM in the latest firmware from Jinke, but again no SDK. Plan to write some USPL scripts Everyone who is interested in software for e-Readers is welcome at my web-site: http://eink-apps.com/ (suggestions and comments are welcome ) Last edited by alekz; 01-13-2010 at 01:31 PM. |
01-13-2010, 01:58 PM | #10 |
Resident Curmudgeon
Posts: 75,890
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
01-13-2010, 08:10 PM | #11 |
The LARdT of E-Books
Posts: 106
Karma: 46
Join Date: Dec 2009
Device: HANLIN V3ext (Papyre 6.1)
|
Leo, I've tried to load the example package and it does not work.
Is there something I've to check or any firmware requirements? |
01-14-2010, 07:17 AM | #12 |
Junior Member
Posts: 2
Karma: 10
Join Date: Jan 2010
Device: Hanlin V3
|
Just put leoscript.exe.fb2 from bin/arm to ebookscript/workdir and it will work (probably the program looks for scripts only in the same folder).
|
01-14-2010, 09:07 AM | #13 | |
The LARdT of E-Books
Posts: 106
Karma: 46
Join Date: Dec 2009
Device: HANLIN V3ext (Papyre 6.1)
|
Quote:
Well, this is how files are: Code:
SD:\ └───script └──autorun.uspl calculator.uspl chess.uspl config.cnf ... leoscript.exe.fb2 ... Trace.log |
|
02-17-2010, 06:50 AM | #14 |
Junior Member
Posts: 5
Karma: 770
Join Date: Oct 2009
Device: hanlin
|
I just upload new version of all executables on sourceforge.
The source is uploaded also. This new version 2.0 add the features: There is two kernels of linux. The Old abi (Application Binary Interface) and new abi (gnueabi). Tirwal, and others firmwares are Old ABI and TIGOR and BUGGINS are GNUEABI These kernels are not compatible and the binary executable is different. The dumb rule is: one executable works and the other don't work. Take the good one and delete the other. The exit to bookshelf is fixed and now is possible run a program, exit and continue working. Installation is easy. Just extract the zip folder on the root of a SD card and use Bookshelf to navigate. Then select gnueabi_*.exe.fb2 and if this don't work then the *.exe.fb2 must work. Thank you and sorry for any inconvenience. https://sourceforge.net/projects/ebooksdk/ |
02-20-2010, 03:02 PM | #15 |
Member
Posts: 19
Karma: 72
Join Date: Dec 2008
Device: bebook
|
Leo,
I did try to build 'hello.exe.fb2' from the SDK and that works OK. When I run it on my BeBook, it works OK. But it keeps on showing the 'rotating arrows' from FBReader while the application is running, which is quite anoying. Do you have the same behaviour ? Or do you use some other firmware ? |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Leo's Wikipedia Reader for Hanlin | leobueno | HanLin eBook | 28 | 02-08-2010 12:33 PM |
iPhone SDK guide Ebook? | rock | Reading Recommendations | 0 | 01-28-2010 05:17 PM |
Leo's Void for Hanlin | leobueno | HanLin eBook | 9 | 10-28-2009 08:46 AM |
The most open-sourced ebook-reader (SDK+extras)? | plisken | Which one should I buy? | 3 | 09-18-2009 11:23 AM |
Hanlin SDK | mrdini | HanLin eBook | 11 | 04-12-2009 06:12 AM |