remove unecessary utils/types.h

This cleans up this header and moves the functionality into more
useful places while reducing the include complexity but only pulling
in whats required.
This commit is contained in:
Vincent Sanders 2014-11-02 20:10:32 +00:00
parent f2cda2e1a7
commit ad343eccb1
35 changed files with 85 additions and 112 deletions

View File

@ -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"

View File

@ -21,8 +21,5 @@
#define ATARI_REDRAW_SLOTS_H
#include <mt_gem.h>
#include "utils/types.h"
#endif

View File

@ -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)

View File

@ -21,8 +21,8 @@
#define ATARI_REDRAW_SLOTS_H
#include <mt_gem.h>
#include "utils/types.h"
#include "utils/utils.h"
/*
MAX_REDRW_SLOTS

View File

@ -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,

View File

@ -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"

View File

@ -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 {

View File

@ -30,7 +30,9 @@
#include "desktop/textinput.h"
#include "utils/errors.h"
struct redraw_context;
struct cookie_data;
enum browser_mouse_state;
/**

View File

@ -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,

View File

@ -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

View File

@ -27,7 +27,6 @@
#include <stddef.h>
#include "utils/types.h"
#include "utils/errors.h"
#include "desktop/plot_style.h"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -27,7 +27,7 @@
#include <stdint.h>
#include <stdbool.h>
#include "utils/types.h"
#include "utils/utils.h"
struct textarea;

View File

@ -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

View File

@ -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;

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -32,6 +32,7 @@
#include <gtk/gtk.h>
#include "utils/log.h"
#include "utils/utils.h"
#include "desktop/plotters.h"
#include "utils/nsoption.h"

View File

@ -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"

View File

@ -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"

View File

@ -35,7 +35,6 @@
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/types.h"
#include "utils/utils.h"
#define JPEG_INTERNAL_OPTIONS

View File

@ -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;

View File

@ -18,6 +18,7 @@
#include <stdio.h>
#include "utils/utils.h"
#include "desktop/plotters.h"
static bool

View File

@ -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);

View File

@ -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. */

View File

@ -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"

View File

@ -27,6 +27,7 @@
#include "oslib/os.h"
#include "utils/log.h"
#include "utils/utils.h"
#include "desktop/plotters.h"
#include "riscos/bitmap.h"

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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"