netsurf: branch tlsa/selection-search-refactor updated. release/3.0-54-g631265e

NetSurf Browser Project (Commit Mailer) no-reply at netsurf-browser.org
Fri May 10 12:17:14 BST 2013


Gitweb links:

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

The branch, tlsa/selection-search-refactor has been updated
       via  631265ef6b06ee5ffe33fae793360d651984d91d (commit)
       via  9644d0594c1dfcc6e104754793a75d23c7a6840e (commit)
       via  d2d04824cfc088cf6776fe2c2e2abdb953dfe006 (commit)
       via  70b1a8b1cef34b956422c92d51aad73f47bc35a1 (commit)
       via  9c6e4c7eb5d425d216ad3ccc987a854d904b59cd (commit)
       via  a0fde060e8b11b55ea70c2d71565a4f4e326b768 (commit)
      from  8b6665fe0383fd565ac7d7cd6a2bf6243ebc9937 (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=631265ef6b06ee5ffe33fae793360d651984d91d
commit 631265ef6b06ee5ffe33fae793360d651984d91d
Author: Michael Drake <tlsa at netsurf-browser.org>
Commit: Michael Drake <tlsa at netsurf-browser.org>

    Front ends have no reason to include desktop/selection.h now.

diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index ae4d8a5..2a4f2ab 100644
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -18,7 +18,6 @@
 
 #include "desktop/gui.h"
 #include "desktop/plotters.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "desktop/options.h"
 
diff --git a/amiga/context_menu.c b/amiga/context_menu.c
index 0a71d30..6ee08f5 100644
--- a/amiga/context_menu.c
+++ b/amiga/context_menu.c
@@ -42,7 +42,6 @@
 #include "desktop/browser_private.h"
 #include "desktop/history_core.h"
 #include "desktop/hotlist.h"
-#include "desktop/selection.h"
 #include "desktop/searchweb.h"
 #include "desktop/textinput.h"
 #include "desktop/tree_url_node.h"
diff --git a/amiga/download.c b/amiga/download.c
index b9b27ab..e461c5f 100644
--- a/amiga/download.c
+++ b/amiga/download.c
@@ -43,7 +43,6 @@
 #include "amiga/utf8.h"
 
 #include "desktop/download.h"
-#include "desktop/selection.h"
 #include "desktop/save_complete.h"
 
 #include "image/ico.h"
diff --git a/amiga/drag.c b/amiga/drag.c
index 8051cc3..c8b4416 100644
--- a/amiga/drag.c
+++ b/amiga/drag.c
@@ -40,8 +40,6 @@
 #include "desktop/options.h"
 #include "amiga/theme.h"
 
-#include "desktop/selection.h"
-
 #include "utils/errors.h"
 #include "utils/log.h"
 #include "utils/messages.h"
diff --git a/amiga/file.c b/amiga/file.c
index 68e2637..49c0afe 100644
--- a/amiga/file.c
+++ b/amiga/file.c
@@ -33,7 +33,6 @@
 #include "desktop/save_complete.h"
 #include "desktop/save_pdf/pdf_plotters.h"
 #include "desktop/save_text.h"
-#include "desktop/selection.h"
 
 #include "utils/messages.h"
 #include "utils/url.h"
diff --git a/amiga/gui.c b/amiga/gui.c
index e2616cf..b0c1c7e 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -27,7 +27,6 @@
 #include "desktop/save_complete.h"
 #include "desktop/scrollbar.h"
 #include "desktop/searchweb.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "desktop/tree.h"
 #include "desktop/tree_url_node.h"
diff --git a/amiga/menu.c b/amiga/menu.c
index c710bff..7334f77 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -60,7 +60,6 @@
 #include "desktop/hotlist.h"
 #include "desktop/browser_private.h"
 #include "desktop/gui.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "utils/messages.h"
 #include "utils/schedule.h"
diff --git a/amiga/search.c b/amiga/search.c
index dd2aa23..18ea27f 100755
--- a/amiga/search.c
+++ b/amiga/search.c
@@ -29,7 +29,6 @@
 #include "desktop/browser.h"
 #include "desktop/gui.h"
 #include "desktop/search.h"
-#include "desktop/selection.h"
 #include "utils/log.h"
 #include "utils/messages.h"
 #include "utils/utils.h"
diff --git a/atari/download.c b/atari/download.c
index 2096504..32a6f12 100755
--- a/atari/download.c
+++ b/atari/download.c
@@ -32,7 +32,6 @@
 #include "desktop/netsurf.h"
 #include "desktop/options.h"
 #include "desktop/save_complete.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "desktop/download.h"
 #include "render/html.h"
diff --git a/atari/gui.c b/atari/gui.c
index cff6082..f125142 100644
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -42,7 +42,6 @@
 
 #include "desktop/options.h"
 #include "desktop/save_complete.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "desktop/browser.h"
 #include "desktop/browser_private.h"
diff --git a/beos/window.cpp b/beos/window.cpp
index 27d68f3..3ce8e27 100644
--- a/beos/window.cpp
+++ b/beos/window.cpp
@@ -26,7 +26,6 @@ extern "C" {
 #include "desktop/browser_private.h"
 #include "desktop/mouse.h"
 #include "desktop/options.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "render/font.h"
 #include "utils/log.h"
diff --git a/cocoa/BrowserView.m b/cocoa/BrowserView.m
index 3b947ea..4bda3b5 100644
--- a/cocoa/BrowserView.m
+++ b/cocoa/BrowserView.m
@@ -28,7 +28,6 @@
 #import "desktop/plotters.h"
 #import "desktop/textinput.h"
 #import "desktop/options.h"
-#import "desktop/selection.h"
 #import "utils/messages.h"
 
 @interface BrowserView ()
diff --git a/cocoa/BrowserViewController.m b/cocoa/BrowserViewController.m
index f43917a..bea383d 100644
--- a/cocoa/BrowserViewController.m
+++ b/cocoa/BrowserViewController.m
@@ -24,7 +24,6 @@
 #import "desktop/history_core.h"
 #import "desktop/textinput.h"
 #import "desktop/options.h"
-#import "desktop/selection.h"
 
 #import "utils/corestrings.h"
 #import "utils/filename.h"
diff --git a/cocoa/NetsurfApp.m b/cocoa/NetsurfApp.m
index 9d19824..19d8437 100644
--- a/cocoa/NetsurfApp.m
+++ b/cocoa/NetsurfApp.m
@@ -32,7 +32,6 @@
 #import "desktop/options.h"
 #import "desktop/plotters.h"
 #import "desktop/save_complete.h"
-#import "desktop/selection.h"
 #import "desktop/textinput.h"
 #import "desktop/tree.h"
 #import "render/html.h"
diff --git a/cocoa/gui.m b/cocoa/gui.m
index fed4da8..fe92c52 100644
--- a/cocoa/gui.m
+++ b/cocoa/gui.m
@@ -30,7 +30,6 @@
 #import "desktop/browser_private.h"
 #import "desktop/options.h"
 #import "desktop/textinput.h"
-#import "desktop/selection.h"
 #import "desktop/401login.h"
 #import "utils/utils.h"
 #import "image/ico.h"
diff --git a/cocoa/selection.m b/cocoa/selection.m
index acfd550..237c61c 100644
--- a/cocoa/selection.m
+++ b/cocoa/selection.m
@@ -21,7 +21,6 @@
 #import "cocoa/BrowserViewController.h"
 
 #import "desktop/browser_private.h"
-#import "desktop/selection.h"
 
 
 static NSMutableString *cocoa_clipboard_string;
diff --git a/framebuffer/clipboard.c b/framebuffer/clipboard.c
index bd9c89d..46a1bb0 100644
--- a/framebuffer/clipboard.c
+++ b/framebuffer/clipboard.c
@@ -25,7 +25,6 @@
 #include <string.h>
 #include "desktop/browser.h"
 #include "desktop/gui.h"
-#include "desktop/selection.h"
 #include "framebuffer/gui.h"
 #include "utils/log.h"
 
diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c
index 8f1f444..5abda62 100644
--- a/gtk/scaffolding.c
+++ b/gtk/scaffolding.c
@@ -48,7 +48,6 @@
 #include "desktop/save_text.h"
 #include "desktop/search.h"
 #include "desktop/searchweb.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "desktop/tree.h"
 #include "gtk/cookies.h"
diff --git a/gtk/search.c b/gtk/search.c
index 3d6bba0..d4fbadc 100644
--- a/gtk/search.c
+++ b/gtk/search.c
@@ -36,7 +36,6 @@
 #include "desktop/gui.h"
 #include "desktop/search.h"
 #include "desktop/searchweb.h"
-#include "desktop/selection.h"
 #include "utils/log.h"
 #include "utils/messages.h"
 #include "utils/utils.h"
diff --git a/gtk/selection.c b/gtk/selection.c
index 7d516e9..b0978b3 100644
--- a/gtk/selection.c
+++ b/gtk/selection.c
@@ -22,7 +22,6 @@
 #include "utils/log.h"
 
 #include "desktop/gui.h"
-#include "desktop/selection.h"
 #include "desktop/browser.h"
 #include "gtk/selection.h"
 #include "gtk/window.h"
diff --git a/gtk/window.c b/gtk/window.c
index 8b7d2f9..798181a 100644
--- a/gtk/window.c
+++ b/gtk/window.c
@@ -33,7 +33,6 @@
 #include "desktop/options.h"
 #include "desktop/searchweb.h"
 #include "desktop/textinput.h"
-#include "desktop/selection.h"
 #include "gtk/compat.h"
 #include "gtk/gui.h"
 #include "gtk/scaffolding.h"
diff --git a/riscos/menus.c b/riscos/menus.c
index 5500910..5c80fd9 100644
--- a/riscos/menus.c
+++ b/riscos/menus.c
@@ -41,7 +41,6 @@
 #include "desktop/history_core.h"
 #include "desktop/hotlist.h"
 #include "desktop/netsurf.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "riscos/dialog.h"
 #include "riscos/configure.h"
diff --git a/riscos/save.c b/riscos/save.c
index 47006d2..7ccbfb1 100644
--- a/riscos/save.c
+++ b/riscos/save.c
@@ -42,7 +42,6 @@
 #include "desktop/netsurf.h"
 #include "desktop/save_complete.h"
 #include "desktop/save_text.h"
-#include "desktop/selection.h"
 #include "desktop/thumbnail.h"
 #include "image/bitmap.h"
 #include "render/form.h"
diff --git a/riscos/search.c b/riscos/search.c
index be6db27..3d3b7ba 100644
--- a/riscos/search.c
+++ b/riscos/search.c
@@ -34,7 +34,6 @@
 #include "desktop/gui.h"
 #include "desktop/browser_private.h"
 #include "desktop/search.h"
-#include "desktop/selection.h"
 #include "riscos/dialog.h"
 #include "riscos/menus.h"
 #include "riscos/wimp.h"
diff --git a/riscos/textselection.c b/riscos/textselection.c
index a1a0288..094924b 100644
--- a/riscos/textselection.c
+++ b/riscos/textselection.c
@@ -27,7 +27,6 @@
 #include "oslib/wimp.h"
 #include "content/hlcache.h"
 #include "desktop/gui.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "riscos/gui.h"
 #include "riscos/menus.h"
diff --git a/riscos/window.c b/riscos/window.c
index 164075d..295315d 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -53,7 +53,6 @@
 #include "desktop/hotlist.h"
 #include "desktop/mouse.h"
 #include "desktop/plotters.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "desktop/thumbnail.h"
 #include "desktop/tree.h"
diff --git a/windows/gui.c b/windows/gui.c
index 63855e0..e318f3a 100644
--- a/windows/gui.c
+++ b/windows/gui.c
@@ -38,7 +38,6 @@
 #include "desktop/netsurf.h"
 #include "desktop/options.h"
 #include "desktop/plotters.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "render/html.h"
 #include "utils/log.h"


commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=9644d0594c1dfcc6e104754793a75d23c7a6840e
commit 9644d0594c1dfcc6e104754793a75d23c7a6840e
Author: Michael Drake <tlsa at netsurf-browser.org>
Commit: Michael Drake <tlsa at netsurf-browser.org>

    Remove struct selection from gui_drag_save_selection, so gui.h doesn't need it now.

diff --git a/amiga/drag.c b/amiga/drag.c
index 45b0843..8051cc3 100644
--- a/amiga/drag.c
+++ b/amiga/drag.c
@@ -89,7 +89,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
 	drag_save = type;
 }
 
-void gui_drag_save_selection(struct selection *s, struct gui_window *g)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
 	ami_drag_icon_show(g->shared->win, "ascii");
 
diff --git a/atari/gui.c b/atari/gui.c
index db44c0a..cff6082 100644
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -661,7 +661,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
     TODO();
 }
 
-void gui_drag_save_selection(struct selection *s, struct gui_window *w)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
     LOG((""));
     TODO();
diff --git a/beos/window.cpp b/beos/window.cpp
index 1e564a1..27d68f3 100644
--- a/beos/window.cpp
+++ b/beos/window.cpp
@@ -1297,7 +1297,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
 
 }
 
-void gui_drag_save_selection(struct selection *s, struct gui_window *g)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
 
 }
diff --git a/cocoa/gui.m b/cocoa/gui.m
index cd7e6d2..fed4da8 100644
--- a/cocoa/gui.m
+++ b/cocoa/gui.m
@@ -291,7 +291,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
 {
 }
 
-void gui_drag_save_selection(struct selection *s, struct gui_window *g)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
 }
 
diff --git a/desktop/gui.h b/desktop/gui.h
index b38bb61..f4b8b72 100644
--- a/desktop/gui.h
+++ b/desktop/gui.h
@@ -50,7 +50,6 @@ typedef enum {
 struct gui_window;
 struct gui_download_window;
 struct browser_window;
-struct selection;
 struct form_control;
 
 #include <stdbool.h>
@@ -116,7 +115,7 @@ void gui_download_window_done(struct gui_download_window *dw);
 
 void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
 		struct gui_window *g);
-void gui_drag_save_selection(struct selection *s, struct gui_window *g);
+void gui_drag_save_selection(struct gui_window *g, const char *selection);
 void gui_start_selection(struct gui_window *g);
 void gui_clear_selection(struct gui_window *g);
 
diff --git a/desktop/selection.c b/desktop/selection.c
index 1b85a09..13a1293 100644
--- a/desktop/selection.c
+++ b/desktop/selection.c
@@ -273,8 +273,9 @@ bool selection_click(struct selection *s, browser_mouse_state mouse,
 		((mouse & BROWSER_MOUSE_DRAG_1) ||
 		 (modkeys && (mouse & BROWSER_MOUSE_DRAG_2)))) {
 		/* drag-saving selection */
-
-		gui_drag_save_selection(s, top->window);
+		char *sel = selection_get_copy(s);
+		gui_drag_save_selection(top->window, sel);
+		free(sel);
 	}
 	else if (!modkeys) {
 		if (pos && (mouse & BROWSER_MOUSE_PRESS_1)) {
diff --git a/framebuffer/gui.c b/framebuffer/gui.c
index 432c298..d063475 100644
--- a/framebuffer/gui.c
+++ b/framebuffer/gui.c
@@ -1844,7 +1844,7 @@ gui_drag_save_object(gui_save_type type,
 }
 
 void
-gui_drag_save_selection(struct selection *s, struct gui_window *g)
+gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
 }
 
diff --git a/gtk/window.c b/gtk/window.c
index 663ff32..8b7d2f9 100644
--- a/gtk/window.c
+++ b/gtk/window.c
@@ -1080,7 +1080,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
 
 }
 
-void gui_drag_save_selection(struct selection *s, struct gui_window *g)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
 
 }
diff --git a/monkey/browser.c b/monkey/browser.c
index 9d87f44..09ecf4b 100644
--- a/monkey/browser.c
+++ b/monkey/browser.c
@@ -314,7 +314,7 @@ gui_window_scroll_visible(struct gui_window *g, int x0, int y0,
 }
 
 void
-gui_drag_save_selection(struct selection *s, struct gui_window *g)
+gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
 }
 
diff --git a/riscos/save.c b/riscos/save.c
index 549a2ab..47006d2 100644
--- a/riscos/save.c
+++ b/riscos/save.c
@@ -395,7 +395,7 @@ void gui_drag_save_object(gui_save_type save_type, hlcache_handle *c,
  * \param  g  gui window
  */
 
-void gui_drag_save_selection(struct selection *s, struct gui_window *g)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
 	wimp_pointer pointer;
 	char icon_buf[20];
@@ -421,7 +421,10 @@ void gui_drag_save_selection(struct selection *s, struct gui_window *g)
 	if (gui_save_selection == NULL)
 		free(gui_save_selection);
 
-	gui_save_selection = selection_get_copy(s);
+	if (selection == NULL)
+		gui_save_selection = strdup("");
+	else
+		gui_save_selection = strdup(selection);
 
 	ro_gui_save_set_state(NULL, GUI_SAVE_TEXT_SELECTION, NULL,
 			save_leafname, LEAFNAME_MAX,
diff --git a/windows/gui.c b/windows/gui.c
index 313da54..63855e0 100644
--- a/windows/gui.c
+++ b/windows/gui.c
@@ -1766,7 +1766,8 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
 {
 }
 
-void gui_drag_save_selection(struct selection *s, struct gui_window *w)
+
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
 }
 


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

Summary of changes:
 Makefile                      |   13 +++++++++++++
 amiga/clipboard.c             |    1 -
 amiga/context_menu.c          |    1 -
 amiga/download.c              |    1 -
 amiga/drag.c                  |    4 +---
 amiga/file.c                  |    1 -
 amiga/gui.c                   |    1 -
 amiga/menu.c                  |    1 -
 amiga/search.c                |    1 -
 atari/download.c              |    1 -
 atari/gui.c                   |    3 +--
 beos/window.cpp               |    3 +--
 cocoa/BrowserView.m           |    1 -
 cocoa/BrowserViewController.m |    1 -
 cocoa/NetsurfApp.m            |    1 -
 cocoa/gui.m                   |    3 +--
 cocoa/selection.m             |    1 -
 desktop/gui.h                 |    3 +--
 desktop/selection.c           |    5 +++--
 framebuffer/clipboard.c       |    1 -
 framebuffer/gui.c             |    2 +-
 gtk/scaffolding.c             |    1 -
 gtk/search.c                  |    1 -
 gtk/selection.c               |    1 -
 gtk/window.c                  |    3 +--
 monkey/browser.c              |    2 +-
 riscos/menus.c                |    1 -
 riscos/save.c                 |    8 +++++---
 riscos/search.c               |    1 -
 riscos/textselection.c        |    1 -
 riscos/window.c               |    1 -
 utils/import-messages.pl      |   39 ++++++++++++++++++++++++++++++++-------
 windows/gui.c                 |    4 ++--
 33 files changed, 63 insertions(+), 49 deletions(-)

diff --git a/Makefile b/Makefile
index 88cb9bb..df13b5e 100644
--- a/Makefile
+++ b/Makefile
@@ -758,6 +758,19 @@ define clean_install_messages
 	)
 endef
 
+.PHONY: messages-split-tfx messages-fetch-tfx messages-import-tfx
+
+# split fat messages into properties files suitable for uploading to transifex
+messages-split-tfx:
+	for splitlang in $(FAT_LANGUAGES);do perl ./utils/split-messages.pl -l $${splitlang} -f transifex -p any -o Messages.any.$${splitlang}.tfx resources/FatMessages;done
+
+# download property files from transifex
+messages-fetch-tfx:
+	for splitlang in $(FAT_LANGUAGES);do $(RM) Messages.any.$${splitlang}.tfx ; perl ./utils/fetch-transifex.pl -w insecure -l $${splitlang} -o Messages.any.$${splitlang}.tfx ;done
+
+# merge property files into fat messages
+messages-import-tfx: messages-fetch-tfx
+	for tfxlang in $(FAT_LANGUAGES);do perl ./utils/import-messages.pl -l $${tfxlang} -p any -f transifex -o resources/FatMessages -i resources/FatMessages -I Messages.any.$${tfxlang}.tfx ; $(RM) Messages.any.$${tfxlang}.tfx; done
 
 # Target installs executable on the host system 
 install: all-program install-$(TARGET)
diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index ae4d8a5..2a4f2ab 100644
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -18,7 +18,6 @@
 
 #include "desktop/gui.h"
 #include "desktop/plotters.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "desktop/options.h"
 
diff --git a/amiga/context_menu.c b/amiga/context_menu.c
index 0a71d30..6ee08f5 100644
--- a/amiga/context_menu.c
+++ b/amiga/context_menu.c
@@ -42,7 +42,6 @@
 #include "desktop/browser_private.h"
 #include "desktop/history_core.h"
 #include "desktop/hotlist.h"
-#include "desktop/selection.h"
 #include "desktop/searchweb.h"
 #include "desktop/textinput.h"
 #include "desktop/tree_url_node.h"
diff --git a/amiga/download.c b/amiga/download.c
index b9b27ab..e461c5f 100644
--- a/amiga/download.c
+++ b/amiga/download.c
@@ -43,7 +43,6 @@
 #include "amiga/utf8.h"
 
 #include "desktop/download.h"
-#include "desktop/selection.h"
 #include "desktop/save_complete.h"
 
 #include "image/ico.h"
diff --git a/amiga/drag.c b/amiga/drag.c
index 45b0843..c8b4416 100644
--- a/amiga/drag.c
+++ b/amiga/drag.c
@@ -40,8 +40,6 @@
 #include "desktop/options.h"
 #include "amiga/theme.h"
 
-#include "desktop/selection.h"
-
 #include "utils/errors.h"
 #include "utils/log.h"
 #include "utils/messages.h"
@@ -89,7 +87,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
 	drag_save = type;
 }
 
-void gui_drag_save_selection(struct selection *s, struct gui_window *g)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
 	ami_drag_icon_show(g->shared->win, "ascii");
 
diff --git a/amiga/file.c b/amiga/file.c
index 68e2637..49c0afe 100644
--- a/amiga/file.c
+++ b/amiga/file.c
@@ -33,7 +33,6 @@
 #include "desktop/save_complete.h"
 #include "desktop/save_pdf/pdf_plotters.h"
 #include "desktop/save_text.h"
-#include "desktop/selection.h"
 
 #include "utils/messages.h"
 #include "utils/url.h"
diff --git a/amiga/gui.c b/amiga/gui.c
index e2616cf..b0c1c7e 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -27,7 +27,6 @@
 #include "desktop/save_complete.h"
 #include "desktop/scrollbar.h"
 #include "desktop/searchweb.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "desktop/tree.h"
 #include "desktop/tree_url_node.h"
diff --git a/amiga/menu.c b/amiga/menu.c
index c710bff..7334f77 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -60,7 +60,6 @@
 #include "desktop/hotlist.h"
 #include "desktop/browser_private.h"
 #include "desktop/gui.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "utils/messages.h"
 #include "utils/schedule.h"
diff --git a/amiga/search.c b/amiga/search.c
index dd2aa23..18ea27f 100755
--- a/amiga/search.c
+++ b/amiga/search.c
@@ -29,7 +29,6 @@
 #include "desktop/browser.h"
 #include "desktop/gui.h"
 #include "desktop/search.h"
-#include "desktop/selection.h"
 #include "utils/log.h"
 #include "utils/messages.h"
 #include "utils/utils.h"
diff --git a/atari/download.c b/atari/download.c
index 2096504..32a6f12 100755
--- a/atari/download.c
+++ b/atari/download.c
@@ -32,7 +32,6 @@
 #include "desktop/netsurf.h"
 #include "desktop/options.h"
 #include "desktop/save_complete.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "desktop/download.h"
 #include "render/html.h"
diff --git a/atari/gui.c b/atari/gui.c
index db44c0a..f125142 100644
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -42,7 +42,6 @@
 
 #include "desktop/options.h"
 #include "desktop/save_complete.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "desktop/browser.h"
 #include "desktop/browser_private.h"
@@ -661,7 +660,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
     TODO();
 }
 
-void gui_drag_save_selection(struct selection *s, struct gui_window *w)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
     LOG((""));
     TODO();
diff --git a/beos/window.cpp b/beos/window.cpp
index 1e564a1..3ce8e27 100644
--- a/beos/window.cpp
+++ b/beos/window.cpp
@@ -26,7 +26,6 @@ extern "C" {
 #include "desktop/browser_private.h"
 #include "desktop/mouse.h"
 #include "desktop/options.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "render/font.h"
 #include "utils/log.h"
@@ -1297,7 +1296,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
 
 }
 
-void gui_drag_save_selection(struct selection *s, struct gui_window *g)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
 
 }
diff --git a/cocoa/BrowserView.m b/cocoa/BrowserView.m
index 3b947ea..4bda3b5 100644
--- a/cocoa/BrowserView.m
+++ b/cocoa/BrowserView.m
@@ -28,7 +28,6 @@
 #import "desktop/plotters.h"
 #import "desktop/textinput.h"
 #import "desktop/options.h"
-#import "desktop/selection.h"
 #import "utils/messages.h"
 
 @interface BrowserView ()
diff --git a/cocoa/BrowserViewController.m b/cocoa/BrowserViewController.m
index f43917a..bea383d 100644
--- a/cocoa/BrowserViewController.m
+++ b/cocoa/BrowserViewController.m
@@ -24,7 +24,6 @@
 #import "desktop/history_core.h"
 #import "desktop/textinput.h"
 #import "desktop/options.h"
-#import "desktop/selection.h"
 
 #import "utils/corestrings.h"
 #import "utils/filename.h"
diff --git a/cocoa/NetsurfApp.m b/cocoa/NetsurfApp.m
index 9d19824..19d8437 100644
--- a/cocoa/NetsurfApp.m
+++ b/cocoa/NetsurfApp.m
@@ -32,7 +32,6 @@
 #import "desktop/options.h"
 #import "desktop/plotters.h"
 #import "desktop/save_complete.h"
-#import "desktop/selection.h"
 #import "desktop/textinput.h"
 #import "desktop/tree.h"
 #import "render/html.h"
diff --git a/cocoa/gui.m b/cocoa/gui.m
index cd7e6d2..fe92c52 100644
--- a/cocoa/gui.m
+++ b/cocoa/gui.m
@@ -30,7 +30,6 @@
 #import "desktop/browser_private.h"
 #import "desktop/options.h"
 #import "desktop/textinput.h"
-#import "desktop/selection.h"
 #import "desktop/401login.h"
 #import "utils/utils.h"
 #import "image/ico.h"
@@ -291,7 +290,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
 {
 }
 
-void gui_drag_save_selection(struct selection *s, struct gui_window *g)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
 }
 
diff --git a/cocoa/selection.m b/cocoa/selection.m
index acfd550..237c61c 100644
--- a/cocoa/selection.m
+++ b/cocoa/selection.m
@@ -21,7 +21,6 @@
 #import "cocoa/BrowserViewController.h"
 
 #import "desktop/browser_private.h"
-#import "desktop/selection.h"
 
 
 static NSMutableString *cocoa_clipboard_string;
diff --git a/desktop/gui.h b/desktop/gui.h
index b38bb61..f4b8b72 100644
--- a/desktop/gui.h
+++ b/desktop/gui.h
@@ -50,7 +50,6 @@ typedef enum {
 struct gui_window;
 struct gui_download_window;
 struct browser_window;
-struct selection;
 struct form_control;
 
 #include <stdbool.h>
@@ -116,7 +115,7 @@ void gui_download_window_done(struct gui_download_window *dw);
 
 void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
 		struct gui_window *g);
-void gui_drag_save_selection(struct selection *s, struct gui_window *g);
+void gui_drag_save_selection(struct gui_window *g, const char *selection);
 void gui_start_selection(struct gui_window *g);
 void gui_clear_selection(struct gui_window *g);
 
diff --git a/desktop/selection.c b/desktop/selection.c
index 1b85a09..13a1293 100644
--- a/desktop/selection.c
+++ b/desktop/selection.c
@@ -273,8 +273,9 @@ bool selection_click(struct selection *s, browser_mouse_state mouse,
 		((mouse & BROWSER_MOUSE_DRAG_1) ||
 		 (modkeys && (mouse & BROWSER_MOUSE_DRAG_2)))) {
 		/* drag-saving selection */
-
-		gui_drag_save_selection(s, top->window);
+		char *sel = selection_get_copy(s);
+		gui_drag_save_selection(top->window, sel);
+		free(sel);
 	}
 	else if (!modkeys) {
 		if (pos && (mouse & BROWSER_MOUSE_PRESS_1)) {
diff --git a/framebuffer/clipboard.c b/framebuffer/clipboard.c
index bd9c89d..46a1bb0 100644
--- a/framebuffer/clipboard.c
+++ b/framebuffer/clipboard.c
@@ -25,7 +25,6 @@
 #include <string.h>
 #include "desktop/browser.h"
 #include "desktop/gui.h"
-#include "desktop/selection.h"
 #include "framebuffer/gui.h"
 #include "utils/log.h"
 
diff --git a/framebuffer/gui.c b/framebuffer/gui.c
index 432c298..d063475 100644
--- a/framebuffer/gui.c
+++ b/framebuffer/gui.c
@@ -1844,7 +1844,7 @@ gui_drag_save_object(gui_save_type type,
 }
 
 void
-gui_drag_save_selection(struct selection *s, struct gui_window *g)
+gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
 }
 
diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c
index 8f1f444..5abda62 100644
--- a/gtk/scaffolding.c
+++ b/gtk/scaffolding.c
@@ -48,7 +48,6 @@
 #include "desktop/save_text.h"
 #include "desktop/search.h"
 #include "desktop/searchweb.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "desktop/tree.h"
 #include "gtk/cookies.h"
diff --git a/gtk/search.c b/gtk/search.c
index 3d6bba0..d4fbadc 100644
--- a/gtk/search.c
+++ b/gtk/search.c
@@ -36,7 +36,6 @@
 #include "desktop/gui.h"
 #include "desktop/search.h"
 #include "desktop/searchweb.h"
-#include "desktop/selection.h"
 #include "utils/log.h"
 #include "utils/messages.h"
 #include "utils/utils.h"
diff --git a/gtk/selection.c b/gtk/selection.c
index 7d516e9..b0978b3 100644
--- a/gtk/selection.c
+++ b/gtk/selection.c
@@ -22,7 +22,6 @@
 #include "utils/log.h"
 
 #include "desktop/gui.h"
-#include "desktop/selection.h"
 #include "desktop/browser.h"
 #include "gtk/selection.h"
 #include "gtk/window.h"
diff --git a/gtk/window.c b/gtk/window.c
index 663ff32..798181a 100644
--- a/gtk/window.c
+++ b/gtk/window.c
@@ -33,7 +33,6 @@
 #include "desktop/options.h"
 #include "desktop/searchweb.h"
 #include "desktop/textinput.h"
-#include "desktop/selection.h"
 #include "gtk/compat.h"
 #include "gtk/gui.h"
 #include "gtk/scaffolding.h"
@@ -1080,7 +1079,7 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
 
 }
 
-void gui_drag_save_selection(struct selection *s, struct gui_window *g)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
 
 }
diff --git a/monkey/browser.c b/monkey/browser.c
index 9d87f44..09ecf4b 100644
--- a/monkey/browser.c
+++ b/monkey/browser.c
@@ -314,7 +314,7 @@ gui_window_scroll_visible(struct gui_window *g, int x0, int y0,
 }
 
 void
-gui_drag_save_selection(struct selection *s, struct gui_window *g)
+gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
 }
 
diff --git a/riscos/menus.c b/riscos/menus.c
index 5500910..5c80fd9 100644
--- a/riscos/menus.c
+++ b/riscos/menus.c
@@ -41,7 +41,6 @@
 #include "desktop/history_core.h"
 #include "desktop/hotlist.h"
 #include "desktop/netsurf.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "riscos/dialog.h"
 #include "riscos/configure.h"
diff --git a/riscos/save.c b/riscos/save.c
index 549a2ab..7ccbfb1 100644
--- a/riscos/save.c
+++ b/riscos/save.c
@@ -42,7 +42,6 @@
 #include "desktop/netsurf.h"
 #include "desktop/save_complete.h"
 #include "desktop/save_text.h"
-#include "desktop/selection.h"
 #include "desktop/thumbnail.h"
 #include "image/bitmap.h"
 #include "render/form.h"
@@ -395,7 +394,7 @@ void gui_drag_save_object(gui_save_type save_type, hlcache_handle *c,
  * \param  g  gui window
  */
 
-void gui_drag_save_selection(struct selection *s, struct gui_window *g)
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
 	wimp_pointer pointer;
 	char icon_buf[20];
@@ -421,7 +420,10 @@ void gui_drag_save_selection(struct selection *s, struct gui_window *g)
 	if (gui_save_selection == NULL)
 		free(gui_save_selection);
 
-	gui_save_selection = selection_get_copy(s);
+	if (selection == NULL)
+		gui_save_selection = strdup("");
+	else
+		gui_save_selection = strdup(selection);
 
 	ro_gui_save_set_state(NULL, GUI_SAVE_TEXT_SELECTION, NULL,
 			save_leafname, LEAFNAME_MAX,
diff --git a/riscos/search.c b/riscos/search.c
index be6db27..3d3b7ba 100644
--- a/riscos/search.c
+++ b/riscos/search.c
@@ -34,7 +34,6 @@
 #include "desktop/gui.h"
 #include "desktop/browser_private.h"
 #include "desktop/search.h"
-#include "desktop/selection.h"
 #include "riscos/dialog.h"
 #include "riscos/menus.h"
 #include "riscos/wimp.h"
diff --git a/riscos/textselection.c b/riscos/textselection.c
index a1a0288..094924b 100644
--- a/riscos/textselection.c
+++ b/riscos/textselection.c
@@ -27,7 +27,6 @@
 #include "oslib/wimp.h"
 #include "content/hlcache.h"
 #include "desktop/gui.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "riscos/gui.h"
 #include "riscos/menus.h"
diff --git a/riscos/window.c b/riscos/window.c
index 164075d..295315d 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -53,7 +53,6 @@
 #include "desktop/hotlist.h"
 #include "desktop/mouse.h"
 #include "desktop/plotters.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "desktop/thumbnail.h"
 #include "desktop/tree.h"
diff --git a/utils/import-messages.pl b/utils/import-messages.pl
index 1c30e7f..4c13a85 100644
--- a/utils/import-messages.pl
+++ b/utils/import-messages.pl
@@ -59,6 +59,8 @@ sub main ()
     my $opt_ok;
     my @input;
     my %message;
+    my $last_key;
+    my $last_plat;
 
     # option parsing:
     Getopt::Long::Configure( GETOPT_OPTS );
@@ -93,11 +95,33 @@ sub main ()
     {
         use bytes;
 
-        if( !/#/     &&
-            !/^\s*$/ &&
-            /^([a-z]{2})\.([^.]+)\.([^:]+):/ )
+        my( $lang, $plat, $key );
+
+        if( /^([a-z]{2})\.([^.]+)\.([^:]+):/ )
         {
-            my( $lang, $plat, $key ) = ( $1, $2, $3 );
+            ( $lang, $plat, $key ) = ( $1, $2, $3 );
+        }
+
+        if( $key || $message{ $last_key } )
+        {
+            #print( $output "## $last_key -> $key\n" );
+            # the key changed but we have a message for it still pending:
+            if( $last_key && $message{ $last_key } && ($key ne $last_key) )
+            {
+                my $plt = $last_plat;
+                my $str = $message{ $last_key };
+                my $msg = qq|$opt{lang}.$last_plat.$last_key:$str\n|;
+
+                print( $output $msg );
+                delete( $message{ $last_key } );
+
+                # if the line following our new translation is not blank,
+                # generate a synthetic group-separator:
+                if( !/^\s*$/ ) { print( $output "\n") }
+            }
+
+            $last_key  = $key;
+            $last_plat = $plat;
 
             if( $lang eq $opt{lang} )
             {
@@ -106,7 +130,8 @@ sub main ()
                     ( $opt{plat} eq 'any' ||   # all platforms ok
                       $opt{plat} eq $plat  ) ) # specified platform matched
                 {
-                    print( $output $val ? qq|$1.$2.$3:$val\n| : $_ );
+                    print( $output qq|$1.$2.$3:$val\n| );
+                    delete( $message{ $key } );
                     next;
                 }
             }
@@ -193,7 +218,7 @@ sub parser ()
 {
     package msgfmt::java;
 
-    sub unescape { $_[0] =~ s/\\([\\':])/$1/g; $_[0] }
+    sub unescape { $_[0] =~ s/\\([^abfnrtv])/$1/g; $_[0] }
     sub parse
     {
         my $cache  = shift();
@@ -201,7 +226,7 @@ sub parser ()
 
         while ( <$stream> )
         {
-            if( /(\S+)\s*=\s?(.*)/ )
+            if( /([^#]\S+)\s*=\s?(.*)/ )
             {
                 my $key = $1;
                 my $val = $2;
diff --git a/windows/gui.c b/windows/gui.c
index 313da54..e318f3a 100644
--- a/windows/gui.c
+++ b/windows/gui.c
@@ -38,7 +38,6 @@
 #include "desktop/netsurf.h"
 #include "desktop/options.h"
 #include "desktop/plotters.h"
-#include "desktop/selection.h"
 #include "desktop/textinput.h"
 #include "render/html.h"
 #include "utils/log.h"
@@ -1766,7 +1765,8 @@ void gui_drag_save_object(gui_save_type type, hlcache_handle *c,
 {
 }
 
-void gui_drag_save_selection(struct selection *s, struct gui_window *w)
+
+void gui_drag_save_selection(struct gui_window *g, const char *selection)
 {
 }
 


-- 
NetSurf Browser



More information about the netsurf-commits mailing list