From 095873194b87a90c4ca34f5501e81436821955a6 Mon Sep 17 00:00:00 2001 From: 4silvertooth Date: Mon, 7 Jun 2021 18:24:53 +0530 Subject: [PATCH] fix: typo in asset decleration how class Font was working till now is a curious case --- PDF.h | 55 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/PDF.h b/PDF.h index e1dd9a0..9261369 100644 --- a/PDF.h +++ b/PDF.h @@ -5,35 +5,50 @@ #include "aux-cvt.h" #include "hpdf.h" +namespace sciter { + inline sciter::value setter(const HPDF_TextAlignment& value) { + return (int)value; + } + + inline sciter::value setter(const HPDF_PageDirection& value) { + return (int)value; + } + + inline sciter::value setter(const HPDF_PageSizes& value) { + return (int)value; + } +} + + namespace libharu { class Image; class Page : public sciter::om::asset { HPDF_Page page; - sciter::value TALIGN_LEFT = (int)HPDF_TALIGN_LEFT; - sciter::value TALIGN_RIGHT = (int)HPDF_TALIGN_RIGHT; - sciter::value TALIGN_CENTER = (int)HPDF_TALIGN_CENTER; - sciter::value TALIGN_JUSTIFY = (int)HPDF_TALIGN_JUSTIFY; + sciter::value TALIGN_LEFT = HPDF_TALIGN_LEFT; + sciter::value TALIGN_RIGHT = HPDF_TALIGN_RIGHT; + sciter::value TALIGN_CENTER = HPDF_TALIGN_CENTER; + sciter::value TALIGN_JUSTIFY = HPDF_TALIGN_JUSTIFY; /** sciter::value TALIGN_TOP = (int)HPDF_TALIGN_TOP; sciter::value TALIGN_BOTTOM = (int)HPDF_TALIGN_BOTTOM; sciter::value TALIGN_MIDDLE = (int)HPDF_TALIGN_MIDDLE; */ - sciter::value SIZE_LETTER = (int)HPDF_PAGE_SIZE_LETTER; - sciter::value SIZE_LEGAL = (int)HPDF_PAGE_SIZE_LEGAL; - sciter::value SIZE_A3 = (int)HPDF_PAGE_SIZE_A3; - sciter::value SIZE_A4 = (int)HPDF_PAGE_SIZE_A4; - sciter::value SIZE_A5 = (int)HPDF_PAGE_SIZE_A5; - sciter::value SIZE_B4 = (int)HPDF_PAGE_SIZE_B4; - sciter::value SIZE_B5 = (int)HPDF_PAGE_SIZE_B5; - sciter::value SIZE_EXECUTIVE = (int)HPDF_PAGE_SIZE_EXECUTIVE; - sciter::value SIZE_US4x6 = (int)HPDF_PAGE_SIZE_US4x6; - sciter::value SIZE_US4x8 = (int)HPDF_PAGE_SIZE_US4x8; - sciter::value SIZE_US5x7 = (int)HPDF_PAGE_SIZE_US5x7; - sciter::value SIZE_COMM10 = (int)HPDF_PAGE_SIZE_COMM10; - - sciter::value PORTRAIT = (int)HPDF_PAGE_PORTRAIT; - sciter::value LANDSCAPE = (int)HPDF_PAGE_LANDSCAPE; + sciter::value SIZE_LETTER = HPDF_PAGE_SIZE_LETTER; + sciter::value SIZE_LEGAL = HPDF_PAGE_SIZE_LEGAL; + sciter::value SIZE_A3 = HPDF_PAGE_SIZE_A3; + sciter::value SIZE_A4 = HPDF_PAGE_SIZE_A4; + sciter::value SIZE_A5 = HPDF_PAGE_SIZE_A5; + sciter::value SIZE_B4 = HPDF_PAGE_SIZE_B4; + sciter::value SIZE_B5 = HPDF_PAGE_SIZE_B5; + sciter::value SIZE_EXECUTIVE = HPDF_PAGE_SIZE_EXECUTIVE; + sciter::value SIZE_US4x6 = HPDF_PAGE_SIZE_US4x6; + sciter::value SIZE_US4x8 = HPDF_PAGE_SIZE_US4x8; + sciter::value SIZE_US5x7 = HPDF_PAGE_SIZE_US5x7; + sciter::value SIZE_COMM10 = HPDF_PAGE_SIZE_COMM10; + + sciter::value PORTRAIT = HPDF_PAGE_PORTRAIT; + sciter::value LANDSCAPE = HPDF_PAGE_LANDSCAPE; public: @@ -186,7 +201,7 @@ class Image : public sciter::om::asset { SOM_PASSPORT_END }; -class Font : public sciter::om::asset { +class Font : public sciter::om::asset { HPDF_Font font; public: