Skip to content

Commit

Permalink
Merge pull request #221 from chrox/master
Browse files Browse the repository at this point in the history
refactor out Docview:render calling into a seperate function
  • Loading branch information
houqp committed Aug 28, 2014
2 parents 446aa93 + 015d2ce commit 11a738d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cre.cpp
Expand Up @@ -421,6 +421,12 @@ static int loadDocument(lua_State *L) {

doc->text_view->LoadDocument(file_name);
doc->dom_doc = doc->text_view->getDocument();

return 0;
}

static int renderDocument(lua_State *L) {
CreDocument *doc = (CreDocument*) luaL_checkudata(L, 1, "credocument");
doc->text_view->Render();

return 0;
Expand Down Expand Up @@ -1367,6 +1373,7 @@ static const struct luaL_Reg cre_func[] = {

static const struct luaL_Reg credocument_meth[] = {
{"loadDocument", loadDocument},
{"renderDocument", renderDocument},
/*--- get methods ---*/
{"getPages", getNumberOfPages},
{"getCurrentPage", getCurrentPage},
Expand Down

0 comments on commit 11a738d

Please sign in to comment.