From bf7ea7af6dcb3da42744177cf229fce8f8d52b71 Mon Sep 17 00:00:00 2001 From: Hans-Werner Hilse Date: Thu, 27 Nov 2014 10:14:24 +0000 Subject: [PATCH 1/4] add device names as comments we use mostly code names internally, but it is probably a good idea to annotate the actual device names. --- frontend/device/kobo/device.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/device/kobo/device.lua b/frontend/device/kobo/device.lua index 452b2c9c1..e760b7b37 100644 --- a/frontend/device/kobo/device.lua +++ b/frontend/device/kobo/device.lua @@ -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, From 677871cbf75d5fd9372504dee6c88bdd7daf08ee Mon Sep 17 00:00:00 2001 From: Hans-Werner Hilse Date: Thu, 27 Nov 2014 10:15:44 +0000 Subject: [PATCH 2/4] allow emulator to specify a viewport This allows for Viewport debugging. It is configured via an environment variable, EMULATE_READER_VIEWPORT. It works with Lua table syntax, e.g.: EMULATE_READER_VIEWPORT="{x=10,w=550,y=5,h=790}" --- frontend/device/emulator/device.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/device/emulator/device.lua b/frontend/device/emulator/device.lua index 7001fa357..394dcca96 100644 --- a/frontend/device/emulator/device.lua +++ b/frontend/device/emulator/device.lua @@ -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{ From 416a90032b4350b94781fe6dbcadcef43c19d927 Mon Sep 17 00:00:00 2001 From: Hans-Werner Hilse Date: Thu, 27 Nov 2014 10:20:20 +0000 Subject: [PATCH 3/4] update base, fetch framebuffer fixes --- base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base b/base index 5890cb8ac..b632bdf64 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit 5890cb8ac32f29ad6d1e77edb530de239696dc44 +Subproject commit b632bdf642352990deac01e13799823a707e6229 From 895b98d5be3c770bc2a26c72eb9109883921956e Mon Sep 17 00:00:00 2001 From: Hans-Werner Hilse Date: Thu, 27 Nov 2014 10:34:16 +0000 Subject: [PATCH 4/4] add debugging output for device initialisation --- frontend/device/generic/device.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/device/generic/device.lua b/frontend/device/generic/device.lua index cefe4e78d..913ea5142 100644 --- a/frontend/device/generic/device.lua +++ b/frontend/device/generic/device.lua @@ -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,