From 514ac803f17b8fd2db9c85e32fd4118ab15ed85b Mon Sep 17 00:00:00 2001 From: Jellby Date: Sat, 31 Oct 2020 10:15:23 +0100 Subject: [PATCH] Bump crengine: support for EPUB non-linear flows --- cre.cpp | 19 +++++++++++++++++++ thirdparty/kpvcrlib/crengine | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/cre.cpp b/cre.cpp index 940745e5d..a3af3ff6b 100644 --- a/cre.cpp +++ b/cre.cpp @@ -790,6 +790,23 @@ static int getCurrentPage(lua_State *L) { return 1; } +static int getPageFlow(lua_State *L) { + CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument"); + int pageno = luaL_checkint(L, 2); + + lua_pushinteger(L, doc->text_view->getPageFlow(pageno-1)); + + return 1; +} + +static int hasNonLinearFlows(lua_State *L) { + CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument"); + + lua_pushboolean(L, doc->text_view->hasNonLinearFlows()); + + return 1; +} + static int getPageFromXPointer(lua_State *L) { CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument"); const char *xpointer_str = luaL_checkstring(L, 2); @@ -3425,6 +3442,7 @@ static const struct luaL_Reg credocument_meth[] = { {"getDocumentProps", getDocumentProps}, {"getPages", getNumberOfPages}, {"getCurrentPage", getCurrentPage}, + {"getPageFlow", getPageFlow}, {"getPageFromXPointer", getPageFromXPointer}, {"getPosFromXPointer", getPosFromXPointer}, {"getCurrentPos", getCurrentPos}, @@ -3518,6 +3536,7 @@ static const struct luaL_Reg credocument_meth[] = { {"getPageMapCurrentPageLabel", getPageMapCurrentPageLabel}, {"getPageMapXPointerPageLabel", getPageMapXPointerPageLabel}, {"getPageMapVisiblePageLabels", getPageMapVisiblePageLabels}, + {"hasNonLinearFlows", hasNonLinearFlows}, {"readDefaults", readDefaults}, {"saveDefaults", saveDefaults}, {"close", closeDocument}, diff --git a/thirdparty/kpvcrlib/crengine b/thirdparty/kpvcrlib/crengine index 190e6c363..2fd5d66bc 160000 --- a/thirdparty/kpvcrlib/crengine +++ b/thirdparty/kpvcrlib/crengine @@ -1 +1 @@ -Subproject commit 190e6c363a5e081e8d428d454443c88d0958cf49 +Subproject commit 2fd5d66bcc5aa54de4f7e61f32c5822a8ec2892e