Skip to content

Commit

Permalink
Merge pull request #206 from blchinezu/dev
Browse files Browse the repository at this point in the history
Up version: 0.0.6-17-58
  • Loading branch information
blchinezu committed Oct 11, 2016
2 parents 508ab01 + 88519eb commit 4fb4467
Show file tree
Hide file tree
Showing 43 changed files with 114 additions and 62 deletions.
11 changes: 7 additions & 4 deletions README.md
Expand Up @@ -47,15 +47,16 @@ After downloading the zip file, extract it and copy the system dir to your devic
- Google & Wikipedia buttons in the dictionary window
- Set book cover as power off logo [[pal](http://www.the-ebook.org/forum/profile.php?mode=viewprofile&u=45840&sid=43f0dd795517591f5bae7add0e609962)]
- Get hardware depth from device
- Control front light by vertically swiping in FW5
- Turn pages by horizontally swiping
- Rewritten TOC window
- StandBy Mode
- Updated translations
- Full screen update on book load
- Fixed font selection bug in settings [[pkb](https://github.com/pkb)]
- Cite toolbar is working with touch devices
- Updated freetype
- Updated translations
- StandBy Mode
- More hyphenations
- Control front light by vertically swiping in FW5
- Turn pages by horizontally swiping
- Pinch screen to change font size
- Chinese is correctly shown in menus
- More page margin values
Expand Down Expand Up @@ -203,3 +204,5 @@ After downloading the zip file, extract it and copy the system dir to your devic
![3.jpg](https://raw.githubusercontent.com/blchinezu/pocketbook-coolreader/master/screenshots/3.jpg)
![4.jpg](https://raw.githubusercontent.com/blchinezu/pocketbook-coolreader/master/screenshots/4.jpg)
![5.jpg](https://raw.githubusercontent.com/blchinezu/pocketbook-coolreader/master/screenshots/5.jpg)
![6.jpg](https://raw.githubusercontent.com/blchinezu/pocketbook-coolreader/master/screenshots/6.jpg)
![7.jpg](https://raw.githubusercontent.com/blchinezu/pocketbook-coolreader/master/screenshots/7.jpg)
Binary file modified builds/360/360/latest.zip
Binary file not shown.
Binary file modified builds/515/pro4/latest.zip
Binary file not shown.
Binary file modified builds/515/pro5/latest.zip
Binary file not shown.
Binary file modified builds/602/pro2/latest.zip
Binary file not shown.
Binary file modified builds/626/pro4/latest.zip
Binary file not shown.
Binary file modified builds/626/pro5/latest.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion builds/current.version
@@ -1 +1 @@
0.0.6-17-57
0.0.6-17-58
26 changes: 19 additions & 7 deletions cr3gui/data/devices/pb360/skins/pb626fw5/cr3skin.xml
Expand Up @@ -138,8 +138,8 @@
<background color="#FFFFFF"/>
<background color="#000000" pos="0, 0" size="100%,1"/>
<background color="#000000" pos="0,-1" size="100%,1"/>
<background color="#000000" pos="0,0" size="1,100%"/>
<background color="#000000" pos="-1,0" size="1,100%"/>
<background color="#000000" pos="0,0" size="1,100%"/>
<background color="#000000" pos="-1,0" size="1,100%"/>
<border widths="8,4,4,4"/>
</title>
<text color="#000000" face="Liberation Sans, DejaVu Sans" size="25" bold="true" italic="false" valign="center" halign="center"/>
Expand All @@ -163,8 +163,8 @@
<background color="#FFFFFF"/>
<background color="#000000" pos="0, 0" size="100%,1"/>
<background color="#000000" pos="0,-1" size="100%,1"/>
<background color="#000000" pos="0,0" size="1,100%"/>
<background color="#000000" pos="-1,0" size="1,100%"/>
<background color="#000000" pos="0,0" size="1,100%"/>
<background color="#000000" pos="-1,0" size="1,100%"/>
<border widths="4,4,4,4"/>
</title>
<text color="#000000" face="Liberation Sans, DejaVu Sans" size="28" bold="true" italic="false" valign="center" halign="left"/>
Expand Down Expand Up @@ -289,7 +289,7 @@
</window>
<window id="tapSettings-rotated" base="#tapSettings"/>

<menu id="main" min-item-count="11" max-item-count="11" show-shortcuts="false" fullscreen="true" >
<menu id="main" min-item-count="12" max-item-count="12" show-shortcuts="false" fullscreen="true" >
<text color="#FFFFFF" face="Liberation Sans, DejaVu Sans" size="25" bold="true" italic="false" valign="center" halign="center"/>
<background color="#AAAAAA"/>
<border widths="0,0,0,0"/>
Expand Down Expand Up @@ -407,16 +407,28 @@

<menu id="recent-books" base="#bookmarks"/>
<menu id="recent-books-rotated" base="#bookmarks-rotated"/>

<menu id="cites-list" base="#bookmarks"/>
<menu id="cites-list-rotated" base="#bookmarks-rotated"/>

<menu id="settings" base="#main" fullscreen="true">
<value base="#menu-value">
<value base="#menu-value">
<text color="#000000" face="Liberation Sans, DejaVu Sans" size="25" bold="false" italic="true" valign="bottom" halign="right"/>
</value>
<item base="#menu-item">
<text color="#000000" face="Liberation Sans, DejaVu Sans" size="30" bold="false" italic="false" valign="top" halign="left"/>
</item>
</menu>
<menu id="settings-rotated" base="#settings" min-item-count="8" max-item-count="8"/>
<menu id="settings-rotated" base="#settings" min-item-count="9" max-item-count="9"/>

<menu id="touch-toc" base="#settings" min-item-count="16" max-item-count="16" fullscreen="true" >
<item id="touch-toc-item">
<size minvalue="36,36" maxvalue="50%,100%"/>
<text color="#000000" face="Liberation Sans, DejaVu Sans" size="28" bold="false" italic="false" valign="center" halign="left"/>
<border widths="20,0,20,0"/>
</item>
<selitem base="#touch-toc-item"/>
</menu>
<menu id="touch-toc-rotated" base="#touch-toc" min-item-count="10" max-item-count="10" fullscreen="true" >

</CR3Skin>
15 changes: 13 additions & 2 deletions cr3gui/data/devices/pb360/skins/pb631fw5/cr3skin.xml
Expand Up @@ -293,7 +293,7 @@
</window>
<window id="tapSettings-rotated" base="#tapSettings"/>

<menu id="main" min-item-count="11" max-item-count="11" show-shortcuts="false" fullscreen="true" >
<menu id="main" min-item-count="12" max-item-count="12" show-shortcuts="false" fullscreen="true" >
<text color="#FFFFFF" face="Liberation Sans, DejaVu Sans" size="25" bold="true" italic="false" valign="center" halign="center"/>
<background color="#AAAAAA"/>
<border widths="0,0,0,0"/>
Expand Down Expand Up @@ -422,5 +422,16 @@
<text color="#000000" face="Liberation Sans, DejaVu Sans" size="30" bold="false" italic="false" valign="top" halign="left"/>
</item>
</menu>
<menu id="settings-rotated" base="#settings" min-item-count="8" max-item-count="8"/>
<menu id="settings-rotated" base="#settings" min-item-count="9" max-item-count="9"/>

<menu id="touch-toc" base="#settings" min-item-count="16" max-item-count="16" fullscreen="true" >
<item id="touch-toc-item">
<size minvalue="36,36" maxvalue="50%,100%"/>
<text color="#000000" face="Liberation Sans, DejaVu Sans" size="28" bold="false" italic="false" valign="center" halign="left"/>
<border widths="20,0,20,0"/>
</item>
<selitem base="#touch-toc-item"/>
</menu>
<menu id="touch-toc-rotated" base="#touch-toc" min-item-count="10" max-item-count="10" fullscreen="true" >

</CR3Skin>
23 changes: 14 additions & 9 deletions cr3gui/src/cr3pocketbook.cpp
Expand Up @@ -2674,22 +2674,27 @@ class CRPocketBookDocView : public V3DocViewWin {
_toc = NULL;
}
}
if (!_tocLength) {
if ( _tocLength < 2 ) {
Message(ICON_INFORMATION, const_cast<char*>("CoolReader"),
const_cast<char*>("@No_contents"), 2000);
return;
}

// #ifdef POCKETBOOK_PRO
#ifdef POCKETBOOK_PRO

// // If device supports touch and resolution is greater than 800x600
// if( useDeveloperFeatures && // FIXME: TODO: XXX: Remove when releasing
// QueryTouchpanel() != 0 && ScreenWidth() > 600 && ScreenHeight() > 800 ) {
// showTocTouchMenu(_toc, _tocLength);
// return;
// }
// If device supports touch, resolution is greater than 800x600 and a FW5 skin is used
if( QueryTouchpanel() != 0 &&
max(ScreenWidth(), ScreenHeight()) > 800 &&
(
pbSkinFileName == lString16("pb626fw5.cr3skin") ||
pbSkinFileName == lString16("pb631fw5.cr3skin")
)
) {
showTocTouchMenu(_toc, _tocLength, _docview->getCurPage() + 1);
return;
}

// #endif
#endif

CRPocketBookContentsWindow *wnd = new CRPocketBookContentsWindow(_wm, _toc,
_tocLength, _docview->getCurPage() + 1);
Expand Down
4 changes: 2 additions & 2 deletions cr3gui/src/cr3pocketbook.h
Expand Up @@ -78,8 +78,8 @@ enum CRPbCommands {

#define PB_CR3_CACHE_SIZE (0x100000 * 64)

#define CR_PB_VERSION "0.0.6-17-57"
#define CR_PB_BUILD_DATE "2016-10-10"
#define CR_PB_VERSION "0.0.6-17-58"
#define CR_PB_BUILD_DATE "2016-10-11"

#define PB_ROTATE_MODE_360 0
#define PB_ROTATE_MODE_180 1
Expand Down
8 changes: 6 additions & 2 deletions cr3gui/src/mainwnd.cpp
Expand Up @@ -725,13 +725,17 @@ void V3DocViewWin::showSettingsMenu()
}

#ifdef POCKETBOOK_PRO
void V3DocViewWin::showTocTouchMenu(tocentry *tocItems, int length)
void V3DocViewWin::showTocTouchMenu(tocentry *tocItems, int length, int currentPage)
{
_props = _docview->propsGetCurrent() | _props;
_newProps = LVClonePropsContainer( _props );
lvRect rc = _wm->getScreen()->getRect();
CRMenu * mainMenu = new CRTocMenu( _wm, _newProps, MCMD_TOC_TOUCH,
getMenuAccelerators(), rc, tocItems, length );
getMenuAccelerators(), rc, tocItems,
length, currentPage );
// CRTOCDialog * mainMenu = new CRTOCDialog( _wm,
// lString16( _("Table of contents") ),
// MCMD_GO_PAGE_APPLY, _docview->getPageCount(), _docview );
_wm->activateWindow( mainMenu );
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion cr3gui/src/mainwnd.h
Expand Up @@ -172,7 +172,7 @@ class V3DocViewWin : public CRViewDialog, public LVDocViewCallback
void showSettingsMenu();

#ifdef POCKETBOOK_PRO
void showTocTouchMenu(tocentry *toc, int length);
void showTocTouchMenu(tocentry *toc, int length, int currentPage);
#endif

#if CR_INTERNAL_PAGE_ORIENTATION==1 || defined(CR_POCKETBOOK)
Expand Down
73 changes: 41 additions & 32 deletions cr3gui/src/pb_toc.cpp
Expand Up @@ -4,32 +4,32 @@

#include <crgui.h>
#include <cri18n.h>
#include <math.h>
#include "viewdlg.h"
#include "mainwnd.h"
#include "cr3pocketbook.h"
//#include "fsmenu.h"
#include "pb_toc.h"


bool CRTocMenu::onCommand( int command, int params )
{
CRLog::trace("CRTocMenu::onCommand(%d, %d)", command, params);
return CRMenu::onCommand( command, params );
}

CRTocMenu::CRTocMenu( CRGUIWindowManager * wm, CRPropRef newProps, int id, CRGUIAcceleratorTableRef menuAccelerators, lvRect &rc, tocentry *tocItems, int length )
CRTocMenu::CRTocMenu( CRGUIWindowManager * wm, CRPropRef newProps, int id,
CRGUIAcceleratorTableRef menuAccelerators, lvRect &rc, tocentry *tocItems,
int length, int currentPage )
: CRFullScreenMenu( wm, id, lString16(_("Contents")), 8, rc ),
props( newProps ),
_menuAccelerators( menuAccelerators ), _menuItemId(mm_Last)
_menuAccelerators( menuAccelerators ), _menuItemId(mm_TouchTOC)
{
CRLog::trace("showTocTouchMenu(): Construct");

if( pbSkinFileName == lString16("pb626fw5.cr3skin") ||
pbSkinFileName == lString16("pb631fw5.cr3skin")
)
if( !fontAntiAliasingActivated() ) {
forcePartialBwUpdates = true;
}

setSkinName(lString16("#settings"));
setSkinName(L"#touch-toc");

_fullscreen = true;

Expand All @@ -44,42 +44,48 @@ CRTocMenu::CRTocMenu( CRGUIWindowManager * wm, CRPropRef newProps, int id, CRGUI
CRMenu * mainMenu = this;
mainMenu->setAccelerators( _menuAccelerators );

_selectedItem = 0;

if ( length ) {

for (int i = 0; i < length; i++) {
if( currentPage >= tocItems[i].position ) {
_selectedItem = i;
}
}

for (int i = 0; i < length; i++) {

// _toc[j].level = item->getLevel();
// _toc[j].position = item->getPage() + 1;
// _toc[j].page = _toc[j].position;
// _toc[j].text = strdup(UnicodeToUtf8(item->getName()).c_str());
lString16 text(tocItems[i].text);

char *text = tocItems[i].text;
// Prepend page number
// text = L"[" + lString16::itoa(tocItems[i].position) + L"] " + text;

// Generate pre text
// lString16 pre;
// for( int l = 0; l < tocItems[i].level; l++ )
// pre = pre + "- ";
// Mark current chapter
if( _selectedItem == i ) {
text = L"> " + text;
}

// Prepend text
// if( !pre.empty() ) {
// free(text);
// text = UnicodeToUtf8( pre + lString16(text) ).c_str();
// }
// Indent level
for( int level = tocItems[i].level; level > 1; level-- ) {
text = L" " + text;
}

// Add item
mainMenu->addItem( new CRMenuItem(
mainMenu,
mainMenu->addItem(new CRMenuItem(
mainMenu,
PB_TOC_SAFE_CMD_RANGE + tocItems[i].page,
text,
UnicodeToUtf8(text).c_str(),
LVImageSourceRef(),
LVFontRef()
) );
LVFontRef()/*,
lString16::itoa(tocItems[i].position).c_str()*/
));
}
}

// Empty contents
// Empty contents - shouldn't reach this
else {
mainMenu->addItem( new CRMenuItem(
mainMenu,
mainMenu,
PB_TOC_SAFE_CMD_RANGE + 1,
"Empty TOC",
LVImageSourceRef(),
Expand All @@ -88,8 +94,11 @@ CRTocMenu::CRTocMenu( CRGUIWindowManager * wm, CRPropRef newProps, int id, CRGUI
}

reconfigure(0);

if( forcePartialBwUpdates )

setCurPage( (int)floor(_selectedItem/_pageItems) );

if( forcePartialBwUpdates ) {
SetWeakTimer("FullUpdate", FullUpdate, 150);
}

}
9 changes: 8 additions & 1 deletion cr3gui/src/pb_toc.h
Expand Up @@ -21,18 +21,25 @@ class CRTocMenu : public CRFullScreenMenu
protected:
CRPropRef props;
CRGUIAcceleratorTableRef _menuAccelerators;

public:
CRTocMenu( CRGUIWindowManager * wm, CRPropRef props, int id, CRGUIAcceleratorTableRef menuAccelerators, lvRect & rc, tocentry *tocItems, int length );
CRTocMenu( CRGUIWindowManager * wm, CRPropRef props, int id,
CRGUIAcceleratorTableRef menuAccelerators, lvRect & rc,
tocentry *tocItems, int length, int currentPage );

virtual bool onCommand( int command, int params );

virtual ~CRTocMenu()
{
forcePartialBwUpdates = false;
CRLog::trace("Calling fontMan->gc() on Toc menu destroy");
fontMan->gc();
CRLog::trace("Done fontMan->gc() on Toc menu destroy");
}

private:
int _menuItemId;

};

#endif //CR3_PB_TOC_H_INCLUDED
1 change: 1 addition & 0 deletions cr3gui/src/settings.h
Expand Up @@ -100,6 +100,7 @@ enum MainMenuItems_t {
#ifdef POCKETBOOK_PRO_FW5
mm_customSystemTheme,
#endif
mm_TouchTOC,
mm_Last
};

Expand Down
2 changes: 1 addition & 1 deletion crengine/include/crgui.h
Expand Up @@ -1174,11 +1174,11 @@ class CRMenu : public CRGUIWindowBase, public CRMenuItem {
virtual void draw();
virtual void Draw( LVDrawBuf & buf, lvRect & rc, CRRectSkinRef skin, CRRectSkinRef valueSkin, bool selected );
//virtual void Draw( LVDrawBuf & buf, int x, int y );
virtual void highlightCommandItem( int cmd );
virtual bool onItemSelect(int command, int params = 0 );
int getLastOnPage();
void doCloseMenu(int command, bool highlight = false, int param = 0);
public:
virtual void highlightCommandItem( int cmd );
/// returns index of selected item, -1 if no item selected
virtual int getSelectedItemIndex();
virtual int getDefaultSelectionIndex() {
Expand Down
Binary file modified data/common/system/share/cr3/i18n/bg.mo
Binary file not shown.
Binary file modified data/common/system/share/cr3/i18n/ca.mo
Binary file not shown.
Binary file modified data/common/system/share/cr3/i18n/cs.mo
Binary file not shown.
Binary file modified data/common/system/share/cr3/i18n/de.mo
Binary file not shown.
Binary file modified data/common/system/share/cr3/i18n/es.mo
Binary file not shown.
Binary file modified data/common/system/share/cr3/i18n/fr.mo
Binary file not shown.
Binary file modified data/common/system/share/cr3/i18n/he.mo
Binary file not shown.
Binary file modified data/common/system/share/cr3/i18n/hu.mo
Binary file not shown.
Binary file modified data/common/system/share/cr3/i18n/it.mo
Binary file not shown.
Binary file modified data/common/system/share/cr3/i18n/lt.mo
Binary file not shown.
Binary file modified data/common/system/share/cr3/i18n/nl.mo
Binary file not shown.
Binary file modified data/common/system/share/cr3/i18n/pl.mo
Binary file not shown.
Binary file modified data/common/system/share/cr3/i18n/ro.mo
Binary file not shown.
Binary file modified data/common/system/share/cr3/i18n/ru.mo
Binary file not shown.
Binary file modified data/common/system/share/cr3/i18n/tr.mo
Binary file not shown.
Binary file modified data/common/system/share/cr3/i18n/uk.mo
Binary file not shown.
Binary file modified data/common/system/share/cr3/i18n/zh.mo
Binary file not shown.
Binary file modified screenshots/0.jpg 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/3.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/4.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/5.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/6.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/7.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4fb4467

Please sign in to comment.