View Single Post
Old 02-08-2010, 09:14 AM   #168
lunohod
OpenInkpot developer
lunohod shares his or her toyslunohod shares his or her toyslunohod shares his or her toyslunohod shares his or her toyslunohod shares his or her toyslunohod shares his or her toyslunohod shares his or her toyslunohod shares his or her toyslunohod shares his or her toyslunohod shares his or her toyslunohod shares his or her toys
 
Posts: 211
Karma: 5627
Join Date: Mar 2008
Location: Stuttgart, Germany
Device: N516,V3,PRS505,iLiad,eSlick,E60,K3,K4NT,M90,PB912,KoboMini
Quote:
Originally Posted by ericshliao View Post
When I was thinking how to mod FBReader to preload next page in background, an interesting idea came to me. I think it can make preloading next page feasible even without thread in FBReader. Although I am making some progress on adding thread-capability to FBReader, I am still not certain if I can make preloading on FBReader. In comparison to adding thread-capability to FBReader, this idea seems very easy to implement.
I call this idea "delayed refresh". It's an iLiad-only idea and can only be achieved with the aiding of xepdmgr. The essence of the idea is "cheating readers"!
Read on and you'll know why preloading can be achieved by "cheating reader".

The details of the idea is:
1. After the first page is loaded by FBReader and displayed, de-activate xepdmgr temporarilly (by adding code to FBReader).
2. Then generate a page-flip signal to FBReader (by adding code to FBReader). Thus, FBReader will load the next page, but it is not shown on screen since xepdmgr is de-activated. In fact, FBReader is already flipped to next page, but the result is not shown on screen.
3. When the user has finished reading the first page, and push the next-page button, immediately re-activate xepdmgr (by adding code to FBReader), and immediately stop FBReader for 500ms (by adding code to FBReader) for xepdmgr to finish its job. Xepdmgr will refresh to show the next page. The speed will be fast since FBReader has already prepared the next page and refreshed the UI widgets. The reader will see screen refreshing in 3 secs after page-flip button is pushed.
4. De-activate xepdmgr before FBReader resumes its normal routines (by adding code to FBReader). Thus, FBReader will load next page but the result will not shown immediately (just like step 2).

I remember that xepdmgr provides some functions for applications to control screen refresh manually, but I never seriously tried. Maybe it's a good time to try it now.

Do you have any comments on the theoretical "delayed refresh" idea?

Added:
Some special care must be added. For example, actions other than pushing next-page button done by users, such as change font-size, scroll backward, open library, change options, will immediately re-activate xepdmgr.
It seems that you are trying to implement something like I did a while ago for OI. Take a look at this commt:
http://git.openinkpot.org/fbreader.g...aada6ea3451bd4
lunohod is offline   Reply With Quote