add screen dpi property in koptcontext

pull/2/merge
chrox 12 years ago
parent da87914cbf
commit 631f56bc78

@ -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},

@ -1 +1 @@
Subproject commit d9ed4f0b5d9212cdcc97fa432b83ba46eab21d09
Subproject commit 5984acd18199ecc7ca7b59f6c172edf9e8076ba5
Loading…
Cancel
Save