summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-11-02 20:10:32 +0000
committerVincent Sanders <vince@kyllikki.org>2014-11-02 20:10:32 +0000
commitad343eccb18454bab2f4e9464b88564c9da69649 (patch)
treea4d775a8e99e7d98dcfabdcdde7e6ad0dfd7368b /desktop
parentf2cda2e1a707033ac582e791c45eeb3d0feaa70d (diff)
downloadnetsurf-ad343eccb18454bab2f4e9464b88564c9da69649.tar.gz
netsurf-ad343eccb18454bab2f4e9464b88564c9da69649.tar.bz2
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.
Diffstat (limited to 'desktop')
-rw-r--r--desktop/browser.h3
-rw-r--r--desktop/cookie_manager.h2
-rw-r--r--desktop/core_window.h3
-rw-r--r--desktop/global_history.h8
-rw-r--r--desktop/gui_clipboard.h1
-rw-r--r--desktop/hotlist.h18
-rw-r--r--desktop/plotters.h26
-rw-r--r--desktop/print.c11
-rw-r--r--desktop/textarea.h2
-rw-r--r--desktop/thumbnail.h11
-rw-r--r--desktop/treeview.h3
11 files changed, 52 insertions, 36 deletions
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;