mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-25 07:49:38 +03:00
Update content to split public and internal API
This commit is contained in:
parent
d923e109cd
commit
76a68d7dd0
@ -28,11 +28,12 @@
|
||||
#include "utils/utils.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "desktop/knockout.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "content/content_debug.h"
|
||||
#include "content/hlcache.h"
|
||||
@ -542,12 +543,8 @@ void content__request_redraw(struct content *c,
|
||||
content_broadcast(c, CONTENT_MSG_REDRAW, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display content on screen with optional tiling.
|
||||
*
|
||||
* Calls the redraw function for the content.
|
||||
*/
|
||||
|
||||
/* exported interface, documented in content/content.h */
|
||||
bool content_redraw(hlcache_handle *h, struct content_redraw_data *data,
|
||||
const struct rect *clip, const struct redraw_context *ctx)
|
||||
{
|
||||
@ -1050,12 +1047,7 @@ bool content__add_rfc5988_link(struct content *c,
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve URL associated with content
|
||||
*
|
||||
* \param c Content to retrieve URL from
|
||||
* \return Pointer to URL, or NULL if not found.
|
||||
*/
|
||||
/* exported interface documented in content/content.h */
|
||||
nsurl *content_get_url(struct content *c)
|
||||
{
|
||||
if (c == NULL)
|
||||
|
@ -17,8 +17,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* Content handling (interface).
|
||||
/**
|
||||
* \file
|
||||
* Content handling interface.
|
||||
*
|
||||
* The content functions manipulate struct contents, which correspond to URLs.
|
||||
*/
|
||||
@ -30,10 +31,8 @@
|
||||
|
||||
#include "utils/errors.h"
|
||||
#include "content/content_factory.h"
|
||||
#include "content/content_type.h"
|
||||
#include "desktop/search.h" /* search flags enum */
|
||||
#include "netsurf/mouse.h" /* mouse state enums */
|
||||
#include "desktop/plot_style.h" /* color typedef */
|
||||
|
||||
struct browser_window;
|
||||
struct browser_window_features;
|
||||
@ -81,18 +80,6 @@ typedef enum {
|
||||
CONTENT_MSG_GADGETCLICK/**< A gadget has been clicked on (mainly for file) */
|
||||
} content_msg;
|
||||
|
||||
/** Debugging dump operations */
|
||||
enum content_debug {
|
||||
CONTENT_DEBUG_RENDER, /** Debug the contents rendering. */
|
||||
CONTENT_DEBUG_DOM, /** Debug the contents Document Object. */
|
||||
CONTENT_DEBUG_REDRAW /** Debug redraw operations. */
|
||||
};
|
||||
|
||||
/** Content encoding informstion types */
|
||||
enum content_encoding_type {
|
||||
CONTENT_ENCODING_NORMAL, /** The content encoding */
|
||||
CONTENT_ENCODING_SOURCE /** The content encoding source */
|
||||
};
|
||||
|
||||
/** RFC5988 metadata link */
|
||||
struct content_rfc5988_link {
|
||||
@ -208,44 +195,35 @@ union content_msg_data {
|
||||
} gadget_click;
|
||||
};
|
||||
|
||||
/** parameters to content redraw */
|
||||
struct content_redraw_data {
|
||||
int x; /**< coordinate for top-left of redraw */
|
||||
int y; /**< coordinate for top-left of redraw */
|
||||
|
||||
/** dimensions to render content at
|
||||
* (for scaling contents with intrinsic dimensions) */
|
||||
int width; /**< horizontal dimension */
|
||||
int height; /**< vertical dimension */
|
||||
|
||||
/** The background colour */
|
||||
colour background_colour;
|
||||
|
||||
/** Scale for redraw
|
||||
* (for scaling contents without intrinsic dimensions) */
|
||||
float scale; /**< Scale factor for redraw */
|
||||
|
||||
bool repeat_x; /**< whether content is tiled in x direction */
|
||||
bool repeat_y; /**< whether content is tiled in y direction */
|
||||
};
|
||||
|
||||
/* The following are for hlcache */
|
||||
void content_destroy(struct content *c);
|
||||
|
||||
bool content_add_user(struct content *h,
|
||||
void (*callback)(struct content *c, content_msg msg,
|
||||
union content_msg_data data, void *pw),
|
||||
void *pw);
|
||||
void content_remove_user(struct content *c,
|
||||
void (*callback)(struct content *c, content_msg msg,
|
||||
union content_msg_data data, void *pw),
|
||||
void *pw);
|
||||
|
||||
bool content_add_user(struct content *h, void (*callback)(struct content *c, content_msg msg, union content_msg_data data, void *pw), void *pw);
|
||||
|
||||
|
||||
void content_remove_user(struct content *c, void (*callback)(struct content *c, content_msg msg, union content_msg_data data, void *pw), void *pw);
|
||||
|
||||
|
||||
uint32_t content_count_users(struct content *c);
|
||||
|
||||
|
||||
bool content_matches_quirks(struct content *c, bool quirks);
|
||||
|
||||
|
||||
bool content_is_shareable(struct content *c);
|
||||
|
||||
/* only used by cocoa apple image handling and for getting nsurl of content */
|
||||
const struct llcache_handle *content_get_llcache_handle(struct content *c);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve URL associated with content
|
||||
*
|
||||
* \param c Content to retrieve URL from
|
||||
* \return Pointer to URL, or NULL if not found.
|
||||
*/
|
||||
struct nsurl *content_get_url(struct content *c);
|
||||
|
||||
struct content *content_clone(struct content *c);
|
||||
@ -254,42 +232,29 @@ nserror content_abort(struct content *c);
|
||||
|
||||
/* Client functions */
|
||||
bool content_can_reformat(struct hlcache_handle *h);
|
||||
|
||||
void content_reformat(struct hlcache_handle *h, bool background,
|
||||
int width, int height);
|
||||
|
||||
void content_request_redraw(struct hlcache_handle *h,
|
||||
int x, int y, int width, int height);
|
||||
|
||||
void content_mouse_track(struct hlcache_handle *h, struct browser_window *bw,
|
||||
browser_mouse_state mouse, int x, int y);
|
||||
|
||||
void content_mouse_action(struct hlcache_handle *h, struct browser_window *bw,
|
||||
browser_mouse_state mouse, int x, int y);
|
||||
|
||||
bool content_keypress(struct hlcache_handle *h, uint32_t key);
|
||||
bool content_redraw(struct hlcache_handle *h, struct content_redraw_data *data,
|
||||
const struct rect *clip, const struct redraw_context *ctx);
|
||||
|
||||
|
||||
/**
|
||||
* Redraw a content with scale set for horizontal fit.
|
||||
*
|
||||
* Redraws the content at a specified width and height with the
|
||||
* content drawing scaled to fit within the area.
|
||||
*
|
||||
* \param content The content to redraw
|
||||
* \param width The target width
|
||||
* \param height The target height
|
||||
* \param ctx current redraw context
|
||||
* \return true if successful, false otherwise
|
||||
*
|
||||
* The thumbnail is guaranteed to be filled to its width/height extents, so
|
||||
* there is no need to render a solid background first.
|
||||
*
|
||||
* Units for width and height are pixels.
|
||||
*/
|
||||
bool content_scaled_redraw(struct hlcache_handle *content, int width, int height, const struct redraw_context *ctx);
|
||||
|
||||
void content_open(struct hlcache_handle *h, struct browser_window *bw,
|
||||
struct content *page, struct object_params *params);
|
||||
|
||||
void content_close(struct hlcache_handle *h);
|
||||
|
||||
void content_clear_selection(struct hlcache_handle *h);
|
||||
|
||||
char * content_get_selection(struct hlcache_handle *h);
|
||||
|
||||
/**
|
||||
@ -305,13 +270,16 @@ nserror content_get_contextual_content(struct hlcache_handle *h,
|
||||
|
||||
bool content_scroll_at_point(struct hlcache_handle *h,
|
||||
int x, int y, int scrx, int scry);
|
||||
|
||||
bool content_drop_file_at_point(struct hlcache_handle *h,
|
||||
int x, int y, char *file);
|
||||
|
||||
void content_search(struct hlcache_handle *h, void *context,
|
||||
search_flags_t flags, const char *string);
|
||||
|
||||
void content_search_clear(struct hlcache_handle *h);
|
||||
|
||||
|
||||
/**
|
||||
* Control debug con a content.
|
||||
*
|
||||
@ -320,6 +288,7 @@ void content_search_clear(struct hlcache_handle *h);
|
||||
*/
|
||||
nserror content_debug(struct hlcache_handle *h, enum content_debug op);
|
||||
|
||||
|
||||
/**
|
||||
* find link in content that matches the rel string.
|
||||
*
|
||||
@ -328,34 +297,8 @@ nserror content_debug(struct hlcache_handle *h, enum content_debug op);
|
||||
* \return A matching rfc5988 link or NULL if none is found.
|
||||
*
|
||||
*/
|
||||
struct content_rfc5988_link *content_find_rfc5988_link(struct hlcache_handle *h,
|
||||
lwc_string *rel);
|
||||
struct content_rfc5988_link *content_find_rfc5988_link(struct hlcache_handle *h, lwc_string *rel);
|
||||
|
||||
/* Member accessors */
|
||||
|
||||
/**
|
||||
* Retrieve computed type of content
|
||||
*
|
||||
* \param h handle to the content to retrieve tyoe of.
|
||||
* \return Computed content type
|
||||
*/
|
||||
content_type content_get_type(struct hlcache_handle *h);
|
||||
|
||||
/**
|
||||
* Retrieve mime-type of content
|
||||
*
|
||||
* \param h handle to the content to retrieve mime type from
|
||||
* \return Pointer to referenced mime type, or NULL if not found.
|
||||
*/
|
||||
lwc_string *content_get_mime_type(struct hlcache_handle *h);
|
||||
|
||||
/**
|
||||
* Retrieve title associated with content
|
||||
*
|
||||
* \param h handle to the content to retrieve title from
|
||||
* \return Pointer to title, or NULL if not found.
|
||||
*/
|
||||
const char *content_get_title(struct hlcache_handle *h);
|
||||
|
||||
/**
|
||||
* Retrieve status of content
|
||||
@ -365,6 +308,7 @@ const char *content_get_title(struct hlcache_handle *h);
|
||||
*/
|
||||
content_status content_get_status(struct hlcache_handle *h);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve status of content
|
||||
*
|
||||
@ -373,6 +317,7 @@ content_status content_get_status(struct hlcache_handle *h);
|
||||
*/
|
||||
content_status content__get_status(struct content *c);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve status message associated with content
|
||||
*
|
||||
@ -381,21 +326,6 @@ content_status content__get_status(struct content *c);
|
||||
*/
|
||||
const char *content_get_status_message(struct hlcache_handle *h);
|
||||
|
||||
/**
|
||||
* Retrieve width of content
|
||||
*
|
||||
* \param h handle to the content to get width of.
|
||||
* \return Content width
|
||||
*/
|
||||
int content_get_width(struct hlcache_handle *h);
|
||||
|
||||
/**
|
||||
* Retrieve height of content
|
||||
*
|
||||
* \param h handle to the content to get height of.
|
||||
* \return Content height
|
||||
*/
|
||||
int content_get_height(struct hlcache_handle *h);
|
||||
|
||||
/**
|
||||
* Retrieve available width of content
|
||||
@ -405,26 +335,6 @@ int content_get_height(struct hlcache_handle *h);
|
||||
*/
|
||||
int content_get_available_width(struct hlcache_handle *h);
|
||||
|
||||
/**
|
||||
* Retrieve source of content
|
||||
*
|
||||
* \param h Content handle to retrieve source of
|
||||
* \param size Pointer to location to receive byte size of source
|
||||
* \return Pointer to source data
|
||||
*/
|
||||
const char *content_get_source_data(struct hlcache_handle *h,
|
||||
unsigned long *size);
|
||||
|
||||
/**
|
||||
* Invalidate content reuse data.
|
||||
*
|
||||
* causes subsequent requests for content URL to query server to
|
||||
* determine if content can be reused. This is required behaviour for
|
||||
* forced reloads etc.
|
||||
*
|
||||
* \param h Content handle to invalidate.
|
||||
*/
|
||||
void content_invalidate_reuse_data(struct hlcache_handle *h);
|
||||
|
||||
/**
|
||||
* Retrieve the refresh URL for a content
|
||||
@ -434,13 +344,6 @@ void content_invalidate_reuse_data(struct hlcache_handle *h);
|
||||
*/
|
||||
struct nsurl *content_get_refresh_url(struct hlcache_handle *h);
|
||||
|
||||
/**
|
||||
* Retrieve the bitmap contained in an image content
|
||||
*
|
||||
* \param h handle to the content.
|
||||
* \return Pointer to bitmap, or NULL if none.
|
||||
*/
|
||||
struct bitmap *content_get_bitmap(struct hlcache_handle *h);
|
||||
|
||||
/**
|
||||
* Determine if a content is opaque from handle
|
||||
@ -451,6 +354,7 @@ struct bitmap *content_get_bitmap(struct hlcache_handle *h);
|
||||
*/
|
||||
bool content_get_opaque(struct hlcache_handle *h);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve quirkiness of a content
|
||||
*
|
||||
@ -459,14 +363,6 @@ bool content_get_opaque(struct hlcache_handle *h);
|
||||
*/
|
||||
bool content_get_quirks(struct hlcache_handle *h);
|
||||
|
||||
/**
|
||||
* Retrieve the encoding of a content
|
||||
*
|
||||
* \param h handle to the content.
|
||||
* \param op encoding operation.
|
||||
* \return Pointer to content info or NULL if none.
|
||||
*/
|
||||
const char *content_get_encoding(struct hlcache_handle *h, enum content_encoding_type op);
|
||||
|
||||
/**
|
||||
* Return whether a content is currently locked
|
||||
@ -476,4 +372,7 @@ const char *content_get_encoding(struct hlcache_handle *h, enum content_encoding
|
||||
*/
|
||||
bool content_is_locked(struct hlcache_handle *h);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#include <libwapcaplet/libwapcaplet.h>
|
||||
|
||||
#include "content/content_type.h"
|
||||
#include "netsurf/content_type.h"
|
||||
#include "utils/errors.h"
|
||||
|
||||
#define CONTENT_FACTORY_REGISTER_TYPES(HNAME, HTYPELIST, HHANDLER) \
|
||||
|
@ -26,29 +26,22 @@
|
||||
#ifndef _NETSURF_CONTENT_CONTENT_PROTECTED_H_
|
||||
#define _NETSURF_CONTENT_CONTENT_PROTECTED_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "utils/config.h"
|
||||
#include "utils/nsurl.h"
|
||||
#include "netsurf/content_type.h"
|
||||
#include "content/content.h"
|
||||
#include "content/content_factory.h"
|
||||
#include "content/llcache.h"
|
||||
#include "utils/errors.h"
|
||||
|
||||
struct bitmap;
|
||||
struct content;
|
||||
struct rect;
|
||||
struct redraw_context;
|
||||
struct content_redraw_data;
|
||||
struct http_parameter;
|
||||
|
||||
struct content_handler {
|
||||
void (*fini)(void);
|
||||
|
||||
nserror (*create)(const content_handler *handler,
|
||||
nserror (*create)(const struct content_handler *handler,
|
||||
lwc_string *imime_type,
|
||||
const struct http_parameter *params,
|
||||
llcache_handle *llcache,
|
||||
struct llcache_handle *llcache,
|
||||
const char *fallback_charset, bool quirks,
|
||||
struct content **c);
|
||||
|
||||
@ -108,11 +101,11 @@ struct content_user
|
||||
|
||||
/** Corresponds to a single URL. */
|
||||
struct content {
|
||||
llcache_handle *llcache; /**< Low-level cache object */
|
||||
struct llcache_handle *llcache; /**< Low-level cache object */
|
||||
|
||||
lwc_string *mime_type; /**< Original MIME type of data */
|
||||
|
||||
const content_handler *handler; /**< Handler for content */
|
||||
const struct content_handler *handler; /**< Handler for content */
|
||||
|
||||
content_status status; /**< Current status. */
|
||||
|
||||
@ -161,7 +154,7 @@ struct content {
|
||||
extern const char * const content_type_name[];
|
||||
extern const char * const content_status_name[];
|
||||
|
||||
nserror content__init(struct content *c, const content_handler *handler,
|
||||
nserror content__init(struct content *c, const struct content_handler *handler,
|
||||
lwc_string *imime_type, const struct http_parameter *params,
|
||||
struct llcache_handle *llcache, const char *fallback_charset,
|
||||
bool quirks);
|
||||
|
@ -40,7 +40,6 @@
|
||||
#include "content/fetch.h"
|
||||
#include "content/fetchers.h"
|
||||
#include "content/fetchers/about.h"
|
||||
#include "content/content_type.h"
|
||||
#include "content/handlers/image/image_cache.h"
|
||||
|
||||
|
||||
|
@ -28,10 +28,12 @@
|
||||
|
||||
#include "utils/utils.h"
|
||||
#include "utils/messages.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/llcache.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
|
||||
#include "bmp.h"
|
||||
|
||||
|
@ -39,10 +39,12 @@
|
||||
#include "utils/utils.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "netsurf/misc.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/llcache.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
|
||||
#include "image.h"
|
||||
#include "gif.h"
|
||||
|
@ -27,9 +27,11 @@
|
||||
#include "utils/utils.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/llcache.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
|
||||
#include "image.h"
|
||||
#include "ico.h"
|
||||
|
@ -22,10 +22,10 @@
|
||||
#include "utils/utils.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "content/content.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
|
||||
#include "bmp.h"
|
||||
#include "gif.h"
|
||||
|
@ -25,6 +25,8 @@
|
||||
|
||||
#include "utils/errors.h"
|
||||
|
||||
struct content_redraw_data;
|
||||
|
||||
/** Initialise the content handlers for image types.
|
||||
*/
|
||||
nserror image_init(void);
|
||||
|
@ -25,10 +25,11 @@
|
||||
|
||||
#include "utils/utils.h"
|
||||
#include "utils/log.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "netsurf/misc.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "content/llcache.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
|
||||
#include "image_cache.h"
|
||||
#include "image.h"
|
||||
|
@ -38,6 +38,7 @@
|
||||
#define NETSURF_IMAGE_IMAGE_CACHE_H_
|
||||
|
||||
#include "utils/errors.h"
|
||||
#include "netsurf/content_type.h"
|
||||
|
||||
struct content_redraw_data;
|
||||
struct redraw_context;
|
||||
|
@ -30,9 +30,10 @@
|
||||
#include "utils/utils.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "content/llcache.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
|
||||
#include "image_cache.h"
|
||||
|
||||
|
@ -28,10 +28,12 @@
|
||||
#include "utils/utils.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/llcache.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
|
||||
#include "nssprite.h"
|
||||
|
||||
@ -62,7 +64,7 @@ typedef struct nssprite_content {
|
||||
|
||||
static nserror nssprite_create(const content_handler *handler,
|
||||
lwc_string *imime_type, const struct http_parameter *params,
|
||||
llcache_handle *llcache, const char *fallback_charset,
|
||||
struct llcache_handle *llcache, const char *fallback_charset,
|
||||
bool quirks, struct content **c)
|
||||
{
|
||||
nssprite_content *sprite;
|
||||
|
@ -25,9 +25,10 @@
|
||||
#include "utils/utils.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "content/llcache.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
|
||||
#include "image_cache.h"
|
||||
#include "png.h"
|
||||
@ -277,10 +278,14 @@ static nserror nspng_create_png_data(nspng_content *png_c)
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
static nserror nspng_create(const content_handler *handler,
|
||||
lwc_string *imime_type, const struct http_parameter *params,
|
||||
llcache_handle *llcache, const char *fallback_charset,
|
||||
bool quirks, struct content **c)
|
||||
static nserror
|
||||
nspng_create(const content_handler *handler,
|
||||
lwc_string *imime_type,
|
||||
const struct http_parameter *params,
|
||||
struct llcache_handle *llcache,
|
||||
const char *fallback_charset,
|
||||
bool quirks,
|
||||
struct content **c)
|
||||
{
|
||||
nspng_content *png_c;
|
||||
nserror error;
|
||||
|
@ -29,8 +29,9 @@
|
||||
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/content_protected.h"
|
||||
|
||||
#include "svg.h"
|
||||
|
||||
@ -71,7 +72,7 @@ no_memory:
|
||||
|
||||
static nserror svg_create(const content_handler *handler,
|
||||
lwc_string *imime_type, const struct http_parameter *params,
|
||||
llcache_handle *llcache, const char *fallback_charset,
|
||||
struct llcache_handle *llcache, const char *fallback_charset,
|
||||
bool quirks, struct content **c)
|
||||
{
|
||||
svg_content *svg;
|
||||
|
@ -30,9 +30,9 @@
|
||||
#include "utils/ring.h"
|
||||
#include "utils/utils.h"
|
||||
#include "netsurf/misc.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
|
||||
#include "content/content.h"
|
||||
#include "content/mimesniff.h"
|
||||
#include "content/hlcache.h"
|
||||
|
||||
|
@ -175,12 +175,5 @@ struct content *hlcache_handle_get_content(const hlcache_handle *handle);
|
||||
*/
|
||||
nserror hlcache_handle_clone(hlcache_handle *handle, hlcache_handle **result);
|
||||
|
||||
/**
|
||||
* Retrieve the URL associated with a high level cache handle
|
||||
*
|
||||
* \param handle The handle to inspect
|
||||
* \return Pointer to URL.
|
||||
*/
|
||||
nsurl *hlcache_handle_get_url(const hlcache_handle *handle);
|
||||
|
||||
#endif
|
||||
|
@ -25,8 +25,9 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "utils/nsurl.h"
|
||||
#include "content/content_type.h"
|
||||
#include "netsurf/content_type.h"
|
||||
|
||||
typedef enum {
|
||||
COOKIE_NETSCAPE = 0,
|
||||
|
@ -47,7 +47,10 @@
|
||||
#include "utils/utils.h"
|
||||
#include "utils/utf8.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "content/content.h"
|
||||
#include "netsurf/misc.h"
|
||||
#include "netsurf/window.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "content/content_debug.h"
|
||||
#include "content/fetch.h"
|
||||
#include "content/hlcache.h"
|
||||
@ -68,10 +71,7 @@
|
||||
#include "desktop/knockout.h"
|
||||
#include "desktop/scrollbar.h"
|
||||
#include "desktop/selection.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "desktop/theme.h"
|
||||
#include "netsurf/misc.h"
|
||||
#include "netsurf/window.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
|
||||
|
||||
|
@ -29,18 +29,17 @@
|
||||
#include <time.h>
|
||||
|
||||
#include "utils/log.h"
|
||||
#include "utils/nsurl.h"
|
||||
#include "utils/utils.h"
|
||||
#include "content/content.h"
|
||||
#include "netsurf/layout.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "content/urldb.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
|
||||
#include "netsurf/layout.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
#include "desktop/browser_history.h"
|
||||
#include "desktop/browser_private.h"
|
||||
#include "netsurf/plotters.h"
|
||||
|
||||
#define WIDTH 100
|
||||
#define HEIGHT 86
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "desktop/frame_types.h"
|
||||
#include "desktop/plot_style.h"
|
||||
|
||||
struct box;
|
||||
struct hlcache_handle;
|
||||
|
@ -29,17 +29,16 @@
|
||||
#include <time.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "utils/config.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/utils.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "render/html.h"
|
||||
#include "render/box.h"
|
||||
|
||||
#include "desktop/browser_private.h"
|
||||
#include "desktop/frames.h"
|
||||
#include "desktop/scrollbar.h"
|
||||
#include "desktop/selection.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
#include "render/html.h"
|
||||
#include "render/box.h"
|
||||
|
||||
/** maximum frame resize margin */
|
||||
#define FRAME_RESIZE 6
|
||||
@ -98,7 +97,7 @@ void browser_window_scroll_callback(void *client_data,
|
||||
/* exported interface, documented in browser.h */
|
||||
void browser_window_handle_scrollbars(struct browser_window *bw)
|
||||
{
|
||||
hlcache_handle *h = bw->current_content;
|
||||
struct hlcache_handle *h = bw->current_content;
|
||||
bool scroll_x;
|
||||
bool scroll_y;
|
||||
int c_width = 0;
|
||||
@ -380,8 +379,8 @@ nserror browser_window_create_frameset(struct browser_window *bw,
|
||||
/* Use the URL of the first ancestor window containing html content
|
||||
* as the referer */
|
||||
for (window = bw; window->parent; window = window->parent) {
|
||||
if (window->current_content &&
|
||||
content_get_type(window->current_content) ==
|
||||
if (window->current_content &&
|
||||
content_get_type(window->current_content) ==
|
||||
CONTENT_HTML)
|
||||
break;
|
||||
}
|
||||
|
172
desktop/print.c
172
desktop/print.c
@ -30,12 +30,12 @@
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/talloc.h"
|
||||
#include "content/content.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "content/handlers/css/utils.h"
|
||||
#include "render/box.h"
|
||||
|
||||
#include "netsurf/plotters.h"
|
||||
#include "desktop/print.h"
|
||||
#include "desktop/printer.h"
|
||||
|
||||
@ -44,11 +44,8 @@
|
||||
#define DEFAULT_PAGE_HEIGHT 840
|
||||
#define DEFAULT_COPIES 1
|
||||
|
||||
static hlcache_handle *print_init(hlcache_handle *, struct print_settings *);
|
||||
static bool print_apply_settings(hlcache_handle *, struct print_settings *);
|
||||
|
||||
static float page_content_width, page_content_height;
|
||||
static hlcache_handle *printed_content;
|
||||
static struct hlcache_handle *printed_content;
|
||||
static float done_height;
|
||||
|
||||
bool html_redraw_printing = false;
|
||||
@ -71,7 +68,7 @@ bool print_basic_run(hlcache_handle *content,
|
||||
bool ret = true;
|
||||
|
||||
assert(content != NULL && printer != NULL && settings != NULL);
|
||||
|
||||
|
||||
if (print_set_up(content, printer, settings, NULL))
|
||||
return false;
|
||||
|
||||
@ -80,10 +77,62 @@ bool print_basic_run(hlcache_handle *content,
|
||||
}
|
||||
|
||||
print_cleanup(content, printer, settings);
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The content passed to the function is duplicated with its boxes, font
|
||||
* measuring functions are being set.
|
||||
*
|
||||
* \param content The content to be printed
|
||||
* \param settings The settings for printing to use
|
||||
* \return true if successful, false otherwise
|
||||
*/
|
||||
static struct hlcache_handle *
|
||||
print_init(struct hlcache_handle *content, struct print_settings *settings)
|
||||
{
|
||||
struct hlcache_handle* printed_content;
|
||||
|
||||
hlcache_handle_clone(content, &printed_content);
|
||||
|
||||
return printed_content;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The content is resized to fit page width.
|
||||
*
|
||||
* \param content The content to be printed
|
||||
* \param settings The settings for printing to use
|
||||
* \return true if successful, false otherwise
|
||||
*/
|
||||
static bool
|
||||
print_apply_settings(hlcache_handle *content, struct print_settings *settings)
|
||||
{
|
||||
if (settings == NULL)
|
||||
return false;
|
||||
|
||||
/* Apply settings - adjust page size etc */
|
||||
|
||||
page_content_width = (settings->page_width -
|
||||
FIXTOFLT(FSUB(settings->margins[MARGINLEFT],
|
||||
settings->margins[MARGINRIGHT]))) / settings->scale;
|
||||
|
||||
page_content_height = (settings->page_height -
|
||||
FIXTOFLT(FSUB(settings->margins[MARGINTOP],
|
||||
settings->margins[MARGINBOTTOM]))) / settings->scale;
|
||||
|
||||
content_reformat(content, false, page_content_width, 0);
|
||||
|
||||
LOG("New layout applied.New height = %d ; New width = %d ",
|
||||
content_get_height(content), content_get_width(content));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function prepares the content to be printed. The current browser content
|
||||
* is duplicated and resized, printer initialization is called.
|
||||
@ -99,20 +148,20 @@ bool print_set_up(hlcache_handle *content,
|
||||
double *height)
|
||||
{
|
||||
printed_content = print_init(content, settings);
|
||||
|
||||
|
||||
if (printed_content == NULL)
|
||||
return false;
|
||||
|
||||
|
||||
print_apply_settings(printed_content, settings);
|
||||
|
||||
if (height)
|
||||
*height = content_get_height(printed_content);
|
||||
|
||||
|
||||
printer->print_begin(settings);
|
||||
|
||||
done_height = 0;
|
||||
|
||||
return true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -158,59 +207,12 @@ bool print_draw_next_page(const struct printer *printer,
|
||||
|
||||
done_height += page_content_height -
|
||||
(html_redraw_printing_top_cropped != INT_MAX ?
|
||||
clip.y1 - html_redraw_printing_top_cropped : 0) /
|
||||
clip.y1 - html_redraw_printing_top_cropped : 0) /
|
||||
settings->scale;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* The content passed to the function is duplicated with its boxes, font
|
||||
* measuring functions are being set.
|
||||
*
|
||||
* \param content The content to be printed
|
||||
* \param settings The settings for printing to use
|
||||
* \return true if successful, false otherwise
|
||||
*/
|
||||
hlcache_handle *print_init(hlcache_handle *content,
|
||||
struct print_settings *settings)
|
||||
{
|
||||
hlcache_handle* printed_content;
|
||||
|
||||
hlcache_handle_clone(content, &printed_content);
|
||||
|
||||
return printed_content;
|
||||
}
|
||||
|
||||
/**
|
||||
* The content is resized to fit page width.
|
||||
*
|
||||
* \param content The content to be printed
|
||||
* \param settings The settings for printing to use
|
||||
* \return true if successful, false otherwise
|
||||
*/
|
||||
bool print_apply_settings(hlcache_handle *content,
|
||||
struct print_settings *settings)
|
||||
{
|
||||
if (settings == NULL)
|
||||
return false;
|
||||
|
||||
/* Apply settings - adjust page size etc */
|
||||
|
||||
page_content_width = (settings->page_width -
|
||||
FIXTOFLT(FSUB(settings->margins[MARGINLEFT],
|
||||
settings->margins[MARGINRIGHT]))) / settings->scale;
|
||||
|
||||
page_content_height = (settings->page_height -
|
||||
FIXTOFLT(FSUB(settings->margins[MARGINTOP],
|
||||
settings->margins[MARGINBOTTOM]))) / settings->scale;
|
||||
|
||||
content_reformat(content, false, page_content_width, 0);
|
||||
|
||||
LOG("New layout applied.New height = %d ; New width = %d ", content_get_height(content), content_get_width(content));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Memory allocated during printing is being freed here.
|
||||
@ -224,16 +226,16 @@ bool print_cleanup(hlcache_handle *content, const struct printer *printer,
|
||||
struct print_settings *settings)
|
||||
{
|
||||
printer->print_end();
|
||||
|
||||
|
||||
html_redraw_printing = false;
|
||||
|
||||
|
||||
if (printed_content) {
|
||||
hlcache_handle_release(printed_content);
|
||||
}
|
||||
|
||||
|
||||
free((void *)settings->output);
|
||||
free(settings);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -252,57 +254,57 @@ struct print_settings *print_make_settings(print_configuration configuration,
|
||||
struct print_settings *settings;
|
||||
css_fixed length = 0;
|
||||
css_unit unit = CSS_UNIT_MM;
|
||||
|
||||
|
||||
switch (configuration){
|
||||
case PRINT_DEFAULT:
|
||||
settings = (struct print_settings*)
|
||||
case PRINT_DEFAULT:
|
||||
settings = (struct print_settings*)
|
||||
malloc(sizeof(struct print_settings));
|
||||
if (settings == NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
settings->page_width = DEFAULT_PAGE_WIDTH;
|
||||
settings->page_height = DEFAULT_PAGE_HEIGHT;
|
||||
settings->copies = DEFAULT_COPIES;
|
||||
|
||||
settings->scale = DEFAULT_EXPORT_SCALE;
|
||||
|
||||
|
||||
length = INTTOFIX(DEFAULT_MARGIN_LEFT_MM);
|
||||
settings->margins[MARGINLEFT] =
|
||||
settings->margins[MARGINLEFT] =
|
||||
nscss_len2px(length, unit, NULL);
|
||||
length = INTTOFIX(DEFAULT_MARGIN_RIGHT_MM);
|
||||
settings->margins[MARGINRIGHT] =
|
||||
settings->margins[MARGINRIGHT] =
|
||||
nscss_len2px(length, unit, NULL);
|
||||
length = INTTOFIX(DEFAULT_MARGIN_TOP_MM);
|
||||
settings->margins[MARGINTOP] =
|
||||
settings->margins[MARGINTOP] =
|
||||
nscss_len2px(length, unit, NULL);
|
||||
length = INTTOFIX(DEFAULT_MARGIN_BOTTOM_MM);
|
||||
settings->margins[MARGINBOTTOM] =
|
||||
settings->margins[MARGINBOTTOM] =
|
||||
nscss_len2px(length, unit, NULL);
|
||||
break;
|
||||
/* use settings from the Export options tab */
|
||||
case PRINT_OPTIONS:
|
||||
settings = (struct print_settings*)
|
||||
settings = (struct print_settings*)
|
||||
malloc(sizeof(struct print_settings));
|
||||
if (settings == NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
settings->page_width = DEFAULT_PAGE_WIDTH;
|
||||
settings->page_height = DEFAULT_PAGE_HEIGHT;
|
||||
settings->copies = DEFAULT_COPIES;
|
||||
|
||||
|
||||
settings->scale = (float)nsoption_int(export_scale) / 100;
|
||||
|
||||
|
||||
length = INTTOFIX(nsoption_int(margin_left));
|
||||
settings->margins[MARGINLEFT] =
|
||||
settings->margins[MARGINLEFT] =
|
||||
nscss_len2px(length, unit, NULL);
|
||||
length = INTTOFIX(nsoption_int(margin_right));
|
||||
settings->margins[MARGINRIGHT] =
|
||||
settings->margins[MARGINRIGHT] =
|
||||
nscss_len2px(length, unit, NULL);
|
||||
length = INTTOFIX(nsoption_int(margin_top));
|
||||
settings->margins[MARGINTOP] =
|
||||
settings->margins[MARGINTOP] =
|
||||
nscss_len2px(length, unit, NULL);
|
||||
length = INTTOFIX(nsoption_int(margin_bottom));
|
||||
settings->margins[MARGINBOTTOM] =
|
||||
settings->margins[MARGINBOTTOM] =
|
||||
nscss_len2px(length, unit, NULL);
|
||||
break;
|
||||
default:
|
||||
@ -319,9 +321,9 @@ struct print_settings *print_make_settings(print_configuration configuration,
|
||||
free(settings);
|
||||
return NULL;
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
settings->output = NULL;
|
||||
}
|
||||
|
||||
return settings;
|
||||
return settings;
|
||||
}
|
||||
|
||||
|
@ -17,8 +17,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* Save HTML document with dependencies (implementation).
|
||||
/**
|
||||
* \file
|
||||
* Save HTML document with dependencies implementation.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
@ -39,7 +40,7 @@
|
||||
#include "utils/utils.h"
|
||||
#include "utils/file.h"
|
||||
#include "utils/messages.h"
|
||||
#include "content/content.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "content/handlers/css/css.h"
|
||||
#include "render/box.h"
|
||||
@ -53,7 +54,7 @@ regex_t save_complete_import_re;
|
||||
|
||||
/** An entry in save_complete_list. */
|
||||
typedef struct save_complete_entry {
|
||||
hlcache_handle *content;
|
||||
struct hlcache_handle *content;
|
||||
struct save_complete_entry *next; /**< Next entry in list */
|
||||
} save_complete_entry;
|
||||
|
||||
@ -73,7 +74,7 @@ typedef enum {
|
||||
} save_complete_event_type;
|
||||
|
||||
|
||||
static bool save_complete_save_html(save_complete_ctx *ctx, hlcache_handle *c,
|
||||
static bool save_complete_save_html(save_complete_ctx *ctx, struct hlcache_handle *c,
|
||||
bool index);
|
||||
static bool save_complete_save_imported_sheets(save_complete_ctx *ctx,
|
||||
struct nscss_import *imports, uint32_t import_count);
|
||||
@ -99,7 +100,7 @@ static void save_complete_ctx_finalise(save_complete_ctx *ctx)
|
||||
}
|
||||
|
||||
static bool save_complete_ctx_add_content(save_complete_ctx *ctx,
|
||||
hlcache_handle *content)
|
||||
struct hlcache_handle *content)
|
||||
{
|
||||
save_complete_entry *entry;
|
||||
|
||||
@ -114,24 +115,32 @@ static bool save_complete_ctx_add_content(save_complete_ctx *ctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
static hlcache_handle *save_complete_ctx_find_content(save_complete_ctx *ctx,
|
||||
const nsurl *url)
|
||||
/**
|
||||
* find handle to content for url
|
||||
*
|
||||
* \param ctx The save context
|
||||
* \param url The url to find content handle for
|
||||
* \return The content handle or NULL if not found.
|
||||
*/
|
||||
static struct hlcache_handle *
|
||||
save_complete_ctx_find_content(save_complete_ctx *ctx, const nsurl *url)
|
||||
{
|
||||
save_complete_entry *entry;
|
||||
|
||||
for (entry = ctx->list; entry != NULL; entry = entry->next)
|
||||
for (entry = ctx->list; entry != NULL; entry = entry->next) {
|
||||
if (nsurl_compare(url,
|
||||
hlcache_handle_get_url(entry->content),
|
||||
NSURL_COMPLETE))
|
||||
hlcache_handle_get_url(entry->content),
|
||||
NSURL_COMPLETE)) {
|
||||
return entry->content;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static bool save_complete_ctx_has_content(save_complete_ctx *ctx,
|
||||
hlcache_handle *content)
|
||||
struct hlcache_handle *content)
|
||||
{
|
||||
save_complete_entry *entry;
|
||||
|
||||
|
@ -31,8 +31,7 @@
|
||||
#include "utils/log.h"
|
||||
#include "utils/utf8.h"
|
||||
#include "utils/utils.h"
|
||||
#include "content/content.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "render/box.h"
|
||||
#include "render/html.h"
|
||||
|
||||
@ -55,7 +54,7 @@ static bool save_text_add_to_buffer(const char *text, size_t length,
|
||||
* \param path Path to save text file too.
|
||||
*/
|
||||
|
||||
void save_as_text(hlcache_handle *c, char *path)
|
||||
void save_as_text(struct hlcache_handle *c, char *path)
|
||||
{
|
||||
FILE *out;
|
||||
struct save_text_state save = { NULL, 0, 0 };
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "utils/log.h"
|
||||
#include "utils/url.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/hlcache.h"
|
||||
|
||||
#include "desktop/searchweb.h"
|
||||
|
@ -23,7 +23,9 @@
|
||||
*/
|
||||
|
||||
#include "utils/log.h"
|
||||
#include "utils/nsurl.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "content/handlers/css/utils.h"
|
||||
|
||||
@ -3634,8 +3636,10 @@ static void treeview_init_plot_styles(int font_pt_size)
|
||||
/**
|
||||
* Callback for hlcache.
|
||||
*/
|
||||
static nserror treeview_res_cb(hlcache_handle *handle,
|
||||
const hlcache_event *event, void *pw)
|
||||
static nserror
|
||||
treeview_res_cb(struct hlcache_handle *handle,
|
||||
const hlcache_event *event,
|
||||
void *pw)
|
||||
{
|
||||
struct treeview_resource *r = pw;
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "utils/log.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/nsurl.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "desktop/version.h"
|
||||
|
||||
@ -331,7 +331,7 @@ STATIC VOID rx_save(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu
|
||||
|
||||
if((fh = FOpen((char *)cmd->ac_ArgList[0], MODE_NEWFILE, 0)))
|
||||
{
|
||||
hlcache_handle *h = browser_window_get_content(gw->bw);
|
||||
struct hlcache_handle *h = browser_window_get_content(gw->bw);
|
||||
if((source_data = content_get_source_data(h, &source_size)))
|
||||
FWrite(fh, source_data, 1, source_size);
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "amiga/os3support.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <proto/exec.h>
|
||||
#ifdef __amigaos4__
|
||||
#include <graphics/blitattr.h>
|
||||
@ -46,8 +47,8 @@
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/nsurl.h"
|
||||
#include "utils/messages.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "netsurf/content.h"
|
||||
|
||||
#include "amiga/gui.h"
|
||||
#include "amiga/bitmap.h"
|
||||
@ -596,7 +597,7 @@ void ami_bitmap_fini(void)
|
||||
pool_bitmap = NULL;
|
||||
}
|
||||
|
||||
static nserror bitmap_render(struct bitmap *bitmap, hlcache_handle *content)
|
||||
static nserror bitmap_render(struct bitmap *bitmap, struct hlcache_handle *content)
|
||||
{
|
||||
#ifdef __amigaos4__
|
||||
struct redraw_context ctx = {
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/utf8.h"
|
||||
#include "utils/nsurl.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "desktop/textinput.h"
|
||||
|
@ -40,10 +40,10 @@
|
||||
#include "utils/messages.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/nsurl.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "desktop/browser_history.h"
|
||||
#include "netsurf/mouse.h"
|
||||
#include "desktop/browser_history.h"
|
||||
#include "desktop/searchweb.h"
|
||||
#include "desktop/textinput.h"
|
||||
|
||||
|
@ -48,13 +48,13 @@
|
||||
#include "utils/utils.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/string.h"
|
||||
#include "desktop/download.h"
|
||||
#include "desktop/save_complete.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/mouse.h"
|
||||
#include "netsurf/window.h"
|
||||
#include "netsurf/download.h"
|
||||
#include "content/handlers/image/ico.h"
|
||||
#include "desktop/download.h"
|
||||
#include "desktop/save_complete.h"
|
||||
|
||||
#include "amiga/gui.h"
|
||||
#include "amiga/download.h"
|
||||
|
@ -34,8 +34,8 @@
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "netsurf/mouse.h"
|
||||
#include "netsurf/content.h"
|
||||
|
||||
#include "amiga/bitmap.h"
|
||||
#include "amiga/clipboard.h"
|
||||
@ -178,7 +178,7 @@ void ami_drag_save(struct Window *win)
|
||||
|
||||
case GUI_SAVE_OBJECT_NATIVE:
|
||||
{
|
||||
hlcache_handle *c = drag_save_data;
|
||||
struct hlcache_handle *c = drag_save_data;
|
||||
AddPart(path, content_get_title(c), 1024);
|
||||
|
||||
ami_file_save(AMINS_SAVE_IFF, path, win, c, NULL, NULL);
|
||||
|
@ -37,9 +37,11 @@
|
||||
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "content/llcache.h"
|
||||
|
||||
#include "amiga/bitmap.h"
|
||||
#include "amiga/filetype.h"
|
||||
|
@ -33,9 +33,10 @@
|
||||
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "content/llcache.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "content/handlers/image/image_cache.h"
|
||||
|
||||
#include "amiga/bitmap.h"
|
||||
|
@ -23,20 +23,24 @@
|
||||
#ifdef WITH_AMIGA_DATATYPES
|
||||
#include "amiga/os3support.h"
|
||||
|
||||
#include "amiga/filetype.h"
|
||||
#include "amiga/datatypes.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "render/box.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
|
||||
#include <proto/datatypes.h>
|
||||
#include <proto/dos.h>
|
||||
#include <proto/intuition.h>
|
||||
#include <datatypes/soundclass.h>
|
||||
#include <intuition/classusr.h>
|
||||
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "render/box.h"
|
||||
#include "content/llcache.h"
|
||||
#include "content/content_protected.h"
|
||||
|
||||
#include "amiga/filetype.h"
|
||||
#include "amiga/datatypes.h"
|
||||
|
||||
|
||||
typedef struct amiga_dt_sound_content {
|
||||
struct content base;
|
||||
|
||||
|
@ -26,14 +26,12 @@
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/file.h"
|
||||
#include "utils/messages.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "content/content.h"
|
||||
#include "content/fetch.h"
|
||||
#include "utils/nsurl.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "desktop/save_complete.h"
|
||||
#include "desktop/save_pdf.h"
|
||||
#include "desktop/save_text.h"
|
||||
#include "netsurf/window.h"
|
||||
|
||||
#include "amiga/gui.h"
|
||||
#include "amiga/bitmap.h"
|
||||
|
@ -20,19 +20,20 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "amiga/filetype.h"
|
||||
#include "amiga/misc.h"
|
||||
#include "amiga/object.h"
|
||||
#include "content/fetch.h"
|
||||
#include "content/content.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/utils.h"
|
||||
#include <proto/icon.h>
|
||||
#include <proto/dos.h>
|
||||
#include <proto/datatypes.h>
|
||||
#include <proto/exec.h>
|
||||
#include <workbench/icon.h>
|
||||
|
||||
#include "netsurf/content.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
#include "amiga/filetype.h"
|
||||
#include "amiga/misc.h"
|
||||
#include "amiga/object.h"
|
||||
|
||||
/**
|
||||
* filetype -- determine the MIME type of a local file
|
||||
*/
|
||||
|
@ -18,12 +18,14 @@
|
||||
|
||||
#ifndef AMIGA_FILETYPE_H
|
||||
#define AMIGA_FILETYPE_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <libwapcaplet/libwapcaplet.h>
|
||||
#include "content/content_type.h"
|
||||
#include "utils/errors.h"
|
||||
#include <datatypes/datatypes.h>
|
||||
|
||||
#include "netsurf/content_type.h"
|
||||
#include "utils/errors.h"
|
||||
|
||||
struct hlcache_handle;
|
||||
struct ami_mime_entry;
|
||||
|
||||
|
@ -86,6 +86,7 @@
|
||||
/* newlib includes */
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* NetSurf core includes */
|
||||
#include "utils/log.h"
|
||||
@ -95,26 +96,24 @@
|
||||
#include "utils/utils.h"
|
||||
#include "utils/nsurl.h"
|
||||
#include "utils/file.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "content/backing_store.h"
|
||||
#include "content/fetchers.h"
|
||||
#include "content/fetchers/resource.h"
|
||||
#include "content/urldb.h"
|
||||
#include "content/handlers/image/ico.h"
|
||||
#include "desktop/browser_history.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "desktop/hotlist.h"
|
||||
#include "netsurf/window.h"
|
||||
#include "netsurf/fetch.h"
|
||||
#include "netsurf/misc.h"
|
||||
#include "netsurf/mouse.h"
|
||||
#include "netsurf/netsurf.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "content/backing_store.h"
|
||||
#include "content/fetchers.h"
|
||||
#include "content/urldb.h"
|
||||
#include "desktop/browser_history.h"
|
||||
#include "desktop/hotlist.h"
|
||||
#include "desktop/version.h"
|
||||
#include "desktop/save_complete.h"
|
||||
#include "desktop/scrollbar.h"
|
||||
#include "desktop/searchweb.h"
|
||||
#include "desktop/textinput.h"
|
||||
#include "desktop/tree.h"
|
||||
#include "netsurf/window.h"
|
||||
#include "netsurf/fetch.h"
|
||||
#include "netsurf/misc.h"
|
||||
|
||||
/* NetSurf Amiga platform includes */
|
||||
#include "amiga/gui.h"
|
||||
@ -848,12 +847,14 @@ static struct RDArgs *ami_gui_commandline(int *argc, char **argv, int *nargc, ch
|
||||
|
||||
if((args = ReadArgs(template, rarray, NULL))) {
|
||||
if(rarray[A_URL]) {
|
||||
LOG("URL %s specified on command line", rarray[A_URL]);
|
||||
LOG("URL %s specified on command line",
|
||||
(char *)rarray[A_URL]);
|
||||
temp_homepage_url = ami_to_utf8_easy((char *)rarray[A_URL]);
|
||||
}
|
||||
|
||||
if(rarray[A_USERSDIR]) {
|
||||
LOG("USERSDIR %s specified on command line", rarray[A_USERSDIR]);
|
||||
LOG("USERSDIR %s specified on command line",
|
||||
(char *)rarray[A_USERSDIR]);
|
||||
users_dir = ASPrintf("%s", rarray[A_USERSDIR]);
|
||||
}
|
||||
|
||||
@ -1751,7 +1752,7 @@ static void ami_gui_scroller_update(struct gui_window_2 *gwin)
|
||||
/**
|
||||
* function to add retrieved favicon to gui
|
||||
*/
|
||||
static void gui_window_set_icon(struct gui_window *g, hlcache_handle *icon)
|
||||
static void gui_window_set_icon(struct gui_window *g, struct hlcache_handle *icon)
|
||||
{
|
||||
struct BitMap *bm = NULL;
|
||||
struct IBox *bbox;
|
||||
@ -5216,7 +5217,7 @@ static void gui_window_remove_caret(struct gui_window *g)
|
||||
|
||||
static void gui_window_new_content(struct gui_window *g)
|
||||
{
|
||||
hlcache_handle *c;
|
||||
struct hlcache_handle *c;
|
||||
|
||||
if(g && g->shared && g->bw && browser_window_has_content(g->bw))
|
||||
c = browser_window_get_content(g->bw);
|
||||
@ -5399,7 +5400,7 @@ void ami_gui_splash_close(Object *win_obj)
|
||||
DisposeObject(win_obj);
|
||||
}
|
||||
|
||||
static void gui_file_gadget_open(struct gui_window *g, hlcache_handle *hl,
|
||||
static void gui_file_gadget_open(struct gui_window *g, struct hlcache_handle *hl,
|
||||
struct form_control *gadget)
|
||||
{
|
||||
LOG("File open dialog request for %p/%p", g, gadget);
|
||||
|
@ -78,6 +78,7 @@
|
||||
#include "amiga/selectmenu.h"
|
||||
#include "amiga/theme.h"
|
||||
#include "amiga/utf8.h"
|
||||
#include "amiga/plotters.h"
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "utils/file.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/content_protected.h"
|
||||
|
||||
#include "amiga/os3support.h"
|
||||
@ -66,7 +67,7 @@ typedef struct amiga_icon_content {
|
||||
|
||||
static nserror amiga_icon_create(const content_handler *handler,
|
||||
lwc_string *imime_type, const struct http_parameter *params,
|
||||
llcache_handle *llcache, const char *fallback_charset,
|
||||
struct llcache_handle *llcache, const char *fallback_charset,
|
||||
bool quirks, struct content **c);
|
||||
static bool amiga_icon_convert(struct content *c);
|
||||
static void amiga_icon_destroy(struct content *c);
|
||||
@ -104,7 +105,7 @@ CONTENT_FACTORY_REGISTER_TYPES(amiga_icon, amiga_icon_types,
|
||||
|
||||
nserror amiga_icon_create(const content_handler *handler,
|
||||
lwc_string *imime_type, const struct http_parameter *params,
|
||||
llcache_handle *llcache, const char *fallback_charset,
|
||||
struct llcache_handle *llcache, const char *fallback_charset,
|
||||
bool quirks, struct content **c)
|
||||
{
|
||||
amiga_icon_content *ai_content;
|
||||
|
@ -26,10 +26,11 @@
|
||||
#include <proto/dos.h>
|
||||
|
||||
#ifndef AMIGA_DR2D_STANDALONE
|
||||
#include "utils/nsurl.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "amiga/os3support.h"
|
||||
#include "amiga/iff_dr2d.h"
|
||||
#include "amiga/misc.h"
|
||||
#include "content/hlcache.h"
|
||||
#else
|
||||
#include "os3support.h"
|
||||
#include "iff_dr2d.h"
|
||||
|
@ -47,11 +47,11 @@
|
||||
#include "utils/log.h"
|
||||
#include "utils/utils.h"
|
||||
#include "utils/nsurl.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "desktop/hotlist.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/mouse.h"
|
||||
#include "netsurf/window.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "desktop/hotlist.h"
|
||||
#include "desktop/textinput.h"
|
||||
#include "desktop/version.h"
|
||||
|
||||
@ -1076,7 +1076,7 @@ void ami_menu_update_checked(struct gui_window_2 *gwin)
|
||||
ResetMenuStrip(gwin->win, menustrip);
|
||||
}
|
||||
|
||||
void ami_menu_update_disabled(struct gui_window *g, hlcache_handle *c)
|
||||
void ami_menu_update_disabled(struct gui_window *g, struct hlcache_handle *c)
|
||||
{
|
||||
struct Window *win = g->shared->win;
|
||||
|
||||
|
@ -23,20 +23,21 @@
|
||||
#include "amiga/os3support.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "amiga/filetype.h"
|
||||
#include "amiga/plugin_hack.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
|
||||
#include <proto/dos.h>
|
||||
#include <proto/exec.h>
|
||||
#include <proto/intuition.h>
|
||||
#include <proto/utility.h>
|
||||
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "amiga/filetype.h"
|
||||
#include "amiga/plugin_hack.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "content/llcache.h"
|
||||
|
||||
|
||||
typedef struct amiga_plugin_hack_content {
|
||||
struct content base;
|
||||
} amiga_plugin_hack_content;
|
||||
|
@ -49,13 +49,14 @@
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
#include "utils/nsurl.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "desktop/printer.h"
|
||||
#include "desktop/print.h"
|
||||
#include "netsurf/layout.h"
|
||||
#include "netsurf/mouse.h"
|
||||
#include "netsurf/window.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "desktop/printer.h"
|
||||
#include "desktop/print.h"
|
||||
|
||||
#include "amiga/plotters.h"
|
||||
#include "amiga/font.h"
|
||||
|
@ -53,13 +53,13 @@
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/utils.h"
|
||||
#include "utils/messages.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/window.h"
|
||||
#include "content/urldb.h"
|
||||
#include "content/llcache.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "desktop/cookie_manager.h"
|
||||
#include "desktop/global_history.h"
|
||||
#include "desktop/hotlist.h"
|
||||
#include "netsurf/window.h"
|
||||
#include "desktop/sslcert_viewer.h"
|
||||
|
||||
#include "amiga/gui.h"
|
||||
|
@ -19,9 +19,10 @@
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/nsurl.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "desktop/textinput.h"
|
||||
#include "content/hlcache.h"
|
||||
|
||||
#include "atari/gui.h"
|
||||
#include "atari/misc.h"
|
||||
@ -50,7 +51,7 @@ struct s_context_info ctxinfo;
|
||||
|
||||
static struct s_context_info * get_context_info( struct gui_window * gw, short mx, short my )
|
||||
{
|
||||
hlcache_handle *h;
|
||||
struct hlcache_handle *h;
|
||||
GRECT area;
|
||||
struct browser_window * bw = gw->browser->bw;
|
||||
int sx, sy;
|
||||
|
@ -29,11 +29,6 @@
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/corestrings.h"
|
||||
#include "content/urldb.h"
|
||||
#include "content/content.h"
|
||||
#include "content/backing_store.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "desktop/treeview.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/layout.h"
|
||||
#include "netsurf/window.h"
|
||||
@ -41,6 +36,11 @@
|
||||
#include "netsurf/fetch.h"
|
||||
#include "netsurf/misc.h"
|
||||
#include "netsurf/netsurf.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/urldb.h"
|
||||
#include "content/backing_store.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "desktop/treeview.h"
|
||||
|
||||
#include "atari/gemtk/gemtk.h"
|
||||
#include "atari/gui.h"
|
||||
|
@ -38,11 +38,11 @@
|
||||
|
||||
extern "C" {
|
||||
#include "utils/log.h"
|
||||
#include "content/content.h"
|
||||
#include "content/urldb.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/urldb.h"
|
||||
}
|
||||
|
||||
#include "beos/bitmap.h"
|
||||
|
@ -27,7 +27,7 @@
|
||||
#import "netsurf/plotters.h"
|
||||
#import "netsurf/bitmap.h"
|
||||
#import "content/urldb.h"
|
||||
#import "content/content.h"
|
||||
#import "netsurf/content.h"
|
||||
|
||||
#import "cocoa/plotter.h"
|
||||
#import "cocoa/bitmap.h"
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "utils/utils.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "content/content.h"
|
||||
#include "netsurf/content.h"
|
||||
|
||||
#include "framebuffer/gui.h"
|
||||
#include "framebuffer/fbtk.h"
|
||||
|
@ -31,8 +31,8 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "utils/utils.h"
|
||||
#include "utils/log.h"
|
||||
#include "content/content.h"
|
||||
#include "utils/errors.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "netsurf/plotters.h"
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
|
||||
@ -33,6 +34,8 @@
|
||||
#include "utils/log.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/file.h"
|
||||
#include "utils/nsurl.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "desktop/browser_history.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "desktop/hotlist.h"
|
||||
@ -46,7 +49,7 @@
|
||||
#include "desktop/save_text.h"
|
||||
#include "desktop/searchweb.h"
|
||||
#include "desktop/textinput.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "desktop/search.h"
|
||||
|
||||
#include "gtk/compat.h"
|
||||
#include "gtk/warn.h"
|
||||
|
@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "utils/utils.h"
|
||||
@ -24,7 +25,7 @@
|
||||
#include "utils/nsurl.h"
|
||||
#include "utils/messages.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "content/content.h"
|
||||
#include "netsurf/content.h"
|
||||
|
||||
#include "gtk/viewdata.h"
|
||||
#include "gtk/viewsource.h"
|
||||
|
@ -36,17 +36,17 @@
|
||||
#include "utils/utf8.h"
|
||||
#include "utils/utils.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "gtk/window.h"
|
||||
#include "gtk/selection.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/mouse.h"
|
||||
#include "desktop/searchweb.h"
|
||||
#include "desktop/textinput.h"
|
||||
#include "netsurf/window.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "desktop/searchweb.h"
|
||||
#include "desktop/textinput.h"
|
||||
#include "render/form.h"
|
||||
|
||||
#include "gtk/window.h"
|
||||
#include "gtk/selection.h"
|
||||
#include "gtk/warn.h"
|
||||
#include "gtk/compat.h"
|
||||
#include "gtk/gui.h"
|
||||
@ -947,7 +947,7 @@ static void gui_window_destroy(struct gui_window *g)
|
||||
* \param gw gtk gui window to set favicon on.
|
||||
* \param icon A handle to the new favicon content.
|
||||
*/
|
||||
static void gui_window_set_icon(struct gui_window *gw, hlcache_handle *icon)
|
||||
static void gui_window_set_icon(struct gui_window *gw, struct hlcache_handle *icon)
|
||||
{
|
||||
struct bitmap *icon_bitmap = NULL;
|
||||
|
||||
@ -1277,7 +1277,7 @@ static void gui_window_create_form_select_menu(struct gui_window *g,
|
||||
|
||||
static void
|
||||
gui_window_file_gadget_open(struct gui_window *g,
|
||||
hlcache_handle *hl,
|
||||
struct hlcache_handle *hl,
|
||||
struct form_control *gadget)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
@ -44,8 +44,8 @@
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "content/content.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "netsurf/content.h"
|
||||
|
||||
#include "riscos/gui.h"
|
||||
#include "riscos/image.h"
|
||||
|
@ -36,8 +36,10 @@
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "content/llcache.h"
|
||||
|
||||
#include "riscos/content-handlers/artworks.h"
|
||||
#include "riscos/gui.h"
|
||||
|
@ -33,8 +33,10 @@
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "content/llcache.h"
|
||||
|
||||
#include "riscos/content-handlers/draw.h"
|
||||
#include "riscos/gui.h"
|
||||
|
@ -32,8 +32,10 @@
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/llcache.h"
|
||||
#include "content/content_protected.h"
|
||||
|
||||
#include "riscos/gui.h"
|
||||
#include "riscos/image.h"
|
||||
|
@ -24,9 +24,7 @@
|
||||
|
||||
#include "utils/config.h"
|
||||
#include "utils/log.h"
|
||||
#include "content/content.h"
|
||||
#include "content/fetch.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "netsurf/content.h"
|
||||
|
||||
#include "riscos/filetype.h"
|
||||
#include "riscos/gui.h"
|
||||
@ -232,7 +230,7 @@ int cmp_type(const void *x, const void *y)
|
||||
}
|
||||
|
||||
/* exported interface documented in riscos/filetype.h */
|
||||
int ro_content_filetype(hlcache_handle *c)
|
||||
int ro_content_filetype(struct hlcache_handle *c)
|
||||
{
|
||||
lwc_string *mime_type;
|
||||
int file_type;
|
||||
@ -252,7 +250,7 @@ int ro_content_filetype(hlcache_handle *c)
|
||||
|
||||
|
||||
/* exported interface documented in riscos/filetype.h */
|
||||
int ro_content_native_type(hlcache_handle *c)
|
||||
int ro_content_native_type(struct hlcache_handle *c)
|
||||
{
|
||||
switch (ro_content_filetype(c)) {
|
||||
case FILETYPE_JPEG: /* jpeg */
|
||||
|
@ -23,7 +23,7 @@
|
||||
#ifndef _NETSURF_RISCOS_FILETYPE_H_
|
||||
#define _NETSURF_RISCOS_FILETYPE_H_
|
||||
|
||||
#include "content/content_type.h"
|
||||
#include "netsurf/content_type.h"
|
||||
|
||||
#ifndef FILETYPE_ACORN_URI
|
||||
#define FILETYPE_ACORN_URI 0xf91
|
||||
|
@ -49,12 +49,12 @@
|
||||
#include "utils/corestrings.h"
|
||||
#include "netsurf/fetch.h"
|
||||
#include "netsurf/misc.h"
|
||||
#include "desktop/save_complete.h"
|
||||
#include "desktop/treeview.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "netsurf/netsurf.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "desktop/save_complete.h"
|
||||
#include "desktop/treeview.h"
|
||||
#include "content/urldb.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "content/backing_store.h"
|
||||
|
||||
#include "riscos/gui.h"
|
||||
@ -1935,7 +1935,7 @@ static void ro_gui_view_source_bounce(wimp_message *message)
|
||||
/**
|
||||
* Send the source of a content to a text editor.
|
||||
*/
|
||||
void ro_gui_view_source(hlcache_handle *c)
|
||||
void ro_gui_view_source(struct hlcache_handle *c)
|
||||
{
|
||||
os_error *error;
|
||||
char *temp_name;
|
||||
|
@ -17,8 +17,9 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* URL bars (implementation).
|
||||
/**
|
||||
* \file
|
||||
* RISC OS URL bar implementation.
|
||||
*/
|
||||
|
||||
#include <alloca.h>
|
||||
@ -35,15 +36,14 @@
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utf8.h"
|
||||
#include "utils/utils.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "content/content.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/hlcache.h"
|
||||
|
||||
#include "riscos/gui.h"
|
||||
#include "riscos/hotlist.h"
|
||||
#include "riscos/gui/url_bar.h"
|
||||
#include "riscos/theme.h"
|
||||
#include "riscos/url_suggest.h"
|
||||
#include "riscos/wimp.h"
|
||||
#include "riscos/wimp_event.h"
|
||||
|
@ -36,10 +36,10 @@
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "content/content.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/content.h"
|
||||
|
||||
#include "riscos/gui.h"
|
||||
#include "riscos/dialog.h"
|
||||
@ -101,10 +101,10 @@ void gui_window_redraw_window(struct gui_window *g);
|
||||
static bool ro_gui_print_click(wimp_pointer *pointer);
|
||||
static bool ro_gui_print_apply(wimp_w w);
|
||||
static void print_update_sheets_shaded_state(bool on);
|
||||
static void print_send_printsave(hlcache_handle *h);
|
||||
static void print_send_printsave(struct hlcache_handle *h);
|
||||
static bool print_send_printtypeknown(wimp_message *m);
|
||||
static bool print_document(struct gui_window *g, const char *filename);
|
||||
static const char *print_declare_fonts(hlcache_handle *h);
|
||||
static const char *print_declare_fonts(struct hlcache_handle *h);
|
||||
static bool print_fonts_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style);
|
||||
static bool print_fonts_plot_line(int x0, int y0, int x1, int y1, const plot_style_t *style);
|
||||
static bool print_fonts_plot_polygon(const int *p, unsigned int n, const plot_style_t *style);
|
||||
@ -312,7 +312,7 @@ void print_update_sheets_shaded_state(bool on)
|
||||
* \param h handle to content to print.
|
||||
*/
|
||||
|
||||
void print_send_printsave(hlcache_handle *h)
|
||||
void print_send_printsave(struct hlcache_handle *h)
|
||||
{
|
||||
wimp_full_message_data_xfer m;
|
||||
os_error *e;
|
||||
@ -546,7 +546,7 @@ bool print_document(struct gui_window *g, const char *filename)
|
||||
int left, right, top, bottom, width, height;
|
||||
int saved_width, saved_height;
|
||||
int yscroll = 0, sheets = print_max_sheets;
|
||||
hlcache_handle *h = browser_window_get_content(g->bw);
|
||||
struct hlcache_handle *h = browser_window_get_content(g->bw);
|
||||
const char *error_message;
|
||||
pdriver_features features;
|
||||
os_fw fhandle, old_job = 0;
|
||||
@ -788,7 +788,7 @@ error:
|
||||
* \return 0 on success, error message on error
|
||||
*/
|
||||
|
||||
const char *print_declare_fonts(hlcache_handle *h)
|
||||
const char *print_declare_fonts(struct hlcache_handle *h)
|
||||
{
|
||||
unsigned int i;
|
||||
struct rect clip;
|
||||
|
@ -40,8 +40,8 @@
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utf8.h"
|
||||
#include "content/content.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "utils/nsurl.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "desktop/hotlist.h"
|
||||
#include "desktop/global_history.h"
|
||||
@ -81,7 +81,7 @@
|
||||
now since we could have multiple saves outstanding */
|
||||
|
||||
static gui_save_type gui_save_current_type;
|
||||
static hlcache_handle *gui_save_content = NULL;
|
||||
static struct hlcache_handle *gui_save_content = NULL;
|
||||
static char *gui_save_selection = NULL;
|
||||
static const char *gui_save_url = NULL;
|
||||
static const char *gui_save_title = NULL;
|
||||
@ -105,17 +105,17 @@ static size_t save_dir_len;
|
||||
|
||||
typedef enum { LINK_ACORN, LINK_ANT, LINK_TEXT } link_format;
|
||||
|
||||
static bool ro_gui_save_complete(hlcache_handle *h, char *path);
|
||||
static bool ro_gui_save_content(hlcache_handle *h, char *path, bool force_overwrite);
|
||||
static bool ro_gui_save_complete(struct hlcache_handle *h, char *path);
|
||||
static bool ro_gui_save_content(struct hlcache_handle *h, char *path, bool force_overwrite);
|
||||
static void ro_gui_save_done(void);
|
||||
static void ro_gui_save_bounced(wimp_message *message);
|
||||
static bool ro_gui_save_object_native(hlcache_handle *h, char *path);
|
||||
static bool ro_gui_save_object_native(struct hlcache_handle *h, char *path);
|
||||
static bool ro_gui_save_link(const char *url, const char *title, link_format format, char *path);
|
||||
static void ro_gui_save_set_state(hlcache_handle *h, gui_save_type save_type,
|
||||
static void ro_gui_save_set_state(struct hlcache_handle *h, gui_save_type save_type,
|
||||
const nsurl *url, char *leaf_buf, size_t leaf_len,
|
||||
char *icon_buf, size_t icon_len);
|
||||
static void ro_gui_save_drag_end(wimp_dragged *drag, void *data);
|
||||
static bool ro_gui_save_create_thumbnail(hlcache_handle *h, const char *name);
|
||||
static bool ro_gui_save_create_thumbnail(struct hlcache_handle *h, const char *name);
|
||||
static void ro_gui_save_overwrite_confirmed(query_id, enum query_response res, void *p);
|
||||
static void ro_gui_save_overwrite_cancelled(query_id, enum query_response res, void *p);
|
||||
|
||||
@ -247,7 +247,7 @@ void ro_gui_saveas_quit(void)
|
||||
* \param title title (if any), when saving links
|
||||
*/
|
||||
|
||||
void ro_gui_save_prepare(gui_save_type save_type, hlcache_handle *h,
|
||||
void ro_gui_save_prepare(gui_save_type save_type, struct hlcache_handle *h,
|
||||
char *s, const nsurl *url, const char *title)
|
||||
{
|
||||
char name_buf[FILENAME_MAX];
|
||||
@ -364,7 +364,7 @@ bool ro_gui_save_ok(wimp_w w)
|
||||
* \param g gui window
|
||||
*/
|
||||
|
||||
void gui_drag_save_object(struct gui_window *g, hlcache_handle *c,
|
||||
void gui_drag_save_object(struct gui_window *g, struct hlcache_handle *c,
|
||||
gui_save_type save_type)
|
||||
{
|
||||
wimp_pointer pointer;
|
||||
@ -741,7 +741,7 @@ void ro_gui_save_bounced(wimp_message *message)
|
||||
void ro_gui_save_datasave_ack(wimp_message *message)
|
||||
{
|
||||
char *path = message->data.data_xfer.file_name;
|
||||
hlcache_handle *h = gui_save_content;
|
||||
struct hlcache_handle *h = gui_save_content;
|
||||
bool force_overwrite;
|
||||
|
||||
switch (gui_save_current_type) {
|
||||
@ -793,7 +793,7 @@ void ro_gui_save_datasave_ack(wimp_message *message)
|
||||
* or (ii) deferred awaiting user confirmation
|
||||
*/
|
||||
|
||||
bool ro_gui_save_content(hlcache_handle *h, char *path, bool force_overwrite)
|
||||
bool ro_gui_save_content(struct hlcache_handle *h, char *path, bool force_overwrite)
|
||||
{
|
||||
os_error *error;
|
||||
const char *source_data;
|
||||
@ -1008,7 +1008,7 @@ static void ro_gui_save_set_file_type(const char *path, lwc_string *mime_type)
|
||||
* \return true on success, false on error and error reported
|
||||
*/
|
||||
|
||||
bool ro_gui_save_complete(hlcache_handle *h, char *path)
|
||||
bool ro_gui_save_complete(struct hlcache_handle *h, char *path)
|
||||
{
|
||||
void *spr = ((byte *) saveas_area) + saveas_area->first;
|
||||
osspriteop_header *sprite = (osspriteop_header *) spr;
|
||||
@ -1093,7 +1093,7 @@ bool ro_gui_save_complete(hlcache_handle *h, char *path)
|
||||
return save_complete(h, path, ro_gui_save_set_file_type);
|
||||
}
|
||||
|
||||
bool ro_gui_save_object_native(hlcache_handle *h, char *path)
|
||||
bool ro_gui_save_object_native(struct hlcache_handle *h, char *path)
|
||||
{
|
||||
int file_type = ro_content_filetype(h);
|
||||
|
||||
@ -1200,7 +1200,7 @@ bool ro_gui_save_link(const char *url, const char *title, link_format format,
|
||||
* \param icon_len size of buffer to receive icon name.
|
||||
*/
|
||||
|
||||
void ro_gui_save_set_state(hlcache_handle *h, gui_save_type save_type,
|
||||
void ro_gui_save_set_state(struct hlcache_handle *h, gui_save_type save_type,
|
||||
const nsurl *url, char *leaf_buf, size_t leaf_len,
|
||||
char *icon_buf, size_t icon_len)
|
||||
{
|
||||
@ -1338,7 +1338,7 @@ void ro_gui_save_set_state(hlcache_handle *h, gui_save_type save_type,
|
||||
* \return true iff successful
|
||||
*/
|
||||
|
||||
bool ro_gui_save_create_thumbnail(hlcache_handle *h, const char *name)
|
||||
bool ro_gui_save_create_thumbnail(struct hlcache_handle *h, const char *name)
|
||||
{
|
||||
osspriteop_header *sprite_header;
|
||||
struct bitmap *bitmap;
|
||||
|
@ -32,9 +32,8 @@
|
||||
|
||||
#include "utils/log.h"
|
||||
#include "utils/utils.h"
|
||||
#include "content/content.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/content.h"
|
||||
|
||||
#include "riscos/bitmap.h"
|
||||
#include "riscos/gui.h"
|
||||
@ -87,7 +86,7 @@ static int ro_save_draw_height;
|
||||
* \return true on success, false on error and error reported
|
||||
*/
|
||||
|
||||
bool save_as_draw(hlcache_handle *h, const char *path)
|
||||
bool save_as_draw(struct hlcache_handle *h, const char *path)
|
||||
{
|
||||
pencil_code code;
|
||||
char *drawfile_buffer;
|
||||
|
@ -31,10 +31,9 @@
|
||||
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "content/content.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/search.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "desktop/search.h"
|
||||
|
||||
#include "riscos/gui.h"
|
||||
@ -269,7 +268,7 @@ bool ro_gui_search_prepare_menu(void)
|
||||
*/
|
||||
static bool ro_gui_search_bw_searchable(struct browser_window *bw)
|
||||
{
|
||||
hlcache_handle *h;
|
||||
struct hlcache_handle *h;
|
||||
|
||||
assert(bw != NULL);
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "content/content.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "desktop/theme.h"
|
||||
|
||||
|
@ -23,14 +23,13 @@
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <oslib/wimp.h>
|
||||
|
||||
#include "oslib/wimp.h"
|
||||
#include "content/content_type.h"
|
||||
#include "utils/messages.h"
|
||||
#include "content/urldb.h"
|
||||
|
||||
#include "riscos/menus.h"
|
||||
#include "riscos/url_suggest.h"
|
||||
#include "utils/messages.h"
|
||||
|
||||
struct url_suggest_item {
|
||||
const char *url; /*< The URL being stored. */
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include <oslib/wimpspriteop.h>
|
||||
#include <nsutils/time.h>
|
||||
|
||||
#include "utils/config.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/talloc.h"
|
||||
@ -52,20 +51,17 @@
|
||||
#include "utils/utils.h"
|
||||
#include "utils/messages.h"
|
||||
#include "utils/string.h"
|
||||
#include "content/content.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/window.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "content/urldb.h"
|
||||
#include "desktop/browser_history.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "desktop/cookie_manager.h"
|
||||
#include "desktop/scrollbar.h"
|
||||
#include "desktop/frames.h"
|
||||
#include "netsurf/mouse.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "desktop/textinput.h"
|
||||
#include "desktop/tree.h"
|
||||
#include "netsurf/window.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "render/form.h"
|
||||
|
||||
#include "riscos/bitmap.h"
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "utils/log.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "content/content.h"
|
||||
#include "netsurf/content.h"
|
||||
|
||||
#include "windows/plot.h"
|
||||
#include "windows/bitmap.h"
|
||||
|
188
include/netsurf/content.h
Normal file
188
include/netsurf/content.h
Normal file
@ -0,0 +1,188 @@
|
||||
/*
|
||||
* 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
|
||||
* Public content interface.
|
||||
*
|
||||
* The content functions manipulate content objects.
|
||||
*/
|
||||
|
||||
#ifndef _NETSURF_CONTENT_H_
|
||||
#define _NETSURF_CONTENT_H_
|
||||
|
||||
#include <libwapcaplet/libwapcaplet.h>
|
||||
|
||||
#include "desktop/plot_style.h" /* color typedef */
|
||||
#include "netsurf/content_type.h"
|
||||
|
||||
struct bitmap;
|
||||
struct hlcache_handle;
|
||||
struct rect;
|
||||
struct redraw_context;
|
||||
|
||||
/** parameters to content redraw */
|
||||
struct content_redraw_data {
|
||||
int x; /**< coordinate for top-left of redraw */
|
||||
int y; /**< coordinate for top-left of redraw */
|
||||
|
||||
/** dimensions to render content at (for scaling contents with
|
||||
* intrinsic dimensions)
|
||||
*/
|
||||
int width; /**< horizontal dimension */
|
||||
int height; /**< vertical dimension */
|
||||
|
||||
/** The background colour */
|
||||
colour background_colour;
|
||||
|
||||
/** Scale for redraw
|
||||
* (for scaling contents without intrinsic dimensions)
|
||||
*/
|
||||
float scale; /**< Scale factor for redraw */
|
||||
|
||||
bool repeat_x; /**< whether content is tiled in x direction */
|
||||
bool repeat_y; /**< whether content is tiled in y direction */
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve the bitmap contained in an image content
|
||||
*
|
||||
* \param h handle to the content.
|
||||
* \return Pointer to bitmap, or NULL if none.
|
||||
*/
|
||||
struct bitmap *content_get_bitmap(struct hlcache_handle *h);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve the encoding of a content
|
||||
*
|
||||
* \param h handle to the content.
|
||||
* \param op encoding operation.
|
||||
* \return Pointer to content info or NULL if none.
|
||||
*/
|
||||
const char *content_get_encoding(struct hlcache_handle *h, enum content_encoding_type op);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve mime-type of content
|
||||
*
|
||||
* \param h handle to the content to retrieve mime type from
|
||||
* \return Pointer to referenced mime type, or NULL if not found.
|
||||
*/
|
||||
lwc_string *content_get_mime_type(struct hlcache_handle *h);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve source of content
|
||||
*
|
||||
* \param h Content handle to retrieve source of
|
||||
* \param size Pointer to location to receive byte size of source
|
||||
* \return Pointer to source data
|
||||
*/
|
||||
const char *content_get_source_data(struct hlcache_handle *h, unsigned long *size);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve title associated with content
|
||||
*
|
||||
* \param h handle to the content to retrieve title from
|
||||
* \return Pointer to title, or NULL if not found.
|
||||
*/
|
||||
const char *content_get_title(struct hlcache_handle *h);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve computed type of content
|
||||
*
|
||||
* \param h handle to the content to retrieve type of.
|
||||
* \return Computed content type
|
||||
*/
|
||||
content_type content_get_type(struct hlcache_handle *h);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve width of content
|
||||
*
|
||||
* \param h handle to the content to get width of.
|
||||
* \return Content width
|
||||
*/
|
||||
int content_get_width(struct hlcache_handle *h);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve height of content
|
||||
*
|
||||
* \param h handle to the content to get height of.
|
||||
* \return Content height
|
||||
*/
|
||||
int content_get_height(struct hlcache_handle *h);
|
||||
|
||||
|
||||
/**
|
||||
* Invalidate content reuse data.
|
||||
*
|
||||
* causes subsequent requests for content URL to query server to
|
||||
* determine if content can be reused. This is required behaviour for
|
||||
* forced reloads etc.
|
||||
*
|
||||
* \param h Content handle to invalidate.
|
||||
*/
|
||||
void content_invalidate_reuse_data(struct hlcache_handle *h);
|
||||
|
||||
|
||||
/**
|
||||
* Display content on screen with optional tiling.
|
||||
*
|
||||
* \param h The content to redraw
|
||||
* \param ctx current redraw context
|
||||
* \return true if successful, false otherwise
|
||||
*
|
||||
* Calls the redraw function for the content.
|
||||
*/
|
||||
bool content_redraw(struct hlcache_handle *h, struct content_redraw_data *data, const struct rect *clip, const struct redraw_context *ctx);
|
||||
|
||||
|
||||
/**
|
||||
* Redraw a content with scale set for horizontal fit.
|
||||
*
|
||||
* Redraws the content at a specified width and height with the
|
||||
* content drawing scaled to fit within the area.
|
||||
*
|
||||
* \param h The content to redraw
|
||||
* \param width The target width
|
||||
* \param height The target height
|
||||
* \param ctx current redraw context
|
||||
* \return true if successful, false otherwise
|
||||
*
|
||||
* The thumbnail is guaranteed to be filled to its width/height extents, so
|
||||
* there is no need to render a solid background first.
|
||||
*
|
||||
* Units for width and height are pixels.
|
||||
*/
|
||||
bool content_scaled_redraw(struct hlcache_handle *h, int width, int height, const struct redraw_context *ctx);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve the URL associated with a high level cache handle
|
||||
*
|
||||
* \param handle The handle to inspect
|
||||
* \return Pointer to URL.
|
||||
*/
|
||||
struct nsurl *hlcache_handle_get_url(const struct hlcache_handle *handle);
|
||||
|
||||
#endif
|
@ -16,21 +16,41 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* Declaration of content_type enum.
|
||||
/**
|
||||
* \file
|
||||
* Declaration of content type enumerations.
|
||||
*
|
||||
* The content_type enum is defined here to prevent cyclic dependencies.
|
||||
* The content enumerations are defined here.
|
||||
*/
|
||||
|
||||
#ifndef _NETSURF_DESKTOP_CONTENT_TYPE_H_
|
||||
#define _NETSURF_DESKTOP_CONTENT_TYPE_H_
|
||||
#ifndef _NETSURF_CONTENT_TYPE_H_
|
||||
#define _NETSURF_CONTENT_TYPE_H_
|
||||
|
||||
/** Debugging dump operations */
|
||||
enum content_debug {
|
||||
CONTENT_DEBUG_RENDER, /** Debug the contents rendering. */
|
||||
CONTENT_DEBUG_DOM, /** Debug the contents Document Object. */
|
||||
CONTENT_DEBUG_REDRAW /** Debug redraw operations. */
|
||||
};
|
||||
|
||||
/** Content encoding information types */
|
||||
enum content_encoding_type {
|
||||
CONTENT_ENCODING_NORMAL, /** The content encoding */
|
||||
CONTENT_ENCODING_SOURCE /** The content encoding source */
|
||||
};
|
||||
|
||||
/** The type of a content. */
|
||||
typedef enum {
|
||||
/** no type for content */
|
||||
CONTENT_NONE = 0x00,
|
||||
|
||||
/** content is HTML */
|
||||
CONTENT_HTML = 0x01,
|
||||
|
||||
/** content is plain text */
|
||||
CONTENT_TEXTPLAIN = 0x02,
|
||||
|
||||
/** content is CSS */
|
||||
CONTENT_CSS = 0x04,
|
||||
|
||||
/** All images */
|
||||
@ -39,11 +59,12 @@ typedef enum {
|
||||
/** Navigator API Plugins */
|
||||
CONTENT_PLUGIN = 0x10,
|
||||
|
||||
/** Themes (only GTK and RISC OS) */
|
||||
/** RISC OS themes content */
|
||||
CONTENT_THEME = 0x20,
|
||||
|
||||
/** Javascript */
|
||||
CONTENT_JS = 0x40,
|
||||
|
||||
/** All script types. */
|
||||
CONTENT_SCRIPT = 0x40,
|
||||
|
@ -13,7 +13,7 @@ prologue Document()
|
||||
#include "utils/corestrings.h"
|
||||
#include "utils/libdom.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
#include "content/hlcache.h"
|
||||
#include "render/html_internal.h"
|
||||
#include "content/urldb.h"
|
||||
|
||||
|
@ -14,6 +14,7 @@ class Window {
|
||||
prologue %{
|
||||
#include "utils/nsurl.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "render/html.h"
|
||||
#include "render/html_internal.h"
|
||||
%};
|
||||
|
@ -33,12 +33,12 @@
|
||||
#include "utils/log.h"
|
||||
#include "utils/talloc.h"
|
||||
#include "utils/utils.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "netsurf/misc.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "netsurf/mouse.h"
|
||||
#include "content/handlers/css/utils.h"
|
||||
#include "content/handlers/css/dump.h"
|
||||
#include "desktop/scrollbar.h"
|
||||
#include "netsurf/misc.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
|
||||
#include "render/box.h"
|
||||
|
@ -22,9 +22,10 @@
|
||||
|
||||
#include <dom/dom.h>
|
||||
|
||||
#include "utils/config.h"
|
||||
#include "utils/log.h"
|
||||
#include "desktop/textarea.h"
|
||||
#include "desktop/textinput.h"
|
||||
#include "utils/log.h"
|
||||
|
||||
#include "render/box_textarea.h"
|
||||
#include "render/font.h"
|
||||
|
@ -40,18 +40,17 @@
|
||||
#include "utils/utf8.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/string.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "content/fetch.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/utf8.h"
|
||||
#include "netsurf/layout.h"
|
||||
#include "netsurf/misc.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "desktop/selection.h"
|
||||
#include "desktop/scrollbar.h"
|
||||
#include "desktop/textarea.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "javascript/js.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/utf8.h"
|
||||
#include "netsurf/layout.h"
|
||||
#include "netsurf/misc.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
|
||||
#include "render/box.h"
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include <dom/dom.h>
|
||||
#include <dom/bindings/hubbub/parser.h>
|
||||
|
||||
#include "content/content_type.h"
|
||||
#include "netsurf/content_type.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/mouse.h"
|
||||
#include "desktop/plot_style.h"
|
||||
|
@ -27,13 +27,14 @@
|
||||
#include <strings.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "content/hlcache.h"
|
||||
#include "content/handlers/css/css.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "utils/corestrings.h"
|
||||
#include "utils/config.h"
|
||||
#include "utils/log.h"
|
||||
#include "netsurf/misc.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "content/handlers/css/css.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
|
||||
#include "render/html_internal.h"
|
||||
|
@ -16,6 +16,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "utils/config.h"
|
||||
#include "utils/corestrings.h"
|
||||
#include "utils/log.h"
|
||||
|
||||
|
@ -33,19 +33,19 @@
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
#include "utils/log.h"
|
||||
#include "content/content.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "desktop/frames.h"
|
||||
#include "netsurf/mouse.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/mouse.h"
|
||||
#include "netsurf/misc.h"
|
||||
#include "netsurf/layout.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "desktop/frames.h"
|
||||
#include "desktop/scrollbar.h"
|
||||
#include "desktop/selection.h"
|
||||
#include "desktop/textarea.h"
|
||||
#include "desktop/textinput.h"
|
||||
#include "javascript/js.h"
|
||||
#include "netsurf/misc.h"
|
||||
#include "netsurf/layout.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
|
||||
#include "render/box.h"
|
||||
|
@ -32,10 +32,11 @@
|
||||
#include "utils/config.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "netsurf/misc.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "content/handlers/css/utils.h"
|
||||
#include "desktop/scrollbar.h"
|
||||
#include "netsurf/misc.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
|
||||
#include "render/box.h"
|
||||
|
@ -40,16 +40,17 @@
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "content/handlers/css/utils.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/plotters.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "netsurf/layout.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "content/handlers/css/utils.h"
|
||||
#include "desktop/selection.h"
|
||||
#include "desktop/print.h"
|
||||
#include "desktop/scrollbar.h"
|
||||
#include "desktop/textarea.h"
|
||||
#include "netsurf/bitmap.h"
|
||||
#include "netsurf/layout.h"
|
||||
#include "desktop/gui_internal.h"
|
||||
|
||||
#include "render/box.h"
|
||||
|
@ -32,10 +32,12 @@
|
||||
#include "utils/corestrings.h"
|
||||
#include "utils/log.h"
|
||||
#include "utils/messages.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "javascript/js.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "content/fetch.h"
|
||||
#include "content/hlcache.h"
|
||||
|
||||
#include "render/html_internal.h"
|
||||
|
||||
typedef bool (script_handler_t)(struct jscontext *jscontext, const char *data, size_t size) ;
|
||||
|
@ -47,12 +47,13 @@
|
||||
#include "utils/talloc.h"
|
||||
#include "utils/utils.h"
|
||||
#include "utils/nsoption.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "netsurf/layout.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "content/handlers/css/utils.h"
|
||||
#include "netsurf/browser_window.h"
|
||||
#include "desktop/scrollbar.h"
|
||||
#include "desktop/textarea.h"
|
||||
#include "netsurf/layout.h"
|
||||
|
||||
#include "render/box.h"
|
||||
#include "render/font.h"
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "utils/messages.h"
|
||||
#include "utils/utils.h"
|
||||
#include "utils/utf8.h"
|
||||
#include "netsurf/content.h"
|
||||
#include "content/content_protected.h"
|
||||
#include "content/hlcache.h"
|
||||
#include "content/handlers/css/utils.h"
|
||||
|
Loading…
Reference in New Issue
Block a user