NetSurf
Functions
save.h File Reference

File/object/selection saving (Interface). More...

#include <stdbool.h>
#include "oslib/wimp.h"
Include dependency graph for save.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void gui_drag_save_object (struct gui_window *g, struct hlcache_handle *c, enum 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...
 
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...
 
void ro_gui_save_prepare (enum gui_save_type save_type, struct hlcache_handle *h, char *s, const struct nsurl *url, const char *title)
 
void ro_gui_save_start_drag (wimp_pointer *pointer)
 Starts a drag for the save dialog. More...
 
void ro_gui_drag_save_link (enum gui_save_type save_type, const struct nsurl *url, const char *title, struct gui_window *g)
 
void ro_gui_drag_icon (int x, int y, const char *sprite)
 Start drag of icon under the pointer. More...
 
void ro_gui_drag_box_cancel (void)
 
void ro_gui_send_datasave (enum 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...
 
bool ro_gui_save_ok (wimp_w w)
 Handle OK click/keypress in the save dialog. 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...
 

Detailed Description

File/object/selection saving (Interface).

Definition in file save.h.

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 298 of file drag.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 303 of file drag.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 ( enum gui_save_type  save_type,
const struct nsurl url,
const char *  title,
struct gui_window g 
)

◆ 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_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_prepare()

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

◆ 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 ( enum 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: