From fe7eb85614244d5e0659c88431fbd9726fa33051 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 30 May 2016 11:23:32 +0100 Subject: move misc header into public API --- content/fetch.c | 2 +- content/fetchers/curl.c | 2 +- content/fs_backing_store.c | 2 +- content/handlers/image/gif.c | 2 +- content/handlers/image/image_cache.c | 2 +- content/hlcache.c | 2 +- content/llcache.c | 2 +- desktop/browser.c | 2 +- desktop/gui_factory.c | 2 +- desktop/gui_misc.h | 108 ----------------------------------- desktop/hotlist.c | 2 +- desktop/netsurf.c | 2 +- desktop/save_complete.c | 2 +- desktop/tree.c | 2 +- frontends/amiga/gui.c | 2 +- frontends/atari/gui.c | 2 +- frontends/beos/gui.cpp | 2 +- frontends/cocoa/gui.m | 2 +- frontends/framebuffer/gui.c | 2 +- frontends/gtk/gui.c | 2 +- frontends/monkey/main.c | 2 +- frontends/riscos/gui.c | 2 +- frontends/windows/main.c | 2 +- include/netsurf/misc.h | 108 +++++++++++++++++++++++++++++++++++ render/box.c | 2 +- render/box_construct.c | 2 +- render/form.c | 2 +- render/html.c | 2 +- render/html_css.c | 2 +- render/html_interaction.c | 2 +- render/html_object.c | 2 +- render/search.c | 2 +- 32 files changed, 138 insertions(+), 138 deletions(-) delete mode 100644 desktop/gui_misc.h create mode 100644 include/netsurf/misc.h diff --git a/content/fetch.c b/content/fetch.c index 9c2933b56..c5928ba85 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -49,7 +49,7 @@ #include "utils/nsurl.h" #include "utils/utils.h" #include "utils/ring.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_internal.h" #include "content/fetch.h" diff --git a/content/fetchers/curl.c b/content/fetchers/curl.c index b94a3f24f..1a4213444 100644 --- a/content/fetchers/curl.c +++ b/content/fetchers/curl.c @@ -53,7 +53,7 @@ #include "utils/file.h" #include "utils/string.h" #include "desktop/gui_fetch.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_internal.h" #include "content/fetch.h" diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c index 0c765962b..7d8ac4b54 100644 --- a/content/fs_backing_store.c +++ b/content/fs_backing_store.c @@ -50,7 +50,7 @@ #include "utils/utils.h" #include "utils/messages.h" #include "desktop/gui_internal.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "content/backing_store.h" diff --git a/content/handlers/image/gif.c b/content/handlers/image/gif.c index 1167266a6..93970f96d 100644 --- a/content/handlers/image/gif.c +++ b/content/handlers/image/gif.c @@ -40,7 +40,7 @@ #include "utils/messages.h" #include "utils/nsoption.h" #include "content/content_protected.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_internal.h" #include "netsurf/bitmap.h" diff --git a/content/handlers/image/image_cache.c b/content/handlers/image/image_cache.c index 52b3b344f..4c008b7a9 100644 --- a/content/handlers/image/image_cache.c +++ b/content/handlers/image/image_cache.c @@ -26,7 +26,7 @@ #include "utils/utils.h" #include "utils/log.h" #include "content/content_protected.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_internal.h" #include "netsurf/bitmap.h" diff --git a/content/hlcache.c b/content/hlcache.c index 06d9f6d74..65210d5a8 100644 --- a/content/hlcache.c +++ b/content/hlcache.c @@ -29,7 +29,7 @@ #include "utils/messages.h" #include "utils/ring.h" #include "utils/utils.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_internal.h" #include "content/content.h" diff --git a/content/llcache.c b/content/llcache.c index 9381ce958..33a9b98aa 100644 --- a/content/llcache.c +++ b/content/llcache.c @@ -47,7 +47,7 @@ #include "utils/nsurl.h" #include "utils/utils.h" #include "utils/time.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_internal.h" #include "content/fetch.h" diff --git a/desktop/browser.c b/desktop/browser.c index bb39ee393..f69acc5f2 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -70,7 +70,7 @@ #include "desktop/selection.h" #include "desktop/plotters.h" #include "desktop/theme.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "netsurf/window.h" #include "desktop/gui_internal.h" diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c index db675a7be..c1a061097 100644 --- a/desktop/gui_factory.c +++ b/desktop/gui_factory.c @@ -32,7 +32,7 @@ #include "desktop/searchweb.h" #include "netsurf/download.h" #include "desktop/gui_fetch.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "netsurf/window.h" #include "netsurf/search.h" #include "netsurf/clipboard.h" diff --git a/desktop/gui_misc.h b/desktop/gui_misc.h deleted file mode 100644 index 399d93895..000000000 --- a/desktop/gui_misc.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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 - * - * Interface to platform-specific miscellaneous browser operation table. - */ - -#ifndef _NETSURF_DESKTOP_GUI_MISC_H_ -#define _NETSURF_DESKTOP_GUI_MISC_H_ - -struct form_control; -struct gui_window; -struct ssl_cert_info; -struct nsurl; - -/** - * Graphical user interface browser misc function table. - * - * function table implementing GUI interface to miscelaneous browser - * functionality - */ -struct gui_misc_table { - /* Mandantory entries */ - - /** - * Schedule a callback. - * - * \param t interval before the callback should be made in ms or - * negative value to remove any existing callback. - * \param callback callback function - * \param p user parameter passed to callback function - * \return NSERROR_OK on sucess or appropriate error on faliure - * - * The callback function will be called as soon as possible - * after the timeout has elapsed. - * - * Additional calls with the same callback and user parameter will - * reset the callback time to the newly specified value. - * - */ - nserror (*schedule)(int t, void (*callback)(void *p), void *p); - - /** - * Warn the user of an event. - * - * \param[in] message A warning looked up in the message - * translation table - * \param[in] detail Additional text to be displayed or NULL. - * \return NSERROR_OK on success or error code if there was a - * faliure displaying the message to the user. - */ - nserror (*warning)(const char *message, const char *detail); - - - /* Optional entries */ - - /** - * called to allow the gui to cleanup. - */ - void (*quit)(void); - - /** - * core has no fetcher for url - */ - nserror (*launch_url)(struct nsurl *url); - - /** - * Prompt the user to verify a certificate with issuse. - * - * \param url The URL being verified. - * \param certs The certificate to be verified - * \param num The number of certificates to be verified. - * \param cb Callback upon user decision. - * \param cbpw Context pointer passed to cb - */ - void (*cert_verify)(struct nsurl *url, const struct ssl_cert_info *certs, unsigned long num, nserror (*cb)(bool proceed, void *pw), void *cbpw); - - /** - * Prompt user for login - */ - void (*login)(struct nsurl *url, const char *realm, - nserror (*cb)(bool proceed, void *pw), void *cbpw); - - /** - * Prompt the user for a password for a PDF. - */ - void (*pdf_password)(char **owner_pass, char **user_pass, char *path); - -}; - -#endif diff --git a/desktop/hotlist.c b/desktop/hotlist.c index 98d5f9c19..f9a1f41be 100644 --- a/desktop/hotlist.c +++ b/desktop/hotlist.c @@ -33,7 +33,7 @@ #include "utils/log.h" #include "content/urldb.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_internal.h" #include "desktop/hotlist.h" #include "desktop/treeview.h" diff --git a/desktop/netsurf.c b/desktop/netsurf.c index d3d45ca66..8e763ca05 100644 --- a/desktop/netsurf.c +++ b/desktop/netsurf.c @@ -47,7 +47,7 @@ #include "desktop/browser.h" #include "desktop/system_colour.h" #include "desktop/searchweb.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_internal.h" #include "desktop/netsurf.h" diff --git a/desktop/save_complete.c b/desktop/save_complete.c index 6f63960aa..201e80b0d 100644 --- a/desktop/save_complete.c +++ b/desktop/save_complete.c @@ -45,7 +45,7 @@ #include "render/box.h" #include "render/html.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_internal.h" #include "desktop/save_complete.h" diff --git a/desktop/tree.c b/desktop/tree.c index e9a2dfdcc..91fd0b9d7 100644 --- a/desktop/tree.c +++ b/desktop/tree.c @@ -44,7 +44,7 @@ struct tree { void *client_data; /* User assigned data for the callbacks */ }; -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_internal.h" #include "desktop/treeview.h" #include "desktop/hotlist.h" diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c index 88a06c628..75875d3c3 100644 --- a/frontends/amiga/gui.c +++ b/frontends/amiga/gui.c @@ -114,7 +114,7 @@ #include "desktop/tree.h" #include "netsurf/window.h" #include "desktop/gui_fetch.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" /* NetSurf Amiga platform includes */ #include "amiga/gui.h" diff --git a/frontends/atari/gui.c b/frontends/atari/gui.c index 5107f83f4..21fe4ec84 100644 --- a/frontends/atari/gui.c +++ b/frontends/atari/gui.c @@ -39,7 +39,7 @@ #include "netsurf/window.h" #include "netsurf/clipboard.h" #include "desktop/gui_fetch.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/netsurf.h" #include "atari/gemtk/gemtk.h" diff --git a/frontends/beos/gui.cpp b/frontends/beos/gui.cpp index 645d7d680..3a45c66b4 100644 --- a/frontends/beos/gui.cpp +++ b/frontends/beos/gui.cpp @@ -63,7 +63,7 @@ extern "C" { #include "content/hlcache.h" #include "content/urldb.h" #include "desktop/browser.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "netsurf/clipboard.h" #include "netsurf/search.h" #include "desktop/gui_fetch.h" diff --git a/frontends/cocoa/gui.m b/frontends/cocoa/gui.m index 326e286b2..787fb68ea 100644 --- a/frontends/cocoa/gui.m +++ b/frontends/cocoa/gui.m @@ -23,7 +23,7 @@ #import "utils/log.h" #import "desktop/mouse.h" #import "netsurf/window.h" -#import "desktop/gui_misc.h" +#import "netsurf/misc.h" #import "desktop/browser.h" #import "desktop/textinput.h" #import "content/handlers/image/ico.h" diff --git a/frontends/framebuffer/gui.c b/frontends/framebuffer/gui.c index 4a8b7a645..fc04ac8fb 100644 --- a/frontends/framebuffer/gui.c +++ b/frontends/framebuffer/gui.c @@ -39,7 +39,7 @@ #include "desktop/browser_history.h" #include "desktop/plotters.h" #include "netsurf/window.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/netsurf.h" #include "content/urldb.h" #include "content/fetch.h" diff --git a/frontends/gtk/gui.c b/frontends/gtk/gui.c index 6430f9dc6..7e23b6f31 100644 --- a/frontends/gtk/gui.c +++ b/frontends/gtk/gui.c @@ -48,7 +48,7 @@ #include "desktop/searchweb.h" #include "desktop/textinput.h" #include "desktop/tree.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/netsurf.h" #include "gtk/compat.h" diff --git a/frontends/monkey/main.c b/frontends/monkey/main.c index ff70bda71..6443dbd20 100644 --- a/frontends/monkey/main.c +++ b/frontends/monkey/main.c @@ -33,7 +33,7 @@ #include "content/fetchers.h" #include "content/fetchers/resource.h" #include "content/hlcache.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/netsurf.h" #include "monkey/dispatch.h" diff --git a/frontends/riscos/gui.c b/frontends/riscos/gui.c index 309f27bdb..79d89e2df 100644 --- a/frontends/riscos/gui.c +++ b/frontends/riscos/gui.c @@ -48,7 +48,7 @@ #include "utils/url.h" #include "utils/corestrings.h" #include "desktop/gui_fetch.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/save_complete.h" #include "desktop/treeview.h" #include "desktop/netsurf.h" diff --git a/frontends/windows/main.c b/frontends/windows/main.c index df64e487d..a8ad9e846 100644 --- a/frontends/windows/main.c +++ b/frontends/windows/main.c @@ -32,7 +32,7 @@ #include "utils/nsoption.h" #include "desktop/browser.h" #include "desktop/gui_fetch.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/netsurf.h" #include "windows/findfile.h" diff --git a/include/netsurf/misc.h b/include/netsurf/misc.h new file mode 100644 index 000000000..399d93895 --- /dev/null +++ b/include/netsurf/misc.h @@ -0,0 +1,108 @@ +/* + * 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 + * + * Interface to platform-specific miscellaneous browser operation table. + */ + +#ifndef _NETSURF_DESKTOP_GUI_MISC_H_ +#define _NETSURF_DESKTOP_GUI_MISC_H_ + +struct form_control; +struct gui_window; +struct ssl_cert_info; +struct nsurl; + +/** + * Graphical user interface browser misc function table. + * + * function table implementing GUI interface to miscelaneous browser + * functionality + */ +struct gui_misc_table { + /* Mandantory entries */ + + /** + * Schedule a callback. + * + * \param t interval before the callback should be made in ms or + * negative value to remove any existing callback. + * \param callback callback function + * \param p user parameter passed to callback function + * \return NSERROR_OK on sucess or appropriate error on faliure + * + * The callback function will be called as soon as possible + * after the timeout has elapsed. + * + * Additional calls with the same callback and user parameter will + * reset the callback time to the newly specified value. + * + */ + nserror (*schedule)(int t, void (*callback)(void *p), void *p); + + /** + * Warn the user of an event. + * + * \param[in] message A warning looked up in the message + * translation table + * \param[in] detail Additional text to be displayed or NULL. + * \return NSERROR_OK on success or error code if there was a + * faliure displaying the message to the user. + */ + nserror (*warning)(const char *message, const char *detail); + + + /* Optional entries */ + + /** + * called to allow the gui to cleanup. + */ + void (*quit)(void); + + /** + * core has no fetcher for url + */ + nserror (*launch_url)(struct nsurl *url); + + /** + * Prompt the user to verify a certificate with issuse. + * + * \param url The URL being verified. + * \param certs The certificate to be verified + * \param num The number of certificates to be verified. + * \param cb Callback upon user decision. + * \param cbpw Context pointer passed to cb + */ + void (*cert_verify)(struct nsurl *url, const struct ssl_cert_info *certs, unsigned long num, nserror (*cb)(bool proceed, void *pw), void *cbpw); + + /** + * Prompt user for login + */ + void (*login)(struct nsurl *url, const char *realm, + nserror (*cb)(bool proceed, void *pw), void *cbpw); + + /** + * Prompt the user for a password for a PDF. + */ + void (*pdf_password)(char **owner_pass, char **user_pass, char *path); + +}; + +#endif diff --git a/render/box.c b/render/box.c index 07ea114d4..81c22ed19 100644 --- a/render/box.c +++ b/render/box.c @@ -38,7 +38,7 @@ #include "content/handlers/css/utils.h" #include "content/handlers/css/dump.h" #include "desktop/scrollbar.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_internal.h" #include "render/box.h" diff --git a/render/box_construct.c b/render/box_construct.c index 6dce5c690..372dcb397 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -46,7 +46,7 @@ #include "content/handlers/css/hints.h" #include "content/handlers/css/select.h" #include "netsurf/css.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_internal.h" #include "render/box.h" diff --git a/render/form.c b/render/form.c index 75d16d83b..71849c265 100644 --- a/render/form.c +++ b/render/form.c @@ -50,7 +50,7 @@ #include "desktop/plotters.h" #include "desktop/scrollbar.h" #include "desktop/textarea.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_internal.h" #include "render/box.h" diff --git a/render/html.c b/render/html.c index 479307577..6120fdf01 100644 --- a/render/html.c +++ b/render/html.c @@ -51,7 +51,7 @@ #include "desktop/browser.h" #include "netsurf/utf8.h" #include "desktop/gui_layout.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_internal.h" #include "render/box.h" diff --git a/render/html_css.c b/render/html_css.c index 0c8ee3351..a3973bf87 100644 --- a/render/html_css.c +++ b/render/html_css.c @@ -33,7 +33,7 @@ #include "utils/corestrings.h" #include "utils/config.h" #include "utils/log.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_internal.h" #include "render/html_internal.h" diff --git a/render/html_interaction.c b/render/html_interaction.c index 19e19f6ef..4d0a903dd 100644 --- a/render/html_interaction.c +++ b/render/html_interaction.c @@ -44,7 +44,7 @@ #include "desktop/textarea.h" #include "desktop/textinput.h" #include "javascript/js.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_layout.h" #include "desktop/gui_internal.h" diff --git a/render/html_object.c b/render/html_object.c index 9e5e26730..baa01e598 100644 --- a/render/html_object.c +++ b/render/html_object.c @@ -35,7 +35,7 @@ #include "content/hlcache.h" #include "content/handlers/css/utils.h" #include "desktop/scrollbar.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_internal.h" #include "render/box.h" diff --git a/render/search.c b/render/search.c index 4a1cd2ce4..523f8fb98 100644 --- a/render/search.c +++ b/render/search.c @@ -34,7 +34,7 @@ #include "content/hlcache.h" #include "desktop/selection.h" #include "netsurf/search.h" -#include "desktop/gui_misc.h" +#include "netsurf/misc.h" #include "desktop/gui_internal.h" #include "render/box.h" -- cgit v1.2.3