summaryrefslogtreecommitdiff
path: root/documentation/front_end_functions.mdwn
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2017-02-04 09:41:13 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2017-02-04 09:41:13 +0000
commite7366bf41f68cfe07e9ea03fc4a398baecbae651 (patch)
tree5bb9c3cbe7eab7e70ff1ebd65d9de59a694762df /documentation/front_end_functions.mdwn
downloadnetsurf-wiki-e7366bf41f68cfe07e9ea03fc4a398baecbae651.tar.gz
netsurf-wiki-e7366bf41f68cfe07e9ea03fc4a398baecbae651.tar.bz2
Initial conversion from MediaWiki, 20170204
Diffstat (limited to 'documentation/front_end_functions.mdwn')
-rw-r--r--documentation/front_end_functions.mdwn81
1 files changed, 81 insertions, 0 deletions
diff --git a/documentation/front_end_functions.mdwn b/documentation/front_end_functions.mdwn
new file mode 100644
index 0000000..4e056f4
--- /dev/null
+++ b/documentation/front_end_functions.mdwn
@@ -0,0 +1,81 @@
+[[!meta title="Documentation/Front end functions"]]
+[[!meta author="James Bursa"]]
+[[!meta date="2011-11-26T22:20:01Z"]]
+
+
+[[!toc]] This page documents the
+functions that need to be implemented by each platform's front end.
+
+: *Note: in progress and incomplete*
+
+The prototypes for these functions are usually in gui/gui.h. The
+implementations live in the platform code, for example **gui\_init()**
+is implemented in each of amiga/gui.c, beos/beos\_gui.cpp,
+framebuffer/gui.c, gtk/gtk\_gui.c, riscos/gui.c, and windows/gui.c. Of
+course only one of those implementations is ever compiled into a binary
+of NetSurf.
+
+Initialization and clean-up
+---------------------------
+
+### int main(int argc, char\*\* argv)
+
+This is the standard C entry point. It should do any critical very-early
+initialization is required, and finish with
+
+`return netsurf_main(argc, argv);`
+
+The prototype may differ on some platforms.
+
+### void gui\_init(int argc, char\*\* argv)
+
+General initialization of platform stuff. Prepare the gui for use, but
+don't yet open any windows.
+
+It should call:
+
+- hubbub\_initialise(), with the platform-specific path to the Aliases
+ file
+- options\_read(), if saving and loading options is supported
+- messages\_load(), with the platform-specific path to the Messages
+ file
+- save\_complete\_init(), if save complete is used
+- urldb\_load() and urldb\_load\_cookies()
+
+Should set default\_stylesheet\_url, quirks\_stylesheet\_url, and
+adblock\_stylesheet\_url.
+
+(Called by netsurf\_init() in desktop/netsurf.c.)
+
+### void gui\_init2(int argc, char\*\* argv)
+
+Last-step of initialization. Can open window(s) by calling
+browser\_window\_create() (e.g. depending on argv).
+
+(Called by netsurf\_init() in desktop/netsurf.c.)
+
+### void gui\_quit(void)
+
+Prepare for exit by doing whatever is needed by the platform.
+
+It should call:
+
+- urldb\_save\_cookies() and urldb\_save()
+- hubbub\_finalise()
+
+(Called by netsurf\_exit() in desktop/netsurf.c.)
+
+Multitasking
+------------
+
+### void gui\_multitask(void)
+
+NetSurf's core will occasionally call this during long-running
+operations. It should yield briefly to the OS if applicable, and handle
+urgent gui events to keep NetSurf responsive. Then it should return
+quickly.
+
+It **must not** call any function in the core or non-platform code.
+
+[[!inline raw=yes pages="Documentation"]]
+