netsurf: branch master updated. release/3.7-120-g169a91a
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/169a91ace945ca0c0747f...
...commit http://git.netsurf-browser.org/netsurf.git/commit/169a91ace945ca0c0747ffa...
...tree http://git.netsurf-browser.org/netsurf.git/tree/169a91ace945ca0c0747ffa0f...
The branch, master has been updated
via 169a91ace945ca0c0747ffa0f7db5ee550188c87 (commit)
from a40dca49e8493802d7064bd8e6aaab03436568ee (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=169a91ace945ca0c074...
commit 169a91ace945ca0c0747ffa0f7db5ee550188c87
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
RISC OS: Plotters: Fix typo.
diff --git a/frontends/riscos/save_draw.c b/frontends/riscos/save_draw.c
index 28880e5..1e67d2d 100644
--- a/frontends/riscos/save_draw.c
+++ b/frontends/riscos/save_draw.c
@@ -407,7 +407,7 @@ ro_save_draw_path(const struct redraw_context *ctx,
pstyle->stroke_colour == NS_TRANSPARENT ?
pencil_TRANSPARENT :
pstyle->stroke_colour << 8,
- plot_style_fixed_to_int(style->stroke_width),
+ plot_style_fixed_to_int(pstyle->stroke_width),
pencil_JOIN_MITRED,
pencil_CAP_BUTT,
pencil_CAP_BUTT,
-----------------------------------------------------------------------
Summary of changes:
frontends/riscos/save_draw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/frontends/riscos/save_draw.c b/frontends/riscos/save_draw.c
index 28880e5..1e67d2d 100644
--- a/frontends/riscos/save_draw.c
+++ b/frontends/riscos/save_draw.c
@@ -407,7 +407,7 @@ ro_save_draw_path(const struct redraw_context *ctx,
pstyle->stroke_colour == NS_TRANSPARENT ?
pencil_TRANSPARENT :
pstyle->stroke_colour << 8,
- plot_style_fixed_to_int(style->stroke_width),
+ plot_style_fixed_to_int(pstyle->stroke_width),
pencil_JOIN_MITRED,
pencil_CAP_BUTT,
pencil_CAP_BUTT,
--
NetSurf Browser
5 years, 4 months
netsurf: branch master updated. release/3.7-119-ga40dca4
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/a40dca49e8493802d7064...
...commit http://git.netsurf-browser.org/netsurf.git/commit/a40dca49e8493802d7064bd...
...tree http://git.netsurf-browser.org/netsurf.git/tree/a40dca49e8493802d7064bd8e...
The branch, master has been updated
via a40dca49e8493802d7064bd8e6aaab03436568ee (commit)
via 8a931f01b958ad5862433ece6024bbde0aa4ecb8 (commit)
via 8332bf6b2a42fd03b864e46f60eeaa76b51da496 (commit)
via 5f4f23f11a1c2aaa85df6bb58f0be6e66fa7cc7b (commit)
via 66493421e65d8cbda3e17fdbe43824387e3d51a7 (commit)
via a58d97a41a6192038573da6862571dc72a560458 (commit)
from 6cabd4cd628833afa32aeb7c614ef153b4a1c985 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=a40dca49e8493802d70...
commit a40dca49e8493802d7064bd8e6aaab03436568ee
Merge: 6cabd4c 8a931f0
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Merge branch 'tlsa/plotter-polish'
-----------------------------------------------------------------------
Summary of changes:
content/handlers/html/box_textarea.c | 2 +-
content/handlers/html/font.c | 7 +--
content/handlers/html/form.c | 2 +-
content/handlers/html/html_redraw_border.c | 2 +-
content/handlers/image/svg.c | 13 ++---
content/handlers/text/textplain.c | 6 +--
desktop/font_haru.c | 2 +-
desktop/knockout.c | 4 +-
desktop/local_history.c | 10 ++--
desktop/plot_style.c | 14 +++---
desktop/save_pdf.c | 16 +++----
desktop/scrollbar.c | 6 +--
desktop/textarea.c | 10 ++--
desktop/treeview.c | 2 +-
frontends/amiga/dt_sound.c | 2 +-
frontends/amiga/font_bullet.c | 4 +-
frontends/amiga/font_diskfont.c | 2 +-
frontends/amiga/plotters.c | 10 ++--
frontends/amiga/plugin_hack.c | 2 +-
frontends/atari/plot/font_freetype.c | 2 +-
frontends/atari/plot/font_vdi.c | 14 +++---
frontends/atari/plot/plot.c | 8 ++--
frontends/atari/toolbar.c | 4 +-
frontends/beos/font.cpp | 2 +-
frontends/beos/plotters.cpp | 8 ++--
frontends/framebuffer/fbtk/text.c | 2 +-
frontends/framebuffer/font_freetype.c | 2 +-
frontends/framebuffer/font_internal.c | 2 +-
frontends/framebuffer/framebuffer.c | 8 ++--
frontends/gtk/layout_pango.c | 2 +-
frontends/gtk/plotters.c | 33 +++++++------
frontends/gtk/print.c | 32 ++++++-------
frontends/monkey/layout.c | 10 ++--
frontends/monkey/plot.c | 6 +--
frontends/riscos/font.c | 2 +-
frontends/riscos/plotters.c | 20 ++++----
frontends/riscos/print.c | 1 -
frontends/riscos/save_draw.c | 9 ++--
frontends/windows/font.c | 2 +-
frontends/windows/plot.c | 10 ++--
include/netsurf/plot_style.h | 34 +++++++++++--
include/netsurf/plotters.h | 72 +++++++++++++++++++++++-----
42 files changed, 232 insertions(+), 169 deletions(-)
diff --git a/content/handlers/html/box_textarea.c b/content/handlers/html/box_textarea.c
index 858de50..c19afbb 100644
--- a/content/handlers/html/box_textarea.c
+++ b/content/handlers/html/box_textarea.c
@@ -244,7 +244,7 @@ bool box_textarea_create_textarea(html_content *html,
textarea_flags ta_flags;
plot_font_style_t fstyle = {
.family = PLOT_FONT_FAMILY_SANS_SERIF,
- .size = 10 * FONT_SIZE_SCALE,
+ .size = 10 * PLOT_STYLE_SCALE,
.weight = 400,
.flags = FONTF_NONE,
.background = 0,
diff --git a/content/handlers/html/font.c b/content/handlers/html/font.c
index 9dbf592..7ebe168 100644
--- a/content/handlers/html/font.c
+++ b/content/handlers/html/font.c
@@ -144,14 +144,15 @@ void font_plot_style_from_css(
fstyle->family = plot_font_generic_family(
css_computed_font_family(css, &families));
+ fstyle->families = families;
css_computed_font_size(css, &length, &unit);
fstyle->size = FIXTOINT(FMUL(nscss_len2pt(len_ctx, length, unit),
- INTTOFIX(FONT_SIZE_SCALE)));
+ INTTOFIX(PLOT_STYLE_SCALE)));
/* Clamp font size to configured minimum */
- if (fstyle->size < (nsoption_int(font_min_size) * FONT_SIZE_SCALE) / 10)
- fstyle->size = (nsoption_int(font_min_size) * FONT_SIZE_SCALE) / 10;
+ if (fstyle->size < (nsoption_int(font_min_size) * PLOT_STYLE_SCALE) / 10)
+ fstyle->size = (nsoption_int(font_min_size) * PLOT_STYLE_SCALE) / 10;
fstyle->weight = plot_font_weight(css_computed_font_weight(css));
fstyle->flags = plot_font_flags(css_computed_font_style(css),
diff --git a/content/handlers/html/form.c b/content/handlers/html/form.c
index 9fe2e77..8ba99d4 100644
--- a/content/handlers/html/form.c
+++ b/content/handlers/html/form.c
@@ -1160,7 +1160,7 @@ bool form_open_select_menu(void *client_data,
menu->line_height = FIXTOINT(FDIV((FMUL(FLTTOFIX(1.2),
FMUL(nscss_screen_dpi,
- INTTOFIX(fstyle.size / FONT_SIZE_SCALE)))),
+ INTTOFIX(fstyle.size / PLOT_STYLE_SCALE)))),
F_72));
line_height_with_spacing = menu->line_height +
diff --git a/content/handlers/html/html_redraw_border.c b/content/handlers/html/html_redraw_border.c
index 2a849e8..0b3d858 100644
--- a/content/handlers/html/html_redraw_border.c
+++ b/content/handlers/html/html_redraw_border.c
@@ -111,7 +111,7 @@ html_redraw_border_plot(const int side,
plot_style_bdr.stroke_type = PLOT_OP_TYPE_DASH;
plot_style_bdr.stroke_colour = c;
- plot_style_bdr.stroke_width = thickness;
+ plot_style_bdr.stroke_width = (thickness << PLOT_STYLE_RADIX);
plot_style_fillbdr.fill_colour = c;
plot_style_fillbdr_dark.fill_colour = darken_colour(c);
plot_style_fillbdr_light.fill_colour = lighten_colour(c);
diff --git a/content/handlers/image/svg.c b/content/handlers/image/svg.c
index 2edc7bd..5126073 100644
--- a/content/handlers/image/svg.c
+++ b/content/handlers/image/svg.c
@@ -188,14 +188,15 @@ svg_redraw_internal(struct content *c,
for (i = 0; i != diagram->shape_count; i++) {
if (diagram->shape[i].path) {
+ pstyle.stroke_width = plot_style_int_to_fixed(
+ diagram->shape[i].stroke);
pstyle.stroke_colour = BGR(diagram->shape[i].stroke);
pstyle.fill_colour = BGR(diagram->shape[i].fill);
res = ctx->plot->path(ctx,
- &pstyle,
- diagram->shape[i].path,
- diagram->shape[i].path_length,
- diagram->shape[i].stroke_width,
- transform);
+ &pstyle,
+ diagram->shape[i].path,
+ diagram->shape[i].path_length,
+ transform);
if (res != NSERROR_OK) {
return false;
}
@@ -210,7 +211,7 @@ svg_redraw_internal(struct content *c,
fstyle.background = 0xffffff;
fstyle.foreground = 0x000000;
- fstyle.size = (8 * FONT_SIZE_SCALE) * scale;
+ fstyle.size = (8 * PLOT_STYLE_SCALE) * scale;
res = ctx->plot->text(ctx,
&fstyle,
diff --git a/content/handlers/text/textplain.c b/content/handlers/text/textplain.c
index e6d167b..af990d1 100644
--- a/content/handlers/text/textplain.c
+++ b/content/handlers/text/textplain.c
@@ -86,7 +86,7 @@ typedef struct textplain_content {
#define MARGIN 4
#define TAB_WIDTH 8 /* must be power of 2 currently */
-#define TEXT_SIZE 10 * FONT_SIZE_SCALE /* Unscaled text size in pt */
+#define TEXT_SIZE 10 * PLOT_STYLE_SCALE /* Unscaled text size in pt */
static plot_font_style_t textplain_style = {
.family = PLOT_FONT_FAMILY_MONOSPACE,
@@ -149,7 +149,7 @@ textplain_create_internal(textplain_content *c, lwc_string *encoding)
parserutils_inputstream *stream;
parserutils_error error;
- textplain_style.size = (nsoption_int(font_size) * FONT_SIZE_SCALE) / 10;
+ textplain_style.size = (nsoption_int(font_size) * PLOT_STYLE_SCALE) / 10;
utf8_data = malloc(CHUNK);
if (utf8_data == NULL)
@@ -400,7 +400,7 @@ static float textplain_line_height(void)
/* Size is in points, so convert to pixels.
* Then use a constant line height of 1.2 x font size.
*/
- return FIXTOFLT(FDIV((FMUL(FLTTOFIX(1.2), FMUL(nscss_screen_dpi, INTTOFIX((textplain_style.size / FONT_SIZE_SCALE))))), F_72));
+ return FIXTOFLT(FDIV((FMUL(FLTTOFIX(1.2), FMUL(nscss_screen_dpi, INTTOFIX((textplain_style.size / PLOT_STYLE_SCALE))))), F_72));
}
diff --git a/desktop/font_haru.c b/desktop/font_haru.c
index f92d891..4ee9824 100644
--- a/desktop/font_haru.c
+++ b/desktop/font_haru.c
@@ -352,7 +352,7 @@ bool haru_nsfont_apply_style(const plot_font_style_t *fstyle,
if (size <= 0)
return true;
- size /= FONT_SIZE_SCALE;
+ size /= PLOT_STYLE_SCALE;
if (size > HPDF_MAX_FONTSIZE)
size = HPDF_MAX_FONTSIZE;
diff --git a/desktop/knockout.c b/desktop/knockout.c
index 6dbf4eb..127a48c 100644
--- a/desktop/knockout.c
+++ b/desktop/knockout.c
@@ -671,7 +671,6 @@ knockout_plot_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -680,14 +679,13 @@ knockout_plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
nserror res;
nserror ffres;
ffres = knockout_plot_flush(ctx);
- res = real_plot.path(ctx, pstyle, p, n, width, transform);
+ res = real_plot.path(ctx, pstyle, p, n, transform);
/* return the first error */
if ((res != NSERROR_OK) && (ffres == NSERROR_OK)) {
diff --git a/desktop/local_history.c b/desktop/local_history.c
index 3219de9..75da4af 100644
--- a/desktop/local_history.c
+++ b/desktop/local_history.c
@@ -55,7 +55,7 @@ struct local_history_session {
*/
static plot_style_t pstyle_line = {
.stroke_type = PLOT_OP_TYPE_SOLID,
- .stroke_width = 2,
+ .stroke_width = plot_style_int_to_fixed(2),
};
@@ -72,7 +72,7 @@ static plot_style_t pstyle_bg = {
*/
static plot_style_t pstyle_rect = {
.stroke_type = PLOT_OP_TYPE_SOLID,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
@@ -81,7 +81,7 @@ static plot_style_t pstyle_rect = {
*/
static plot_style_t pstyle_rect_sel = {
.stroke_type = PLOT_OP_TYPE_SOLID,
- .stroke_width = 3,
+ .stroke_width = plot_style_int_to_fixed(3),
};
@@ -90,7 +90,7 @@ static plot_style_t pstyle_rect_sel = {
*/
static plot_font_style_t pfstyle_node = {
.family = PLOT_FONT_FAMILY_SANS_SERIF,
- .size = 8 * FONT_SIZE_SCALE,
+ .size = 8 * PLOT_STYLE_SCALE,
.weight = 400,
.flags = FONTF_NONE,
};
@@ -101,7 +101,7 @@ static plot_font_style_t pfstyle_node = {
*/
static plot_font_style_t pfstyle_node_sel = {
.family = PLOT_FONT_FAMILY_SANS_SERIF,
- .size = 8 * FONT_SIZE_SCALE,
+ .size = 8 * PLOT_STYLE_SCALE,
.weight = 900,
.flags = FONTF_NONE,
};
diff --git a/desktop/plot_style.c b/desktop/plot_style.c
index 1f0ac39..0595414 100644
--- a/desktop/plot_style.c
+++ b/desktop/plot_style.c
@@ -47,7 +47,7 @@ plot_style_t *plot_style_fill_red = &plot_style_fill_red_static;
static const plot_style_t plot_style_content_edge_static = {
.stroke_type = PLOT_OP_TYPE_SOLID,
.stroke_colour = 0x00ff0000,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
plot_style_t const * const plot_style_content_edge =
&plot_style_content_edge_static;
@@ -55,7 +55,7 @@ plot_style_t const * const plot_style_content_edge =
static const plot_style_t plot_style_padding_edge_static = {
.stroke_type = PLOT_OP_TYPE_SOLID,
.stroke_colour = 0x000000ff,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
plot_style_t const * const plot_style_padding_edge =
&plot_style_padding_edge_static;
@@ -63,7 +63,7 @@ plot_style_t const * const plot_style_padding_edge =
static const plot_style_t plot_style_margin_edge_static = {
.stroke_type = PLOT_OP_TYPE_SOLID,
.stroke_colour = 0x0000ffff,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
plot_style_t const * const plot_style_margin_edge =
&plot_style_margin_edge_static;
@@ -74,14 +74,14 @@ static const plot_style_t plot_style_broken_object_static = {
.fill_colour = 0x008888ff,
.stroke_type = PLOT_OP_TYPE_SOLID,
.stroke_colour = 0x000000ff,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
plot_style_t const * const plot_style_broken_object =
&plot_style_broken_object_static;
static const plot_font_style_t plot_fstyle_broken_object_static = {
.family = PLOT_FONT_FAMILY_SANS_SERIF,
- .size = 16 * FONT_SIZE_SCALE,
+ .size = 16 * PLOT_STYLE_SCALE,
.weight = 400,
.flags = FONTF_NONE,
.background = 0x8888ff,
@@ -134,7 +134,7 @@ plot_style_t *plot_style_fill_wblobc = &plot_style_fill_wblobc_static;
static plot_style_t plot_style_stroke_wblobc_static = {
.stroke_type = PLOT_OP_TYPE_SOLID,
.stroke_colour = WIDGET_BLOBC,
- .stroke_width = 2,
+ .stroke_width = plot_style_int_to_fixed(2),
};
plot_style_t *plot_style_stroke_wblobc = &plot_style_stroke_wblobc_static;
@@ -156,7 +156,7 @@ plot_style_t *plot_style_stroke_lightwbasec = &plot_style_stroke_lightwbasec_sta
/* Generic font style */
static const plot_font_style_t plot_style_font_static = {
.family = PLOT_FONT_FAMILY_SANS_SERIF,
- .size = 8 * FONT_SIZE_SCALE,
+ .size = 8 * PLOT_STYLE_SCALE,
.weight = 400,
.flags = FONTF_NONE,
.background = 0xffffff,
diff --git a/desktop/save_pdf.c b/desktop/save_pdf.c
index 83e3d4f..8891900 100644
--- a/desktop/save_pdf.c
+++ b/desktop/save_pdf.c
@@ -213,10 +213,10 @@ bool pdf_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *psty
}
apply_clip_and_mode(false,
- NS_TRANSPARENT,
- pstyle->stroke_colour,
- pstyle->stroke_width,
- dash);
+ NS_TRANSPARENT,
+ pstyle->stroke_colour,
+ plot_style_int_to_fixed(pstyle->stroke_width),
+ dash);
HPDF_Page_Rectangle(pdf_page, x0, page_height - y0, x1 - x0, -(y1 - y0));
HPDF_Page_Stroke(pdf_page);
@@ -245,10 +245,10 @@ bool pdf_plot_line(int x0, int y0, int x1, int y1, const plot_style_t *pstyle)
}
apply_clip_and_mode(false,
- NS_TRANSPARENT,
- pstyle->stroke_colour,
- pstyle->stroke_width,
- dash);
+ NS_TRANSPARENT,
+ pstyle->stroke_colour,
+ plot_style_int_to_fixed(pstyle->stroke_width),
+ dash);
HPDF_Page_MoveTo(pdf_page, x0, page_height - y0);
HPDF_Page_LineTo(pdf_page, x1, page_height - y1);
diff --git a/desktop/scrollbar.c b/desktop/scrollbar.c
index 5a7420a..af5536b 100644
--- a/desktop/scrollbar.c
+++ b/desktop/scrollbar.c
@@ -164,17 +164,17 @@ scrollbar_rectangle(const struct redraw_context *ctx,
static plot_style_t c0 = {
.stroke_type = PLOT_OP_TYPE_SOLID,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
static plot_style_t c1 = {
.stroke_type = PLOT_OP_TYPE_SOLID,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
static plot_style_t c2 = {
.stroke_type = PLOT_OP_TYPE_SOLID,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
if (inset) {
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 3fd4c98..5bae27a 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -45,9 +45,9 @@
#define TA_ALLOC_STEP 512
static plot_style_t pstyle_stroke_caret = {
- .stroke_type = PLOT_OP_TYPE_SOLID,
- .stroke_colour = CARET_COLOR,
- .stroke_width = 1,
+ .stroke_type = PLOT_OP_TYPE_SOLID,
+ .stroke_colour = CARET_COLOR,
+ .stroke_width = plot_style_int_to_fixed(1),
};
struct line_info {
@@ -1805,7 +1805,7 @@ static void textarea_setup_text_offsets(struct textarea *ta)
ta->line_height = FIXTOINT(FMUL(FLTTOFIX(1.3), FDIV(FMUL(
nscss_screen_dpi, FDIV(INTTOFIX(ta->fstyle.size),
- INTTOFIX(FONT_SIZE_SCALE))), F_72)));
+ INTTOFIX(PLOT_STYLE_SCALE))), F_72)));
text_y_offset = text_y_offset_baseline = ta->border_width;
if (ta->flags & TEXTAREA_MULTILINE) {
@@ -1948,7 +1948,7 @@ struct textarea *textarea_create(const textarea_flags flags,
ret->line_height = FIXTOINT(FMUL(FLTTOFIX(1.3), FDIV(FMUL(
nscss_screen_dpi, FDIV(INTTOFIX(setup->text.size),
- INTTOFIX(FONT_SIZE_SCALE))), F_72)));
+ INTTOFIX(PLOT_STYLE_SCALE))), F_72)));
ret->caret_pos.line = ret->caret_pos.byte_off = -1;
ret->caret_x = 0;
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 1651ff5..928a696 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -5195,7 +5195,7 @@ nserror treeview_init(void)
10 + 36) / 72;
tree_g.line_height = (font_px_size * 8 + 3) / 6;
- res = treeview_init_plot_styles(font_pt_size * FONT_SIZE_SCALE / 10);
+ res = treeview_init_plot_styles(font_pt_size * PLOT_STYLE_SCALE / 10);
if (res != NSERROR_OK) {
return res;
}
diff --git a/frontends/amiga/dt_sound.c b/frontends/amiga/dt_sound.c
index ae313bb..f3b365d 100644
--- a/frontends/amiga/dt_sound.c
+++ b/frontends/amiga/dt_sound.c
@@ -195,7 +195,7 @@ bool amiga_dt_sound_redraw(struct content *c,
.fill_type = PLOT_OP_TYPE_SOLID,
.fill_colour = 0xffffff,
.stroke_colour = 0x000000,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
struct rect rect;
diff --git a/frontends/amiga/font_bullet.c b/frontends/amiga/font_bullet.c
index c8ad34c..62c2dde 100644
--- a/frontends/amiga/font_bullet.c
+++ b/frontends/amiga/font_bullet.c
@@ -63,7 +63,7 @@
#define NSA_VALUE_SHEARSIN (1 << 14)
#define NSA_VALUE_SHEARCOS (1 << 16)
-#define NSA_FONT_EMWIDTH(s) (s / FONT_SIZE_SCALE) * (ami_font_dpi_get_xdpi() / 72.0)
+#define NSA_FONT_EMWIDTH(s) (s / PLOT_STYLE_SCALE) * (ami_font_dpi_get_xdpi() / 72.0)
const uint16 sc_table[] = {
0x0061, 0x1D00, /* a */
@@ -512,7 +512,7 @@ static struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle
}
/* Scale to 16.16 fixed point */
- ysize = fstyle->size * ((1 << 16) / FONT_SIZE_SCALE);
+ ysize = fstyle->size * ((1 << 16) / PLOT_STYLE_SCALE);
if(designed_node == NULL) {
ofont = node->font;
diff --git a/frontends/amiga/font_diskfont.c b/frontends/amiga/font_diskfont.c
index 2da3f00..a587d6e 100644
--- a/frontends/amiga/font_diskfont.c
+++ b/frontends/amiga/font_diskfont.c
@@ -97,7 +97,7 @@ static struct TextFont *ami_font_bm_open(struct RastPort *rp, const plot_font_st
snprintf(font, MAX_FONT_NAME_SIZE, "%s.font", fontname);
tattr.ta_Name = font;
- tattr.ta_YSize = fstyle->size / FONT_SIZE_SCALE;
+ tattr.ta_YSize = fstyle->size / PLOT_STYLE_SCALE;
NSLOG(netsurf, INFO, "font: %s/%d", tattr.ta_Name, tattr.ta_YSize);
if(prev_font != NULL) CloseFont(prev_font);
diff --git a/frontends/amiga/plotters.c b/frontends/amiga/plotters.c
index b848543..4623afa 100644
--- a/frontends/amiga/plotters.c
+++ b/frontends/amiga/plotters.c
@@ -722,8 +722,8 @@ ami_line(const struct redraw_context *ctx,
struct gui_globals *glob = (struct gui_globals *)ctx->priv;
- glob->rp->PenWidth = style->stroke_width;
- glob->rp->PenHeight = style->stroke_width;
+ glob->rp->PenWidth = plot_style_fixed_to_int(style->stroke_width);
+ glob->rp->PenHeight = plot_style_fixed_to_int(style->stroke_width);
switch (style->stroke_type) {
case PLOT_OP_TYPE_SOLID: /**< Solid colour */
@@ -780,8 +780,8 @@ ami_rectangle(const struct redraw_context *ctx,
}
if (style->stroke_type != PLOT_OP_TYPE_NONE) {
- glob->rp->PenWidth = style->stroke_width;
- glob->rp->PenHeight = style->stroke_width;
+ glob->rp->PenWidth = plot_style_fixed_to_int(style->stroke_width);
+ glob->rp->PenHeight = plot_style_fixed_to_int(style->stroke_width);
switch (style->stroke_type) {
case PLOT_OP_TYPE_SOLID: /**< Solid colour */
@@ -868,7 +868,6 @@ ami_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -877,7 +876,6 @@ ami_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
unsigned int i;
diff --git a/frontends/amiga/plugin_hack.c b/frontends/amiga/plugin_hack.c
index 4fd1f03..5d7ec19 100644
--- a/frontends/amiga/plugin_hack.c
+++ b/frontends/amiga/plugin_hack.c
@@ -151,7 +151,7 @@ bool amiga_plugin_hack_redraw(struct content *c,
.fill_type = PLOT_OP_TYPE_SOLID,
.fill_colour = 0xffffff,
.stroke_colour = 0x000000,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
struct rect rect;
nserror res;
diff --git a/frontends/atari/plot/font_freetype.c b/frontends/atari/plot/font_freetype.c
index 1688e97..f8109f6 100644
--- a/frontends/atari/plot/font_freetype.c
+++ b/frontends/atari/plot/font_freetype.c
@@ -250,7 +250,7 @@ static void ft_fill_scalar(const plot_font_style_t *fstyle, FTC_Scaler srec)
srec->face_id = (FTC_FaceID)font_faces[selected_face];
- srec->width = srec->height = (fstyle->size * 64) / FONT_SIZE_SCALE;
+ srec->width = srec->height = (fstyle->size * 64) / PLOT_STYLE_SCALE;
srec->pixel = 0;
/* calculate x/y resolution, when browser_get_dpi() isn't available */
diff --git a/frontends/atari/plot/font_vdi.c b/frontends/atari/plot/font_vdi.c
index 7cd82dd..556c08e 100644
--- a/frontends/atari/plot/font_vdi.c
+++ b/frontends/atari/plot/font_vdi.c
@@ -106,9 +106,9 @@ static int str_width( FONT_PLOTTER self,const plot_font_style_t *fstyle, const c
fx |= 1;
vst_effects( self->vdi_handle, fx );
/* TODO: replace 90 with global dpi setting */
- //pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 );
+ //pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 / 72 );
//vst_height( self->vdi_handle, pxsize ,&cw, &ch, &cellw, &cellh);
- pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 );
+ pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 );
vst_point( self->vdi_handle, pxsize, &cw, &ch, &cellw, &cellh);
/*
if(slen != utf8_bounded_length(str, length)){
@@ -148,10 +148,10 @@ static int str_split( FONT_PLOTTER self, const plot_font_style_t * fstyle, const
if( fstyle->weight > 450 )
fx |= 1;
vst_effects( self->vdi_handle, fx );
- //pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 );
+ //pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 / 72 );
//vst_height( self->vdi_handle, pxsize ,&cw, &ch, &cellw, &cellh);
- pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 );
+ pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 );
vst_point( self->vdi_handle, pxsize, &cw, &ch, &cellw, &cellh);
*actual_x = 0;
//*char_offset = 0;
@@ -216,7 +216,7 @@ static int pixel_pos( FONT_PLOTTER self, const plot_font_style_t * fstyle,const
if( fstyle->weight > 450 )
fx |= 1;
vst_effects(self->vdi_handle, fx);
- pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 );
+ pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 / 72 );
vst_height( self->vdi_handle, pxsize ,&cw, &ch, &cellw, &cellh);
*actual_x = 0;
*char_offset = 0;
@@ -283,8 +283,8 @@ static int text( FONT_PLOTTER self, int x, int y, const char *text, size_t leng
/* TODO: netsurf uses 90 as default dpi ( somewhere defined in libcss),
use that value or pass it as arg, to reduce netsurf dependency */
- //pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 );
- pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 );
+ //pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 / 72 );
+ pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 / 72 );
plot_get_dimensions(&canvas);
x += canvas.g_x;
diff --git a/frontends/atari/plot/plot.c b/frontends/atari/plot/plot.c
index 14c6703..4935b17 100644
--- a/frontends/atari/plot/plot.c
+++ b/frontends/atari/plot/plot.c
@@ -2124,7 +2124,7 @@ plot_line(const struct redraw_context *ctx,
{
short pxy[4];
uint32_t lt;
- int sw = pstyle->stroke_width;
+ int sw = plot_style_fixed_to_int(pstyle->stroke_width);
if (((line->x0 < 0) && (line->x1 < 0)) ||
((line->y0 < 0) && (line->y1 < 0))) {
@@ -2183,7 +2183,7 @@ plot_rectangle(const struct redraw_context *ctx,
{
short pxy[4];
GRECT r, rclip, sclip;
- int sw = pstyle->stroke_width;
+ int sw = plot_style_fixed_to_int(pstyle->stroke_width);
uint32_t lt;
/* current canvas clip: */
@@ -2266,7 +2266,7 @@ plot_rectangle(const struct redraw_context *ctx,
if (pstyle->fill_type != PLOT_OP_TYPE_NONE ) {
short stroke_width = (short)(pstyle->stroke_type != PLOT_OP_TYPE_NONE) ?
- pstyle->stroke_width : 0;
+ plot_style_fixed_to_int(pstyle->stroke_width) : 0;
vsf_rgbcolor(atari_plot_vdi_handle, pstyle->fill_colour);
vsf_perimeter(atari_plot_vdi_handle, 0);
@@ -2343,7 +2343,6 @@ plot_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -2352,7 +2351,6 @@ plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
/** \todo Implement atari path plot */
diff --git a/frontends/atari/toolbar.c b/frontends/atari/toolbar.c
index fdfedcb..b8f4226 100644
--- a/frontends/atari/toolbar.c
+++ b/frontends/atari/toolbar.c
@@ -94,7 +94,7 @@ static float toolbar_url_scale = 1.0;
static plot_font_style_t font_style_url = {
.family = PLOT_FONT_FAMILY_SANS_SERIF,
- .size = 14*FONT_SIZE_SCALE,
+ .size = 14*PLOT_STYLE_SCALE,
.weight = 400,
.flags = FONTF_NONE,
.background = 0xffffff,
@@ -302,7 +302,7 @@ struct s_toolbar *toolbar_create(struct s_gui_win_root *owner)
/* create the url widget: */
font_style_url.size =
- toolbar_styles[t->style].font_height_pt * FONT_SIZE_SCALE;
+ toolbar_styles[t->style].font_height_pt * PLOT_STYLE_SCALE;
textarea_flags ta_flags = TEXTAREA_INTERNAL_CARET;
textarea_setup ta_setup;
diff --git a/frontends/beos/font.cpp b/frontends/beos/font.cpp
index 8111303..5e7e782 100644
--- a/frontends/beos/font.cpp
+++ b/frontends/beos/font.cpp
@@ -130,7 +130,7 @@ void nsbeos_style_to_font(BFont &font, const struct plot_font_style *fstyle)
}
//fprintf(stderr, "nsbeos_style_to_font: value %f unit %d\n", style->font_size.value.length.value, style->font_size.value.length.unit);
- size = fstyle->size / FONT_SIZE_SCALE;
+ size = fstyle->size / PLOT_STYLE_SCALE;
//fprintf(stderr, "nsbeos_style_to_font: %f %d\n", size, style->font_size.value.length.unit);
diff --git a/frontends/beos/plotters.cpp b/frontends/beos/plotters.cpp
index c4903e0..2c50f94 100644
--- a/frontends/beos/plotters.cpp
+++ b/frontends/beos/plotters.cpp
@@ -370,7 +370,7 @@ nsbeos_plot_line(const struct redraw_context *ctx,
nsbeos_set_colour(style->stroke_colour);
float pensize = view->PenSize();
- view->SetPenSize(style->stroke_width);
+ view->SetPenSize(plot_style_fixed_to_float(style->stroke_width));
BPoint start(line->x0, line->y0);
BPoint end(line->x1, line->y1);
@@ -447,7 +447,7 @@ nsbeos_plot_rectangle(const struct redraw_context *ctx,
nsbeos_set_colour(style->stroke_colour);
float pensize = view->PenSize();
- view->SetPenSize(style->stroke_width);
+ view->SetPenSize(plot_style_fixed_to_float(style->stroke_width));
BRect rect(nsrect->x0, nsrect->y0, nsrect->x1, nsrect->y1);
view->StrokeRect(rect, pat);
@@ -518,7 +518,6 @@ nsbeos_plot_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -527,7 +526,6 @@ nsbeos_plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
unsigned int i;
@@ -578,7 +576,7 @@ nsbeos_plot_path(const struct redraw_context *ctx,
rgb_color old_high = view->HighColor();
float old_pen = view->PenSize();
- view->SetPenSize(width);
+ view->SetPenSize(plot_style_fixed_to_float(pstyle->stroke_width));
view->MovePenTo(0, 0);
if (pstyle->fill_colour != NS_TRANSPARENT) {
view->SetHighColor(nsbeos_rgb_colour(pstyle->fill_colour));
diff --git a/frontends/framebuffer/fbtk/text.c b/frontends/framebuffer/fbtk/text.c
index 4f3a238..9c96dce 100644
--- a/frontends/framebuffer/fbtk/text.c
+++ b/frontends/framebuffer/fbtk/text.c
@@ -71,7 +71,7 @@ fb_text_font_style(fbtk_widget_t *widget, int *font_height, int *padding,
#endif
font_style->family = PLOT_FONT_FAMILY_SANS_SERIF;
- font_style->size = px_to_pt(*font_height * FONT_SIZE_SCALE);
+ font_style->size = px_to_pt(*font_height * PLOT_STYLE_SCALE);
font_style->weight = 400;
font_style->flags = FONTF_NONE;
font_style->background = widget->bg;
diff --git a/frontends/framebuffer/font_freetype.c b/frontends/framebuffer/font_freetype.c
index 9e47e4b..744ac62 100644
--- a/frontends/framebuffer/font_freetype.c
+++ b/frontends/framebuffer/font_freetype.c
@@ -392,7 +392,7 @@ static void fb_fill_scalar(const plot_font_style_t *fstyle, FTC_Scaler srec)
srec->face_id = (FTC_FaceID)fb_faces[selected_face];
- srec->width = srec->height = (fstyle->size * 64) / FONT_SIZE_SCALE;
+ srec->width = srec->height = (fstyle->size * 64) / PLOT_STYLE_SCALE;
srec->pixel = 0;
srec->x_res = srec->y_res = browser_get_dpi();
diff --git a/frontends/framebuffer/font_internal.c b/frontends/framebuffer/font_internal.c
index ff3471d..d755681 100644
--- a/frontends/framebuffer/font_internal.c
+++ b/frontends/framebuffer/font_internal.c
@@ -212,7 +212,7 @@ fb_get_font_size(const plot_font_style_t *fstyle)
{
int size = fstyle->size * 10 /
(((nsoption_int(font_min_size) * 3 +
- nsoption_int(font_size)) / 4) * FONT_SIZE_SCALE);
+ nsoption_int(font_size)) / 4) * PLOT_STYLE_SCALE);
if (size > 2)
size = 2;
else if (size <= 0)
diff --git a/frontends/framebuffer/framebuffer.c b/frontends/framebuffer/framebuffer.c
index 2ccc750..52afdbf 100644
--- a/frontends/framebuffer/framebuffer.c
+++ b/frontends/framebuffer/framebuffer.c
@@ -168,7 +168,7 @@ framebuffer_plot_line(const struct redraw_context *ctx,
}
pen.stroke_colour = style->stroke_colour;
- pen.stroke_width = style->stroke_width;
+ pen.stroke_width = plot_style_fixed_to_int(style->stroke_width);
nsfb_plot_line(nsfb, &rect, &pen);
}
@@ -216,7 +216,9 @@ framebuffer_plot_rectangle(const struct redraw_context *ctx,
dashed = true;
}
- nsfb_plot_rectangle(nsfb, &rect, style->stroke_width, style->stroke_colour, dotted, dashed);
+ nsfb_plot_rectangle(nsfb, &rect,
+ plot_style_fixed_to_int(style->stroke_width),
+ style->stroke_colour, dotted, dashed);
}
return NSERROR_OK;
}
@@ -259,7 +261,6 @@ framebuffer_plot_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -268,7 +269,6 @@ framebuffer_plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
NSLOG(netsurf, INFO, "path unimplemented");
diff --git a/frontends/gtk/layout_pango.c b/frontends/gtk/layout_pango.c
index a5964eb..9e8e94d 100644
--- a/frontends/gtk/layout_pango.c
+++ b/frontends/gtk/layout_pango.c
@@ -277,7 +277,7 @@ nsfont_style_to_description(const plot_font_style_t *fstyle)
break;
}
- size = (fstyle->size * PANGO_SCALE) / FONT_SIZE_SCALE;
+ size = (fstyle->size * PANGO_SCALE) / PLOT_STYLE_SCALE;
if (fstyle->flags & FONTF_ITALIC)
style = PANGO_STYLE_ITALIC;
diff --git a/frontends/gtk/plotters.c b/frontends/gtk/plotters.c
index 88e7760..4a5ef51 100644
--- a/frontends/gtk/plotters.c
+++ b/frontends/gtk/plotters.c
@@ -89,6 +89,20 @@ static inline void nsgtk_set_dashed(void)
/**
+ * Set cairo context line width.
+ */
+static inline void nsgtk_set_line_width(plot_style_fixed width)
+{
+ if (width == 0) {
+ cairo_set_line_width(current_cr, 1);
+ } else {
+ cairo_set_line_width(current_cr,
+ plot_style_fixed_to_double(width));
+ }
+}
+
+
+/**
* \brief Sets a clip rectangle for subsequent plot operations.
*
* \param ctx The current redraw context.
@@ -191,10 +205,7 @@ nsgtk_plot_disc(const struct redraw_context *ctx,
break;
}
- if (style->stroke_width == 0)
- cairo_set_line_width(current_cr, 1);
- else
- cairo_set_line_width(current_cr, style->stroke_width);
+ nsgtk_set_line_width(style->stroke_width);
cairo_arc(current_cr, x, y, radius, 0, M_PI * 2);
@@ -242,10 +253,7 @@ nsgtk_plot_line(const struct redraw_context *ctx,
nsgtk_set_colour(style->stroke_colour);
}
- if (style->stroke_width == 0)
- cairo_set_line_width(current_cr, 1);
- else
- cairo_set_line_width(current_cr, style->stroke_width);
+ nsgtk_set_line_width(style->stroke_width);
/* core expects horizontal and vertical lines to be on pixels, not
* between pixels
@@ -331,10 +339,7 @@ nsgtk_plot_rectangle(const struct redraw_context *ctx,
break;
}
- if (style->stroke_width == 0)
- cairo_set_line_width(current_cr, 1);
- else
- cairo_set_line_width(current_cr, style->stroke_width);
+ nsgtk_set_line_width(style->stroke_width);
cairo_rectangle(current_cr,
rect->x0 + 0.5,
@@ -394,7 +399,6 @@ nsgtk_plot_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -403,7 +407,6 @@ nsgtk_plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
unsigned int i;
@@ -421,7 +424,7 @@ nsgtk_plot_path(const struct redraw_context *ctx,
cairo_get_matrix(current_cr, &old_ctm);
/* Set up line style and width */
- cairo_set_line_width(current_cr, 1);
+ nsgtk_set_line_width(pstyle->stroke_width);
nsgtk_set_solid();
/* Load new CTM */
diff --git a/frontends/gtk/print.c b/frontends/gtk/print.c
index 8f71230..c4f1b0f 100644
--- a/frontends/gtk/print.c
+++ b/frontends/gtk/print.c
@@ -133,6 +133,17 @@ static inline void nsgtk_print_set_dashed(void)
cairo_set_dash(gtk_print_current_cr, cdashes, 1, 0);
}
+/** Set cairo context line width. */
+static inline void nsgtk_set_line_width(plot_style_fixed width)
+{
+ if (width == 0) {
+ cairo_set_line_width(gtk_print_current_cr, 1);
+ } else {
+ cairo_set_line_width(gtk_print_current_cr,
+ plot_style_fixed_to_double(width));
+ }
+}
+
/**
* \brief Sets a clip rectangle for subsequent plot operations.
@@ -248,10 +259,7 @@ nsgtk_print_plot_disc(const struct redraw_context *ctx,
break;
}
- if (style->stroke_width == 0)
- cairo_set_line_width(gtk_print_current_cr, 1);
- else
- cairo_set_line_width(gtk_print_current_cr, style->stroke_width);
+ nsgtk_set_line_width(style->stroke_width);
cairo_arc(gtk_print_current_cr, x, y, radius, 0, M_PI * 2);
@@ -294,10 +302,7 @@ nsgtk_print_plot_line(const struct redraw_context *ctx,
break;
}
- if (style->stroke_width == 0)
- cairo_set_line_width(gtk_print_current_cr, 1);
- else
- cairo_set_line_width(gtk_print_current_cr, style->stroke_width);
+ nsgtk_set_line_width(style->stroke_width);
cairo_move_to(gtk_print_current_cr, line->x0 + 0.5, line->y0 + 0.5);
cairo_line_to(gtk_print_current_cr, line->x1 + 0.5, line->y1 + 0.5);
@@ -350,13 +355,6 @@ nsgtk_print_plot_rectangle(const struct redraw_context *ctx,
}
if (style->stroke_type != PLOT_OP_TYPE_NONE) {
- int stroke_width;
-
- /* ensure minimum stroke width */
- stroke_width = style->stroke_width;
- if (stroke_width == 0) {
- stroke_width = 1;
- }
nsgtk_print_set_colour(style->stroke_colour);
@@ -375,7 +373,7 @@ nsgtk_print_plot_rectangle(const struct redraw_context *ctx,
break;
}
- cairo_set_line_width(gtk_print_current_cr, stroke_width);
+ nsgtk_set_line_width(style->stroke_width);
cairo_rectangle(gtk_print_current_cr,
rect->x0, rect->y0,
@@ -429,7 +427,6 @@ nsgtk_print_plot_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -438,7 +435,6 @@ nsgtk_print_plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
/* Only the internal SVG renderer uses this plot call currently,
diff --git a/frontends/monkey/layout.c b/frontends/monkey/layout.c
index 7b72231..0d6a3b4 100644
--- a/frontends/monkey/layout.c
+++ b/frontends/monkey/layout.c
@@ -33,7 +33,7 @@ static nserror nsfont_width(const plot_font_style_t *fstyle,
const char *string, size_t length,
int *width)
{
- *width = (fstyle->size * utf8_bounded_length(string, length)) / FONT_SIZE_SCALE;
+ *width = (fstyle->size * utf8_bounded_length(string, length)) / PLOT_STYLE_SCALE;
return NSERROR_OK;
}
@@ -53,10 +53,10 @@ static nserror nsfont_position_in_string(const plot_font_style_t *fstyle,
const char *string, size_t length,
int x, size_t *char_offset, int *actual_x)
{
- *char_offset = x / (fstyle->size / FONT_SIZE_SCALE);
+ *char_offset = x / (fstyle->size / PLOT_STYLE_SCALE);
if (*char_offset > length)
*char_offset = length;
- *actual_x = *char_offset * (fstyle->size / FONT_SIZE_SCALE);
+ *actual_x = *char_offset * (fstyle->size / PLOT_STYLE_SCALE);
return NSERROR_OK;
}
@@ -88,7 +88,7 @@ static nserror nsfont_split(const plot_font_style_t *fstyle,
const char *string, size_t length,
int x, size_t *char_offset, int *actual_x)
{
- int c_off = *char_offset = x / (fstyle->size / FONT_SIZE_SCALE);
+ int c_off = *char_offset = x / (fstyle->size / PLOT_STYLE_SCALE);
if (*char_offset > length) {
*char_offset = length;
} else {
@@ -104,7 +104,7 @@ static nserror nsfont_split(const plot_font_style_t *fstyle,
}
}
}
- *actual_x = *char_offset * (fstyle->size / FONT_SIZE_SCALE);
+ *actual_x = *char_offset * (fstyle->size / PLOT_STYLE_SCALE);
return NSERROR_OK;
}
diff --git a/frontends/monkey/plot.c b/frontends/monkey/plot.c
index d00dca7..2fc9a3c 100644
--- a/frontends/monkey/plot.c
+++ b/frontends/monkey/plot.c
@@ -177,7 +177,6 @@ monkey_plot_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -186,12 +185,11 @@ monkey_plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
fprintf(stdout,
"PLOT PATH VERTICIES %d WIDTH %f\n",
- n, width);
+ n, plot_style_fixed_to_float(pstyle->stroke_width));
return NSERROR_OK;
}
@@ -273,7 +271,7 @@ static const struct plotter_table plotters = {
.path = monkey_plot_path,
.bitmap = monkey_plot_bitmap,
.text = monkey_plot_text,
- .option_knockout = true,
+ .option_knockout = true,
};
const struct plotter_table* monkey_plotters = &plotters;
diff --git a/frontends/riscos/font.c b/frontends/riscos/font.c
index 8913efe..2ff3090 100644
--- a/frontends/riscos/font.c
+++ b/frontends/riscos/font.c
@@ -469,7 +469,7 @@ void nsfont_read_style(const plot_font_style_t *fstyle,
rufl_WEIGHT_900
};
- *font_size = (fstyle->size * 16) / FONT_SIZE_SCALE;
+ *font_size = (fstyle->size * 16) / PLOT_STYLE_SCALE;
if (1600 < *font_size)
*font_size = 1600;
diff --git a/frontends/riscos/plotters.c b/frontends/riscos/plotters.c
index 2fbd12a..2b30682 100644
--- a/frontends/riscos/plotters.c
+++ b/frontends/riscos/plotters.c
@@ -324,9 +324,9 @@ ro_plot_line(const struct redraw_context *ctx,
dashed = true;
return ro_plot_draw_path((const draw_path *)path,
- style->stroke_width,
- style->stroke_colour,
- dotted, dashed);
+ plot_style_fixed_to_int(style->stroke_width),
+ style->stroke_colour,
+ dotted, dashed);
}
return NSERROR_OK;
}
@@ -412,10 +412,10 @@ ro_plot_rectangle(const struct redraw_context *ctx,
dashed = true;
ro_plot_draw_path((const draw_path *)path,
- style->stroke_width,
- style->stroke_colour,
- dotted,
- dashed);
+ plot_style_fixed_to_int(style->stroke_width),
+ style->stroke_colour,
+ dotted,
+ dashed);
}
return NSERROR_OK;
@@ -483,7 +483,6 @@ ro_plot_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -492,7 +491,6 @@ ro_plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
static const draw_line_style line_style = {
@@ -591,7 +589,9 @@ ro_plot_path(const struct redraw_context *ctx,
}
error = xdraw_stroke((draw_path *) path, 0, &trfm, 0,
- width * 2 * 256, &line_style, 0);
+ plot_style_fixed_to_int(
+ pstyle->stroke_width) * 2 * 256,
+ &line_style, 0);
if (error) {
NSLOG(netsurf, INFO, "xdraw_stroke: 0x%x: %s",
error->errnum, error->errmess);
diff --git a/frontends/riscos/print.c b/frontends/riscos/print.c
index d965baf..b390c69 100644
--- a/frontends/riscos/print.c
+++ b/frontends/riscos/print.c
@@ -831,7 +831,6 @@ print_fonts_plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
return NSERROR_OK;
diff --git a/frontends/riscos/save_draw.c b/frontends/riscos/save_draw.c
index 9ee7304..28880e5 100644
--- a/frontends/riscos/save_draw.c
+++ b/frontends/riscos/save_draw.c
@@ -168,7 +168,7 @@ ro_save_draw_line(const struct redraw_context *ctx,
sizeof path / sizeof path[0],
pencil_TRANSPARENT,
style->stroke_colour << 8,
- style->stroke_width,
+ plot_style_fixed_to_int(style->stroke_width),
pencil_JOIN_MITRED,
pencil_CAP_BUTT,
pencil_CAP_BUTT,
@@ -235,7 +235,7 @@ ro_save_draw_rectangle(const struct redraw_context *ctx,
sizeof path / sizeof path[0],
pencil_TRANSPARENT,
style->stroke_colour << 8,
- style->stroke_width,
+ plot_style_fixed_to_int(style->stroke_width),
pencil_JOIN_MITRED,
pencil_CAP_BUTT,
pencil_CAP_BUTT,
@@ -312,7 +312,6 @@ ro_save_draw_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -321,7 +320,6 @@ ro_save_draw_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
pencil_code code;
@@ -409,7 +407,8 @@ ro_save_draw_path(const struct redraw_context *ctx,
pstyle->stroke_colour == NS_TRANSPARENT ?
pencil_TRANSPARENT :
pstyle->stroke_colour << 8,
- width, pencil_JOIN_MITRED,
+ plot_style_fixed_to_int(style->stroke_width),
+ pencil_JOIN_MITRED,
pencil_CAP_BUTT,
pencil_CAP_BUTT,
0,
diff --git a/frontends/windows/font.c b/frontends/windows/font.c
index 37ccf23..7389bd8 100644
--- a/frontends/windows/font.c
+++ b/frontends/windows/font.c
@@ -120,7 +120,7 @@ HFONT get_font(const plot_font_style_t *style)
int nHeight = -10;
HDC hdc = GetDC(font_hwnd);
- nHeight = -MulDiv(style->size, GetDeviceCaps(hdc, LOGPIXELSY), 72 * FONT_SIZE_SCALE);
+ nHeight = -MulDiv(style->size, GetDeviceCaps(hdc, LOGPIXELSY), 72 * PLOT_STYLE_SCALE);
ReleaseDC(font_hwnd, hdc);
HFONT font = CreateFont(
diff --git a/frontends/windows/plot.c b/frontends/windows/plot.c
index 3668e4b..4d9096d 100644
--- a/frontends/windows/plot.c
+++ b/frontends/windows/plot.c
@@ -601,7 +601,9 @@ line(const struct redraw_context *ctx,
(style->stroke_type == PLOT_OP_TYPE_DASH) ? PS_DASH:
0);
LOGBRUSH lb = {BS_SOLID, col, 0};
- HPEN pen = ExtCreatePen(penstyle, style->stroke_width, &lb, 0, NULL);
+ HPEN pen = ExtCreatePen(penstyle,
+ plot_style_fixed_to_int(style->stroke_width),
+ &lb, 0, NULL);
if (pen == NULL) {
DeleteObject(clipregion);
return NSERROR_INVALID;
@@ -672,7 +674,9 @@ rectangle(const struct redraw_context *ctx,
if (style->fill_type == PLOT_OP_TYPE_NONE)
lb1.lbStyle = BS_HOLLOW;
- HPEN pen = ExtCreatePen(penstyle, style->stroke_width, &lb, 0, NULL);
+ HPEN pen = ExtCreatePen(penstyle,
+ plot_style_fixed_to_int(style->stroke_width),
+ &lb, 0, NULL);
if (pen == NULL) {
return NSERROR_INVALID;
}
@@ -810,7 +814,6 @@ polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -819,7 +822,6 @@ path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
NSLOG(plot, DEEPDEBUG, "path unimplemented");
diff --git a/include/netsurf/plot_style.h b/include/netsurf/plot_style.h
index 30db366..f1b6172 100644
--- a/include/netsurf/plot_style.h
+++ b/include/netsurf/plot_style.h
@@ -25,6 +25,8 @@
#define NETSURF_PLOT_STYLE_H
#include <stdint.h>
+#include <stdint.h>
+#include <libwapcaplet/libwapcaplet.h>
#include "netsurf/types.h"
/** light grey widget base colour */
@@ -36,8 +38,26 @@
/** Transparent colour value. */
#define NS_TRANSPARENT 0x01000000
-/** Scaling factor for font sizes */
-#define FONT_SIZE_SCALE 1024
+/** 22:10 fixed point */
+#define PLOT_STYLE_RADIX (10)
+
+/** Scaling factor for plot styles */
+#define PLOT_STYLE_SCALE (1 << PLOT_STYLE_RADIX)
+
+/* type for fixed point numbers */
+typedef int32_t plot_style_fixed;
+
+/* Convert an int to fixed point */
+#define plot_style_int_to_fixed(v) ((v) << PLOT_STYLE_RADIX)
+
+/* Convert fixed point to int */
+#define plot_style_fixed_to_int(v) ((v) >> PLOT_STYLE_RADIX)
+
+/* Convert fixed point to float */
+#define plot_style_fixed_to_float(v) (((float)v) / PLOT_STYLE_SCALE)
+
+/* Convert fixed point to double */
+#define plot_style_fixed_to_double(v) (((double)v) / PLOT_STYLE_SCALE)
/**
* Type of plot operation
@@ -55,7 +75,7 @@ typedef enum {
*/
typedef struct plot_style_s {
plot_operation_type_t stroke_type; /**< Stroke plot type */
- int stroke_width; /**< Width of stroke, in pixels */
+ plot_style_fixed stroke_width; /**< Width of stroke, in pixels */
colour stroke_colour; /**< Colour of stroke */
plot_operation_type_t fill_type; /**< Fill plot type */
colour fill_colour; /**< Colour of fill */
@@ -89,8 +109,14 @@ typedef enum {
* Font style for plotting
*/
typedef struct plot_font_style {
+ /**
+ * Array of pointers to font families.
+ *
+ * May be NULL. Array is NULL terminated.
+ */
+ lwc_string * const * families;
plot_font_generic_family_t family; /**< Generic family to plot with */
- int size; /**< Font size, in points * FONT_SIZE_SCALE */
+ plot_style_fixed size; /**< Font size, in pt */
int weight; /**< Font weight: value in range [100,900] as per CSS */
plot_font_flags_t flags; /**< Font flags */
colour background; /**< Background colour to blend to, if appropriate */
diff --git a/include/netsurf/plotters.h b/include/netsurf/plotters.h
index 87fbd9a..2fd507a 100644
--- a/include/netsurf/plotters.h
+++ b/include/netsurf/plotters.h
@@ -108,7 +108,9 @@ struct plotter_table {
* operations within.
* \return NSERROR_OK on success else error code.
*/
- nserror (*clip)(const struct redraw_context *ctx, const struct rect *clip);
+ nserror (*clip)(
+ const struct redraw_context *ctx,
+ const struct rect *clip);
/**
* Plots an arc
@@ -126,7 +128,14 @@ struct plotter_table {
* \param angle2 The finish angle of the arc.
* \return NSERROR_OK on success else error code.
*/
- nserror (*arc)(const struct redraw_context *ctx, const plot_style_t *pstyle, int x, int y, int radius, int angle1, int angle2);
+ nserror (*arc)(
+ const struct redraw_context *ctx,
+ const plot_style_t *pstyle,
+ int x,
+ int y,
+ int radius,
+ int angle1,
+ int angle2);
/**
* Plots a circle
@@ -140,7 +149,12 @@ struct plotter_table {
* \param radius The radius of the circle.
* \return NSERROR_OK on success else error code.
*/
- nserror (*disc)(const struct redraw_context *ctx, const plot_style_t *pstyle, int x, int y, int radius);
+ nserror (*disc)(
+ const struct redraw_context *ctx,
+ const plot_style_t *pstyle,
+ int x,
+ int y,
+ int radius);
/**
* Plots a line
@@ -153,7 +167,10 @@ struct plotter_table {
* \param line A rectangle defining the line to be drawn
* \return NSERROR_OK on success else error code.
*/
- nserror (*line)(const struct redraw_context *ctx, const plot_style_t *pstyle, const struct rect *line);
+ nserror (*line)(
+ const struct redraw_context *ctx,
+ const plot_style_t *pstyle,
+ const struct rect *line);
/**
* Plots a rectangle.
@@ -168,7 +185,10 @@ struct plotter_table {
* \param rect A rectangle defining the line to be drawn
* \return NSERROR_OK on success else error code.
*/
- nserror (*rectangle)(const struct redraw_context *ctx, const plot_style_t *pstyle, const struct rect *rectangle);
+ nserror (*rectangle)(
+ const struct redraw_context *ctx,
+ const plot_style_t *pstyle,
+ const struct rect *rectangle);
/**
* Plot a polygon
@@ -184,7 +204,11 @@ struct plotter_table {
* \param n number of verticies.
* \return NSERROR_OK on success else error code.
*/
- nserror (*polygon)(const struct redraw_context *ctx, const plot_style_t *pstyle, const int *p, unsigned int n);
+ nserror (*polygon)(
+ const struct redraw_context *ctx,
+ const plot_style_t *pstyle,
+ const int *p,
+ unsigned int n);
/**
* Plots a path.
@@ -196,11 +220,15 @@ struct plotter_table {
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
- nserror (*path)(const struct redraw_context *ctx, const plot_style_t *pstyle, const float *p, unsigned int n, float width, const float transform[6]);
+ nserror (*path)(
+ const struct redraw_context *ctx,
+ const plot_style_t *pstyle,
+ const float *p,
+ unsigned int n,
+ const float transform[6]);
/**
* Plot a bitmap
@@ -226,7 +254,15 @@ struct plotter_table {
* \param flags the flags controlling the type of plot operation
* \return NSERROR_OK on success else error code.
*/
- nserror (*bitmap)(const struct redraw_context *ctx, struct bitmap *bitmap, int x, int y, int width, int height, colour bg, bitmap_flags_t flags);
+ nserror (*bitmap)(
+ const struct redraw_context *ctx,
+ struct bitmap *bitmap,
+ int x,
+ int y,
+ int width,
+ int height,
+ colour bg,
+ bitmap_flags_t flags);
/**
* Text plotting.
@@ -239,7 +275,13 @@ struct plotter_table {
* \param length length of string, in bytes
* \return NSERROR_OK on success else error code.
*/
- nserror (*text)(const struct redraw_context *ctx, const plot_font_style_t *fstyle, int x, int y, const char *text, size_t length);
+ nserror (*text)(
+ const struct redraw_context *ctx,
+ const plot_font_style_t *fstyle,
+ int x,
+ int y,
+ const char *text,
+ size_t length);
/**
* Start of a group of objects.
@@ -250,7 +292,9 @@ struct plotter_table {
* \param ctx The current redraw context.
* \return NSERROR_OK on success else error code.
*/
- nserror (*group_start)(const struct redraw_context *ctx, const char *name);
+ nserror (*group_start)(
+ const struct redraw_context *ctx,
+ const char *name);
/**
* End of the most recently started group.
@@ -260,7 +304,8 @@ struct plotter_table {
* \param ctx The current redraw context.
* \return NSERROR_OK on success else error code.
*/
- nserror (*group_end)(const struct redraw_context *ctx);
+ nserror (*group_end)(
+ const struct redraw_context *ctx);
/**
* Only used internally by the knockout code. Must be NULL in
@@ -269,7 +314,8 @@ struct plotter_table {
* \param ctx The current redraw context.
* \return NSERROR_OK on success else error code.
*/
- nserror (*flush)(const struct redraw_context *ctx);
+ nserror (*flush)(
+ const struct redraw_context *ctx);
/* flags */
/**
--
NetSurf Browser
5 years, 4 months
netsurf: branch tlsa/plotter-polish created. release/3.7-118-g8a931f0
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/8a931f01b958ad5862433...
...commit http://git.netsurf-browser.org/netsurf.git/commit/8a931f01b958ad5862433ec...
...tree http://git.netsurf-browser.org/netsurf.git/tree/8a931f01b958ad5862433ece6...
The branch, tlsa/plotter-polish has been created
at 8a931f01b958ad5862433ece6024bbde0aa4ecb8 (commit)
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=8a931f01b958ad58624...
commit 8a931f01b958ad5862433ece6024bbde0aa4ecb8
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Plotters: Expose array of font family strings to front ends.
diff --git a/content/handlers/html/font.c b/content/handlers/html/font.c
index 71843e1..7ebe168 100644
--- a/content/handlers/html/font.c
+++ b/content/handlers/html/font.c
@@ -144,6 +144,7 @@ void font_plot_style_from_css(
fstyle->family = plot_font_generic_family(
css_computed_font_family(css, &families));
+ fstyle->families = families;
css_computed_font_size(css, &length, &unit);
fstyle->size = FIXTOINT(FMUL(nscss_len2pt(len_ctx, length, unit),
diff --git a/include/netsurf/plot_style.h b/include/netsurf/plot_style.h
index d7a027c..f1b6172 100644
--- a/include/netsurf/plot_style.h
+++ b/include/netsurf/plot_style.h
@@ -26,6 +26,7 @@
#include <stdint.h>
#include <stdint.h>
+#include <libwapcaplet/libwapcaplet.h>
#include "netsurf/types.h"
/** light grey widget base colour */
@@ -108,6 +109,12 @@ typedef enum {
* Font style for plotting
*/
typedef struct plot_font_style {
+ /**
+ * Array of pointers to font families.
+ *
+ * May be NULL. Array is NULL terminated.
+ */
+ lwc_string * const * families;
plot_font_generic_family_t family; /**< Generic family to plot with */
plot_style_fixed size; /**< Font size, in pt */
int weight; /**< Font weight: value in range [100,900] as per CSS */
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=8332bf6b2a42fd03b86...
commit 8332bf6b2a42fd03b864e46f60eeaa76b51da496
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Plotters: Remove width param from path plotter.
We now use the stroke_width in the plot_style.
diff --git a/content/handlers/image/svg.c b/content/handlers/image/svg.c
index 766bb10..5126073 100644
--- a/content/handlers/image/svg.c
+++ b/content/handlers/image/svg.c
@@ -188,14 +188,14 @@ svg_redraw_internal(struct content *c,
for (i = 0; i != diagram->shape_count; i++) {
if (diagram->shape[i].path) {
+ pstyle.stroke_width = plot_style_int_to_fixed(
+ diagram->shape[i].stroke);
pstyle.stroke_colour = BGR(diagram->shape[i].stroke);
pstyle.fill_colour = BGR(diagram->shape[i].fill);
res = ctx->plot->path(ctx,
&pstyle,
diagram->shape[i].path,
diagram->shape[i].path_length,
- plot_style_int_to_fixed(
- diagram->shape[i].stroke_width),
transform);
if (res != NSERROR_OK) {
return false;
diff --git a/desktop/knockout.c b/desktop/knockout.c
index 6dbf4eb..127a48c 100644
--- a/desktop/knockout.c
+++ b/desktop/knockout.c
@@ -671,7 +671,6 @@ knockout_plot_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -680,14 +679,13 @@ knockout_plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
nserror res;
nserror ffres;
ffres = knockout_plot_flush(ctx);
- res = real_plot.path(ctx, pstyle, p, n, width, transform);
+ res = real_plot.path(ctx, pstyle, p, n, transform);
/* return the first error */
if ((res != NSERROR_OK) && (ffres == NSERROR_OK)) {
diff --git a/frontends/amiga/plotters.c b/frontends/amiga/plotters.c
index 58dc905..4623afa 100644
--- a/frontends/amiga/plotters.c
+++ b/frontends/amiga/plotters.c
@@ -868,7 +868,6 @@ ami_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -877,7 +876,6 @@ ami_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
unsigned int i;
diff --git a/frontends/atari/plot/plot.c b/frontends/atari/plot/plot.c
index 5f69f2a..4935b17 100644
--- a/frontends/atari/plot/plot.c
+++ b/frontends/atari/plot/plot.c
@@ -2343,7 +2343,6 @@ plot_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -2352,7 +2351,6 @@ plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
/** \todo Implement atari path plot */
diff --git a/frontends/beos/plotters.cpp b/frontends/beos/plotters.cpp
index a0a70f5..2c50f94 100644
--- a/frontends/beos/plotters.cpp
+++ b/frontends/beos/plotters.cpp
@@ -518,7 +518,6 @@ nsbeos_plot_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -527,7 +526,6 @@ nsbeos_plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
unsigned int i;
@@ -578,7 +576,7 @@ nsbeos_plot_path(const struct redraw_context *ctx,
rgb_color old_high = view->HighColor();
float old_pen = view->PenSize();
- view->SetPenSize(width);
+ view->SetPenSize(plot_style_fixed_to_float(pstyle->stroke_width));
view->MovePenTo(0, 0);
if (pstyle->fill_colour != NS_TRANSPARENT) {
view->SetHighColor(nsbeos_rgb_colour(pstyle->fill_colour));
diff --git a/frontends/framebuffer/framebuffer.c b/frontends/framebuffer/framebuffer.c
index 5a26035..52afdbf 100644
--- a/frontends/framebuffer/framebuffer.c
+++ b/frontends/framebuffer/framebuffer.c
@@ -261,7 +261,6 @@ framebuffer_plot_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -270,7 +269,6 @@ framebuffer_plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
NSLOG(netsurf, INFO, "path unimplemented");
diff --git a/frontends/gtk/plotters.c b/frontends/gtk/plotters.c
index 6178104..4a5ef51 100644
--- a/frontends/gtk/plotters.c
+++ b/frontends/gtk/plotters.c
@@ -399,7 +399,6 @@ nsgtk_plot_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -408,7 +407,6 @@ nsgtk_plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
unsigned int i;
@@ -426,7 +424,7 @@ nsgtk_plot_path(const struct redraw_context *ctx,
cairo_get_matrix(current_cr, &old_ctm);
/* Set up line style and width */
- cairo_set_line_width(current_cr, 1);
+ nsgtk_set_line_width(pstyle->stroke_width);
nsgtk_set_solid();
/* Load new CTM */
diff --git a/frontends/gtk/print.c b/frontends/gtk/print.c
index f447a46..c4f1b0f 100644
--- a/frontends/gtk/print.c
+++ b/frontends/gtk/print.c
@@ -427,7 +427,6 @@ nsgtk_print_plot_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -436,7 +435,6 @@ nsgtk_print_plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
/* Only the internal SVG renderer uses this plot call currently,
diff --git a/frontends/monkey/plot.c b/frontends/monkey/plot.c
index d00dca7..2fc9a3c 100644
--- a/frontends/monkey/plot.c
+++ b/frontends/monkey/plot.c
@@ -177,7 +177,6 @@ monkey_plot_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -186,12 +185,11 @@ monkey_plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
fprintf(stdout,
"PLOT PATH VERTICIES %d WIDTH %f\n",
- n, width);
+ n, plot_style_fixed_to_float(pstyle->stroke_width));
return NSERROR_OK;
}
@@ -273,7 +271,7 @@ static const struct plotter_table plotters = {
.path = monkey_plot_path,
.bitmap = monkey_plot_bitmap,
.text = monkey_plot_text,
- .option_knockout = true,
+ .option_knockout = true,
};
const struct plotter_table* monkey_plotters = &plotters;
diff --git a/frontends/riscos/plotters.c b/frontends/riscos/plotters.c
index 286ddab..2b30682 100644
--- a/frontends/riscos/plotters.c
+++ b/frontends/riscos/plotters.c
@@ -483,7 +483,6 @@ ro_plot_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -492,7 +491,6 @@ ro_plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
static const draw_line_style line_style = {
@@ -591,7 +589,9 @@ ro_plot_path(const struct redraw_context *ctx,
}
error = xdraw_stroke((draw_path *) path, 0, &trfm, 0,
- width * 2 * 256, &line_style, 0);
+ plot_style_fixed_to_int(
+ pstyle->stroke_width) * 2 * 256,
+ &line_style, 0);
if (error) {
NSLOG(netsurf, INFO, "xdraw_stroke: 0x%x: %s",
error->errnum, error->errmess);
diff --git a/frontends/riscos/print.c b/frontends/riscos/print.c
index d965baf..b390c69 100644
--- a/frontends/riscos/print.c
+++ b/frontends/riscos/print.c
@@ -831,7 +831,6 @@ print_fonts_plot_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
return NSERROR_OK;
diff --git a/frontends/riscos/save_draw.c b/frontends/riscos/save_draw.c
index 41764d9..28880e5 100644
--- a/frontends/riscos/save_draw.c
+++ b/frontends/riscos/save_draw.c
@@ -312,7 +312,6 @@ ro_save_draw_polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -321,7 +320,6 @@ ro_save_draw_path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
pencil_code code;
@@ -409,7 +407,8 @@ ro_save_draw_path(const struct redraw_context *ctx,
pstyle->stroke_colour == NS_TRANSPARENT ?
pencil_TRANSPARENT :
pstyle->stroke_colour << 8,
- width, pencil_JOIN_MITRED,
+ plot_style_fixed_to_int(style->stroke_width),
+ pencil_JOIN_MITRED,
pencil_CAP_BUTT,
pencil_CAP_BUTT,
0,
diff --git a/frontends/windows/plot.c b/frontends/windows/plot.c
index 60b175a..4d9096d 100644
--- a/frontends/windows/plot.c
+++ b/frontends/windows/plot.c
@@ -814,7 +814,6 @@ polygon(const struct redraw_context *ctx,
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -823,7 +822,6 @@ path(const struct redraw_context *ctx,
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6])
{
NSLOG(plot, DEEPDEBUG, "path unimplemented");
diff --git a/include/netsurf/plotters.h b/include/netsurf/plotters.h
index 4828eb4..2fd507a 100644
--- a/include/netsurf/plotters.h
+++ b/include/netsurf/plotters.h
@@ -220,7 +220,6 @@ struct plotter_table {
* \param pstyle Style controlling the path plot.
* \param p elements of path
* \param n nunber of elements on path
- * \param width The width of the path
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
@@ -229,7 +228,6 @@ struct plotter_table {
const plot_style_t *pstyle,
const float *p,
unsigned int n,
- float width,
const float transform[6]);
/**
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=5f4f23f11a1c2aaa85d...
commit 5f4f23f11a1c2aaa85df6bb58f0be6e66fa7cc7b
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Plotters: Split function parameters over multiple lines for readability.
diff --git a/include/netsurf/plotters.h b/include/netsurf/plotters.h
index 87fbd9a..4828eb4 100644
--- a/include/netsurf/plotters.h
+++ b/include/netsurf/plotters.h
@@ -108,7 +108,9 @@ struct plotter_table {
* operations within.
* \return NSERROR_OK on success else error code.
*/
- nserror (*clip)(const struct redraw_context *ctx, const struct rect *clip);
+ nserror (*clip)(
+ const struct redraw_context *ctx,
+ const struct rect *clip);
/**
* Plots an arc
@@ -126,7 +128,14 @@ struct plotter_table {
* \param angle2 The finish angle of the arc.
* \return NSERROR_OK on success else error code.
*/
- nserror (*arc)(const struct redraw_context *ctx, const plot_style_t *pstyle, int x, int y, int radius, int angle1, int angle2);
+ nserror (*arc)(
+ const struct redraw_context *ctx,
+ const plot_style_t *pstyle,
+ int x,
+ int y,
+ int radius,
+ int angle1,
+ int angle2);
/**
* Plots a circle
@@ -140,7 +149,12 @@ struct plotter_table {
* \param radius The radius of the circle.
* \return NSERROR_OK on success else error code.
*/
- nserror (*disc)(const struct redraw_context *ctx, const plot_style_t *pstyle, int x, int y, int radius);
+ nserror (*disc)(
+ const struct redraw_context *ctx,
+ const plot_style_t *pstyle,
+ int x,
+ int y,
+ int radius);
/**
* Plots a line
@@ -153,7 +167,10 @@ struct plotter_table {
* \param line A rectangle defining the line to be drawn
* \return NSERROR_OK on success else error code.
*/
- nserror (*line)(const struct redraw_context *ctx, const plot_style_t *pstyle, const struct rect *line);
+ nserror (*line)(
+ const struct redraw_context *ctx,
+ const plot_style_t *pstyle,
+ const struct rect *line);
/**
* Plots a rectangle.
@@ -168,7 +185,10 @@ struct plotter_table {
* \param rect A rectangle defining the line to be drawn
* \return NSERROR_OK on success else error code.
*/
- nserror (*rectangle)(const struct redraw_context *ctx, const plot_style_t *pstyle, const struct rect *rectangle);
+ nserror (*rectangle)(
+ const struct redraw_context *ctx,
+ const plot_style_t *pstyle,
+ const struct rect *rectangle);
/**
* Plot a polygon
@@ -184,7 +204,11 @@ struct plotter_table {
* \param n number of verticies.
* \return NSERROR_OK on success else error code.
*/
- nserror (*polygon)(const struct redraw_context *ctx, const plot_style_t *pstyle, const int *p, unsigned int n);
+ nserror (*polygon)(
+ const struct redraw_context *ctx,
+ const plot_style_t *pstyle,
+ const int *p,
+ unsigned int n);
/**
* Plots a path.
@@ -200,7 +224,13 @@ struct plotter_table {
* \param transform A transform to apply to the path.
* \return NSERROR_OK on success else error code.
*/
- nserror (*path)(const struct redraw_context *ctx, const plot_style_t *pstyle, const float *p, unsigned int n, float width, const float transform[6]);
+ nserror (*path)(
+ const struct redraw_context *ctx,
+ const plot_style_t *pstyle,
+ const float *p,
+ unsigned int n,
+ float width,
+ const float transform[6]);
/**
* Plot a bitmap
@@ -226,7 +256,15 @@ struct plotter_table {
* \param flags the flags controlling the type of plot operation
* \return NSERROR_OK on success else error code.
*/
- nserror (*bitmap)(const struct redraw_context *ctx, struct bitmap *bitmap, int x, int y, int width, int height, colour bg, bitmap_flags_t flags);
+ nserror (*bitmap)(
+ const struct redraw_context *ctx,
+ struct bitmap *bitmap,
+ int x,
+ int y,
+ int width,
+ int height,
+ colour bg,
+ bitmap_flags_t flags);
/**
* Text plotting.
@@ -239,7 +277,13 @@ struct plotter_table {
* \param length length of string, in bytes
* \return NSERROR_OK on success else error code.
*/
- nserror (*text)(const struct redraw_context *ctx, const plot_font_style_t *fstyle, int x, int y, const char *text, size_t length);
+ nserror (*text)(
+ const struct redraw_context *ctx,
+ const plot_font_style_t *fstyle,
+ int x,
+ int y,
+ const char *text,
+ size_t length);
/**
* Start of a group of objects.
@@ -250,7 +294,9 @@ struct plotter_table {
* \param ctx The current redraw context.
* \return NSERROR_OK on success else error code.
*/
- nserror (*group_start)(const struct redraw_context *ctx, const char *name);
+ nserror (*group_start)(
+ const struct redraw_context *ctx,
+ const char *name);
/**
* End of the most recently started group.
@@ -260,7 +306,8 @@ struct plotter_table {
* \param ctx The current redraw context.
* \return NSERROR_OK on success else error code.
*/
- nserror (*group_end)(const struct redraw_context *ctx);
+ nserror (*group_end)(
+ const struct redraw_context *ctx);
/**
* Only used internally by the knockout code. Must be NULL in
@@ -269,7 +316,8 @@ struct plotter_table {
* \param ctx The current redraw context.
* \return NSERROR_OK on success else error code.
*/
- nserror (*flush)(const struct redraw_context *ctx);
+ nserror (*flush)(
+ const struct redraw_context *ctx);
/* flags */
/**
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=66493421e65d8cbda3e...
commit 66493421e65d8cbda3e17fdbe43824387e3d51a7
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Plotters: Change stroke width in the plot_style_t to fixed point.
diff --git a/content/handlers/html/html_redraw_border.c b/content/handlers/html/html_redraw_border.c
index 2a849e8..0b3d858 100644
--- a/content/handlers/html/html_redraw_border.c
+++ b/content/handlers/html/html_redraw_border.c
@@ -111,7 +111,7 @@ html_redraw_border_plot(const int side,
plot_style_bdr.stroke_type = PLOT_OP_TYPE_DASH;
plot_style_bdr.stroke_colour = c;
- plot_style_bdr.stroke_width = thickness;
+ plot_style_bdr.stroke_width = (thickness << PLOT_STYLE_RADIX);
plot_style_fillbdr.fill_colour = c;
plot_style_fillbdr_dark.fill_colour = darken_colour(c);
plot_style_fillbdr_light.fill_colour = lighten_colour(c);
diff --git a/content/handlers/image/svg.c b/content/handlers/image/svg.c
index 924c848..766bb10 100644
--- a/content/handlers/image/svg.c
+++ b/content/handlers/image/svg.c
@@ -191,11 +191,12 @@ svg_redraw_internal(struct content *c,
pstyle.stroke_colour = BGR(diagram->shape[i].stroke);
pstyle.fill_colour = BGR(diagram->shape[i].fill);
res = ctx->plot->path(ctx,
- &pstyle,
- diagram->shape[i].path,
- diagram->shape[i].path_length,
- diagram->shape[i].stroke_width,
- transform);
+ &pstyle,
+ diagram->shape[i].path,
+ diagram->shape[i].path_length,
+ plot_style_int_to_fixed(
+ diagram->shape[i].stroke_width),
+ transform);
if (res != NSERROR_OK) {
return false;
}
diff --git a/desktop/local_history.c b/desktop/local_history.c
index dc5bac9..75da4af 100644
--- a/desktop/local_history.c
+++ b/desktop/local_history.c
@@ -55,7 +55,7 @@ struct local_history_session {
*/
static plot_style_t pstyle_line = {
.stroke_type = PLOT_OP_TYPE_SOLID,
- .stroke_width = 2,
+ .stroke_width = plot_style_int_to_fixed(2),
};
@@ -72,7 +72,7 @@ static plot_style_t pstyle_bg = {
*/
static plot_style_t pstyle_rect = {
.stroke_type = PLOT_OP_TYPE_SOLID,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
@@ -81,7 +81,7 @@ static plot_style_t pstyle_rect = {
*/
static plot_style_t pstyle_rect_sel = {
.stroke_type = PLOT_OP_TYPE_SOLID,
- .stroke_width = 3,
+ .stroke_width = plot_style_int_to_fixed(3),
};
diff --git a/desktop/plot_style.c b/desktop/plot_style.c
index c3a4139..0595414 100644
--- a/desktop/plot_style.c
+++ b/desktop/plot_style.c
@@ -47,7 +47,7 @@ plot_style_t *plot_style_fill_red = &plot_style_fill_red_static;
static const plot_style_t plot_style_content_edge_static = {
.stroke_type = PLOT_OP_TYPE_SOLID,
.stroke_colour = 0x00ff0000,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
plot_style_t const * const plot_style_content_edge =
&plot_style_content_edge_static;
@@ -55,7 +55,7 @@ plot_style_t const * const plot_style_content_edge =
static const plot_style_t plot_style_padding_edge_static = {
.stroke_type = PLOT_OP_TYPE_SOLID,
.stroke_colour = 0x000000ff,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
plot_style_t const * const plot_style_padding_edge =
&plot_style_padding_edge_static;
@@ -63,7 +63,7 @@ plot_style_t const * const plot_style_padding_edge =
static const plot_style_t plot_style_margin_edge_static = {
.stroke_type = PLOT_OP_TYPE_SOLID,
.stroke_colour = 0x0000ffff,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
plot_style_t const * const plot_style_margin_edge =
&plot_style_margin_edge_static;
@@ -74,7 +74,7 @@ static const plot_style_t plot_style_broken_object_static = {
.fill_colour = 0x008888ff,
.stroke_type = PLOT_OP_TYPE_SOLID,
.stroke_colour = 0x000000ff,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
plot_style_t const * const plot_style_broken_object =
&plot_style_broken_object_static;
@@ -134,7 +134,7 @@ plot_style_t *plot_style_fill_wblobc = &plot_style_fill_wblobc_static;
static plot_style_t plot_style_stroke_wblobc_static = {
.stroke_type = PLOT_OP_TYPE_SOLID,
.stroke_colour = WIDGET_BLOBC,
- .stroke_width = 2,
+ .stroke_width = plot_style_int_to_fixed(2),
};
plot_style_t *plot_style_stroke_wblobc = &plot_style_stroke_wblobc_static;
diff --git a/desktop/save_pdf.c b/desktop/save_pdf.c
index 83e3d4f..8891900 100644
--- a/desktop/save_pdf.c
+++ b/desktop/save_pdf.c
@@ -213,10 +213,10 @@ bool pdf_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *psty
}
apply_clip_and_mode(false,
- NS_TRANSPARENT,
- pstyle->stroke_colour,
- pstyle->stroke_width,
- dash);
+ NS_TRANSPARENT,
+ pstyle->stroke_colour,
+ plot_style_int_to_fixed(pstyle->stroke_width),
+ dash);
HPDF_Page_Rectangle(pdf_page, x0, page_height - y0, x1 - x0, -(y1 - y0));
HPDF_Page_Stroke(pdf_page);
@@ -245,10 +245,10 @@ bool pdf_plot_line(int x0, int y0, int x1, int y1, const plot_style_t *pstyle)
}
apply_clip_and_mode(false,
- NS_TRANSPARENT,
- pstyle->stroke_colour,
- pstyle->stroke_width,
- dash);
+ NS_TRANSPARENT,
+ pstyle->stroke_colour,
+ plot_style_int_to_fixed(pstyle->stroke_width),
+ dash);
HPDF_Page_MoveTo(pdf_page, x0, page_height - y0);
HPDF_Page_LineTo(pdf_page, x1, page_height - y1);
diff --git a/desktop/scrollbar.c b/desktop/scrollbar.c
index 5a7420a..af5536b 100644
--- a/desktop/scrollbar.c
+++ b/desktop/scrollbar.c
@@ -164,17 +164,17 @@ scrollbar_rectangle(const struct redraw_context *ctx,
static plot_style_t c0 = {
.stroke_type = PLOT_OP_TYPE_SOLID,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
static plot_style_t c1 = {
.stroke_type = PLOT_OP_TYPE_SOLID,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
static plot_style_t c2 = {
.stroke_type = PLOT_OP_TYPE_SOLID,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
if (inset) {
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 5666c97..5bae27a 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -45,9 +45,9 @@
#define TA_ALLOC_STEP 512
static plot_style_t pstyle_stroke_caret = {
- .stroke_type = PLOT_OP_TYPE_SOLID,
- .stroke_colour = CARET_COLOR,
- .stroke_width = 1,
+ .stroke_type = PLOT_OP_TYPE_SOLID,
+ .stroke_colour = CARET_COLOR,
+ .stroke_width = plot_style_int_to_fixed(1),
};
struct line_info {
diff --git a/frontends/amiga/dt_sound.c b/frontends/amiga/dt_sound.c
index ae313bb..f3b365d 100644
--- a/frontends/amiga/dt_sound.c
+++ b/frontends/amiga/dt_sound.c
@@ -195,7 +195,7 @@ bool amiga_dt_sound_redraw(struct content *c,
.fill_type = PLOT_OP_TYPE_SOLID,
.fill_colour = 0xffffff,
.stroke_colour = 0x000000,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
struct rect rect;
diff --git a/frontends/amiga/plotters.c b/frontends/amiga/plotters.c
index b848543..58dc905 100644
--- a/frontends/amiga/plotters.c
+++ b/frontends/amiga/plotters.c
@@ -722,8 +722,8 @@ ami_line(const struct redraw_context *ctx,
struct gui_globals *glob = (struct gui_globals *)ctx->priv;
- glob->rp->PenWidth = style->stroke_width;
- glob->rp->PenHeight = style->stroke_width;
+ glob->rp->PenWidth = plot_style_fixed_to_int(style->stroke_width);
+ glob->rp->PenHeight = plot_style_fixed_to_int(style->stroke_width);
switch (style->stroke_type) {
case PLOT_OP_TYPE_SOLID: /**< Solid colour */
@@ -780,8 +780,8 @@ ami_rectangle(const struct redraw_context *ctx,
}
if (style->stroke_type != PLOT_OP_TYPE_NONE) {
- glob->rp->PenWidth = style->stroke_width;
- glob->rp->PenHeight = style->stroke_width;
+ glob->rp->PenWidth = plot_style_fixed_to_int(style->stroke_width);
+ glob->rp->PenHeight = plot_style_fixed_to_int(style->stroke_width);
switch (style->stroke_type) {
case PLOT_OP_TYPE_SOLID: /**< Solid colour */
diff --git a/frontends/amiga/plugin_hack.c b/frontends/amiga/plugin_hack.c
index 4fd1f03..5d7ec19 100644
--- a/frontends/amiga/plugin_hack.c
+++ b/frontends/amiga/plugin_hack.c
@@ -151,7 +151,7 @@ bool amiga_plugin_hack_redraw(struct content *c,
.fill_type = PLOT_OP_TYPE_SOLID,
.fill_colour = 0xffffff,
.stroke_colour = 0x000000,
- .stroke_width = 1,
+ .stroke_width = plot_style_int_to_fixed(1),
};
struct rect rect;
nserror res;
diff --git a/frontends/atari/plot/plot.c b/frontends/atari/plot/plot.c
index 14c6703..5f69f2a 100644
--- a/frontends/atari/plot/plot.c
+++ b/frontends/atari/plot/plot.c
@@ -2124,7 +2124,7 @@ plot_line(const struct redraw_context *ctx,
{
short pxy[4];
uint32_t lt;
- int sw = pstyle->stroke_width;
+ int sw = plot_style_fixed_to_int(pstyle->stroke_width);
if (((line->x0 < 0) && (line->x1 < 0)) ||
((line->y0 < 0) && (line->y1 < 0))) {
@@ -2183,7 +2183,7 @@ plot_rectangle(const struct redraw_context *ctx,
{
short pxy[4];
GRECT r, rclip, sclip;
- int sw = pstyle->stroke_width;
+ int sw = plot_style_fixed_to_int(pstyle->stroke_width);
uint32_t lt;
/* current canvas clip: */
@@ -2266,7 +2266,7 @@ plot_rectangle(const struct redraw_context *ctx,
if (pstyle->fill_type != PLOT_OP_TYPE_NONE ) {
short stroke_width = (short)(pstyle->stroke_type != PLOT_OP_TYPE_NONE) ?
- pstyle->stroke_width : 0;
+ plot_style_fixed_to_int(pstyle->stroke_width) : 0;
vsf_rgbcolor(atari_plot_vdi_handle, pstyle->fill_colour);
vsf_perimeter(atari_plot_vdi_handle, 0);
diff --git a/frontends/beos/plotters.cpp b/frontends/beos/plotters.cpp
index c4903e0..a0a70f5 100644
--- a/frontends/beos/plotters.cpp
+++ b/frontends/beos/plotters.cpp
@@ -370,7 +370,7 @@ nsbeos_plot_line(const struct redraw_context *ctx,
nsbeos_set_colour(style->stroke_colour);
float pensize = view->PenSize();
- view->SetPenSize(style->stroke_width);
+ view->SetPenSize(plot_style_fixed_to_float(style->stroke_width));
BPoint start(line->x0, line->y0);
BPoint end(line->x1, line->y1);
@@ -447,7 +447,7 @@ nsbeos_plot_rectangle(const struct redraw_context *ctx,
nsbeos_set_colour(style->stroke_colour);
float pensize = view->PenSize();
- view->SetPenSize(style->stroke_width);
+ view->SetPenSize(plot_style_fixed_to_float(style->stroke_width));
BRect rect(nsrect->x0, nsrect->y0, nsrect->x1, nsrect->y1);
view->StrokeRect(rect, pat);
diff --git a/frontends/framebuffer/framebuffer.c b/frontends/framebuffer/framebuffer.c
index 2ccc750..5a26035 100644
--- a/frontends/framebuffer/framebuffer.c
+++ b/frontends/framebuffer/framebuffer.c
@@ -168,7 +168,7 @@ framebuffer_plot_line(const struct redraw_context *ctx,
}
pen.stroke_colour = style->stroke_colour;
- pen.stroke_width = style->stroke_width;
+ pen.stroke_width = plot_style_fixed_to_int(style->stroke_width);
nsfb_plot_line(nsfb, &rect, &pen);
}
@@ -216,7 +216,9 @@ framebuffer_plot_rectangle(const struct redraw_context *ctx,
dashed = true;
}
- nsfb_plot_rectangle(nsfb, &rect, style->stroke_width, style->stroke_colour, dotted, dashed);
+ nsfb_plot_rectangle(nsfb, &rect,
+ plot_style_fixed_to_int(style->stroke_width),
+ style->stroke_colour, dotted, dashed);
}
return NSERROR_OK;
}
diff --git a/frontends/gtk/plotters.c b/frontends/gtk/plotters.c
index 88e7760..6178104 100644
--- a/frontends/gtk/plotters.c
+++ b/frontends/gtk/plotters.c
@@ -89,6 +89,20 @@ static inline void nsgtk_set_dashed(void)
/**
+ * Set cairo context line width.
+ */
+static inline void nsgtk_set_line_width(plot_style_fixed width)
+{
+ if (width == 0) {
+ cairo_set_line_width(current_cr, 1);
+ } else {
+ cairo_set_line_width(current_cr,
+ plot_style_fixed_to_double(width));
+ }
+}
+
+
+/**
* \brief Sets a clip rectangle for subsequent plot operations.
*
* \param ctx The current redraw context.
@@ -191,10 +205,7 @@ nsgtk_plot_disc(const struct redraw_context *ctx,
break;
}
- if (style->stroke_width == 0)
- cairo_set_line_width(current_cr, 1);
- else
- cairo_set_line_width(current_cr, style->stroke_width);
+ nsgtk_set_line_width(style->stroke_width);
cairo_arc(current_cr, x, y, radius, 0, M_PI * 2);
@@ -242,10 +253,7 @@ nsgtk_plot_line(const struct redraw_context *ctx,
nsgtk_set_colour(style->stroke_colour);
}
- if (style->stroke_width == 0)
- cairo_set_line_width(current_cr, 1);
- else
- cairo_set_line_width(current_cr, style->stroke_width);
+ nsgtk_set_line_width(style->stroke_width);
/* core expects horizontal and vertical lines to be on pixels, not
* between pixels
@@ -331,10 +339,7 @@ nsgtk_plot_rectangle(const struct redraw_context *ctx,
break;
}
- if (style->stroke_width == 0)
- cairo_set_line_width(current_cr, 1);
- else
- cairo_set_line_width(current_cr, style->stroke_width);
+ nsgtk_set_line_width(style->stroke_width);
cairo_rectangle(current_cr,
rect->x0 + 0.5,
diff --git a/frontends/gtk/print.c b/frontends/gtk/print.c
index 8f71230..f447a46 100644
--- a/frontends/gtk/print.c
+++ b/frontends/gtk/print.c
@@ -133,6 +133,17 @@ static inline void nsgtk_print_set_dashed(void)
cairo_set_dash(gtk_print_current_cr, cdashes, 1, 0);
}
+/** Set cairo context line width. */
+static inline void nsgtk_set_line_width(plot_style_fixed width)
+{
+ if (width == 0) {
+ cairo_set_line_width(gtk_print_current_cr, 1);
+ } else {
+ cairo_set_line_width(gtk_print_current_cr,
+ plot_style_fixed_to_double(width));
+ }
+}
+
/**
* \brief Sets a clip rectangle for subsequent plot operations.
@@ -248,10 +259,7 @@ nsgtk_print_plot_disc(const struct redraw_context *ctx,
break;
}
- if (style->stroke_width == 0)
- cairo_set_line_width(gtk_print_current_cr, 1);
- else
- cairo_set_line_width(gtk_print_current_cr, style->stroke_width);
+ nsgtk_set_line_width(style->stroke_width);
cairo_arc(gtk_print_current_cr, x, y, radius, 0, M_PI * 2);
@@ -294,10 +302,7 @@ nsgtk_print_plot_line(const struct redraw_context *ctx,
break;
}
- if (style->stroke_width == 0)
- cairo_set_line_width(gtk_print_current_cr, 1);
- else
- cairo_set_line_width(gtk_print_current_cr, style->stroke_width);
+ nsgtk_set_line_width(style->stroke_width);
cairo_move_to(gtk_print_current_cr, line->x0 + 0.5, line->y0 + 0.5);
cairo_line_to(gtk_print_current_cr, line->x1 + 0.5, line->y1 + 0.5);
@@ -350,13 +355,6 @@ nsgtk_print_plot_rectangle(const struct redraw_context *ctx,
}
if (style->stroke_type != PLOT_OP_TYPE_NONE) {
- int stroke_width;
-
- /* ensure minimum stroke width */
- stroke_width = style->stroke_width;
- if (stroke_width == 0) {
- stroke_width = 1;
- }
nsgtk_print_set_colour(style->stroke_colour);
@@ -375,7 +373,7 @@ nsgtk_print_plot_rectangle(const struct redraw_context *ctx,
break;
}
- cairo_set_line_width(gtk_print_current_cr, stroke_width);
+ nsgtk_set_line_width(style->stroke_width);
cairo_rectangle(gtk_print_current_cr,
rect->x0, rect->y0,
diff --git a/frontends/riscos/plotters.c b/frontends/riscos/plotters.c
index 2fbd12a..286ddab 100644
--- a/frontends/riscos/plotters.c
+++ b/frontends/riscos/plotters.c
@@ -324,9 +324,9 @@ ro_plot_line(const struct redraw_context *ctx,
dashed = true;
return ro_plot_draw_path((const draw_path *)path,
- style->stroke_width,
- style->stroke_colour,
- dotted, dashed);
+ plot_style_fixed_to_int(style->stroke_width),
+ style->stroke_colour,
+ dotted, dashed);
}
return NSERROR_OK;
}
@@ -412,10 +412,10 @@ ro_plot_rectangle(const struct redraw_context *ctx,
dashed = true;
ro_plot_draw_path((const draw_path *)path,
- style->stroke_width,
- style->stroke_colour,
- dotted,
- dashed);
+ plot_style_fixed_to_int(style->stroke_width),
+ style->stroke_colour,
+ dotted,
+ dashed);
}
return NSERROR_OK;
diff --git a/frontends/riscos/save_draw.c b/frontends/riscos/save_draw.c
index 9ee7304..41764d9 100644
--- a/frontends/riscos/save_draw.c
+++ b/frontends/riscos/save_draw.c
@@ -168,7 +168,7 @@ ro_save_draw_line(const struct redraw_context *ctx,
sizeof path / sizeof path[0],
pencil_TRANSPARENT,
style->stroke_colour << 8,
- style->stroke_width,
+ plot_style_fixed_to_int(style->stroke_width),
pencil_JOIN_MITRED,
pencil_CAP_BUTT,
pencil_CAP_BUTT,
@@ -235,7 +235,7 @@ ro_save_draw_rectangle(const struct redraw_context *ctx,
sizeof path / sizeof path[0],
pencil_TRANSPARENT,
style->stroke_colour << 8,
- style->stroke_width,
+ plot_style_fixed_to_int(style->stroke_width),
pencil_JOIN_MITRED,
pencil_CAP_BUTT,
pencil_CAP_BUTT,
diff --git a/frontends/windows/plot.c b/frontends/windows/plot.c
index 3668e4b..60b175a 100644
--- a/frontends/windows/plot.c
+++ b/frontends/windows/plot.c
@@ -601,7 +601,9 @@ line(const struct redraw_context *ctx,
(style->stroke_type == PLOT_OP_TYPE_DASH) ? PS_DASH:
0);
LOGBRUSH lb = {BS_SOLID, col, 0};
- HPEN pen = ExtCreatePen(penstyle, style->stroke_width, &lb, 0, NULL);
+ HPEN pen = ExtCreatePen(penstyle,
+ plot_style_fixed_to_int(style->stroke_width),
+ &lb, 0, NULL);
if (pen == NULL) {
DeleteObject(clipregion);
return NSERROR_INVALID;
@@ -672,7 +674,9 @@ rectangle(const struct redraw_context *ctx,
if (style->fill_type == PLOT_OP_TYPE_NONE)
lb1.lbStyle = BS_HOLLOW;
- HPEN pen = ExtCreatePen(penstyle, style->stroke_width, &lb, 0, NULL);
+ HPEN pen = ExtCreatePen(penstyle,
+ plot_style_fixed_to_int(style->stroke_width),
+ &lb, 0, NULL);
if (pen == NULL) {
return NSERROR_INVALID;
}
diff --git a/include/netsurf/plot_style.h b/include/netsurf/plot_style.h
index db5a5ee..d7a027c 100644
--- a/include/netsurf/plot_style.h
+++ b/include/netsurf/plot_style.h
@@ -25,6 +25,7 @@
#define NETSURF_PLOT_STYLE_H
#include <stdint.h>
+#include <stdint.h>
#include "netsurf/types.h"
/** light grey widget base colour */
@@ -45,6 +46,18 @@
/* type for fixed point numbers */
typedef int32_t plot_style_fixed;
+/* Convert an int to fixed point */
+#define plot_style_int_to_fixed(v) ((v) << PLOT_STYLE_RADIX)
+
+/* Convert fixed point to int */
+#define plot_style_fixed_to_int(v) ((v) >> PLOT_STYLE_RADIX)
+
+/* Convert fixed point to float */
+#define plot_style_fixed_to_float(v) (((float)v) / PLOT_STYLE_SCALE)
+
+/* Convert fixed point to double */
+#define plot_style_fixed_to_double(v) (((double)v) / PLOT_STYLE_SCALE)
+
/**
* Type of plot operation
*/
@@ -61,7 +74,7 @@ typedef enum {
*/
typedef struct plot_style_s {
plot_operation_type_t stroke_type; /**< Stroke plot type */
- int stroke_width; /**< Width of stroke, in pixels */
+ plot_style_fixed stroke_width; /**< Width of stroke, in pixels */
colour stroke_colour; /**< Colour of stroke */
plot_operation_type_t fill_type; /**< Fill plot type */
colour fill_colour; /**< Colour of fill */
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=a58d97a41a619203857...
commit a58d97a41a6192038573da6862571dc72a560458
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Plotters: Add plot_style_fixed type, and use for font size.
diff --git a/content/handlers/html/box_textarea.c b/content/handlers/html/box_textarea.c
index 858de50..c19afbb 100644
--- a/content/handlers/html/box_textarea.c
+++ b/content/handlers/html/box_textarea.c
@@ -244,7 +244,7 @@ bool box_textarea_create_textarea(html_content *html,
textarea_flags ta_flags;
plot_font_style_t fstyle = {
.family = PLOT_FONT_FAMILY_SANS_SERIF,
- .size = 10 * FONT_SIZE_SCALE,
+ .size = 10 * PLOT_STYLE_SCALE,
.weight = 400,
.flags = FONTF_NONE,
.background = 0,
diff --git a/content/handlers/html/font.c b/content/handlers/html/font.c
index 9dbf592..71843e1 100644
--- a/content/handlers/html/font.c
+++ b/content/handlers/html/font.c
@@ -147,11 +147,11 @@ void font_plot_style_from_css(
css_computed_font_size(css, &length, &unit);
fstyle->size = FIXTOINT(FMUL(nscss_len2pt(len_ctx, length, unit),
- INTTOFIX(FONT_SIZE_SCALE)));
+ INTTOFIX(PLOT_STYLE_SCALE)));
/* Clamp font size to configured minimum */
- if (fstyle->size < (nsoption_int(font_min_size) * FONT_SIZE_SCALE) / 10)
- fstyle->size = (nsoption_int(font_min_size) * FONT_SIZE_SCALE) / 10;
+ if (fstyle->size < (nsoption_int(font_min_size) * PLOT_STYLE_SCALE) / 10)
+ fstyle->size = (nsoption_int(font_min_size) * PLOT_STYLE_SCALE) / 10;
fstyle->weight = plot_font_weight(css_computed_font_weight(css));
fstyle->flags = plot_font_flags(css_computed_font_style(css),
diff --git a/content/handlers/html/form.c b/content/handlers/html/form.c
index 9fe2e77..8ba99d4 100644
--- a/content/handlers/html/form.c
+++ b/content/handlers/html/form.c
@@ -1160,7 +1160,7 @@ bool form_open_select_menu(void *client_data,
menu->line_height = FIXTOINT(FDIV((FMUL(FLTTOFIX(1.2),
FMUL(nscss_screen_dpi,
- INTTOFIX(fstyle.size / FONT_SIZE_SCALE)))),
+ INTTOFIX(fstyle.size / PLOT_STYLE_SCALE)))),
F_72));
line_height_with_spacing = menu->line_height +
diff --git a/content/handlers/image/svg.c b/content/handlers/image/svg.c
index 2edc7bd..924c848 100644
--- a/content/handlers/image/svg.c
+++ b/content/handlers/image/svg.c
@@ -210,7 +210,7 @@ svg_redraw_internal(struct content *c,
fstyle.background = 0xffffff;
fstyle.foreground = 0x000000;
- fstyle.size = (8 * FONT_SIZE_SCALE) * scale;
+ fstyle.size = (8 * PLOT_STYLE_SCALE) * scale;
res = ctx->plot->text(ctx,
&fstyle,
diff --git a/content/handlers/text/textplain.c b/content/handlers/text/textplain.c
index e6d167b..af990d1 100644
--- a/content/handlers/text/textplain.c
+++ b/content/handlers/text/textplain.c
@@ -86,7 +86,7 @@ typedef struct textplain_content {
#define MARGIN 4
#define TAB_WIDTH 8 /* must be power of 2 currently */
-#define TEXT_SIZE 10 * FONT_SIZE_SCALE /* Unscaled text size in pt */
+#define TEXT_SIZE 10 * PLOT_STYLE_SCALE /* Unscaled text size in pt */
static plot_font_style_t textplain_style = {
.family = PLOT_FONT_FAMILY_MONOSPACE,
@@ -149,7 +149,7 @@ textplain_create_internal(textplain_content *c, lwc_string *encoding)
parserutils_inputstream *stream;
parserutils_error error;
- textplain_style.size = (nsoption_int(font_size) * FONT_SIZE_SCALE) / 10;
+ textplain_style.size = (nsoption_int(font_size) * PLOT_STYLE_SCALE) / 10;
utf8_data = malloc(CHUNK);
if (utf8_data == NULL)
@@ -400,7 +400,7 @@ static float textplain_line_height(void)
/* Size is in points, so convert to pixels.
* Then use a constant line height of 1.2 x font size.
*/
- return FIXTOFLT(FDIV((FMUL(FLTTOFIX(1.2), FMUL(nscss_screen_dpi, INTTOFIX((textplain_style.size / FONT_SIZE_SCALE))))), F_72));
+ return FIXTOFLT(FDIV((FMUL(FLTTOFIX(1.2), FMUL(nscss_screen_dpi, INTTOFIX((textplain_style.size / PLOT_STYLE_SCALE))))), F_72));
}
diff --git a/desktop/font_haru.c b/desktop/font_haru.c
index f92d891..4ee9824 100644
--- a/desktop/font_haru.c
+++ b/desktop/font_haru.c
@@ -352,7 +352,7 @@ bool haru_nsfont_apply_style(const plot_font_style_t *fstyle,
if (size <= 0)
return true;
- size /= FONT_SIZE_SCALE;
+ size /= PLOT_STYLE_SCALE;
if (size > HPDF_MAX_FONTSIZE)
size = HPDF_MAX_FONTSIZE;
diff --git a/desktop/local_history.c b/desktop/local_history.c
index 3219de9..dc5bac9 100644
--- a/desktop/local_history.c
+++ b/desktop/local_history.c
@@ -90,7 +90,7 @@ static plot_style_t pstyle_rect_sel = {
*/
static plot_font_style_t pfstyle_node = {
.family = PLOT_FONT_FAMILY_SANS_SERIF,
- .size = 8 * FONT_SIZE_SCALE,
+ .size = 8 * PLOT_STYLE_SCALE,
.weight = 400,
.flags = FONTF_NONE,
};
@@ -101,7 +101,7 @@ static plot_font_style_t pfstyle_node = {
*/
static plot_font_style_t pfstyle_node_sel = {
.family = PLOT_FONT_FAMILY_SANS_SERIF,
- .size = 8 * FONT_SIZE_SCALE,
+ .size = 8 * PLOT_STYLE_SCALE,
.weight = 900,
.flags = FONTF_NONE,
};
diff --git a/desktop/plot_style.c b/desktop/plot_style.c
index 1f0ac39..c3a4139 100644
--- a/desktop/plot_style.c
+++ b/desktop/plot_style.c
@@ -81,7 +81,7 @@ plot_style_t const * const plot_style_broken_object =
static const plot_font_style_t plot_fstyle_broken_object_static = {
.family = PLOT_FONT_FAMILY_SANS_SERIF,
- .size = 16 * FONT_SIZE_SCALE,
+ .size = 16 * PLOT_STYLE_SCALE,
.weight = 400,
.flags = FONTF_NONE,
.background = 0x8888ff,
@@ -156,7 +156,7 @@ plot_style_t *plot_style_stroke_lightwbasec = &plot_style_stroke_lightwbasec_sta
/* Generic font style */
static const plot_font_style_t plot_style_font_static = {
.family = PLOT_FONT_FAMILY_SANS_SERIF,
- .size = 8 * FONT_SIZE_SCALE,
+ .size = 8 * PLOT_STYLE_SCALE,
.weight = 400,
.flags = FONTF_NONE,
.background = 0xffffff,
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 3fd4c98..5666c97 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -1805,7 +1805,7 @@ static void textarea_setup_text_offsets(struct textarea *ta)
ta->line_height = FIXTOINT(FMUL(FLTTOFIX(1.3), FDIV(FMUL(
nscss_screen_dpi, FDIV(INTTOFIX(ta->fstyle.size),
- INTTOFIX(FONT_SIZE_SCALE))), F_72)));
+ INTTOFIX(PLOT_STYLE_SCALE))), F_72)));
text_y_offset = text_y_offset_baseline = ta->border_width;
if (ta->flags & TEXTAREA_MULTILINE) {
@@ -1948,7 +1948,7 @@ struct textarea *textarea_create(const textarea_flags flags,
ret->line_height = FIXTOINT(FMUL(FLTTOFIX(1.3), FDIV(FMUL(
nscss_screen_dpi, FDIV(INTTOFIX(setup->text.size),
- INTTOFIX(FONT_SIZE_SCALE))), F_72)));
+ INTTOFIX(PLOT_STYLE_SCALE))), F_72)));
ret->caret_pos.line = ret->caret_pos.byte_off = -1;
ret->caret_x = 0;
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 1651ff5..928a696 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -5195,7 +5195,7 @@ nserror treeview_init(void)
10 + 36) / 72;
tree_g.line_height = (font_px_size * 8 + 3) / 6;
- res = treeview_init_plot_styles(font_pt_size * FONT_SIZE_SCALE / 10);
+ res = treeview_init_plot_styles(font_pt_size * PLOT_STYLE_SCALE / 10);
if (res != NSERROR_OK) {
return res;
}
diff --git a/frontends/amiga/font_bullet.c b/frontends/amiga/font_bullet.c
index c8ad34c..62c2dde 100644
--- a/frontends/amiga/font_bullet.c
+++ b/frontends/amiga/font_bullet.c
@@ -63,7 +63,7 @@
#define NSA_VALUE_SHEARSIN (1 << 14)
#define NSA_VALUE_SHEARCOS (1 << 16)
-#define NSA_FONT_EMWIDTH(s) (s / FONT_SIZE_SCALE) * (ami_font_dpi_get_xdpi() / 72.0)
+#define NSA_FONT_EMWIDTH(s) (s / PLOT_STYLE_SCALE) * (ami_font_dpi_get_xdpi() / 72.0)
const uint16 sc_table[] = {
0x0061, 0x1D00, /* a */
@@ -512,7 +512,7 @@ static struct OutlineFont *ami_open_outline_font(const plot_font_style_t *fstyle
}
/* Scale to 16.16 fixed point */
- ysize = fstyle->size * ((1 << 16) / FONT_SIZE_SCALE);
+ ysize = fstyle->size * ((1 << 16) / PLOT_STYLE_SCALE);
if(designed_node == NULL) {
ofont = node->font;
diff --git a/frontends/amiga/font_diskfont.c b/frontends/amiga/font_diskfont.c
index 2da3f00..a587d6e 100644
--- a/frontends/amiga/font_diskfont.c
+++ b/frontends/amiga/font_diskfont.c
@@ -97,7 +97,7 @@ static struct TextFont *ami_font_bm_open(struct RastPort *rp, const plot_font_st
snprintf(font, MAX_FONT_NAME_SIZE, "%s.font", fontname);
tattr.ta_Name = font;
- tattr.ta_YSize = fstyle->size / FONT_SIZE_SCALE;
+ tattr.ta_YSize = fstyle->size / PLOT_STYLE_SCALE;
NSLOG(netsurf, INFO, "font: %s/%d", tattr.ta_Name, tattr.ta_YSize);
if(prev_font != NULL) CloseFont(prev_font);
diff --git a/frontends/atari/plot/font_freetype.c b/frontends/atari/plot/font_freetype.c
index 1688e97..f8109f6 100644
--- a/frontends/atari/plot/font_freetype.c
+++ b/frontends/atari/plot/font_freetype.c
@@ -250,7 +250,7 @@ static void ft_fill_scalar(const plot_font_style_t *fstyle, FTC_Scaler srec)
srec->face_id = (FTC_FaceID)font_faces[selected_face];
- srec->width = srec->height = (fstyle->size * 64) / FONT_SIZE_SCALE;
+ srec->width = srec->height = (fstyle->size * 64) / PLOT_STYLE_SCALE;
srec->pixel = 0;
/* calculate x/y resolution, when browser_get_dpi() isn't available */
diff --git a/frontends/atari/plot/font_vdi.c b/frontends/atari/plot/font_vdi.c
index 7cd82dd..556c08e 100644
--- a/frontends/atari/plot/font_vdi.c
+++ b/frontends/atari/plot/font_vdi.c
@@ -106,9 +106,9 @@ static int str_width( FONT_PLOTTER self,const plot_font_style_t *fstyle, const c
fx |= 1;
vst_effects( self->vdi_handle, fx );
/* TODO: replace 90 with global dpi setting */
- //pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 );
+ //pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 / 72 );
//vst_height( self->vdi_handle, pxsize ,&cw, &ch, &cellw, &cellh);
- pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 );
+ pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 );
vst_point( self->vdi_handle, pxsize, &cw, &ch, &cellw, &cellh);
/*
if(slen != utf8_bounded_length(str, length)){
@@ -148,10 +148,10 @@ static int str_split( FONT_PLOTTER self, const plot_font_style_t * fstyle, const
if( fstyle->weight > 450 )
fx |= 1;
vst_effects( self->vdi_handle, fx );
- //pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 );
+ //pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 / 72 );
//vst_height( self->vdi_handle, pxsize ,&cw, &ch, &cellw, &cellh);
- pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 );
+ pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 );
vst_point( self->vdi_handle, pxsize, &cw, &ch, &cellw, &cellh);
*actual_x = 0;
//*char_offset = 0;
@@ -216,7 +216,7 @@ static int pixel_pos( FONT_PLOTTER self, const plot_font_style_t * fstyle,const
if( fstyle->weight > 450 )
fx |= 1;
vst_effects(self->vdi_handle, fx);
- pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 );
+ pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 / 72 );
vst_height( self->vdi_handle, pxsize ,&cw, &ch, &cellw, &cellh);
*actual_x = 0;
*char_offset = 0;
@@ -283,8 +283,8 @@ static int text( FONT_PLOTTER self, int x, int y, const char *text, size_t leng
/* TODO: netsurf uses 90 as default dpi ( somewhere defined in libcss),
use that value or pass it as arg, to reduce netsurf dependency */
- //pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 );
- pxsize = ceil( (fstyle->size/FONT_SIZE_SCALE) * 90 / 72 );
+ //pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 / 72 );
+ pxsize = ceil( (fstyle->size/PLOT_STYLE_SCALE) * 90 / 72 );
plot_get_dimensions(&canvas);
x += canvas.g_x;
diff --git a/frontends/atari/toolbar.c b/frontends/atari/toolbar.c
index fdfedcb..b8f4226 100644
--- a/frontends/atari/toolbar.c
+++ b/frontends/atari/toolbar.c
@@ -94,7 +94,7 @@ static float toolbar_url_scale = 1.0;
static plot_font_style_t font_style_url = {
.family = PLOT_FONT_FAMILY_SANS_SERIF,
- .size = 14*FONT_SIZE_SCALE,
+ .size = 14*PLOT_STYLE_SCALE,
.weight = 400,
.flags = FONTF_NONE,
.background = 0xffffff,
@@ -302,7 +302,7 @@ struct s_toolbar *toolbar_create(struct s_gui_win_root *owner)
/* create the url widget: */
font_style_url.size =
- toolbar_styles[t->style].font_height_pt * FONT_SIZE_SCALE;
+ toolbar_styles[t->style].font_height_pt * PLOT_STYLE_SCALE;
textarea_flags ta_flags = TEXTAREA_INTERNAL_CARET;
textarea_setup ta_setup;
diff --git a/frontends/beos/font.cpp b/frontends/beos/font.cpp
index 8111303..5e7e782 100644
--- a/frontends/beos/font.cpp
+++ b/frontends/beos/font.cpp
@@ -130,7 +130,7 @@ void nsbeos_style_to_font(BFont &font, const struct plot_font_style *fstyle)
}
//fprintf(stderr, "nsbeos_style_to_font: value %f unit %d\n", style->font_size.value.length.value, style->font_size.value.length.unit);
- size = fstyle->size / FONT_SIZE_SCALE;
+ size = fstyle->size / PLOT_STYLE_SCALE;
//fprintf(stderr, "nsbeos_style_to_font: %f %d\n", size, style->font_size.value.length.unit);
diff --git a/frontends/framebuffer/fbtk/text.c b/frontends/framebuffer/fbtk/text.c
index 4f3a238..9c96dce 100644
--- a/frontends/framebuffer/fbtk/text.c
+++ b/frontends/framebuffer/fbtk/text.c
@@ -71,7 +71,7 @@ fb_text_font_style(fbtk_widget_t *widget, int *font_height, int *padding,
#endif
font_style->family = PLOT_FONT_FAMILY_SANS_SERIF;
- font_style->size = px_to_pt(*font_height * FONT_SIZE_SCALE);
+ font_style->size = px_to_pt(*font_height * PLOT_STYLE_SCALE);
font_style->weight = 400;
font_style->flags = FONTF_NONE;
font_style->background = widget->bg;
diff --git a/frontends/framebuffer/font_freetype.c b/frontends/framebuffer/font_freetype.c
index 9e47e4b..744ac62 100644
--- a/frontends/framebuffer/font_freetype.c
+++ b/frontends/framebuffer/font_freetype.c
@@ -392,7 +392,7 @@ static void fb_fill_scalar(const plot_font_style_t *fstyle, FTC_Scaler srec)
srec->face_id = (FTC_FaceID)fb_faces[selected_face];
- srec->width = srec->height = (fstyle->size * 64) / FONT_SIZE_SCALE;
+ srec->width = srec->height = (fstyle->size * 64) / PLOT_STYLE_SCALE;
srec->pixel = 0;
srec->x_res = srec->y_res = browser_get_dpi();
diff --git a/frontends/framebuffer/font_internal.c b/frontends/framebuffer/font_internal.c
index ff3471d..d755681 100644
--- a/frontends/framebuffer/font_internal.c
+++ b/frontends/framebuffer/font_internal.c
@@ -212,7 +212,7 @@ fb_get_font_size(const plot_font_style_t *fstyle)
{
int size = fstyle->size * 10 /
(((nsoption_int(font_min_size) * 3 +
- nsoption_int(font_size)) / 4) * FONT_SIZE_SCALE);
+ nsoption_int(font_size)) / 4) * PLOT_STYLE_SCALE);
if (size > 2)
size = 2;
else if (size <= 0)
diff --git a/frontends/gtk/layout_pango.c b/frontends/gtk/layout_pango.c
index a5964eb..9e8e94d 100644
--- a/frontends/gtk/layout_pango.c
+++ b/frontends/gtk/layout_pango.c
@@ -277,7 +277,7 @@ nsfont_style_to_description(const plot_font_style_t *fstyle)
break;
}
- size = (fstyle->size * PANGO_SCALE) / FONT_SIZE_SCALE;
+ size = (fstyle->size * PANGO_SCALE) / PLOT_STYLE_SCALE;
if (fstyle->flags & FONTF_ITALIC)
style = PANGO_STYLE_ITALIC;
diff --git a/frontends/monkey/layout.c b/frontends/monkey/layout.c
index 7b72231..0d6a3b4 100644
--- a/frontends/monkey/layout.c
+++ b/frontends/monkey/layout.c
@@ -33,7 +33,7 @@ static nserror nsfont_width(const plot_font_style_t *fstyle,
const char *string, size_t length,
int *width)
{
- *width = (fstyle->size * utf8_bounded_length(string, length)) / FONT_SIZE_SCALE;
+ *width = (fstyle->size * utf8_bounded_length(string, length)) / PLOT_STYLE_SCALE;
return NSERROR_OK;
}
@@ -53,10 +53,10 @@ static nserror nsfont_position_in_string(const plot_font_style_t *fstyle,
const char *string, size_t length,
int x, size_t *char_offset, int *actual_x)
{
- *char_offset = x / (fstyle->size / FONT_SIZE_SCALE);
+ *char_offset = x / (fstyle->size / PLOT_STYLE_SCALE);
if (*char_offset > length)
*char_offset = length;
- *actual_x = *char_offset * (fstyle->size / FONT_SIZE_SCALE);
+ *actual_x = *char_offset * (fstyle->size / PLOT_STYLE_SCALE);
return NSERROR_OK;
}
@@ -88,7 +88,7 @@ static nserror nsfont_split(const plot_font_style_t *fstyle,
const char *string, size_t length,
int x, size_t *char_offset, int *actual_x)
{
- int c_off = *char_offset = x / (fstyle->size / FONT_SIZE_SCALE);
+ int c_off = *char_offset = x / (fstyle->size / PLOT_STYLE_SCALE);
if (*char_offset > length) {
*char_offset = length;
} else {
@@ -104,7 +104,7 @@ static nserror nsfont_split(const plot_font_style_t *fstyle,
}
}
}
- *actual_x = *char_offset * (fstyle->size / FONT_SIZE_SCALE);
+ *actual_x = *char_offset * (fstyle->size / PLOT_STYLE_SCALE);
return NSERROR_OK;
}
diff --git a/frontends/riscos/font.c b/frontends/riscos/font.c
index 8913efe..2ff3090 100644
--- a/frontends/riscos/font.c
+++ b/frontends/riscos/font.c
@@ -469,7 +469,7 @@ void nsfont_read_style(const plot_font_style_t *fstyle,
rufl_WEIGHT_900
};
- *font_size = (fstyle->size * 16) / FONT_SIZE_SCALE;
+ *font_size = (fstyle->size * 16) / PLOT_STYLE_SCALE;
if (1600 < *font_size)
*font_size = 1600;
diff --git a/frontends/windows/font.c b/frontends/windows/font.c
index 37ccf23..7389bd8 100644
--- a/frontends/windows/font.c
+++ b/frontends/windows/font.c
@@ -120,7 +120,7 @@ HFONT get_font(const plot_font_style_t *style)
int nHeight = -10;
HDC hdc = GetDC(font_hwnd);
- nHeight = -MulDiv(style->size, GetDeviceCaps(hdc, LOGPIXELSY), 72 * FONT_SIZE_SCALE);
+ nHeight = -MulDiv(style->size, GetDeviceCaps(hdc, LOGPIXELSY), 72 * PLOT_STYLE_SCALE);
ReleaseDC(font_hwnd, hdc);
HFONT font = CreateFont(
diff --git a/include/netsurf/plot_style.h b/include/netsurf/plot_style.h
index 30db366..db5a5ee 100644
--- a/include/netsurf/plot_style.h
+++ b/include/netsurf/plot_style.h
@@ -36,8 +36,14 @@
/** Transparent colour value. */
#define NS_TRANSPARENT 0x01000000
-/** Scaling factor for font sizes */
-#define FONT_SIZE_SCALE 1024
+/** 22:10 fixed point */
+#define PLOT_STYLE_RADIX (10)
+
+/** Scaling factor for plot styles */
+#define PLOT_STYLE_SCALE (1 << PLOT_STYLE_RADIX)
+
+/* type for fixed point numbers */
+typedef int32_t plot_style_fixed;
/**
* Type of plot operation
@@ -90,7 +96,7 @@ typedef enum {
*/
typedef struct plot_font_style {
plot_font_generic_family_t family; /**< Generic family to plot with */
- int size; /**< Font size, in points * FONT_SIZE_SCALE */
+ plot_style_fixed size; /**< Font size, in pt */
int weight; /**< Font weight: value in range [100,900] as per CSS */
plot_font_flags_t flags; /**< Font flags */
colour background; /**< Background colour to blend to, if appropriate */
-----------------------------------------------------------------------
--
NetSurf Browser
5 years, 4 months
netsurf: branch master updated. release/3.7-113-g6cabd4c
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/6cabd4cd628833afa32ae...
...commit http://git.netsurf-browser.org/netsurf.git/commit/6cabd4cd628833afa32aeb7...
...tree http://git.netsurf-browser.org/netsurf.git/tree/6cabd4cd628833afa32aeb7c6...
The branch, master has been updated
via 6cabd4cd628833afa32aeb7c614ef153b4a1c985 (commit)
from 7c3da95a07f0d21860e6803567b0603127c517c1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=6cabd4cd628833afa32...
commit 6cabd4cd628833afa32aeb7c614ef153b4a1c985
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
remove spurious messages file from framebuffer install target
diff --git a/frontends/framebuffer/Makefile b/frontends/framebuffer/Makefile
index 489eab9..bdedd90 100644
--- a/frontends/framebuffer/Makefile
+++ b/frontends/framebuffer/Makefile
@@ -170,7 +170,7 @@ EXETARGET := nsfb
NETSURF_FRAMEBUFFER_RESOURCE_LIST := adblock.css credits.html \
default.css internal.css licence.html \
- netsurf.png quirks.css welcome.html maps.html Messages
+ netsurf.png quirks.css welcome.html maps.html
install-framebuffer:
$(Q)$(MKDIR) -p $(DESTDIR)$(NETSURF_FRAMEBUFFER_BIN)
-----------------------------------------------------------------------
Summary of changes:
frontends/framebuffer/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/frontends/framebuffer/Makefile b/frontends/framebuffer/Makefile
index 489eab9..bdedd90 100644
--- a/frontends/framebuffer/Makefile
+++ b/frontends/framebuffer/Makefile
@@ -170,7 +170,7 @@ EXETARGET := nsfb
NETSURF_FRAMEBUFFER_RESOURCE_LIST := adblock.css credits.html \
default.css internal.css licence.html \
- netsurf.png quirks.css welcome.html maps.html Messages
+ netsurf.png quirks.css welcome.html maps.html
install-framebuffer:
$(Q)$(MKDIR) -p $(DESTDIR)$(NETSURF_FRAMEBUFFER_BIN)
--
NetSurf Browser
5 years, 4 months
netsurf: branch master updated. release/3.7-112-g7c3da95
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/7c3da95a07f0d21860e68...
...commit http://git.netsurf-browser.org/netsurf.git/commit/7c3da95a07f0d21860e6803...
...tree http://git.netsurf-browser.org/netsurf.git/tree/7c3da95a07f0d21860e680356...
The branch, master has been updated
via 7c3da95a07f0d21860e6803567b0603127c517c1 (commit)
from 216fb88f58227f94e87d9e9926b599161a8e65bb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=7c3da95a07f0d21860e...
commit 7c3da95a07f0d21860e6803567b0603127c517c1
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Resolve resource leak on error (coverity issue 1390560)
diff --git a/utils/messages.c b/utils/messages.c
index e1e6120..2e22cc7 100644
--- a/utils/messages.c
+++ b/utils/messages.c
@@ -57,16 +57,16 @@ static nserror messages_load_ctx(const char *path, struct hash_table **ctx)
{
struct hash_table *nctx; /* new context */
nserror res;
-
- if (*ctx == NULL) {
- nctx = hash_create(HASH_SIZE);
- } else {
+
+ if (*ctx != NULL) {
/**
* \note The passed hash is not copied here so this
* updates in place.
*/
- nctx = *ctx;
+ return hash_add_file(*ctx, path);
}
+
+ nctx = hash_create(HASH_SIZE);
if (nctx == NULL) {
NSLOG(netsurf, INFO,
"Unable to create hash table for messages file %s",
@@ -74,10 +74,11 @@ static nserror messages_load_ctx(const char *path, struct hash_table **ctx)
return NSERROR_NOMEM;
}
-
res = hash_add_file(nctx, path);
if (res == NSERROR_OK) {
*ctx = nctx;
+ } else {
+ hash_destroy(nctx);
}
return res;
@@ -337,4 +338,3 @@ void messages_destroy(void)
messages_destroy_ctx(messages_hash);
messages_hash = NULL;
}
-
-----------------------------------------------------------------------
Summary of changes:
utils/messages.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/utils/messages.c b/utils/messages.c
index e1e6120..2e22cc7 100644
--- a/utils/messages.c
+++ b/utils/messages.c
@@ -57,16 +57,16 @@ static nserror messages_load_ctx(const char *path, struct hash_table **ctx)
{
struct hash_table *nctx; /* new context */
nserror res;
-
- if (*ctx == NULL) {
- nctx = hash_create(HASH_SIZE);
- } else {
+
+ if (*ctx != NULL) {
/**
* \note The passed hash is not copied here so this
* updates in place.
*/
- nctx = *ctx;
+ return hash_add_file(*ctx, path);
}
+
+ nctx = hash_create(HASH_SIZE);
if (nctx == NULL) {
NSLOG(netsurf, INFO,
"Unable to create hash table for messages file %s",
@@ -74,10 +74,11 @@ static nserror messages_load_ctx(const char *path, struct hash_table **ctx)
return NSERROR_NOMEM;
}
-
res = hash_add_file(nctx, path);
if (res == NSERROR_OK) {
*ctx = nctx;
+ } else {
+ hash_destroy(nctx);
}
return res;
@@ -337,4 +338,3 @@ void messages_destroy(void)
messages_destroy_ctx(messages_hash);
messages_hash = NULL;
}
-
--
NetSurf Browser
5 years, 4 months
netsurf: branch master updated. release/3.7-111-g216fb88
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/216fb88f58227f94e87d9...
...commit http://git.netsurf-browser.org/netsurf.git/commit/216fb88f58227f94e87d9e9...
...tree http://git.netsurf-browser.org/netsurf.git/tree/216fb88f58227f94e87d9e992...
The branch, master has been updated
via 216fb88f58227f94e87d9e9926b599161a8e65bb (commit)
from dc9e7c989f1a259a8fee9a6e1a4c6be6186f7c31 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=216fb88f58227f94e87...
commit 216fb88f58227f94e87d9e9926b599161a8e65bb
Author: Vincent Sanders <vince(a)netsurf-browser.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
clean up html content handler header use
Improve header use in preperation for making browser window a corewindow
diff --git a/content/handlers/html/box_construct.c b/content/handlers/html/box_construct.c
index 9c19391..5650fbf 100644
--- a/content/handlers/html/box_construct.c
+++ b/content/handlers/html/box_construct.c
@@ -49,6 +49,7 @@
#include "css/utils.h"
#include "desktop/gui_internal.h"
+#include "html/html.h"
#include "html/box.h"
#include "html/box_textarea.h"
#include "html/form_internal.h"
diff --git a/content/handlers/html/box_textarea.c b/content/handlers/html/box_textarea.c
index abd28fb..858de50 100644
--- a/content/handlers/html/box_textarea.c
+++ b/content/handlers/html/box_textarea.c
@@ -28,6 +28,8 @@
#include "netsurf/keypress.h"
#include "desktop/textarea.h"
+#include "html/html_internal.h"
+#include "html/box.h"
#include "html/box_textarea.h"
#include "html/font.h"
#include "html/form_internal.h"
diff --git a/content/handlers/html/box_textarea.h b/content/handlers/html/box_textarea.h
index e2b02e8..822fc8b 100644
--- a/content/handlers/html/box_textarea.h
+++ b/content/handlers/html/box_textarea.h
@@ -24,11 +24,9 @@
#ifndef NETSURF_HTML_BOX_TEXTAREA_H
#define NETSURF_HTML_BOX_TEXTAREA_H
-
-#include "html/box.h"
-#include "html/html_internal.h"
-
struct dom_node;
+struct html_content;
+struct box;
/**
* Create textarea widget for a form element
@@ -37,7 +35,7 @@ struct dom_node;
* \param box box with gadget to be given textarea widget
* \param node DOM node for form element
*/
-bool box_textarea_create_textarea(html_content *html,
+bool box_textarea_create_textarea(struct html_content *html,
struct box *box, struct dom_node *node);
@@ -49,6 +47,6 @@ bool box_textarea_create_textarea(html_content *html,
* \param key keypress
* \return true iff keypress handled
*/
-bool box_textarea_keypress(html_content *html, struct box *box, uint32_t key);
+bool box_textarea_keypress(struct html_content *html, struct box *box, uint32_t key);
#endif
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index 18c1a7a..f721b98 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -54,9 +54,11 @@
#include "javascript/js.h"
#include "desktop/gui_internal.h"
+#include "html/html.h"
+#include "html/html_save.h"
+#include "html/html_internal.h"
#include "html/box.h"
#include "html/form_internal.h"
-#include "html/html_internal.h"
#include "html/imagemap.h"
#include "html/layout.h"
#include "html/search.h"
diff --git a/content/handlers/html/html.h b/content/handlers/html/html.h
index 691e969..8d1c779 100644
--- a/content/handlers/html/html.h
+++ b/content/handlers/html/html.h
@@ -28,9 +28,6 @@
#include <stdbool.h>
-#include <dom/dom.h>
-#include <dom/bindings/hubbub/parser.h>
-
#include "netsurf/types.h"
#include "netsurf/content_type.h"
#include "netsurf/browser_window.h"
@@ -65,6 +62,7 @@ struct html_stylesheet {
bool unused;
};
+
/**
* Container for scripts used by an HTML document
*/
@@ -103,12 +101,10 @@ struct content_html_object {
bool background; /**< This object is a background image. */
};
-struct html_scrollbar_data {
- struct content *c;
- struct box *box;
-};
-/** Frame tree (frameset or frame tag) */
+/**
+ * Frame tree (frameset or frame tag)
+ */
struct content_html_frames {
int cols; /** number of columns in frameset */
int rows; /** number of rows in frameset */
@@ -129,7 +125,9 @@ struct content_html_frames {
struct content_html_frames *children; /** [cols * rows] children */
};
-/** Inline frame list (iframe tag) */
+/**
+ * Inline frame list (iframe tag)
+ */
struct content_html_iframe {
struct box *box;
@@ -153,19 +151,46 @@ struct content_html_iframe {
#define STYLESHEET_USER 3 /* user stylesheet */
#define STYLESHEET_START 4 /* start of document stylesheets */
+/**
+ * initialise content handler
+ *
+ * \return NSERROR_OK on success otherwise appropriate error code
+ */
nserror html_init(void);
+/**
+ * redraw a specific box
+ *
+ * used by core browser
+ */
void html_redraw_a_box(struct hlcache_handle *h, struct box *box);
-void html_overflow_scroll_drag_end(struct scrollbar *scrollbar,
- browser_mouse_state mouse, int x, int y);
-
-dom_document *html_get_document(struct hlcache_handle *h);
-struct box *html_get_box_tree(struct hlcache_handle *h);
+/**
+ * obtain html frame content from handle
+ *
+ * used by core browser
+ */
struct content_html_frames *html_get_frameset(struct hlcache_handle *h);
+
+/**
+ * obtain html iframe content from handle
+ *
+ * used by core browser
+ */
struct content_html_iframe *html_get_iframe(struct hlcache_handle *h);
-struct nsurl *html_get_base_url(struct hlcache_handle *h);
+
+/**
+ * obtain html base target from handle
+ *
+ * used by core browser
+ */
const char *html_get_base_target(struct hlcache_handle *h);
+
+/**
+ * set filename on a file gadget
+ *
+ * used by core browser
+ */
void html_set_file_gadget_filename(struct hlcache_handle *hl,
struct form_control *gadget, const char *fn);
@@ -179,8 +204,19 @@ void html_set_file_gadget_filename(struct hlcache_handle *hl,
struct html_stylesheet *html_get_stylesheets(struct hlcache_handle *h,
unsigned int *n);
+/**
+ * Retrieve objects used by HTML document
+ *
+ * \param h Content to retrieve objects from
+ * \param n Pointer to location to receive number of objects
+ * \return Pointer to array of objects
+ */
struct content_html_object *html_get_objects(struct hlcache_handle *h,
unsigned int *n);
+
+/**
+ * get the offset within the docuemnt of a fragment id
+ */
bool html_get_id_offset(struct hlcache_handle *h, lwc_string *frag_id,
int *x, int *y);
diff --git a/content/handlers/html/html_css.c b/content/handlers/html/html_css.c
index b67d19a..7b2d469 100644
--- a/content/handlers/html/html_css.c
+++ b/content/handlers/html/html_css.c
@@ -38,6 +38,7 @@
#include "css/css.h"
#include "desktop/gui_internal.h"
+#include "html/html.h"
#include "html/html_internal.h"
static nsurl *html_default_stylesheet_url;
diff --git a/content/handlers/html/html_interaction.c b/content/handlers/html/html_interaction.c
index 898f55b..648d274 100644
--- a/content/handlers/html/html_interaction.c
+++ b/content/handlers/html/html_interaction.c
@@ -294,6 +294,45 @@ html__image_coords_dom_user_data_handler(dom_node_operation operation,
}
}
+
+/**
+ * End overflow scroll scrollbar drags
+ *
+ * \param scrollbar scrollbar widget
+ * \param mouse state of mouse buttons and modifier keys
+ * \param x coordinate of mouse
+ * \param y coordinate of mouse
+ */
+static void
+html_overflow_scroll_drag_end(struct scrollbar *scrollbar,
+ browser_mouse_state mouse,
+ int x, int y)
+{
+ int scroll_mouse_x, scroll_mouse_y, box_x, box_y;
+ struct html_scrollbar_data *data = scrollbar_get_data(scrollbar);
+ struct box *box;
+
+ box = data->box;
+ box_coords(box, &box_x, &box_y);
+
+ if (scrollbar_is_horizontal(scrollbar)) {
+ scroll_mouse_x = x - box_x;
+ scroll_mouse_y = y - (box_y + box->padding[TOP] +
+ box->height + box->padding[BOTTOM] -
+ SCROLLBAR_WIDTH);
+ scrollbar_mouse_drag_end(scrollbar, mouse,
+ scroll_mouse_x, scroll_mouse_y);
+ } else {
+ scroll_mouse_x = x - (box_x + box->padding[LEFT] +
+ box->width + box->padding[RIGHT] -
+ SCROLLBAR_WIDTH);
+ scroll_mouse_y = y - box_y;
+ scrollbar_mouse_drag_end(scrollbar, mouse,
+ scroll_mouse_x, scroll_mouse_y);
+ }
+}
+
+
/**
* Handle mouse clicks and movements in an HTML content window.
*
@@ -1227,41 +1266,6 @@ void html_overflow_scroll_callback(void *client_data,
}
-/**
- * End overflow scroll scrollbar drags
- *
- * \param scrollbar scrollbar widget
- * \param mouse state of mouse buttons and modifier keys
- * \param x coordinate of mouse
- * \param y coordinate of mouse
- */
-void html_overflow_scroll_drag_end(struct scrollbar *scrollbar,
- browser_mouse_state mouse, int x, int y)
-{
- int scroll_mouse_x, scroll_mouse_y, box_x, box_y;
- struct html_scrollbar_data *data = scrollbar_get_data(scrollbar);
- struct box *box;
-
- box = data->box;
- box_coords(box, &box_x, &box_y);
-
- if (scrollbar_is_horizontal(scrollbar)) {
- scroll_mouse_x = x - box_x;
- scroll_mouse_y = y - (box_y + box->padding[TOP] +
- box->height + box->padding[BOTTOM] -
- SCROLLBAR_WIDTH);
- scrollbar_mouse_drag_end(scrollbar, mouse,
- scroll_mouse_x, scroll_mouse_y);
- } else {
- scroll_mouse_x = x - (box_x + box->padding[LEFT] +
- box->width + box->padding[RIGHT] -
- SCROLLBAR_WIDTH);
- scroll_mouse_y = y - box_y;
- scrollbar_mouse_drag_end(scrollbar, mouse,
- scroll_mouse_x, scroll_mouse_y);
- }
-}
-
/* Documented in html_internal.h */
void html_set_drag_type(html_content *html, html_drag_type drag_type,
union html_drag_owner drag_owner, const struct rect *rect)
diff --git a/content/handlers/html/html_internal.h b/content/handlers/html/html_internal.h
index b9eca66..77354c3 100644
--- a/content/handlers/html/html_internal.h
+++ b/content/handlers/html/html_internal.h
@@ -25,14 +25,14 @@
#define NETSURF_HTML_HTML_INTERNAL_H
#include <libcss/libcss.h>
+#include <dom/bindings/hubbub/parser.h>
-#include "content/handlers/css/utils.h"
+#include "netsurf/types.h"
#include "content/content_protected.h"
#include "desktop/selection.h"
-#include "html/html.h"
-
struct gui_layout_table;
+struct scrollbar_msg_data;
typedef enum {
HTML_DRAG_NONE, /** No drag */
@@ -44,12 +44,15 @@ typedef enum {
HTML_DRAG_CONTENT_SCROLL /** Not own; drag in child content */
} html_drag_type;
+/**
+ * For drags we don't own
+ */
union html_drag_owner {
bool no_owner;
struct box *content;
struct scrollbar *scrollbar;
struct box *textarea;
-}; /**< For drags we don't own */
+};
typedef enum {
HTML_SELECTION_NONE, /** No selection */
@@ -57,24 +60,39 @@ typedef enum {
HTML_SELECTION_SELF, /** Selection in this html content */
HTML_SELECTION_CONTENT /** Selection in child content */
} html_selection_type;
+
+/**
+ * For getting at selections in this content or things in this content
+ */
union html_selection_owner {
bool none;
struct box *textarea;
struct box *content;
-}; /**< For getting at selections in this content or things in this content */
+};
typedef enum {
- HTML_FOCUS_SELF, /** Focus is our own */
- HTML_FOCUS_CONTENT, /** Focus belongs to child content */
- HTML_FOCUS_TEXTAREA /** Focus belongs to textarea */
+ HTML_FOCUS_SELF, /**< Focus is our own */
+ HTML_FOCUS_CONTENT, /**< Focus belongs to child content */
+ HTML_FOCUS_TEXTAREA /**< Focus belongs to textarea */
} html_focus_type;
+
+/**
+ * For directing input
+ */
union html_focus_owner {
bool self;
struct box *textarea;
struct box *content;
-}; /**< For directing input */
+};
-/** Data specific to CONTENT_HTML. */
+struct html_scrollbar_data {
+ struct content *c;
+ struct box *box;
+};
+
+/**
+ * Data specific to CONTENT_HTML.
+ */
typedef struct html_content {
struct content base;
diff --git a/content/handlers/html/html_object.c b/content/handlers/html/html_object.c
index c8715e3..7eab466 100644
--- a/content/handlers/html/html_object.c
+++ b/content/handlers/html/html_object.c
@@ -40,6 +40,7 @@
#include "desktop/scrollbar.h"
#include "desktop/gui_internal.h"
+#include "html/html.h"
#include "html/box.h"
#include "html/html_internal.h"
diff --git a/content/handlers/html/html_save.h b/content/handlers/html/html_save.h
new file mode 100644
index 0000000..c173922
--- /dev/null
+++ b/content/handlers/html/html_save.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2018 Vincent Sanders <vince(a)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
+ * Interface to HTML content handler to save documents.
+ *
+ * \todo Investigate altering this API as it is only used for
+ * exporting the html content to disc.
+ */
+
+#ifndef NETSURF_HTML_HTML_SAVE_H
+#define NETSURF_HTML_HTML_SAVE_H
+
+/**
+ * get the dom document of a html content from a handle
+ */
+dom_document *html_get_document(struct hlcache_handle *h);
+
+
+/**
+ * get the render box tree of a html content from a handle
+ */
+struct box *html_get_box_tree(struct hlcache_handle *h);
+
+/**
+ * get the base url of an html content from a handle
+ */
+struct nsurl *html_get_base_url(struct hlcache_handle *h);
+
+#endif
diff --git a/content/handlers/html/html_script.c b/content/handlers/html/html_script.c
index e18a0ca..80992b9 100644
--- a/content/handlers/html/html_script.c
+++ b/content/handlers/html/html_script.c
@@ -39,6 +39,7 @@
#include "content/fetch.h"
#include "content/hlcache.h"
+#include "html/html.h"
#include "html/html_internal.h"
typedef bool (script_handler_t)(struct jscontext *jscontext, const char *data, size_t size) ;
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index 6941d67..2d2c424 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -56,10 +56,12 @@
#include "desktop/scrollbar.h"
#include "desktop/textarea.h"
+#include "html/html.h"
+#include "html/html_save.h"
+#include "html/html_internal.h"
#include "html/box.h"
#include "html/font.h"
#include "html/form_internal.h"
-#include "html/html_internal.h"
#include "html/layout.h"
#include "html/table.h"
diff --git a/desktop/save_complete.c b/desktop/save_complete.c
index cd4ab30..ef794d4 100644
--- a/desktop/save_complete.c
+++ b/desktop/save_complete.c
@@ -44,6 +44,7 @@
#include "content/hlcache.h"
#include "css/css.h"
#include "html/box.h"
+#include "html/html_save.h"
#include "html/html.h"
#include "netsurf/misc.h"
diff --git a/desktop/save_text.c b/desktop/save_text.c
index c4abb16..a86f173 100644
--- a/desktop/save_text.c
+++ b/desktop/save_text.c
@@ -33,7 +33,7 @@
#include "utils/utils.h"
#include "netsurf/content.h"
#include "html/box.h"
-#include "html/html.h"
+#include "html/html_save.h"
#include "netsurf/utf8.h"
#include "desktop/gui_internal.h"
-----------------------------------------------------------------------
Summary of changes:
content/handlers/html/box_construct.c | 1 +
content/handlers/html/box_textarea.c | 2 +
content/handlers/html/box_textarea.h | 10 ++-
content/handlers/html/html.c | 4 +-
content/handlers/html/html.h | 66 +++++++++++++----
content/handlers/html/html_css.c | 1 +
content/handlers/html/html_interaction.c | 74 +++++++++++---------
content/handlers/html/html_internal.h | 38 +++++++---
content/handlers/html/html_object.c | 1 +
.../handlers/html/html_save.h | 28 ++++----
content/handlers/html/html_script.c | 1 +
content/handlers/html/layout.c | 4 +-
desktop/save_complete.c | 1 +
desktop/save_text.c | 2 +-
14 files changed, 150 insertions(+), 83 deletions(-)
copy frontends/gtk/completion.h => content/handlers/html/html_save.h (53%)
diff --git a/content/handlers/html/box_construct.c b/content/handlers/html/box_construct.c
index 9c19391..5650fbf 100644
--- a/content/handlers/html/box_construct.c
+++ b/content/handlers/html/box_construct.c
@@ -49,6 +49,7 @@
#include "css/utils.h"
#include "desktop/gui_internal.h"
+#include "html/html.h"
#include "html/box.h"
#include "html/box_textarea.h"
#include "html/form_internal.h"
diff --git a/content/handlers/html/box_textarea.c b/content/handlers/html/box_textarea.c
index abd28fb..858de50 100644
--- a/content/handlers/html/box_textarea.c
+++ b/content/handlers/html/box_textarea.c
@@ -28,6 +28,8 @@
#include "netsurf/keypress.h"
#include "desktop/textarea.h"
+#include "html/html_internal.h"
+#include "html/box.h"
#include "html/box_textarea.h"
#include "html/font.h"
#include "html/form_internal.h"
diff --git a/content/handlers/html/box_textarea.h b/content/handlers/html/box_textarea.h
index e2b02e8..822fc8b 100644
--- a/content/handlers/html/box_textarea.h
+++ b/content/handlers/html/box_textarea.h
@@ -24,11 +24,9 @@
#ifndef NETSURF_HTML_BOX_TEXTAREA_H
#define NETSURF_HTML_BOX_TEXTAREA_H
-
-#include "html/box.h"
-#include "html/html_internal.h"
-
struct dom_node;
+struct html_content;
+struct box;
/**
* Create textarea widget for a form element
@@ -37,7 +35,7 @@ struct dom_node;
* \param box box with gadget to be given textarea widget
* \param node DOM node for form element
*/
-bool box_textarea_create_textarea(html_content *html,
+bool box_textarea_create_textarea(struct html_content *html,
struct box *box, struct dom_node *node);
@@ -49,6 +47,6 @@ bool box_textarea_create_textarea(html_content *html,
* \param key keypress
* \return true iff keypress handled
*/
-bool box_textarea_keypress(html_content *html, struct box *box, uint32_t key);
+bool box_textarea_keypress(struct html_content *html, struct box *box, uint32_t key);
#endif
diff --git a/content/handlers/html/html.c b/content/handlers/html/html.c
index 18c1a7a..f721b98 100644
--- a/content/handlers/html/html.c
+++ b/content/handlers/html/html.c
@@ -54,9 +54,11 @@
#include "javascript/js.h"
#include "desktop/gui_internal.h"
+#include "html/html.h"
+#include "html/html_save.h"
+#include "html/html_internal.h"
#include "html/box.h"
#include "html/form_internal.h"
-#include "html/html_internal.h"
#include "html/imagemap.h"
#include "html/layout.h"
#include "html/search.h"
diff --git a/content/handlers/html/html.h b/content/handlers/html/html.h
index 691e969..8d1c779 100644
--- a/content/handlers/html/html.h
+++ b/content/handlers/html/html.h
@@ -28,9 +28,6 @@
#include <stdbool.h>
-#include <dom/dom.h>
-#include <dom/bindings/hubbub/parser.h>
-
#include "netsurf/types.h"
#include "netsurf/content_type.h"
#include "netsurf/browser_window.h"
@@ -65,6 +62,7 @@ struct html_stylesheet {
bool unused;
};
+
/**
* Container for scripts used by an HTML document
*/
@@ -103,12 +101,10 @@ struct content_html_object {
bool background; /**< This object is a background image. */
};
-struct html_scrollbar_data {
- struct content *c;
- struct box *box;
-};
-/** Frame tree (frameset or frame tag) */
+/**
+ * Frame tree (frameset or frame tag)
+ */
struct content_html_frames {
int cols; /** number of columns in frameset */
int rows; /** number of rows in frameset */
@@ -129,7 +125,9 @@ struct content_html_frames {
struct content_html_frames *children; /** [cols * rows] children */
};
-/** Inline frame list (iframe tag) */
+/**
+ * Inline frame list (iframe tag)
+ */
struct content_html_iframe {
struct box *box;
@@ -153,19 +151,46 @@ struct content_html_iframe {
#define STYLESHEET_USER 3 /* user stylesheet */
#define STYLESHEET_START 4 /* start of document stylesheets */
+/**
+ * initialise content handler
+ *
+ * \return NSERROR_OK on success otherwise appropriate error code
+ */
nserror html_init(void);
+/**
+ * redraw a specific box
+ *
+ * used by core browser
+ */
void html_redraw_a_box(struct hlcache_handle *h, struct box *box);
-void html_overflow_scroll_drag_end(struct scrollbar *scrollbar,
- browser_mouse_state mouse, int x, int y);
-
-dom_document *html_get_document(struct hlcache_handle *h);
-struct box *html_get_box_tree(struct hlcache_handle *h);
+/**
+ * obtain html frame content from handle
+ *
+ * used by core browser
+ */
struct content_html_frames *html_get_frameset(struct hlcache_handle *h);
+
+/**
+ * obtain html iframe content from handle
+ *
+ * used by core browser
+ */
struct content_html_iframe *html_get_iframe(struct hlcache_handle *h);
-struct nsurl *html_get_base_url(struct hlcache_handle *h);
+
+/**
+ * obtain html base target from handle
+ *
+ * used by core browser
+ */
const char *html_get_base_target(struct hlcache_handle *h);
+
+/**
+ * set filename on a file gadget
+ *
+ * used by core browser
+ */
void html_set_file_gadget_filename(struct hlcache_handle *hl,
struct form_control *gadget, const char *fn);
@@ -179,8 +204,19 @@ void html_set_file_gadget_filename(struct hlcache_handle *hl,
struct html_stylesheet *html_get_stylesheets(struct hlcache_handle *h,
unsigned int *n);
+/**
+ * Retrieve objects used by HTML document
+ *
+ * \param h Content to retrieve objects from
+ * \param n Pointer to location to receive number of objects
+ * \return Pointer to array of objects
+ */
struct content_html_object *html_get_objects(struct hlcache_handle *h,
unsigned int *n);
+
+/**
+ * get the offset within the docuemnt of a fragment id
+ */
bool html_get_id_offset(struct hlcache_handle *h, lwc_string *frag_id,
int *x, int *y);
diff --git a/content/handlers/html/html_css.c b/content/handlers/html/html_css.c
index b67d19a..7b2d469 100644
--- a/content/handlers/html/html_css.c
+++ b/content/handlers/html/html_css.c
@@ -38,6 +38,7 @@
#include "css/css.h"
#include "desktop/gui_internal.h"
+#include "html/html.h"
#include "html/html_internal.h"
static nsurl *html_default_stylesheet_url;
diff --git a/content/handlers/html/html_interaction.c b/content/handlers/html/html_interaction.c
index 898f55b..648d274 100644
--- a/content/handlers/html/html_interaction.c
+++ b/content/handlers/html/html_interaction.c
@@ -294,6 +294,45 @@ html__image_coords_dom_user_data_handler(dom_node_operation operation,
}
}
+
+/**
+ * End overflow scroll scrollbar drags
+ *
+ * \param scrollbar scrollbar widget
+ * \param mouse state of mouse buttons and modifier keys
+ * \param x coordinate of mouse
+ * \param y coordinate of mouse
+ */
+static void
+html_overflow_scroll_drag_end(struct scrollbar *scrollbar,
+ browser_mouse_state mouse,
+ int x, int y)
+{
+ int scroll_mouse_x, scroll_mouse_y, box_x, box_y;
+ struct html_scrollbar_data *data = scrollbar_get_data(scrollbar);
+ struct box *box;
+
+ box = data->box;
+ box_coords(box, &box_x, &box_y);
+
+ if (scrollbar_is_horizontal(scrollbar)) {
+ scroll_mouse_x = x - box_x;
+ scroll_mouse_y = y - (box_y + box->padding[TOP] +
+ box->height + box->padding[BOTTOM] -
+ SCROLLBAR_WIDTH);
+ scrollbar_mouse_drag_end(scrollbar, mouse,
+ scroll_mouse_x, scroll_mouse_y);
+ } else {
+ scroll_mouse_x = x - (box_x + box->padding[LEFT] +
+ box->width + box->padding[RIGHT] -
+ SCROLLBAR_WIDTH);
+ scroll_mouse_y = y - box_y;
+ scrollbar_mouse_drag_end(scrollbar, mouse,
+ scroll_mouse_x, scroll_mouse_y);
+ }
+}
+
+
/**
* Handle mouse clicks and movements in an HTML content window.
*
@@ -1227,41 +1266,6 @@ void html_overflow_scroll_callback(void *client_data,
}
-/**
- * End overflow scroll scrollbar drags
- *
- * \param scrollbar scrollbar widget
- * \param mouse state of mouse buttons and modifier keys
- * \param x coordinate of mouse
- * \param y coordinate of mouse
- */
-void html_overflow_scroll_drag_end(struct scrollbar *scrollbar,
- browser_mouse_state mouse, int x, int y)
-{
- int scroll_mouse_x, scroll_mouse_y, box_x, box_y;
- struct html_scrollbar_data *data = scrollbar_get_data(scrollbar);
- struct box *box;
-
- box = data->box;
- box_coords(box, &box_x, &box_y);
-
- if (scrollbar_is_horizontal(scrollbar)) {
- scroll_mouse_x = x - box_x;
- scroll_mouse_y = y - (box_y + box->padding[TOP] +
- box->height + box->padding[BOTTOM] -
- SCROLLBAR_WIDTH);
- scrollbar_mouse_drag_end(scrollbar, mouse,
- scroll_mouse_x, scroll_mouse_y);
- } else {
- scroll_mouse_x = x - (box_x + box->padding[LEFT] +
- box->width + box->padding[RIGHT] -
- SCROLLBAR_WIDTH);
- scroll_mouse_y = y - box_y;
- scrollbar_mouse_drag_end(scrollbar, mouse,
- scroll_mouse_x, scroll_mouse_y);
- }
-}
-
/* Documented in html_internal.h */
void html_set_drag_type(html_content *html, html_drag_type drag_type,
union html_drag_owner drag_owner, const struct rect *rect)
diff --git a/content/handlers/html/html_internal.h b/content/handlers/html/html_internal.h
index b9eca66..77354c3 100644
--- a/content/handlers/html/html_internal.h
+++ b/content/handlers/html/html_internal.h
@@ -25,14 +25,14 @@
#define NETSURF_HTML_HTML_INTERNAL_H
#include <libcss/libcss.h>
+#include <dom/bindings/hubbub/parser.h>
-#include "content/handlers/css/utils.h"
+#include "netsurf/types.h"
#include "content/content_protected.h"
#include "desktop/selection.h"
-#include "html/html.h"
-
struct gui_layout_table;
+struct scrollbar_msg_data;
typedef enum {
HTML_DRAG_NONE, /** No drag */
@@ -44,12 +44,15 @@ typedef enum {
HTML_DRAG_CONTENT_SCROLL /** Not own; drag in child content */
} html_drag_type;
+/**
+ * For drags we don't own
+ */
union html_drag_owner {
bool no_owner;
struct box *content;
struct scrollbar *scrollbar;
struct box *textarea;
-}; /**< For drags we don't own */
+};
typedef enum {
HTML_SELECTION_NONE, /** No selection */
@@ -57,24 +60,39 @@ typedef enum {
HTML_SELECTION_SELF, /** Selection in this html content */
HTML_SELECTION_CONTENT /** Selection in child content */
} html_selection_type;
+
+/**
+ * For getting at selections in this content or things in this content
+ */
union html_selection_owner {
bool none;
struct box *textarea;
struct box *content;
-}; /**< For getting at selections in this content or things in this content */
+};
typedef enum {
- HTML_FOCUS_SELF, /** Focus is our own */
- HTML_FOCUS_CONTENT, /** Focus belongs to child content */
- HTML_FOCUS_TEXTAREA /** Focus belongs to textarea */
+ HTML_FOCUS_SELF, /**< Focus is our own */
+ HTML_FOCUS_CONTENT, /**< Focus belongs to child content */
+ HTML_FOCUS_TEXTAREA /**< Focus belongs to textarea */
} html_focus_type;
+
+/**
+ * For directing input
+ */
union html_focus_owner {
bool self;
struct box *textarea;
struct box *content;
-}; /**< For directing input */
+};
-/** Data specific to CONTENT_HTML. */
+struct html_scrollbar_data {
+ struct content *c;
+ struct box *box;
+};
+
+/**
+ * Data specific to CONTENT_HTML.
+ */
typedef struct html_content {
struct content base;
diff --git a/content/handlers/html/html_object.c b/content/handlers/html/html_object.c
index c8715e3..7eab466 100644
--- a/content/handlers/html/html_object.c
+++ b/content/handlers/html/html_object.c
@@ -40,6 +40,7 @@
#include "desktop/scrollbar.h"
#include "desktop/gui_internal.h"
+#include "html/html.h"
#include "html/box.h"
#include "html/html_internal.h"
diff --git a/frontends/gtk/completion.h b/content/handlers/html/html_save.h
similarity index 53%
copy from frontends/gtk/completion.h
copy to content/handlers/html/html_save.h
index 9a1db29..c173922 100644
--- a/frontends/gtk/completion.h
+++ b/content/handlers/html/html_save.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2006 Rob Kendrick <rjek(a)rjek.com>
+ * Copyright 2018 Vincent Sanders <vince(a)netsurf-browser.org>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -18,29 +18,29 @@
/**
* \file
- * Interface to url entry completion.
+ * Interface to HTML content handler to save documents.
+ *
+ * \todo Investigate altering this API as it is only used for
+ * exporting the html content to disc.
*/
-#ifndef _NETSURF_GTK_COMPLETION_H_
-#define _NETSURF_GTK_COMPLETION_H_
-
-struct nsgtk_scaffolding;
+#ifndef NETSURF_HTML_HTML_SAVE_H
+#define NETSURF_HTML_HTML_SAVE_H
/**
- * initialise completion list store
+ * get the dom document of a html content from a handle
*/
-void nsgtk_completion_init(void);
+dom_document *html_get_document(struct hlcache_handle *h);
+
/**
- * update completion list store.
+ * get the render box tree of a html content from a handle
*/
-gboolean nsgtk_completion_update(GtkEntry *entry);
+struct box *html_get_box_tree(struct hlcache_handle *h);
/**
- * create a new entry completion on a scaffold.
- *
- * \param gs The scaffoliding which the url entry is in.
+ * get the base url of an html content from a handle
*/
-GtkEntryCompletion *nsgtk_url_entry_completion_new(struct nsgtk_scaffolding *gs);
+struct nsurl *html_get_base_url(struct hlcache_handle *h);
#endif
diff --git a/content/handlers/html/html_script.c b/content/handlers/html/html_script.c
index e18a0ca..80992b9 100644
--- a/content/handlers/html/html_script.c
+++ b/content/handlers/html/html_script.c
@@ -39,6 +39,7 @@
#include "content/fetch.h"
#include "content/hlcache.h"
+#include "html/html.h"
#include "html/html_internal.h"
typedef bool (script_handler_t)(struct jscontext *jscontext, const char *data, size_t size) ;
diff --git a/content/handlers/html/layout.c b/content/handlers/html/layout.c
index 6941d67..2d2c424 100644
--- a/content/handlers/html/layout.c
+++ b/content/handlers/html/layout.c
@@ -56,10 +56,12 @@
#include "desktop/scrollbar.h"
#include "desktop/textarea.h"
+#include "html/html.h"
+#include "html/html_save.h"
+#include "html/html_internal.h"
#include "html/box.h"
#include "html/font.h"
#include "html/form_internal.h"
-#include "html/html_internal.h"
#include "html/layout.h"
#include "html/table.h"
diff --git a/desktop/save_complete.c b/desktop/save_complete.c
index cd4ab30..ef794d4 100644
--- a/desktop/save_complete.c
+++ b/desktop/save_complete.c
@@ -44,6 +44,7 @@
#include "content/hlcache.h"
#include "css/css.h"
#include "html/box.h"
+#include "html/html_save.h"
#include "html/html.h"
#include "netsurf/misc.h"
diff --git a/desktop/save_text.c b/desktop/save_text.c
index c4abb16..a86f173 100644
--- a/desktop/save_text.c
+++ b/desktop/save_text.c
@@ -33,7 +33,7 @@
#include "utils/utils.h"
#include "netsurf/content.h"
#include "html/box.h"
-#include "html/html.h"
+#include "html/html_save.h"
#include "netsurf/utf8.h"
#include "desktop/gui_internal.h"
--
NetSurf Browser
5 years, 4 months
netsurf: branch master updated. release/3.7-110-gdc9e7c9
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/dc9e7c989f1a259a8fee9...
...commit http://git.netsurf-browser.org/netsurf.git/commit/dc9e7c989f1a259a8fee9a6...
...tree http://git.netsurf-browser.org/netsurf.git/tree/dc9e7c989f1a259a8fee9a6e1...
The branch, master has been updated
via dc9e7c989f1a259a8fee9a6e1a4c6be6186f7c31 (commit)
from 2a03ea30490892ac52b3da325ab78e1aa888f83e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=dc9e7c989f1a259a8fe...
commit dc9e7c989f1a259a8fee9a6e1a4c6be6186f7c31
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
fixup doxygen directory list to cope with html content handler move
diff --git a/docs/Doxyfile b/docs/Doxyfile
index f106693..9f72bc1 100644
--- a/docs/Doxyfile
+++ b/docs/Doxyfile
@@ -773,7 +773,6 @@ INPUT = docs \
frontends/riscos/scripts \
frontends/windows \
include/netsurf \
- render \
desktop \
content \
content/fetchers \
@@ -781,6 +780,8 @@ INPUT = docs \
content/handlers/css \
content/handlers/javascript \
content/handlers/javascript/duktape \
+ content/handlers/html \
+ content/handlers/text \
utils \
utils/http
-----------------------------------------------------------------------
Summary of changes:
docs/Doxyfile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/Doxyfile b/docs/Doxyfile
index f106693..9f72bc1 100644
--- a/docs/Doxyfile
+++ b/docs/Doxyfile
@@ -773,7 +773,6 @@ INPUT = docs \
frontends/riscos/scripts \
frontends/windows \
include/netsurf \
- render \
desktop \
content \
content/fetchers \
@@ -781,6 +780,8 @@ INPUT = docs \
content/handlers/css \
content/handlers/javascript \
content/handlers/javascript/duktape \
+ content/handlers/html \
+ content/handlers/text \
utils \
utils/http
--
NetSurf Browser
5 years, 4 months
netsurf-wiki: branch master updated. f0b640fabdc10f451abd7cf510097d5a3d17a8b6
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf-wiki.git/shortlog/f0b640fabdc10f45...
...commit http://git.netsurf-browser.org/netsurf-wiki.git/commit/f0b640fabdc10f451a...
...tree http://git.netsurf-browser.org/netsurf-wiki.git/tree/f0b640fabdc10f451abd...
The branch, master has been updated
via f0b640fabdc10f451abd7cf510097d5a3d17a8b6 (commit)
from 31729f47a6874da3bbb03e114e02b218d6977934 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf-wiki.git/commit/?id=f0b640fabdc10f...
commit f0b640fabdc10f451abd7cf510097d5a3d17a8b6
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
try using four space preformatting
diff --git a/netsurf_corebuild.mdwn b/netsurf_corebuild.mdwn
index 64215af..794445f 100644
--- a/netsurf_corebuild.mdwn
+++ b/netsurf_corebuild.mdwn
@@ -16,179 +16,182 @@ The source layout was in need of improvement to achive use of core buildsystem.
Most of the layout change has been done and current layout in May 2018 is:
-```
-├── content
-│ ├── fetchers
-│ └── handlers
-│ ├── css
-│ ├── html
-│ ├── image
-│ ├── javascript
-│ └── text
-├── desktop
-├── docs
-├── frontends
-│ ├── amiga
-│ ├── atari
-│ ├── beos
-│ ├── framebuffer
-│ ├── gtk
-│ ├── monkey
-│ ├── riscos
-│ └── windows
-├── include
-│ └── netsurf
-├── resources
-│ ├── de
-│ ├── en
-│ ├── fr
-│ ├── icons
-│ ├── it
-│ ├── ja
-│ └── nl
-├── test
-│ ├── data
-│ └── js
-└── utils
- ├── http
- └── nsurl
-```
+
+ ├── content
+ │ ├── fetchers
+ │ └── handlers
+ │ ├── css
+ │ ├── html
+ │ ├── image
+ │ ├── javascript
+ │ └── text
+ ├── desktop
+ ├── docs
+ ├── frontends
+ │ ├── amiga
+ │ ├── atari
+ │ ├── beos
+ │ ├── framebuffer
+ │ ├── gtk
+ │ ├── monkey
+ │ ├── riscos
+ │ └── windows
+ ├── include
+ │ └── netsurf
+ ├── resources
+ │ ├── de
+ │ ├── en
+ │ ├── fr
+ │ ├── icons
+ │ ├── it
+ │ ├── ja
+ │ └── nl
+ ├── test
+ │ ├── data
+ │ └── js
+ └── utils
+ ├── http
+ └── nsurl
+
vincents original target:
-```
- + netsurf
- + resources
- + url
- + utils
- + test
- + docs
- + include
- | + netsurf
- + content
- | + cache
- | + fetchers
- | + handlers
- | + css
- | + image
- | + html
- | + javascript
- | + text
- + ui
- | + browser
- | + widgets
- | + textarea
- | + treeview
- + frontends
- + amiga
- + atari
- + beos
- + cocoa
- + framebuffer
- + gtk
- + monkey
- + riscos
- + windows
-
-```
+ + netsurf
+ + resources
+ + url
+ + utils
+ + test
+ + docs
+ + include
+ | + netsurf
+ + content
+ | + cache
+ | + fetchers
+ | + handlers
+ | + css
+ | + image
+ | + html
+ | + javascript
+ | + text
+ + ui
+ | + browser
+ | + widgets
+ | + textarea
+ | + treeview
+ + frontends
+ + amiga
+ + atari
+ + beos
+ + cocoa
+ + framebuffer
+ + gtk
+ + monkey
+ + riscos
+ + windows
+
tlsa's proposal:
-` + netsurf`
-` + test`
-` + docs`
-` + utils`
-` + core`
-` | + include`
-` | + content`
-` | | + cache`
-` | | + fetch`
-` | | + handlers`
-` | | + css`
-` | | + image`
-` | | | + bmp`
-` | | | + jpeg`
-` | | | + gif`
-` | | | + png`
-` | | | + svg`
-` | | + html`
-` | | + javascript`
-` | | + text`
-` | + ui`
-` | | + browser`
-` | | + widgets`
-` | | + textarea`
-` | | + treeview`
-` | + resources`
-` | + url`
-` | + utils`
-` + frontends`
-` + amiga`
-` + atari`
-` + beos`
-` + cocoa`
-` + framebuffer`
-` + gtk`
-` + monkey`
-` + riscos`
-` + windows`
+
+ + netsurf
+ + test
+ + docs
+ + utils
+ + core
+ | + include
+ | + content
+ | | + cache
+ | | + fetch
+ | | + handlers
+ | | + css
+ | | + image
+ | | | + bmp
+ | | | + jpeg
+ | | | + gif
+ | | | + png
+ | | | + svg
+ | | + html
+ | | + javascript
+ | | + text
+ | + ui
+ | | + browser
+ | | + widgets
+ | | + textarea
+ | | + treeview
+ | + resources
+ | + url
+ | + utils
+ + frontends
+ + amiga
+ + atari
+ + beos
+ + cocoa
+ + framebuffer
+ + gtk
+ + monkey
+ + riscos
+ + windo
+
original layout in June 2016:
-` + netsurf`
-` + resources`
-` + test`
-` + Docs`
-` + desktop`
-` + render`
-` + utils`
-` | + http`
-` + include`
-` | + netsurf`
-` + content`
-` | + fetchers`
-` | + handlers`
-` | + image`
-` | + css`
-` | + javascript`
-` | + duktape`
-` | + none`
-` | + WebIDL`
-` + frontends`
-` + amiga`
-` + atari`
-` + beos`
-` + cocoa`
-` + framebuffer`
-` + gtk`
-` + monkey`
-` + riscos`
-` + windows`
+
+ + netsurf
+ + resources
+ + test
+ + Docs
+ + desktop
+ + render
+ + utils
+ | + http
+ + include
+ | + netsurf
+ + content
+ | + fetchers
+ | + handlers
+ | + image
+ | + css
+ | + javascript
+ | + duktape
+ | + none
+ | + WebIDL
+ + frontends
+ + amiga
+ + atari
+ + beos
+ + cocoa
+ + framebuffer
+ + gtk
+ + monkey
+ + riscos
+ + windo
+
Previous attempt:
-` + netsurf`
-` + core`
-` | + api`
-` | + browser`
-` | + content`
-` | + css`
-` | + html`
-` | + image`
-` | + javascript`
-` | + resource`
-` | + widgets`
-` + frontends`
-` | + amiga`
-` | + atari`
-` | + beos`
-` | + cocoa`
-` | + framebuffer`
-` | + gtk`
-` | + monkey`
-` | + riscos`
-` | + windows`
-` + utils`
-` + test`
-` + docs`
+
+ + netsurf
+ + core
+ | + api
+ | + browser
+ | + content
+ | + css
+ | + html
+ | + image
+ | + javascript
+ | + resource
+ | + widgets
+ + frontends
+ | + amiga
+ | + atari
+ | + beos
+ | + cocoa
+ | + framebuffer
+ | + gtk
+ | + monkey
+ | + riscos
+ | + windows
+ + utils
+ + test
+ + do
-----------------------------------------------------------------------
Summary of changes:
netsurf_corebuild.mdwn | 329 ++++++++++++++++++++++++------------------------
1 file changed, 166 insertions(+), 163 deletions(-)
diff --git a/netsurf_corebuild.mdwn b/netsurf_corebuild.mdwn
index 64215af..794445f 100644
--- a/netsurf_corebuild.mdwn
+++ b/netsurf_corebuild.mdwn
@@ -16,179 +16,182 @@ The source layout was in need of improvement to achive use of core buildsystem.
Most of the layout change has been done and current layout in May 2018 is:
-```
-├── content
-│ ├── fetchers
-│ └── handlers
-│ ├── css
-│ ├── html
-│ ├── image
-│ ├── javascript
-│ └── text
-├── desktop
-├── docs
-├── frontends
-│ ├── amiga
-│ ├── atari
-│ ├── beos
-│ ├── framebuffer
-│ ├── gtk
-│ ├── monkey
-│ ├── riscos
-│ └── windows
-├── include
-│ └── netsurf
-├── resources
-│ ├── de
-│ ├── en
-│ ├── fr
-│ ├── icons
-│ ├── it
-│ ├── ja
-│ └── nl
-├── test
-│ ├── data
-│ └── js
-└── utils
- ├── http
- └── nsurl
-```
+
+ ├── content
+ │ ├── fetchers
+ │ └── handlers
+ │ ├── css
+ │ ├── html
+ │ ├── image
+ │ ├── javascript
+ │ └── text
+ ├── desktop
+ ├── docs
+ ├── frontends
+ │ ├── amiga
+ │ ├── atari
+ │ ├── beos
+ │ ├── framebuffer
+ │ ├── gtk
+ │ ├── monkey
+ │ ├── riscos
+ │ └── windows
+ ├── include
+ │ └── netsurf
+ ├── resources
+ │ ├── de
+ │ ├── en
+ │ ├── fr
+ │ ├── icons
+ │ ├── it
+ │ ├── ja
+ │ └── nl
+ ├── test
+ │ ├── data
+ │ └── js
+ └── utils
+ ├── http
+ └── nsurl
+
vincents original target:
-```
- + netsurf
- + resources
- + url
- + utils
- + test
- + docs
- + include
- | + netsurf
- + content
- | + cache
- | + fetchers
- | + handlers
- | + css
- | + image
- | + html
- | + javascript
- | + text
- + ui
- | + browser
- | + widgets
- | + textarea
- | + treeview
- + frontends
- + amiga
- + atari
- + beos
- + cocoa
- + framebuffer
- + gtk
- + monkey
- + riscos
- + windows
-
-```
+ + netsurf
+ + resources
+ + url
+ + utils
+ + test
+ + docs
+ + include
+ | + netsurf
+ + content
+ | + cache
+ | + fetchers
+ | + handlers
+ | + css
+ | + image
+ | + html
+ | + javascript
+ | + text
+ + ui
+ | + browser
+ | + widgets
+ | + textarea
+ | + treeview
+ + frontends
+ + amiga
+ + atari
+ + beos
+ + cocoa
+ + framebuffer
+ + gtk
+ + monkey
+ + riscos
+ + windows
+
tlsa's proposal:
-` + netsurf`
-` + test`
-` + docs`
-` + utils`
-` + core`
-` | + include`
-` | + content`
-` | | + cache`
-` | | + fetch`
-` | | + handlers`
-` | | + css`
-` | | + image`
-` | | | + bmp`
-` | | | + jpeg`
-` | | | + gif`
-` | | | + png`
-` | | | + svg`
-` | | + html`
-` | | + javascript`
-` | | + text`
-` | + ui`
-` | | + browser`
-` | | + widgets`
-` | | + textarea`
-` | | + treeview`
-` | + resources`
-` | + url`
-` | + utils`
-` + frontends`
-` + amiga`
-` + atari`
-` + beos`
-` + cocoa`
-` + framebuffer`
-` + gtk`
-` + monkey`
-` + riscos`
-` + windows`
+
+ + netsurf
+ + test
+ + docs
+ + utils
+ + core
+ | + include
+ | + content
+ | | + cache
+ | | + fetch
+ | | + handlers
+ | | + css
+ | | + image
+ | | | + bmp
+ | | | + jpeg
+ | | | + gif
+ | | | + png
+ | | | + svg
+ | | + html
+ | | + javascript
+ | | + text
+ | + ui
+ | | + browser
+ | | + widgets
+ | | + textarea
+ | | + treeview
+ | + resources
+ | + url
+ | + utils
+ + frontends
+ + amiga
+ + atari
+ + beos
+ + cocoa
+ + framebuffer
+ + gtk
+ + monkey
+ + riscos
+ + windo
+
original layout in June 2016:
-` + netsurf`
-` + resources`
-` + test`
-` + Docs`
-` + desktop`
-` + render`
-` + utils`
-` | + http`
-` + include`
-` | + netsurf`
-` + content`
-` | + fetchers`
-` | + handlers`
-` | + image`
-` | + css`
-` | + javascript`
-` | + duktape`
-` | + none`
-` | + WebIDL`
-` + frontends`
-` + amiga`
-` + atari`
-` + beos`
-` + cocoa`
-` + framebuffer`
-` + gtk`
-` + monkey`
-` + riscos`
-` + windows`
+
+ + netsurf
+ + resources
+ + test
+ + Docs
+ + desktop
+ + render
+ + utils
+ | + http
+ + include
+ | + netsurf
+ + content
+ | + fetchers
+ | + handlers
+ | + image
+ | + css
+ | + javascript
+ | + duktape
+ | + none
+ | + WebIDL
+ + frontends
+ + amiga
+ + atari
+ + beos
+ + cocoa
+ + framebuffer
+ + gtk
+ + monkey
+ + riscos
+ + windo
+
Previous attempt:
-` + netsurf`
-` + core`
-` | + api`
-` | + browser`
-` | + content`
-` | + css`
-` | + html`
-` | + image`
-` | + javascript`
-` | + resource`
-` | + widgets`
-` + frontends`
-` | + amiga`
-` | + atari`
-` | + beos`
-` | + cocoa`
-` | + framebuffer`
-` | + gtk`
-` | + monkey`
-` | + riscos`
-` | + windows`
-` + utils`
-` + test`
-` + docs`
+
+ + netsurf
+ + core
+ | + api
+ | + browser
+ | + content
+ | + css
+ | + html
+ | + image
+ | + javascript
+ | + resource
+ | + widgets
+ + frontends
+ | + amiga
+ | + atari
+ | + beos
+ | + cocoa
+ | + framebuffer
+ | + gtk
+ | + monkey
+ | + riscos
+ | + windows
+ + utils
+ + test
+ + do
--
NetSurf Developer Wiki Backing Store
5 years, 4 months
netsurf-wiki: branch master updated. 31729f47a6874da3bbb03e114e02b218d6977934
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf-wiki.git/shortlog/31729f47a6874da3...
...commit http://git.netsurf-browser.org/netsurf-wiki.git/commit/31729f47a6874da3bb...
...tree http://git.netsurf-browser.org/netsurf-wiki.git/tree/31729f47a6874da3bbb0...
The branch, master has been updated
via 31729f47a6874da3bbb03e114e02b218d6977934 (commit)
from c1612a6d583e133d58319a674f8289e02be402e0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf-wiki.git/commit/?id=31729f47a6874d...
commit 31729f47a6874da3bbb03e114e02b218d6977934
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
i hate wiki formatting
diff --git a/netsurf_corebuild.mdwn b/netsurf_corebuild.mdwn
index 1635970..64215af 100644
--- a/netsurf_corebuild.mdwn
+++ b/netsurf_corebuild.mdwn
@@ -17,41 +17,41 @@ The source layout was in need of improvement to achive use of core buildsystem.
Most of the layout change has been done and current layout in May 2018 is:
```
-├── content
-│ ├── fetchers
-│ └── handlers
-│ ├── css
-│ ├── html
-│ ├── image
-│ ├── javascript
-│ └── text
-├── desktop
-├── docs
-├── frontends
-│ ├── amiga
-│ ├── atari
-│ ├── beos
-│ ├── framebuffer
-│ ├── gtk
-│ ├── monkey
-│ ├── riscos
-│ └── windows
-├── include
-│ └── netsurf
-├── resources
-│ ├── de
-│ ├── en
-│ ├── fr
-│ ├── icons
-│ ├── it
-│ ├── ja
-│ └── nl
-├── test
-│ ├── data
-│ └── js
-└── utils
- ├── http
- └── nsurl
+├── content
+│ ├── fetchers
+│ └── handlers
+│ ├── css
+│ ├── html
+│ ├── image
+│ ├── javascript
+│ └── text
+├── desktop
+├── docs
+├── frontends
+│ ├── amiga
+│ ├── atari
+│ ├── beos
+│ ├── framebuffer
+│ ├── gtk
+│ ├── monkey
+│ ├── riscos
+│ └── windows
+├── include
+│ └── netsurf
+├── resources
+│ ├── de
+│ ├── en
+│ ├── fr
+│ ├── icons
+│ ├── it
+│ ├── ja
+│ └── nl
+├── test
+│ ├── data
+│ └── js
+└── utils
+ ├── http
+ └── nsurl
```
vincents original target:
@@ -63,8 +63,8 @@ vincents original target:
+ utils
+ test
+ docs
- + include
- | + netsurf
+ + include
+ | + netsurf
+ content
| + cache
| + fetchers
-----------------------------------------------------------------------
Summary of changes:
netsurf_corebuild.mdwn | 74 ++++++++++++++++++++++++------------------------
1 file changed, 37 insertions(+), 37 deletions(-)
diff --git a/netsurf_corebuild.mdwn b/netsurf_corebuild.mdwn
index 1635970..64215af 100644
--- a/netsurf_corebuild.mdwn
+++ b/netsurf_corebuild.mdwn
@@ -17,41 +17,41 @@ The source layout was in need of improvement to achive use of core buildsystem.
Most of the layout change has been done and current layout in May 2018 is:
```
-├── content
-│ ├── fetchers
-│ └── handlers
-│ ├── css
-│ ├── html
-│ ├── image
-│ ├── javascript
-│ └── text
-├── desktop
-├── docs
-├── frontends
-│ ├── amiga
-│ ├── atari
-│ ├── beos
-│ ├── framebuffer
-│ ├── gtk
-│ ├── monkey
-│ ├── riscos
-│ └── windows
-├── include
-│ └── netsurf
-├── resources
-│ ├── de
-│ ├── en
-│ ├── fr
-│ ├── icons
-│ ├── it
-│ ├── ja
-│ └── nl
-├── test
-│ ├── data
-│ └── js
-└── utils
- ├── http
- └── nsurl
+├── content
+│ ├── fetchers
+│ └── handlers
+│ ├── css
+│ ├── html
+│ ├── image
+│ ├── javascript
+│ └── text
+├── desktop
+├── docs
+├── frontends
+│ ├── amiga
+│ ├── atari
+│ ├── beos
+│ ├── framebuffer
+│ ├── gtk
+│ ├── monkey
+│ ├── riscos
+│ └── windows
+├── include
+│ └── netsurf
+├── resources
+│ ├── de
+│ ├── en
+│ ├── fr
+│ ├── icons
+│ ├── it
+│ ├── ja
+│ └── nl
+├── test
+│ ├── data
+│ └── js
+└── utils
+ ├── http
+ └── nsurl
```
vincents original target:
@@ -63,8 +63,8 @@ vincents original target:
+ utils
+ test
+ docs
- + include
- | + netsurf
+ + include
+ | + netsurf
+ content
| + cache
| + fetchers
--
NetSurf Developer Wiki Backing Store
5 years, 4 months