Gitweb links:

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

The branch, master has been updated
       via  c4a412604106e06ca4a0e59c6f7279d1e4b182a4 (commit)
       via  ca6be72dff1471556303676aea89cd72a7c0f507 (commit)
       via  cc3b9435ea05896e08aaabd3d5639fa430cc16b2 (commit)
       via  18db6826f1cd7c73dd5108210783c3ef7cc0ab2f (commit)
      from  36d30565262631c3d053f1f1e6ef8c783c62e906 (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/c4a412604106e06ca4a0e59c6f7279d1e4b182a4
commit c4a412604106e06ca4a0e59c6f7279d1e4b182a4
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Also write a (duplicate) UTF8 chunk, irregardless of the "UTF-8 clipboard" 
option.  We don't support pasting UTF8 chunks yet.

diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index ef86023..6c91f95 100755
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -43,6 +43,8 @@
 #include <datatypes/textclass.h>
 #include <datatypes/pictureclass.h>
 
+#define ID_UTF8  MAKE_ID('U','T','F','8')
+
 struct IFFHandle *iffh = NULL;
 bool ami_utf8_clipboard = false; // force UTF-8 in clipboard
 
@@ -228,6 +230,15 @@ bool gui_add_to_clipboard(const char *text, size_t length, 
bool space)
                PopChunk(iffh);
                return false;
        }
+
+       if(!(PushChunk(iffh, 0, ID_UTF8, IFFSIZE_UNKNOWN))) {
+               WriteChunkBytes(iffh, text, length);
+               if(space) WriteChunkBytes(iffh, " ", 1);
+               PopChunk(iffh);
+       } else {
+               PopChunk(iffh);
+               return false;
+       }
                
        return true;
 }


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/ca6be72dff1471556303676aea89cd72a7c0f507
commit ca6be72dff1471556303676aea89cd72a7c0f507
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Remove extraneous functionage

diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index 49cee2d..ef86023 100755
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -198,18 +198,10 @@ bool gui_add_to_clipboard(const char *text, size_t 
length, bool space)
           These only seem to be called from desktop/textinput.c in this 
specific order, if they
           are added elsewhere this might need a rewrite. */
 
-       if(text)
-       {
-               if(!ami_add_to_clipboard(text, length, space)) return false;
-       }
-
-       return true;
-}
-
-bool ami_add_to_clipboard(const char *text, size_t length, bool space)
-{
        char *buffer;
 
+       if(text == NULL) return true;
+       
        if(!(PushChunk(iffh,0,ID_CHRS,IFFSIZE_UNKNOWN))) {
                if(nsoption_bool(utf8_clipboard) || ami_utf8_clipboard) {
                        WriteChunkBytes(iffh,text,length);


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/cc3b9435ea05896e08aaabd3d5639fa430cc16b2
commit cc3b9435ea05896e08aaabd3d5639fa430cc16b2
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Use core clipboard copy function. ami_selection_to_text() will need fixing 
as it still needs selection_traverse()

diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index d6f2867..49cee2d 100755
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -247,23 +247,6 @@ bool gui_commit_clipboard(void)
        return true;
 }
 
-bool ami_clipboard_copy(const char *text, size_t length, struct box *box,
-       void *handle, const char *whitespace_text,size_t whitespace_length)
-{
-       if (whitespace_text)
-       {
-               if(!ami_add_to_clipboard(whitespace_text,whitespace_length, 
false)) return false;
-       }
-
-       if(text)
-       {
-               bool add_space = box != NULL ? box->space != 0 : false;
-
-               if (!ami_add_to_clipboard(text, length, add_space)) return 
false;
-       }
-       return true;
-}
-
 bool gui_copy_to_clipboard(struct selection *s)
 {
        bool success;
@@ -271,7 +254,7 @@ bool gui_copy_to_clipboard(struct selection *s)
        if(s->defined == false) return false;
        if(!gui_empty_clipboard()) return false;
 
-       success = selection_traverse(s, ami_clipboard_copy, NULL);
+       success = selection_copy_to_clipboard(s);
 
        /* commit regardless, otherwise we leave the clipboard in an unusable 
state */
        gui_commit_clipboard();


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/18db6826f1cd7c73dd5108210783c3ef7cc0ab2f
commit 18db6826f1cd7c73dd5108210783c3ef7cc0ab2f
Author: Chris Young <[email protected]>
Commit: Chris Young <[email protected]>

    Move Push- and PopChunk out of the selection_traversal function

diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index b98ef57..d6f2867 100755
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -198,19 +198,9 @@ bool gui_add_to_clipboard(const char *text, size_t length, 
bool space)
           These only seem to be called from desktop/textinput.c in this 
specific order, if they
           are added elsewhere this might need a rewrite. */
 
-       if(!(PushChunk(iffh,0,ID_CHRS,IFFSIZE_UNKNOWN)))
+       if(text)
        {
-               if(text)
-               {
-                       if(!ami_add_to_clipboard(text, length, space)) return 
false;
-               }
-
-               PopChunk(iffh);
-       }
-       else
-       {
-               PopChunk(iffh);
-               return false;
+               if(!ami_add_to_clipboard(text, length, space)) return false;
        }
 
        return true;
@@ -220,33 +210,33 @@ bool ami_add_to_clipboard(const char *text, size_t 
length, bool space)
 {
        char *buffer;
 
-       if(nsoption_bool(utf8_clipboard) || ami_utf8_clipboard)
-       {
-               WriteChunkBytes(iffh,text,length);
-       }
-       else
-       {
-               buffer = ami_utf8_easy(text);
+       if(!(PushChunk(iffh,0,ID_CHRS,IFFSIZE_UNKNOWN))) {
+               if(nsoption_bool(utf8_clipboard) || ami_utf8_clipboard) {
+                       WriteChunkBytes(iffh,text,length);
+               } else {
+                       buffer = ami_utf8_easy(text);
 
-               if(buffer)
-               {
-                       char *p;
+                       if(buffer) {
+                               char *p;
 
-                       p = buffer;
+                               p = buffer;
 
-                       while(*p != '\0')
-                       {
-                               if(*p == 0xa0) *p = 0x20;
-                               p++;
+                               while(*p != '\0') {
+                                       if(*p == 0xa0) *p = 0x20;
+                                       p++;
+                               }
+                               WriteChunkBytes(iffh, buffer, strlen(buffer));
+                               ami_utf8_free(buffer);
                        }
-                       WriteChunkBytes(iffh, buffer, strlen(buffer));
-
-                       ami_utf8_free(buffer);
                }
-       }
-
-       if(space) WriteChunkBytes(iffh," ",1);
 
+               if(space) WriteChunkBytes(iffh," ",1);
+               PopChunk(iffh);
+       } else {
+               PopChunk(iffh);
+               return false;
+       }
+               
        return true;
 }
 
@@ -260,28 +250,17 @@ bool gui_commit_clipboard(void)
 bool ami_clipboard_copy(const char *text, size_t length, struct box *box,
        void *handle, const char *whitespace_text,size_t whitespace_length)
 {
-       if(!(PushChunk(iffh,0,ID_CHRS,IFFSIZE_UNKNOWN)))
+       if (whitespace_text)
        {
-               if (whitespace_text)
-               {
-                       
if(!ami_add_to_clipboard(whitespace_text,whitespace_length, false)) return 
false;
-               }
-
-               if(text)
-               {
-                       bool add_space = box != NULL ? box->space != 0 : false;
-
-                       if (!ami_add_to_clipboard(text, length, add_space)) 
return false;
-               }
-
-               PopChunk(iffh);
+               if(!ami_add_to_clipboard(whitespace_text,whitespace_length, 
false)) return false;
        }
-       else
+
+       if(text)
        {
-               PopChunk(iffh);
-               return false;
-       }
+               bool add_space = box != NULL ? box->space != 0 : false;
 
+               if (!ami_add_to_clipboard(text, length, add_space)) return 
false;
+       }
        return true;
 }
 


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

Summary of changes:
 amiga/clipboard.c |  103 +++++++++++++++++-----------------------------------
 1 files changed, 34 insertions(+), 69 deletions(-)

diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index b98ef57..6c91f95 100755
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -43,6 +43,8 @@
 #include <datatypes/textclass.h>
 #include <datatypes/pictureclass.h>
 
+#define ID_UTF8  MAKE_ID('U','T','F','8')
+
 struct IFFHandle *iffh = NULL;
 bool ami_utf8_clipboard = false; // force UTF-8 in clipboard
 
@@ -198,55 +200,46 @@ bool gui_add_to_clipboard(const char *text, size_t 
length, bool space)
           These only seem to be called from desktop/textinput.c in this 
specific order, if they
           are added elsewhere this might need a rewrite. */
 
-       if(!(PushChunk(iffh,0,ID_CHRS,IFFSIZE_UNKNOWN)))
-       {
-               if(text)
-               {
-                       if(!ami_add_to_clipboard(text, length, space)) return 
false;
-               }
-
-               PopChunk(iffh);
-       }
-       else
-       {
-               PopChunk(iffh);
-               return false;
-       }
-
-       return true;
-}
-
-bool ami_add_to_clipboard(const char *text, size_t length, bool space)
-{
        char *buffer;
 
-       if(nsoption_bool(utf8_clipboard) || ami_utf8_clipboard)
-       {
-               WriteChunkBytes(iffh,text,length);
-       }
-       else
-       {
-               buffer = ami_utf8_easy(text);
+       if(text == NULL) return true;
+       
+       if(!(PushChunk(iffh,0,ID_CHRS,IFFSIZE_UNKNOWN))) {
+               if(nsoption_bool(utf8_clipboard) || ami_utf8_clipboard) {
+                       WriteChunkBytes(iffh,text,length);
+               } else {
+                       buffer = ami_utf8_easy(text);
 
-               if(buffer)
-               {
-                       char *p;
+                       if(buffer) {
+                               char *p;
 
-                       p = buffer;
+                               p = buffer;
 
-                       while(*p != '\0')
-                       {
-                               if(*p == 0xa0) *p = 0x20;
-                               p++;
+                               while(*p != '\0') {
+                                       if(*p == 0xa0) *p = 0x20;
+                                       p++;
+                               }
+                               WriteChunkBytes(iffh, buffer, strlen(buffer));
+                               ami_utf8_free(buffer);
                        }
-                       WriteChunkBytes(iffh, buffer, strlen(buffer));
-
-                       ami_utf8_free(buffer);
                }
-       }
 
-       if(space) WriteChunkBytes(iffh," ",1);
+               if(space) WriteChunkBytes(iffh," ",1);
+               PopChunk(iffh);
+       } else {
+               PopChunk(iffh);
+               return false;
+       }
 
+       if(!(PushChunk(iffh, 0, ID_UTF8, IFFSIZE_UNKNOWN))) {
+               WriteChunkBytes(iffh, text, length);
+               if(space) WriteChunkBytes(iffh, " ", 1);
+               PopChunk(iffh);
+       } else {
+               PopChunk(iffh);
+               return false;
+       }
+               
        return true;
 }
 
@@ -257,34 +250,6 @@ bool gui_commit_clipboard(void)
        return true;
 }
 
-bool ami_clipboard_copy(const char *text, size_t length, struct box *box,
-       void *handle, const char *whitespace_text,size_t whitespace_length)
-{
-       if(!(PushChunk(iffh,0,ID_CHRS,IFFSIZE_UNKNOWN)))
-       {
-               if (whitespace_text)
-               {
-                       
if(!ami_add_to_clipboard(whitespace_text,whitespace_length, false)) return 
false;
-               }
-
-               if(text)
-               {
-                       bool add_space = box != NULL ? box->space != 0 : false;
-
-                       if (!ami_add_to_clipboard(text, length, add_space)) 
return false;
-               }
-
-               PopChunk(iffh);
-       }
-       else
-       {
-               PopChunk(iffh);
-               return false;
-       }
-
-       return true;
-}
-
 bool gui_copy_to_clipboard(struct selection *s)
 {
        bool success;
@@ -292,7 +257,7 @@ bool gui_copy_to_clipboard(struct selection *s)
        if(s->defined == false) return false;
        if(!gui_empty_clipboard()) return false;
 
-       success = selection_traverse(s, ami_clipboard_copy, NULL);
+       success = selection_copy_to_clipboard(s);
 
        /* commit regardless, otherwise we leave the clipboard in an unusable 
state */
        gui_commit_clipboard();


-- 
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