add cre view mode support in frontend

This commit is contained in:
Qingping Hou
2012-12-13 12:41:48 +08:00
parent 454ffc0479
commit 1675d8667b
3 changed files with 11 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ CreDocument = Document:new{
line_space_percent = 100,
default_font = "Droid Sans Fallback",
view_mode = "page",
}
-- NuPogodi, 20.05.12: inspect the zipfile content
@@ -68,8 +69,13 @@ function CreDocument:init()
end
local style_sheet = "./data/"..file_type..".css"
-- view_mode default to page mode
local view_mode = 1
if self.view_mode == "scroll" then
view_mode = 0
end
ok, self._document = pcall(cre.openDocument, self.file, style_sheet,
Screen:getWidth(), Screen:getHeight())
Screen:getWidth(), Screen:getHeight(), view_mode)
if not ok then
self.error_message = self.doc -- will contain error message
return