Files
koreader/frontend/device/emulator/device.lua
Hans-Werner Hilse 63af71188a refactor refresh
Lots of the device-related distinction wandered into
base/ffi/framebuffer_<driver>. This eases the refresh logic in
UI manager, which basically only decides what kind of refresh
to trigger. The device specific configuration in the framebuffer
driver decides how to realize that whish.

screen.lua is gone, in its place is now the framebuffer driver.
The device abstraction decides what framebuffer driver to load.
2014-11-23 12:13:32 +00:00

34 lines
858 B
Lua

local Generic = require("device/generic/device")
local util = require("ffi/util")
local function yes() return true end
local Device = Generic:new{
model = "Emulator",
isEmulator = yes,
hasKeyboard = yes,
hasKeys = yes,
hasFrontlight = yes,
isTouchDevice = yes,
}
function Device:init()
if util.haveSDL2() then
self.screen = require("ffi/framebuffer_SDL2_0"):new{device = self}
self.input = require("device/input"):new{
device = self,
event_map = require("device/emulator/event_map_sdl2"),
}
else
self.screen = require("ffi/framebuffer_SDL1_2"):new{device = self}
self.input = require("device/input"):new{
device = self,
event_map = require("device/emulator/event_map_sdl"),
}
end
Generic.init(self)
end
return Device