Hi,
I just comile fbreader 0.10.2 for iliad, with the adam's vm, and other people' experience, now it's running on my iliad, currently I change toolbar icon with my own habbit, replace undo/redo with nextpage/previouspage, and findprevious/findnext with nextTOCsection/previousTOCsection, and help with exit, I just ensure the card version working on my SD card, the cf for cf card version doesn't try, and because the icon work perfect, so I don't concern with the hardware key.
you just download the package, and unrar to your SD/CF card root and name it fbreader, and change the permission with 755, you can got it running within contentlist, for people who want to direct open file with extension, maybe you will need modify registry, For now, I don't know how to do it with script to create a package, anybody want to help me do it?
Just give it a try, though something maybe not so comfortable.
Good luck.
Mike
Hi all,
For those who are not professional programmer also, here is what I do when I compile ipdf&fbreader for my iliad:
1. download adam.B virtual machine, then official SDK from:
http://developer.irexnet.com/pub/iLi...091648.tar.bz2
2.use putty login debian, and use command (ifconfig) to find out what the IP address for your vm(it's depend on what's the network setting on your vmware), then change it according to your need on file /etc/network/interfaces
3.use winscp to copy the SDK to vm /tmp directory, command (su - developer) to become the only user can run scratchbox, then use command (scratchbox) then choose select->iliad-dev to enter into developer environment
4.setup the PKG_CONFIG_PATH to your login shell with (vi .bash_profile) and add one line:
export PKG_CONFIG_PATH=/usr/local/arm/oe/arm-linux/lib/pkgconfig
5.tar -xvf oe-sdk-20071004091648.tar.bz2 to root directory.
6.you can compile the ipdf&fbreader now, caution:all the file I download to vm tmp directory, and all these files will be wipe out after restart.
7.ipdf compile example:
cd /tmp
tar xvf fullscreen-1.0a1-svn25.tar.bz2
cd trunk-new/
./autogen.sh
and following one line is very important, when configure script generate the make file, it will insert the predefined LD_LIBRARY_PATH for you, but when you compile, must export this variable to the compile path:
export LD_LIBRARY_PATH=/usr/local/arm/oe/arm-linux/lib
make
then you will find ipdf in src directory, if you like you can use command (strip) to strip out the debug symbol and therefore reduce the binary size much smaller.
for the fbreader the compile is another long long story, if you have patient, you can read below:
at the very first I was very exciting that I can compile ipdf and produce my first touch version ipdf as I want, then I think I can compile fbreader, though I know it's difficult, but never think I need so long time to finish it(almost one month), I list the problem below:
1. I want to set up another platform according to the /fbreader-0.10.2/makefiles/target.mk, but soon I know I can't finish that, so I tried with this config
TARGET_ARCH = desktop
UI_TYPE = gtk
and quickly I find I missing lib for expat, libcurl,libz,libbz2,liblinebreak,libfribidi, all these lib described in file README.build at the root directory of the source ocode f the fbreader. it's time to download these lib and compile one by one.
2. I can compile the fbreader, but don't know where the binary have been put, so I open every file under the makefiles, several file worth mention:
config.mk the fbreader zlibrary compile include lib path and compile flag
target.mk what's platform and the release/debug version for your target platform
desktop.mk the UI gtk incude lib path and the install dir for the target
ok, change desktop.mk INSTALLDIR=/usr/local to INSTALLDIR=/tmp I got the binary version of fbreader,it's cool, but soon I be sad, it won't running both on vmware(irex-iliad) and iliad, what's wrong? I search a lot on mobileread forum, and got many useful info to drive me go on:
https://www.mobileread.com/forums/showthread.php?t=10035
this thread let me know I must insert some code into the fbreader source to let the pageflip bar respond to fbreader, much later I use adam.B's diff file for 0.8.2b, that patch to fbreader to compile for iliad.
https://www.mobileread.com/forums/showthread.php?t=33369
this thread let me know how to add one line code to produce which library are missing when run fbreader, so I copy the code to the corresponding position to get the missing lib name:
libfribidi.so.0
libexpat.so.1
libcurl.so.4
libpng.so.3
ok, time to test, yeah! it's running on vmware(iliad-irex), happy never last for long time, when I copy it to iliad, nothing happen except led blink serveral second.
What's wrong? I try to copy the who /usr/local/lib that locate in iliad-dev environment to fbreader/lib and put onto iliad simulate the test environment, and install adam.B's 0.8.4fbreader and override all the file with the one I compiled, still nothing happen, I almost give up, because I'm not a programmer, I just read a little of programming book as interest, never writing code. I think I can do something for my iliad this thought still drive me going on. Then, I want to know where's the problem, gdb give me some hope, I looking for how gdb work, but it's too complex and difficult to learn quickly, anyway, try it, at the beginning, I meet a big problem, gdb doesn't run fbreader on iliad-dev environment, why? search a lot, the answer is: the debug only can be on the target running gdbserver, and network connect or serial connect to host to debug, now time to compile gdbserver, fortunately the gdbserver inside gdb 6.1 compiled without problem, but when I put it on iliad, and use command gdbserver :7000 FBReader and run command (gdb), then command (target remote ip-address:7000 FBReader), I can run and can see the source code when I type break 3, but it won't display zlibrary function's source code, why? finally, I put the fbreader and fbreader source code in the same directory both vmware and iliad, then on gdb, type (add-symbol-file the path to include the libzlcore.so.0.10&libzltext.so.0.10) that fbreader depends on, and type (set debug-file-directory) to include the source code directory, ok I can step by step running the fbreader on iliad, finally I see where is the problem, when it running, it always to find the path defined in desktop.mk INSTALLDIR=/tmp, the path that test on vmware, so I change it to /media/card/fbreader, recompile, it just as same as before:led blink several second nothing happen, debug again, this time I see endless loop on process some file fbreader/share/FBReader/formats/fb2 directory, I change the name of fb2genres.xml to another one because I saw some special character in this file, ok this time fbreader are display on my iliad, but without any response with pageflip bar and doesn't refresh any time, when I touch on some icon on the toolbar and press the home key, the screen do changed, I know this is a running version of fbreader for my iliad.
it's time to insert the diff file line by line to the source code with adam.B patch for 0.8.2b version to respond to the hardware key, the code I used as below:
diff -r fbreader-0.8.2b/zlibrary/src/gtk/application-desktop/
ZLGtkApplicationWindow.cpp fbreaderiliad/zlibrary/src/gtk/application-
desktop/ZLGtkApplicationWindow.cpp
65a66,67
> gtk_window_set_title(GTK_WINDOW(myMainWindow), "sh");
> gtk_window_set_wmclass(GTK_WINDOW(myMainWindow), "sh", "sh");
diff -r fbreader-0.8.2b/zlibrary/src/gtk/application-desktop/
ZLGtkApplicationWindow.h fbreaderiliad/zlibrary/src/gtk/application-
desktop/ZLGtkApplicationWindow.h
52c52
< void setCaption(const std::string &caption)
{ gtk_window_set_title (myMainWindow, caption.c_str ()); }
---
> void setCaption(const std::string &caption) { gtk_window_set_title (myMainWindow, "sh"); }
diff -r fbreader-0.8.2b/zlibrary/src/gtk/view-desktop/
ZLGtkViewWidget.cpp fbreaderiliad/zlibrary/src/gtk/view-desktop/
ZLGtkViewWidget.cpp
24c24,25
<
---
> #include <liberdm/erdm.h>
> #include <liberipc/eripcbusyd.h>
26a28,30
> erClientChannel_t erbusyChannel;
> erClientChannel_t ertoolbarChannel;
92a97,101
> // Turn off busy LED if we were invoked via [SHELL]
> erIpcStartClient(ER_BUSYD_CHANNEL, &erbusyChannel);
> busySetBusy(erbusyChannel, ccBusyState_Off);
> dmDisplay(dmCmdPriorNormal, dmQFull);
after this time of compile, fbreader are running on my iliad, but the display alway not satisfied, so I remove the last line dmDisplay(dmCmdPriorNormal, dmQFull); from source code and use xepdmgr to control the refresh issue, now I have a functional fbreader, but the key still not function properly as defined by the option.xml used by adam.B, I don't know how to change it, but I have another way to meet my needs, I use the icon inside the /fbreader/share/pixmaps/FBReader/ directory, and put some icon into it, and rename it the action defined in source code fbreader-0.10.2/fbreader/src/fbreader/FBReaderActionCode.cpp:
const std::string ActionCode::SHOW_READING = "showReading";
const std::string ActionCode::SHOW_COLLECTION = "showLibrary";
const std::string ActionCode::SHOW_NET_LIBRARY = "showNetLibrary";
const std::string ActionCode::SHOW_OPTIONS = "preferences";
const std::string ActionCode::UNDO = "undo";
const std::string ActionCode::REDO = "redo";
const std::string ActionCode::SHOW_CONTENTS = "toc";
const std::string ActionCode::SEARCH = "search";
const std::string ActionCode::FIND_PREVIOUS = "findPrevious";
const std::string ActionCode::FIND_NEXT = "findNext";
const std::string ActionCode::LARGE_SCROLL_FORWARD = "largeScrollForward";
const std::string ActionCode::LARGE_SCROLL_BACKWARD = "largeScrollBackward";
const std::string ActionCode::SMALL_SCROLL_FORWARD = "smallScrollForward";
const std::string ActionCode::SMALL_SCROLL_BACKWARD = "smallScrollBackward";
const std::string ActionCode::MOUSE_SCROLL_FORWARD = "mouseScrollForward";
const std::string ActionCode::MOUSE_SCROLL_BACKWARD = "mouseScrollBackward";
const std::string ActionCode::TAP_SCROLL_FORWARD = "tapScrollForward";
const std::string ActionCode::TAP_SCROLL_BACKWARD = "tapScrollBackward";
const std::string ActionCode::SCROLL_TO_HOME = "gotoHome";
const std::string ActionCode::SCROLL_TO_START_OF_TEXT = "gotoSectionStart";
const std::string ActionCode::SCROLL_TO_END_OF_TEXT = "gotoSectionEnd";
const std::string ActionCode::CANCEL = "cancel";
const std::string ActionCode::INCREASE_FONT = "increaseFont";
const std::string ActionCode:

ECREASE_FONT = "decreaseFont";
const std::string ActionCode::SHOW_HIDE_POSITION_INDICATOR = "toggleIndicator";
const std::string ActionCode::TOGGLE_FULLSCREEN = "toggleFullscreen";
const std::string ActionCode::FULLSCREEN_ON = "onFullscreen";
const std::string ActionCode::ADD_BOOK = "addBook";
const std::string ActionCode::SHOW_BOOK_INFO = "bookInfo";
const std::string ActionCode::SHOW_HELP = "showHelp";
const std::string ActionCode::ROTATE_SCREEN = "rotate";
const std::string ActionCode::QUIT = "quit";
const std::string ActionCode::OPEN_PREVIOUS_BOOK = "previousBook";
const std::string ActionCode::GOTO_NEXT_TOC_SECTION = "nextTOCSection";
const std::string ActionCode::GOTO_PREVIOUS_TOC_SECTION = "previousTOCSection";
const std::string ActionCode::COPY_SELECTED_TEXT_TO_CLIPBOARD = "copyToClipboard";
const std::string ActionCode::CLEAR_SELECTION = "clearSelection";
const std::string ActionCode::OPEN_SELECTED_TEXT_IN_DICTIONARY = "openInDictionary";
const std::string ActionCode::GOTO_PAGE_NUMBER = "gotoPageNumber";
const std::string ActionCode::GOTO_PAGE_NUMBER_WITH_PARAMETER = "gotoPageNumberWithParameter";
const std::string ActionCode::SEARCH_ON_NETWORK = "searchOnNetwork";
const std::string ActionCode::ADVANCED_SEARCH_ON_NETWORK = "advancedSearchOnNetwork";
const std::string ActionCode::ORGANIZE_BOOKS_BY_AUTHOR = "byAuthor";
const std::string ActionCode::ORGANIZE_BOOKS_BY_TAG = "byTag";
like nextTOCSection.png(the image resolution I used is 32*32, other don't know), and change the install directory /fbreader/share/FBReader/default/toolbar.xml, replace the string after <button id="undo"/> with my
<button id="nextTOCSection"/>
after done this, I don't need to conside how the fbreader respond to the hardware key:-)
but I still want to more read area on iliad, and I find the original code can't enter/exit fullscreen mode, and I modify a little to source code
/fbreader-0.10.2/zlibrary/ui/src/gtk/application-desktop/ZLGtkApplicationWindow.cpp
add one line at the beginning
static int fullscreenFlag=0;
add one line within void ZLGtkApplicationWindow::setFullscreen after the fullscreen function finished
fullscreenFlag=1;
and one line after the unfullscreen function finished
fullscreenFlag=1;
and replace function
bool ZLGtkApplicationWindow::isFullscreen() const {
return
gdk_window_get_state(GTK_WIDGET(myMainWindow)->window) &
GDK_WINDOW_STATE_FULLSCREEN;
}
with
bool ZLGtkApplicationWindow::isFullscreen() const {
return fullscreenFlag;
}
now the fullscreen mode can normally function, but on iliad, still need modify the install file /fbreader/share/FBReader/default/fullscreen_toolbar.xml, you can define yourself function icon or just copy all from toolbar.xml as you want.
my icon sequence as below:
showReading|showLibrary|addBook|showNetLibrary|got oHome|largeScrollForward|largeScrollBackward|gotoP ageNumberWithParameter|toc|search|nextTOCSection|p reviousTOCSection|bookInfo|preferences|rotate|togg leFullscreen|quit
Currently I don't make sure how to make a correct installer for all you. I tried with ipkg-build tool to produce a ipk installer,but I realize that I must test the install root on cf/sd/internal memory, and test the /usr/local directory created before reside on which medium, or whether I need to create it by myself, all these can't be done without strong shell knowledge, I don't want to brick anyones iliad, before I make sure it just running as I expect, so I still don't make a installer.
the attach is cf/sd card of fbreader binary, unzip it to your root directory and run it from contentlister, if want hardware key function, pls copy the option.xml to the .FBReader/ directory on your cf/sd card, should be _local\home\.FBReader if you installed adam.B's fbreader, for people who success running on his iliad, pls report here which version you used, so other one know it's a working version, therefore can give it a try.
good luck!
another one is the source code of fbreader0.10.2 I modified as your reference, pls rename the extension to tgz because mb doesn't accept tgz I change it to tar.
especially thanks for:
adam.B for developer vmware, and the patch for fbreader and other great work done on iliad platform.
ericshliao for how to send the debug info to screen for fbreader lib handling.
Antartica for xepdmgr control the fbreader screen refresh
and so many kindly people, without your creative work, the fbreader 0.10.2 won't be running on my iliad.
thank you all!