summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--amiga/download.c67
-rwxr-xr-xamiga/gui.c11
2 files changed, 66 insertions, 12 deletions
diff --git a/amiga/download.c b/amiga/download.c
index af9072e6e..10b66cba5 100644
--- a/amiga/download.c
+++ b/amiga/download.c
@@ -21,10 +21,22 @@
#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/intuition.h>
+#include <proto/utility.h>
+#include <proto/icon.h>
+
+#include <workbench/icon.h>
#include "amiga/download.h"
#include "amiga/object.h"
#include "amiga/options.h"
+#include "amiga/save_complete.h"
+
+#include "desktop/selection.h"
+
+#include "utils/messages.h"
+#include "utils/utils.h"
+
+#include <string.h>
#include <proto/window.h>
#include <proto/layout.h>
@@ -46,7 +58,7 @@ struct gui_download_window *gui_download_window_create(const char *url,
DebugPrintF("%s\n%lx\n",url,gui);
- if((!IsListEmpty(&gui->dllist)) && (dw->dln = FindName(&gui->dllist,url)))
+ if((!IsListEmpty(&gui->dllist)) && (dw->dln = (struct dlnode *)FindName(&gui->dllist,url)))
{
DebugPrintF("%lx node\n",dw->dln);
strcpy(fname,dw->dln->filename);
@@ -175,11 +187,11 @@ void gui_download_window_done(struct gui_download_window *dw)
if(dln = dw->dln)
{
- dln2 = GetSucc(dln);
+ dln2 = (struct dlnode *)GetSucc((struct Node *)dln);
if(dln != dln2) queuedl = true;
free(dln->filename);
- Remove(dln);
+ Remove((struct Node *)dln);
FreeVec(dln);
}
@@ -197,17 +209,60 @@ void ami_free_download_list(struct List *dllist)
node = (struct dlnode *)GetHead((struct List *)dllist);
- while(nnode=(struct dlnode *)GetSucc((struct dlnode *)node))
+ while(nnode=(struct dlnode *)GetSucc((struct Node *)node))
{
free(node->node.ln_Name);
free(node->filename);
- Remove(node);
- FreeVec(node);
+ Remove((struct Node *)node);
+ FreeVec((struct Node *)node);
node=nnode;
}
}
+void gui_window_save_as_link(struct gui_window *g, struct content *c)
+{
+ BPTR fh = 0;
+ char fname[1024];
+ STRPTR openurlstring,linkname;
+ struct DiskObject *dobj = NULL;
+
+ linkname = ASPrintf("Link_to_%s",FilePart(c->url));
+
+ if(AslRequestTags(savereq,
+ ASLFR_TitleText,messages_get("NetSurf"),
+ ASLFR_Screen,scrn,
+ ASLFR_InitialFile,linkname,
+ TAG_DONE))
+ {
+ strlcpy(&fname,savereq->fr_Drawer,1024);
+ AddPart(fname,savereq->fr_File,1024);
+ ami_update_pointer(g->shared->win,GUI_POINTER_WAIT);
+ if(fh = FOpen(fname,MODE_NEWFILE,0))
+ {
+ openurlstring = ASPrintf("openurl \"%s\"\n",c->url);
+ FWrite(fh,openurlstring,1,strlen(openurlstring));
+ FClose(fh);
+ FreeVec(openurlstring);
+ SetComment(fname,c->url);
+
+ dobj = GetIconTags(NULL,ICONGETA_GetDefaultName,"url",
+ ICONGETA_GetDefaultType,WBPROJECT,
+ TAG_DONE);
+
+ dobj->do_DefaultTool = "IconX";
+
+ PutIconTags(fname,dobj,
+ ICONPUTA_NotifyWorkbench,TRUE,
+ TAG_DONE);
+
+ FreeDiskObject(dobj);
+ }
+ FreeVec(linkname);
+ ami_update_pointer(g->shared->win,GUI_POINTER_DEFAULT);
+ }
+}
+
void gui_drag_save_object(gui_save_type type, struct content *c,
struct gui_window *g)
{
diff --git a/amiga/gui.c b/amiga/gui.c
index 0339f9fdc..80912a861 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -2185,6 +2185,7 @@ DebugPrintF("%ld %ld calc\n",(y1-y0)+(yoffset+y0-vcurrent),(y0-(int)vcurrent));
BltBitMapRastPort(glob.bm,x0-hcurrent,y0-vcurrent,g->shared->win->RPort,xoffset+x0-hcurrent,yoffset+y0-vcurrent,x1-x0,y1-y0,0x0C0);
+/*
DebugPrintF("%ld %ld %ld %ld draw area\n%ld %ld %ld %ld clip rect\n%ld %ld bitmap src\n%ld %ld %ld %ld bitmap dest\n\n",-hcurrent,-vcurrent,width-hcurrent,height-vcurrent,
(ULONG)floorf((x0 *
g->shared->bw->scale)-(int)hcurrent),
@@ -2192,7 +2193,7 @@ DebugPrintF("%ld %ld calc\n",(y1-y0)+(yoffset+y0-vcurrent),(y0-(int)vcurrent));
g->shared->bw->scale)-(int)vcurrent),
(ULONG)x1-hcurrent,
(ULONG)y1-vcurrent,x0-hcurrent,y0-vcurrent,xoffset+x0-hcurrent,yoffset+y0-vcurrent,x1-x0,y1-y0);
-
+*/
}
void gui_window_redraw(struct gui_window *g, int x0, int y0, int x1, int y1)
@@ -2706,7 +2707,9 @@ void gui_window_place_caret(struct gui_window *g, int x, int y, int height)
SetAPen(g->shared->win->RPort,3);
-// if(((x-xs) < bbox->Left) || ((x-xs) > (bbox->Left+bbox->Width)) || ((y-ys) < bbox->Top) || ((y-ys) > (bbox->Top+bbox->Height))) return;
+ if((y-ys+height) > (bbox->Height)) height = bbox->Height-y+ys;
+
+ if(((x-xs) <= 0) || ((x-xs+2) >= (bbox->Width)) || ((y-ys) <= 0) || ((y-ys) >= (bbox->Height))) return;
RectFill(g->shared->win->RPort,x+bbox->Left-xs,y+bbox->Top-ys,x+bbox->Left+2-xs,y+bbox->Top+height-ys);
@@ -2752,10 +2755,6 @@ bool gui_window_frame_resize_start(struct gui_window *g)
printf("resize frame\n");
}
-void gui_window_save_as_link(struct gui_window *g, struct content *c)
-{
-}
-
void gui_window_set_scale(struct gui_window *g, float scale)
{
printf("set scale\n");