-
Notifications
You must be signed in to change notification settings - Fork 26
front_end_functions
!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.
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.
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.)
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.)
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.)
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.