View Single Post
Old 02-24-2009, 09:24 PM   #1
DesiLinguist
Computational Linguist
DesiLinguist doesn't litterDesiLinguist doesn't litter
 
Posts: 110
Karma: 100
Join Date: Feb 2009
Device: iLiad BE, iPhone, Kindle DX
Modifying flipbar behavior

In a recent thread about the weirdness of the flipbar wherein it would randomly turn 5 pages when it should have only done a single page, Shaggy suggested that it might be useful to completely furn off that feature since the ipdf sources are now available.

I am very comfortable with linux and have done some embedded system development back in the day. So, I guess I wouldn't mind taking a shot at taking the fantastic jharker fullscreen ipdf (which is my default ipdf now) and modifying it to disable the 5 page turn completely.

However, I would still prefer if someone well-versed with developing for the iLiad took a shot at doing this before me primarily because the turn around time would be so much shorter. IMHO, this modification shouldn't be that difficult for someone who knows their way around the source already.

So, I would really really appreciate it if one of the more experienced iLiad developers could try their hand at this before I took a shot.

Thanks in advance!

Update:

I downloaded jharker's sources and explored a bit and found the changes that I think should be made according to my (so far very preliminary) understanding of the code.

The first set of changes should be in PDFPortraitView.cpp in the range between lines 318 and 361:
Code:
    case GDK_Page_Up:
        view->ctrl->settings.setRenderDir(RenderPrev);
        if (view->ctrl->settings.getCurrentPage() <= 1)
        {
            displayPage(1, ScrollToPrevPage);    
        }
        else
        {
            displayPage(view->ctrl->settings.getCurrentPage() - 1, ScrollToPrevPage);
        }   
        break;
    case GDK_Page_Down:
        view->ctrl->settings.setRenderDir(RenderNext);
        if (view->ctrl->settings.getCurrentPage() >= view->ctrl->core->getNumPages())
        {
            displayPage(view->ctrl->settings.getCurrentPage(), ScrollToNextPage);    
        }
        else
        {
            displayPage(view->ctrl->settings.getCurrentPage() + 1, ScrollToNextPage);
        }   
        break;
    case GDK_F1: // iRex: long pageflip forward 
        view->ctrl->settings.setRenderDir(RenderNext);
        if (view->ctrl->settings.getCurrentPage() + JumpWidth > view->ctrl->core->getNumPages())
        {
            displayPage(view->ctrl->core->getNumPages());
        }
        else
        {
            displayPage(view->ctrl->settings.getCurrentPage() + JumpWidth, ScrollToNextPages);
        }            
        break;
    case GDK_F2: // iRex: long pageflip backward 
        view->ctrl->settings.setRenderDir(RenderPrev);
        if ((view->ctrl->settings.getCurrentPage() - JumpWidth) < 1)
        {
            displayPage(1);
        }
        else
        {
            displayPage(view->ctrl->settings.getCurrentPage() - JumpWidth, ScrollToPrevPages);
        }            
        break;
If I am not mistaken, the first two CASE statements handle the regular flips and the next two CASE statements handle the long flips. So, all one should have to do is to ensure that the long flips do *exactly* the same thing as the short flips. And that should be all that is needed to remove the 5-page turn function.

Of course, the same changes need to be made in PDFLandscapeView.cpp as well but the changes should be pretty much identical.

To developers: If I am wrong about the changes that need to be made, please let me know. If I am right, I would really appreciate it if you could produce a version of this ipdf (jharker's) that incorporated these changes. Like I said, I could do it myself but it would take me a looong time to set up the toolchain and produce a final result whereas one of you veteran developers could probably do it in very little time. I would be happy to package up the new ipdf into daudi's all-in-one ipdf installer once this binary was produced.

Please help a fellow iLiad lover!

Last edited by DesiLinguist; 02-25-2009 at 01:54 AM. Reason: Added code
DesiLinguist is offline   Reply With Quote