reduce content header interdependancy

This commit is contained in:
Vincent Sanders 2016-04-18 23:04:16 +01:00
parent 34f6aa1323
commit 392307bb1f
14 changed files with 65 additions and 28 deletions

View File

@ -32,6 +32,7 @@
#include "image/bitmap.h"
#include "content/content_protected.h"
#include "content/content_debug.h"
#include "content/hlcache.h"
#define URL_FMT_SPC "%.140s"
@ -62,7 +63,7 @@ static void content_convert(struct content *c);
*/
nserror content__init(struct content *c, const content_handler *handler,
lwc_string *imime_type, const http_parameter *params,
lwc_string *imime_type, const struct http_parameter *params,
llcache_handle *llcache, const char *fallback_charset,
bool quirks)
{

View File

@ -26,19 +26,14 @@
#ifndef _NETSURF_CONTENT_CONTENT_H_
#define _NETSURF_CONTENT_CONTENT_H_
#include <stdbool.h>
#include <stdio.h>
#include <libwapcaplet/libwapcaplet.h>
#include "utils/config.h"
#include "utils/errors.h"
#include "utils/http.h"
#include "content/content_factory.h"
#include "content/content_type.h"
#include "desktop/search.h"
#include "desktop/mouse.h"
#include "desktop/plot_style.h"
#include "desktop/search.h" /* search flags enum */
#include "desktop/mouse.h" /* mouse state enums */
#include "desktop/plot_style.h" /* color typedef */
struct browser_window;
struct browser_window_features;
@ -317,15 +312,6 @@ void content_search(struct hlcache_handle *h, void *context,
search_flags_t flags, const char *string);
void content_search_clear(struct hlcache_handle *h);
/**
* Dump debug information to file.
*
* \param h content handle to debug.
* \param f File to write output to.
* \param op Debug operation type.
*/
nserror content_debug_dump(struct hlcache_handle *h, FILE *f, enum content_debug op);
/**
* Control debug con a content.
*

38
content/content_debug.h Normal file
View File

@ -0,0 +1,38 @@
/*
* Copyright 2016 Vincent Sanders <vince@netsurf-browser.org>
*
* 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 <http://www.gnu.org/licenses/>.
*/
/**
* \file
* Interface to content handling debug.
*/
#ifndef _NETSURF_CONTENT_CONTENT_DEBUG_H_
#define _NETSURF_CONTENT_CONTENT_DEBUG_H_
#include <stdio.h>
/**
* Dump debug information to file.
*
* \param h content handle to debug.
* \param f File to write output to.
* \param op Debug operation type.
*/
nserror content_debug_dump(struct hlcache_handle *h, FILE *f, enum content_debug op);
#endif

View File

@ -24,6 +24,8 @@
#include <stdlib.h>
#include <string.h>
#include "utils/http.h"
#include "content/content.h"
#include "content/content_factory.h"
#include "content/content_protected.h"

View File

@ -28,6 +28,8 @@
#include <stdint.h>
#include <time.h>
#include <stdio.h>
#include "utils/config.h"
#include "content/content.h"
#include "content/content_factory.h"
@ -38,15 +40,17 @@ struct bitmap;
struct content;
struct rect;
struct redraw_context;
struct http_parameter;
struct content_handler {
void (*fini)(void);
nserror (*create)(const content_handler *handler,
lwc_string *imime_type, const http_parameter *params,
llcache_handle *llcache,
const char *fallback_charset, bool quirks,
struct content **c);
lwc_string *imime_type,
const struct http_parameter *params,
llcache_handle *llcache,
const char *fallback_charset, bool quirks,
struct content **c);
bool (*process_data)(struct content *c,
const char *data, unsigned int size);
@ -157,7 +161,7 @@ extern const char * const content_type_name[];
extern const char * const content_status_name[];
nserror content__init(struct content *c, const content_handler *handler,
lwc_string *imime_type, const http_parameter *params,
lwc_string *imime_type, const struct http_parameter *params,
struct llcache_handle *llcache, const char *fallback_charset,
bool quirks);
nserror content__clone(const struct content *c, struct content *nc);

View File

@ -47,6 +47,7 @@
#include "utils/utf8.h"
#include "utils/nsoption.h"
#include "content/content.h"
#include "content/content_debug.h"
#include "content/fetch.h"
#include "content/hlcache.h"
#include "content/urldb.h"

View File

@ -20,6 +20,7 @@
#include <stdint.h>
#include <stdbool.h>
#include "utils/config.h"
#include "utils/errors.h"
#include "utils/file.h"
#include "image/bitmap.h"

View File

@ -21,6 +21,9 @@
* \brief core web search facilities implementation.
*/
#include <stdlib.h>
#include "utils/utils.h"
#include "utils/log.h"
#include "utils/url.h"
#include "utils/nsoption.h"

View File

@ -26,6 +26,7 @@
#include <assert.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
#include <cairo.h>
#include <gtk/gtk.h>

View File

@ -61,7 +61,7 @@ static unsigned char nsjpeg_eoi[] = { 0xff, JPEG_EOI };
* Content create entry point.
*/
static nserror nsjpeg_create(const content_handler *handler,
lwc_string *imime_type, const http_parameter *params,
lwc_string *imime_type, const struct http_parameter *params,
llcache_handle *llcache, const char *fallback_charset,
bool quirks, struct content **c)
{

View File

@ -60,7 +60,7 @@ typedef struct nssprite_content {
static nserror nssprite_create(const content_handler *handler,
lwc_string *imime_type, const http_parameter *params,
lwc_string *imime_type, const struct http_parameter *params,
llcache_handle *llcache, const char *fallback_charset,
bool quirks, struct content **c)
{

View File

@ -279,7 +279,7 @@ static nserror nspng_create_png_data(nspng_content *png_c)
}
static nserror nspng_create(const content_handler *handler,
lwc_string *imime_type, const http_parameter *params,
lwc_string *imime_type, const struct http_parameter *params,
llcache_handle *llcache, const char *fallback_charset,
bool quirks, struct content **c)
{

View File

@ -70,7 +70,7 @@ no_memory:
*/
static nserror svg_create(const content_handler *handler,
lwc_string *imime_type, const http_parameter *params,
lwc_string *imime_type, const struct http_parameter *params,
llcache_handle *llcache, const char *fallback_charset,
bool quirks, struct content **c)
{

View File

@ -38,7 +38,7 @@ typedef struct javascript_content {
} javascript_content;
static nserror javascript_create(const content_handler *handler,
lwc_string *imime_type, const http_parameter *params,
lwc_string *imime_type, const struct http_parameter *params,
llcache_handle *llcache, const char *fallback_charset,
bool quirks, struct content **c)
{