mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
added gotoLink
Conflicts: unireader.lua
This commit is contained in:
committed by
Qingping Hou
parent
60edf54e2f
commit
bc4d2e7a49
10
cre.cpp
10
cre.cpp
@@ -475,6 +475,15 @@ static int getPageLinks(lua_State *L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int gotoLink(lua_State *L) {
|
||||
CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument");
|
||||
const char *pos = luaL_checkstring(L, 2);
|
||||
|
||||
doc->text_view->goLink(lString16(pos), true);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int drawCurrentPage(lua_State *L) {
|
||||
CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument");
|
||||
@@ -624,6 +633,7 @@ static const struct luaL_Reg credocument_meth[] = {
|
||||
{"drawCurrentPage", drawCurrentPage},
|
||||
{"findText", findText},
|
||||
{"getPageLinks", getPageLinks},
|
||||
{"gotoLink", gotoLink},
|
||||
{"close", closeDocument},
|
||||
{"__gc", closeDocument},
|
||||
{NULL, NULL}
|
||||
|
||||
Reference in New Issue
Block a user