aboutsummaryrefslogtreecommitdiff
path: root/src/utils.hpp
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-03-25 13:13:02 +0530
committerAkshay Nair <phenax5@gmail.com>2025-03-25 18:20:18 +0530
commit4cbaaae7c55e71d2d4db591029394812077eb844 (patch)
tree23574a00f4790332e9aafb4fd86fbc046c0ed85a /src/utils.hpp
parent346c16b4e2ea26f47e0e370a490b7794492a9ebb (diff)
downloadnull-browser-4cbaaae7c55e71d2d4db591029394812077eb844.tar.gz
null-browser-4cbaaae7c55e71d2d4db591029394812077eb844.zip
Add web.history for history navigation
Diffstat (limited to 'src/utils.hpp')
-rw-r--r--src/utils.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils.hpp b/src/utils.hpp
index d5d4fc5..eace39e 100644
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -10,3 +10,9 @@
#define DEFINE_GETTER(METHOD, EXPR) \
decltype(auto) METHOD() { return EXPR; }
+
+#define DEFINE_FETCHER(TYPE, NAME) \
+ void set_##NAME##_fetcher(const std::function<TYPE> &fetcher) { \
+ fetch_##NAME = fetcher; \
+ } \
+ std::function<qsizetype()> fetch_##NAME = []() { return -1; };