Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/b6c149f3d68c6ae179b0f7917b0e7b85bf29aae5
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/b6c149f3d68c6ae179b0f7917b0e7b85bf29aae5
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/b6c149f3d68c6ae179b0f7917b0e7b85bf29aae5

The branch, master has been updated
       via  b6c149f3d68c6ae179b0f7917b0e7b85bf29aae5 (commit)
       via  c8a83bf1b41b9588225769f56fd4b4e5b8330c2c (commit)
       via  d106091d6e5df26a83460ae484c31753b873368c (commit)
       via  68947c377ed358db310b32ee241db375e0b51de4 (commit)
       via  986bc5ff8332d39629f65177cc8232c5ec7c8791 (commit)
      from  76583d63ecccd3e37e6b3a33330caa2fb71dce4d (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/commitdiff/b6c149f3d68c6ae179b0f7917b0e7b85bf29aae5
commit b6c149f3d68c6ae179b0f7917b0e7b85bf29aae5
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Convert to use selection_copy_to_clipboard() and font style passed via 
gui_add_to_clipboard. Note: untested.

diff --git a/beos/window.cpp b/beos/window.cpp
index 572aa86..845c8ac 100644
--- a/beos/window.cpp
+++ b/beos/window.cpp
@@ -1672,6 +1672,15 @@ bool gui_add_to_clipboard(const char *text, size_t 
length, bool space,
                const plot_font_style_t *fstyle)
 {
        BString s;
+       BFont font;
+       text_run *run = new text_run;
+
+       nsbeos_style_to_font(font, &fstyle);
+       run->offset = current_selection.Length();
+       run->font = font;
+       run->color = nsbeos_rgb_colour(fstyle->foreground);
+       current_selection_textruns.AddItem(run);
+
        s.SetTo(text, length);
        current_selection << s;
        if (space)
@@ -1712,45 +1721,9 @@ bool gui_commit_clipboard(void)
        return true;
 }
 
-static bool copy_handler(const char *text, size_t length, struct box *box,
-               void *handle, const char *whitespace_text,
-               size_t whitespace_length)
-{
-       bool space = false;
-       //XXX: handle box->style to StyledEdit / RTF ?
-       /* add any whitespace which precedes the text from this box */
-       if (whitespace_text) {
-               if (!gui_add_to_clipboard(whitespace_text,
-                               whitespace_length, false,
-                               plot_style_font)) {
-                       return false;
-               }
-       }
-
-       // add a text_run for StyledEdit-like text formating
-       if (box && box->style) {
-               text_run *run = new text_run;
-               BFont font;
-               plot_font_style_t style;
-               font_plot_style_from_css(box->style, &style);
-               nsbeos_style_to_font(font, &style);
-               run->offset = current_selection.Length();
-               run->font = font;
-               run->color = nsbeos_rgb_colour(style->foreground);
-               current_selection_textruns.AddItem(run);
-               space = box->space != 0;
-       }
-
-       /* add the text from this box */
-       if (!gui_add_to_clipboard(text, length, space, plot_style_font))
-               return false;
-
-       return true;
-}
-
 bool gui_copy_to_clipboard(struct selection *s)
 {
-       if (s->defined && selection_traverse(s, copy_handler, NULL))
+       if (s->defined && selection_copy_to_clipboard(s))
                gui_commit_clipboard();
        return true;
 }


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/c8a83bf1b41b9588225769f56fd4b4e5b8330c2c
commit c8a83bf1b41b9588225769f56fd4b4e5b8330c2c
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    s/TRUE/true/

diff --git a/gtk/selection.c b/gtk/selection.c
index 36d0969..fd0b7c8 100644
--- a/gtk/selection.c
+++ b/gtk/selection.c
@@ -46,7 +46,7 @@ bool gui_copy_to_clipboard(struct selection *s)
        clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
        if (s->defined && selection_copy_to_clipboard(s))
                gui_commit_clipboard();
-       return TRUE;
+       return true;
 }
 
 void gui_start_selection(struct gui_window *g)


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/d106091d6e5df26a83460ae484c31753b873368c
commit d106091d6e5df26a83460ae484c31753b873368c
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Pass font plot style out to front end clipboard append function.

diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index b092650..b745088 100755
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -17,6 +17,7 @@
  */
 
 #include "desktop/gui.h"
+#include "desktop/plotters.h"
 #include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "render/box.h"
@@ -245,7 +246,8 @@ bool gui_empty_clipboard(void)
        return false;
 }
 
-bool gui_add_to_clipboard(const char *text, size_t length, bool space)
+bool gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle)
 {
        /* This might crash or at least not work if gui_empty_clipboard isn't 
called first,
           and gui_commit_clipboard after.
@@ -418,7 +420,8 @@ void ami_drag_selection(struct selection *s)
 bool ami_easy_clipboard(char *text)
 {
        if(!gui_empty_clipboard()) return false;
-       if(!gui_add_to_clipboard(text,strlen(text),false)) return false;
+       if(!gui_add_to_clipboard(text,strlen(text),false,plot_style_font))
+               return false;
        if(!gui_commit_clipboard()) return false;
 
        return true;
diff --git a/atari/gui.c b/atari/gui.c
index 99b5f99..2df8ca0 100755
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -643,7 +643,8 @@ bool gui_empty_clipboard(void)
        return true;
 }
 
-bool gui_add_to_clipboard(const char *text_utf8, size_t length_utf8, bool 
space)
+bool gui_add_to_clipboard(const char *text_utf8, size_t length_utf8, bool 
space,
+               const plot_font_style_t *fstyle)
 {
        LOG(("(%s): %s (%d)\n", (space)?"space":"", (char*)text_utf8, 
(int)length_utf8));
        char * oldptr = tmp_clipboard;
diff --git a/beos/window.cpp b/beos/window.cpp
index d62aecf..572aa86 100644
--- a/beos/window.cpp
+++ b/beos/window.cpp
@@ -1668,7 +1668,8 @@ bool gui_empty_clipboard(void)
        return true;
 }
 
-bool gui_add_to_clipboard(const char *text, size_t length, bool space)
+bool gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle)
 {
        BString s;
        s.SetTo(text, length);
@@ -1720,7 +1721,8 @@ static bool copy_handler(const char *text, size_t length, 
struct box *box,
        /* add any whitespace which precedes the text from this box */
        if (whitespace_text) {
                if (!gui_add_to_clipboard(whitespace_text,
-                               whitespace_length, false)) {
+                               whitespace_length, false,
+                               plot_style_font)) {
                        return false;
                }
        }
@@ -1740,7 +1742,7 @@ static bool copy_handler(const char *text, size_t length, 
struct box *box,
        }
 
        /* add the text from this box */
-       if (!gui_add_to_clipboard(text, length, space))
+       if (!gui_add_to_clipboard(text, length, space, plot_style_font))
                return false;
 
        return true;
diff --git a/cocoa/selection.m b/cocoa/selection.m
index 587f120..76617d2 100644
--- a/cocoa/selection.m
+++ b/cocoa/selection.m
@@ -56,7 +56,8 @@ bool gui_empty_clipboard(void)
        return true;
 }
 
-bool gui_add_to_clipboard(const char *text, size_t length, bool space)
+bool gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle)
 {
        if (nil == cocoa_clipboard_string) return false;
        
diff --git a/desktop/gui.h b/desktop/gui.h
index 85f1015..2fc2b91 100644
--- a/desktop/gui.h
+++ b/desktop/gui.h
@@ -129,7 +129,8 @@ void gui_clear_selection(struct gui_window *g);
 
 void gui_paste_from_clipboard(struct gui_window *g, int x, int y);
 bool gui_empty_clipboard(void);
-bool gui_add_to_clipboard(const char *text, size_t length, bool space);
+bool gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle);
 bool gui_commit_clipboard(void);
 bool gui_copy_to_clipboard(struct selection *s);
 
diff --git a/desktop/selection.c b/desktop/selection.c
index 436117a..00984d9 100644
--- a/desktop/selection.c
+++ b/desktop/selection.c
@@ -753,7 +753,7 @@ static bool selection_copy_handler(const char *text, size_t 
length,
        /* add any whitespace which precedes the text from this box */
        if (whitespace_text != NULL && whitespace_length > 0) {
                if (!gui_add_to_clipboard(whitespace_text,
-                               whitespace_length, false)) {
+                               whitespace_length, false, &style)) {
                        return false;
                }
        }
@@ -772,7 +772,7 @@ static bool selection_copy_handler(const char *text, size_t 
length,
        }
 
        /* add the text from this box */
-       if (!gui_add_to_clipboard(text, length, add_space))
+       if (!gui_add_to_clipboard(text, length, add_space, &style))
                return false;
 
        return true;
diff --git a/framebuffer/clipboard.c b/framebuffer/clipboard.c
index d534cfe..85e6a1d 100644
--- a/framebuffer/clipboard.c
+++ b/framebuffer/clipboard.c
@@ -69,7 +69,8 @@ bool gui_empty_clipboard(void)
  * \return true iff successful
  */
 
-bool gui_add_to_clipboard(const char *text, size_t length, bool space)
+bool gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle)
 {
        size_t new_length = gui_clipboard.length + length + (space ? 1 : 0) + 1;
 
diff --git a/gtk/selection.c b/gtk/selection.c
index 1493567..36d0969 100644
--- a/gtk/selection.c
+++ b/gtk/selection.c
@@ -31,12 +31,13 @@ static GString *current_selection = NULL;
 static GtkClipboard *clipboard;
 
 
-bool gui_add_to_clipboard(const char *text, size_t length, bool space)
+bool gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle)
 {
        /* add the text from this box */
-       current_selection = g_string_append_len (current_selection,
+       current_selection = g_string_append_len(current_selection,
                text, length);
-       if (space) g_string_append (current_selection, " ");
+       if (space) g_string_append(current_selection, " ");
        return true;
 }
 
diff --git a/monkey/browser.c b/monkey/browser.c
index 265821c..a9cfd04 100644
--- a/monkey/browser.c
+++ b/monkey/browser.c
@@ -339,7 +339,8 @@ gui_empty_clipboard(void)
 }
 
 bool
-gui_add_to_clipboard(const char *text, size_t length, bool space)
+gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle)
 {
   return true;
 }
diff --git a/render/textinput.c b/render/textinput.c
index 0e62d1e..3712690 100644
--- a/render/textinput.c
+++ b/render/textinput.c
@@ -554,8 +554,8 @@ static bool textinput_textarea_cut(struct content *c,
                struct box *next = box->next;
 
                if (box->type == BOX_BR) {
-                       if (clipboard &&
-                                       !gui_add_to_clipboard("\n", 1, false)) {
+                       if (clipboard && !gui_add_to_clipboard("\n", 1, false,
+                                       plot_style_font)) {
                                gui_commit_clipboard();
                                return false;
                        }
@@ -565,7 +565,7 @@ static bool textinput_textarea_cut(struct content *c,
                        if (clipboard &&
                                !gui_add_to_clipboard(box->text + start_idx,
                                        box->length - start_idx,
-                                       SPACE_LEN(box))) {
+                                       SPACE_LEN(box), plot_style_font)) {
                                gui_commit_clipboard();
                                return false;
                        }
@@ -593,7 +593,8 @@ static bool textinput_textarea_cut(struct content *c,
        /* and the last box */
        if (box) {
                if (clipboard && !gui_add_to_clipboard(box->text + start_idx,
-                               end_idx - start_idx, end_idx > box->length)) {
+                               end_idx - start_idx, end_idx > box->length,
+                               plot_style_font)) {
                        success = false;
                } else {
                        if (del) {
diff --git a/riscos/textselection.c b/riscos/textselection.c
index 06224a5..c5a42b5 100644
--- a/riscos/textselection.c
+++ b/riscos/textselection.c
@@ -229,10 +229,12 @@ void gui_clear_selection(struct gui_window *g)
  * \param  text    text to be added
  * \param  length  length of text in bytes
  * \param  space   indicates whether a trailing space should be appended also
+ * \param  fstyle  font plot style for text
  * \return true iff successful
  */
 
-bool gui_add_to_clipboard(const char *text, size_t length, bool space)
+bool gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle)
 {
        size_t new_length = clip_length + length + (space ? 1 : 0);
 
diff --git a/windows/gui.c b/windows/gui.c
index 27f55c8..4018cc8 100644
--- a/windows/gui.c
+++ b/windows/gui.c
@@ -1766,7 +1766,8 @@ bool gui_empty_clipboard(void)
        return false;
 }
 
-bool gui_add_to_clipboard(const char *text, size_t length, bool space)
+bool gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle)
 {
        HANDLE hnew;
        char *new, *original;


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/68947c377ed358db310b32ee241db375e0b51de4
commit 68947c377ed358db310b32ee241db375e0b51de4
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Obtain font style in copy handler.

diff --git a/desktop/selection.c b/desktop/selection.c
index 6679be6..436117a 100644
--- a/desktop/selection.c
+++ b/desktop/selection.c
@@ -747,7 +747,8 @@ static bool selection_copy_handler(const char *text, size_t 
length,
                struct box *box, void *handle, const char *whitespace_text,
                size_t whitespace_length)
 {
-       bool add_space = box != NULL ? box->space != 0 : false;
+       bool add_space = false;
+       plot_font_style_t style = *plot_style_font;
 
        /* add any whitespace which precedes the text from this box */
        if (whitespace_text != NULL && whitespace_length > 0) {
@@ -757,6 +758,19 @@ static bool selection_copy_handler(const char *text, 
size_t length,
                }
        }
 
+       if (box != NULL) {
+               /* HTML */
+               add_space = (box->space != 0);
+
+               if (box->style != NULL) {
+                       /* Override default font style */
+                       font_plot_style_from_css(box->style, &style);
+               } else {
+                       /* If there's no style, there must be no text */
+                       assert(box->text == NULL);
+               }
+       }
+
        /* add the text from this box */
        if (!gui_add_to_clipboard(text, length, add_space))
                return false;


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/986bc5ff8332d39629f65177cc8232c5ec7c8791
commit 986bc5ff8332d39629f65177cc8232c5ec7c8791
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Simplify font colour acquisition.

diff --git a/beos/window.cpp b/beos/window.cpp
index 89c3d5c..d62aecf 100644
--- a/beos/window.cpp
+++ b/beos/window.cpp
@@ -1734,10 +1734,7 @@ static bool copy_handler(const char *text, size_t 
length, struct box *box,
                nsbeos_style_to_font(font, &style);
                run->offset = current_selection.Length();
                run->font = font;
-               css_color csscolor;
-               if (css_computed_color(box->style, &csscolor) == 
CSS_COLOR_COLOR) {
-                       run->color = 
nsbeos_rgb_colour(nscss_color_to_ns(csscolor));
-               }
+               run->color = nsbeos_rgb_colour(style->foreground);
                current_selection_textruns.AddItem(run);
                space = box->space != 0;
        }


-----------------------------------------------------------------------

Summary of changes:
 amiga/clipboard.c       |    7 ++++-
 atari/gui.c             |    3 +-
 beos/window.cpp         |   52 ++++++++++------------------------------------
 cocoa/selection.m       |    3 +-
 desktop/gui.h           |    3 +-
 desktop/selection.c     |   20 +++++++++++++++--
 framebuffer/clipboard.c |    3 +-
 gtk/selection.c         |    9 ++++---
 monkey/browser.c        |    3 +-
 render/textinput.c      |    9 ++++---
 riscos/textselection.c  |    4 ++-
 windows/gui.c           |    3 +-
 12 files changed, 59 insertions(+), 60 deletions(-)

diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index b092650..b745088 100755
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -17,6 +17,7 @@
  */
 
 #include "desktop/gui.h"
+#include "desktop/plotters.h"
 #include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "render/box.h"
@@ -245,7 +246,8 @@ bool gui_empty_clipboard(void)
        return false;
 }
 
-bool gui_add_to_clipboard(const char *text, size_t length, bool space)
+bool gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle)
 {
        /* This might crash or at least not work if gui_empty_clipboard isn't 
called first,
           and gui_commit_clipboard after.
@@ -418,7 +420,8 @@ void ami_drag_selection(struct selection *s)
 bool ami_easy_clipboard(char *text)
 {
        if(!gui_empty_clipboard()) return false;
-       if(!gui_add_to_clipboard(text,strlen(text),false)) return false;
+       if(!gui_add_to_clipboard(text,strlen(text),false,plot_style_font))
+               return false;
        if(!gui_commit_clipboard()) return false;
 
        return true;
diff --git a/atari/gui.c b/atari/gui.c
index 99b5f99..2df8ca0 100755
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -643,7 +643,8 @@ bool gui_empty_clipboard(void)
        return true;
 }
 
-bool gui_add_to_clipboard(const char *text_utf8, size_t length_utf8, bool 
space)
+bool gui_add_to_clipboard(const char *text_utf8, size_t length_utf8, bool 
space,
+               const plot_font_style_t *fstyle)
 {
        LOG(("(%s): %s (%d)\n", (space)?"space":"", (char*)text_utf8, 
(int)length_utf8));
        char * oldptr = tmp_clipboard;
diff --git a/beos/window.cpp b/beos/window.cpp
index 89c3d5c..845c8ac 100644
--- a/beos/window.cpp
+++ b/beos/window.cpp
@@ -1668,9 +1668,19 @@ bool gui_empty_clipboard(void)
        return true;
 }
 
-bool gui_add_to_clipboard(const char *text, size_t length, bool space)
+bool gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle)
 {
        BString s;
+       BFont font;
+       text_run *run = new text_run;
+
+       nsbeos_style_to_font(font, &fstyle);
+       run->offset = current_selection.Length();
+       run->font = font;
+       run->color = nsbeos_rgb_colour(fstyle->foreground);
+       current_selection_textruns.AddItem(run);
+
        s.SetTo(text, length);
        current_selection << s;
        if (space)
@@ -1711,47 +1721,9 @@ bool gui_commit_clipboard(void)
        return true;
 }
 
-static bool copy_handler(const char *text, size_t length, struct box *box,
-               void *handle, const char *whitespace_text,
-               size_t whitespace_length)
-{
-       bool space = false;
-       //XXX: handle box->style to StyledEdit / RTF ?
-       /* add any whitespace which precedes the text from this box */
-       if (whitespace_text) {
-               if (!gui_add_to_clipboard(whitespace_text,
-                               whitespace_length, false)) {
-                       return false;
-               }
-       }
-
-       // add a text_run for StyledEdit-like text formating
-       if (box && box->style) {
-               text_run *run = new text_run;
-               BFont font;
-               plot_font_style_t style;
-               font_plot_style_from_css(box->style, &style);
-               nsbeos_style_to_font(font, &style);
-               run->offset = current_selection.Length();
-               run->font = font;
-               css_color csscolor;
-               if (css_computed_color(box->style, &csscolor) == 
CSS_COLOR_COLOR) {
-                       run->color = 
nsbeos_rgb_colour(nscss_color_to_ns(csscolor));
-               }
-               current_selection_textruns.AddItem(run);
-               space = box->space != 0;
-       }
-
-       /* add the text from this box */
-       if (!gui_add_to_clipboard(text, length, space))
-               return false;
-
-       return true;
-}
-
 bool gui_copy_to_clipboard(struct selection *s)
 {
-       if (s->defined && selection_traverse(s, copy_handler, NULL))
+       if (s->defined && selection_copy_to_clipboard(s))
                gui_commit_clipboard();
        return true;
 }
diff --git a/cocoa/selection.m b/cocoa/selection.m
index 587f120..76617d2 100644
--- a/cocoa/selection.m
+++ b/cocoa/selection.m
@@ -56,7 +56,8 @@ bool gui_empty_clipboard(void)
        return true;
 }
 
-bool gui_add_to_clipboard(const char *text, size_t length, bool space)
+bool gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle)
 {
        if (nil == cocoa_clipboard_string) return false;
        
diff --git a/desktop/gui.h b/desktop/gui.h
index 85f1015..2fc2b91 100644
--- a/desktop/gui.h
+++ b/desktop/gui.h
@@ -129,7 +129,8 @@ void gui_clear_selection(struct gui_window *g);
 
 void gui_paste_from_clipboard(struct gui_window *g, int x, int y);
 bool gui_empty_clipboard(void);
-bool gui_add_to_clipboard(const char *text, size_t length, bool space);
+bool gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle);
 bool gui_commit_clipboard(void);
 bool gui_copy_to_clipboard(struct selection *s);
 
diff --git a/desktop/selection.c b/desktop/selection.c
index 6679be6..00984d9 100644
--- a/desktop/selection.c
+++ b/desktop/selection.c
@@ -747,18 +747,32 @@ static bool selection_copy_handler(const char *text, 
size_t length,
                struct box *box, void *handle, const char *whitespace_text,
                size_t whitespace_length)
 {
-       bool add_space = box != NULL ? box->space != 0 : false;
+       bool add_space = false;
+       plot_font_style_t style = *plot_style_font;
 
        /* add any whitespace which precedes the text from this box */
        if (whitespace_text != NULL && whitespace_length > 0) {
                if (!gui_add_to_clipboard(whitespace_text,
-                               whitespace_length, false)) {
+                               whitespace_length, false, &style)) {
                        return false;
                }
        }
 
+       if (box != NULL) {
+               /* HTML */
+               add_space = (box->space != 0);
+
+               if (box->style != NULL) {
+                       /* Override default font style */
+                       font_plot_style_from_css(box->style, &style);
+               } else {
+                       /* If there's no style, there must be no text */
+                       assert(box->text == NULL);
+               }
+       }
+
        /* add the text from this box */
-       if (!gui_add_to_clipboard(text, length, add_space))
+       if (!gui_add_to_clipboard(text, length, add_space, &style))
                return false;
 
        return true;
diff --git a/framebuffer/clipboard.c b/framebuffer/clipboard.c
index d534cfe..85e6a1d 100644
--- a/framebuffer/clipboard.c
+++ b/framebuffer/clipboard.c
@@ -69,7 +69,8 @@ bool gui_empty_clipboard(void)
  * \return true iff successful
  */
 
-bool gui_add_to_clipboard(const char *text, size_t length, bool space)
+bool gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle)
 {
        size_t new_length = gui_clipboard.length + length + (space ? 1 : 0) + 1;
 
diff --git a/gtk/selection.c b/gtk/selection.c
index 1493567..fd0b7c8 100644
--- a/gtk/selection.c
+++ b/gtk/selection.c
@@ -31,12 +31,13 @@ static GString *current_selection = NULL;
 static GtkClipboard *clipboard;
 
 
-bool gui_add_to_clipboard(const char *text, size_t length, bool space)
+bool gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle)
 {
        /* add the text from this box */
-       current_selection = g_string_append_len (current_selection,
+       current_selection = g_string_append_len(current_selection,
                text, length);
-       if (space) g_string_append (current_selection, " ");
+       if (space) g_string_append(current_selection, " ");
        return true;
 }
 
@@ -45,7 +46,7 @@ bool gui_copy_to_clipboard(struct selection *s)
        clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
        if (s->defined && selection_copy_to_clipboard(s))
                gui_commit_clipboard();
-       return TRUE;
+       return true;
 }
 
 void gui_start_selection(struct gui_window *g)
diff --git a/monkey/browser.c b/monkey/browser.c
index 265821c..a9cfd04 100644
--- a/monkey/browser.c
+++ b/monkey/browser.c
@@ -339,7 +339,8 @@ gui_empty_clipboard(void)
 }
 
 bool
-gui_add_to_clipboard(const char *text, size_t length, bool space)
+gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle)
 {
   return true;
 }
diff --git a/render/textinput.c b/render/textinput.c
index 0e62d1e..3712690 100644
--- a/render/textinput.c
+++ b/render/textinput.c
@@ -554,8 +554,8 @@ static bool textinput_textarea_cut(struct content *c,
                struct box *next = box->next;
 
                if (box->type == BOX_BR) {
-                       if (clipboard &&
-                                       !gui_add_to_clipboard("\n", 1, false)) {
+                       if (clipboard && !gui_add_to_clipboard("\n", 1, false,
+                                       plot_style_font)) {
                                gui_commit_clipboard();
                                return false;
                        }
@@ -565,7 +565,7 @@ static bool textinput_textarea_cut(struct content *c,
                        if (clipboard &&
                                !gui_add_to_clipboard(box->text + start_idx,
                                        box->length - start_idx,
-                                       SPACE_LEN(box))) {
+                                       SPACE_LEN(box), plot_style_font)) {
                                gui_commit_clipboard();
                                return false;
                        }
@@ -593,7 +593,8 @@ static bool textinput_textarea_cut(struct content *c,
        /* and the last box */
        if (box) {
                if (clipboard && !gui_add_to_clipboard(box->text + start_idx,
-                               end_idx - start_idx, end_idx > box->length)) {
+                               end_idx - start_idx, end_idx > box->length,
+                               plot_style_font)) {
                        success = false;
                } else {
                        if (del) {
diff --git a/riscos/textselection.c b/riscos/textselection.c
index 06224a5..c5a42b5 100644
--- a/riscos/textselection.c
+++ b/riscos/textselection.c
@@ -229,10 +229,12 @@ void gui_clear_selection(struct gui_window *g)
  * \param  text    text to be added
  * \param  length  length of text in bytes
  * \param  space   indicates whether a trailing space should be appended also
+ * \param  fstyle  font plot style for text
  * \return true iff successful
  */
 
-bool gui_add_to_clipboard(const char *text, size_t length, bool space)
+bool gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle)
 {
        size_t new_length = clip_length + length + (space ? 1 : 0);
 
diff --git a/windows/gui.c b/windows/gui.c
index 27f55c8..4018cc8 100644
--- a/windows/gui.c
+++ b/windows/gui.c
@@ -1766,7 +1766,8 @@ bool gui_empty_clipboard(void)
        return false;
 }
 
-bool gui_add_to_clipboard(const char *text, size_t length, bool space)
+bool gui_add_to_clipboard(const char *text, size_t length, bool space,
+               const plot_font_style_t *fstyle)
 {
        HANDLE hnew;
        char *new, *original;


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to