diff options
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/gui.h | 8 | ||||
-rw-r--r-- | desktop/gui_factory.c | 6 | ||||
-rw-r--r-- | desktop/gui_factory.h | 4 | ||||
-rw-r--r-- | desktop/netsurf.c | 17 | ||||
-rw-r--r-- | desktop/netsurf.h | 27 |
5 files changed, 39 insertions, 23 deletions
diff --git a/desktop/gui.h b/desktop/gui.h index 0d4135a93..c0a5a4e21 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -521,11 +521,12 @@ struct gui_browser_table { }; -/** Graphical user interface function table +/** + * NetSurf operation function table * - * function table implementing GUI interface to browser core + * Function table implementing interface operations for the browser core. */ -struct gui_table { +struct netsurf_table { /** * Browser table. @@ -566,7 +567,6 @@ struct gui_table { struct gui_utf8_table *utf8; /** - * * Page search table. * * Provides routines for the interactive text search on a page. diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c index 8e3ce178d..756f5dd0e 100644 --- a/desktop/gui_factory.c +++ b/desktop/gui_factory.c @@ -21,8 +21,8 @@ #include "desktop/gui_factory.h" #include "utils/file.h" -/** The global GUI interface table */ -struct gui_table *guit = NULL; +/** The global interface table */ +struct netsurf_table *guit = NULL; @@ -541,7 +541,7 @@ static nserror verify_browser_register(struct gui_browser_table *gbt) /* exported interface documented in desktop/gui_factory.h */ -nserror gui_factory_register(struct gui_table *gt) +nserror gui_factory_register(struct netsurf_table *gt) { nserror err; diff --git a/desktop/gui_factory.h b/desktop/gui_factory.h index dc94b3a16..3c8661577 100644 --- a/desktop/gui_factory.h +++ b/desktop/gui_factory.h @@ -26,7 +26,7 @@ #include "desktop/gui.h" /** The global operation table */ -extern struct gui_table *guit; +extern struct netsurf_table *guit; /** register and verify global operation table * @@ -34,6 +34,6 @@ extern struct gui_table *guit; * @return NSERROR_OK on success or error code on faliure. On faliure * global table will not be initialised */ -nserror gui_factory_register(struct gui_table *gt); +nserror gui_factory_register(struct netsurf_table *gt); #endif diff --git a/desktop/netsurf.c b/desktop/netsurf.c index c3653b574..1c9d880f7 100644 --- a/desktop/netsurf.c +++ b/desktop/netsurf.c @@ -110,11 +110,15 @@ static nserror netsurf_llcache_query_handler(const llcache_query *query, #define MINIMUM_MEMORY_CACHE_SIZE (2 * 1024 * 1024) -/** - * Initialise components used by gui NetSurf. - */ +/* exported interface documented in desktop/netsurf.h */ +nserror netsurf_register(struct netsurf_table *table) +{ + /* register the operation handlers */ + return gui_factory_register(table); +} -nserror netsurf_init(const char *messages, struct gui_table *gt) +/* exported interface documented in desktop/netsurf.h */ +nserror netsurf_init(const char *messages) { nserror error; struct utsname utsname; @@ -148,11 +152,6 @@ nserror netsurf_init(const char *messages, struct gui_table *gt) utsname.nodename, utsname.release, utsname.version, utsname.machine)); - /* register the gui handlers */ - error = gui_factory_register(gt); - if (error != NSERROR_OK) - return error; - messages_load(messages); /* corestrings init */ diff --git a/desktop/netsurf.h b/desktop/netsurf.h index 77589c71c..60ec57845 100644 --- a/desktop/netsurf.h +++ b/desktop/netsurf.h @@ -27,15 +27,32 @@ extern const char * const netsurf_version; extern const int netsurf_version_major; extern const int netsurf_version_minor; -struct gui_table; +struct netsurf_table; -/** Initialise netsurf core */ -nserror netsurf_init(const char *messages, struct gui_table *gt); +/** + * Register operation table. + * + * @param table NetSurf operations table. + * @return NSERROR_OK on success or error code on faliure. + */ +nserror netsurf_register(struct netsurf_table *table); -/** Run primary event loop */ +/** + * Initialise netsurf core. + * + * @param messages path to translation mesage file. + * @return NSERROR_OK on success or error code on faliure. + */ +nserror netsurf_init(const char *messages); + +/** + * Run event loop. + */ extern int netsurf_main_loop(void); -/** finalise NetSurf core */ +/** + * Finalise NetSurf core + */ extern void netsurf_exit(void); |