From edf1c0bb8b112879433f2e31fd9750c30e2d5144 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 28 Nov 2020 14:23:18 +0200 Subject: Scrolling wide preformatted blocks horizontally Not entirely glitch-free but should be good enough for now. IssueID #44 --- src/gmdocument.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/gmdocument.h') diff --git a/src/gmdocument.h b/src/gmdocument.h index c2a4b272..6804d772 100644 --- a/src/gmdocument.h +++ b/src/gmdocument.h @@ -90,11 +90,19 @@ struct Impl_GmRun { uint8_t flags; iRect bounds; /* used for hit testing, may extend to edges */ iRect visBounds; /* actual visual bounds */ + uint16_t preId; /* preformatted block ID (sequential) */ iGmLinkId linkId; /* zero for non-links */ uint16_t imageId; /* zero if not an image */ uint16_t audioId; /* zero if not audio */ }; +iDeclareType(GmRunRange) + +struct Impl_GmRunRange { + const iGmRun *start; + const iGmRun *end; +}; + const char * findLoc_GmRun (const iGmRun *, iInt2 pos); iDeclareClass(GmDocument) @@ -130,8 +138,9 @@ const iString * bannerText_GmDocument (const iGmDocument *); const iArray * headings_GmDocument (const iGmDocument *); /* array of GmHeadings */ const iString * source_GmDocument (const iGmDocument *); -iRangecc findText_GmDocument (const iGmDocument *, const iString *text, const char *start); -iRangecc findTextBefore_GmDocument (const iGmDocument *, const iString *text, const char *before); +iRangecc findText_GmDocument (const iGmDocument *, const iString *text, const char *start); +iRangecc findTextBefore_GmDocument (const iGmDocument *, const iString *text, const char *before); +iGmRunRange findPreformattedRange_GmDocument (const iGmDocument *, const iGmRun *run); enum iGmLinkPart { icon_GmLinkPart, -- cgit v1.2.3