diff options
Diffstat (limited to 'src/gmdocument.h')
-rw-r--r-- | src/gmdocument.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/gmdocument.h b/src/gmdocument.h index fcbb7e59..943a408c 100644 --- a/src/gmdocument.h +++ b/src/gmdocument.h | |||
@@ -22,6 +22,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
22 | 22 | ||
23 | #pragma once | 23 | #pragma once |
24 | 24 | ||
25 | #include "defs.h" | ||
25 | #include "gmutil.h" | 26 | #include "gmutil.h" |
26 | #include "media.h" | 27 | #include "media.h" |
27 | 28 | ||
@@ -125,12 +126,12 @@ enum iGmRunMediaType { | |||
125 | 126 | ||
126 | struct Impl_GmRun { | 127 | struct Impl_GmRun { |
127 | iRangecc text; | 128 | iRangecc text; |
129 | iRect bounds; /* used for hit testing, may extend to edges */ | ||
130 | iRect visBounds; /* actual visual bounds */ | ||
128 | uint8_t font; | 131 | uint8_t font; |
129 | uint8_t color; | 132 | uint8_t color; |
130 | uint8_t flags; | 133 | uint8_t flags; |
131 | uint8_t mediaType; | 134 | uint8_t mediaType; |
132 | iRect bounds; /* used for hit testing, may extend to edges */ | ||
133 | iRect visBounds; /* actual visual bounds */ | ||
134 | uint16_t preId; /* preformatted block ID (sequential) */ | 135 | uint16_t preId; /* preformatted block ID (sequential) */ |
135 | iGmLinkId linkId; /* zero for non-links */ | 136 | iGmLinkId linkId; /* zero for non-links */ |
136 | uint16_t mediaId; /* zero if not an image */ | 137 | uint16_t mediaId; /* zero if not an image */ |
@@ -148,29 +149,29 @@ iRangecc findLoc_GmRun (const iGmRun *, iInt2 pos); | |||
148 | iDeclareClass(GmDocument) | 149 | iDeclareClass(GmDocument) |
149 | iDeclareObjectConstruction(GmDocument) | 150 | iDeclareObjectConstruction(GmDocument) |
150 | 151 | ||
151 | enum iGmDocumentFormat { | ||
152 | undefined_GmDocumentFormat = -1, | ||
153 | gemini_GmDocumentFormat = 0, | ||
154 | plainText_GmDocumentFormat, | ||
155 | }; | ||
156 | |||
157 | enum iGmDocumentBanner { | 152 | enum iGmDocumentBanner { |
158 | none_GmDocumentBanner, | 153 | none_GmDocumentBanner, |
159 | siteDomain_GmDocumentBanner, | 154 | siteDomain_GmDocumentBanner, |
160 | certificateWarning_GmDocumentBanner, | 155 | certificateWarning_GmDocumentBanner, |
161 | }; | 156 | }; |
162 | 157 | ||
158 | enum iGmDocumentUpdate { | ||
159 | partial_GmDocumentUpdate, /* appending more content */ | ||
160 | final_GmDocumentUpdate, /* process all lines, including the last one if not terminated */ | ||
161 | }; | ||
162 | |||
163 | void setThemeSeed_GmDocument (iGmDocument *, const iBlock *seed); | 163 | void setThemeSeed_GmDocument (iGmDocument *, const iBlock *seed); |
164 | void setFormat_GmDocument (iGmDocument *, enum iGmDocumentFormat format); | 164 | void setFormat_GmDocument (iGmDocument *, enum iSourceFormat format); |
165 | void setBanner_GmDocument (iGmDocument *, enum iGmDocumentBanner type); | 165 | void setBanner_GmDocument (iGmDocument *, enum iGmDocumentBanner type); |
166 | void setWidth_GmDocument (iGmDocument *, int width); | 166 | void setWidth_GmDocument (iGmDocument *, int width); |
167 | void redoLayout_GmDocument (iGmDocument *); | 167 | void redoLayout_GmDocument (iGmDocument *); |
168 | iBool updateOpenURLs_GmDocument(iGmDocument *); | 168 | iBool updateOpenURLs_GmDocument(iGmDocument *); |
169 | void setUrl_GmDocument (iGmDocument *, const iString *url); | 169 | void setUrl_GmDocument (iGmDocument *, const iString *url); |
170 | void setSource_GmDocument (iGmDocument *, const iString *source, int width); | 170 | void setSource_GmDocument (iGmDocument *, const iString *source, int width, |
171 | enum iGmDocumentUpdate updateType); | ||
171 | void foldPre_GmDocument (iGmDocument *, uint16_t preId); | 172 | void foldPre_GmDocument (iGmDocument *, uint16_t preId); |
172 | 173 | ||
173 | void reset_GmDocument (iGmDocument *); /* free images */ | 174 | //void reset_GmDocument (iGmDocument *); /* free images */ |
174 | 175 | ||
175 | typedef void (*iGmDocumentRenderFunc)(void *, const iGmRun *); | 176 | typedef void (*iGmDocumentRenderFunc)(void *, const iGmRun *); |
176 | 177 | ||
@@ -190,6 +191,7 @@ enum iGmDocumentBanner bannerType_GmDocument(const iGmDocument *); | |||
190 | const iString * bannerText_GmDocument (const iGmDocument *); | 191 | const iString * bannerText_GmDocument (const iGmDocument *); |
191 | const iArray * headings_GmDocument (const iGmDocument *); /* array of GmHeadings */ | 192 | const iArray * headings_GmDocument (const iGmDocument *); /* array of GmHeadings */ |
192 | const iString * source_GmDocument (const iGmDocument *); | 193 | const iString * source_GmDocument (const iGmDocument *); |
194 | size_t memorySize_GmDocument (const iGmDocument *); /* bytes */ | ||
193 | 195 | ||
194 | iRangecc findText_GmDocument (const iGmDocument *, const iString *text, const char *start); | 196 | iRangecc findText_GmDocument (const iGmDocument *, const iString *text, const char *start); |
195 | iRangecc findTextBefore_GmDocument (const iGmDocument *, const iString *text, const char *before); | 197 | iRangecc findTextBefore_GmDocument (const iGmDocument *, const iString *text, const char *before); |