mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add getOrientation method for einkfb module
This commit is contained in:
12
einkfb.c
12
einkfb.c
@@ -236,6 +236,17 @@ static int einkSetOrientation(lua_State *L) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int einkGetOrientation(lua_State *L) {
|
||||
int mode = 0;
|
||||
#ifndef EMULATE_READER
|
||||
FBInfo *fb = (FBInfo*) luaL_checkudata(L, 1, "einkfb");
|
||||
|
||||
ioctl(fb->fd, FBIO_EINK_GET_DISPLAY_ORIENTATION, &mode);
|
||||
#endif
|
||||
lua_pushinteger(L, mode);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static const struct luaL_Reg einkfb_func[] = {
|
||||
{"open", openFrameBuffer},
|
||||
@@ -246,6 +257,7 @@ static const struct luaL_Reg einkfb_meth[] = {
|
||||
{"close", closeFrameBuffer},
|
||||
{"__gc", closeFrameBuffer},
|
||||
{"refresh", einkUpdate},
|
||||
{"getOrientation", einkGetOrientation},
|
||||
{"setOrientation", einkSetOrientation},
|
||||
{"getSize", getSize},
|
||||
{NULL, NULL}
|
||||
|
||||
Reference in New Issue
Block a user