summaryrefslogtreecommitdiff
path: root/src/history.h
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-06-25 16:26:53 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-06-25 16:26:53 +0300
commit5dbc85eaaa1bd0a0fc11dd76a75ece2efe763df5 (patch)
tree9721fb7aced603adb10b9bb3f3beb3f8d5fba973 /src/history.h
parent95c527db1484f7758a180c6de051d0182c3b2e81 (diff)
parentf99a9111170f2ff28383fd3172fdaf4b9a1ba069 (diff)
Merge branch 'work/v1.6' into work/serious-unicode
# Conflicts: # res/fonts/SmolEmoji-Regular.ttf
Diffstat (limited to 'src/history.h')
-rw-r--r--src/history.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/history.h b/src/history.h
index 164a61d6..7dad72df 100644
--- a/src/history.h
+++ b/src/history.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 "gmdocument.h"
25#include "gmrequest.h" 26#include "gmrequest.h"
26 27
27#include <the_Foundation/ptrarray.h> 28#include <the_Foundation/ptrarray.h>
@@ -37,6 +38,17 @@ struct Impl_RecentUrl {
37 iString url; 38 iString url;
38 float normScrollY; /* normalized to document height */ 39 float normScrollY; /* normalized to document height */
39 iGmResponse *cachedResponse; /* kept in memory for quicker back navigation */ 40 iGmResponse *cachedResponse; /* kept in memory for quicker back navigation */
41 iGmDocument *cachedDoc; /* cached copy of the presentation: layout and media (not serialized) */
42 struct {
43 uint8_t openedFromSidebar : 1;
44 } flags;
45};
46
47iDeclareType(MemInfo)
48
49struct Impl_MemInfo {
50 size_t cacheSize; /* number of bytes stored persistently */
51 size_t memorySize; /* number of bytes stored in RAM */
40}; 52};
41 53
42/*----------------------------------------------------------------------------------------------*/ 54/*----------------------------------------------------------------------------------------------*/
@@ -51,13 +63,19 @@ void clear_History (iHistory *);
51void add_History (iHistory *, const iString *url); 63void add_History (iHistory *, const iString *url);
52void replace_History (iHistory *, const iString *url); 64void replace_History (iHistory *, const iString *url);
53void setCachedResponse_History (iHistory *, const iGmResponse *response); 65void setCachedResponse_History (iHistory *, const iGmResponse *response);
66void setCachedDocument_History (iHistory *, iGmDocument *doc, iBool openedFromSidebar);
54iBool goBack_History (iHistory *); 67iBool goBack_History (iHistory *);
55iBool goForward_History (iHistory *); 68iBool goForward_History (iHistory *);
69iBool preceding_History (iHistory *d, iRecentUrl *recent_out);
70//iBool following_History (iHistory *d, iRecentUrl *recent_out);
56iRecentUrl *recentUrl_History (iHistory *, size_t pos); 71iRecentUrl *recentUrl_History (iHistory *, size_t pos);
57iRecentUrl *mostRecentUrl_History (iHistory *); 72iRecentUrl *mostRecentUrl_History (iHistory *);
58iRecentUrl *findUrl_History (iHistory *, const iString *url); 73iRecentUrl *findUrl_History (iHistory *, const iString *url);
59void clearCache_History (iHistory *); 74
60size_t pruneLeastImportant_History (iHistory *); 75void clearCache_History (iHistory *);
76size_t pruneLeastImportant_History (iHistory *);
77size_t pruneLeastImportantMemory_History (iHistory *);
78void invalidateTheme_History (iHistory *); /* theme has changed, cached contents need updating */
61 79
62iBool atLatest_History (const iHistory *); 80iBool atLatest_History (const iHistory *);
63iBool atOldest_History (const iHistory *); 81iBool atOldest_History (const iHistory *);
@@ -73,6 +91,7 @@ const iRecentUrl *
73const iGmResponse * 91const iGmResponse *
74 cachedResponse_History (const iHistory *); 92 cachedResponse_History (const iHistory *);
75size_t cacheSize_History (const iHistory *); 93size_t cacheSize_History (const iHistory *);
94size_t memorySize_History (const iHistory *);
76 95
77iString * debugInfo_History (const iHistory *); 96iString * debugInfo_History (const iHistory *);
78 97iMemInfo memoryUsage_History (const iHistory *);