=> 47024a3bd5f9b9173319a0c345e546bb573daf56
[1mdiff --git a/src/defs.h b/src/defs.h[m [1mindex d592abb2..d16c56f5 100644[m [1m--- a/src/defs.h[m [1m+++ b/src/defs.h[m [36m@@ -36,6 +36,8 @@[m [menum iFileVersion {[m [m /* Icons */[m [m [32m+[m[32m#define rightArrowhead_Icon "\u27a4"[m [32m+[m[32m#define leftArrowhead_Icon "\u27a4"[m #define warning_Icon "\u26a0"[m #define openLock_Icon "\U0001f513"[m #define closedLock_Icon "\U0001f512"[m [1mdiff --git a/src/gempub.c b/src/gempub.c[m [1mindex aa03d835..f3021add 100644[m [1m--- a/src/gempub.c[m [1m+++ b/src/gempub.c[m [36m@@ -213,6 +213,10 @@[m [miBool isOpen_Gempub(const iGempub *d) {[m return d->arch != NULL;[m }[m [m [32m+[m[32mconst iString *property_Gempub(const iGempub *d, enum iGempubProperty prop) {[m [32m+[m[32m return &d->props[prop];[m [32m+[m[32m}[m [32m+[m const iString *coverPageUrl_Gempub(const iGempub *d) {[m return &d->baseUrl;[m }[m [36m@@ -232,6 +236,39 @@[m [mconst iString *navStartLinkUrl_Gempub(const iGempub *d) {[m return &((const iGempubNavLink *) constFront_Array(d->navLinks))->url;[m }[m [m [32m+[m[32msize_t navSize_Gempub(const iGempub *d) {[m [32m+[m[32m parseNavigationLinks_Gempub_(d);[m [32m+[m[32m return size_Array(d->navLinks);[m [32m+[m[32m}[m [32m+[m [32m+[m[32msize_t navIndex_Gempub(const iGempub *d, const iString *url) {[m [32m+[m[32m parseNavigationLinks_Gempub_(d);[m [32m+[m[32m const iString *normUrl = withSpacesEncoded_String(url);[m [32m+[m[32m iConstForEach(Array, i, d->navLinks) {[m [32m+[m[32m const iGempubNavLink *nav = i.value;[m [32m+[m[32m if (equalCase_String(&nav->url, normUrl)) {[m [32m+[m[32m return index_ArrayConstIterator(&i);[m [32m+[m[32m }[m [32m+[m[32m }[m [32m+[m[32m return iInvalidPos;[m [32m+[m[32m}[m [32m+[m [32m+[m[32mconst iString *navLinkUrl_Gempub(const iGempub *d, size_t index) {[m [32m+[m[32m parseNavigationLinks_Gempub_(d);[m [32m+[m[32m if (index < size_Array(d->navLinks)) {[m [32m+[m[32m return &constValue_Array(d->navLinks, index, iGempubNavLink).url;[m [32m+[m[32m }[m [32m+[m[32m return NULL;[m [32m+[m[32m}[m [32m+[m [32m+[m[32mconst iString *navLinkLabel_Gempub(const iGempub *d, size_t index) {[m [32m+[m[32m parseNavigationLinks_Gempub_(d);[m [32m+[m[32m if (index < size_Array(d->navLinks)) {[m [32m+[m[32m return &constValue_Array(d->navLinks, index, iGempubNavLink).label;[m [32m+[m[32m }[m [32m+[m[32m return NULL;[m[41m [m [32m+[m[32m}[m [32m+[m static iBool hasProperty_Gempub_(const iGempub *d, enum iGempubProperty prop) {[m return !isEmpty_String(&d->props[prop]);[m }[m [1mdiff --git a/src/gempub.h b/src/gempub.h[m [1mindex 6912bcc9..c03cabe6 100644[m [1m--- a/src/gempub.h[m [1m+++ b/src/gempub.h[m [36m@@ -60,5 +60,9 @@[m [mconst iString * property_Gempub (const iGempub *, enum iGempubProperty);[m const iString * coverPageUrl_Gempub (const iGempub *);[m const iString * indexPageUrl_Gempub (const iGempub *);[m const iString * navStartLinkUrl_Gempub (const iGempub *); /* for convenience */[m [32m+[m[32msize_t navSize_Gempub (const iGempub *);[m [32m+[m[32msize_t navIndex_Gempub (const iGempub *, const iString *url);[m [32m+[m[32mconst iString * navLinkUrl_Gempub (const iGempub *, size_t index);[m [32m+[m[32mconst iString * navLinkLabel_Gempub (const iGempub *, size_t index);[m [m extern const char *mimeType_Gempub;[m [1mdiff --git a/src/gmdocument.c b/src/gmdocument.c[m [1mindex ec406a63..ad8616a3 100644[m [1m--- a/src/gmdocument.c[m [1m+++ b/src/gmdocument.c[m [36m@@ -30,6 +30,7 @@[m [mSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */[m #include "visited.h"[m #include "bookmarks.h"[m #include "app.h"[m [32m+[m[32m#include "defs.h"[m [m #include[m #include [m [36m@@ -400,7 +401,7 @@[m [mstatic void doLayout_GmDocument_(iGmDocument *d) {[m static const float bottomMargin[max_GmLineType] = {[m 0.0f, 0.333f, 1.0f, 0.5f, 0.5f, 0.5f, 0.5f, 0.25f[m };[m [31m- static const char *arrow = "\u27a4";[m [32m+[m[32m static const char *arrow = rightArrowhead_Icon;[m static const char *envelope = "\U0001f4e7";[m static const char *bullet = "\u2022";[m static const char *folder = "\U0001f4c1";[m [1mdiff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c[m [1mindex f354623e..c8aad02b 100644[m [1m--- a/src/ui/documentwidget.c[m [1m+++ b/src/ui/documentwidget.c[m [36m@@ -1222,15 +1222,89 @@[m [mstatic void postProcessRequestContent_DocumentWidget_(iDocumentWidget *d, iBool[m }[m if (d->sourceGempub) {[m if (equal_String(d->mod.url, coverPageUrl_Gempub(d->sourceGempub))) {[m [31m- makeFooterButtons_DocumentWidget_(d, (iMenuItem[]){[m [31m- { "Gempub Cover Page", 0, 0, NULL }[m [31m- }, 1);[m [32m+[m[32m if (equalCase_Rangecc(urlScheme_String(d->mod.url), "file")) {[m [32m+[m[32m iArray *items = collectNew_Array(sizeof(iMenuItem));[m [32m+[m[32m pushBack_Array([m [32m+[m[32m items,[m [32m+[m[32m &(iMenuItem){ book_Icon " ${gempub.cover.view}",[m [32m+[m[32m 0,[m [32m+[m[32m 0,[m [32m+[m[32m format_CStr("!open url:%s",[m [32m+[m[32m cstr_String(indexPageUrl_Gempub(d->sourceGempub))) });[m [32m+[m[32m if (navSize_Gempub(d->sourceGempub) > 0) {[m [32m+[m[32m pushBack_Array([m [32m+[m[32m items,[m [32m+[m[32m &(iMenuItem){[m [32m+[m[32m format_CStr(forwardArrow_Icon " %s",[m [32m+[m[32m cstr_String(navLinkLabel_Gempub(d->sourceGempub, 0))),[m [32m+[m[32m SDLK_RIGHT,[m [32m+[m[32m 0,[m [32m+[m[32m format_CStr("!open url:%s",[m [32m+[m[32m cstr_String(navLinkUrl_Gempub(d->sourceGempub, 0))) });[m [32m+[m[32m }[m [32m+[m[32m makeFooterButtons_DocumentWidget_(d, constData_Array(items), size_Array(items));[m [32m+[m[32m }[m if (preloadCoverImage_Gempub(d->sourceGempub, d->doc)) {[m redoLayout_GmDocument(d->doc);[m updateVisible_DocumentWidget_(d);[m invalidate_DocumentWidget_(d);[m }[m }[m [32m+[m[32m else if (equal_String(d->mod.url, indexPageUrl_Gempub(d->sourceGempub))) {[m [32m+[m[32m makeFooterButtons_DocumentWidget_([m [32m+[m[32m d,[m [32m+[m[32m (iMenuItem[]){ { format_CStr(book_Icon " %s",[m [32m+[m[32m cstr_String(property_Gempub(d->sourceGempub,[m [32m+[m[32m title_GempubProperty))),[m [32m+[m[32m SDLK_LEFT,[m [32m+[m[32m 0,[m [32m+[m[32m format_CStr("!open url:%s",[m [32m+[m[32m cstr_String(coverPageUrl_Gempub(d->sourceGempub))) } },[m [32m+[m[32m 1);[m [32m+[m[32m }[m [32m+[m[32m else {[m [32m+[m[32m /* Navigation buttons. */[m [32m+[m[32m iArray *items = collectNew_Array(sizeof(iMenuItem));[m [32m+[m[32m const size_t navIndex = navIndex_Gempub(d->sourceGempub, d->mod.url);[m [32m+[m[32m if (navIndex != iInvalidPos) {[m [32m+[m[32m if (navIndex < navSize_Gempub(d->sourceGempub) - 1) {[m [32m+[m[32m pushBack_Array([m [32m+[m[32m items,[m [32m+[m[32m &(iMenuItem){[m [32m+[m[32m format_CStr(forwardArrow_Icon " %s",[m [32m+[m[32m cstr_String(navLinkLabel_Gempub(d->sourceGempub, navIndex + 1))),[m [32m+[m[32m SDLK_RIGHT,[m [32m+[m[32m 0,[m [32m+[m[32m format_CStr("!open url:%s",[m [32m+[m[32m cstr_String(navLinkUrl_Gempub(d->sourceGempub, navIndex + 1))) });[m [32m+[m[32m }[m [32m+[m[32m if (navIndex > 0) {[m [32m+[m[32m pushBack_Array([m [32m+[m[32m items,[m [32m+[m[32m &(iMenuItem){[m [32m+[m[32m format_CStr(backArrow_Icon " %s",[m [32m+[m[32m cstr_String(navLinkLabel_Gempub(d->sourceGempub, navIndex - 1))),[m [32m+[m[32m SDLK_LEFT,[m [32m+[m[32m 0,[m [32m+[m[32m format_CStr("!open url:%s",[m [32m+[m[32m cstr_String(navLinkUrl_Gempub(d->sourceGempub, navIndex - 1))) });[m [32m+[m[32m }[m [32m+[m[32m else if (!equalCase_String(d->mod.url, indexPageUrl_Gempub(d->sourceGempub))) {[m [32m+[m[32m pushBack_Array([m [32m+[m[32m items,[m [32m+[m[32m &(iMenuItem){[m [32m+[m[32m format_CStr(book_Icon " %s",[m [32m+[m[32m cstr_String(property_Gempub(d->sourceGempub, title_GempubProperty))),[m [32m+[m[32m SDLK_LEFT,[m [32m+[m[32m 0,[m [32m+[m[32m format_CStr("!open url:%s",[m [32m+[m[32m cstr_String(coverPageUrl_Gempub(d->sourceGempub))) });[m [32m+[m[32m }[m [32m+[m[32m }[m [32m+[m[32m if (!isEmpty_Array(items)) {[m [32m+[m[32m makeFooterButtons_DocumentWidget_(d, constData_Array(items), size_Array(items));[m[41m [m [32m+[m[32m }[m [32m+[m[32m }[m if (!isCached && prefs_App()->pinSplit &&[m equal_String(d->mod.url, indexPageUrl_Gempub(d->sourceGempub))) {[m const iString *navStart = navStartLinkUrl_Gempub(d->sourceGempub);[m
text/gemini; charset=utf-8
This content has been proxied by September (3851b).