Skip to content

Commit 0a54431

Browse files
committed
megre koreader port
2 parents 72f4fe8 + 8bb69b0 commit 0a54431

File tree

248 files changed

+721570
-1093
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

248 files changed

+721570
-1093
lines changed

CMakeLists.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,14 @@ else()
148148
SET(USE_UNRAR 0)
149149
endif(DEFINED USE_UNRAR)
150150

151+
find_path(NANOSVG_INCLUDE_DIR nanosvg.h DOC "Path to NanoSVG include dir")
152+
if (NOT NANOSVG_INCLUDE_DIR)
153+
SET(NANOSVG_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/nanosvg/src)
154+
endif(NOT NANOSVG_INCLUDE_DIR)
155+
156+
ADD_DEFINITIONS(-DUSE_NANOSVG=1)
157+
INCLUDE_DIRECTORIES(${NANOSVG_INCLUDE_DIR})
158+
151159
if (MAC)
152160
message("will use zlib, libpng, libjpeg, freetype from Qt static library")
153161
SET(ZLIB_INCLUDE_DIR ${QT_3RDPARTY_DIR}/zlib)
@@ -245,6 +253,21 @@ else()
245253
set(DESKTOP_DEFS ${DESKTOP_DEFS} -DUSE_FONTCONFIG=0)
246254
endif (FONTCONFIG_FOUND)
247255

256+
if (NOT MSVC)
257+
find_package(FriBidi)
258+
endif(NOT MSVC)
259+
260+
if (NOT FRIBIDI_FOUND)
261+
message("System FriBidi not found, will build local one\n")
262+
ADD_SUBDIRECTORY(thirdparty/fribidi)
263+
SET(FRIBIDI_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/fribidi/lib)
264+
SET(FRIBIDI_LIBRARY fribidi)
265+
set(DESKTOP_DEFS ${DESKTOP_DEFS} -DBUNDLED_FRIBIDI=1 -I${CMAKE_BINARY_DIR}/thirdparty/fribidi)
266+
endif (NOT FRIBIDI_FOUND)
267+
268+
set(DESKTOP_DEFS ${DESKTOP_DEFS} -DUSE_FRIBIDI=1)
269+
270+
248271
endif (NOT MAC)
249272

250273
#if (ENABLE_CHM)
@@ -275,6 +298,7 @@ INCLUDE_DIRECTORIES(
275298
${HARFBUZZ_INCLUDE_DIR}
276299
${ANTIWORD_INCLUDE_DIR}
277300
${CHM_INCLUDE_DIR}
301+
${FRIBIDI_INCLUDE_DIR}
278302
)
279303

280304
if ( ${GUI} STREQUAL FB2PROPS )
@@ -291,6 +315,8 @@ SET(STD_LIBS
291315
${CHM_LIBRARIES}
292316
${ZLIB_LIBRARIES}
293317
${ANTIWORD_LIBRARIES}
318+
${FRIBIDI_LIBRARIES}
319+
qimagescale
294320
)
295321
if (FONTCONFIG_FOUND)
296322
set(STD_LIBS ${STD_LIBS} ${FONTCONFIG_LIBRARIES})

android/.idea/modules.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

android/app/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ include_directories(${CR3_ROOT}/thirdparty/libjpeg)
1919
include_directories(${CR3_ROOT}/thirdparty/antiword)
2020
include_directories(${CR3_ROOT}/thirdparty/chmlib/src)
2121
include_directories(${CR3_ROOT}/thirdparty/nanosvg/src)
22+
include_directories(${CR3_ROOT}/thirdparty/fribidi/lib)
23+
include_directories(thirdparty_libs/fribidi/lib)
2224

2325
add_definitions(-DLINUX=1 -D_LINUX=1 -DFOR_ANDROID=1 -DCR3_PATCH)
2426
add_definitions(-DFT_CONFIG_MODULES_H=<builds/android/include/config/ftmodule.h> -DFT_CONFIG_OPTIONS_H=<builds/android/include/config/ftoption.h>)
@@ -28,6 +30,7 @@ add_definitions(-DLDOM_USE_OWN_MEM_MAN=0)
2830
add_definitions(-DCR3_ANTIWORD_PATCH=1 -DENABLE_ANTIWORD=1)
2931
add_definitions(-DMAX_IMAGE_SCALE_MUL=2)
3032
add_definitions(-DUSE_NANOSVG=1)
33+
add_definitions(-DUSE_FRIBIDI=1 -DBUNDLED_FRIBIDI=1)
3134

3235
#set(LOCAL_CFLAGS "-Wno-psabi -Wno-unused-variable -Wno-sign-compare -Wno-write-strings -Wno-main -Wno-unused-but-set-variable -Wno-unused-function -Wall")
3336
# Option '-Wl,--no-merge-exidx-entries' removed as incompatible with clang.
@@ -162,6 +165,7 @@ target_link_libraries( # Specifies the target library.
162165
harfbuzz
163166
chmlib
164167
antiword
168+
fribidi
165169

166170
# Links the target library to the log library
167171
# included in the NDK.

android/app/thirdparty_libs/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ add_subdirectory(freetype)
55
add_subdirectory(harfbuzz)
66
add_subdirectory(chmlib)
77
add_subdirectory(antiword)
8+
add_subdirectory(fribidi)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
LOCAL_PATH := $(call my-dir)
3+
4+
include $(CLEAR_VARS)
5+
6+
LOCAL_MODULE := local_fribidi
7+
8+
FRIBIDI_SRC_DIR := ../../../../thirdparty/fribidi
9+
FRIBIDI_SRC_DIR_P := $(LOCAL_PATH)/../../../../thirdparty/fribidi
10+
FRIBIDI_CONFIG_DIR_P := $(LOCAL_PATH)
11+
12+
LOCAL_C_INCLUDES := \
13+
$(FRIBIDI_CONFIG_DIR_P) \
14+
$(FRIBIDI_CONFIG_DIR_P)/lib \
15+
$(FRIBIDI_SRC_DIR_P)/lib
16+
17+
LOCAL_CFLAGS += -DHAVE_CONFIG_H=1
18+
LOCAL_CFLAGS += -funwind-tables -Wl,--no-merge-exidx-entries
19+
20+
LOCAL_SRC_FILES := \
21+
$(FRIBIDI_SRC_DIR)/lib/fribidi.c \
22+
$(FRIBIDI_SRC_DIR)/lib/fribidi-arabic.c \
23+
$(FRIBIDI_SRC_DIR)/lib/fribidi-bidi.c \
24+
$(FRIBIDI_SRC_DIR)/lib/fribidi-bidi-types.c \
25+
$(FRIBIDI_SRC_DIR)/lib/fribidi-char-sets.c \
26+
$(FRIBIDI_SRC_DIR)/lib/fribidi-char-sets-cap-rtl.c \
27+
$(FRIBIDI_SRC_DIR)/lib/fribidi-char-sets-cp1255.c \
28+
$(FRIBIDI_SRC_DIR)/lib/fribidi-char-sets-cp1256.c \
29+
$(FRIBIDI_SRC_DIR)/lib/fribidi-char-sets-iso8859-6.c \
30+
$(FRIBIDI_SRC_DIR)/lib/fribidi-char-sets-iso8859-8.c \
31+
$(FRIBIDI_SRC_DIR)/lib/fribidi-char-sets-utf8.c \
32+
$(FRIBIDI_SRC_DIR)/lib/fribidi-deprecated.c \
33+
$(FRIBIDI_SRC_DIR)/lib/fribidi-joining.c \
34+
$(FRIBIDI_SRC_DIR)/lib/fribidi-joining-types.c \
35+
$(FRIBIDI_SRC_DIR)/lib/fribidi-mirroring.c \
36+
$(FRIBIDI_SRC_DIR)/lib/fribidi-brackets.c \
37+
$(FRIBIDI_SRC_DIR)/lib/fribidi-run.c \
38+
$(FRIBIDI_SRC_DIR)/lib/fribidi-shape.c \
39+
40+
include $(BUILD_STATIC_LIBRARY)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
project(fribidi C)
2+
3+
cmake_minimum_required(VERSION 3.4)
4+
5+
set(FRIBIDI_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../../../thirdparty/fribidi")
6+
set(FRIBIDI_CONFIG_DIR "${PROJECT_SOURCE_DIR}")
7+
8+
include_directories(${FRIBIDI_SOURCE_DIR})
9+
include_directories(${FRIBIDI_CONFIG_DIR})
10+
include_directories(${FRIBIDI_CONFIG_DIR}/lib)
11+
add_definitions(-DHAVE_CONFIG_H=1)
12+
13+
set(FRIBIDI_SOURCE
14+
${FRIBIDI_SOURCE_DIR}/lib/fribidi.c
15+
${FRIBIDI_SOURCE_DIR}/lib/fribidi-arabic.c
16+
${FRIBIDI_SOURCE_DIR}/lib/fribidi-bidi.c
17+
${FRIBIDI_SOURCE_DIR}/lib/fribidi-bidi-types.c
18+
${FRIBIDI_SOURCE_DIR}/lib/fribidi-char-sets.c
19+
${FRIBIDI_SOURCE_DIR}/lib/fribidi-char-sets-cap-rtl.c
20+
${FRIBIDI_SOURCE_DIR}/lib/fribidi-char-sets-cp1255.c
21+
${FRIBIDI_SOURCE_DIR}/lib/fribidi-char-sets-cp1256.c
22+
${FRIBIDI_SOURCE_DIR}/lib/fribidi-char-sets-iso8859-6.c
23+
${FRIBIDI_SOURCE_DIR}/lib/fribidi-char-sets-iso8859-8.c
24+
${FRIBIDI_SOURCE_DIR}/lib/fribidi-char-sets-utf8.c
25+
${FRIBIDI_SOURCE_DIR}/lib/fribidi-deprecated.c
26+
${FRIBIDI_SOURCE_DIR}/lib/fribidi-joining.c
27+
${FRIBIDI_SOURCE_DIR}/lib/fribidi-joining-types.c
28+
${FRIBIDI_SOURCE_DIR}/lib/fribidi-mirroring.c
29+
${FRIBIDI_SOURCE_DIR}/lib/fribidi-brackets.c
30+
${FRIBIDI_SOURCE_DIR}/lib/fribidi-run.c
31+
${FRIBIDI_SOURCE_DIR}/lib/fribidi-shape.c
32+
)
33+
34+
add_library(fribidi STATIC ${FRIBIDI_SOURCE})
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/* config.h. Generated from config.h.in by configure. */
2+
/* config.h.in. Generated from configure.ac by autoheader. */
3+
4+
/* Define to 1 if you want to include debug code in the library */
5+
/* #undef DEBUG */
6+
7+
/* Don not build deprecated functionality */
8+
/* #undef FRIBIDI_NO_DEPRECATED */
9+
10+
/* Define to 1 if you have the <asm/page.h> header file. */
11+
/* #undef HAVE_ASM_PAGE_H */
12+
13+
/* Define to 1 if you have the <dlfcn.h> header file. */
14+
#define HAVE_DLFCN_H 1
15+
16+
/* Define to 1 if you have the <inttypes.h> header file. */
17+
#define HAVE_INTTYPES_H 1
18+
19+
/* Define to 1 if you have the `memmove' function. */
20+
#define HAVE_MEMMOVE 1
21+
22+
/* Define to 1 if you have the <memory.h> header file. */
23+
#define HAVE_MEMORY_H 1
24+
25+
/* Define to 1 if you have the `memset' function. */
26+
#define HAVE_MEMSET 1
27+
28+
/* Define to 1 if you have the <stdint.h> header file. */
29+
#define HAVE_STDINT_H 1
30+
31+
/* Define to 1 if you have the <stdlib.h> header file. */
32+
#define HAVE_STDLIB_H 1
33+
34+
/* Define to 1 if you have the `strdup' function. */
35+
#define HAVE_STRDUP 1
36+
37+
/* Define to 1 if cpp supports the ANSI # stringizing operator. */
38+
#define HAVE_STRINGIZE 1
39+
40+
/* Define to 1 if you have the <strings.h> header file. */
41+
#define HAVE_STRINGS_H 1
42+
43+
/* Define to 1 if you have the <string.h> header file. */
44+
#define HAVE_STRING_H 1
45+
46+
/* Define to 1 if you have the <sys/stat.h> header file. */
47+
#define HAVE_SYS_STAT_H 1
48+
49+
/* Define to 1 if you have the <sys/times.h> header file. */
50+
#define HAVE_SYS_TIMES_H 1
51+
52+
/* Define to 1 if you have the <sys/types.h> header file. */
53+
#define HAVE_SYS_TYPES_H 1
54+
55+
/* Define to 1 if you have the <unistd.h> header file. */
56+
#define HAVE_UNISTD_H 1
57+
58+
/* Define to 1 if you have the <wchar.h> header file. */
59+
#define HAVE_WCHAR_H 1
60+
61+
/* Define to the sub-directory where libtool stores uninstalled libraries. */
62+
#define LT_OBJDIR ".libs/"
63+
64+
/* Define to the address where bug reports for this package should be sent. */
65+
#define PACKAGE_BUGREPORT "https://github.com/fribidi/fribidi/issues/new"
66+
67+
/* Define to the full name of this package. */
68+
#define PACKAGE_NAME "GNU FriBidi"
69+
70+
/* Define to the full name and version of this package. */
71+
#define PACKAGE_STRING "GNU FriBidi 1.0.8"
72+
73+
/* Define to the one symbol short name of this package. */
74+
#define PACKAGE_TARNAME "fribidi"
75+
76+
/* Define to the home page for this package. */
77+
#define PACKAGE_URL "http://fribidi.org/"
78+
79+
/* Define to the version of this package. */
80+
#define PACKAGE_VERSION "1.0.8"
81+
82+
/* Define as the return type of signal handlers (`int' or `void'). */
83+
#define RETSIGTYPE void
84+
85+
/* The size of `int', as computed by sizeof. */
86+
#define SIZEOF_INT 4
87+
88+
/* The size of `short', as computed by sizeof. */
89+
#define SIZEOF_SHORT 2
90+
91+
/* The size of `void *', as computed by sizeof. */
92+
#define SIZEOF_VOID_P 4
93+
94+
/* The size of `wchar_t', as computed by sizeof. */
95+
#define SIZEOF_WCHAR_T 4
96+
97+
/* Define to 1 if you have the ANSI C header files. */
98+
#define STDC_HEADERS 1
99+
100+
/* Define to empty if `const' does not conform to ANSI C. */
101+
/* #undef const */
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* lib/fribidi-config.h. Generated from fribidi-config.h.in by configure. */
2+
/* Not copyrighted, in public domain. */
3+
#ifndef FRIBIDI_CONFIG_H
4+
#define FRIBIDI_CONFIG_H
5+
6+
#define FRIBIDI "fribidi"
7+
#define FRIBIDI_NAME "GNU FriBidi"
8+
#define FRIBIDI_BUGREPORT "https://github.com/fribidi/fribidi/issues/new"
9+
10+
#define FRIBIDI_VERSION "1.0.8"
11+
#define FRIBIDI_MAJOR_VERSION 1
12+
#define FRIBIDI_MINOR_VERSION 0
13+
#define FRIBIDI_MICRO_VERSION 8
14+
#define FRIBIDI_INTERFACE_VERSION 4
15+
#define FRIBIDI_INTERFACE_VERSION_STRING "4"
16+
17+
/* The size of a `int', as computed by sizeof. */
18+
#define FRIBIDI_SIZEOF_INT 4
19+
20+
/* Define if fribidi was built with MSVC */
21+
#undef FRIBIDI_BUILT_WITH_MSVC
22+
23+
#endif /* FRIBIDI_CONFIG_H */

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#Sun Oct 20 23:59:55 MSK 2019
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
43
zipStoreBase=GRADLE_USER_HOME

android/jni/Android.mk

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ CRFLAGS := -DLINUX=1 -D_LINUX=1 -DFOR_ANDROID=1 -DCR3_PATCH \
1414
-DLDOM_USE_OWN_MEM_MAN=0 \
1515
-DCR3_ANTIWORD_PATCH=1 -DENABLE_ANTIWORD=1 \
1616
-DMAX_IMAGE_SCALE_MUL=2 \
17-
-DUSE_NANOSVG=1
17+
-DUSE_NANOSVG=1 \
18+
-DUSE_FRIBIDI=1 -DBUNDLED_FRIBIDI=1
1819

1920
CR3_ROOT := $(LOCAL_PATH)/../..
2021

@@ -28,7 +29,9 @@ LOCAL_C_INCLUDES := \
2829
$(CR3_ROOT)/thirdparty/libjpeg \
2930
$(CR3_ROOT)/thirdparty/antiword \
3031
$(CR3_ROOT)/thirdparty/chmlib/src \
31-
$(CR3_ROOT)/thirdparty/nanosvg/src
32+
$(CR3_ROOT)/thirdparty/nanosvg/src \
33+
$(CR3_ROOT)/thirdparty/fribidi/lib \
34+
$(CR3_ROOT)/android/app/thirdparty_libs/fribidi/lib
3235

3336

3437
LOCAL_CFLAGS += $(CRFLAGS)
@@ -133,7 +136,8 @@ LOCAL_STATIC_LIBRARIES := \
133136
local_freetype \
134137
local_harfbuzz \
135138
local_chmlib \
136-
local_antiword
139+
local_antiword \
140+
local_fribidi
137141

138142
LOCAL_LDLIBS := -lm -llog -lz -ldl -flto
139143
#

0 commit comments

Comments
 (0)