added gotoLink

Conflicts:

	unireader.lua
This commit is contained in:
Dobrica Pavlinusic
2012-10-09 23:51:53 +02:00
committed by Qingping Hou
parent 60edf54e2f
commit bc4d2e7a49

10
cre.cpp
View File

@@ -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}