Skip to content

Commit

Permalink
input: drop unused pocketbook leftovers
Browse files Browse the repository at this point in the history
Pocketbook devices don't even load `koreader-input`, cf. `frontend/device/input.lua`:
```lua
    elseif self.device:isAndroid() then
        self.input = require("ffi/input_android")
    elseif self.device:isPocketBook() then
        self.input = require("ffi/input_pocketbook")
    else
        self.input = require("libs/libkoreader-input")
    end
```
  • Loading branch information
benoit-pierre committed Dec 12, 2024
1 parent 60c0256 commit 416d1af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 288 deletions.
263 changes: 0 additions & 263 deletions input/input-pocketbook.h

This file was deleted.

25 changes: 4 additions & 21 deletions input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ int inputfds[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
size_t fd_idx = 0U; // index of the *next* fd in inputfds (also, *current* amount of open fds)
pid_t fake_ev_generator_pid = -1;

#if defined(POCKETBOOK)
# include "input-pocketbook.h"
#elif defined(KINDLE)
#if defined(KINDLE)
# include "input-kindle.h"
#elif defined(KOBO)
# include "input-kobo.h"
Expand All @@ -72,9 +70,8 @@ pid_t fake_ev_generator_pid = -1;
# include "input-cervantes.h"
#endif

// NOTE: Legacy Kindle systems are too old to support timerfd (and we don't really need it there anyway),
// and PocketBook uses a custom polling loop.
#if !defined(KINDLE_LEGACY) && !defined(POCKETBOOK)
// NOTE: Legacy Kindle systems are too old to support timerfd (and we don't really need it there anyway).
#if !defined(KINDLE_LEGACY)
# include "timerfd-callbacks.h"
#endif

Expand Down Expand Up @@ -111,21 +108,10 @@ static int openInputDevice(lua_State* L)
// Otherwise, we're golden, and fd_idx is the index of the next free slot in the inputfds array ;).
const char* restrict ko_dont_grab_input = getenv("KO_DONT_GRAB_INPUT");

#if defined(POCKETBOOK)
// NOTE: This is for the deprecated Lua/C PB input implementation (c.f., "input-pocketbook.h").
// The frontend code (e.g., device/input's open wrapper) no longer uses nor supports this,
// as we've unconditionally moved to using the newer Lua/FFI implementation (c.f., ffi/input_pocketbook).
int inkview_events = luaL_checkint(L, 2);
if (inkview_events == 1) {
startInkViewMain(L, fd_idx, inputdevice);
return 0;
}
#endif

if (!strcmp("fake_events", inputdevice)) {
// Special case: the power slider for Kindle and USB events for Kobo.
int pipefd[2U];
#if defined(KINDLE_LEGACY) || defined(POCKETBOOK)
#if defined(KINDLE_LEGACY)
// pipe2 requires Linux 2.6.27 & glibc 2.9...
if (pipe(pipefd) == -1) {
return luaL_error(L, "Cannot create fake event generator communication pipe (pipe(): %s)", strerror(errno));
Expand Down Expand Up @@ -570,9 +556,6 @@ static const struct luaL_Reg input_func[] = {
{ "closeAll", closeAllInputDevices },
{ "waitForEvent", waitForInput },
{ "fakeTapInput", fakeTapInput },
#if defined(POCKETBOOK)
{ "setSuspendState", setSuspendState },
#endif
#if defined(WITH_TIMERFD)
{ "setTimer", setTimer },
{ "clearTimer", clearTimer },
Expand Down
6 changes: 2 additions & 4 deletions thirdparty/cmake_modules/koreader_targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,8 @@ declare_koreader_target(
set(DEPENDS luajit::luajit)
if(KINDLE OR REMARKABLE)
list(APPEND DEPENDS popen-noshell::popen-noshell)
elseif(POCKETBOOK)
list(APPEND DEPENDS dl inkview pthread)
endif()
if(ANDROID OR USE_SDL)
if(ANDROID OR POCKETBOOK OR USE_SDL)
set(EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL)
else()
set(EXCLUDE_FROM_ALL)
Expand All @@ -129,7 +127,7 @@ declare_koreader_target(
VISIBILITY hidden
)
function(setup_koreader_input)
foreach(PLATFORM CERVANTES KOBO KINDLE LEGACY POCKETBOOK REMARKABLE SONY_PRSTUX)
foreach(PLATFORM CERVANTES KOBO KINDLE LEGACY REMARKABLE SONY_PRSTUX)
if(${PLATFORM})
if(PLATFORM STREQUAL "LEGACY")
set(PLATFORM KINDLE_LEGACY)
Expand Down

0 comments on commit 416d1af

Please sign in to comment.