mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add screen dpi property in koptcontext
This commit is contained in:
@@ -26,6 +26,7 @@ static int newKOPTContext(lua_State *L) {
|
||||
int columns = 2;
|
||||
int offset_x = 0;
|
||||
int offset_y = 0;
|
||||
int dev_dpi = 167;
|
||||
int dev_width = 600;
|
||||
int dev_height = 800;
|
||||
int page_width = 600;
|
||||
@@ -58,6 +59,7 @@ static int newKOPTContext(lua_State *L) {
|
||||
kc->columns = columns;
|
||||
kc->offset_x = offset_x;
|
||||
kc->offset_y = offset_y;
|
||||
kc->dev_dpi = dev_dpi;
|
||||
kc->dev_width = dev_width;
|
||||
kc->dev_height = dev_height;
|
||||
kc->page_width = page_width;
|
||||
@@ -146,6 +148,12 @@ static int kcGetOffset(lua_State *L) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int kcSetDeviceDPI(lua_State *L) {
|
||||
KOPTContext *kc = (KOPTContext*) luaL_checkudata(L, 1, "koptcontext");
|
||||
kc->dev_dpi = luaL_checkint(L, 2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int kcSetDeviceDim(lua_State *L) {
|
||||
KOPTContext *kc = (KOPTContext*) luaL_checkudata(L, 1, "koptcontext");
|
||||
kc->dev_width = luaL_checkint(L, 2);
|
||||
@@ -243,6 +251,7 @@ static const struct luaL_Reg koptcontext_meth[] = {
|
||||
{"setOffset", kcSetOffset},
|
||||
{"getOffset", kcGetOffset},
|
||||
{"setDeviceDim", kcSetDeviceDim},
|
||||
{"setDeviceDPI", kcSetDeviceDPI},
|
||||
{"getPageDim", kcGetPageDim},
|
||||
{"setStraighten", kcSetStraighten},
|
||||
{"setJustification", kcSetJustification},
|
||||
|
||||
Submodule libk2pdfopt updated: d9ed4f0b5d...5984acd181
Reference in New Issue
Block a user