Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Sony Reader > Sony Reader Dev Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 06-03-2007, 06:55 PM   #1
igorsk
Wizard
igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.
 
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
Post Unofficial Sony Reader SDK released

Well, I finally got this more or less working.
Included:
1) an import library for Fsk.dll (MSVC format)
2) a header file with definitions of enough Fsk functions to implement a simple text viewer
3) a sample of said viewer

How to install the sample:
1) Copy testviewer.dll next to "CONNECT Reader.exe"
2) Add the followings line to kconfig.xml (make sure to backup it!)
after <extension href="[applicationPath]FskDocumentViewer"/>:
Code:
<extension href="testviewer"/>
after <subtype name="plain" extension="txt"/>:
Code:
<subtype name="plain2" extension="txt2"/>
to see the debug messages, after </environment>:
Code:
<debug>
          <console visible="true"/>
</debug>
To test the sample, make a simple text file (if you use any non-ASCII symbols, make sure to save it as UTF-8) and give it a .txt2 extension. Then just open it in Connect.

I'm sorry that there's no documentation, I'm not really a doc writing type. I hope the code is more or less self-explaining. Feel free to ask about anything and I'll try to explain. Also check fsk.lst file for the list of all Fsk functions. Let me know if there's any one that looks interesting to you and I will try to find out how it works.

TODO (in no specific order):
  • Fix bookmarks so that the view doesn't shift after switching between font sizes
  • make and test port for Reader
  • implement save/load of layout info and bookmarks
  • implement bitmap display
  • document more Fsk functions.
  • implement links
  • implement spans

Current version: 0.1
http://projects.mobileread.com/reade...FskSDK-0.1.zip
igorsk is offline   Reply With Quote
Old 06-03-2007, 07:52 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Wow impressive.
kovidgoyal is offline   Reply With Quote
Advert
Old 06-05-2007, 08:21 AM   #3
Alexander Turcic
Fully Converged
Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.
 
Alexander Turcic's Avatar
 
Posts: 18,163
Karma: 14021202
Join Date: Oct 2002
Location: Switzerland
Device: Too many to count here.
That. Is. So. Cool.

Thank you igorsk!
Alexander Turcic is offline   Reply With Quote
Old 06-05-2007, 11:26 PM   #4
alex_d
Addict
alex_d doesn't litteralex_d doesn't litter
 
Posts: 303
Karma: 187
Join Date: Dec 2006
Device: Sony Reader
I'm sorry, what's Fsk?

Is this an SDK for the Reader or for the Connect software?
alex_d is offline   Reply With Quote
Old 06-06-2007, 03:38 AM   #5
igorsk
Wizard
igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.
 
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
Fsk is the engine of the Reader (and Connect) UI. On win32 it's implemented in Fsk.dll and on the Reader in libtinyhttp.so. The current release of SDK supports only Win32, but as the API is basically the same, it shouldn't be too hard to port to Linux. Right now I only described enough functions to make a custom viewer plugin, but in theory it's possible to add image viewers, audio decoders and about any custom UI components.
igorsk is offline   Reply With Quote
Advert
Old 06-06-2007, 10:02 AM   #6
alex_d
Addict
alex_d doesn't litteralex_d doesn't litter
 
Posts: 303
Karma: 187
Join Date: Dec 2006
Device: Sony Reader
cool

but the Connect UI looks nothing like the Reader's. Is there going to be some sort of interoperability? Ability to test and debug on win32 and move to the reader?

also, if you add a viewer using this method, what can the viewer do? Anything it wants? What about the issues of the user input, system messages, etc that I'm dealing with in the other thread?
alex_d is offline   Reply With Quote
Old 06-06-2007, 10:46 AM   #7
igorsk
Wizard
igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.
 
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
Viewer plugins interface is very abstract, so you can use the same code on Win32 and Linux. Fsk takes care of all input and display, you only need to implement the features you need. The text viewer interface is described by the DocViewer structure. For the bare minimum you need to implement:
  1. CanHandle, which is used by Fsk to check whether the plugin can render a given mime type
  2. New, which is called by Fsk on opening of the file and should return a new viewer instance. One of the parameters has a pointer to the fileRead function, which can be used to read the actual file data.
  3. Dispose, called when closing the file.
  4. Render, called by Fsk when it needs to render a page. It should return an FskBitmap with rendered text/graphics. Various Fsk APIs can be used for rendering text and graphics on the bitmap.
  5. A few propery handlers in PropTable. You probably need at least handlers for Dimensions and Crop. If you want resizable text, you need to implement TextScale. To handle multi-page documents, Page and Pages.
When using resizable fonts, marks interface needs to be implemented too (MarkNewFromLocation etc).
To register in the viewer plugins chain, the plugin should call FskExtensionInstall in the fskLoad function.
igorsk is offline   Reply With Quote
Old 06-06-2007, 11:22 AM   #8
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,660
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
What about handling graphics?
JSWolf is offline   Reply With Quote
Old 06-06-2007, 11:33 AM   #9
igorsk
Wizard
igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.
 
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
Did you mean picture viewer? Or books with images? Both are doable, though I didn't investigate them too far yet.
igorsk is offline   Reply With Quote
Old 06-06-2007, 02:41 PM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,660
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by igorsk View Post
Did you mean picture viewer? Or books with images? Both are doable, though I didn't investigate them too far yet.
How easy do you think it might be to write say a LIT viewer (no need for DRM) or a Mobipocket viewer. I know for sure that a Mobipocket viewer is more important as it would get more people away from the palm and onto the Sony.
JSWolf is offline   Reply With Quote
Old 06-06-2007, 04:20 PM   #11
igorsk
Wizard
igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.
 
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
Well, the groundwork is there, all that's left is someone to write the actual code
Maybe I will see what I can do some time later...
igorsk is offline   Reply With Quote
Old 06-06-2007, 05:38 PM   #12
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,660
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by igorsk View Post
Well, the groundwork is there, all that's left is someone to write the actual code
Maybe I will see what I can do some time later...
That would be nice!Is the source code for Mobipocket available? if not, I can try to ask Mobipocket if it's ok to have such for porting to the Sony. It would be in their best interest.
JSWolf is offline   Reply With Quote
Old 06-06-2007, 09:21 PM   #13
igorsk
Wizard
igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.
 
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
Hehe I doubt they will share it
I'll see if it's possible to reuse some of FBReader's code...
igorsk is offline   Reply With Quote
Old 06-06-2007, 10:20 PM   #14
alex_d
Addict
alex_d doesn't litteralex_d doesn't litter
 
Posts: 303
Karma: 187
Join Date: Dec 2006
Device: Sony Reader
Oh, I see. So it's not about programming viewers per se, it's about programming file-handling plugins for the Sony viewer. I mean, can I even create my own interface where I can enter page numbers?

It's nice to see how elegantly Sony programmed everything. However, I'm afraid this is useless for my needs because i'm focusing on doing advanced rendering by directly controlling the eink.

igorsk, what about modifying the Reader UI to call other executables? (ie, similar integration but more power)

Last edited by alex_d; 06-07-2007 at 05:15 AM.
alex_d is offline   Reply With Quote
Old 06-07-2007, 02:49 AM   #15
igorsk
Wizard
igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.
 
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
Well, the problem is that a lot of the UI logic is implemented in ECMAScript, and hooking into it is rather complicated if the plugins interface is not enough for you...
igorsk is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is the PRS-505 still considered the best Sony Reader model released so far? megacoupe Sony Reader 56 06-07-2010 07:26 PM
Sony Reader Firmware 1.1.00.18040 released methlp Sony Reader 1 07-24-2008 03:12 PM
Sony SDK? binkman71 Sony Reader Dev Corner 3 05-08-2008 07:33 AM
iPhone SDK Released! NatCh Apple Devices 11 03-07-2008 11:27 PM
RasterFarian V2.5 Beta for Sony Reader released Alexander Turcic Sony Reader 0 04-17-2007 02:53 PM


All times are GMT -4. The time now is 08:52 PM.


MobileRead.com is a privately owned, operated and funded community.