From e7366bf41f68cfe07e9ea03fc4a398baecbae651 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 4 Feb 2017 09:41:13 +0000 Subject: Initial conversion from MediaWiki, 20170204 --- documentation/front_end_functions.mdwn | 81 ++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 documentation/front_end_functions.mdwn (limited to 'documentation/front_end_functions.mdwn') 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"]] + -- cgit v1.2.3