21#include <proto/exec.h>
22#include <proto/icon.h>
23#include <workbench/icon.h>
60 lwc_string *lwc_mt = NULL;
64 if(msg->ap_Info.fib_DirEntryType > 0)
return(TRUE);
66 strcpy(fname,fr->fr_Drawer);
67 AddPart(fname, msg->ap_Info.fib_FileName,1024);
70 lerror = lwc_intern_string(mt, strlen(mt), &lwc_mt);
71 if (lerror != lwc_error_ok)
75 lwc_string_unref(lwc_mt);
91 ASLFR_SleepWindow, TRUE,
93 ASLFR_DoSaveMode, FALSE,
94 ASLFR_RejectIcons, TRUE,
98 if((temp = malloc(1024)))
100 strlcpy(temp,
filereq->fr_Drawer, 1024);
101 AddPart(temp,
filereq->fr_File, 1024);
124 const char *default_type;
128 default_type =
"html";
135 if (default_type != NULL) {
136 struct DiskObject *dobj = NULL;
138 dobj = GetIconTags(NULL,ICONGETA_GetDefaultName,default_type,
139 ICONGETA_GetDefaultType,WBPROJECT,
142 PutIconTags(
path, dobj,
143 ICONPUTA_NotifyWorkbench, TRUE, TAG_DONE);
152 const uint8_t *source_data;
165 if((fh =
FOpen(fname, MODE_NEWFILE,0))) {
166 FWrite(fh, source_data, 1, source_size);
177 if((lock = CreateDir(fname))) {
185#ifdef WITH_PDF_EXPORT
186 if(save_as_pdf(
object, fname))
199 ami_save_svg(
object, fname);
207 fh =
FOpen(fname, MODE_NEWFILE,0);
228 char *fname = malloc(1024);
229 char *initial_fname = NULL;
230 char *fname_with_ext = NULL;
231 bool strip_ext =
true;
238 if(initial_fname != NULL) {
239 fname_with_ext = malloc(strlen(initial_fname) + 5);
241 strcpy(fname_with_ext, initial_fname);
247 strcat(fname_with_ext,
".txt");
250 strcat(fname_with_ext,
".iff");
253 strcat(fname_with_ext,
".pdf");
259 if(initial_fname) free(initial_fname);
264 ASLFR_SleepWindow, TRUE,
267 ASLFR_InitialFile, fname_with_ext ? fname_with_ext :
"",
270 strlcpy(fname,
savereq->fr_Drawer, 1024);
271 AddPart(fname,
savereq->fr_File, 1024);
277 if(fname) free(fname);
278 if(fname_with_ext) free(fname_with_ext);
284 Tag initial_dir_tag = ASLFR_InitialDrawer;
286 if(initial_dir == NULL) initial_dir_tag = TAG_IGNORE;
288 filereq = (
struct FileRequester *)AllocAslRequest(ASL_FileRequest, NULL);
289 savereq = (
struct FileRequester *)AllocAslRequestTags(ASL_FileRequest,
290 ASLFR_DoSaveMode, TRUE,
291 ASLFR_RejectIcons, TRUE,
292 initial_dir_tag, initial_dir,
295 aslhookfunc.h_Entry = (
void *)&ami_file_asl_mime_hook;
const char * fetch_filetype(const char *unix_path)
Determine the MIME type of a local file.
bool ami_mime_compare(struct hlcache_handle *c, const char *type)
Compare the MIME type of an hlcache_handle to a DefIcons type.
struct Screen * ami_gui_get_screen(void)
Get a pointer to the screen NetSurf is running on.
struct browser_window * ami_gui2_get_browser_window(struct gui_window_2 *gwin)
Get browser window from gui_window_2.
struct gui_window * ami_gui2_get_gui_window(struct gui_window_2 *gwin)
Get gui_window from gui_window_2.
struct hlcache_handle * ami_gui_get_favicon(struct gui_window *gw)
Get favicon from gui_window.
struct Window * ami_gui2_get_window(struct gui_window_2 *gwin)
Get window from gui_window_2.
nserror amiga_warn_user(const char *warning, const char *detail)
Warn the user of an event.
void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
Browser window creation and manipulation interface.
nserror browser_window_navigate(struct browser_window *bw, struct nsurl *url, struct nsurl *referrer, enum browser_window_nav_flags flags, char *post_urlenc, struct fetch_multipart_data *post_multipart, struct hlcache_handle *parent)
Start fetching a page in a browser window.
char * browser_window_get_selection(struct browser_window *bw)
Get the current selection from a root browser window, ownership passed to caller, who must free() it.
@ BW_NAVIGATE_HISTORY
this will form a new history node (don't set for back/reload/etc)
content_type content_factory_type_from_mime_type(lwc_string *mime_type)
Compute the generic content type for a MIME type.
content_type
The type of a content.
@ CONTENT_NONE
no type for content
@ CONTENT_HTML
content is HTML
void ami_bitmap_set_url(struct bitmap *bm, struct nsurl *url)
Set bitmap URL.
bool amiga_bitmap_save(void *bitmap, const char *path, unsigned flags)
Save a bitmap in the platform's native format.
void ami_bitmap_set_title(struct bitmap *bm, const char *title)
Set bitmap title.
BOOL ami_download_check_overwrite(const char *file, struct Window *win, ULONG size)
void ami_file_save_req(int type, struct gui_window_2 *gwin, struct hlcache_handle *object)
struct FileRequester * filereq
HOOKF(ULONG, ami_file_asl_mime_hook, struct FileRequester *, fr, struct AnchorPathOld *)
struct FileRequester * savereq
void ami_file_req_free(void)
void ami_file_req_init(void)
void ami_file_open(struct gui_window_2 *gwin)
static void ami_file_set_type(const char *path, lwc_string *mime_type)
void ami_file_save(int type, char *fname, struct Window *win, struct hlcache_handle *object, struct hlcache_handle *favicon, struct browser_window *bw)
static struct Hook aslhookfunc
static char * download_dir
Current download directory.
void amiga_icon_superimpose_favicon(char *path, struct hlcache_handle *icon, char *type)
Content for image/x-amiga-icon (icon.library interface).
Public content interface.
struct nsurl * hlcache_handle_get_url(const struct hlcache_handle *handle)
Retrieve the URL associated with a high level cache handle.
const char * content_get_title(struct hlcache_handle *h)
Retrieve title associated with content.
struct bitmap * content_get_bitmap(struct hlcache_handle *h)
Retrieve the bitmap contained in an image content.
const uint8_t * content_get_source_data(struct hlcache_handle *h, size_t *size)
Retrieve source of content.
const char * messages_get(const char *key)
Fast lookup of a message by key from the standard Messages hash.
Localised message support (interface).
NetSurf URL handling (interface).
void nsurl_unref(nsurl *url)
Drop a reference to a NetSurf URL object.
const char * nsurl_access(const nsurl *url)
Access a NetSurf URL object as a string.
nserror nsurl_nice(const nsurl *url, char **result, bool remove_extensions)
Attempt to find a nice filename for a URL.
struct nsurl nsurl
NetSurf URL object.
nserror save_complete(hlcache_handle *c, const char *path, save_complete_set_type_cb set_type)
Save an HTML page with all dependencies.
Save HTML document with dependencies (interface).
void save_as_text(struct hlcache_handle *c, char *path)
Extract the text from an HTML content and save it as a text file.
Text export of HTML (interface).
Interface to utility string handling.
RISC OS wimp toolkit bitmap.
nserror netsurf_path_to_nsurl(const char *path, struct nsurl **url)
Create a nsurl from a path.
Default operations table for files.
Option reading and saving interface.
#define nsoption_charp(OPTION)
Get the value of a string option.
Interface to a number of general purpose functionality.
static nserror path(const struct redraw_context *ctx, const plot_style_t *pstyle, const float *p, unsigned int n, const float transform[6])
Plots a path.