summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-05-10 12:20:24 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2013-05-10 12:20:24 +0100
commit51a16104c7d6a15188cb366d6c1a5e68fc600002 (patch)
tree915da1075b08a8d6013b09d601272e913f198d3f
parentd2d04824cfc088cf6776fe2c2e2abdb953dfe006 (diff)
parent631265ef6b06ee5ffe33fae793360d651984d91d (diff)
downloadnetsurf-51a16104c7d6a15188cb366d6c1a5e68fc600002.tar.gz
netsurf-51a16104c7d6a15188cb366d6c1a5e68fc600002.tar.bz2
Merge branch 'tlsa/selection-search-refactor'
-rw-r--r--amiga/clipboard.c1
-rw-r--r--amiga/context_menu.c1
-rw-r--r--amiga/download.c1
-rw-r--r--amiga/drag.c4
-rw-r--r--amiga/file.c1
-rw-r--r--amiga/gui.c1
-rw-r--r--amiga/menu.c1
-rwxr-xr-xamiga/search.c1
-rwxr-xr-xatari/download.c1
-rw-r--r--atari/gui.c3
-rw-r--r--beos/window.cpp3
-rw-r--r--cocoa/BrowserView.m1
-rw-r--r--cocoa/BrowserViewController.m1
-rw-r--r--cocoa/NetsurfApp.m1
-rw-r--r--cocoa/gui.m3
-rw-r--r--cocoa/selection.m1
-rw-r--r--desktop/gui.h3
-rw-r--r--desktop/selection.c5
-rw-r--r--framebuffer/clipboard.c1
-rw-r--r--framebuffer/gui.c2
-rw-r--r--gtk/scaffolding.c1
-rw-r--r--gtk/search.c1
-rw-r--r--gtk/selection.c1
-rw-r--r--gtk/window.c3
-rw-r--r--monkey/browser.c2
-rw-r--r--riscos/menus.c1
-rw-r--r--riscos/save.c8
-rw-r--r--riscos/search.c1
-rw-r--r--riscos/textselection.c1
-rw-r--r--riscos/window.c1
-rw-r--r--windows/gui.c4
31 files changed, 18 insertions, 42 deletions
diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index ae4d8a5d1..2a4f2ab56 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 0a71d3085..6ee08f54a 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 b9b27ab9f..e461c5f36 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 45b0843dd..c8b44165d 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 68e2637c2..49c0afebf 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 e2616cf21..b0c1c7e67 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 c710bffac..7334f77a1 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 dd2aa2320..18ea27fce 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 209650490..32a6f1252 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 db44c0ae3..f125142af 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 1e564a173..3ce8e274c 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 3b947ea9b..4bda3b563 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 f43917a01..bea383d5c 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 9d19824ae..19d843734 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 cd7e6d239..fe92c5225 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 acfd55087..237c61ce2 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 b38bb61d5..f4b8b7215 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 1b85a090c..13a1293e3 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 bd9c89dca..46a1bb018 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 432c29855..d0634750d 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 8f1f4447e..5abda6276 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 3d6bba05d..d4fbadcc8 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 7d516e944..b0978b385 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 663ff32a3..798181ae1 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 9d87f4471..09ecf4b11 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 550091061..5c80fd976 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 549a2ab3e..7ccbfb13f 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 be6db2714..3d3b7ba4a 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 a1a02887f..094924bea 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 164075d0b..295315d2c 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 313da5423..e318f3a4e 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)
{
}