Skip to content

Commit

Permalink
add setViewDimen API for crengine backend
Browse files Browse the repository at this point in the history
  • Loading branch information
chrox committed Oct 10, 2014
1 parent 132f766 commit ce27f6e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cre.cpp
Expand Up @@ -646,6 +646,17 @@ static int setViewMode(lua_State *L) {
return 0;
}

static int setViewDimen(lua_State *L) {
CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument");
int w = luaL_checkint(L, 2);
int h = luaL_checkint(L, 3);

doc->text_view->Resize(w, h);
doc->text_view->Render();

return 0;
}

static int setHeaderInfo(lua_State *L) {
CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument");
int info = luaL_checkint(L, 2);
Expand Down Expand Up @@ -1400,6 +1411,7 @@ static const struct luaL_Reg credocument_meth[] = {
{"setIntProperty", setIntProperty},
{"setStringProperty", setStringProperty},
{"setViewMode", setViewMode},
{"setViewDimen", setViewDimen},
{"setHeaderInfo", setHeaderInfo},
{"setHeaderFont", setHeaderFont},
{"setFontFace", setFontFace},
Expand Down

0 comments on commit ce27f6e

Please sign in to comment.