diff options
35 files changed, 85 insertions, 112 deletions
diff --git a/atari/download.c b/atari/download.c index f5c9120ca..c2a82d72b 100755 --- a/atari/download.c +++ b/atari/download.c @@ -29,7 +29,6 @@ #include "utils/messages.h" #include "utils/utils.h" #include "utils/nsoption.h" -#include "utils/types.h" #include "content/urldb.h" #include "content/fetch.h" #include "desktop/save_complete.h" diff --git a/atari/gemtk/redrawslots.h b/atari/gemtk/redrawslots.h index d045b3965..9691fb4bc 100644 --- a/atari/gemtk/redrawslots.h +++ b/atari/gemtk/redrawslots.h @@ -21,8 +21,5 @@ #define ATARI_REDRAW_SLOTS_H #include <mt_gem.h> -#include "utils/types.h" - - #endif diff --git a/atari/redrawslots.c b/atari/redrawslots.c index 55660b777..6977a6d2d 100644 --- a/atari/redrawslots.c +++ b/atari/redrawslots.c @@ -17,9 +17,10 @@ */ #include <stdbool.h> -#include "utils/types.h" -#include "atari/redrawslots.h" +#include "utils/utils.h" + +#include "atari/redrawslots.h" #include "atari/gemtk/gemtk.h" void redraw_slots_init(struct s_redrw_slots * slots, short size) diff --git a/atari/redrawslots.h b/atari/redrawslots.h index 2c932bbc1..c972c17ed 100644 --- a/atari/redrawslots.h +++ b/atari/redrawslots.h @@ -21,8 +21,8 @@ #define ATARI_REDRAW_SLOTS_H #include <mt_gem.h> -#include "utils/types.h" +#include "utils/utils.h" /*
MAX_REDRW_SLOTS
diff --git a/atari/thumbnail.c b/atari/thumbnail.c index 4783103bd..c6224ba77 100755 --- a/atari/thumbnail.c +++ b/atari/thumbnail.c @@ -16,6 +16,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "utils/nsurl.h" #include "desktop/thumbnail.h" bool thumbnail_create(struct hlcache_handle *content, struct bitmap *bitmap, diff --git a/beos/window.cpp b/beos/window.cpp index 71ae3a677..a507d6f07 100644 --- a/beos/window.cpp +++ b/beos/window.cpp @@ -29,7 +29,6 @@ extern "C" { #include "desktop/textinput.h" #include "desktop/font.h" #include "utils/log.h" -#include "utils/types.h" #include "utils/utf8.h" #include "utils/utils.h" #include "desktop/mouse.h" diff --git a/desktop/browser.h b/desktop/browser.h index 1d896dd72..8757474fb 100644 --- a/desktop/browser.h +++ b/desktop/browser.h @@ -27,7 +27,6 @@ #include <stdbool.h> #include <stdio.h> -#include "utils/types.h" #include "utils/errors.h" #include "desktop/plot_style.h" #include "desktop/frame_types.h" @@ -41,6 +40,8 @@ struct selection; struct fetch_multipart_data; struct form_control; struct nsurl; +struct rect; +struct redraw_context; enum content_debug; typedef enum { diff --git a/desktop/cookie_manager.h b/desktop/cookie_manager.h index 3565caf63..30a66e598 100644 --- a/desktop/cookie_manager.h +++ b/desktop/cookie_manager.h @@ -30,7 +30,9 @@ #include "desktop/textinput.h" #include "utils/errors.h" +struct redraw_context; struct cookie_data; + enum browser_mouse_state; /** diff --git a/desktop/core_window.h b/desktop/core_window.h index 3fe88f3d7..38045a3e8 100644 --- a/desktop/core_window.h +++ b/desktop/core_window.h @@ -23,9 +23,8 @@ #ifndef _NETSURF_DESKTOP_CORE_WINDOW_H_ #define _NETSURF_DESKTOP_CORE_WINDOW_H_ -#include "utils/types.h" - struct core_window; +struct rect; typedef enum { CORE_WINDOW_DRAG_NONE, diff --git a/desktop/global_history.h b/desktop/global_history.h index 463ab1b9c..a2281ad60 100644 --- a/desktop/global_history.h +++ b/desktop/global_history.h @@ -25,7 +25,9 @@ #include "desktop/core_window.h" #include "desktop/textinput.h" #include "utils/errors.h" -#include "utils/nsurl.h" + +struct redraw_context; +struct nsurl; enum browser_mouse_state; @@ -63,7 +65,7 @@ nserror global_history_fini(void); * \param url URL for node being added * \return NSERROR_OK on success, appropriate error otherwise */ -nserror global_history_add(nsurl *url); +nserror global_history_add(struct nsurl *url); /* * Save global history to file (html) @@ -116,7 +118,7 @@ bool global_history_has_selection(void); * \param title Updated to the selected entry's title, or NULL * \return true iff global history has a selection */ -bool global_history_get_selection(nsurl **url, const char **title); +bool global_history_get_selection(struct nsurl **url, const char **title); /** * Expand the treeview's nodes diff --git a/desktop/gui_clipboard.h b/desktop/gui_clipboard.h index 8933e3099..6feea2404 100644 --- a/desktop/gui_clipboard.h +++ b/desktop/gui_clipboard.h @@ -27,7 +27,6 @@ #include <stddef.h> -#include "utils/types.h" #include "utils/errors.h" #include "desktop/plot_style.h" diff --git a/desktop/hotlist.h b/desktop/hotlist.h index 7e2aa6955..69caa01d9 100644 --- a/desktop/hotlist.h +++ b/desktop/hotlist.h @@ -25,7 +25,9 @@ #include "desktop/core_window.h" #include "desktop/textinput.h" #include "utils/errors.h" -#include "utils/nsurl.h" + +struct redraw_context; +struct nsurl; enum browser_mouse_state; @@ -63,7 +65,7 @@ nserror hotlist_fini(const char *path); * \param url URL for node being added * \return NSERROR_OK on success, appropriate error otherwise */ -nserror hotlist_add_url(nsurl *url); +nserror hotlist_add_url(struct nsurl *url); /** * Check whether given URL is present in hotlist @@ -71,21 +73,21 @@ nserror hotlist_add_url(nsurl *url); * \param url Address to look for in hotlist * \return true iff url is present in hotlist, false otherwise */ -bool hotlist_has_url(nsurl *url); +bool hotlist_has_url(struct nsurl *url); /** * Remove any entries matching the given URL from the hotlist * * \param url Address to look for in hotlist */ -void hotlist_remove_url(nsurl *url); +void hotlist_remove_url(struct nsurl *url); /** * Update given URL, e.g. new visited data * * \param url Address to update entries for */ -void hotlist_update_url(nsurl *url); +void hotlist_update_url(struct nsurl *url); /** * Add an entry to the hotlist for given Title/URL. @@ -96,7 +98,7 @@ void hotlist_update_url(nsurl *url); * \param y Y-offset in px from top of hotlist. Ignored if (!at_y). * \return NSERROR_OK on success, appropriate error otherwise */ -nserror hotlist_add_entry(nsurl *url, const char *title, bool at_y, int y); +nserror hotlist_add_entry(struct nsurl *url, const char *title, bool at_y, int y); /** * Add a folder to the hotlist. @@ -134,7 +136,7 @@ typedef nserror (*hotlist_folder_enter_cb)(void *ctx, const char *title); * \param title The entry's title * \return NSERROR_OK on success, or appropriate error otherwise */ -typedef nserror (*hotlist_address_cb)(void *ctx, nsurl *url, const char *title); +typedef nserror (*hotlist_address_cb)(void *ctx, struct nsurl *url, const char *title); /** * Client callback for hotlist_iterate, reporting a hotlist folder departure @@ -207,7 +209,7 @@ bool hotlist_has_selection(void); * \param title Updated to the selected entry's title, or NULL * \return true iff hotlist has a selection */ -bool hotlist_get_selection(nsurl **url, const char **title); +bool hotlist_get_selection(struct nsurl **url, const char **title); /** * Edit the first selected node diff --git a/desktop/plotters.h b/desktop/plotters.h index c34692433..d764de2d2 100644 --- a/desktop/plotters.h +++ b/desktop/plotters.h @@ -26,16 +26,22 @@ #include <stdbool.h> #include <stdio.h> -#include "utils/types.h" #include "desktop/plot_style.h" struct bitmap; +struct rect; typedef unsigned long bitmap_flags_t; #define BITMAPF_NONE 0 #define BITMAPF_REPEAT_X 1 #define BITMAPF_REPEAT_Y 2 +enum path_command { + PLOTTER_PATH_MOVE, + PLOTTER_PATH_CLOSE, + PLOTTER_PATH_LINE, + PLOTTER_PATH_BEZIER, +}; /** Set of target specific plotting functions. * @@ -137,12 +143,18 @@ struct plotter_table { bool option_knockout; /**< set if knockout rendering is required */ }; -enum path_command { - PLOTTER_PATH_MOVE, - PLOTTER_PATH_CLOSE, - PLOTTER_PATH_LINE, - PLOTTER_PATH_BEZIER, -}; +/* Redraw context */ +struct redraw_context { + /** Redraw to show interactive features, such as active selections + * etc. Should be off for printing. */ + bool interactive; + + /** Render background images. May want it off for printing. */ + bool background_images; + + /** Current plotters, must be assigned before use. */ + const struct plotter_table *plot; +}; #endif diff --git a/desktop/print.c b/desktop/print.c index 9b3b297d6..9b698f707 100644 --- a/desktop/print.c +++ b/desktop/print.c @@ -24,19 +24,18 @@ #include <assert.h> #include <string.h> - #include <dom/dom.h> +#include "utils/nsoption.h" +#include "utils/log.h" +#include "utils/talloc.h" #include "content/content.h" #include "content/hlcache.h" #include "css/utils.h" -#include "utils/nsoption.h" +#include "render/box.h" + #include "desktop/print.h" #include "desktop/printer.h" -#include "render/box.h" -#include "utils/log.h" -#include "utils/talloc.h" -#include "utils/types.h" /* Default print settings */ #define DEFAULT_PAGE_WIDTH 595 diff --git a/desktop/textarea.h b/desktop/textarea.h index de63b3ffb..5f9e58175 100644 --- a/desktop/textarea.h +++ b/desktop/textarea.h @@ -27,7 +27,7 @@ #include <stdint.h> #include <stdbool.h> -#include "utils/types.h" +#include "utils/utils.h" struct textarea; diff --git a/desktop/thumbnail.h b/desktop/thumbnail.h index 05bae7abc..ecf8fa6f2 100644 --- a/desktop/thumbnail.h +++ b/desktop/thumbnail.h @@ -24,12 +24,11 @@ #define _NETSURF_DESKTOP_THUMBNAIL_H_ #include <stdbool.h> -#include "utils/nsurl.h" -#include "utils/types.h" struct hlcache_handle; +struct redraw_context; struct bitmap; - +struct nsurl; /** * Redraw a content for thumbnailing @@ -47,12 +46,12 @@ struct bitmap; * * Units for width and height are pixels. */ -bool thumbnail_redraw(struct hlcache_handle *content, - int width, int height, const struct redraw_context *ctx); +bool thumbnail_redraw(struct hlcache_handle *content, int width, int height, + const struct redraw_context *ctx); /* In platform specific thumbnail.c. */ bool thumbnail_create(struct hlcache_handle *content, struct bitmap *bitmap, - nsurl *url); + struct nsurl *url); #endif diff --git a/desktop/treeview.h b/desktop/treeview.h index 0b5bbbbd9..8f9dd7db9 100644 --- a/desktop/treeview.h +++ b/desktop/treeview.h @@ -29,7 +29,8 @@ #include "desktop/mouse.h" #include "desktop/core_window.h" #include "desktop/textinput.h" -#include "utils/types.h" + +struct redraw_context; typedef struct treeview treeview; typedef struct treeview_node treeview_node; diff --git a/framebuffer/framebuffer.c b/framebuffer/framebuffer.c index a0f39707c..0988c6b33 100644 --- a/framebuffer/framebuffer.c +++ b/framebuffer/framebuffer.c @@ -28,6 +28,7 @@ #include <libnsfb_event.h> #include <libnsfb_cursor.h> +#include "utils/utils.h" #include "utils/log.h" #include "desktop/browser.h" #include "image/bitmap.h" diff --git a/framebuffer/gui.c b/framebuffer/gui.c index 0ee60c944..df7b0e7c7 100644 --- a/framebuffer/gui.c +++ b/framebuffer/gui.c @@ -36,7 +36,6 @@ #include "utils/filepath.h" #include "utils/log.h" #include "utils/messages.h" -#include "utils/types.h" #include "desktop/browser.h" #include "desktop/textinput.h" #include "desktop/browser_history.h" diff --git a/framebuffer/localhistory.c b/framebuffer/localhistory.c index caacae7e5..1b2eb9a60 100644 --- a/framebuffer/localhistory.c +++ b/framebuffer/localhistory.c @@ -24,7 +24,6 @@ #include <libnsfb_plot.h> #include <libnsfb_event.h> -#include "utils/types.h" #include "desktop/browser_history.h" #include "desktop/plotters.h" diff --git a/framebuffer/thumbnail.c b/framebuffer/thumbnail.c index 0573e0758..616a59901 100644 --- a/framebuffer/thumbnail.c +++ b/framebuffer/thumbnail.c @@ -23,6 +23,7 @@ #include "utils/log.h" #include "utils/utils.h" +#include "desktop/plotters.h" #include "desktop/thumbnail.h" #include "content/urldb.h" #include "content/content.h" diff --git a/gtk/plotters.c b/gtk/plotters.c index de0bf9d48..ab7e4c5fb 100644 --- a/gtk/plotters.c +++ b/gtk/plotters.c @@ -32,6 +32,7 @@ #include <gtk/gtk.h> #include "utils/log.h" +#include "utils/utils.h" #include "desktop/plotters.h" #include "utils/nsoption.h" diff --git a/gtk/window.c b/gtk/window.c index 00aad32d2..1f70822bf 100644 --- a/gtk/window.c +++ b/gtk/window.c @@ -38,6 +38,7 @@ #include "desktop/searchweb.h" #include "desktop/textinput.h" #include "desktop/gui_window.h" +#include "desktop/plotters.h" #include "render/form.h" #include "gtk/compat.h" diff --git a/image/image.c b/image/image.c index 81d53a3af..e0c9a435b 100644 --- a/image/image.c +++ b/image/image.c @@ -21,6 +21,7 @@ #include <stdbool.h> #include <string.h> +#include "utils/utils.h" #include "utils/errors.h" #include "utils/config.h" #include "utils/log.h" diff --git a/image/jpeg.c b/image/jpeg.c index fd18238f7..a5d77b55b 100644 --- a/image/jpeg.c +++ b/image/jpeg.c @@ -35,7 +35,6 @@ #include "utils/log.h" #include "utils/messages.h" -#include "utils/types.h" #include "utils/utils.h" #define JPEG_INTERNAL_OPTIONS diff --git a/image/svg.c b/image/svg.c index 76be76ac2..0bffbe836 100644 --- a/image/svg.c +++ b/image/svg.c @@ -26,12 +26,13 @@ #include <svgtiny.h> +#include "utils/messages.h" +#include "utils/utils.h" #include "content/content_protected.h" #include "css/css.h" #include "desktop/plotters.h" + #include "image/svg.h" -#include "utils/messages.h" -#include "utils/utils.h" typedef struct svg_content { struct content base; diff --git a/monkey/plot.c b/monkey/plot.c index db4d6cd32..bd5b0a18f 100644 --- a/monkey/plot.c +++ b/monkey/plot.c @@ -18,6 +18,7 @@ #include <stdio.h> +#include "utils/utils.h" #include "desktop/plotters.h" static bool diff --git a/render/box.h b/render/box.h index 988b2872c..8e5aef8f5 100644 --- a/render/box.h +++ b/render/box.h @@ -91,8 +91,6 @@ #include <stdio.h> #include "css/css.h" -#include "utils/nsurl.h" -#include "utils/types.h" struct content; struct box; @@ -101,8 +99,9 @@ struct column; struct object_params; struct object_param; struct html_content; - +struct nsurl; struct dom_node; +struct rect; #define UNKNOWN_WIDTH INT_MAX #define UNKNOWN_MAX_WIDTH INT_MAX @@ -216,7 +215,7 @@ struct box { /** Width of space after current text (depends on font and size). */ int space; - nsurl *href; /**< Link, or 0. */ + struct nsurl *href; /**< Link, or 0. */ const char *target; /**< Link target, or 0. */ const char *title; /**< Title, or 0. */ @@ -289,11 +288,11 @@ struct column { /** Parameters for object element and similar elements. */ struct object_params { - nsurl *data; + struct nsurl *data; char *type; char *codetype; - nsurl *codebase; - nsurl *classid; + struct nsurl *codebase; + struct nsurl *classid; struct object_param *params; }; @@ -316,7 +315,7 @@ extern const char *TARGET_BLANK; struct box * box_create(css_select_results *styles, css_computed_style *style, - bool style_owned, nsurl *href, const char *target, + bool style_owned, struct nsurl *href, const char *target, const char *title, lwc_string *id, void *context); void box_add_child(struct box *parent, struct box *child); void box_insert_sibling(struct box *box, struct box *new_box); @@ -332,7 +331,7 @@ struct box *box_pick_text_box(struct html_content *html, struct box *box_find_by_id(struct box *box, lwc_string *id); bool box_visible(struct box *box); void box_dump(FILE *stream, struct box *box, unsigned int depth, bool style); -bool box_extract_link(const char *rel, nsurl *base, nsurl **result); +bool box_extract_link(const char *rel, struct nsurl *base, struct nsurl **result); bool box_handle_scrollbars(struct content *c, struct box *box, bool bottom, bool right); diff --git a/render/form.h b/render/form.h index 31efb7c43..77356dabd 100644 --- a/render/form.h +++ b/render/form.h @@ -36,6 +36,8 @@ struct dom_string; struct content; struct nsurl; struct fetch_multipart_data; +struct redraw_context; + enum browser_mouse_state; /** Form submit method. */ diff --git a/riscos/gui/url_bar.c b/riscos/gui/url_bar.c index 348fc85c4..406fa9da7 100644 --- a/riscos/gui/url_bar.c +++ b/riscos/gui/url_bar.c @@ -38,6 +38,7 @@ #include "content/hlcache.h" #include "content/content.h" #include "desktop/browser.h" +#include "desktop/plotters.h" #include "riscos/gui.h" #include "riscos/hotlist.h" diff --git a/riscos/plotters.c b/riscos/plotters.c index e3745c5ba..d35d1f0c6 100644 --- a/riscos/plotters.c +++ b/riscos/plotters.c @@ -27,6 +27,7 @@ #include "oslib/os.h" #include "utils/log.h" +#include "utils/utils.h" #include "desktop/plotters.h" #include "riscos/bitmap.h" diff --git a/riscos/save_draw.c b/riscos/save_draw.c index e8b7faae6..fe14071ee 100644 --- a/riscos/save_draw.c +++ b/riscos/save_draw.c @@ -31,7 +31,6 @@ #include <pencil.h> #include "utils/log.h" -#include "utils/types.h" #include "utils/utils.h" #include "content/content.h" #include "content/hlcache.h" diff --git a/utils/types.h b/utils/types.h deleted file mode 100644 index 3c78124e3..000000000 --- a/utils/types.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2011 Michael Drake <tlsa@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 - * Core types. - */ - -#ifndef _NETSURF_UTILS_TYPES_H_ -#define _NETSURF_UTILS_TYPES_H_ - -#include <stdbool.h> - -struct plotter_table; -struct hlcache_handle; - -/* Rectangle coordinates */ -struct rect { - int x0, y0; /* Top left */ - int x1, y1; /* Bottom right */ -}; - - -/* Redraw context */ -struct redraw_context { - /** Redraw to show interactive features, such as active selections - * etc. Should be off for printing. */ - bool interactive; - - /** Render background images. May want it off for printing. */ - bool background_images; - - /** Current plotters, must be assigned before use. */ - const struct plotter_table *plot; -}; - - - -#endif diff --git a/utils/utils.h b/utils/utils.h index 00d150126..e2865d738 100644 --- a/utils/utils.h +++ b/utils/utils.h @@ -38,6 +38,12 @@ #include "utils/errors.h" +/* Rectangle coordinates */ +struct rect { + int x0, y0; /* Top left */ + int x1, y1; /* Bottom right */ +}; + struct dirent; #ifndef NOF_ELEMENTS diff --git a/windows/drawable.c b/windows/drawable.c index cbbbaa379..acbcdf1f0 100644 --- a/windows/drawable.c +++ b/windows/drawable.c @@ -25,6 +25,7 @@ #include "desktop/browser.h" #include "desktop/textinput.h" +#include "desktop/plotters.h" #include "utils/errors.h" #include "utils/log.h" #include "utils/utils.h" |