Skip to content

Commit

Permalink
continue working on cite dialog support, move to new version of PB SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
pkb committed Jun 12, 2011
1 parent efae3bf commit b38f3fe
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 37 deletions.
10 changes: 6 additions & 4 deletions cr3gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,15 @@ elseif (${GUI} STREQUAL CRGUI_PB)
# SET(CR3_SOURCES ${CR3_SOURCES} src/cr3pocketbook.cpp)
FIND_LIBRARY(INKVIEW_LIB inkview)
IF (INKVIEW_LIB)
IF (DEFINED POCKETBOOK_PRO)
FIND_LIBRARY(MORPHOLOGY_LIB Morphology)
ENDIF (DEFINED POCKETBOOK_PRO)
SET (EXTRA_LIBS ${INKVIEW_LIB} ${MORPHOLOGY_LIB})
IF (DEFINED POCKETBOOK_EMU_GTK)
FIND_PACKAGE (GTK2 REQUIRED)
FIND_PACKAGE (CURL REQUIRED)
ENDIF (DEFINED POCKETBOOK_EMU_GTK)
SET (EXTRA_LIBS ${INKVIEW_LIB} ${GTK2_LIBRARIES} ${CURL_LIBRARIES})
ELSE (INKVIEW_LIB)
message("libinkview library not found!")
ENDIF (INKVIEW_LIB)

INSTALL( FILES ${CR3_STYLES} DESTINATION system/share/cr3)
INSTALL( DIRECTORY data/hyph/ DESTINATION system/share/cr3/hyph
FILES_MATCHING PATTERN "*.pdb" )
Expand Down
40 changes: 23 additions & 17 deletions cr3gui/src/citedlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,28 +73,34 @@ class CiteWindow : public BackgroundFitWindow
LVDrawBuf * buf = _wm->getScreen()->getCanvas().get();
skin->draw( *buf, _rect );
lvRect borders = skin->getBorderWidths();
#if 0 /* def CR_POCKETBOOK */
lString16 prompt(_("Select text"));
#ifdef CR_POCKETBOOK
lvRect keyRect = _rect;
int promptWidth = skin->measureText(prompt).x;
keyRect.right = keyRect.left + promptWidth + borders.left + borders.right;
if ( !keyRect.isEmpty() ) {
skin->draw( *_wm->getScreen()->getCanvas(), keyRect );
skin->drawText( *_wm->getScreen()->getCanvas(), keyRect, prompt );
}
CRToolBarSkinRef tbSkin = _wm->getSkin()->getToolBarSkin( L"#cite-toolbar" );
if (!tbSkin.isNull()) {
CRLog::trace("ToolBar skin is not NULL");
keyRect.left += (borders.right + promptWidth);
keyRect.right = _rect.right;
CRButtonListRef buttons = tbSkin->getButtons();
if (!(buttons.isNull() || _itemsCount != buttons->length()))
tbSkin->drawToolBar(*_wm->getScreen()->getCanvas(), _rect, true, _selectedIndex);
} else
#endif
{
CRLog::trace("ToolBar skin is NULL");
lString16 prompt(_("Select text"));
buf->FillRect( _rect, 0xAAAAAA );
lvRect keyRect = _rect;
LVFontRef font = fontMan->GetFont( 20, 600, false, css_ff_sans_serif, lString8("Arial")); //skin->getFont();
// int margin = 4;
keyRect.right = _rect.right;
if ( !keyRect.isEmpty() ) {
skin->draw( *_wm->getScreen()->getCanvas(), keyRect );
skin->drawText( *_wm->getScreen()->getCanvas(), keyRect, prompt );
}
tbSkin->drawToolBar(*_wm->getScreen()->getCanvas(), keyRect, true, _selectedIndex);
}
#else
buf->FillRect( _rect, 0xAAAAAA );
lvRect keyRect = _rect;
LVFontRef font = fontMan->GetFont( 20, 600, false, css_ff_sans_serif, lString8("Arial")); //skin->getFont();
// int margin = 4;
keyRect.right = _rect.right;
if ( !keyRect.isEmpty() ) {
skin->draw( *_wm->getScreen()->getCanvas(), keyRect );
skin->drawText( *_wm->getScreen()->getCanvas(), keyRect, prompt );
}
#endif
}

public:
Expand Down
5 changes: 4 additions & 1 deletion cr3gui/src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,11 @@ CRSettingsMenu::CRSettingsMenu( CRGUIWindowManager * wm, CRPropRef newProps, int
#if BIG_PAGE_MARGINS==1
//static int def_margin[] = { 8, 0, 5, 10, 20, 30, 50, 60 };
{"0", "0"},
{"1", "1"},
{"2", "2"},
{"3", "3"},
{"4", "4"},
{"5", "5"},
{"8", "8"},
{"10", "10"},
{"20", "20"},
{"30", "30"},
Expand Down
4 changes: 2 additions & 2 deletions crengine/include/crskin.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,11 @@ class CRToolBarSkin : public CRRectSkin
}

CRButtonListRef getButtons() { return _buttons; }
CRButtonListRef setButtons(CRButtonListRef list) { _buttons = list; }
void setButtons(CRButtonListRef list) { _buttons = list; }
virtual void drawToolBar( LVDrawBuf & buf, const lvRect & rc, bool enabled, int selectedButton );
virtual void drawButton(LVDrawBuf & buf, const lvRect & rc, int index, int flags);
};
typedef LVRef<CRToolBarSkin> CRToolBarSkinRef;
typedef LVFastRef<CRToolBarSkin> CRToolBarSkinRef;

class CRWindowSkin : public CRRectSkin
{
Expand Down
10 changes: 3 additions & 7 deletions crengine/src/crskin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ void CRToolBarSkin::drawToolBar( LVDrawBuf & buf, const lvRect & rect, bool enab
LVRef<CRButtonSkin> button = _buttons->get(i);
if (!button.isNull()) {
width += button->getMinSize().x;
int h = button->getMinSize().x;
int h = button->getMinSize().y;
if (h > rc.height())
return;
}
Expand Down Expand Up @@ -1321,7 +1321,7 @@ void CRToolBarSkin::drawToolBar( LVDrawBuf & buf, const lvRect & rect, bool enab
} else
rc2.bottom = rc2.top + button->getMinSize().y;
button->drawButton( buf, rc2, flags );
offsetX = rc2.right;
offsetX = rc2.right - rc.left;
}
}
}
Expand Down Expand Up @@ -1900,13 +1900,9 @@ bool CRSkinContainer::readToolBarSkin( const lChar16 * path, CRToolBarSkin * re
flg = readRectSkin( path, res ) || flg;

lString16 buttonspath = p + L"/button";
CRButtonListRef buttons;
bool buttonsFlag = false;
CRLog::trace("Reading buttons");
buttons = readButtons( buttonspath.c_str(), &buttonsFlag);
CRLog::trace("Buttons have been read");
CRButtonListRef buttons = readButtons( buttonspath.c_str(), &buttonsFlag);
if ( buttonsFlag ) {
CRLog::trace("count = %d", buttons->length());
res->setButtons( buttons );
flg = true;
}
Expand Down
4 changes: 2 additions & 2 deletions crengine/src/lvdocview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4833,8 +4833,8 @@ CRPropRef LVDocView::propsApply(CRPropRef props) {
== PROP_PAGE_MARGIN_LEFT || name == PROP_PAGE_MARGIN_RIGHT
|| name == PROP_PAGE_MARGIN_BOTTOM) {
lUInt32 margin = props->getIntDef(name.c_str(), 8);
if (margin > 30)
margin = 30;
if (margin > 130)
margin = 130;
lvRect rc = getPageMargins();
if (name == PROP_PAGE_MARGIN_TOP)
rc.top = margin;
Expand Down
10 changes: 6 additions & 4 deletions tools/toolchain-arm-gnu-eabi-pocketbook.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_VERSION 1)

# specify the cross compiler
SET(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabi-gcc)
SET(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabi-g++)
SET(CMAKE_STRIP /usr/local/pocketbook/bin/arm-linux-gnueabi-strip)
SET(CMAKE_C_COMPILER /usr/bin/arm-none-linux-gnueabi-gcc)
SET(CMAKE_CXX_COMPILER /usr/bin/arm-none-linux-gnueabi-g++)
SET(CMAKE_STRIP /usr/bin/arm-none-linux-gnueabi-strip)

# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /usr/local/pocketbook_eabi)
SET(CMAKE_FIND_ROOT_PATH /usr/arm-none-linux-gnueabi)

include_directories(/usr/arm-none-linux-gnueabi/include/c++/4.1.2)

# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
Expand Down

0 comments on commit b38f3fe

Please sign in to comment.