From a2247a75a3dab9d583617299a88d0e76c923f83b Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 16 Jan 2014 13:24:14 +0000 Subject: cleanup copyright headers and some doc comments --- desktop/gui.h | 9 +-------- desktop/gui_factory.c | 23 +++++++++++++++++++++-- desktop/gui_factory.h | 9 ++++++++- framebuffer/gui.c | 5 +++-- riscos/query.h | 4 ++++ utils/utils.h | 5 ----- 6 files changed, 37 insertions(+), 18 deletions(-) diff --git a/desktop/gui.h b/desktop/gui.h index cd116e9c1..5252737f9 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -1,6 +1,5 @@ /* - * Copyright 2003 Phil Mellor - * Copyright 2004 James Bursa + * Copyright 2014 Vincent Sanders * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -26,14 +25,8 @@ #include -#include -#include - -#include "utils/config.h" #include "content/hlcache.h" #include "desktop/download.h" -#include "desktop/mouse.h" -#include "desktop/search.h" #include "utils/errors.h" typedef enum { diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c index 1bd683df7..104f4906d 100644 --- a/desktop/gui_factory.c +++ b/desktop/gui_factory.c @@ -1,12 +1,29 @@ +/* + * 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 . + */ #include "desktop/gui.h" #include "desktop/gui_factory.h" +/** The global GUI interface table */ struct gui_table *guit = NULL; - static void gui_default_window_set_title(struct gui_window *g, const char *title) { } @@ -254,6 +271,7 @@ static void gui_default_set_clipboard(const char *buffer, size_t length, { } +/** verify clipboard table is valid */ static nserror verify_clipboard_register(struct gui_clipboard_table *gct) { /* check table is present */ @@ -310,7 +328,7 @@ static void gui_default_401login_open(nsurl *url, const char *realm, cb(false, cbpw); } - +/** verify browser table is valid */ static nserror verify_browser_register(struct gui_browser_table *gbt) { /* check table is present */ @@ -369,6 +387,7 @@ static struct gui_clipboard_table default_clipboard_table = { .set = gui_default_set_clipboard, }; +/* exported interface documented in desktop/gui_factory.h */ nserror gui_factory_register(struct gui_table *gt) { nserror err; diff --git a/desktop/gui_factory.h b/desktop/gui_factory.h index 50b5eb31e..dc94b3a16 100644 --- a/desktop/gui_factory.h +++ b/desktop/gui_factory.h @@ -25,8 +25,15 @@ #include "desktop/gui.h" -extern struct gui_table *guit; /* the gui vtable */ +/** The global operation table */ +extern struct gui_table *guit; +/** register and verify global operation table + * + * @param gt The global table to register + * @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); #endif diff --git a/framebuffer/gui.c b/framebuffer/gui.c index 76ed397d3..d89315957 100644 --- a/framebuffer/gui.c +++ b/framebuffer/gui.c @@ -1826,10 +1826,11 @@ static struct gui_window_table framebuffer_window_table = { static struct gui_browser_table framebuffer_browser_table = { .poll = gui_poll, - .quit = gui_quit, - .get_resource_url = gui_get_resource_url, .filename_from_path = filename_from_path, .path_add_part = path_add_part, + + .quit = gui_quit, + .get_resource_url = gui_get_resource_url, }; /** Entry point from OS. diff --git a/riscos/query.h b/riscos/query.h index 92e3e292e..10a67e73b 100644 --- a/riscos/query.h +++ b/riscos/query.h @@ -29,4 +29,8 @@ query_id query_user_xy(const char *query, const char *detail, void ro_gui_query_init(void); void ro_gui_query_window_bring_to_front(query_id id); +query_id query_user(const char *query, const char *detail, + const query_callback *cb, void *pw, const char *yes, const char *no); +void query_close(query_id); + #endif diff --git a/utils/utils.h b/utils/utils.h index d56330e10..ed19cb33f 100644 --- a/utils/utils.h +++ b/utils/utils.h @@ -186,9 +186,4 @@ void die(const char * const error); void warn_user(const char *warning, const char *detail); void PDF_Password(char **owner_pass, char **user_pass, char *path); -/* only riscos */ -query_id query_user(const char *query, const char *detail, - const query_callback *cb, void *pw, const char *yes, const char *no); -void query_close(query_id); - #endif -- cgit v1.2.3