From c041393e66b4a75cfc1165e184be77cc974a63cb Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 30 May 2016 11:51:10 +0100 Subject: move netsurf header into public API --- include/netsurf/clipboard.h | 4 ++-- include/netsurf/css.h | 4 ++-- include/netsurf/download.h | 4 ++-- include/netsurf/fetch.h | 4 ++-- include/netsurf/layout.h | 4 ++-- include/netsurf/misc.h | 4 ++-- include/netsurf/netsurf.h | 53 +++++++++++++++++++++++++++++++++++++++++++++ include/netsurf/search.h | 4 ++-- include/netsurf/utf8.h | 4 ++-- include/netsurf/window.h | 4 ++-- 10 files changed, 71 insertions(+), 18 deletions(-) create mode 100644 include/netsurf/netsurf.h (limited to 'include/netsurf') diff --git a/include/netsurf/clipboard.h b/include/netsurf/clipboard.h index 6feea2404..d90ebc4cb 100644 --- a/include/netsurf/clipboard.h +++ b/include/netsurf/clipboard.h @@ -22,8 +22,8 @@ * Interface to platform-specific clipboard operations. */ -#ifndef _NETSURF_DESKTOP_GUI_CLIPBOARD_H_ -#define _NETSURF_DESKTOP_GUI_CLIPBOARD_H_ +#ifndef _NETSURF_CLIPBOARD_H_ +#define _NETSURF_CLIPBOARD_H_ #include diff --git a/include/netsurf/css.h b/include/netsurf/css.h index bd95eaeeb..3c7ae283c 100644 --- a/include/netsurf/css.h +++ b/include/netsurf/css.h @@ -21,8 +21,8 @@ * Netsurf core css API */ -#ifndef NETSURF_CSS_H_ -#define NETSURF_CSS_H_ +#ifndef _NETSURF_CSS_H_ +#define _NETSURF_CSS_H_ /** * Convert a CSS color to a NetSurf colour primitive diff --git a/include/netsurf/download.h b/include/netsurf/download.h index 55e115d52..ae554db24 100644 --- a/include/netsurf/download.h +++ b/include/netsurf/download.h @@ -22,8 +22,8 @@ * Interface to platform-specific download operations. */ -#ifndef _NETSURF_DESKTOP_GUI_DOWNLOAD_H_ -#define _NETSURF_DESKTOP_GUI_DOWNLOAD_H_ +#ifndef _NETSURF_DOWNLOAD_H_ +#define _NETSURF_DOWNLOAD_H_ struct gui_window; struct download_context; diff --git a/include/netsurf/fetch.h b/include/netsurf/fetch.h index 22c5e6a2e..6e6d653ee 100644 --- a/include/netsurf/fetch.h +++ b/include/netsurf/fetch.h @@ -22,8 +22,8 @@ * Interface to platform-specific fetcher operations. */ -#ifndef _NETSURF_DESKTOP_GUI_FETCH_H_ -#define _NETSURF_DESKTOP_GUI_FETCH_H_ +#ifndef _NETSURF_FETCH_H_ +#define _NETSURF_FETCH_H_ struct nsurl; diff --git a/include/netsurf/layout.h b/include/netsurf/layout.h index 1696aee91..266de4091 100644 --- a/include/netsurf/layout.h +++ b/include/netsurf/layout.h @@ -29,8 +29,8 @@ * is the correct approach. */ -#ifndef _NETSURF_DESKTOP_GUI_LAYOUT_H_ -#define _NETSURF_DESKTOP_GUI_LAYOUT_H_ +#ifndef _NETSURF_LAYOUT_H_ +#define _NETSURF_LAYOUT_H_ struct plot_font_style; diff --git a/include/netsurf/misc.h b/include/netsurf/misc.h index 399d93895..7b354953c 100644 --- a/include/netsurf/misc.h +++ b/include/netsurf/misc.h @@ -22,8 +22,8 @@ * Interface to platform-specific miscellaneous browser operation table. */ -#ifndef _NETSURF_DESKTOP_GUI_MISC_H_ -#define _NETSURF_DESKTOP_GUI_MISC_H_ +#ifndef _NETSURF_MISC_H_ +#define _NETSURF_MISC_H_ struct form_control; struct gui_window; diff --git a/include/netsurf/netsurf.h b/include/netsurf/netsurf.h new file mode 100644 index 000000000..9c9d2b402 --- /dev/null +++ b/include/netsurf/netsurf.h @@ -0,0 +1,53 @@ +/* + * Copyright 2014 Vincent Sanders + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file + * + * NetSurf core interface registration, construction and destruction. + */ + +#ifndef _NETSURF_NETSURF_H_ +#define _NETSURF_NETSURF_H_ + +#include "utils/errors.h" +#include "desktop/gui_table.h" + +/** + * Register operation table. + * + * @param table NetSurf operations table. + * @return NSERROR_OK on success or error code on faliure. On faliure + * global table will not be initialised. + */ +nserror netsurf_register(struct netsurf_table *table); + +/** + * Initialise netsurf core. + * + * @param store_path path to persistant storage. + * @return NSERROR_OK on success or error code on faliure. + */ +nserror netsurf_init(const char *store_path); + +/** + * Finalise NetSurf core + */ +extern void netsurf_exit(void); + +#endif diff --git a/include/netsurf/search.h b/include/netsurf/search.h index 0b02ac8bb..1246ea984 100644 --- a/include/netsurf/search.h +++ b/include/netsurf/search.h @@ -22,8 +22,8 @@ * Interface to platform-specific search operations. */ -#ifndef _NETSURF_DESKTOP_GUI_SEARCH_H_ -#define _NETSURF_DESKTOP_GUI_SEARCH_H_ +#ifndef _NETSURF_SEARCH_H_ +#define _NETSURF_SEARCH_H_ /** * function table for page text search. diff --git a/include/netsurf/utf8.h b/include/netsurf/utf8.h index c40c4c1b3..04499e504 100644 --- a/include/netsurf/utf8.h +++ b/include/netsurf/utf8.h @@ -22,8 +22,8 @@ * Interface to platform-specific utf8 operations. */ -#ifndef _NETSURF_DESKTOP_GUI_UTF8_H_ -#define _NETSURF_DESKTOP_GUI_UTF8_H_ +#ifndef _NETSURF_UTF8_H_ +#define _NETSURF_UTF8_H_ /** * User interface utf8 characterset conversion routines. diff --git a/include/netsurf/window.h b/include/netsurf/window.h index 7ecd3c21d..8b3e9c4f4 100644 --- a/include/netsurf/window.h +++ b/include/netsurf/window.h @@ -23,8 +23,8 @@ * operations. */ -#ifndef _NETSURF_DESKTOP_GUI_WINDOW_H_ -#define _NETSURF_DESKTOP_GUI_WINDOW_H_ +#ifndef _NETSURF_WINDOW_H_ +#define _NETSURF_WINDOW_H_ typedef enum gui_save_type { GUI_SAVE_SOURCE, -- cgit v1.2.3