2015-01-09 14:10:25 +00:00
|
|
|
local Generic = require("device/generic/device") -- <= look at this file!
|
2023-12-29 16:41:53 +00:00
|
|
|
local Geom = require("ui/geometry")
|
2023-05-18 21:13:43 +00:00
|
|
|
local UIManager
|
2016-12-29 08:10:38 +00:00
|
|
|
local logger = require("logger")
|
2017-10-22 16:08:53 +00:00
|
|
|
local ffi = require("ffi")
|
2020-08-30 15:27:37 +00:00
|
|
|
local C = ffi.C
|
2017-10-22 16:08:53 +00:00
|
|
|
local inkview = ffi.load("inkview")
|
2020-08-30 15:27:37 +00:00
|
|
|
local band = require("bit").band
|
2020-08-30 16:36:41 +00:00
|
|
|
local util = require("util")
|
2022-02-28 15:50:18 +00:00
|
|
|
local _ = require("gettext")
|
2015-01-09 14:10:25 +00:00
|
|
|
|
2020-08-30 15:27:37 +00:00
|
|
|
require("ffi/posix_h")
|
|
|
|
require("ffi/linux_input_h")
|
|
|
|
require("ffi/inkview_h")
|
|
|
|
|
2015-01-09 14:10:25 +00:00
|
|
|
local function yes() return true end
|
2017-12-02 09:28:11 +00:00
|
|
|
local function no() return false end
|
2015-01-09 14:10:25 +00:00
|
|
|
|
2020-09-01 15:52:16 +00:00
|
|
|
local ext_path = "/mnt/ext1/system/config/extensions.cfg"
|
|
|
|
local app_name = "koreader.app"
|
2016-06-12 18:50:30 +00:00
|
|
|
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook = Generic:extend{
|
2015-01-12 16:14:56 +00:00
|
|
|
model = "PocketBook",
|
|
|
|
isPocketBook = yes,
|
2018-10-06 05:55:35 +00:00
|
|
|
hasOTAUpdates = yes,
|
2019-03-12 06:05:43 +00:00
|
|
|
hasWifiToggle = yes,
|
2020-05-19 18:07:18 +00:00
|
|
|
isTouchDevice = yes,
|
|
|
|
hasKeys = yes,
|
|
|
|
hasFrontlight = yes,
|
2021-04-19 07:04:31 +00:00
|
|
|
hasSystemFonts = yes,
|
2020-06-19 07:41:50 +00:00
|
|
|
canSuspend = no,
|
2020-09-02 21:35:59 +00:00
|
|
|
canReboot = yes,
|
2020-09-01 19:43:21 +00:00
|
|
|
canPowerOff = yes,
|
2020-08-30 15:27:37 +00:00
|
|
|
needsScreenRefreshAfterResume = no,
|
2020-06-19 07:41:50 +00:00
|
|
|
home_dir = "/mnt/ext1",
|
2022-01-30 21:01:28 +00:00
|
|
|
canAssociateFileExtensions = yes,
|
2020-08-19 20:41:10 +00:00
|
|
|
|
|
|
|
-- all devices that have warmth lights use inkview api
|
|
|
|
hasNaturalLightApi = yes,
|
2020-09-19 17:05:35 +00:00
|
|
|
|
2020-09-27 19:35:03 +00:00
|
|
|
-- NOTE: Apparently, HW inversion is a pipedream on PB (#6669), ... well, on sunxi chipsets anyway.
|
|
|
|
-- For which we now probe in fbinfoOverride() and tweak the flag to "no".
|
|
|
|
-- NTX chipsets *should* work (PB631), but in case it doesn't on your device, set this to "no" in here.
|
2022-02-19 18:50:52 +00:00
|
|
|
--
|
|
|
|
-- The above comment applied to rendering without inkview. With the inkview library HW inverting the
|
|
|
|
-- screen is not possible. For now disable HWInvert for all devices.
|
|
|
|
canHWInvert = no,
|
2020-09-22 20:04:37 +00:00
|
|
|
|
2020-10-17 10:59:24 +00:00
|
|
|
-- If we can access the necessary devices, input events can be handled directly.
|
|
|
|
-- This improves latency (~40ms), as well as power usage - we can spend more time asleep,
|
|
|
|
-- instead of busy looping at 50Hz the way inkview insists on doing.
|
|
|
|
-- In case this method fails (no root), we fallback to classic inkview api.
|
|
|
|
raw_input = nil, --[[{
|
|
|
|
-- value or function to adjust touch matrix orientiation.
|
|
|
|
touch_rotation = -3+4,
|
|
|
|
-- Works same as input.event_map, but for raw input EV_KEY translation
|
|
|
|
keymap = { [scan] = event },
|
|
|
|
}]]
|
|
|
|
-- Runtime state: whether raw input is actually used
|
2021-05-15 15:44:30 +00:00
|
|
|
--- @fixme: Never actually set anywhere?
|
2020-10-17 10:59:24 +00:00
|
|
|
is_using_raw_input = nil,
|
|
|
|
|
2022-10-27 22:50:50 +00:00
|
|
|
-- InkView may have started translating button codes based on rotation on newer devices...
|
|
|
|
-- That historically wasn't the case, hence this defaulting to false.
|
|
|
|
inkview_translates_buttons = false,
|
|
|
|
|
2021-05-15 15:44:30 +00:00
|
|
|
-- Will be set appropriately at init
|
|
|
|
isB288SoC = no,
|
|
|
|
|
2020-09-22 20:04:37 +00:00
|
|
|
-- Private per-model kludges
|
|
|
|
_fb_init = function() end,
|
|
|
|
_model_init = function() end,
|
2015-01-09 14:10:25 +00:00
|
|
|
}
|
|
|
|
|
2020-09-01 19:43:21 +00:00
|
|
|
-- Helper to try load externally signalled book whenever we're brought to foreground
|
|
|
|
local function tryOpenBook()
|
|
|
|
local path = os.getenv("KO_PATH_OPEN_BOOK")
|
|
|
|
if not path then return end
|
|
|
|
local fi = io.open(path, "r")
|
|
|
|
if not fi then return end
|
|
|
|
local fn = fi:read("*line")
|
|
|
|
fi:close()
|
|
|
|
os.remove(path)
|
|
|
|
if fn and util.pathExists(fn) then
|
|
|
|
require("apps/reader/readerui"):showReader(fn)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-03-10 17:11:58 +00:00
|
|
|
|
|
|
|
-- A couple helper functions to compute/check aligned values...
|
|
|
|
-- c.f., <linux/kernel.h>
|
|
|
|
local function ALIGN(x, a)
|
|
|
|
-- (x + (a-1)) & ~(a-1)
|
|
|
|
local mask = a - 1
|
|
|
|
return bit.band(x + mask, bit.bnot(mask))
|
|
|
|
end
|
|
|
|
|
|
|
|
local function IS_ALIGNED(x, a)
|
|
|
|
-- (x & (a-1)) == 0
|
|
|
|
if bit.band(x, a - 1) == 0 then
|
|
|
|
return true
|
|
|
|
else
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-01-09 14:10:25 +00:00
|
|
|
function PocketBook:init()
|
2020-10-17 10:59:24 +00:00
|
|
|
local raw_input = self.raw_input
|
|
|
|
local touch_rotation = raw_input and raw_input.touch_rotation or 0
|
|
|
|
|
2022-01-28 15:17:36 +00:00
|
|
|
self.screen = require("ffi/framebuffer_pocketbook"):new {
|
2020-09-22 20:04:37 +00:00
|
|
|
device = self,
|
|
|
|
debug = logger.dbg,
|
2020-10-22 11:23:09 +00:00
|
|
|
wf_level = G_reader_settings:readSetting("wf_level") or 0,
|
2020-09-27 19:35:03 +00:00
|
|
|
fbinfoOverride = function(fb, finfo, vinfo)
|
|
|
|
-- Device model caps *can* set both to indicate that either will work to get correct orientation.
|
|
|
|
-- But for FB backend, the flags are mutually exclusive, so we nuke one of em later.
|
|
|
|
fb.is_always_portrait = self.isAlwaysPortrait()
|
|
|
|
fb.forced_rotation = self.usingForcedRotation()
|
2020-10-22 11:23:09 +00:00
|
|
|
-- Tweak combination of alwaysPortrait/hwRot/hwInvert flags depending on probed HW and wf settings.
|
|
|
|
if fb:isB288() then
|
2021-05-15 15:44:30 +00:00
|
|
|
self.isB288SoC = yes
|
|
|
|
|
|
|
|
-- Allow bypassing the bans for debugging purposes...
|
|
|
|
if G_reader_settings:nilOrFalse("pb_ignore_b288_quirks") then
|
|
|
|
logger.dbg("mxcfb: Disabling hwinvert on B288 chipset")
|
|
|
|
self.canHWInvert = no
|
|
|
|
-- GL16 glitches with hwrot. And apparently with more stuff on newer FW (#7663)
|
|
|
|
logger.dbg("mxcfb: Disabling hwrot on B288 chipset")
|
|
|
|
fb.forced_rotation = nil
|
|
|
|
end
|
2020-10-22 11:23:09 +00:00
|
|
|
end
|
2021-03-10 17:11:58 +00:00
|
|
|
-- If hwrot is still on, nuke swrot
|
2020-10-22 11:23:09 +00:00
|
|
|
if fb.forced_rotation then
|
2020-09-27 19:35:03 +00:00
|
|
|
fb.is_always_portrait = false
|
|
|
|
end
|
2021-03-10 17:11:58 +00:00
|
|
|
|
|
|
|
-- Legacy devices return incomplete/broken data, fix it without breaking saner devices.
|
|
|
|
-- c.f., https://github.com/koreader/koreader-base/blob/50a965c28fd5ea2100257aa9ce2e62c9c301155c/ffi/framebuffer_linux.lua#L119-L189
|
|
|
|
if string.byte(ffi.string(finfo.id, 16), 1, 1) == 0 then
|
|
|
|
local xres_virtual = vinfo.xres_virtual
|
|
|
|
if not IS_ALIGNED(vinfo.xres_virtual, 32) then
|
|
|
|
vinfo.xres_virtual = ALIGN(vinfo.xres, 32)
|
|
|
|
end
|
|
|
|
local yres_virtual = vinfo.yres_virtual
|
|
|
|
if not IS_ALIGNED(vinfo.yres_virtual, 128) then
|
|
|
|
vinfo.yres_virtual = ALIGN(vinfo.yres, 128)
|
|
|
|
end
|
|
|
|
local line_length = finfo.line_length
|
|
|
|
finfo.line_length = vinfo.xres_virtual * bit.rshift(vinfo.bits_per_pixel, 3)
|
|
|
|
|
|
|
|
local fb_size = finfo.line_length * vinfo.yres_virtual
|
|
|
|
if fb_size > finfo.smem_len then
|
|
|
|
if not IS_ALIGNED(yres_virtual, 32) then
|
|
|
|
vinfo.yres_virtual = ALIGN(vinfo.yres, 32)
|
|
|
|
else
|
|
|
|
vinfo.yres_virtual = yres_virtual
|
|
|
|
end
|
|
|
|
fb_size = finfo.line_length * vinfo.yres_virtual
|
|
|
|
|
|
|
|
if fb_size > finfo.smem_len then
|
|
|
|
--fb_size = finfo.smem_len
|
|
|
|
finfo.line_length = line_length
|
|
|
|
vinfo.xres_virtual = xres_virtual
|
|
|
|
vinfo.yres_virtual = yres_virtual
|
|
|
|
|
|
|
|
vinfo.xres_virtual = bit.lshift(finfo.line_length, 3) / vinfo.bits_per_pixel
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-09-27 19:35:03 +00:00
|
|
|
return self._fb_init(fb, finfo, vinfo)
|
|
|
|
end,
|
2020-10-17 10:59:24 +00:00
|
|
|
-- raw touch input orientiation is different from the screen
|
|
|
|
getTouchRotation = function(fb)
|
|
|
|
if type(touch_rotation) == "function" then
|
|
|
|
return touch_rotation(self, fb:getRotationMode())
|
|
|
|
end
|
|
|
|
return (4 + fb:getRotationMode() + touch_rotation) % 4
|
|
|
|
end,
|
2020-09-22 20:04:37 +00:00
|
|
|
}
|
2020-08-30 15:27:37 +00:00
|
|
|
|
|
|
|
-- Whenever we lose focus, but also get suspended for real (we can't reliably tell atm),
|
|
|
|
-- plugins need to be notified to stop doing foreground stuff, and vice versa. To this end,
|
|
|
|
-- we maintain pseudo suspended state just to keep plugins happy, even though it's not
|
|
|
|
-- related real to suspend states.
|
|
|
|
local quasiSuspended
|
|
|
|
|
2018-01-06 12:14:26 +00:00
|
|
|
self.input = require("device/input"):new{
|
|
|
|
device = self,
|
2020-10-17 10:59:24 +00:00
|
|
|
raw_input = raw_input,
|
|
|
|
event_map = setmetatable({
|
2022-11-15 17:23:23 +00:00
|
|
|
[C.KEY_HOME] = "Home",
|
2020-08-30 15:27:37 +00:00
|
|
|
[C.KEY_MENU] = "Menu",
|
|
|
|
[C.KEY_PREV] = "LPgBack",
|
|
|
|
[C.KEY_NEXT] = "LPgFwd",
|
|
|
|
[C.KEY_UP] = "Up",
|
|
|
|
[C.KEY_DOWN] = "Down",
|
|
|
|
[C.KEY_LEFT] = "Left",
|
|
|
|
[C.KEY_RIGHT] = "Right",
|
|
|
|
[C.KEY_OK] = "Press",
|
2020-10-17 10:59:24 +00:00
|
|
|
}, {__index=raw_input and raw_input.keymap or {}}),
|
2018-01-06 12:14:26 +00:00
|
|
|
handleMiscEv = function(this, ev)
|
2020-08-30 15:27:37 +00:00
|
|
|
local ui = require("ui/uimanager")
|
|
|
|
if ev.code == C.EVT_HIDE or ev.code == C.EVT_BACKGROUND then
|
|
|
|
ui:flushSettings()
|
|
|
|
if not quasiSuspended then
|
|
|
|
quasiSuspended = true
|
|
|
|
return "Suspend"
|
|
|
|
end
|
|
|
|
elseif ev.code == C.EVT_FOREGROUND or ev.code == C.EVT_SHOW then
|
2020-09-01 19:43:21 +00:00
|
|
|
tryOpenBook()
|
2020-09-19 17:05:35 +00:00
|
|
|
ui:setDirty('all', 'ui')
|
2020-08-30 15:27:37 +00:00
|
|
|
if quasiSuspended then
|
|
|
|
quasiSuspended = false
|
2018-01-06 12:14:26 +00:00
|
|
|
return "Resume"
|
|
|
|
end
|
2022-10-28 00:25:06 +00:00
|
|
|
elseif ev.code == C.EVT_EXIT then
|
|
|
|
-- Auto shutdown event from inkview framework,
|
|
|
|
-- gracefully close everything and let the framework shutdown the device.
|
|
|
|
return "Exit"
|
2022-12-21 14:50:39 +00:00
|
|
|
elseif ev.code == C.MSC_GYRO then
|
|
|
|
return this:handleGyroEv(ev)
|
2018-01-06 12:14:26 +00:00
|
|
|
end
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
|
2022-10-27 22:50:50 +00:00
|
|
|
-- If InkView translates buttons for us, disable our own translation map
|
|
|
|
if self.inkview_translates_buttons then
|
2022-12-21 14:50:39 +00:00
|
|
|
self.input:disableRotationMap()
|
2022-10-27 22:50:50 +00:00
|
|
|
end
|
|
|
|
|
2022-12-23 18:22:22 +00:00
|
|
|
-- If InkView tells us this device has a gsensor enable the event based functionality
|
|
|
|
if inkview.QueryGSensor() ~= 0 then
|
|
|
|
self.hasGSensor = yes
|
|
|
|
end
|
|
|
|
|
2022-10-28 00:25:06 +00:00
|
|
|
-- In contrast to kobo/kindle, pocketbook-devices do not use linux/input events directly.
|
|
|
|
-- To be able to use input.lua nevertheless,
|
|
|
|
-- we make inkview-events look like linux/input events or handle them directly here.
|
2018-01-06 12:14:26 +00:00
|
|
|
-- Unhandled events will leave Input:waitEvent() as "GenericInput"
|
2022-12-12 12:55:37 +00:00
|
|
|
-- NOTE: This all happens in ffi/input_pocketbook.lua
|
2015-01-09 14:10:25 +00:00
|
|
|
|
2020-09-22 20:04:37 +00:00
|
|
|
self._model_init()
|
2020-10-17 10:59:24 +00:00
|
|
|
if (not self.input.raw_input) or (not pcall(self.input.open, self.input, self.raw_input)) then
|
|
|
|
inkview.OpenScreen()
|
|
|
|
-- Raw mode open failed (no permissions?), so we'll run the usual way.
|
|
|
|
-- Disable touch coordinate translation as inkview will do that.
|
|
|
|
self.input.raw_input = nil
|
|
|
|
self.input:open()
|
|
|
|
touch_rotation = 0
|
|
|
|
else
|
|
|
|
self.canSuspend = yes
|
|
|
|
end
|
|
|
|
self.powerd = require("device/pocketbook/powerd"):new{device = self}
|
2020-08-30 15:27:37 +00:00
|
|
|
self:setAutoStandby(true)
|
2015-01-09 14:10:25 +00:00
|
|
|
Generic.init(self)
|
|
|
|
end
|
|
|
|
|
2023-08-11 23:10:54 +00:00
|
|
|
function PocketBook:exit()
|
|
|
|
-- Exit code can be shoddy on some devices due to broken library dtors calling _exit(0) from os.exit(N)
|
|
|
|
local ko_exit = os.getenv("KO_EXIT_CODE")
|
|
|
|
if ko_exit then
|
2023-08-19 11:22:22 +00:00
|
|
|
local f = io.open(ko_exit, "w+")
|
|
|
|
if f then
|
2023-08-11 23:10:54 +00:00
|
|
|
-- As returned by UIManager:run() in reader.lua
|
2023-08-19 11:22:22 +00:00
|
|
|
f:write(tostring(UIManager._exit_code))
|
|
|
|
f:close()
|
2023-08-11 23:10:54 +00:00
|
|
|
end
|
|
|
|
end
|
2023-08-19 11:22:22 +00:00
|
|
|
|
|
|
|
Generic.exit(self)
|
2023-08-11 23:10:54 +00:00
|
|
|
end
|
|
|
|
|
2020-09-01 15:52:16 +00:00
|
|
|
function PocketBook:notifyBookState(title, document)
|
2022-10-12 17:59:48 +00:00
|
|
|
local fn = document and document.file
|
|
|
|
logger.dbg("Notify book state", title, fn)
|
2020-09-01 15:52:16 +00:00
|
|
|
os.remove("/tmp/.current")
|
|
|
|
if fn then
|
|
|
|
local fo = io.open("/tmp/.current", "w+")
|
2022-10-12 17:59:48 +00:00
|
|
|
if fo then
|
|
|
|
fo:write(fn)
|
|
|
|
fo:close()
|
|
|
|
end
|
2020-09-01 15:52:16 +00:00
|
|
|
end
|
2022-02-28 15:50:18 +00:00
|
|
|
inkview.SetSubtaskInfo(inkview.GetCurrentTask(), 0, title and (title .. " - koreader") or "koreader", fn or _("N/A"))
|
2020-09-01 15:52:16 +00:00
|
|
|
end
|
|
|
|
|
2017-09-18 17:04:36 +00:00
|
|
|
function PocketBook:setDateTime(year, month, day, hour, min, sec)
|
2017-08-15 17:54:02 +00:00
|
|
|
if hour == nil or min == nil then return true end
|
2020-08-30 15:27:37 +00:00
|
|
|
-- If the device is rooted, we might actually have a fighting chance to change os clock.
|
|
|
|
local su = "/mnt/secure/su"
|
|
|
|
su = util.pathExists(su) and (su .. " ") or ""
|
2017-09-18 17:04:36 +00:00
|
|
|
local command
|
|
|
|
if year and month and day then
|
2020-08-30 15:27:37 +00:00
|
|
|
command = string.format(su .. "/bin/date -s '%d-%d-%d %d:%d:%d'", year, month, day, hour, min, sec)
|
2017-09-18 17:04:36 +00:00
|
|
|
else
|
2020-08-30 15:27:37 +00:00
|
|
|
command = string.format(su .. "/bin/date -s '%d:%d'",hour, min)
|
2017-09-18 17:04:36 +00:00
|
|
|
end
|
|
|
|
if os.execute(command) == 0 then
|
2020-08-30 15:27:37 +00:00
|
|
|
os.execute(su .. '/sbin/hwclock -u -w')
|
2017-08-15 17:54:02 +00:00
|
|
|
return true
|
|
|
|
else
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-09-01 15:52:16 +00:00
|
|
|
function PocketBook:associateFileExtensions(assoc)
|
|
|
|
-- First load the system-wide table, from which we'll snoop file types and icons
|
|
|
|
local info = {}
|
|
|
|
for l in io.lines("/ebrmain/config/extensions.cfg") do
|
|
|
|
local m = { l:match("^([^:]*):([^:]*):([^:]*):([^:]*):(.*)") }
|
2022-07-14 09:46:25 +00:00
|
|
|
if #m > 0 then
|
|
|
|
info[m[1]] = m
|
|
|
|
end
|
2020-09-01 15:52:16 +00:00
|
|
|
end
|
|
|
|
local res = {"#koreader"}
|
|
|
|
for k,v in pairs(assoc) do
|
|
|
|
local t = info[k]
|
|
|
|
if t then
|
|
|
|
-- A system entry exists, so just change app, and reuse the rest
|
2020-09-02 20:44:38 +00:00
|
|
|
t[4] = app_name .. "," .. t[4]
|
2020-09-01 15:52:16 +00:00
|
|
|
else
|
|
|
|
-- Doesn't exist, so hallucinate up something
|
|
|
|
-- TBD: We have document opener in 'v', maybe consult mime in there?
|
|
|
|
local bn = k:match("%a+"):upper()
|
|
|
|
t = { k, '@' .. bn .. '_file', "1", app_name, "ICON_" .. bn }
|
|
|
|
end
|
|
|
|
table.insert(res, table.concat(t, ":"))
|
|
|
|
end
|
|
|
|
local out = io.open(ext_path, "w+")
|
|
|
|
out:write(table.concat(res, "\n"))
|
|
|
|
out:close()
|
|
|
|
end
|
|
|
|
|
2020-08-30 15:27:37 +00:00
|
|
|
function PocketBook:setAutoStandby(isAllowed)
|
|
|
|
inkview.iv_sleepmode(isAllowed and 1 or 0)
|
|
|
|
end
|
|
|
|
|
2020-09-01 19:43:21 +00:00
|
|
|
function PocketBook:powerOff()
|
|
|
|
inkview.PowerOff()
|
|
|
|
end
|
|
|
|
|
2020-10-17 10:59:24 +00:00
|
|
|
function PocketBook:suspend()
|
|
|
|
inkview.SendGlobalRequest(C.REQ_KEYLOCK)
|
|
|
|
end
|
|
|
|
|
2020-09-02 21:35:59 +00:00
|
|
|
function PocketBook:reboot()
|
|
|
|
inkview.iv_ipc_request(C.MSG_REBOOT, 1, nil, 0, 0)
|
|
|
|
end
|
|
|
|
|
2016-06-12 18:50:30 +00:00
|
|
|
function PocketBook:initNetworkManager(NetworkMgr)
|
2022-06-25 17:58:30 +00:00
|
|
|
local function keepWifiAlive()
|
|
|
|
-- Make sure only one wifiKeepAlive is scheduled
|
|
|
|
UIManager:unschedule(keepWifiAlive)
|
|
|
|
|
|
|
|
if NetworkMgr:isWifiOn() then
|
|
|
|
logger.dbg("ping wifi keep alive and reschedule")
|
|
|
|
|
|
|
|
inkview.NetMgrPing()
|
|
|
|
UIManager:scheduleIn(30, keepWifiAlive)
|
|
|
|
else
|
|
|
|
logger.dbg("wifi is disabled do not reschedule")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-03-12 06:05:43 +00:00
|
|
|
function NetworkMgr:turnOnWifi(complete_callback)
|
2022-01-11 11:41:19 +00:00
|
|
|
inkview.WiFiPower(1)
|
2022-06-25 17:58:30 +00:00
|
|
|
if inkview.NetConnect(nil) == C.NET_OK then
|
|
|
|
keepWifiAlive()
|
|
|
|
else
|
|
|
|
logger.info("NetConnect failed")
|
2019-03-12 06:05:43 +00:00
|
|
|
end
|
|
|
|
if complete_callback then
|
|
|
|
complete_callback()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function NetworkMgr:turnOffWifi(complete_callback)
|
|
|
|
inkview.NetDisconnect()
|
|
|
|
if complete_callback then
|
|
|
|
complete_callback()
|
|
|
|
end
|
2016-06-12 18:50:30 +00:00
|
|
|
end
|
|
|
|
|
2023-01-31 20:28:32 +00:00
|
|
|
function NetworkMgr:isConnected()
|
2022-01-29 19:58:28 +00:00
|
|
|
return band(inkview.QueryNetwork(), C.NET_CONNECTED) ~= 0
|
2016-06-12 18:50:30 +00:00
|
|
|
end
|
2023-01-31 20:28:32 +00:00
|
|
|
NetworkMgr.isWifiOn = NetworkMgr.isConnected
|
2016-06-12 18:50:30 +00:00
|
|
|
end
|
|
|
|
|
2017-10-22 16:08:53 +00:00
|
|
|
function PocketBook:getSoftwareVersion()
|
|
|
|
return ffi.string(inkview.GetSoftwareVersion())
|
|
|
|
end
|
|
|
|
|
|
|
|
function PocketBook:getDeviceModel()
|
|
|
|
return ffi.string(inkview.GetDeviceModel())
|
|
|
|
end
|
|
|
|
|
2021-04-22 06:38:49 +00:00
|
|
|
function PocketBook:getDefaultCoverPath()
|
|
|
|
return "/mnt/ext1/system/logo/offlogo/cover.bmp"
|
|
|
|
end
|
|
|
|
|
2023-05-18 21:13:43 +00:00
|
|
|
function PocketBook:UIManagerReady(uimgr)
|
|
|
|
UIManager = uimgr
|
|
|
|
end
|
|
|
|
|
|
|
|
function PocketBook:setEventHandlers(uimgr)
|
2022-09-10 11:45:31 +00:00
|
|
|
-- Only fg/bg state plugin notifiers, not real power event.
|
Assorted bag'o tweaks & fixes (#9569)
* UIManager: Support more specialized update modes for corner-cases:
* A2, which we'll use for the VirtualKeyboards keys (they'd... inadvertently switched to UI with the highlight refactor).
* NO_MERGE variants of ui & partial (for sunxi). Use `[ui]` in ReaderHighlight's popup, because of a Sage kernel bug that could otherwise make it translucent, sometimes completely so (*sigh*).
* UIManager: Assorted code cleanups & simplifications.
* Logger & dbg: Unify logging style, and code cleanups.
* SDL: Unbreak suspend/resume outside of the emulator (fix #9567).
* NetworkMgr: Cache the network status, and allow it to be queried. (Used by AutoSuspend to avoid repeatedly poking the system when computing the standby schedule delay).
* OneTimeMigration: Don't forget about `NETWORK_PROXY` & `STARDICT_DATA_DIR` when migrating `defaults.persistent.lua` (fix #9573)
* WakeupMgr: Workaround an apparent limitation of the RTC found on i.MX5 Kobo devices, where setting a wakealarm further than UINT16_MAX seconds in the future would apparently overflow and wraparound... (fix #8039, many thanks to @yfede for the extensive deep-dive and for actually accurately pinpointing the issue!).
* Kobo: Handle standby transitions at full CPU clock speeds, in order to limit the latency hit.
* UIManager: Properly quit on reboot & exit. This ensures our exit code is preserved, as we exit on our own terms (instead of being killed by the init system). This is important on platforms where exit codes are semantically meaningful (e.g., Kobo).
* UIManager: Speaking of reboot & exit, make sure the Screensaver shows in all circumstances (e.g., autoshutdown, re: #9542)), and that there aren't any extraneous refreshes triggered. (Additionally, fix a minor regression since #9448 about tracking this very transient state on Kobo & Cervantes).
* Kindle: ID the upcoming Scribe.
* Bump base (https://github.com/koreader/koreader-base/pull/1524)
2022-10-02 01:01:49 +00:00
|
|
|
UIManager.event_handlers.Suspend = function()
|
2023-05-18 21:13:43 +00:00
|
|
|
self.powerd:beforeSuspend()
|
2022-09-10 11:45:31 +00:00
|
|
|
end
|
Assorted bag'o tweaks & fixes (#9569)
* UIManager: Support more specialized update modes for corner-cases:
* A2, which we'll use for the VirtualKeyboards keys (they'd... inadvertently switched to UI with the highlight refactor).
* NO_MERGE variants of ui & partial (for sunxi). Use `[ui]` in ReaderHighlight's popup, because of a Sage kernel bug that could otherwise make it translucent, sometimes completely so (*sigh*).
* UIManager: Assorted code cleanups & simplifications.
* Logger & dbg: Unify logging style, and code cleanups.
* SDL: Unbreak suspend/resume outside of the emulator (fix #9567).
* NetworkMgr: Cache the network status, and allow it to be queried. (Used by AutoSuspend to avoid repeatedly poking the system when computing the standby schedule delay).
* OneTimeMigration: Don't forget about `NETWORK_PROXY` & `STARDICT_DATA_DIR` when migrating `defaults.persistent.lua` (fix #9573)
* WakeupMgr: Workaround an apparent limitation of the RTC found on i.MX5 Kobo devices, where setting a wakealarm further than UINT16_MAX seconds in the future would apparently overflow and wraparound... (fix #8039, many thanks to @yfede for the extensive deep-dive and for actually accurately pinpointing the issue!).
* Kobo: Handle standby transitions at full CPU clock speeds, in order to limit the latency hit.
* UIManager: Properly quit on reboot & exit. This ensures our exit code is preserved, as we exit on our own terms (instead of being killed by the init system). This is important on platforms where exit codes are semantically meaningful (e.g., Kobo).
* UIManager: Speaking of reboot & exit, make sure the Screensaver shows in all circumstances (e.g., autoshutdown, re: #9542)), and that there aren't any extraneous refreshes triggered. (Additionally, fix a minor regression since #9448 about tracking this very transient state on Kobo & Cervantes).
* Kindle: ID the upcoming Scribe.
* Bump base (https://github.com/koreader/koreader-base/pull/1524)
2022-10-02 01:01:49 +00:00
|
|
|
UIManager.event_handlers.Resume = function()
|
2023-05-18 21:13:43 +00:00
|
|
|
self.powerd:afterResume()
|
2022-09-10 11:45:31 +00:00
|
|
|
end
|
2022-10-28 00:25:06 +00:00
|
|
|
UIManager.event_handlers.Exit = function()
|
|
|
|
local Event = require("ui/event")
|
|
|
|
UIManager:broadcastEvent(Event:new("Close"))
|
|
|
|
UIManager:quit(0)
|
|
|
|
end
|
2022-09-10 11:45:31 +00:00
|
|
|
end
|
|
|
|
|
2020-09-22 20:04:37 +00:00
|
|
|
-- Pocketbook HW rotation modes start from landsape, CCW
|
2020-09-27 19:35:03 +00:00
|
|
|
local function landscape_ccw() return {
|
2020-09-22 20:04:37 +00:00
|
|
|
1, 0, 3, 2, -- PORTRAIT, LANDSCAPE, PORTRAIT_180, LANDSCAPE_180
|
|
|
|
every_paint = true, -- inkview will try to steal the rot mode frequently
|
|
|
|
restore = false, -- no need, because everything using inkview forces 3 on focus
|
|
|
|
default = nil, -- usually 3
|
2020-09-27 19:35:03 +00:00
|
|
|
} end
|
2020-09-22 20:04:37 +00:00
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook Mini (515)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook515 = PocketBook:extend{
|
2020-05-24 13:58:43 +00:00
|
|
|
model = "PB515",
|
|
|
|
display_dpi = 200,
|
|
|
|
isTouchDevice = no,
|
2020-08-23 09:15:49 +00:00
|
|
|
hasFrontlight = no,
|
2020-05-25 10:23:43 +00:00
|
|
|
hasDPad = yes,
|
2020-05-26 15:43:44 +00:00
|
|
|
hasFewKeys = yes,
|
2020-05-24 13:58:43 +00:00
|
|
|
}
|
|
|
|
|
2022-01-28 22:42:42 +00:00
|
|
|
-- PocketBook Basic 4 (606)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook606 = PocketBook:extend{
|
2020-08-20 08:09:54 +00:00
|
|
|
model = "PB606",
|
|
|
|
display_dpi = 212,
|
|
|
|
isTouchDevice = no,
|
|
|
|
hasFrontlight = no,
|
|
|
|
hasDPad = yes,
|
|
|
|
hasFewKeys = yes,
|
|
|
|
}
|
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook Basic (611)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook611 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PB611",
|
|
|
|
display_dpi = 167,
|
|
|
|
isTouchDevice = no,
|
|
|
|
hasFrontlight = no,
|
|
|
|
hasDPad = yes,
|
|
|
|
hasFewKeys = yes,
|
|
|
|
}
|
|
|
|
|
|
|
|
-- PocketBook Basic (613)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook613 = PocketBook:extend{
|
2020-05-26 15:07:41 +00:00
|
|
|
model = "PB613B",
|
|
|
|
display_dpi = 167,
|
|
|
|
isTouchDevice = no,
|
|
|
|
hasWifiToggle = no,
|
2023-11-02 22:41:21 +00:00
|
|
|
hasSeamlessWifiToggle = no,
|
2020-08-07 21:02:30 +00:00
|
|
|
hasFrontlight = no,
|
2020-05-26 15:07:41 +00:00
|
|
|
hasDPad = yes,
|
2020-05-26 15:43:44 +00:00
|
|
|
hasFewKeys = yes,
|
2020-05-26 15:07:41 +00:00
|
|
|
}
|
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook Basic 2 / Basic 3 (614/614W)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook614W = PocketBook:extend{
|
2020-06-26 14:15:49 +00:00
|
|
|
model = "PB614W",
|
|
|
|
display_dpi = 167,
|
|
|
|
isTouchDevice = no,
|
|
|
|
hasFrontlight = no,
|
|
|
|
hasDPad = yes,
|
|
|
|
hasFewKeys = yes,
|
|
|
|
}
|
|
|
|
|
2020-08-19 12:49:17 +00:00
|
|
|
-- PocketBook Basic Lux / 615 Plus (615/615W)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook615 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PBBLux",
|
2020-05-24 13:58:43 +00:00
|
|
|
display_dpi = 212,
|
2020-05-26 15:07:41 +00:00
|
|
|
isTouchDevice = no,
|
|
|
|
hasDPad = yes,
|
2020-05-26 15:43:44 +00:00
|
|
|
hasFewKeys = yes,
|
2020-05-24 13:58:43 +00:00
|
|
|
}
|
|
|
|
|
2020-08-19 12:49:17 +00:00
|
|
|
-- PocketBook Basic Lux 2 (616/616W)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook616 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PBBLux2",
|
2018-11-26 14:19:00 +00:00
|
|
|
display_dpi = 212,
|
2020-08-07 21:02:30 +00:00
|
|
|
isTouchDevice = no,
|
|
|
|
hasDPad = yes,
|
|
|
|
hasFewKeys = yes,
|
2018-11-26 14:19:00 +00:00
|
|
|
}
|
|
|
|
|
2022-01-28 22:42:42 +00:00
|
|
|
-- PocketBook Basic Lux 3 (617)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook617 = PocketBook:extend{
|
2022-01-28 22:42:42 +00:00
|
|
|
model = "PBBLux3",
|
|
|
|
display_dpi = 212,
|
|
|
|
isTouchDevice = no,
|
|
|
|
hasDPad = yes,
|
|
|
|
hasFewKeys = yes,
|
|
|
|
hasNaturalLight = yes,
|
|
|
|
}
|
|
|
|
|
2023-10-12 12:53:08 +00:00
|
|
|
-- PocketBook Basic Lux 4 (618)
|
|
|
|
local PocketBook618 = PocketBook:extend{
|
|
|
|
model = "PBBLux4",
|
|
|
|
display_dpi = 212,
|
|
|
|
}
|
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook Touch (622)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook622 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PBTouch",
|
|
|
|
display_dpi = 167,
|
|
|
|
hasFrontlight = no,
|
2018-12-25 23:56:02 +00:00
|
|
|
}
|
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook Touch Lux (623)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook623 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PBTouchLux",
|
2017-11-07 19:51:52 +00:00
|
|
|
display_dpi = 212,
|
|
|
|
}
|
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook Basic Touch (624)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook624 = PocketBook:extend{
|
2019-01-13 23:49:29 +00:00
|
|
|
model = "PBBasicTouch",
|
2020-08-07 21:02:30 +00:00
|
|
|
display_dpi = 167,
|
2017-12-02 09:28:11 +00:00
|
|
|
hasFrontlight = no,
|
|
|
|
}
|
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook Basic Touch 2 (625)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook625 = PocketBook:extend{
|
2019-01-13 23:49:29 +00:00
|
|
|
model = "PBBasicTouch2",
|
2020-08-07 21:02:30 +00:00
|
|
|
display_dpi = 167,
|
2019-01-08 02:46:32 +00:00
|
|
|
hasFrontlight = no,
|
|
|
|
}
|
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook Touch Lux 2 / Touch Lux 3 (626)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook626 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PBLux3",
|
|
|
|
display_dpi = 212,
|
2019-07-15 12:39:37 +00:00
|
|
|
}
|
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook Touch Lux 4 (627)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook627 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PBLux4",
|
2017-12-10 19:02:34 +00:00
|
|
|
display_dpi = 212,
|
2021-05-31 20:19:24 +00:00
|
|
|
isAlwaysPortrait = yes,
|
2017-12-10 19:02:34 +00:00
|
|
|
}
|
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook Touch Lux 5 (628)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook628 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PBTouchLux5",
|
|
|
|
display_dpi = 212,
|
2020-09-27 19:35:03 +00:00
|
|
|
isAlwaysPortrait = yes,
|
2020-09-22 20:04:37 +00:00
|
|
|
usingForcedRotation = landscape_ccw,
|
2020-08-19 20:41:10 +00:00
|
|
|
hasNaturalLight = yes,
|
2018-04-04 16:26:44 +00:00
|
|
|
}
|
|
|
|
|
2023-09-25 20:41:09 +00:00
|
|
|
-- PocketBook Verse (629)
|
|
|
|
local PocketBook629 = PocketBook:extend{
|
|
|
|
model = "PB629",
|
|
|
|
display_dpi = 212,
|
|
|
|
isAlwaysPortrait = yes,
|
|
|
|
hasNaturalLight = yes,
|
|
|
|
}
|
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook Sense / Sense 2 (630)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook630 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PBSense",
|
|
|
|
display_dpi = 212,
|
|
|
|
}
|
|
|
|
|
|
|
|
-- PocketBook Touch HD / Touch HD 2 (631)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook631 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PBTouchHD",
|
2019-09-18 13:21:04 +00:00
|
|
|
display_dpi = 300,
|
2020-08-19 20:41:10 +00:00
|
|
|
-- see https://github.com/koreader/koreader/pull/6531#issuecomment-676629182
|
|
|
|
hasNaturalLight = function() return inkview.GetFrontlightColor() >= 0 end,
|
2019-09-18 13:21:04 +00:00
|
|
|
}
|
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook Touch HD Plus / Touch HD 3 (632)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook632 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PBTouchHDPlus",
|
|
|
|
display_dpi = 300,
|
2020-09-27 19:35:03 +00:00
|
|
|
isAlwaysPortrait = yes,
|
2020-09-22 20:04:37 +00:00
|
|
|
usingForcedRotation = landscape_ccw,
|
2020-08-19 20:41:10 +00:00
|
|
|
hasNaturalLight = yes,
|
2020-02-22 08:09:18 +00:00
|
|
|
}
|
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook Color (633)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook633 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PBColor",
|
|
|
|
display_dpi = 300,
|
2022-11-18 19:23:35 +00:00
|
|
|
color_saturation = 1.5,
|
2020-08-07 21:02:30 +00:00
|
|
|
hasColorScreen = yes,
|
2022-11-18 19:23:35 +00:00
|
|
|
canHWDither = yes, -- Adjust color saturation with inkview
|
2020-08-07 21:02:30 +00:00
|
|
|
canUseCBB = no, -- 24bpp
|
2020-09-27 19:35:03 +00:00
|
|
|
isAlwaysPortrait = yes,
|
2020-09-22 20:04:37 +00:00
|
|
|
usingForcedRotation = landscape_ccw,
|
2018-11-23 12:33:43 +00:00
|
|
|
}
|
|
|
|
|
2023-09-25 20:41:09 +00:00
|
|
|
-- PocketBook Verse Pro (634)
|
|
|
|
local PocketBook634 = PocketBook:extend{
|
|
|
|
model = "PB634",
|
|
|
|
display_dpi = 300,
|
|
|
|
isAlwaysPortrait = yes,
|
|
|
|
hasNaturalLight = yes,
|
|
|
|
}
|
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook Aqua (640)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook640 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PBAqua",
|
|
|
|
display_dpi = 167,
|
|
|
|
}
|
|
|
|
|
|
|
|
-- PocketBook Aqua 2 (641)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook641 = PocketBook:extend{
|
2019-01-13 23:49:29 +00:00
|
|
|
model = "PBAqua2",
|
2019-01-05 08:02:45 +00:00
|
|
|
display_dpi = 212,
|
|
|
|
}
|
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook Ultra (650)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook650 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PBUltra",
|
|
|
|
display_dpi = 212,
|
|
|
|
}
|
|
|
|
|
2022-07-23 13:29:09 +00:00
|
|
|
-- PocketBook Era (700)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook700 = PocketBook:extend{
|
2022-07-23 13:29:09 +00:00
|
|
|
model = "PB700",
|
|
|
|
display_dpi = 300,
|
|
|
|
isAlwaysPortrait = yes,
|
|
|
|
hasNaturalLight = yes,
|
2022-10-27 22:50:50 +00:00
|
|
|
-- c.f., https://github.com/koreader/koreader/issues/9556
|
|
|
|
inkview_translates_buttons = true,
|
2022-07-23 13:29:09 +00:00
|
|
|
}
|
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook InkPad 3 (740)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook740 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PBInkPad3",
|
|
|
|
display_dpi = 300,
|
2020-09-30 21:27:40 +00:00
|
|
|
isAlwaysPortrait = yes,
|
2020-09-22 20:04:37 +00:00
|
|
|
usingForcedRotation = landscape_ccw,
|
2020-08-19 20:41:10 +00:00
|
|
|
hasNaturalLight = yes,
|
2020-08-07 21:02:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
-- PocketBook InkPad 3 Pro (740_2)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook740_2 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PBInkPad3Pro",
|
|
|
|
display_dpi = 300,
|
2020-09-27 19:35:03 +00:00
|
|
|
isAlwaysPortrait = yes,
|
2020-09-22 20:04:37 +00:00
|
|
|
usingForcedRotation = landscape_ccw,
|
2020-08-19 20:41:10 +00:00
|
|
|
hasNaturalLight = yes,
|
2020-10-17 10:59:24 +00:00
|
|
|
raw_input = {
|
|
|
|
touch_rotation = -1,
|
|
|
|
keymap = {
|
|
|
|
[115] = "Menu",
|
|
|
|
[109] = "LPgFwd",
|
|
|
|
[104] = "LPgBack",
|
|
|
|
}
|
|
|
|
}
|
2020-08-07 21:02:30 +00:00
|
|
|
}
|
|
|
|
|
2021-05-31 20:19:24 +00:00
|
|
|
-- PocketBook InkPad Color (741)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook741 = PocketBook:extend{
|
2021-05-31 20:19:24 +00:00
|
|
|
model = "PBInkPadColor",
|
|
|
|
display_dpi = 300,
|
2022-11-18 19:23:35 +00:00
|
|
|
color_saturation = 1.5,
|
2021-05-31 20:19:24 +00:00
|
|
|
hasColorScreen = yes,
|
2022-11-18 19:23:35 +00:00
|
|
|
canHWDither = yes, -- Adjust color saturation with inkview
|
2021-05-31 20:19:24 +00:00
|
|
|
canUseCBB = no, -- 24bpp
|
|
|
|
isAlwaysPortrait = yes,
|
|
|
|
usingForcedRotation = landscape_ccw,
|
|
|
|
}
|
|
|
|
|
2022-01-28 15:17:36 +00:00
|
|
|
function PocketBook741._fb_init(fb, finfo, vinfo)
|
|
|
|
-- Pocketbook Color Lux reports bits_per_pixel = 8, but actually uses an RGB24 framebuffer
|
|
|
|
vinfo.bits_per_pixel = 24
|
|
|
|
end
|
|
|
|
|
2023-07-12 14:50:20 +00:00
|
|
|
-- PocketBook InkPad Color 2 (743C)
|
|
|
|
local PocketBook743C = PocketBook:extend{
|
|
|
|
model = "PBInkPadColor2",
|
|
|
|
display_dpi = 300,
|
|
|
|
color_saturation = 1.5,
|
|
|
|
hasColorScreen = yes,
|
|
|
|
canHWDither = yes, -- Adjust color saturation with inkview
|
|
|
|
canUseCBB = no, -- 24bpp
|
|
|
|
isAlwaysPortrait = yes,
|
|
|
|
usingForcedRotation = landscape_ccw,
|
|
|
|
hasNaturalLight = yes,
|
|
|
|
}
|
|
|
|
|
|
|
|
function PocketBook743C._fb_init(fb, finfo, vinfo)
|
|
|
|
-- Pocketbook Color Lux reports bits_per_pixel = 8, but actually uses an RGB24 framebuffer
|
|
|
|
vinfo.bits_per_pixel = 24
|
|
|
|
end
|
|
|
|
|
2023-11-05 12:23:11 +00:00
|
|
|
-- PocketBook InkPad Color 3 (743K3)
|
|
|
|
local PocketBook743K3 = PocketBook:extend{
|
|
|
|
model = "PBInkPadColor3",
|
|
|
|
display_dpi = 300,
|
2023-12-29 16:41:53 +00:00
|
|
|
viewport = Geom:new{x=3, y=2, w=1395, h=1864},
|
2023-11-05 12:23:11 +00:00
|
|
|
color_saturation = 1.5,
|
|
|
|
hasColorScreen = yes,
|
|
|
|
canHWDither = yes, -- Adjust color saturation with inkview
|
|
|
|
canUseCBB = no, -- 24bpp
|
|
|
|
isAlwaysPortrait = yes,
|
|
|
|
usingForcedRotation = landscape_ccw,
|
|
|
|
hasNaturalLight = yes,
|
|
|
|
}
|
|
|
|
|
|
|
|
function PocketBook743K3._fb_init(fb, finfo, vinfo)
|
|
|
|
-- Pocketbook Color Lux reports bits_per_pixel = 8, but actually uses an RGB24 framebuffer
|
|
|
|
vinfo.bits_per_pixel = 24
|
|
|
|
end
|
|
|
|
|
2023-07-07 17:28:06 +00:00
|
|
|
-- PocketBook InkPad 4 (743G/743g)
|
|
|
|
local PocketBook743G = PocketBook:extend{
|
2023-05-20 23:24:27 +00:00
|
|
|
model = "PBInkPad4",
|
|
|
|
display_dpi = 300,
|
|
|
|
isAlwaysPortrait = yes,
|
|
|
|
usingForcedRotation = landscape_ccw,
|
|
|
|
hasNaturalLight = yes,
|
|
|
|
}
|
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook Color Lux (801)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBookColorLux = PocketBook:extend{
|
2019-01-13 23:49:29 +00:00
|
|
|
model = "PBColorLux",
|
2020-08-07 21:02:30 +00:00
|
|
|
display_dpi = 125,
|
2022-11-18 19:23:35 +00:00
|
|
|
color_saturation = 1.5,
|
2018-09-30 19:37:14 +00:00
|
|
|
hasColorScreen = yes,
|
2022-11-18 19:23:35 +00:00
|
|
|
canHWDither = yes, -- Adjust color saturation with inkview
|
2019-05-02 02:27:48 +00:00
|
|
|
canUseCBB = no, -- 24bpp
|
2018-09-30 19:37:14 +00:00
|
|
|
}
|
2020-09-22 20:04:37 +00:00
|
|
|
function PocketBookColorLux:_model_init()
|
2022-12-21 14:50:39 +00:00
|
|
|
self.screen.blitbuffer_rotation_mode = self.screen.DEVICE_ROTATED_UPRIGHT
|
|
|
|
self.screen.native_rotation_mode = self.screen.DEVICE_ROTATED_UPRIGHT
|
2020-09-22 20:04:37 +00:00
|
|
|
end
|
2021-03-10 17:11:58 +00:00
|
|
|
function PocketBookColorLux._fb_init(fb, finfo, vinfo)
|
2020-09-22 20:04:37 +00:00
|
|
|
-- Pocketbook Color Lux reports bits_per_pixel = 8, but actually uses an RGB24 framebuffer
|
|
|
|
vinfo.bits_per_pixel = 24
|
|
|
|
vinfo.xres = vinfo.xres / 3
|
|
|
|
fb.refresh_pixel_size = 3
|
|
|
|
end
|
2018-09-30 19:37:14 +00:00
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook InkPad / InkPad 2 (840)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook840 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PBInkPad",
|
|
|
|
display_dpi = 250,
|
|
|
|
}
|
|
|
|
|
2021-10-17 08:08:51 +00:00
|
|
|
-- PocketBook InkPad Lite (970)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook970 = PocketBook:extend{
|
2021-10-17 08:08:51 +00:00
|
|
|
model = "PB970",
|
|
|
|
display_dpi = 150,
|
|
|
|
isAlwaysPortrait = yes,
|
|
|
|
hasNaturalLight = yes,
|
|
|
|
}
|
|
|
|
|
2020-08-07 21:02:30 +00:00
|
|
|
-- PocketBook InkPad X (1040)
|
Clarify our OOP semantics across the codebase (#9586)
Basically:
* Use `extend` for class definitions
* Use `new` for object instantiations
That includes some minor code cleanups along the way:
* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
* ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 00:14:48 +00:00
|
|
|
local PocketBook1040 = PocketBook:extend{
|
2020-08-07 21:02:30 +00:00
|
|
|
model = "PB1040",
|
|
|
|
display_dpi = 227,
|
2020-09-30 22:10:22 +00:00
|
|
|
isAlwaysPortrait = yes,
|
2020-09-22 20:04:37 +00:00
|
|
|
usingForcedRotation = landscape_ccw,
|
2020-08-19 20:41:10 +00:00
|
|
|
hasNaturalLight = yes,
|
2020-08-07 21:02:30 +00:00
|
|
|
}
|
|
|
|
|
2017-10-22 16:08:53 +00:00
|
|
|
logger.info('SoftwareVersion: ', PocketBook:getSoftwareVersion())
|
|
|
|
|
|
|
|
local codename = PocketBook:getDeviceModel()
|
|
|
|
|
2020-05-24 13:58:43 +00:00
|
|
|
if codename == "PocketBook 515" then
|
|
|
|
return PocketBook515
|
2020-08-20 08:09:54 +00:00
|
|
|
elseif codename == "PB606" or codename == "PocketBook 606" then
|
|
|
|
return PocketBook606
|
2020-08-07 21:02:30 +00:00
|
|
|
elseif codename == "PocketBook 611" then
|
|
|
|
return PocketBook611
|
2020-05-26 15:07:41 +00:00
|
|
|
elseif codename == "PocketBook 613" then
|
|
|
|
return PocketBook613
|
2020-08-19 12:49:17 +00:00
|
|
|
elseif codename == "PocketBook 614" or codename == "PocketBook 614W" then
|
2020-06-26 14:15:49 +00:00
|
|
|
return PocketBook614W
|
2020-08-19 12:49:17 +00:00
|
|
|
elseif codename == "PB615" or codename == "PB615W" or
|
|
|
|
codename == "PocketBook 615" or codename == "PocketBook 615W" then
|
2020-08-07 21:02:30 +00:00
|
|
|
return PocketBook615
|
2020-08-19 12:49:17 +00:00
|
|
|
elseif codename == "PB616" or codename == "PB616W" or
|
|
|
|
codename == "PocketBook 616" or codename == "PocketBook 616W" then
|
2020-05-24 13:58:43 +00:00
|
|
|
return PocketBook616
|
2022-01-28 22:42:42 +00:00
|
|
|
elseif codename == "PB617" or codename == "PocketBook 617" then
|
|
|
|
return PocketBook617
|
2023-10-12 12:53:08 +00:00
|
|
|
elseif codename == "PB618" then
|
|
|
|
return PocketBook618
|
2020-05-24 13:58:43 +00:00
|
|
|
elseif codename == "PocketBook 622" then
|
2019-07-15 12:39:37 +00:00
|
|
|
return PocketBook622
|
|
|
|
elseif codename == "PocketBook 623" then
|
2019-01-13 11:34:53 +00:00
|
|
|
return PocketBook623
|
|
|
|
elseif codename == "PocketBook 624" then
|
|
|
|
return PocketBook624
|
|
|
|
elseif codename == "PB625" then
|
|
|
|
return PocketBook625
|
2019-08-16 20:59:36 +00:00
|
|
|
elseif codename == "PB626" or codename == "PB626(2)-TL3" or
|
|
|
|
codename == "PocketBook 626" then
|
2019-01-13 11:34:53 +00:00
|
|
|
return PocketBook626
|
2018-11-26 14:19:00 +00:00
|
|
|
elseif codename == "PB627" then
|
|
|
|
return PocketBook627
|
2020-08-07 21:02:30 +00:00
|
|
|
elseif codename == "PB628" then
|
|
|
|
return PocketBook628
|
2023-09-25 20:41:09 +00:00
|
|
|
elseif codename == "PB629" then
|
|
|
|
return PocketBook629
|
2019-01-13 11:34:53 +00:00
|
|
|
elseif codename == "PocketBook 630" then
|
|
|
|
return PocketBook630
|
2020-08-07 21:02:30 +00:00
|
|
|
elseif codename == "PB631" or codename == "PocketBook 631" then
|
2017-10-22 16:08:53 +00:00
|
|
|
return PocketBook631
|
2018-12-25 23:56:02 +00:00
|
|
|
elseif codename == "PB632" then
|
|
|
|
return PocketBook632
|
2020-08-07 21:02:30 +00:00
|
|
|
elseif codename == "PB633" then
|
|
|
|
return PocketBook633
|
2023-09-25 20:41:09 +00:00
|
|
|
elseif codename == "PB634" then
|
|
|
|
return PocketBook634
|
2020-08-20 08:09:54 +00:00
|
|
|
elseif codename == "PB640" or codename == "PocketBook 640" then
|
2020-08-07 21:02:30 +00:00
|
|
|
return PocketBook640
|
2019-01-05 08:02:45 +00:00
|
|
|
elseif codename == "PB641" then
|
|
|
|
return PocketBook641
|
2020-08-20 08:09:54 +00:00
|
|
|
elseif codename == "PB650" or codename == "PocketBook 650" then
|
2020-08-07 21:02:30 +00:00
|
|
|
return PocketBook650
|
2022-07-23 13:29:09 +00:00
|
|
|
elseif codename == "PB700" or codename == "PocketBook 700" then
|
|
|
|
return PocketBook700
|
2018-04-04 16:26:44 +00:00
|
|
|
elseif codename == "PB740" then
|
|
|
|
return PocketBook740
|
2022-02-27 13:51:22 +00:00
|
|
|
elseif codename == "PB740-2" or codename == "PB740-3" then
|
2019-09-18 13:21:04 +00:00
|
|
|
return PocketBook740_2
|
2021-05-31 20:19:24 +00:00
|
|
|
elseif codename == "PB741" then
|
|
|
|
return PocketBook741
|
2023-07-12 14:50:20 +00:00
|
|
|
elseif codename == "PB743C" then
|
|
|
|
return PocketBook743C
|
2023-11-05 12:23:11 +00:00
|
|
|
elseif codename == "PB743K3" then
|
|
|
|
return PocketBook743K3
|
2023-07-07 17:28:06 +00:00
|
|
|
elseif codename == "PB743G" or codename == "PB743g" or codename == "PocketBook 743G" or codename == "PocketBook 743g" then
|
|
|
|
return PocketBook743G
|
2023-06-15 11:54:15 +00:00
|
|
|
elseif codename == "PocketBook 840" or codename == "Reader InkPad" then
|
2019-01-13 11:34:53 +00:00
|
|
|
return PocketBook840
|
2021-10-17 08:08:51 +00:00
|
|
|
elseif codename == "PB970" then
|
|
|
|
return PocketBook970
|
2020-08-07 21:02:30 +00:00
|
|
|
elseif codename == "PB1040" then
|
|
|
|
return PocketBook1040
|
2018-09-30 19:37:14 +00:00
|
|
|
elseif codename == "PocketBook Color Lux" then
|
|
|
|
return PocketBookColorLux
|
2017-10-22 16:08:53 +00:00
|
|
|
else
|
|
|
|
error("unrecognized PocketBook model " .. codename)
|
|
|
|
end
|