mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Merge pull request #1269 from hwhw/master
pull fixes in base, plus some emulator features
This commit is contained in:
2
base
2
base
Submodule base updated: 5890cb8ac3...b632bdf642
@@ -13,6 +13,13 @@ local Device = Generic:new{
|
||||
}
|
||||
|
||||
function Device:init()
|
||||
-- allows to set a viewport via environment variable
|
||||
-- syntax is Lua table syntax, e.g. EMULATE_READER_VIEWPORT="{x=10,w=550,y=5,h=790}"
|
||||
local viewport = os.getenv("EMULATE_READER_VIEWPORT")
|
||||
if viewport then
|
||||
self.viewport = require("ui/geometry"):new(loadstring("return " .. viewport)())
|
||||
end
|
||||
|
||||
if util.haveSDL2() then
|
||||
self.screen = require("ffi/framebuffer_SDL2_0"):new{device = self}
|
||||
self.input = require("device/input"):new{
|
||||
|
||||
@@ -44,6 +44,9 @@ function Device:init()
|
||||
end
|
||||
self.screen.debug = DEBUG
|
||||
|
||||
DEBUG("initializing for device", self.model)
|
||||
DEBUG("framebuffer resolution:", self.screen:getSize())
|
||||
|
||||
if not self.input then
|
||||
self.input = require("device/input"):new{device = self}
|
||||
end
|
||||
@@ -52,6 +55,7 @@ function Device:init()
|
||||
end
|
||||
|
||||
if self.viewport then
|
||||
DEBUG("setting a viewport:", self.viewport)
|
||||
self.screen:setViewport(self.viewport)
|
||||
self.input:registerEventAdjustHook(
|
||||
self.input.adjustTouchTranslate,
|
||||
|
||||
@@ -17,16 +17,19 @@ local Kobo = Generic:new{
|
||||
|
||||
-- TODO: hasKeys for some devices?
|
||||
|
||||
-- Kobo Touch:
|
||||
local KoboTrilogy = Kobo:new{
|
||||
model = "Kobo_trilogy",
|
||||
touch_switch_xy = false,
|
||||
}
|
||||
|
||||
-- Kobo Mini:
|
||||
local KoboPixie = Kobo:new{
|
||||
model = "Kobo_pixie",
|
||||
display_dpi = 200,
|
||||
}
|
||||
|
||||
-- Kobo Aura H2O:
|
||||
local KoboDahlia = Kobo:new{
|
||||
model = "Kobo_dahlia",
|
||||
hasFrontlight = yes,
|
||||
@@ -36,18 +39,21 @@ local KoboDahlia = Kobo:new{
|
||||
viewport = Geom:new{x=0, y=10, w=1080, h=1430},
|
||||
}
|
||||
|
||||
-- Kobo Aura HD:
|
||||
local KoboDragon = Kobo:new{
|
||||
model = "Kobo_dragon",
|
||||
hasFrontlight = yes,
|
||||
display_dpi = 265,
|
||||
}
|
||||
|
||||
-- Kobo Glo:
|
||||
local KoboKraken = Kobo:new{
|
||||
model = "Kobo_kraken",
|
||||
hasFrontlight = yes,
|
||||
display_dpi = 212,
|
||||
}
|
||||
|
||||
-- Kobo Aura:
|
||||
local KoboPhoenix = Kobo:new{
|
||||
model = "Kobo_phoenix",
|
||||
hasFrontlight = yes,
|
||||
|
||||
Reference in New Issue
Block a user