View Full Version : iLiad FBReader


Adam B.
03-14-2007, 02:27 PM
Update 3/16/07

My port of FBReader is working well and is ready for users. Right now, the most difficult part is installation. I'll have to rely on someone else to put together an installation script.

With this method, I'm able to open up files supported by FBReader (chm,rtf,fb2,pdb,tcr,prc) directly from the content lister. The pagebar works, and the screen refreshes as it should.

Known Problems:
1) The first time you use the page bar, it may not respond. Simply press it again and it will work.
2) You will need to use the close soft-button in the upper right to exit. If you press one of the News, Books, Docs, Notes, hardware buttons, FBReader will be hidden in the background and continue running. You will need to close it through a shell, or restart for it to be closed.

Typical Disclaimers Apply. Do not install this unless you know what you are doing. Working in the root filesystem is very dangerous!! Is is possible (though unlikely) to brick your iLiad. I take no responsibility if you do so. Install at your own risk.

http://projects.mobileread.com/iliad/projects/fbreader/fbreader.zip

To install:
1) Put the fbreader folder on the root of your CompactFlash Card.
2) Copy the .fbreader folder to your /home/root/ directory. This contains the settings to make files readable on the iLiad. You can change all of these in the options dialog.
3) You will need to edit the /mnt/settings/er_registry.txt file in order to launch programs from the content lister. The is the most dangerous part of the installation. If this file is formatted incorrectly, you iLiad will be rendered useless.

Change

[USER_APPLICATIONS]
uaIDList=BROWSER;IPDF;APABIMOBI;IMAGEVIEWER;SETUP; PROFILES;EBA;SHELL

to

[USER_APPLICATIONS]
uaIDList=BROWSER;IPDF;APABIMOBI;IMAGEVIEWER;SETUP; PROFILES;EBA;SHELL;FBREADER

Below


[EBA]
category=viewer
arguments=<FILENAME>
exec=/usr/bin/eba
xResourceName=eba
channel=14
extensions=eba;EBA


Add


[FBREADER]
category=viewer
arguments=<FILENAME>
exec=/mnt/cf/fbreader/FBReader
xResourceName=fbreader
channel=14
extensions=chm;CHM;rtf;RTF;fb2;FB2;pdb;PDB;tcr;TCR ;prc;PRC


Below


XEB=/usr/share/contentlister/Icon_books.png


Add


chm=/usr/share/contentlister/Icon_books.png
CHM=/usr/share/contentlister/Icon_books.png
rtf=/usr/share/contentlister/Icon_books.png
RTF=/usr/share/contentlister/Icon_books.png
fb2=/usr/share/contentlister/Icon_books.png
FB2=/usr/share/contentlister/Icon_books.png
pdb=/usr/share/contentlister/Icon_books.png
PDB=/usr/share/contentlister/Icon_books.png
tcr=/usr/share/contentlister/Icon_books.png
TCR=/usr/share/contentlister/Icon_books.png
prc=/usr/share/contentlister/Icon_newspapers.png
PRC=/usr/share/contentlister/Icon_newspapers.png


I've included a copy of my er_registry.txt in the zip file for comparison.

Hope you all like it. Below is a screenshot of it reading an RTF downloaded from ManyBooks.net

vranghel
03-14-2007, 02:35 PM
Looks promising, but there is still lots to be done to it.

Good luck, and keep up the good work :)

Adam B.
03-14-2007, 03:00 PM
Yeah, definitely a lot of work to do. Hence why I'm not releasing it yet. ;)

At this point, I'm probably going to need to spend some time in FBReader's newsgroups and site to learn the ins and outs of the program.

chamcham
03-14-2007, 03:04 PM
can you tell me how you ported FBReader to iLiad?
Maybe I can try porting some other apps to iLiad and have people test them.

Thanks.

Adam B.
03-14-2007, 03:16 PM
This article explains how to setup the tool chain: http://wiki.mobileread.com/wiki/Iliad_unofficial_toolchain

Other than that, it's just a matter of finding and downloading the needed dependencies. Some programs are easier to port than others.

Adam B.
03-14-2007, 09:07 PM
Even more progress (see attached).

Now comes the part where I may need some help.

1) Pagebar and buttons do nothing. They also cause the activity light to flash until the program is closed.
2) No option to close the program. I guess FBReader relies on the window manager to do it, but since we don't have a close button I don't know how to add this.
3) FBReader doesn't have the option that I can see to run from a dynamic location. The way I was able to get the icons and settings working, was because I made a symbolic link from /usr/local to /mnt/usb/fbreader. While this works for me, it's not practical for the average user.
4) I messed up my toolchain while testing. I'm using scratchbox. If anyone (*cough*Antartica*cough* ;)) has an up to date (2.9.1) toolchain, it would be great.

I may talk to FBReader developers to see if they can help. I'm sure they'd love to get a complete port to the iLiad.

Antartica
03-15-2007, 06:45 AM
Even more progress (see attached).

Excellent work, Adam!

Now comes the part where I may need some help.

1) Pagebar and buttons do nothing. They also cause the activity light to flash until the program is closed.

Hardware buttons only works if the application in registered to th X server as "sh". In gtk1.x this is done with

gtk_window_set_wmclass(GTK_WINDOW(my_main_window), "sh", "sh");

In Gtk2 there should be some equivalent method. Searching a bit in Goocle, it seems that the wmclass is an attribute of the window in Gtk2 (no especial method, just ask for the attribute of wmclass), but I have not found any code example.


As for the flashing, there is a bug in muy patch to libX11.so that doesn't turn off the led. It should, as it tourns it off the first time, but then the same code stop working. Maybe it's that I cannot reuse some variables from one call to the next... but as I don't have a lot of documentation about the usage of liberbusyd, it's by trial-and-error :-(.

2) No option to close the program. I guess FBReader relies on the window manager to do it, but since we don't have a close button I don't know how to add this.

You could try with "q" in the virtual keyboard. If fbreader behaves as the majority of UNIX apps, it should exit :-).

3) FBReader doesn't have the option that I can see to run from a dynamic location. The way I was able to get the icons and settings working, was because I made a symbolic link from /usr/local to /mnt/usb/fbreader. While this works for me, it's not practical for the average user.

In the configure, pass it something like "--datadir=./" and try if that works. If not, pass another string and replace it in the final executable with sed (yes, it's a hack, but it works. You should only replace strings with other strings of the same length, or you will corrupt the executable).

4) I messed up my toolchain while testing. I'm using scratchbox. If anyone (*cough*Antartica*cough* ;)) has an up to date (2.9.1) toolchain, it would be great.

Its a work in progress. I will post a new toolchain sometime, but I'm just starting with it :-).

I may talk to FBReader developers to see if they can help. I'm sure they'd love to get a complete port to the iLiad.

I agree :-).

nekokami
03-15-2007, 12:38 PM
This is brilliant. In one port you'll be meeting the needs of just about every format request I've seen for the iLiad. :D (I can't imagine why iRex didn't include this in the first place.)

Are you able to get the Vision Objects HWR to input to fields, or is the virtual keyboard the only option? Maybe that could be a later enhancement -- if I understand what iRex has said about the Vision Objects functions correctly, it should be possible to use that feature anywhere, but it may not be simple or automatic.

Adam B.
03-15-2007, 02:20 PM
The close button was a simple enough addtiion. It doesn't have an icon, but that's alright because the default "icon missing" icon is an X. Closing gracefully solved the problem of settings not being saved. All of the functions seem to be working as well. I'll have to research the GTK wmclass issue. And yes, handwriting recognition does work for fields.

Right now my biggest problem is getting libraries/versions straight. Sometimes the screen doesn't want to update by itself after selecting something. I'll have to tap again in a blank area to get it to update.

Overall though, I don't see why this shouldn't eventually be very useful on the iLiad.

Antartica
03-15-2007, 02:28 PM
The close button was a simple enough addtiion. It doesn't have an icon, but that's alright because the default "icon missing" icon is an X. Closing gracefully solved the problem of settings not being saved. All of the functions seem to be working as well. I'll have to research the GTK wmclass issue. And yes, handwriting recognition does work for fields.

The close icon is a very clean solution possible :-). Perfect.

Right now my biggest problem is getting libraries/versions straight. Sometimes the screen doesn't want to update by itself after selecting something. I'll have to tap again in a blank area to get it to update.

After executing fbreader, you should have a file named "iliad_refresh.conf". It contains the timeout for updating the screen after having detected some message passing betwen the program and the X server (that file is created by my patched version of libX11.so). Edit it to have a larger value (it's in milliseconds), and test if the problem disappears.

However, the larger that timeout is, there is more lag between doing some action in the UI and seeing the feedback in the screen.

Overall though, I don't see why this shouldn't eventually be very useful on the iLiad.

Joking, eh? It will be the dream of a lot of MRs come true ;-).

Good work.

Adam B.
03-15-2007, 03:04 PM
Joking, eh? It will be the dream of a lot of MRs come true ;-).


I agree, but I won't be happy until I can select a file (chm, rtf, etc) from the contentlister, and have it open up directly into FBReader. Maybe some iRex devs can implement those enhancements to the contentlister in the next version. ;)

Also, page turning is leaving behind a lot of ghosting since the screen isn't blanked when I move to the next page. I don't know if this will be solved by getting the hardware buttons working...

nekokami
03-15-2007, 03:32 PM
I think iRex is opting not to release the source of the content lister, IIRC, so someone may have to write a replacement. (Personally, I think that could only be an improvement.)

Adam B.
03-15-2007, 04:35 PM
I was able to get the pagebar working with the gtk_window_set_wmclass statement.

I've finally got it working to a point where it's ready for an (early) alpha release. It works, but there's still work to do.

Known Issues:
1) Symbolic link needs to be created at /usr/local. I thought I was able to change this with the make file, but I still have more testing to do.
2) Screen doesn't always update. When this happens, you will need to tap a blank area of the screen (I just tap the lower left most corner) to get it to update. This happens when the program initally loads, and some other places. iliad_refresh.comf had no effect on this.
3) Activity light continues to flash after pressing hardware button. I'll have to wait for Antartica to patch his libX11.so before this is fixed.

Typical Disclaimers Apply. Do not install this unless you know what you are doing. Working in the root filesystem is very dangerous!! Is is possible (though unlikely) to brick your iLiad. I take no responsibility if you do so. Install at your own risk.

http://adamrb.googlepages.com/fbreader.zip

To install:
1) Put the fbreader folder somewhere. It's 15MB, so a memory card would probably be best.
2) Make a symbolic link from /usr/local pointing to the directory where you put fbreader. EX: If you put the fbreader folder on your SD/MMC card, enter "ln -s /mnt/card/fbreader /usr/local"
3) Copy the .fbreader folder to your /home/root/ directory. This contains the settings to make files readable on the iLiad. You can change all of these in the options dialog.

CommanderROR
03-15-2007, 05:07 PM
GREAT work Adam B.

I'm looking forward to seeing this nearing final status. At the moment it's not for the likes of me yet, but once it's working (at least beta-status) and yokos (or somebody) makes an installer I'll be sure to try it.
The only problem now is that I'm not using my ILiad anymore, and with a great reading software becoming available it would be cool to go back, but it is just so much more convenient to use the STAReBOOK, and more than a new reading software would be required to bring me back to the Iliad...unfortunately. My girlfriend uses the Iliad from time to time, bu I guess she won't realkly see the benefit of having fbreader on it... ;)

Antartica
03-16-2007, 06:53 AM
I agree, but I won't be happy until I can select a file (chm, rtf, etc) from the contentlister, and have it open up directly into FBReader. Maybe some iRex devs can implement those enhancements to the contentlister in the next version. ;)

Yep. The could look up some file or directory in /mnt/free for handlers for other formats...

It can be done as simple as:

/mnt/free/handlers/chm/exec

And exec that script when that file type is detected.

Also, page turning is leaving behind a lot of ghosting since the screen isn't blanked when I move to the next page. I don't know if this will be solved by getting the hardware buttons working...

Again, edit the iliad_refresh.conf. Change the first word to "Full" and you should be set. Look at the iliad_refresh.conf of the dillo port ;-).

Adam B.
03-16-2007, 10:23 AM
I was able to get FBReader to open up files directly from the contentlister. See here (http://forum.irexnet.com/viewtopic.php?p=5255#5255) for instructions. The problem I have, is that when launching from contentlister, the hardware buttons stop working.

After changing iliad_refresh.conf to match the settings in dillo ;), the ghosting went away, but it still doesn't refresh correctly when the program starts. I may take Matthijs' advise and try to have FBReader update the screen itself without using the hacked libX11. I'm not sure what all is invloved in that, but it's worth a shot.

firekat
03-16-2007, 10:35 AM
This is all just so cool! Thanks for all the work guys!

Adam B.
03-16-2007, 04:14 PM
Updated! See first post. (http://www.mobileread.com/forums/showthread.php?t=10035)

Riocaz
03-16-2007, 04:55 PM
Adam, you do realise that you've just about made my decision for me in regards to whether or not I stick with the iLiad?

Adam B.
03-16-2007, 05:03 PM
:) Glad to hear it. I know this will be a critical piece of software for the iLiad. For those who need to, you can probably set this as default for handling txt and html files. I'm sure it will be a better reader than iRex's solution for those.

There's still work to be done, and I may be at the limits of what I can do. But I know there are others in this forum that are smarter than me.

NatCh
03-16-2007, 05:06 PM
Adam, you do realise that you've just about made my decision for me in regards to whether or not I stick with the iLiad?I'm guessing that this decision is somewhat contrary to the one you seem to have been leaning towards in your recent posts, then, Riocaz? http://www.sims99.com/forum/images/smilies/y_wink.gif

Riocaz
03-16-2007, 06:03 PM
Not really.

I still want iRex to acknoledge their obligations.

But this is a big step in the right direction.

nekokami
03-16-2007, 06:13 PM
Adam, I was digging around and found this in a discussion about porting editors:

About the keys: all iLiad hardkeys are mapped to normal keyboard keys.
The flipbar is PgUp and PgDn, the arrow up/down keys are Up and Down, the confirm key is Return, the UP key is Home. Long presses are different keys: F1 through F6.

So you might be able to trap the "Home" key to go back to the content lister.

CommanderROR
03-16-2007, 07:16 PM
This really makes me want to go back to the Iliad... ;)

Maybe somebody will get a similar feat done for the STAReBOOk but i'm not so sure since it's not really as "open" as the Iliad has now become...we'll see.

Now,I'd like to see an install script for this...YOKOS? so that I don't have to reformat the books my girlfriend reads on the Iliad to PDF...^^

Adam B.
03-16-2007, 07:33 PM
Adam, I was digging around and found this in a discussion about porting editors:

So you might be able to trap the "Home" key to go back to the content lister.

Good catch. I'll take a look at the code and options to see what I can do. :cool:

wallcraft
03-17-2007, 01:48 AM
The close button was a simple enough addtiion. It doesn't have an icon, but that's alright because the default "icon missing" icon is an X.
See the attached KDE Flat icons (http://www.kde-look.org/content/show.php/Flat?content=12132) (download the entire theme here (http://www.dannya.org/downloads/icons/flat1.0.tar.gz)), one of which might work for "close". The circle with vertical bar is often used for exit or window-close, although I'm not sure why, and an X is the other typical close icon. These are 32x32, which should be close enough to FBReader's 34x28 icons (if not there is always FlatSVG). Flat is released under the LGPL, so it can certainly be used here.

The standard FBReader icons look surprisingly good on the iLiad, but I also have a complete set of Flat-based icons for FBReader if you are interested.

NatCh
03-17-2007, 02:27 AM
That 'circle/bar' icon is a power symbol -- I mean it's used to mark power switches, not that it's some political or arcane symbol. :)

firekat
03-17-2007, 10:20 AM
I am watching from the sidelines right now hoping that someone will come up with a package for this.

A couple of questions; Will FBReader just take all sorts of html files without having to go through the manipulation of an xml file like you have to do with the iRex viewer? Will it display multiple pages, or does it have to be all one page? Will links and/or drop down select boxes work?

Another question is does FBReader have the option of inserting a line between paragraphs? I have noticed in the illustrations that it indents are the only thing differentiating paragraphs. ( I just visited the FBReader page - it appears that you can set different formatting parameters - does that function work in this porting?)

On a side note, though I have not tried the iRex companion software from what I see it does not have any availability of automatically formatting documents for best viewing on the iLiad. I was hoping that would be a possible function and it certainly would have made things much easier for the laity.

To all, keep up the good work!

NatCh
03-17-2007, 10:36 AM
I haven't used FBReader, so I can't speak to what it does or doesn't do (though I've heard good things about it), but there's a list of supported formats on it's homepage (http://only.mawhrin.net/fbreader/).

Main features: * Supported formats areo fb2 e-book format (style attributes are not supported yet).
o HTML format (tables are not supported).
o CHM format (tables are not supported).
o plucker format (embedded images are supported, tables are not supported).
o Palmdoc (aportis doc).
o zTxt (Weasel format).
o TCR (psion text) format.
o RTF format (stylesheets and tables are not supported).
o OEB format (css and tables are not supported).
o OpenReader format (css and tables are not supported).
o Non-DRM'ed mobipocket format (tables are not supported).
o Plain text format.
* Direct reading from tar, zip, gzip and bzip2 archives. (Multiple books in one archive are supported.)
* Supported encodings: utf-8, us-ascii, windows-1251, windows-1252, koi8-r, ibm866, iso-8859-*, Big5, GBK. Automatic encoding detection is supported.
* Automatically generated contents table.
* Embedded images support.
* Footnotes/hyperlinks support.
* Position indicator.
* Keeps the last open book and the last read positions for all opened books between runs.
* List of last opened books.
* Automatic hyphenations. Liang's algorithm is used. The same algorithm is used in TeX, and TeX hyphenation patterns are used in FBReader. Patterns for Czech, English, Esperanto, French, German and Russian are included in the current version.
* Text search.
* Full-screen mode.
* Screen rotation by 90, 180 and 270 degrees.

Features, planned for future versions: * Dictionary integration.
* Automatic scrolling.
* Bookmarks.
* Tables support.
* Support for other e-book formats.

They also have a link for a list of requests (http://only.mawhrin.net/fbreader/more/requests.php) that have been submitted. :nice:

wallcraft
03-17-2007, 12:21 PM
A couple of questions; Will FBReader just take all sorts of html files without having to go through the manipulation of an xml file like you have to do with the iRex viewer? Will it display multiple pages, or does it have to be all one page? Will links and/or drop down select boxes work? The just released version 0.8.0 of FBReader also runs under Windows XP, so you can try it out if you have a XP (or Linux) Desktop. I assume the iLiad port is of version 7, and I would not reccomend upgrading to version 8 yet (because it is brand new).

FBReader does handle multi-file HTML documents, but all the files have to be local (typically in one directory, or one zip file). I almost always convert HTML to Plucker, which means I get one file and essentially a simplified HTML layout (still with links). The notes on version 8 says it will now invoke an external browser for non-local links. Note that it does not handle tables in any file format.

For screenshots of FBReader on a PepperPad, see the MobiPocket Java Reader on Pepper Pad 3 (http://www.mobileread.com/forums/showthread.php?t=9552) thread. These include shots from a set of HTML's in a zip file. As the title suggests, I was originally posting about the Mobipocket reader - but I ended up saying more about FBReader. I certainly did not think then that FBReader would be available on the iLiad before Mobipocket.

wallcraft
03-17-2007, 02:51 PM
Maybe somebody will get a similar feat done for the STAReBOOk but i'm not so sure since it's not really as "open" as the Iliad has now become...we'll see. FBReader needs GTK+ (>2.4) or Qt 3*, and it has only been ported to devices with either a touch screen or a mouse. I don't know how hard it would be to port to a device that only had hardware keys for navigation. On the other hand, NAEB (Baen's Bar) want to have FBReader on Bookeen's e-book reader (same hardware of the STAReBOOK).

nekokami
03-17-2007, 10:22 PM
I suppose if FBReader has some kind of assistive mode, as many windowing applications do, to allow keyboard control, it might be possible to implement it using the buttons on the STAReBOOK. Without that already implemented, it will be a tough job to port. I imagine the interface could be rewritten to use arrow keys, etc., but that would be non-trivial. This is one of the resons I'm not very interested in the NAEB project.

wallcraft
03-18-2007, 01:49 AM
I suppose if FBReader has some kind of assistive mode, as many windowing applications do, to allow keyboard control, it might be possible to implement it using the buttons on the STAReBOOK. Without that already implemented, it will be a tough job to port. I imagine the interface could be rewritten to use arrow keys, etc., but that would be non-trivial. This is one of the resons I'm not very interested in the NAEB project. FBReader can map keys to tasks, but this is customized via the setting menu and in general I don't think it is possible to work mouse/stylus free.

On the other hand, if a device like the STAReBOOK has X11 (or, say, GTK+ without X11), then it needs some replacement for the mouse. So, assistive technology should be at the GTK+ level.

It is interesting that cell phones, PDA's, UMPC's all have screen navigatation based interfaces, but dedicated e-book readers do not. This might just be an anomaly of a new display technology, but it might also be a function of single application devices. On the other hand, the eBookWise eb-1150 has a touch screen.

wallcraft
03-18-2007, 02:04 AM
Another question is does FBReader have the option of inserting a line between paragraphs? I have noticed in the illustrations that it indents are the only thing differentiating paragraphs. ( I just visited the FBReader page - it appears that you can set different formatting parameters - does that function work in this porting?) FBReader is extensively customizable, including formating. The default for paragraphs is a 1st line indent , but you can also set: spacing before, spacing after, line spacing, alignment, left indent, right indent (and 1st line indent). There are similar options for a long list of other text sections.

The advantage of porting an application like FBReader is that you get a very rich feature set, and almost everything should work once the basic functionality works. I would be very surprised if formating options failed to work on the iLiad, and if they did the FBReader developers can probably quickly fix the problem.

bojan
03-18-2007, 11:59 AM
Is there a way to read a topic with all of it subtopics in a continous mode - not having to use the TOC all the time for selecting next heading/subtopic? I find it very annoying to read whole topics in this way.

Adam B.
03-18-2007, 02:09 PM
Is there a way to read a topic with all of it subtopics in a continous mode - not having to use the TOC all the time for selecting next heading/subtopic? I find it very annoying to read whole topics in this way.

Not as far as I know. I agree, using the TOC can get quite annoying.

I've started work on .0.8. I've got it compiled and running, but the files created are quite large (24mb for the executable and library alone). I'm not sure if something changed with my tool chain, or if it's a difference with the new version. I'll keep you guys posted. :cool:

wallcraft
03-18-2007, 02:44 PM
Is there a way to read a topic with all of it subtopics in a continous mode - not having to use the TOC all the time for selecting next heading/subtopic? Support for CHM is relatively new in FBReader. I see that Microsoft's own reader requires you to access the TOC (with the mouse, or with arrow and enter keys) to advance, but it is on the screen and so this is much easier than in FBReader.

I suggest you ask at FBReader's Google Group (http://groups.google.com/group/fbreader). Without knowing what programming would be required, it seems that the actions "last section" and "next section" would be useful for any document with a table of contents. You would then bind these actions to keys. Or there might be other ways for the FBReader developers to improve CHM reading.

bojan
03-18-2007, 06:13 PM
I see that Microsoft's own reader requires you to access the TOC (with the mouse, or with arrow and enter keys) to advance, but it is on the screen and so this is much easier than in FBReader.

This is why I installed FBReader on my Windows XP, hoping to use it instead of built in reader :) . I think I will try to look at the sources, and see if there is a way to modify this.


it seems that the actions "last section" and "next section" would be useful for any document with a table of contents

I agree, "next section" with TOC is a must for me. I will also try to post in their group.
Thanks!

mtas
03-19-2007, 04:26 AM
This really makes me want to go back to the Iliad... ;)

Maybe somebody will get a similar feat done for the STAReBOOk but i'm not so sure since it's not really as "open" as the Iliad has now become...we'll see.

Now,I'd like to see an install script for this...YOKOS? so that I don't have to reformat the books my girlfriend reads on the Iliad to PDF...^^I'm on to it. This one is a little more complex to do in a "safe" way, especially if you want it to be the default reader for some formats.

That said, what formats do you want me register with this application?

CommanderROR
03-19-2007, 05:24 AM
Well, if you ask me, then just everything apart from PDF... ;)

The iRex HTML and .txt viewers are still too uncomplete for my taste, and since i'm planning on using mainly htm and rtf files it would be handy to have them open automatically in fbreader.

Adam B.
03-19-2007, 09:25 AM
I haven't tested HTML files on the iLiad in FBReader. Does anyone have a good example file?

Adam B.
03-19-2007, 09:27 AM
I'm on to it. This one is a little more complex to do in a "safe" way, especially if you want it to be the default reader for some formats.

That said, what formats do you want me register with this application?

I agree, it could be quite difficult to do the necessary changes to the er_registry file. I haven't even checked to see if we have sed on the iLiad...

Edit: Looks like we do. That should make things a bit easier.

Adam B.
03-19-2007, 10:28 AM
Attached: FBReader .8 reading the zText format from manybooks. I haven't released it yet because there are some screen refresh and file size issues I need to work out.

narve
03-19-2007, 03:28 PM
I'm on to it. This one is a little more complex to do in a "safe" way, especially if you want it to be the default reader for some formats.

That said, what formats do you want me register with this application?
Everything except pdf? At least html and txt!

wallcraft
03-20-2007, 02:45 AM
I haven't tested HTML files on the iLiad in FBReader. Does anyone have a good example file? For testing FBReader and Mobipocket on the PepperPad, I used Project Gutenberg's The Illustrated London Reading Book (http://www.gutenberg.org/etext/11921). With figures, this is 6.7 MB compressed. You can leave it in the .zip file for FBReader. For MobiPocket the HTML has to be converted to a .prc file, and for FBReader I would typically run it through Sunrise XP to make a plucker file (with size-optimized figures) but the original HTML is good for testing. Note that it is a single HTML file with lots of images. With version 0.8.0, it shows that the section/chapter marks in the position indicator may not work well when there are many sections.

narve
03-30-2007, 06:41 PM
I finally got around to try to run FBReader on my iLiad. I've really had troubles with my iLiad lately, and it turned out my MMC card FS was messed up. (This has happened before, I try now to be extremely careful about mounting/unmounting etc, hopefully it will not happen again).

Anyway, FBReader didn't work. And the error message is (of course): Segmentation fault. (Main reason why I don't like programming in C...).

When I run it the first time, all the other things that should be done (moving manifest files, settings etc) seemed to work ok. When I start FBReader from the iLiad, it goes back to the content lister after about 4 seconds. When I start FBReader from my shell, it gives me seg fault.

So, any ideas? Probably not, but any common errors or anything I can do to get some clue to what the problem is?

narve
03-30-2007, 06:56 PM
I have an idea...

First: Did any Windows users get this to work? If so, how did they transfer the files?

I used wget (on the iliad) to get the file, but unzip didn't work (unknown compression method '0'?). Then I used unzip on my (windows) computer to unzip it and repackage it as a tar.gz, which I transferred to the iliad and unpacked. But then the text files (xml config files) seems to be in dos-format. That could be the cause. I also tried copying the files from my computer using my card reader but of course that will cause the same problem with text files.

So I will try to unzip and repackage on another linux computer, and then try everything again...

narve
03-30-2007, 07:11 PM
Damnation! When I tried to untar my repackaged zip file my shell just hangs. I can open new shells, but I can't access /media/card. Reboot doesn't work, gotta use the reset button. And 'ls' in my fbread folder hangs as well. So the entire filesystem is messed up again??

Seems like a problem with my MMC card, perhaps?

Anyways, I guess I'll just stick with PDF books for a while, perhaps buy a CF card that is confirmed to work properly. Luckily I have enough books for the easter holiday :S

henkvdg
03-31-2007, 05:22 AM
I have an idea...

First: Did any Windows users get this to work? If so, how did they transfer the files?

I used wget (on the iliad) to get the file, but unzip didn't work (unknown compression method '0'?). Then I used unzip on my (windows) computer to unzip it and repackage it as a tar.gz, which I transferred to the iliad and unpacked. But then the text files (xml config files) seems to be in dos-format. That could be the cause. I also tried copying the files from my computer using my card reader but of course that will cause the same problem with text files.

So I will try to unzip and repackage on another linux computer, and then try everything again...

I use 7zip on my Windows computer and save the result in a file on it, or directly in the root of my SD card via the multicardreader/writer on the PC. Then it works.

wallcraft
04-04-2007, 11:26 PM
Is there a way to read a topic with all of it subtopics in a continous mode - not having to use the TOC all the time for selecting next heading/subtopic? I find it very annoying to read whole topics in this way. Version 0.8.1c has "Go To Next/Previous Toc Section" actions. By default these are mapped to <ctrl> right/left arrow, but they can be mapped to other keys (either by changing the iLiad defaults, or via the keys tab in the settings). These actions are essential for CHM files, but are also useful for other book formats with a TOC.

I have tried both gnochm and kchmviewer on my Pepper Pad, and FBReader is stil my favorite for CHM files. Having the TOC on-screen all the time can be convenient, but it takes up too much screen real estate.

Adam B.
04-05-2007, 04:24 PM
It's odd. When I compile it for the iLiad, I don't have a keys tab in the settings. Is it because I'm using the desktop profile for compiling? Maybe I should try a different one...

joblack
04-05-2007, 04:33 PM
what is the FBReader anyway .. havenīt read of it yet ...

wallcraft
04-05-2007, 11:12 PM
It's odd. When I compile it for the iLiad, I don't have a keys tab in the settings. Is it because I'm using the desktop profile for compiling? Maybe I should try a different one... The Pepper Pad version is exactly the same as Desktop build. See the attached screenshot that shows all the settings tabs on the Pepper Pad.

Adam B.
04-05-2007, 11:19 PM
Hmmm....Comparing your screenshot to mine:

http://www.mobileread.com/forums/attachment.php?attachmentid=2939

Looks like my options screen is cut off after colors with no way to scroll to the next tabs. Colors aren't much use on the iLiad, I'm sure I can remove that tab somewhere in the code.

wallcraft
04-05-2007, 11:19 PM
what is the FBReader anyway .. havenīt read of it yet It is Open Source e-book reader software for Linux (and now Windows) devices. See FBReader's web page (http://only.mawhrin.net/fbreader/).

FBReader reads a wide range of non-DRM reflowable e-book formats, and is highly customizable.

wallcraft
04-05-2007, 11:38 PM
Looks like my options screen is cut off after colors with no way to scroll to the next tabs. Colors aren't much use on the iLiad, I'm sure I can remove that tab somewhere in the code. Under Windows, the tabs are in two rows (see attached). The "Web" tab is new with version 0.8.X, but the "Keys" tab has always been there and is very useful for customizing the available keys based on how you use the reader. Note that for scrolling options you may need the scrolling tab (to choose how to scroll) and the keys tab (to associate a key with a scrolling action).

narve
04-08-2007, 03:58 PM
I use 7zip on my Windows computer and save the result in a file on it, or directly in the root of my SD card via the multicardreader/writer on the PC. Then it works.

I doesn't work for me... :(

Did you format the card on windows? And do you have 32-bit or 64-bit? I have 64-bit, of course it shouldn't matter but...

Can you tell me the brand of your SD card? I am going to try a new SD/MMC/CF card, and I will buy something that people have had success with (but as large as possible).

narve
04-08-2007, 07:07 PM
Damn I really want this to work! After YET another reformat all the files seems to be where they should be, and the card is properly recognized (no more sudden switches to read-only mounts. I think I used FAT previosly, "for maximum portability", this time I checked the FAQ and used FAT32).

But now I get this error:

./FBReader: error while loading shared libraries: unexpected PLT reloc type 0x00
r

(If I start it from the iLiad I get a few seconds of blinking green lights and then back to the content lister)

Does anybody know what this means?

Edit: After a reboot, I get this error:


root@ereader:/media/card/fbread# export DISPLAY=:0
root@ereader:/media/card/fbread# export LD_LIBRARY_PATH=/media/card/fbread/lib
root@ereader:/media/card/fbread# ./FBReader
Illegal instruction
root@ereader:/media/card/fbread#

VillageReader
04-09-2007, 07:09 AM
So far at least I'm in the 'doesn't work' camp. I downloaded the sh hack Friday, tried the FBRead folder that I had previously to the CF card, and nothing happened. Using a flavor of Windows XP.

henkvdg
04-09-2007, 07:17 AM
I doesn't work for me... :(

Did you format the card on windows? And do you have 32-bit or 64-bit? I have 64-bit, of course it shouldn't matter but...

Can you tell me the brand of your SD card? I am going to try a new SD/MMC/CF card, and I will buy something that people have had success with (but as large as possible).

It seems that the largest SD card you can use is 1GB ! My brand is Kingston.
Just format it as FAT
First try if you can put a PDF on it and read it with the iLiad

CommanderROR
04-09-2007, 08:45 AM
I could use fbreader without problem (apart from the fact that it still has quite a few bugs and rough edges).

I'm running Vista Ultimate 64bit, I gues you can't get much more incompatible these days but it did not cause any problems.
I'm using a 1GB SD card, a Sandisk in the Iliad.

narve
04-09-2007, 12:11 PM
It seems that the largest SD card you can use is 1GB ! My brand is Kingston.
Just format it as FAT
First try if you can put a PDF on it and read it with the iLiad
The wiki on memory cards said FAT32, so I used that the last time, instead of FAT. My card is MMCPlus (which is unsupported, but MMCPlus <= 1GB should be backwards compatible with MMC so it should work...), and this time around I haven't had any major problems except that I sometimes have to mount it manually (using "mount /dev/mmc1 /mnt/card"). So for that reason dropbear and my wlan profile script is stored on the main memory.

The card works for everything else, documents, other applications etc. It is just FBReader that I can't get to work (and the MP3 daemon).

narve
04-09-2007, 12:15 PM
I could use fbreader without problem (apart from the fact that it still has quite a few bugs and rough edges).

I'm running Vista Ultimate 64bit, I gues you can't get much more incompatible these days but it did not cause any problems.
I'm using a 1GB SD card, a Sandisk in the Iliad.
I guess you are more incompatible than me, so there is probably some other reason...

First error: ./FBReader: error while loading shared libraries: unexpected PLT reloc type 0x00r

Second error: Illegal instruction
Does this give any information?

Adam B.
04-09-2007, 03:08 PM
That is odd....sounds like some file corruption problems. Do you have a different memory card you can try? Have you tried to copy it to the internal memory and run it from there?

I'm attempting to port version .8, but I've run into some issues.

I'm still unable to get the screen refresh working as I expect it. I'm attempting to get it going with the standard libX11 library. The problem is that the screen is either refreshing too often, or not enough. I think that most of my problem stems from the screen updating before the updated window is painted. I may have to set a wait in there to give the screen time to refresh.

The hardware buttons have also stopped working with the new version of FBReader. I've set gtk_window_set_wmclass(GTK_WINDOW(myMainWindow), "sh",
"sh"); the same way I had in the .7 version, but it is no longer working. Hopefully I can get these issue resolved and release a good, working version of the software that is ready for mass consumption.

narve
04-09-2007, 03:59 PM
That is odd....sounds like some file corruption problems. Do you have a different memory card you can try? Have you tried to copy it to the internal memory and run it from there?


Originally it (probably) was file corruption problems. But the last times it didn't seem like there were any file corruption. Lastly I tried copying the files using the windows explorer onto the main memory (/mnt/free/newspapers) and run fbreader from there:

root@ereader:/mnt/free/newspapers/fbread# ./FBReader
Illegal instruction

(After setting LD_LIBRARY_PATH correctly, and moving settings to /home/root etc)

By the way, what is the difference between the mmc version and the cf version? Are there hardcoded file/directory references? Is this related to the "fbread must be in the root folder" requirement? And could FBReader then possibly work from main memory the way I did it? (I used the MMC-zip for this).

Adam B.
04-09-2007, 04:09 PM
FBReader only allows the installed path to be set at compile time. If you have it it any directory other than the one it was compiled for, the graphics will not load properly. It shouldn't prevent the program from running.

Try the first part (all but step 4) of the instructions here: http://wiki.mobileread.com/wiki/ILiad_FBReader#Native_Installation

Copy the fbreader directory to your /mnt/newspapers. Then run: "ln -s /mnt/free/newspapers/fbreader /usr/local"

You shouldn't have to export the LD_Library_path. Just set the display and run FBReader. Let me know what happens. :thumbsup:

narve
04-09-2007, 04:37 PM
FBReader only allows the installed path to be set at compile time. If you have it it any directory other than the one it was compiled for, the graphics will not load properly. It shouldn't prevent the program from running.

Try the first part (all but step 4) of the instructions here: http://wiki.mobileread.com/wiki/ILiad_FBReader#Native_Installation

Copy the fbreader directory to your /mnt/newspapers. Then run: "ln -s /mnt/free/newspapers/fbreader /usr/local"

You shouldn't have to export the LD_Library_path. Just set the display and run FBReader. Let me know what happens. :thumbsup:

First: Isn't it extremely ... ahem... "uncommon" to hardcode the installation path into the binaries? Why do the FBReader programmers do that? But I am unused to C++/Linux programming, so I guess there is a reason. But what is the hardcoded compile-time installation path -- /usr/local/fbreader I presume?

Second: I didn't copy the files again, I already had the binaries and libs from my mmc-zip. Are the binaries different, so I have to download the other zip and use that one, or should that be ok?

Third: My files are in /mnt/free/newspapers/fbread. I tried this:

root@ereader:/mnt/free/newspapers/fbread# ls -lF /usr/local
lrwxrwxrwx 1 root root 27 Apr 9 19:28 fbread -> /mnt/free/newspapers/fbread/
lrwxrwxrwx 1 root root 27 Apr 9 19:33 fbreader -> /mnt/free/newspapers/fbread/

root@ereader:/mnt/free/newspapers/fbread# set |grep DISPLAY
DISPLAY=':0'
root@ereader:/mnt/free/newspapers/fbread# ./FBReader
Illegal instruction
root@ereader:/mnt/free/newspapers/fbread#

Did this posting give you any more information?

Adam B.
04-09-2007, 04:46 PM
Download the files again. Use this link: http://projects.mobileread.com/iliad/projects/fbreader/fbreader.zip It is a different binary.

As far as hard coding, most programs are compiled to run from /usr/ or /usr/local/. It doesn't so much matter for the executable file, but the other files that it depends on. FBReader looks for it's graphics in /usr/local/share by default. /usr/local will need to point to /mnt/free/newspapers/fbreader, not a directory within local. There is no /usr/local in the iLiad by default, so this won't cause a problem.

narve
04-09-2007, 04:52 PM
Download the files again. Use this link: http://projects.mobileread.com/iliad/projects/fbreader/fbreader.zip It is a different binary.

Already on it (no patience today), but the copying takes some time... I think the iLiad is a bit overworked perhaps :S


As far as hard coding, most programs are compiled to run from /usr/ or /usr/local/. It doesn't so much matter for the executable file, but the other files that it depends on. FBReader looks for it's graphics is /usr/local/share by default. /usr/local will need to point to /mnt/free/newspapers/fbreader, not a directory within local. There is no /usr/local in the iLiad by default, so this won't cause a problem.
This seems like a sub-optimal solution. What if I have another program with the same "problem"? Why don't we instead create a "local" dir and then a "share" dir in that one, and then symlink to the directory/ies that FBReader need(s)? And I still don't see the need for different binaries, as symlinking should resolve that need?

Anyway, will try the new binaries when my iLiad wants to talk to me again. The copying is going nowhere, fast, and a see a click on the reset button looming in the horizon... :(

Adam B.
04-09-2007, 05:01 PM
Agreed. For .8, I'll change that.

I've setup seperate binaries so for those who don't want to touch their root file system. Once an unbricking option is available, I may change the way I build apps since there will be no danger of breaking anything permanantly.

narve
04-09-2007, 05:08 PM
Agreed. For .8, I'll change that.

I've setup seperate binaries so for those who don't want to touch their root file system. Once an unbricking option is available, I may change the way I build apps since there will be no danger of breaking anything permanantly.
Aha, when you said "root file system" I thought you only referred to the "registry" settings, but you (also) referred to /usr/local. Now it all becomes clear to me :)

A possible (minor) problem with the different symlink scheme is that they may be removed in the next iRex update. But living on the cutting edige is never easy:)

I am still waiting for the iLiad to recover. I am a bit afraid of just disconnecting it physically (file corruption...)... I don't know how to cleanly umount (or whatever the correct verb is) a USB connection from the iLiad, and the windows "Safely remove hardware" wizard doesn't allow me to stop the drive... :(

Adam B.
04-10-2007, 10:41 AM
So how did it go?


I've setup FBReader .8.1d. It includes


* Opening of external http/ftp/mail links in external browser has been added. (should work with dillo)
* OpenReader book format has been supported.
* New encodings (Vietnamese, Korean, MacRoman, etc.) has been supported.
* Time and position text on indicator
* FBReader reads multi-body fb2 documents.
* Added "Go To Next/Previous Toc Section" actions. (Next Section Via Button on Toolbar. Should be setup to use up/down hardware buttons as well)
* Should Close with Upper Left (Home) Hardware Button
* Better screen refreshes


I finished it this morning, but unfortunately, I forgot my iLiad at home. If anyone with a compact flash card wants to test and let me know, it would be appreciated. It works great in my development area.

If the screen refresh does not work as expected, delete libX11.so.6 and rename libX11.so.6.hacked to libX11.so.6.

http://projects.mobileread.com/iliad/projects/fbreader/fbread8cf.tar.bz2

nekokami
04-10-2007, 03:31 PM
I have CF and would like to test. I'm still waiting on the shell hack from iRex, however. :(

narve
04-10-2007, 04:51 PM
So how did it go?

I just plugged my iLiad to the USB cable and was told that the internal memory had been formatted (by the companion software). But I know from SSH that it is still working... so my conclusion is: I will never use the USB connection again! So I will try to setup dropbear so that SCP works, and then I will try again.

ericshliao
12-29-2008, 12:49 PM
Hardware buttons only works if the application in registered to th X server as "sh". In gtk1.x this is done with

gtk_window_set_wmclass(GTK_WINDOW(my_main_window), "sh", "sh");


What's the difference between "gtk_window_set_title() " and "gtk_window_set_wmclass()"?
According to info provided in iRex Forum, iRex used gtk_window_set_title() in their app.
I have a strange problem now. I used the two lines independently in FBReader code,
gtk_window_set_title(GTK_WINDOW(myMainWindow), "fbreader");
gtk_window_set_wmclass(GTK_WINDOW(myMainWindow), "sh", "sh");

And I have modified registry.xml with (for each case)
<xResourceName>fbreader</xResourceName>
<xResourceName>sh</xResourceName>

The result is only the case of gtk_window_set_wmclass() works. FBreader can get flipbar event in the case.

When I test the two case with my homebrew image viewer, both case work.

Now that I am trying to make djview4 (based on QT) work with flipbar, I found that setWindowTitle() (a QT function to set window title) doesn't work, either.

I might have to read source code of contetlister to understand how does CL do the job.