mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
3 new cre methods from @kai771
renamed from kai's commit: * setViewMode * setHeaderInfo * setHeaderFont
This commit is contained in:
30
cre.cpp
30
cre.cpp
@@ -294,6 +294,33 @@ static int getFontFaces(lua_State *L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int setViewMode(lua_State *L) {
|
||||
CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument");
|
||||
LVDocViewMode view_mode = (LVDocViewMode)luaL_checkint(L, 2);
|
||||
|
||||
doc->text_view->setViewMode(view_mode, -1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int setHeaderInfo(lua_State *L) {
|
||||
CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument");
|
||||
int info = luaL_checkint(L, 2);
|
||||
|
||||
doc->text_view->setPageHeaderInfo(info);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int setHeaderFont(lua_State *L) {
|
||||
CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument");
|
||||
const char *face = luaL_checkstring(L, 2);
|
||||
|
||||
doc->text_view->setStatusFontFace(lString8(face));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int setFontFace(lua_State *L) {
|
||||
CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument");
|
||||
const char *face = luaL_checkstring(L, 2);
|
||||
@@ -632,6 +659,9 @@ static const struct luaL_Reg credocument_meth[] = {
|
||||
{"getFontFace", getFontFace},
|
||||
{"getToc", getTableOfContent},
|
||||
/*--- set methods ---*/
|
||||
{"setViewMode", setViewMode},
|
||||
{"setHeaderInfo", setHeaderInfo},
|
||||
{"setHeaderFont", setHeaderFont},
|
||||
{"setFontFace", setFontFace},
|
||||
{"setFontSize", setFontSize},
|
||||
{"setDefaultInterlineSpace", setDefaultInterlineSpace},
|
||||
|
||||
Reference in New Issue
Block a user