NetSurf
Data Structures | Macros | Enumerations | Functions | Variables
save.c File Reference

Save dialog and drag and drop saving implementation for RISC OS. More...

#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "oslib/dragasprite.h"
#include "oslib/osbyte.h"
#include "oslib/osfile.h"
#include "oslib/osmodule.h"
#include "oslib/osspriteop.h"
#include "oslib/wimp.h"
#include "oslib/wimpspriteop.h"
#include "utils/config.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/nsoption.h"
#include "utils/nsurl.h"
#include "utils/utf8.h"
#include "utils/utils.h"
#include "netsurf/browser_window.h"
#include "netsurf/window.h"
#include "netsurf/bitmap.h"
#include "netsurf/content.h"
#include "netsurf/form.h"
#include "desktop/hotlist.h"
#include "desktop/global_history.h"
#include "desktop/version.h"
#include "desktop/save_complete.h"
#include "desktop/save_text.h"
#include "riscos/bitmap.h"
#include "riscos/dialog.h"
#include "riscos/gui.h"
#include "riscos/window.h"
#include "riscos/menus.h"
#include "riscos/message.h"
#include "riscos/mouse.h"
#include "riscos/query.h"
#include "riscos/save.h"
#include "riscos/save_draw.h"
#include "riscos/save_pdf.h"
#include "riscos/textselection.h"
#include "riscos/wimp.h"
#include "riscos/wimp_event.h"
#include "riscos/ucstables.h"
#include "riscos/filetype.h"
Include dependency graph for save.c:

Go to the source code of this file.

Data Structures

struct  gui_save_table_entry
 An entry in gui_save_table. More...
 

Macros

#define LEAFNAME_MAX   200
 

Enumerations

enum  link_format { LINK_ACORN , LINK_ANT , LINK_TEXT }
 

Functions

static bool ro_gui_save_content (struct hlcache_handle *h, char *path, bool force_overwrite)
 Does the actual saving. More...
 
wimp_w ro_gui_saveas_create (const char *template_name)
 Create the saveas dialogue from the given template, and the sprite area necessary for our thumbnail (full page save) More...
 
void ro_gui_saveas_quit (void)
 Clean-up function that releases our sprite area and memory. More...
 
static bool ro_gui_save_create_thumbnail (struct hlcache_handle *h, const char *name)
 Create a thumbnail sprite for the page being saved. More...
 
static void ro_gui_save_set_state (struct hlcache_handle *h, gui_save_type save_type, const nsurl *url, char *leaf_buf, size_t leaf_len, char *icon_buf, size_t icon_len)
 Suggest a leafname and sprite name for the given content. More...
 
void ro_gui_save_prepare (gui_save_type save_type, struct hlcache_handle *h, char *s, const nsurl *url, const char *title)
 Prepares the save box to reflect gui_save_type and a content, and opens it. More...
 
static void ro_gui_save_bounced (wimp_message *message)
 Handle lack of Message_DataSaveAck for drags, saveas dialogs and clipboard code. More...
 
static void ro_gui_save_drag_end (wimp_dragged *drag, void *data)
 Handle User_Drag_Box event for a drag from the save dialog or browser window. More...
 
void ro_gui_save_start_drag (wimp_pointer *pointer)
 Starts a drag for the save dialog. More...
 
static void ro_gui_save_done (void)
 Save completed, inform recipient and close our 'save as' dialog. More...
 
static void ro_gui_save_overwrite_cancelled (query_id id, enum query_response res, void *p)
 User has opted not to overwrite the existing file. More...
 
static void ro_gui_save_overwrite_confirmed (query_id id, enum query_response res, void *p)
 Overwrite of existing file confirmed, proceed with the save. More...
 
static bool ro_gui_save_link (const char *url, const char *title, link_format format, char *path)
 Save a link file. More...
 
static void ro_gui_save_set_file_type (const char *path, lwc_string *mime_type)
 set RISC OS filetype of file from mimetype More...
 
static bool ro_gui_save_complete (struct hlcache_handle *h, char *path)
 Prepare an application directory and save_complete() to it. More...
 
static bool ro_gui_save_object_native (struct hlcache_handle *h, char *path)
 Save object in native type. More...
 
bool ro_gui_save_ok (wimp_w w)
 Handle OK click/keypress in the save dialog. More...
 
void gui_drag_save_object (struct gui_window *g, struct hlcache_handle *c, gui_save_type save_type)
 Initiates drag saving of an object directly from a browser window. More...
 
void gui_drag_save_selection (struct gui_window *g, const char *selection)
 Initiates drag saving of a selection from a browser window. More...
 
void ro_gui_drag_save_link (gui_save_type save_type, const nsurl *url, const char *title, struct gui_window *g)
 Initiates drag saving of a link/URL file. More...
 
void ro_gui_drag_icon (int x, int y, const char *sprite)
 Start drag of icon under the pointer. More...
 
void ro_gui_convert_save_path (char *dp, size_t len, const char *p)
 Convert a ctrl-char terminated pathname possibly containing spaces to a NUL-terminated one containing only hard spaces. More...
 
void ro_gui_drag_box_cancel (void)
 
void ro_gui_send_datasave (gui_save_type save_type, wimp_full_message_data_xfer *message, wimp_t to)
 Send DataSave message on behalf of clipboard code and remember that it's the clipboard contents we're being asked for when the DataSaveAck reply arrives. More...
 
void ro_gui_save_datasave_ack (wimp_message *message)
 Handle Message_DataSaveAck for a drag from the save dialog or browser window, or Clipboard protocol. More...
 

Variables

static gui_save_type gui_save_current_type
 
static struct hlcache_handlegui_save_content = NULL
 
static char * gui_save_selection = NULL
 
static const char * gui_save_url = NULL
 
static const char * gui_save_title = NULL
 
static int gui_save_filetype
 
static query_id gui_save_query
 
static bool gui_save_send_dataload
 
static wimp_message gui_save_message
 
static bool gui_save_close_after = true
 
static bool dragbox_active = false
 
static bool using_dragasprite = true
 in-progress Wimp_DragBox/DragASprite op More...
 
static bool saving_from_dialog = true
 
static osspriteop_area * saveas_area = NULL
 
static wimp_w gui_save_sourcew = (wimp_w)-1
 
static char save_leafname [LEAFNAME_MAX]
 
static char * save_dir = NULL
 Current save directory (updated by and used for dialog-based saving) More...
 
static size_t save_dir_len
 
static const struct gui_save_table_entry gui_save_table []
 Table of filetypes and default filenames. More...
 
static const query_callback overwrite_funcs
 Overwrite confirmation callbacks. More...
 

Detailed Description

Save dialog and drag and drop saving implementation for RISC OS.

Definition in file save.c.

Macro Definition Documentation

◆ LEAFNAME_MAX

#define LEAFNAME_MAX   200

Definition at line 105 of file save.c.

Enumeration Type Documentation

◆ link_format

Enumerator
LINK_ACORN 
LINK_ANT 
LINK_TEXT 

Definition at line 112 of file save.c.

Function Documentation

◆ gui_drag_save_object()

void gui_drag_save_object ( struct gui_window g,
struct hlcache_handle c,
gui_save_type  save_type 
)

Initiates drag saving of an object directly from a browser window.

Parameters
ggui window
ccontent to save
save_typetype of save

Definition at line 1144 of file save.c.

References dialog_saveas, gui_save_sourcew, hlcache_handle_get_url(), LEAFNAME_MAX, NSLOG, ro_gui_dialog_close(), ro_gui_drag_icon(), ro_gui_save_drag_end(), ro_gui_save_set_state(), ro_mouse_drag_start(), ro_warn_user(), save_leafname, saving_from_dialog, and gui_window::window.

Here is the call graph for this function:

◆ gui_drag_save_selection()

void gui_drag_save_selection ( struct gui_window g,
const char *  selection 
)

Initiates drag saving of a selection from a browser window.

Parameters
ggui window
selectionselection object

Definition at line 1184 of file save.c.

References dialog_saveas, gui_save_selection, gui_save_sourcew, GUI_SAVE_TEXT_SELECTION, LEAFNAME_MAX, NSLOG, ro_gui_dialog_close(), ro_gui_drag_icon(), ro_gui_save_drag_end(), ro_gui_save_set_state(), ro_mouse_drag_start(), ro_warn_user(), save_leafname, saving_from_dialog, and gui_window::window.

Here is the call graph for this function:

◆ ro_gui_convert_save_path()

void ro_gui_convert_save_path ( char *  dp,
size_t  len,
const char *  p 
)

Convert a ctrl-char terminated pathname possibly containing spaces to a NUL-terminated one containing only hard spaces.

Parameters
dpdestination buffer to receive pathname
lensize of destination buffer
psource pathname, ctrl-char terminated

Definition at line 1349 of file save.c.

Referenced by ro_gui_download_drag_end(), ro_gui_download_keypress(), ro_gui_save_drag_end(), and ro_gui_save_ok().

Here is the caller graph for this function:

◆ ro_gui_drag_box_cancel()

void ro_gui_drag_box_cancel ( void  )

Definition at line 1364 of file save.c.

References dragbox_active, NSLOG, ro_warn_user(), and using_dragasprite.

Referenced by ro_gui_keypress(), ro_gui_save_drag_end(), and ro_gui_selection_drag_claim().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_drag_icon()

void ro_gui_drag_icon ( int  x,
int  y,
const char *  sprite 
)

Start drag of icon under the pointer.

Parameters
xThe x coordinate of the drag start
yThe y coordinate of the drag start
spriteThe sprite to use for the drag.

Definition at line 1275 of file save.c.

References dragbox_active, NSLOG, ro_warn_user(), saveas_area, and using_dragasprite.

Referenced by gui_drag_save_object(), gui_drag_save_selection(), ro_gui_download_click(), ro_gui_drag_save_link(), and ro_gui_save_start_drag().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_drag_save_link()

void ro_gui_drag_save_link ( gui_save_type  save_type,
const nsurl url,
const char *  title,
struct gui_window g 
)

Initiates drag saving of a link/URL file.

Parameters
save_typeformat in which URL should be saved
urlurl to be saved
titletitle to be included in URI format, if any
ggui window to save from \

Definition at line 1234 of file save.c.

References dialog_saveas, gui_save_sourcew, gui_save_title, gui_save_url, LEAFNAME_MAX, NSLOG, nsurl_access(), ro_gui_dialog_close(), ro_gui_drag_icon(), ro_gui_save_drag_end(), ro_gui_save_set_state(), ro_mouse_drag_start(), ro_warn_user(), save_leafname, saving_from_dialog, gui_window::title, gui_window::url, and gui_window::window.

Referenced by ro_gui_window_toolbar_click().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_save_bounced()

static void ro_gui_save_bounced ( wimp_message *  message)
static

Handle lack of Message_DataSaveAck for drags, saveas dialogs and clipboard code.

Parameters
messageA wimp message.

Definition at line 489 of file save.c.

References gui_current_drag_type, and GUI_DRAG_NONE.

Referenced by ro_gui_save_drag_end(), and ro_gui_send_datasave().

Here is the caller graph for this function:

◆ ro_gui_save_complete()

static bool ro_gui_save_complete ( struct hlcache_handle h,
char *  path 
)
static

Prepare an application directory and save_complete() to it.

Parameters
hcontent of type CONTENT_HTML to save
pathpath to save as
Returns
true on success, false on error and error reported

Definition at line 802 of file save.c.

References content_get_title(), hlcache_handle_get_url(), LINK_ANT, NSLOG, nsurl_access(), path(), ro_gui_save_link(), ro_gui_save_set_file_type(), ro_warn_user(), save_complete(), and saveas_area.

Referenced by ro_gui_save_content().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_save_content()

static bool ro_gui_save_content ( struct hlcache_handle h,
char *  path,
bool  force_overwrite 
)
static

Does the actual saving.

Parameters
hhandle to content to save (or NULL for other)
pathpath to save to
force_overwritetrue iff required to overwrite without prompting
Returns
true on success, false on (i) error and error reported or (ii) deferred awaiting user confirmation
Todo:
do this earlier?

Definition at line 962 of file save.c.

References content_get_source_data(), content_get_type(), CONTENT_HTML, fallthrough, global_history_export(), GUI_SAVE_CLIPBOARD_CONTENTS, GUI_SAVE_COMPLETE, gui_save_current_type, GUI_SAVE_DRAW, GUI_SAVE_HISTORY_EXPORT_HTML, GUI_SAVE_HOTLIST_EXPORT_HTML, GUI_SAVE_LINK_TEXT, GUI_SAVE_LINK_URI, GUI_SAVE_LINK_URL, GUI_SAVE_OBJECT_NATIVE, GUI_SAVE_OBJECT_ORIG, GUI_SAVE_PDF, gui_save_query, gui_save_selection, GUI_SAVE_SOURCE, GUI_SAVE_TEXT, GUI_SAVE_TEXT_SELECTION, gui_save_title, gui_save_url, hotlist_export(), LINK_ACORN, LINK_ANT, LINK_TEXT, messages_get(), NSERROR_OK, NSLOG, overwrite_funcs, path(), query_user(), ro_content_filetype(), ro_gui_save_clipboard(), ro_gui_save_complete(), ro_gui_save_link(), ro_gui_save_object_native(), ro_warn_user(), save_as_text(), and utf8_save_text().

Referenced by ro_gui_save_datasave_ack(), ro_gui_save_ok(), and ro_gui_save_overwrite_confirmed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_save_create_thumbnail()

static bool ro_gui_save_create_thumbnail ( struct hlcache_handle h,
const char *  name 
)
static

Create a thumbnail sprite for the page being saved.

Parameters
hcontent to be converted
namesprite name to use
Returns
true iff successful

Definition at line 241 of file save.c.

References bitmap(), BITMAP_CLEAR, BITMAP_OPAQUE, min, NSLOG, riscos_bitmap_convert_8bpp(), riscos_bitmap_create(), riscos_bitmap_destroy(), riscos_bitmap_render(), and saveas_area.

Referenced by ro_gui_save_set_state().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_save_datasave_ack()

void ro_gui_save_datasave_ack ( wimp_message *  message)

Handle Message_DataSaveAck for a drag from the save dialog or browser window, or Clipboard protocol.

Definition at line 1420 of file save.c.

References GUI_SAVE_CLIPBOARD_CONTENTS, gui_save_content, gui_save_current_type, GUI_SAVE_HISTORY_EXPORT_HTML, GUI_SAVE_HOTLIST_EXPORT_HTML, GUI_SAVE_LINK_TEXT, GUI_SAVE_LINK_URI, GUI_SAVE_LINK_URL, gui_save_message, gui_save_send_dataload, gui_save_sourcew, GUI_SAVE_TEXT_SELECTION, ICON_SAVE_PATH, NSLOG, nsoption_bool, path(), ro_gui_save_content(), ro_gui_save_done(), ro_gui_set_icon_string(), and saving_from_dialog.

Referenced by ro_msg_datasave_ack().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_save_done()

static void ro_gui_save_done ( void  )
static

Save completed, inform recipient and close our 'save as' dialog.

Definition at line 630 of file save.c.

References dialog_saveas, gui_save_close_after, gui_save_content, gui_save_message, gui_save_send_dataload, NSLOG, ro_gui_dialog_close(), ro_warn_user(), save_dir, save_dir_len, and saving_from_dialog.

Referenced by ro_gui_save_datasave_ack(), ro_gui_save_ok(), and ro_gui_save_overwrite_confirmed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_save_drag_end()

static void ro_gui_save_drag_end ( wimp_dragged *  drag,
void *  data 
)
static

Handle User_Drag_Box event for a drag from the save dialog or browser window.

Parameters
*dragThe Wimp_DragEnd data block.
*dataNULL, as function is used as a callback from ro_mouse.
Todo:
we're supposed to set this if drag-n-drop used

Definition at line 501 of file save.c.

References browser_window_drop_file_at_point(), gui_window::bw, dragbox_active, gui_current_drag_type, GUI_DRAG_SAVE, GUI_SAVE_COMPLETE, gui_save_current_type, gui_save_filetype, gui_save_sourcew, ICON_SAVE_PATH, NSERROR_BAD_ENCODING, NSERROR_OK, NSLOG, ro_gui_convert_save_path(), ro_gui_drag_box_cancel(), ro_gui_get_icon_string(), ro_gui_save_bounced(), ro_gui_window_lookup(), ro_gui_window_to_window_pos(), ro_message_send_message_to_window(), ro_warn_user(), save_leafname, saving_from_dialog, utf8_to_local_encoding(), and browser_window::x.

Referenced by gui_drag_save_object(), gui_drag_save_selection(), ro_gui_drag_save_link(), and ro_gui_save_start_drag().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_save_link()

static bool ro_gui_save_link ( const char *  url,
const char *  title,
link_format  format,
char *  path 
)
static

Save a link file.

Parameters
urlurl to be saved
titlecorresponding title, if any
formatformat of link file
pathpathname for link file
Returns
true on success, false on failure and reports the error

Definition at line 732 of file save.c.

References LINK_ACORN, LINK_ANT, LINK_TEXT, netsurf_version, path(), ro_warn_user(), gui_window::title, and gui_window::url.

Referenced by ro_gui_save_complete(), and ro_gui_save_content().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_save_object_native()

static bool ro_gui_save_object_native ( struct hlcache_handle h,
char *  path 
)
static

Save object in native type.

Definition at line 907 of file save.c.

References BITMAP_SAVE_FULL_ALPHA, content_get_bitmap(), content_get_source_data(), NSLOG, os_version, path(), riscos_bitmap_save(), ro_content_filetype(), ro_content_native_type(), and ro_warn_user().

Referenced by ro_gui_save_content().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_save_ok()

bool ro_gui_save_ok ( wimp_w  w)

Handle OK click/keypress in the save dialog.

Parameters
wwindow handle of save dialog
Returns
true on success, false on failure

Definition at line 1110 of file save.c.

References gui_save_close_after, gui_save_content, gui_save_message, gui_save_send_dataload, gui_save_sourcew, ICON_SAVE_PATH, nsoption_bool, path(), ro_gui_convert_save_path(), ro_gui_get_icon_string(), ro_gui_save_content(), ro_gui_save_done(), ro_warn_user(), and saving_from_dialog.

Referenced by ro_gui_dialog_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_save_overwrite_cancelled()

static void ro_gui_save_overwrite_cancelled ( query_id  id,
enum query_response  res,
void *  p 
)
static

User has opted not to overwrite the existing file.

Definition at line 701 of file save.c.

References saving_from_dialog.

◆ ro_gui_save_overwrite_confirmed()

static void ro_gui_save_overwrite_confirmed ( query_id  id,
enum query_response  res,
void *  p 
)
static

Overwrite of existing file confirmed, proceed with the save.

Definition at line 714 of file save.c.

References gui_save_content, gui_save_message, ro_gui_save_content(), and ro_gui_save_done().

Here is the call graph for this function:

◆ ro_gui_save_prepare()

void ro_gui_save_prepare ( gui_save_type  save_type,
struct hlcache_handle h,
char *  s,
const nsurl url,
const char *  title 
)

Prepares the save box to reflect gui_save_type and a content, and opens it.

Parameters
save_typetype of save
hcontent to save
sselection to save
urlurl to be saved (link types)
titletitle (if any), when saving links

Definition at line 437 of file save.c.

References dialog_saveas, GUI_SAVE_HISTORY_EXPORT_HTML, GUI_SAVE_HOTLIST_EXPORT_HTML, GUI_SAVE_LINK_TEXT, GUI_SAVE_LINK_URI, GUI_SAVE_LINK_URL, gui_save_selection, GUI_SAVE_TEXT_SELECTION, gui_save_title, gui_save_url, hlcache_handle_get_url(), ICON_SAVE_ICON, ICON_SAVE_PATH, nsurl_access(), ro_gui_save_set_state(), ro_gui_set_icon_sprite(), ro_gui_set_icon_string(), ro_gui_wimp_event_memorise(), save_dir, save_dir_len, saveas_area, bitmap::title, and bitmap::url.

Referenced by global_history_menu_prepare(), gui_window_save_link(), hotlist_menu_prepare(), ro_gui_window_action_save(), ro_gui_window_menu_select(), and ro_gui_window_menu_warning().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_save_set_file_type()

static void ro_gui_save_set_file_type ( const char *  path,
lwc_string *  mime_type 
)
static

set RISC OS filetype of file from mimetype

Parameters
pathThe path of the file to set filetype on
mime_typeThe mime type to set.

Definition at line 782 of file save.c.

References NSLOG, path(), and ro_content_filetype_from_mime_type().

Referenced by ro_gui_save_complete().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_save_set_state()

static void ro_gui_save_set_state ( struct hlcache_handle h,
gui_save_type  save_type,
const nsurl url,
char *  leaf_buf,
size_t  leaf_len,
char *  icon_buf,
size_t  icon_len 
)
static

Suggest a leafname and sprite name for the given content.

Parameters
hcontent being saved
save_typetype of save operation being performed
urlused to determine leafname
leaf_bufbuffer to receive suggested leafname.
leaf_lensize of buffer to receive suggested leafname.
icon_bufbuffer to receive sprite name.
icon_lensize of buffer to receive icon name.

Definition at line 295 of file save.c.

References gui_save_table_entry::filetype, GUI_SAVE_COMPLETE, gui_save_content, gui_save_current_type, gui_save_filetype, GUI_SAVE_OBJECT_NATIVE, gui_save_table, messages_get(), gui_save_table_entry::name, NSERROR_BAD_ENCODING, NSERROR_OK, NSLOG, nsoption_bool, nsurl_nice(), ro_content_filetype(), ro_content_native_type(), ro_gui_save_create_thumbnail(), ro_gui_wimp_get_sprite(), ro_warn_user(), saveas_area, bitmap::url, and utf8_to_local_encoding().

Referenced by gui_drag_save_object(), gui_drag_save_selection(), ro_gui_drag_save_link(), and ro_gui_save_prepare().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_save_start_drag()

void ro_gui_save_start_drag ( wimp_pointer *  pointer)

Starts a drag for the save dialog.

Parameters
pointermouse position info from Wimp

Definition at line 602 of file save.c.

References gui_save_close_after, gui_save_sourcew, ro_gui_drag_icon(), ro_gui_get_icon_string(), ro_gui_save_drag_end(), ro_mouse_drag_start(), and saving_from_dialog.

Referenced by ro_gui_dialog_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_saveas_create()

wimp_w ro_gui_saveas_create ( const char *  template_name)

Create the saveas dialogue from the given template, and the sprite area necessary for our thumbnail (full page save)

Parameters
template_namename of template to be used
Returns
window handle of created dialogue

Definition at line 152 of file save.c.

References die(), ICON_SAVE_ICON, NSLOG, ro_gui_dialog_load_template(), ro_warn_user(), and saveas_area.

Referenced by ro_gui_dialog_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_saveas_quit()

void ro_gui_saveas_quit ( void  )

Clean-up function that releases our sprite area and memory.

Definition at line 216 of file save.c.

References NSLOG, ro_warn_user(), save_dir, and saveas_area.

Referenced by gui_quit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_send_datasave()

void ro_gui_send_datasave ( gui_save_type  save_type,
wimp_full_message_data_xfer *  message,
wimp_t  to 
)

Send DataSave message on behalf of clipboard code and remember that it's the clipboard contents we're being asked for when the DataSaveAck reply arrives.

Definition at line 1397 of file save.c.

References dialog_saveas, gui_current_drag_type, GUI_DRAG_SAVE, gui_save_current_type, gui_save_sourcew, ro_gui_dialog_close(), ro_gui_save_bounced(), ro_message_send_message(), saving_from_dialog, and to.

Referenced by ro_gui_selection_data_request().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ dragbox_active

bool dragbox_active = false
static

Definition at line 100 of file save.c.

Referenced by ro_gui_drag_box_cancel(), ro_gui_drag_icon(), and ro_gui_save_drag_end().

◆ gui_save_close_after

bool gui_save_close_after = true
static

Definition at line 98 of file save.c.

Referenced by ro_gui_save_done(), ro_gui_save_ok(), and ro_gui_save_start_drag().

◆ gui_save_content

struct hlcache_handle* gui_save_content = NULL
static

◆ gui_save_current_type

gui_save_type gui_save_current_type
static
Todo:
much of the state information for a save should probably be moved into a structure now since we could have multiple saves outstanding.

Definition at line 89 of file save.c.

Referenced by ro_gui_save_content(), ro_gui_save_datasave_ack(), ro_gui_save_drag_end(), ro_gui_save_set_state(), and ro_gui_send_datasave().

◆ gui_save_filetype

int gui_save_filetype
static

Definition at line 94 of file save.c.

Referenced by ro_gui_save_drag_end(), and ro_gui_save_set_state().

◆ gui_save_message

wimp_message gui_save_message
static

◆ gui_save_query

query_id gui_save_query
static

Definition at line 95 of file save.c.

Referenced by ro_gui_save_content().

◆ gui_save_selection

char* gui_save_selection = NULL
static

Definition at line 91 of file save.c.

Referenced by gui_drag_save_selection(), ro_gui_save_content(), and ro_gui_save_prepare().

◆ gui_save_send_dataload

bool gui_save_send_dataload
static

Definition at line 96 of file save.c.

Referenced by ro_gui_save_datasave_ack(), ro_gui_save_done(), and ro_gui_save_ok().

◆ gui_save_sourcew

wimp_w gui_save_sourcew = (wimp_w)-1
static

◆ gui_save_table

const struct gui_save_table_entry gui_save_table[]
static
Initial value:
= {
{ 0, "SaveSource" },
{ 0xaff, "SaveDraw" },
{ 0xadf, "SavePDF" },
{ 0xfff, "SaveText" },
{ 0xfaf, "SaveComplete" },
{ 0, "SaveObject" },
{ 0, "SaveObject" },
{ 0xf91, "SaveLink" },
{ 0xb28, "SaveLink" },
{ 0xfff, "SaveLink" },
{ 0xfaf, "Hotlist" },
{ 0xfaf, "History" },
{ 0xfff, "SaveSelection" },
}

Table of filetypes and default filenames.

Must be in sync with gui_save_type (riscos/gui.h). A filetype of 0 indicates the content should be used.

Definition at line 125 of file save.c.

Referenced by ro_gui_save_set_state().

◆ gui_save_title

const char* gui_save_title = NULL
static

Definition at line 93 of file save.c.

Referenced by ro_gui_drag_save_link(), ro_gui_save_content(), and ro_gui_save_prepare().

◆ gui_save_url

const char* gui_save_url = NULL
static

Definition at line 92 of file save.c.

Referenced by ro_gui_drag_save_link(), ro_gui_save_content(), and ro_gui_save_prepare().

◆ overwrite_funcs

const query_callback overwrite_funcs
static
Initial value:
=
{
}
static void ro_gui_save_overwrite_confirmed(query_id id, enum query_response res, void *p)
Overwrite of existing file confirmed, proceed with the save.
Definition: save.c:714
static void ro_gui_save_overwrite_cancelled(query_id id, enum query_response res, void *p)
User has opted not to overwrite the existing file.
Definition: save.c:701

Overwrite confirmation callbacks.

Definition at line 897 of file save.c.

Referenced by ro_gui_save_content().

◆ save_dir

char* save_dir = NULL
static

Current save directory (updated by and used for dialog-based saving)

Definition at line 109 of file save.c.

Referenced by ro_gui_save_done(), ro_gui_save_prepare(), and ro_gui_saveas_quit().

◆ save_dir_len

size_t save_dir_len
static

Definition at line 110 of file save.c.

Referenced by ro_gui_save_done(), and ro_gui_save_prepare().

◆ save_leafname

char save_leafname[LEAFNAME_MAX]
static

◆ saveas_area

osspriteop_area* saveas_area = NULL
static

◆ saving_from_dialog

bool saving_from_dialog = true
static

◆ using_dragasprite

bool using_dragasprite = true
static

in-progress Wimp_DragBox/DragASprite op

Definition at line 101 of file save.c.

Referenced by ro_gui_drag_box_cancel(), and ro_gui_drag_icon().