diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2010-07-24 16:39:37 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2010-07-24 16:39:37 +0000 |
commit | 004aee8281895120f69bb83559278c17805584cd (patch) | |
tree | 01d99e47995846d4a3afaa28163f7ed01f890890 /amiga/clipboard.c | |
parent | d5b8cf89da0552129c9a88e93cbc25aab61ae25e (diff) | |
download | netsurf-004aee8281895120f69bb83559278c17805584cd.tar.gz netsurf-004aee8281895120f69bb83559278c17805584cd.tar.bz2 |
Amiga: Add "cut" option; make cut/copy/paste menus context sensitive; allow dragging
selections within NetSurf window to text fields (does not work across windows).
todo: switching tabs will reset cut/copy/paste menus to initial state; cut option is
putting something on the clipboard which causes a crash when pasting it back
svn path=/trunk/netsurf/; revision=10660
Diffstat (limited to 'amiga/clipboard.c')
-rwxr-xr-x | amiga/clipboard.c | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/amiga/clipboard.c b/amiga/clipboard.c index 04198c984..01b813667 100755 --- a/amiga/clipboard.c +++ b/amiga/clipboard.c @@ -17,21 +17,26 @@ */ #include "desktop/gui.h" +#include "utils/utf8.h" +#include "desktop/selection.h" + #include "amiga/iff_cset.h" -#include <proto/iffparse.h> -#include <datatypes/textclass.h> #include "amiga/options.h" #include "amiga/gui.h" -#include <proto/exec.h> #include "amiga/utf8.h" -#include "utils/utf8.h" -#include "desktop/selection.h" -#include <datatypes/pictureclass.h> -#include <proto/datatypes.h> #include "amiga/bitmap.h" #include "amiga/iff_dr2d.h" +#include "amiga/menu.h" + +#include <proto/iffparse.h> +#include <proto/intuition.h> +#include <proto/exec.h> +#include <proto/datatypes.h> #include <proto/diskfont.h> + #include <diskfont/diskfonttag.h> +#include <datatypes/textclass.h> +#include <datatypes/pictureclass.h> struct IFFHandle *iffh = NULL; @@ -54,6 +59,24 @@ void ami_clipboard_free(void) void gui_start_selection(struct gui_window *g) { + if(!g) return; + if(!g->shared->win) return; + + OnMenu(g->shared->win, AMI_MENU_CLEAR); + OnMenu(g->shared->win, AMI_MENU_COPY); + + if(selection_read_only(g->shared->bw->sel) == false) + OnMenu(g->shared->win, AMI_MENU_CUT); +} + +void gui_clear_selection(struct gui_window *g) +{ + if(!g) return; + if(!g->shared->win) return; + + OffMenu(g->shared->win, AMI_MENU_CLEAR); + OffMenu(g->shared->win, AMI_MENU_CUT); + OffMenu(g->shared->win, AMI_MENU_COPY); } void gui_paste_from_clipboard(struct gui_window *g, int x, int y) @@ -109,6 +132,7 @@ void gui_paste_from_clipboard(struct gui_window *g, int x, int y) bool gui_empty_clipboard(void) { + return true; } bool gui_add_to_clipboard(const char *text, size_t length, bool space) |