Skip to content

Commit

Permalink
Changes to build for PB wine emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
pkb committed Apr 10, 2011
1 parent e7e2da1 commit 67de013
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,15 @@ if (NOT FREETYPE_FOUND)
SET(FREETYPE_LIBRARIES freetype)
endif (NOT FREETYPE_FOUND)

if (ENABLE_CHM)
message("Will build patched LIBCHM library")
ADD_SUBDIRECTORY(thirdparty/chmlib)
SET(CHM_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/chmlib)
SET(CHM_LIBRARIES chmlib)
ADD_DEFINITIONS(-DCHM_SUPPORT_ENABLED=1)
else()
ADD_DEFINITIONS(-DCHM_SUPPORT_ENABLED=0)
endif(ENABLE_CHM)

if (ENABLE_ANTIWORD)
message("Will build patched ANTIWORD library")
Expand Down
4 changes: 4 additions & 0 deletions README.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ cd pb360
cmake -D DEVICE_NAME=pb360 -D CMAKE_INSTALL_PREFIX=/usr/local/pocketbook/mnt/ext1 -D CMAKE_TOOLCHAIN_FILE=../tools/toolchain-arm-pocketbook.cmake -D MAX_IMAGE_SCALE_MUL=2 -D CMAKE_BUILD_TYPE=Release -D GUI=CRGUI_PB -D USE_EXTERNAL_EDICT_DICTIONARY=1 ..
make

# Building Wine version for PocketBook:
mkdir pb360
cd pb360
cmake -D DEVICE_NAME=pb360 -D CMAKE_INSTALL_PREFIX=/usr/local/pocketbook/mnt/ext1 -D CMAKE_TOOLCHAIN_FILE=../tools/toolchain-wine-pocketbook.cmake -D MAX_IMAGE_SCALE_MUL=2 -D CMAKE_BUILD_TYPE=Debug -D CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING="-mwindows -m32" -D GUI=CRGUI_PB -D USE_EXTERNAL_EDICT_DICTIONARY=1 ..
==============================
*** QT Build under Windows ***
==============================
Expand Down
2 changes: 1 addition & 1 deletion cr3gui/src/dictdlg.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <stdexcept>
//#include <cstdlib>
#include "dictdlg.h"
#include <lvstring.h>
Expand All @@ -11,7 +12,6 @@
#include <lvstring.h>
#include <lvtinydom.h>
#include <lvdocview.h>
#include <stdexcept>
#include "mainwnd.h"
#include "viewdlg.h"
#include "bgfit.h"
Expand Down
3 changes: 2 additions & 1 deletion crengine/src/lvdocview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3214,7 +3214,7 @@ bool LVDocView::LoadDocument(LVStreamRef stream) {
return true;
}
}

#if CHM_SUPPORT_ENABLED == 1
if ( DetectCHMFormat( m_stream ) ) {
// CHM
CRLog::info("CHM format detected");
Expand Down Expand Up @@ -3245,6 +3245,7 @@ bool LVDocView::LoadDocument(LVStreamRef stream) {
return true;
}
}
#endif

#if ENABLE_ANTIWORD==1
if ( DetectWordFormat( m_stream ) ) {
Expand Down
12 changes: 6 additions & 6 deletions crengine/src/lvstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ class LVFileMappedStream : public LVNamedStream
// WIN32
__int64 offset = size - 1;
lUInt32 pos_low = (lUInt32)((__int64)offset & 0xFFFFFFFF);
long pos_high = (long)(((__int64)offset >> 32) & 0xFFFFFFFF);
LONG pos_high = (long)(((__int64)offset >> 32) & 0xFFFFFFFF);
pos_low = SetFilePointer(m_hFile, pos_low, &pos_high, FILE_BEGIN );
if (pos_low == 0xFFFFFFFF) {
lUInt32 err = GetLastError();
Expand Down Expand Up @@ -736,7 +736,7 @@ class LVFileMappedStream : public LVNamedStream
}
// check size
lUInt32 hw=0;
m_size = GetFileSize( m_hFile, &hw );
m_size = GetFileSize( m_hFile, (LPDWORD)&hw );
#if LVLONG_FILE_SUPPORT
if (hw)
m_size |= (((lvsize_t)hw)<<32);
Expand Down Expand Up @@ -1009,7 +1009,7 @@ class LVFileStream : public LVNamedStream
return LVERR_FAIL; // EOF

lUInt32 dwBytesRead = 0;
if (ReadFile( m_hFile, buf, (lUInt32)count, &dwBytesRead, NULL )) {
if (ReadFile( m_hFile, buf, (lUInt32)count, (LPDWORD)&dwBytesRead, NULL )) {
if (nBytesRead)
*nBytesRead = dwBytesRead;
m_pos += dwBytesRead;
Expand Down Expand Up @@ -1097,7 +1097,7 @@ class LVFileStream : public LVNamedStream
return LVERR_FAIL;
//
lUInt32 dwBytesWritten = 0;
if (WriteFile( m_hFile, buf, (lUInt32)count, &dwBytesWritten, NULL )) {
if (WriteFile( m_hFile, buf, (lUInt32)count, (LPDWORD)&dwBytesWritten, NULL )) {
if (nBytesWritten)
*nBytesWritten = dwBytesWritten;
m_pos += dwBytesWritten;
Expand Down Expand Up @@ -1133,7 +1133,7 @@ class LVFileStream : public LVNamedStream
if (m_hFile == INVALID_HANDLE_VALUE)
return LVERR_FAIL;
lUInt32 pos_low = (lUInt32)((__int64)offset & 0xFFFFFFFF);
long pos_high = (long)(((__int64)offset >> 32) & 0xFFFFFFFF);
LONG pos_high = (LONG)(((__int64)offset >> 32) & 0xFFFFFFFF);
lUInt32 m=0;
switch (origin) {
case LVSEEK_SET:
Expand Down Expand Up @@ -1267,7 +1267,7 @@ class LVFileStream : public LVNamedStream
// set file size and position
m_mode = (lvopen_mode_t)mode;
lUInt32 hw=0;
m_size = GetFileSize( m_hFile, &hw );
m_size = GetFileSize( m_hFile, (LPDWORD)&hw );
#if LVLONG_FILE_SUPPORT
if (hw)
m_size |= (((lvsize_t)hw)<<32);
Expand Down
2 changes: 1 addition & 1 deletion crengine/src/lvtinydom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10552,7 +10552,7 @@ void runBasicTinyDomUnitTests()

void runCHMUnitTest()
{
#if BUILD_LITE!=1
#if CHM_SUPPORT_ENABLED == 1
LVStreamRef stream = LVOpenFileStream("/home/lve/src/test/mysql.chm", LVOM_READ);
MYASSERT ( !stream.isNull(), "container stream opened" );
CRLog::trace("runCHMUnitTest() -- file stream opened ok");
Expand Down
13 changes: 13 additions & 0 deletions tools/toolchain-wine-pocketbook.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# CMake toolchain file for building Pocketbook Free SDK software using

# specify the cross compiler
SET(CMAKE_C_COMPILER winegcc)
SET(CMAKE_CXX_COMPILER wineg++)

SET(CMAKE_FIND_ROOT_PATH /usr/local/pocketbook)

SET(CMAKE_C_FLAGS "-g -mwindows -m32")
SET(CMAKE_CXX_FLAGS "-g -mwindows -m32")

ADD_DEFINITIONS( -DCR_EMULATE_GETTEXT=1)

0 comments on commit 67de013

Please sign in to comment.