From a3c357f4e602baa22a86601de6e63d11da757c47 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 17 May 2009 09:55:28 +0000 Subject: Allow Copy menu to copy the image currently displayed, if we aren't displaying text Fix some warnings svn path=/trunk/netsurf/; revision=7520 --- amiga/menu.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'amiga') diff --git a/amiga/menu.c b/amiga/menu.c index a8f578b40..f7c7de80f 100755 --- a/amiga/menu.c +++ b/amiga/menu.c @@ -42,6 +42,9 @@ #include "desktop/textinput.h" #include "amiga/search.h" #include "amiga/history_local.h" +#include "amiga/bitmap.h" +#include "amiga/clipboard.h" +#include "content/fetch.h" BOOL menualreadyinit; const char * const netsurf_version; @@ -238,9 +241,9 @@ struct NewMenu *ami_create_menu(ULONG type) if(!menualreadyinit) { ami_menu_scan(hotlist,menu); - ami_menu_arexx_scan(menu); + ami_menu_arexx_scan(&menu); - aslhookfunc.h_Entry = &ami_asl_mime_hook; + aslhookfunc.h_Entry = (void *)&ami_asl_mime_hook; aslhookfunc.h_SubEntry = NULL; aslhookfunc.h_Data = NULL; @@ -553,8 +556,17 @@ void ami_menupick(ULONG code,struct gui_window_2 *gwin,struct MenuItem *item) switch(itemnum) { case 0: // copy - browser_window_key_press(gwin->bw, KEY_COPY_SELECTION); - browser_window_key_press(gwin->bw, KEY_ESCAPE); + if(gwin->bw->current_content->type <= CONTENT_CSS) + { + browser_window_key_press(gwin->bw, KEY_COPY_SELECTION); + browser_window_key_press(gwin->bw, KEY_ESCAPE); + } + else if(gwin->bw->current_content->bitmap) + { + gwin->bw->current_content->bitmap->url = gwin->bw->current_content->url; + gwin->bw->current_content->bitmap->title = gwin->bw->current_content->title; + ami_easy_clipboard_bitmap(gwin->bw->current_content->bitmap); + } break; case 1: // paste -- cgit v1.2.3