summaryrefslogtreecommitdiff
path: root/amiga/context_menu.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2009-05-19 07:23:56 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2009-05-19 07:23:56 +0000
commit6f120338edb03bbdf7224f1b4d5560caf61bb002 (patch)
tree90161e3be8f111dc224a0c1b0c98e61098abeee1 /amiga/context_menu.c
parentefe2151c9a1d811b7b28d2f8c169688e7615ea11 (diff)
downloadnetsurf-6f120338edb03bbdf7224f1b4d5560caf61bb002.tar.gz
netsurf-6f120338edb03bbdf7224f1b4d5560caf61bb002.tar.bz2
Add ability to copy SVGs to the clipboard and save in IFF DR2D format.
svn path=/trunk/netsurf/; revision=7523
Diffstat (limited to 'amiga/context_menu.c')
-rwxr-xr-xamiga/context_menu.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/amiga/context_menu.c b/amiga/context_menu.c
index b5f02f0da..7f60d4963 100755
--- a/amiga/context_menu.c
+++ b/amiga/context_menu.c
@@ -33,6 +33,7 @@
#include <proto/asl.h>
#include "desktop/textinput.h"
#include "amiga/bitmap.h"
+#include "amiga/iff_dr2d.h"
uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved);
@@ -280,9 +281,18 @@ uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved)
case CMID_CLIPOBJ:
object = (struct content *)userdata;
- object->bitmap->url = object->url;
- object->bitmap->title = object->title;
- ami_easy_clipboard_bitmap(object->bitmap);
+ if(object->bitmap)
+ {
+ object->bitmap->url = object->url;
+ object->bitmap->title = object->title;
+ ami_easy_clipboard_bitmap(object->bitmap);
+ }
+#ifdef WITH_NS_SVG
+ else if(object->type == CONTENT_SVG)
+ {
+ ami_easy_clipboard_svg(object);
+ }
+#endif
break;
case CMID_SAVEOBJ:
@@ -322,9 +332,18 @@ uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved)
char fname[1024];
strlcpy(&fname,savereq->fr_Drawer,1024);
AddPart(fname,savereq->fr_File,1024);
- object->bitmap->url = object->url;
- object->bitmap->title = object->title;
- bitmap_save(object->bitmap,fname,0);
+ if(object->bitmap)
+ {
+ object->bitmap->url = object->url;
+ object->bitmap->title = object->title;
+ bitmap_save(object->bitmap,fname,0);
+ }
+#ifdef WITH_NS_SVG
+ else if(object->type == CONTENT_SVG)
+ {
+ ami_save_svg(object,fname);
+ }
+#endif
SetComment(fname,object->url);
ami_update_pointer(gwin->win,GUI_POINTER_DEFAULT);
}