NetSurf
|
implementation of content for image/svg using libsvgtiny. More...
#include <assert.h>
#include <limits.h>
#include <string.h>
#include <stdlib.h>
#include <svgtiny.h>
#include "utils/messages.h"
#include "utils/utils.h"
#include "utils/nsurl.h"
#include "netsurf/plotters.h"
#include "netsurf/content.h"
#include "content/content_protected.h"
#include "content/content_factory.h"
#include "image/svg.h"
Go to the source code of this file.
Data Structures | |
struct | svg_content |
Macros | |
#define | BGR(c) |
Typedefs | |
typedef struct svg_content | svg_content |
Functions | |
static nserror | svg_create_svg_data (svg_content *c) |
static nserror | svg_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) |
Create a CONTENT_SVG. More... | |
static bool | svg_convert (struct content *c) |
Convert a CONTENT_SVG for display. More... | |
static void | svg_reformat (struct content *c, int width, int height) |
Reformat a CONTENT_SVG. More... | |
static bool | svg_redraw_internal (svg_content *svg, int x, int y, int width, int height, const struct rect *clip, const struct redraw_context *ctx, float scale, colour background_colour) |
Redraw a CONTENT_SVG. More... | |
static bool | svg_redraw_tiled_internal (svg_content *svg, struct content_redraw_data *data, const struct rect *clip, const struct redraw_context *ctx) |
static bool | svg_redraw (struct content *c, struct content_redraw_data *data, const struct rect *clip, const struct redraw_context *ctx) |
Redraw a CONTENT_SVG. More... | |
static void | svg_destroy (struct content *c) |
Destroy a CONTENT_SVG and free all resources it owns. More... | |
static nserror | svg_clone (const struct content *old, struct content **newc) |
static content_type | svg_content_type (void) |
CONTENT_FACTORY_REGISTER_TYPES (svg, svg_types, svg_content_handler) | |
Variables | |
static const content_handler | svg_content_handler |
static const char * | svg_types [] |
implementation of content for image/svg using libsvgtiny.
Definition in file svg.c.
#define BGR | ( | c | ) |
typedef struct svg_content svg_content |
CONTENT_FACTORY_REGISTER_TYPES | ( | svg | , |
svg_types | , | ||
svg_content_handler | |||
) |
Definition at line 338 of file svg.c.
References svg_content::base, content__clone(), content_destroy(), CONTENT_STATUS_DONE, CONTENT_STATUS_READY, NSERROR_CLONE_FAILED, NSERROR_NOMEM, NSERROR_OK, content::status, svg_convert(), and svg_create_svg_data().
|
static |
Definition at line 373 of file svg.c.
References CONTENT_IMAGE.
|
static |
Convert a CONTENT_SVG for display.
Definition at line 109 of file svg.c.
References content_set_done(), content_set_ready(), and content_set_status().
Referenced by svg_clone().
|
static |
Create a CONTENT_SVG.
Definition at line 73 of file svg.c.
References svg_content::base, content__init(), llcache, NSERROR_NOMEM, NSERROR_OK, and svg_create_svg_data().
|
static |
Definition at line 52 of file svg.c.
References svg_content::base, content_broadcast_error(), svg_content::current_height, svg_content::current_width, svg_content::diagram, NSERROR_NOMEM, and NSERROR_OK.
Referenced by svg_clone(), and svg_create().
|
static |
Destroy a CONTENT_SVG and free all resources it owns.
Definition at line 329 of file svg.c.
References svg_content::diagram.
|
static |
Redraw a CONTENT_SVG.
Definition at line 300 of file svg.c.
References content_redraw_data::background_colour, clip(), content_redraw_data::height, content_redraw_data::repeat_x, content_redraw_data::repeat_y, content_redraw_data::scale, svg_redraw_internal(), svg_redraw_tiled_internal(), content_redraw_data::width, content_redraw_data::x, and content_redraw_data::y.
|
static |
Redraw a CONTENT_SVG.
Definition at line 161 of file svg.c.
References plot_font_style::background, svg_content::base, BGR, svg_content::diagram, plot_style_s::fill_colour, plot_style_s::fill_type, plot_font_style::foreground, content::height, height, NS_TRANSPARENT, NSERROR_OK, plotter_table::path, redraw_context::plot, PLOT_OP_TYPE_NONE, PLOT_OP_TYPE_SOLID, plot_style_font, plot_style_int_to_fixed, PLOT_STYLE_SCALE, plot_font_style::size, plot_style_s::stroke_colour, plot_style_s::stroke_type, plot_style_s::stroke_width, plotter_table::text, content::width, and width.
Referenced by svg_redraw(), and svg_redraw_tiled_internal().
|
static |
Definition at line 254 of file svg.c.
References content_redraw_data::background_colour, clip(), content_redraw_data::height, content_redraw_data::repeat_x, content_redraw_data::repeat_y, content_redraw_data::scale, svg_redraw_internal(), content_redraw_data::width, content_redraw_data::x, and content_redraw_data::y.
Referenced by svg_redraw().
|
static |
Reformat a CONTENT_SVG.
Definition at line 128 of file svg.c.
References content__get_source_data(), content_get_url(), svg_content::current_height, svg_content::current_width, svg_content::diagram, content::height, height, nsurl_access(), content::width, and width.
|
static |