Skip to content

Commit

Permalink
PocketBook port initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
pkb committed Apr 6, 2011
1 parent 1568d6c commit 1649b67
Show file tree
Hide file tree
Showing 50 changed files with 1,296 additions and 4 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,18 @@ elseif ( ${GUI} STREQUAL WX )
ENDIF (wxWidgets_FOUND)
ADD_SUBDIRECTORY(crengine)
ADD_SUBDIRECTORY(cr3wx)
elseif ( ${GUI} STREQUAL CRGUI_PB )
message("Will make CR3GUI for PocketBook")
ADD_DEFINITIONS( -DLBOOK=1 -DCR_POCKETBOOK=1
${CRGUI_DEFS} -DENABLE_UPDATE_MODE_SETTING=1 )
ADD_SUBDIRECTORY(crengine)
ADD_SUBDIRECTORY(cr3gui)
FIND_PATH (INKVIEW_INCLUDE_DIR inkview.h)
IF (INKVIEW_INCLUDE_DIR)
include_directories(${INKVIEW_INCLUDE_DIR})
ELSE (INKVIEW_INCLUDE_DIR)
message("inkview.h not found")
ENDIF (INKVIEW_INCLUDE_DIR)
else ( ${GUI} STREQUAL CRGUI_XCB )
message("Unknown GUI type ${GUI}")
endif ( ${GUI} STREQUAL CRGUI_XCB )
5 changes: 5 additions & 0 deletions README.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ cd v3abuild
cmake -D DEVICE_NAME=v3a -D MAX_IMAGE_SCALE_MUL=2 -D CMAKE_TOOLCHAIN_FILE=../tools/toolchain-arm-v5.cmake -D GUI=CRGUI_NANOX -D GRAY_BACKBUFFER_BITS=4 -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=dest -D DOC_DATA_COMPRESSION_LEVEL=1 -D DOC_BUFFER_SIZE=0x1000000 ..
make

# Building ARM 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-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

==============================
*** QT Build under Windows ***
Expand Down
22 changes: 22 additions & 0 deletions cr3gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,28 @@ elseif ( ${GUI} STREQUAL CRGUI_WIN32 )
FILES_MATCHING PATTERN "*.mo" )
SET (CR3_BIN_DESTINATION )

elseif (${GUI} STREQUAL CRGUI_PB)
SET(CR3_SOURCES ${CR3_SOURCES} src/cr3pocketbook.cpp)
FIND_LIBRARY(INKVIEW_LIB inkview)
IF (INKVIEW_LIB)
SET (EXTRA_LIBS ${INKVIEW_LIB})
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" )
INSTALL( DIRECTORY data/hyph/ DESTINATION system/share/cr3/hyph
FILES_MATCHING PATTERN "*.pattern" )
INSTALL( DIRECTORY data/devices/${DEVICE_NAME}/skins/default/ DESTINATION system/share/cr3/skin )
INSTALL( DIRECTORY data/devices/${DEVICE_NAME}/keymaps/ DESTINATION system/share/cr3/keymaps )
INSTALL( DIRECTORY data/manual/ DESTINATION system/share/cr3/manual )

FOREACH(LANGUAGE ${LANGUAGES})
SET(MO_FILE "${CMAKE_BINARY_DIR}/i18n/${LANGUAGE}/LC_MESSAGES/cr3.mo")
INSTALL(FILES ${MO_FILE} DESTINATION system/share/cr3/i18n RENAME ${LANGUAGE}.mo)
ENDFOREACH(LANGUAGE ${LANGUAGES})

endif ( ${GUI} STREQUAL CRGUI_XCB )


Expand Down
31 changes: 31 additions & 0 deletions cr3gui/data/devices/pb360/keymaps/kblayout.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#english, virtual keyboard
[english.vk]
1=abcdefghij
2=klmnopqrst
3=uvwxyz-'.
4=,!?;:"_+*$
5=1234567890
#english, T5 keyboard
[english.tx]
1=abcde
2=fghij
3=klmno
4=pqrst
5=uvwxyz
#russian, virtual keyboard
[russian.vk]
1=абвгдеёжзи
2=йклмнопрст
3=уфхцчшщъыь
4=эюя-'.,!?
5=1234567890

#russian, T5 keyboard
[russian.tx]
1=абвгде
2=ёжзийк
3=лмнопр
4=стуфхц
5=чшщъыьэюя
188 changes: 188 additions & 0 deletions cr3gui/data/devices/pb360/keymaps/keydefs.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
#======================================
# Cool Reader 3
# Definition file for keymaps
#======================================

#######################################
# key codes


KEY_BACK = 0x1b
KEY_DELETE = 0x08
KEY_OK = 0x0a
KEY_UP = 0x11
KEY_DOWN = 0x12
KEY_LEFT = 0x13
KEY_RIGHT = 0x14
KEY_MINUS = 0x15
KEY_PLUS = 0x16
KEY_MENU = 0x17
KEY_MUSIC = 0x1e
KEY_POWER = 0x01
KEY_PREV = 0x18
KEY_NEXT = 0x19
KEY_PREV2 = 0x1c
KEY_NEXT2 = 0x1d

KEY_0 = 0x30
KEY_1 = 0x31
KEY_2 = 0x32
KEY_3 = 0x33
KEY_4 = 0x34
KEY_5 = 0x35
KEY_6 = 0x36
KEY_7 = 0x37
KEY_8 = 0x38
KEY_9 = 0x39

#######################################
# key modifiers

LONG = 1

#######################################
# command name definitions

#definitions from lvdocview.h
DCMD_BEGIN = 100
DCMD_LINEUP = 101
DCMD_PAGEUP = 102
DCMD_PAGEDOWN = 103
DCMD_LINEDOWN = 104
DCMD_LINK_FORWARD = 105
DCMD_LINK_BACK = 106
DCMD_LINK_NEXT = 107
DCMD_LINK_PREV = 108
DCMD_LINK_GO = 109
DCMD_END = 110
DCMD_GO_POS = 111
DCMD_GO_PAGE = 112
DCMD_ZOOM_IN = 113
DCMD_ZOOM_OUT = 114
DCMD_TOGGLE_TEXT_FORMAT = 115
DCMD_BOOKMARK_SAVE_N = 116
DCMD_BOOKMARK_GO_N = 117
DCMD_MOVE_BY_CHAPTER = 118
DCMD_GO_SCROLL_POS = 119
DCMD_TOGGLE_PAGE_SCROLL_VIEW = 120
DCMD_LINK_FIRST = 121
DCMD_ROTATE_BY = 122
DCMD_ROTATE_SET = 123
DCMD_SAVE_HISTORY = 124
DCMD_SAVE_TO_CACHE = 125
DCMD_TOGGLE_BOLD = 126

#definitions from crgui.h
MCMD_CANCEL=500
MCMD_OK=501
MCMD_SCROLL_FORWARD=502
MCMD_SCROLL_BACK=503
MCMD_SELECT_0=504
MCMD_SELECT_1=505
MCMD_SELECT_2=506
MCMD_SELECT_3=507
MCMD_SELECT_4=508
MCMD_SELECT_5=509
MCMD_SELECT_6=510
MCMD_SELECT_7=511
MCMD_SELECT_8=512
MCMD_SELECT_9=513
MCMD_SELECT_0_LONG=514
MCMD_SELECT_1_LONG=515
MCMD_SELECT_2_LONG=516
MCMD_SELECT_3_LONG=517
MCMD_SELECT_4_LONG=518
MCMD_SELECT_5_LONG=519
MCMD_SELECT_6_LONG=520
MCMD_SELECT_7_LONG=521
MCMD_SELECT_8_LONG=522
MCMD_SELECT_9_LONG=523
MCMD_SCROLL_FORWARD_LONG=524
MCMD_SCROLL_BACK_LONG=525
MCMD_CLEAR=526

#use this command to pass key to parent window/app
GCMD_PASS_TO_PARENT=550

#definitions from mainwnd.h
MCMD_QUIT = 201
MCMD_MAIN_MENU = 202
MCMD_GO_PAGE = 203
#MCMD_GO_PAGE_APPLY = 204
MCMD_SETTINGS = 205
#MCMD_SETTINGS_APPLY = 206
MCMD_SETTINGS_FONTSIZE = 207
MCMD_SETTINGS_ORIENTATION = 208
MCMD_GO_LINK = 209
#MCMD_GO_LINK_APPLY = 210
MCMD_LONG_FORWARD = 211
MCMD_LONG_BACK = 212
MCMD_DICT = 213
MCMD_BOOKMARK_LIST = 214
MCMD_RECENT_BOOK_LIST = 215
#MCMD_OPEN_RECENT_BOOK = 216
MCMD_ABOUT = 217
MCMD_CITE = 218
MCMD_SEARCH = 219
MCMD_SEARCH_FINDFIRST = 220
MCMD_DICT_VKEYBOARD = 221
MCMD_DICT_FIND = 222
MCMD_KBD_NEXTLAYOUT = 223
MCMD_KBD_PREVLAYOUT = 224
MCMD_HELP = 225
MCMD_HELP_KEYS = 226
MCMD_SWITCH_TO_RECENT_BOOK = 227
MCMD_NEXT_MODE = 228
MCMD_PREV_MODE = 229
MCMD_BOOKMARK_LIST_GO_MODE = 230
MCMD_GO_PERCENT = 231
#MCMD_GO_PERCENT_APPLY = 232



# txtselector.h
CMD_SEL_MIDDLE_WORD = 4500
CMD_SEL_MIDDLE_SENTENCE = 4501
CMD_SEL_MIDDLE_PARA = 4502
CMD_SEL_MIDDLE_INTERVAL = 4503
CMD_SEL_CUR_MODE_TOGGLE = 4504
CMD_SEL_CUR_MODE_START = 4505
CMD_SEL_CUR_MODE_END = 4506
CMD_SEL_CUR_MODE_ALL = 4507
CMD_SEL_CUR_INTERVAL_TOGGLE = 4508
CMD_SEL_CUR_INTERVAL_WORD = 4509
CMD_SEL_CUR_INTERVAL_SENTENCE = 4510
CMD_SEL_CUR_INTERVAL_PARA = 4511
CMD_SEL_START_FWD_BY_WORD = 4512
CMD_SEL_START_FWD_BY_SENTENCE = 4513
CMD_SEL_START_FWD_BY_PARA = 4514
CMD_SEL_START_FWD_BY_INTERVAL = 4515
CMD_SEL_START_BACK_BY_WORD = 4516
CMD_SEL_START_BACK_BY_SENTENCE = 4517
CMD_SEL_START_BACK_BY_PARA = 4518
CMD_SEL_START_BACK_BY_INTERVAL = 4519
CMD_SEL_END_FWD_BY_WORD = 4520
CMD_SEL_END_FWD_BY_SENTENCE = 4521
CMD_SEL_END_FWD_BY_PARA = 4522
CMD_SEL_END_FWD_BY_INTERVAL = 4523
CMD_SEL_END_BACK_BY_WORD = 4524
CMD_SEL_END_BACK_BY_SENTENCE = 4525
CMD_SEL_END_BACK_BY_PARA = 4526
CMD_SEL_END_BACK_BY_INTERVAL = 4527
CMD_SEL_ALL_FWD_BY_WORD = 4528
CMD_SEL_ALL_FWD_BY_SENTENCE = 4529
CMD_SEL_ALL_FWD_BY_PARA = 4530
CMD_SEL_ALL_FWD_BY_INTERVAL = 4531
CMD_SEL_ALL_BACK_BY_WORD = 4532
CMD_SEL_ALL_BACK_BY_SENTENCE = 4533
CMD_SEL_ALL_BACK_BY_PARA = 4534
CMD_SEL_ALL_BACK_BY_INTERVAL = 4535
CMD_SEL_CUR_FWD_BY_WORD = 4536
CMD_SEL_CUR_FWD_BY_SENTENCE = 4537
CMD_SEL_CUR_FWD_BY_PARA = 4538
CMD_SEL_CUR_FWD_BY_INTERVAL = 4539
CMD_SEL_CUR_BACK_BY_WORD = 4540
CMD_SEL_CUR_BACK_BY_SENTENCE = 4541
CMD_SEL_CUR_BACK_BY_PARA = 4542
CMD_SEL_CUR_BACK_BY_INTERVAL = 4543

104 changes: 104 additions & 0 deletions cr3gui/data/devices/pb360/keymaps/keymaps.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#===========================================================
# CoolReader3
# Key to Command map file
#
# all identifiers should be declared in keydefs.ini
#===========================================================

#main viewer window, commands possible to use in override

[main-override-commands]

#main viewer window, keys possible to override
[main-override-keys]
'1' = KEY_1
'2' = KEY_2
'3' = KEY_3
'4' = KEY_4
'5' = KEY_5
'6' = KEY_6
'7' = KEY_7
'8' = KEY_8
'9' = KEY_9
'0' = KEY_0

# key translation map for different screen orientations
[key-substitution-90]
KEY_LEFT = KEY_DOWN
KEY_RIGHT = KEY_UP
KEY_DOWN = KEY_RIGHT
KEY_UP = KEY_LEFT
[key-substitution-180]
KEY_LEFT = KEY_RIGHT
KEY_RIGHT = KEY_LEFT
KEY_DOWN = KEY_UP
KEY_UP = KEY_DOWN
KEY_NEXT = KEY_PREV
KEY_PREV = KEY_NEXT
KEY_PREV2 = KEY_NEXT2
KEY_NEXT2 = KEY_PREV2
[key-substitution-270]
KEY_LEFT = KEY_UP
KEY_RIGHT = KEY_DOWN
KEY_DOWN = KEY_LEFT
KEY_UP = KEY_RIGHT

# main viewer window
[main]
KEY_LEFT = DCMD_PAGEUP
KEY_PREV = DCMD_PAGEUP
KEY_PREV, LONG = DCMD_PAGEUP, 10
KEY_RIGHT = DCMD_PAGEDOWN
KEY_NEXT = DCMD_PAGEDOWN
KEY_NEXT, LONG = DCMD_PAGEDOWN, 10
KEY_OK = MCMD_MAIN_MENU
KEY_UP = DCMD_ZOOM_IN
KEY_DOWN = DCMD_ZOOM_OUT
KEY_PREV, LONG = MCMD_QUIT

[menu]
KEY_LEFT = MCMD_CANCEL
KEY_OK = MCMD_OK

KEY_UP = MCMD_SCROLL_FORWARD
KEY_DOWN = MCMD_SCROLL_BACK
KEY_UP, LONG = MCMD_SCROLL_FORWARD_LONG
KEY_DOWN, LONG = MCMD_SCROLL_BACK_LONG
KEY_NEXT, LONG = MCMD_LONG_FORWARD
KEY_PREV, LONG = MCMD_LONG_BACK

[menu10]

[dialog]
KEY_LEFT = MCMD_CANCEL
KEY_OK = MCMD_OK
KEY_NEXT = MCMD_SCROLL_FORWARD
KEY_PREV = MCMD_SCROLL_BACK
KEY_UP = MCMD_SCROLL_FORWARD
KEY_DOWN = MCMD_SCROLL_BACK
KEY_NEXT, LONG = MCMD_SCROLL_FORWARD_LONG
KEY_PREV, LONG = MCMD_SCROLL_BACK_LONG


[vkeyboard]

[txkeyboard]

# custom document view dialog
[browse]

# this is Main Menu definition
# place items for main menu here
# left side will be ignored
[mainMenuItems]
1 = MCMD_ABOUT
2 = MCMD_GO_PAGE
3 = MCMD_RECENT_BOOK_LIST
4 = MCMD_DICT
5 = MCMD_CITE
6 = MCMD_BOOKMARK_LIST
7 = MCMD_SEARCH
8 = MCMD_SETTINGS
9 = MCMD_HELP
10 = MCMD_HELP_KEYS
11 = MCMD_GO_PERCENT
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cr3gui/data/devices/pb360/skins/default/cr-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1649b67

Please sign in to comment.