NetSurf
|
#include "utils/config.h"
#include <assert.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <oslib/colourtrans.h>
#include <oslib/osfile.h>
#include <oslib/osgbpb.h>
#include <oslib/osspriteop.h>
#include <oslib/wimp.h>
#include "utils/nsoption.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/nsurl.h"
#include "desktop/version.h"
#include "desktop/searchweb.h"
#include "netsurf/browser_window.h"
#include "riscos/configure.h"
#include "riscos/cookies.h"
#include "riscos/dialog.h"
#include "riscos/local_history.h"
#include "riscos/global_history.h"
#include "riscos/gui.h"
#include "riscos/window.h"
#include "riscos/hotlist.h"
#include "riscos/pageinfo.h"
#include "riscos/menus.h"
#include "riscos/save.h"
#include "riscos/toolbar.h"
#include "riscos/url_complete.h"
#include "riscos/url_suggest.h"
#include "riscos/wimp.h"
#include "riscos/wimp_event.h"
#include "riscos/wimputils.h"
Go to the source code of this file.
Macros | |
#define | ICON_ZOOM_VALUE 1 |
#define | ICON_ZOOM_DEC 2 |
#define | ICON_ZOOM_INC 3 |
#define | ICON_ZOOM_FRAMES 5 |
#define | ICON_ZOOM_CANCEL 7 |
#define | ICON_ZOOM_OK 8 |
#define | MAX_PERSISTENT 64 |
Functions | |
static bool | ro_gui_dialog_open_url_init (void) |
Create the Open URL dialogue, allocating storage for the URL field icon as we go. More... | |
static bool | ro_gui_dialog_openurl_apply (wimp_w w) |
static bool | ro_gui_dialog_open_url_menu_prepare (wimp_w w, wimp_i i, wimp_menu *menu, wimp_pointer *pointer) |
Callback to prepare menus in the Open URL dialog. More... | |
static bool | ro_gui_dialog_zoom_apply (wimp_w w) |
void | ro_gui_dialog_init (void) |
Load and create dialogs from template file. More... | |
wimp_w | ro_gui_dialog_create (const char *template_name) |
Create a window from a template. More... | |
wimp_window * | ro_gui_dialog_load_template (const char *template_name) |
Load a template without creating a window. More... | |
void | ro_gui_dialog_open (wimp_w w) |
Open a dialog box, centred on the screen. More... | |
void | ro_gui_dialog_close (wimp_w close) |
Close a dialog box. More... | |
bool | ro_gui_dialog_open_top (wimp_w w, struct toolbar *toolbar, int width, int height) |
Moves a window to the top of the stack. More... | |
void | ro_gui_dialog_open_at_pointer (wimp_w w) |
Open window at the location of the pointer. More... | |
void | ro_gui_dialog_open_xy (wimp_w w, int x, int y) |
Open window at a specified location. More... | |
static void | ro_gui_dialog_open_centre_parent (wimp_w parent, wimp_w child) |
Opens a window at the centre of either another window or the screen. More... | |
void | ro_gui_dialog_open_persistent (wimp_w parent, wimp_w w, bool pointer) |
Open a persistent dialog box relative to the pointer. More... | |
void | ro_gui_dialog_add_persistent (wimp_w parent, wimp_w w) |
void | ro_gui_dialog_close_persistent (wimp_w parent) |
Close persistent dialogs associated with a window. More... | |
void | ro_gui_save_options (void) |
Save the current options. More... | |
void | ro_gui_dialog_prepare_zoom (struct gui_window *g) |
Prepares the Scale view dialog. More... | |
void | ro_gui_dialog_update_zoom (struct gui_window *g) |
Update the Scale View dialog to reflect the current window settings. More... | |
void | ro_gui_dialog_prepare_open_url (void) |
Prepares the Open URL dialog. More... | |
Variables | |
wimp_w | dialog_info |
wimp_w | dialog_saveas |
wimp_w | dialog_zoom |
wimp_w | dialog_pageinfo |
wimp_w | dialog_objinfo |
wimp_w | dialog_tooltip |
wimp_w | dialog_warning |
wimp_w | dialog_folder |
wimp_w | dialog_entry |
wimp_w | dialog_search |
wimp_w | dialog_print |
wimp_w | dialog_url_complete |
wimp_w | dialog_openurl |
struct gui_window * | ro_gui_current_zoom_gui |
struct { | |
wimp_w dialog | |
wimp_w parent | |
} | persistent_dialog [MAX_PERSISTENT] |
void ro_gui_dialog_add_persistent | ( | wimp_w | parent, |
wimp_w | w | ||
) |
Definition at line 608 of file dialog.c.
References dialog, MAX_PERSISTENT, NSLOG, parent, persistent_dialog, and ro_gui_wimp_update_window_furniture().
Referenced by ro_gui_dialog_open_persistent(), and ro_gui_wimp_event_mouse_click().
void ro_gui_dialog_close | ( | wimp_w | close | ) |
Close a dialog box.
Definition at line 335 of file dialog.c.
References dialog, MAX_PERSISTENT, NSLOG, parent, persistent_dialog, ro_gui_dialog_close_persistent(), and ro_warn_user().
Referenced by gui_drag_save_object(), gui_drag_save_selection(), ro_cw_mouse_click(), ro_gui_close_window_request(), ro_gui_dialog_close_persistent(), ro_gui_drag_save_link(), ro_gui_query_close(), ro_gui_save_done(), ro_gui_send_datasave(), ro_gui_wimp_event_keypress(), ro_gui_wimp_event_mouse_click(), ro_gui_wimp_event_ok_click(), ro_local_history_mouse(), ro_pageinfo_mouse(), and ro_print_cleanup().
void ro_gui_dialog_close_persistent | ( | wimp_w | parent | ) |
Close persistent dialogs associated with a window.
parent | the window to close children of |
Definition at line 638 of file dialog.c.
References dialog, MAX_PERSISTENT, NSLOG, parent, persistent_dialog, ro_gui_dialog_close(), and ro_gui_wimp_event_close_window().
Referenced by gui_window_destroy(), gui_window_new_content(), ro_gui_dialog_close(), and ro_msg_window_info().
wimp_w ro_gui_dialog_create | ( | const char * | template_name | ) |
Create a window from a template.
template_name | name of template to load |
Exits through die() on error.
Definition at line 208 of file dialog.c.
References die(), gui_sprites, NSLOG, and ro_gui_dialog_load_template().
Referenced by ro_gui_configure_initialise(), ro_gui_configure_register(), ro_gui_dialog_init(), ro_gui_print_init(), and ro_gui_search_init().
void ro_gui_dialog_init | ( | void | ) |
Load and create dialogs from template file.
Definition at line 103 of file dialog.c.
References dialog_info, dialog_objinfo, dialog_pageinfo, dialog_saveas, dialog_theme_install, dialog_tooltip, dialog_url_complete, dialog_warning, dialog_zoom, ICON_SAVE_CANCEL, ICON_SAVE_ICON, ICON_SAVE_OK, ICON_SAVE_PATH, ICON_THEME_INSTALL_CANCEL, ICON_THEME_INSTALL_INSTALL, ICON_WARNING_CONTINUE, ICON_ZOOM_CANCEL, ICON_ZOOM_DEC, ICON_ZOOM_FRAMES, ICON_ZOOM_INC, ICON_ZOOM_OK, ICON_ZOOM_VALUE, netsurf_version, ro_gui_configure_initialise(), ro_gui_cookies_initialise(), ro_gui_dialog_create(), ro_gui_dialog_open_url_init(), ro_gui_dialog_zoom_apply(), ro_gui_global_history_initialise(), ro_gui_hotlist_initialise(), ro_gui_local_history_initialise(), ro_gui_pageinfo_initialise(), ro_gui_print_init(), ro_gui_save_ok(), ro_gui_save_start_drag(), ro_gui_saveas_create(), ro_gui_search_init(), ro_gui_set_icon_string(), ro_gui_theme_install_apply(), ro_gui_url_complete_click(), ro_gui_url_complete_entering(), ro_gui_url_complete_redraw(), ro_gui_wimp_event_register_button(), ro_gui_wimp_event_register_cancel(), ro_gui_wimp_event_register_checkbox(), ro_gui_wimp_event_register_mouse_click(), ro_gui_wimp_event_register_numeric_field(), ro_gui_wimp_event_register_ok(), ro_gui_wimp_event_register_pointer_entering_window(), ro_gui_wimp_event_register_redraw_window(), ro_gui_wimp_event_register_text_field(), and ro_gui_wimp_event_set_help_prefix().
Referenced by gui_init().
wimp_window * ro_gui_dialog_load_template | ( | const char * | template_name | ) |
Load a template without creating a window.
template_name | name of template to load |
Exits through die() on error.
Definition at line 242 of file dialog.c.
Referenced by ro_gui_cookies_initialise(), ro_gui_dialog_create(), ro_gui_dialog_open_url_init(), ro_gui_download_init(), ro_gui_global_history_initialise(), ro_gui_hotlist_initialise(), ro_gui_local_history_initialise(), ro_gui_pageinfo_initialise(), ro_gui_query_init(), and ro_gui_saveas_create().
void ro_gui_dialog_open | ( | wimp_w | w | ) |
Open a dialog box, centred on the screen.
Definition at line 297 of file dialog.c.
References NSLOG, PTR_WIMP_OPEN, ro_gui_open_window_request(), ro_gui_screen_size(), ro_gui_set_caret_first(), and ro_warn_user().
Referenced by gui_download_window_create(), query_user_xy(), ro_gui_query_window_bring_to_front(), and ro_warn_user().
void ro_gui_dialog_open_at_pointer | ( | wimp_w | w | ) |
Open window at the location of the pointer.
Definition at line 465 of file dialog.c.
References NSLOG, ro_gui_dialog_open_xy(), and ro_warn_user().
Referenced by ro_gui_dialog_open_persistent().
|
static |
Opens a window at the centre of either another window or the screen.
/param parent the parent window (NULL for centre of screen) /param child the child window
Definition at line 531 of file dialog.c.
References NSLOG, parent, PTR_WIMP_OPEN, ro_get_vscroll_width(), ro_gui_open_window_request(), ro_gui_screen_size(), and ro_warn_user().
Referenced by ro_gui_dialog_open_persistent().
void ro_gui_dialog_open_persistent | ( | wimp_w | parent, |
wimp_w | w, | ||
bool | pointer | ||
) |
Open a persistent dialog box relative to the pointer.
parent | the owning window (NULL for no owner) |
w | the dialog window |
pointer | open the window at the pointer (centre of the parent otherwise) |
Definition at line 591 of file dialog.c.
References dialog_objinfo, dialog_pageinfo, parent, ro_gui_dialog_add_persistent(), ro_gui_dialog_open_at_pointer(), ro_gui_dialog_open_centre_parent(), ro_gui_set_caret_first(), and ro_gui_wimp_update_window_furniture().
Referenced by global_history_menu_select(), gui_window_save_link(), hotlist_menu_select(), ro_gui_configure_click(), ro_gui_iconbar_menu_select(), ro_gui_window_action_page_info(), ro_gui_window_action_print(), ro_gui_window_action_save(), ro_gui_window_action_search(), ro_gui_window_action_zoom(), ro_gui_window_menu_select(), ro_local_history_open(), and ro_pageinfo_open().
bool ro_gui_dialog_open_top | ( | wimp_w | w, |
struct toolbar * | toolbar, | ||
int | width, | ||
int | height | ||
) |
Moves a window to the top of the stack.
If the window is currently closed then:
If the window is currently open then:
w | the window to show |
toolbar | the toolbar to consider |
width | the window width if it is currently closed (or 0 to retain) |
height | the window height if it is currently closed (or 0 to retain) |
Definition at line 413 of file dialog.c.
References height, PTR_WIMP_OPEN, ro_get_vscroll_width(), ro_gui_open_window_request(), ro_gui_screen_size(), ro_toolbar_get_editing(), ro_toolbar_height(), ro_toolbar_toggle_edit(), ro_warn_user(), and width.
Referenced by ro_gui_configure_click(), ro_gui_configure_show(), ro_gui_cookies_present(), ro_gui_download_window_destroy(), ro_gui_global_history_present(), ro_gui_hotlist_present(), and theme_install_start().
|
static |
Create the Open URL dialogue, allocating storage for the URL field icon as we go.
Definition at line 719 of file dialog.c.
References buffer, dialog_openurl, die(), gui_sprites, ICON_OPENURL_CANCEL, ICON_OPENURL_MENU, ICON_OPENURL_OPEN, ICON_OPENURL_URL, NSLOG, ro_gui_dialog_load_template(), ro_gui_dialog_open_url_menu_prepare(), ro_gui_dialog_openurl_apply(), RO_GUI_MAX_URL_SIZE, ro_gui_url_suggest_menu, ro_gui_wimp_event_register_cancel(), ro_gui_wimp_event_register_menu_gright(), ro_gui_wimp_event_register_menu_prepare(), ro_gui_wimp_event_register_ok(), and ro_gui_wimp_event_set_help_prefix().
Referenced by ro_gui_dialog_init().
|
static |
Callback to prepare menus in the Open URL dialog.
At present, this only has to handle the URL Suggestion pop-up.
w | The window handle owning the menu. |
i | The icon handle owning the menu. |
*menu | The menu to be prepared. |
*pointer | The associated mouse click event block, or NULL on an Adjust-click re-opening. |
Definition at line 828 of file dialog.c.
References ICON_OPENURL_MENU, ro_gui_url_suggest_menu, and ro_gui_url_suggest_prepare_menu().
Referenced by ro_gui_dialog_open_url_init().
void ro_gui_dialog_open_xy | ( | wimp_w | w, |
int | x, | ||
int | y | ||
) |
Open window at a specified location.
Definition at line 487 of file dialog.c.
References NSLOG, PTR_WIMP_OPEN, ro_gui_open_window_request(), and ro_warn_user().
Referenced by query_user_xy(), and ro_gui_dialog_open_at_pointer().
|
static |
Definition at line 775 of file dialog.c.
References browser_window_create(), BW_CREATE_HISTORY, ICON_OPENURL_URL, messages_get_errorcode(), NSERROR_OK, nsurl_unref(), ro_gui_get_icon_string(), ro_warn_user(), search_web_omni(), and SEARCH_WEB_OMNI_NONE.
Referenced by ro_gui_dialog_open_url_init().
void ro_gui_dialog_prepare_open_url | ( | void | ) |
Prepares the Open URL dialog.
Definition at line 807 of file dialog.c.
References dialog_openurl, ICON_OPENURL_MENU, ICON_OPENURL_URL, ro_gui_set_icon_shaded_state(), ro_gui_set_icon_string(), ro_gui_url_suggest_prepare_menu(), and ro_gui_wimp_event_memorise().
Referenced by ro_gui_iconbar_menu_select(), and ro_gui_iconbar_menu_warning().
void ro_gui_dialog_prepare_zoom | ( | struct gui_window * | g | ) |
Prepares the Scale view dialog.
Definition at line 689 of file dialog.c.
References browser_window_get_scale(), gui_window::bw, dialog_zoom, ICON_ZOOM_FRAMES, ICON_ZOOM_VALUE, ro_gui_current_zoom_gui, ro_gui_set_icon_selected_state(), ro_gui_set_icon_shaded_state(), ro_gui_set_icon_string(), and ro_gui_wimp_event_memorise().
Referenced by ro_gui_dialog_update_zoom(), ro_gui_window_action_zoom(), and ro_gui_window_menu_warning().
void ro_gui_dialog_update_zoom | ( | struct gui_window * | g | ) |
Update the Scale View dialog to reflect the current window settings.
g | the gui_window to update for |
Definition at line 705 of file dialog.c.
References ro_gui_current_zoom_gui, and ro_gui_dialog_prepare_zoom().
|
static |
Definition at line 675 of file dialog.c.
References ICON_ZOOM_VALUE, ro_gui_current_zoom_gui, ro_gui_get_icon_string(), and ro_gui_window_set_scale().
Referenced by ro_gui_dialog_init().
void ro_gui_save_options | ( | void | ) |
Save the current options.
Definition at line 670 of file dialog.c.
References nsoption_write().
Referenced by cookie_toolbar_save(), global_history_toolbar_save(), hotlist_toolbar_save(), ro_gui_options_cache_ok(), ro_gui_options_connection_ok(), ro_gui_options_content_ok(), ro_gui_options_fonts_ok(), ro_gui_options_home_ok(), ro_gui_options_image_ok(), ro_gui_options_interface_ok(), ro_gui_options_language_ok(), ro_gui_options_security_ok(), ro_gui_options_theme_ok(), ro_gui_theme_install_apply(), ro_gui_window_menu_select(), and ro_gui_window_save_toolbar_buttons().
wimp_w dialog |
Definition at line 87 of file dialog.c.
Referenced by gui_window_file_gadget_open(), nsgtk_about_dialog_init(), nsgtk_about_dialog_response(), nsgtk_check_for_downloads(), nsgtk_dialog_get_content_area(), nsgtk_dialog_set_has_separator(), nsgtk_download_dialog_show(), nsgtk_download_handle_error(), ro_gui_dialog_add_persistent(), ro_gui_dialog_close(), and ro_gui_dialog_close_persistent().
wimp_w dialog_info |
Definition at line 75 of file dialog.c.
Referenced by ro_gui_dialog_init(), and ro_gui_iconbar_initialise().
wimp_w dialog_objinfo |
Definition at line 76 of file dialog.c.
Referenced by ro_gui_dialog_init(), ro_gui_dialog_open_persistent(), ro_gui_window_initialise(), ro_gui_window_menu_select(), and ro_gui_window_prepare_objectinfo().
wimp_w dialog_openurl |
Definition at line 79 of file dialog.c.
Referenced by ro_gui_dialog_open_url_init(), ro_gui_dialog_prepare_open_url(), ro_gui_iconbar_initialise(), and ro_gui_iconbar_menu_select().
wimp_w dialog_pageinfo |
Definition at line 76 of file dialog.c.
Referenced by ro_gui_dialog_init(), ro_gui_dialog_open_persistent(), ro_gui_window_action_page_info(), ro_gui_window_initialise(), and ro_gui_window_prepare_pageinfo().
wimp_w dialog_print |
Definition at line 78 of file dialog.c.
Referenced by print_update_sheets_shaded_state(), ro_gui_print_apply(), ro_gui_print_init(), ro_gui_print_prepare(), ro_gui_window_action_print(), ro_gui_window_initialise(), and ro_print_cleanup().
wimp_w dialog_saveas |
Definition at line 75 of file dialog.c.
Referenced by global_history_menu_select(), gui_drag_save_object(), gui_drag_save_selection(), gui_window_save_link(), hotlist_menu_select(), ro_global_history_init(), ro_gui_dialog_init(), ro_gui_drag_save_link(), ro_gui_save_done(), ro_gui_save_prepare(), ro_gui_send_datasave(), ro_gui_window_action_save(), ro_gui_window_initialise(), ro_gui_window_menu_select(), and ro_hotlist_init().
wimp_w dialog_search |
Definition at line 78 of file dialog.c.
Referenced by ro_gui_search_add_recent(), ro_gui_search_click(), ro_gui_search_init(), ro_gui_search_keypress(), ro_gui_search_next(), ro_gui_search_prepare(), ro_gui_search_set_back_state(), ro_gui_search_set_forward_state(), ro_gui_search_set_status(), ro_gui_search_update_flags(), ro_gui_window_action_search(), and ro_gui_window_initialise().
wimp_w dialog_tooltip |
Definition at line 76 of file dialog.c.
Referenced by ro_gui_dialog_init(), ro_local_history_mouse(), and ro_local_history_tooltip().
wimp_w dialog_url_complete |
Definition at line 79 of file dialog.c.
Referenced by ro_gui_dialog_init(), ro_gui_url_complete_click(), ro_gui_url_complete_close(), ro_gui_url_complete_keypress(), and ro_gui_url_complete_resize().
wimp_w dialog_warning |
Definition at line 77 of file dialog.c.
Referenced by ro_gui_dialog_init(), and ro_warn_user().
wimp_w dialog_zoom |
Definition at line 76 of file dialog.c.
Referenced by ro_gui_dialog_init(), ro_gui_dialog_prepare_zoom(), ro_gui_window_action_zoom(), and ro_gui_window_initialise().
wimp_w parent |
Definition at line 88 of file dialog.c.
Referenced by __talloc(), CookieWindow::_AddDomain(), about_button_clicked_cb(), box_add_child(), box_is_root(), box_unlink_and_free(), browser_window_create_frameset_internal(), browser_window_navigate(), browser_window_navigate_up(), browser_window_refresh(), browser_window_resize_frame(), browser_window_resize_frames(), browser_window_up_available(), convert_script_async_cb(), convert_script_defer_cb(), convert_script_sync_cb(), cookie_manager_add(), cookie_manager_create_cookie_node(), cookie_manager_remove(), dirlist_generate_parent_link(), download_context_create(), CookieDateColumn::DrawField(), fb_corewindow_init(), fb_local_history_init(), fb_local_history_present(), fbtk_create_bitmap(), fbtk_create_button(), fbtk_create_fill(), fbtk_create_hscroll(), fbtk_create_text(), fbtk_create_text_button(), fbtk_create_user(), fbtk_create_vscroll(), fbtk_create_window(), fbtk_create_writable_text(), fbtk_destroy_widget(), fbtk_set_pos_and_size(), fbtk_widget_new(), filename_flush_directory(), global_history_entry_insert(), global_history_get_parent_treeview_node(), gui_download_window_create(), html_convert_css_callback(), html_redraw_background(), knockout_calculate(), knockout_plot_bitmap_recursive(), knockout_plot_fill_recursive(), libdom_find_first_element(), libdom_iterate_child_elements(), named_parent_node(), netsurf_recursive_rm(), next_node(), node_is_root(), nscss_get_blank_style(), nscss_handle_import(), nsgtk_about_dialog_init(), nsgtk_check_for_downloads(), nsgtk_local_history_present(), nsgtk_preferences(), nsgtk_saveas_dialog(), nsgtk_show_uri(), nsgtk_viewdata_file_save(), nsw32_about_dialog_init(), nsws_prefs_dialog_init(), nsws_prefs_font_prepare(), parent_node(), ro_gui_dialog_add_persistent(), ro_gui_dialog_close(), ro_gui_dialog_close_persistent(), ro_gui_dialog_open_centre_parent(), ro_gui_dialog_open_persistent(), ro_gui_local_history_present(), ro_gui_status_bar_create(), ro_gui_toolbar_lookup(), ro_gui_url_complete_keypress(), ro_gui_url_complete_start(), ro_gui_wimp_event_deregister(), ro_gui_wimp_update_window_furniture(), ro_gui_window_open(), ro_local_history_open(), ro_pageinfo_open(), ro_textarea_create(), ro_textarea_reflow(), ro_toolbar_attach(), ro_toolbar_create(), treeview_delete_empty_nodes(), treeview_move_selection(), treeview_walk_internal(), urldb_add_host_node(), urldb_add_path_node(), urldb_delete_cookie_hosts(), urldb_delete_cookie_paths(), urldb_dump_hosts(), urldb_dump_paths(), urldb_dump_search(), urldb_iterate_entries_host(), urldb_iterate_entries_path(), urldb_iterate_partial_path(), urldb_match_path(), urldb_save_cookie_hosts(), urldb_save_cookie_paths(), urldb_save_search_tree(), and urldb_write_paths().
struct { ... } persistent_dialog[MAX_PERSISTENT] |
Referenced by ro_gui_dialog_add_persistent(), ro_gui_dialog_close(), and ro_gui_dialog_close_persistent().
struct gui_window* ro_gui_current_zoom_gui |
Definition at line 81 of file dialog.c.
Referenced by ro_gui_dialog_prepare_zoom(), ro_gui_dialog_update_zoom(), and ro_gui_dialog_zoom_apply().