10-02-2015, 03:49 PM | #1 |
Enthusiast
Posts: 49
Karma: 107174
Join Date: Mar 2012
Device: PB631, PB741, PB840
|
qPBReader v1.0 - epub reader for firmware 4 623/626
Hello,
I have developed an epub reader for pocketbook 623 and 626 with firmware 4. Complete source code is here: https://github.com/m4mmon/qPBReader I also provide a ready-to-use version: https://www112.zippyshare.com/v/Ic1nAoCu/file.html I will not copy here the complete "README" you can find on github. To sum up:
I deliberately decided not to support touch actions for page changing, because I do not like that. The following screenshots were made with qPBReader set to french. By default, it tries to load current system language and falls back to english. Translating the application is a matter of running Qt lupdate/linguist/lrelease and putting the generated file next to executable. Dialog show when using menu button: Text layout dialog. Features font size (in fact text zoom), book margins, hyphens: Font options dialog. There is also an option to ignore embedded fonts: Native pb dictionary dialog integration. Requires long tap on word: Default parameters configuration (values used when opening a book the first time). Accessible from pb applications (qPBReaderConfig): Since qPBReader is calibre-based, it also supports Mathjax (book sample from calibre): Last edited by m4mmon; 08-12-2018 at 10:46 AM. Reason: updated package link |
10-03-2015, 10:51 AM | #2 |
Grand Sorcerer
Posts: 45,046
Karma: 56751447
Join Date: Jan 2007
Location: Peru
Device: Kindle: Oasis 3, Voyage WiFi; Kobo: Libra 2, Aura One
|
Moderator Notice
M4mmon Please take a few moments to read our Posting Guidelines, in particular the part about the maximum image size allowed (600x600 pixels). Images that violate those guidelines will be deleted. It is every member's responsibility to read our Posting Guidelines and follow them. Thanks. |
Advert | |
|
10-12-2015, 03:31 PM | #3 |
Enthusiast
Posts: 49
Karma: 107174
Join Date: Mar 2012
Device: PB631, PB741, PB840
|
I am in the process of building qPBReader for 626 + firmware 5.
Parts that were using QXmlQuery had to be rewritten since Qt is even more butchered with firmware 5 than it was with 4. I am also struggling with some issues regarding the so-called SDK provided there.
|
10-13-2015, 02:56 AM | #4 | ||
Addict
Posts: 352
Karma: 188498
Join Date: Jan 2015
Location: Romania
Device: Kobo Aura One
|
Quote:
Quote:
You can't do much with it. You can toggle show/hide and that's about it. |
||
10-13-2015, 11:43 AM | #5 |
Enthusiast
Posts: 49
Karma: 107174
Join Date: Mar 2012
Device: PB631, PB741, PB840
|
Thank you for sharing that.
I will try to hide/show it, and for displaying page number, add some Qt stuff. Optional would be nice, in order to occupy maximum available space on screen. |
Advert | |
|
10-13-2015, 11:46 AM | #6 |
Addict
Posts: 352
Karma: 188498
Join Date: Jan 2015
Location: Romania
Device: Kobo Aura One
|
Here's the code I used for that in CoolReader:
PHP Code:
|
10-13-2015, 04:00 PM | #7 |
Enthusiast
Posts: 49
Karma: 107174
Join Date: Mar 2012
Device: PB631, PB741, PB840
|
Thank you for the tip.
Unfortunately, even if I do it before initializing the main Qt dialog, it eats up space at the bottom of the screen, I think this has something to do with pb platform implementation. I have to find out what is going on there. I can see pb Qt splash screen ("browser") moving up when the API is called, and space at the bottom is kind of lost. Narrowed it... in Qt pb platform integration plugin. Qt system determines "desktop" size by substracting PanelHeight() to ScreenHeight(). It does not seem to care whether or not the panel is hidden afterwards. I just verified that by LD_PRELOAD-ing this function and making it return 0. I have to find a proper way to notify Qt of "desktop" screen resolution change when toggling on/off the top panel, surely sending some signal or event to some object. Last edited by m4mmon; 10-13-2015 at 06:03 PM. Reason: updates |
10-14-2015, 05:14 AM | #8 |
Addict
Posts: 352
Karma: 188498
Join Date: Jan 2015
Location: Romania
Device: Kobo Aura One
|
I had issues with this too. For example, when showing the menu in CR (FW5), the entire display buffer offsets with PanelHeight() pixels.
So I did a dirty workaround for that (being the fact that while the menu is shown, no interaction is allowed with the rest of the app). I activate the panel without drawing it, take an offset screenshot, redraw the screenshot, draw top & bottom parts of the menu and then update the screen. If I wouldn't do the screenshot part I'd always get an annoying offset of the page text when toggling menu. It's not an elegant way of solving things but I was too lazy to go deeper into the problem. ) PHP Code:
|
10-14-2015, 01:41 PM | #9 |
Wizard
Posts: 3,015
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
The new version 5 firmware seems to do some kind of trickery when it draws the toolbar panel at the top of the screen. To me, it looks like the panel is drawn at the bottom of the image (like in old firmware versions), and then the image is shifted down and the bottom part is offset to the top of the screen. When you disable the panel, everything is drawn normally.
When you don't want the panel to be shown: 1) SetPanelType(0), 2) draw to the full screen, and 3) don't call DrawPanel(). When you want the panel to be shown: 1) SetPanelType(1), 2) draw to the _top_ (ScreenHeight() - PanelHeight()) part of the screen, 3) call DrawPanel(). These steps are the same for all versions of the firmware. Version 5 will secretly move the bottom panel area to the top of the screen if SetPanelType(1) was last called, even if DrawPanel() was not called. Last edited by rkomar; 10-14-2015 at 01:43 PM. |
10-14-2015, 03:31 PM | #10 |
Enthusiast
Posts: 49
Karma: 107174
Join Date: Mar 2012
Device: PB631, PB741, PB840
|
By playing with screen orientation spying for traces, signals etc. I found by changing orientation, everything was properly handled.
So Qt internal initialization stuff is properly triggered by doing this: PHP Code:
edit: did not see your answer before rkomar, I will try to completely disable those DrawPanel functions. edit2: avoiding DrawPanel calls does not make it my case. From what I understand, PB Qt platform integration makes use of inkview library. When starting Qt graphic stuff (which occurs at QApplication construction), InkViewMain is called, and internal window system is initialized with some defaults (i.e. Panel shown). When calling SetPanelType(0), QPlatformScreen is not notified of the change (QApplication::desktop()->screenGeometry() continues to return partial screen size). The simple call at the top of this message make stuff properly update. Of course, this is speculation, but the result is here with Qt. There are custom event types in PB platform integration. For now I have only discovered 1111 which simply wraps OpenRotateBox and perform SendEvent() stuff in handler, nothing more. So I guess EVT_ORIENTATION is properly processed in main event handler. And after that, QApplication::desktop()->screenGeometry() returns good value. All I know it is valid only for Qt. Last edited by m4mmon; 10-14-2015 at 03:55 PM. |
10-14-2015, 04:43 PM | #11 |
Wizard
Posts: 3,015
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
Okay, but I was more replying to @brucelee's problem with the panel than to your problem.
|
10-14-2015, 06:43 PM | #12 | ||
Addict
Posts: 352
Karma: 188498
Join Date: Jan 2015
Location: Romania
Device: Kobo Aura One
|
Quote:
That's something I don't really get. I accept shifting down because it kind of feels normal. It might be something that's meant to be that way or simply a huge bug. We'd have to ask a PocketBook developer for that. From my point of view, it feels ok to automatically shift the view. But to wrap the drawing is really wrong. If you offset the buffer with 75px (assuming that's the case), well, when going over 949px things shouldn't wrap around. Like PanelHeight + ScreenHeight shouldn't overlap the top of the screen. Quote:
But if something else updates the entire screen (like expanding the system panel menu and closing it) shit goes wrong. I get the entire background page shifted downwards. That's why I do the screenshot part I was talking about earlier. (And it's not the only possible way of messing around with the view.) Last edited by brucelee; 10-14-2015 at 06:55 PM. |
||
10-30-2015, 03:11 PM | #13 |
Enthusiast
Posts: 49
Karma: 107174
Join Date: Mar 2012
Device: PB631, PB741, PB840
|
Just a small update about progress with firmware 5 on 626.
Everything is mostly working fine, but I have not spent much time these days on it. So no status bar yet (to display page count or so), and I made the mistake of updating to october 21st firmware (5.9_458), and something obviously changed inside Qt runtime, font combo box is somehow broken... pfff |
12-06-2015, 10:37 AM | #14 |
Member
Posts: 20
Karma: 12452
Join Date: Feb 2012
Location: France
Device: Pocketbook 623
|
Excellent news for my Pb 623 ! Really great work, thanks
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mise à jour Firmware PocketBook Touch Lux 623 | Tos | PocketBook | 53 | 05-06-2024 11:04 AM |
PocketBook 626 Touch Lux 2 now has Firmware 5.5 | brucelee | PocketBook | 55 | 09-23-2015 05:21 PM |
Empty line between paragraph in epub on Pocketbook 626 | nickie_twisp | Calibre | 2 | 11-30-2014 01:59 PM |
Touch Lux 623 Firmware 4.4. hängt | Mike1 | PocketBook | 5 | 12-30-2013 02:18 PM |
Touch Lux 623: No Link Mode in Firmware 4.3 | enlo | PocketBook | 2 | 10-24-2013 07:58 PM |