NetSurf
|
Provides all the mandatory functions prefixed with gui_ for atari. More...
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/corestrings.h"
#include "utils/nsoption.h"
#include "netsurf/browser_window.h"
#include "netsurf/layout.h"
#include "netsurf/window.h"
#include "netsurf/clipboard.h"
#include "netsurf/fetch.h"
#include "netsurf/misc.h"
#include "netsurf/netsurf.h"
#include "netsurf/content.h"
#include "netsurf/cookie_db.h"
#include "netsurf/url_db.h"
#include "netsurf/plotters.h"
#include "content/backing_store.h"
#include "atari/gemtk/gemtk.h"
#include "atari/gui.h"
#include "atari/misc.h"
#include "atari/findfile.h"
#include "atari/schedule.h"
#include "atari/rootwin.h"
#include "atari/statusbar.h"
#include "atari/toolbar.h"
#include "atari/hotlist.h"
#include "atari/cookies.h"
#include "atari/history.h"
#include "atari/encoding.h"
#include "atari/res/netsurf.rsh"
#include "atari/plot/plot.h"
#include "atari/clipboard.h"
#include "atari/osspec.h"
#include "atari/search.h"
#include "atari/deskmenu.h"
#include "atari/download.h"
#include "atari/file.h"
#include "atari/filetype.h"
#include "atari/bitmap.h"
#include "atari/font.h"
#include "atari/treeview.h"
#include "cflib.h"
Go to the source code of this file.
Functions | |
bool | gui_window_get_scroll (struct gui_window *w, int *sx, int *sy) |
static nserror | gui_window_set_url (struct gui_window *w, nsurl *url) |
static void | atari_poll (void) |
Core atari event processing. More... | |
static struct gui_window * | gui_window_create (struct browser_window *bw, struct gui_window *existing, gui_window_create_flags flags) |
Create and open a gui window for a browsing context. More... | |
void | gui_window_destroy (struct gui_window *gw) |
Destroy previously created gui window. More... | |
static nserror | gui_window_get_dimensions (struct gui_window *gw, int *width, int *height) |
Find the current dimensions of a atari browser window content area. More... | |
static void | gui_window_set_title (struct gui_window *gw, const char *title) |
Set the title of a window. More... | |
void | atari_window_set_status (struct gui_window *w, const char *text) |
Set the status bar of a browser window. More... | |
static nserror | atari_window_invalidate_area (struct gui_window *gw, const struct rect *rect) |
Invalidates an area of an atari browser window. More... | |
static nserror | gui_window_set_scroll (struct gui_window *gw, const struct rect *rect) |
Set the scroll position of a atari browser window. More... | |
static void | gui_window_update_extent (struct gui_window *gw) |
Update the extent of the inside of a browser window to that of the current content. More... | |
void | gui_window_set_pointer (struct gui_window *gw, gui_pointer_shape shape) |
set the pointer shape More... | |
char * | gui_window_get_url (struct gui_window *gw) |
char * | gui_window_get_title (struct gui_window *gw) |
static void | throbber_advance (void *data) |
static void | gui_window_start_throbber (struct gui_window *w) |
static void | gui_window_stop_throbber (struct gui_window *w) |
static void | gui_window_place_caret (struct gui_window *w, int x, int y, int height, const struct rect *clip) |
Place caret in window. More... | |
static void | gui_window_remove_caret (struct gui_window *w) |
clear window caret More... | |
static void | gui_window_set_icon (struct gui_window *g, struct hlcache_handle *icon) |
Set a favicon for a gui window. More... | |
static void | gui_window_new_content (struct gui_window *w) |
static void | gui_get_clipboard (char **buffer, size_t *length) |
Core asks front end for clipboard contents. More... | |
static void | gui_set_clipboard (const char *buffer, size_t length, nsclipboard_styles styles[], int n_styles) |
Core tells front end to put given text in clipboard. More... | |
void | gui_set_input_gui_window (struct gui_window *gw) |
struct gui_window * | gui_get_input_window (void) |
static void | gui_quit (void) |
static bool | process_cmdline (int argc, char **argv) |
Process commandline parameters. More... | |
static void | create_cursor (int flags, short mode, void *form, MFORM_EX *m) |
static nsurl * | gui_get_resource_url (const char *path) |
static nserror | set_defaults (struct nsoption_s *defaults) |
Set option defaults for atari frontend. More... | |
static void | gui_init (int argc, char **argv) |
Initialise atari gui. More... | |
static nserror | gui_window_event (struct gui_window *gw, enum gui_window_event event) |
process miscellaneous window events More... | |
int | main (int argc, char **argv) |
Entry point from OS. More... | |
Variables | |
static bool | atari_quit = false |
struct gui_window * | input_window = NULL |
struct gui_window * | window_list = NULL |
void * | h_gem_rsrc |
long | next_poll |
bool | rendering = false |
GRECT | desk_area |
int | option_window_width |
int | option_window_height |
int | option_window_x |
int | option_window_y |
const char * | option_homepage_url |
char | options [PATH_MAX] |
EVMULT_IN | aes_event_in |
EVMULT_OUT | aes_event_out |
short | aes_msg_out [8] |
static char * | theapp = (char*)"NetSurf" |
static struct gui_window_table | atari_window_table |
static struct gui_clipboard_table | atari_clipboard_table |
static struct gui_fetch_table | atari_fetch_table |
static struct gui_misc_table | atari_misc_table |
Provides all the mandatory functions prefixed with gui_ for atari.
Definition in file gui.c.
|
static |
Core atari event processing.
Definition at line 114 of file gui.c.
References aes_event_in, aes_event_out, aes_msg_out, s_redrw_slots::areas_used, atari_quit, atari_treeview_flush_redraws(), deskmenu_dispatch_item(), deskmenu_dispatch_keypress(), input_window, gui_window::next, NSLOG, nsoption_int, s_gui_win_root::redraw_slots, rendering, gui_window::root, schedule_run(), window_list, and window_process_redraws().
Referenced by main().
|
static |
Invalidates an area of an atari browser window.
gw | gui_window |
rect | area to redraw or NULL for the entire window area |
Definition at line 386 of file gui.c.
References BROWSER_AREA_CONTENT, NSERROR_BAD_PARAMETER, NSERROR_OK, gui_window::root, s_gui_win_root::win, window_get_grect(), window_schedule_redraw_grect(), rect::x0, rect::x1, rect::y0, and rect::y1.
Referenced by gui_window_new_content().
void atari_window_set_status | ( | struct gui_window * | w, |
const char * | text | ||
) |
Set the status bar of a browser window.
w | The gui_window to update. |
text | new status text |
Definition at line 356 of file gui.c.
References input_window, gui_window::root, gui_window::status, text(), and window_set_stauts().
Referenced by gui_download_window_done(), and gui_download_window_error().
|
inlinestatic |
Definition at line 881 of file gui.c.
References mform_ex_s::flags, MFORM_EX_FLAG_USERFORM, mode, mform_ex_s::number, and mform_ex_s::tree.
Referenced by gui_init().
|
static |
Core asks front end for clipboard contents.
buffer | UTF-8 text, allocated by front end, ownership yeilded to core |
length | Byte length of UTF-8 text in buffer |
Definition at line 703 of file gui.c.
References buffer, clip(), NSERROR_OK, scrap_txt_read(), and utf8_to_local_encoding().
struct gui_window * gui_get_input_window | ( | void | ) |
Definition at line 772 of file gui.c.
References input_window.
Referenced by handle_event().
|
static |
Definition at line 892 of file gui.c.
References atari_find_resource(), netsurf_path_to_nsurl(), path(), PATH_MAX, and gui_window::url.
|
static |
Initialise atari gui.
Definition at line 926 of file gui.c.
References aes_event_in, s_gem_cursors::appstarting, s_gem_cursors::arrow, atari_cookie_manager_init(), atari_find_resource(), atari_global_history_init(), atari_hotlist_init(), atari_plotters, create_cursor(), s_gem_cursors::cross, s_gem_cursors::deny, desk_area, deskmenu_init(), die(), gem_cursors, gem_set_cursor(), s_gem_cursors::hand, s_gem_cursors::help, s_gem_cursors::ibeam, redraw_context::interactive, s_gem_cursors::menu, MFORM_EX_FLAG_USERFORM, s_gem_cursors::nodrop, NSLOG, nsoption_charp, nsoption_set_bool, PATH_MAX, plot_init(), process_cmdline(), s_gem_cursors::sizeall, s_gem_cursors::sizenesw, s_gem_cursors::sizens, s_gem_cursors::sizenwse, s_gem_cursors::sizewe, theapp, toolbar_init(), urldb_load(), urldb_load_cookies(), and s_gem_cursors::wait.
Referenced by main().
|
static |
Definition at line 777 of file gui.c.
References atari_cookie_manager_destroy(), atari_global_history_destroy(), atari_hotlist_destroy(), gui_window::browser, browser_window_destroy(), s_browser::bw, deskmenu_destroy(), gui_window::next, NSLOG, nsoption_charp, plot_finalise(), toolbar_exit(), urldb_save(), urldb_save_cookies(), and window_list.
|
static |
Core tells front end to put given text in clipboard.
buffer | UTF-8 text, owned by core |
length | Byte length of UTF-8 text in buffer |
styles | Array of styles given to text runs, owned by core, or NULL |
n_styles | Number of text run styles in array |
Definition at line 745 of file gui.c.
References buffer, clip(), NSERROR_OK, scrap_txt_write(), and utf8_to_local_encoding().
void gui_set_input_gui_window | ( | struct gui_window * | gw | ) |
Definition at line 765 of file gui.c.
References input_window, and NSLOG.
Referenced by gui_window_create(), gui_window_destroy(), handle_event(), on_content_mouse_click(), and window_unref_gui_window().
|
static |
Create and open a gui window for a browsing context.
bw | bw to create gui_window for |
existing | an existing gui_window, may be NULL |
flags | flags for gui window creation |
If GW_CREATE_CLONE flag is set existing is non-NULL.
The created gui_window must include a reference to the browser window passed in the bw param.
Definition at line 193 of file gui.c.
References BROWSER_POINTER_DEFAULT, gui_window::bw, gui_set_input_gui_window(), gui_window_set_pointer(), gui_window_set_url(), gui_window::next, NSLOG, option_window_height, option_window_width, option_window_x, option_window_y, gui_window::prev, gui_window::root, s_gui_win_root::toolbar, toolbar_key_input(), URL_WIDGET, WIDGET_NONE, WIDGET_RESIZE, WIDGET_SCROLL, WIDGET_STATUSBAR, WIDGET_TOOLBAR, s_gui_win_root::win, window_create(), window_list, window_open(), and window_set_focus().
void gui_window_destroy | ( | struct gui_window * | gw | ) |
Destroy previously created gui window.
gw | The gui window to destroy. |
Definition at line 252 of file gui.c.
References gui_window::browser, gui_set_input_gui_window(), input_window, gui_window::next, nsatari_search_session_destroy(), NSLOG, gui_window::prev, gui_window::root, gui_window::search, gui_window::status, gui_window::title, gui_window::url, window_list, and window_unref_gui_window().
|
static |
process miscellaneous window events
gw | The window receiving the event. |
event | The event code. |
Definition at line 1026 of file gui.c.
References gui_window_new_content(), gui_window_remove_caret(), gui_window_start_throbber(), gui_window_stop_throbber(), gui_window_update_extent(), GW_EVENT_NEW_CONTENT, GW_EVENT_REMOVE_CARET, GW_EVENT_START_THROBBER, GW_EVENT_STOP_THROBBER, GW_EVENT_UPDATE_EXTENT, and NSERROR_OK.
|
static |
Find the current dimensions of a atari browser window content area.
gw | The gui window to measure content area of. |
width | receives width of window |
height | receives height of window |
Definition at line 306 of file gui.c.
References BROWSER_AREA_CONTENT, height, NSERROR_OK, gui_window::root, width, and window_get_grect().
bool gui_window_get_scroll | ( | struct gui_window * | w, |
int * | sx, | ||
int * | sy | ||
) |
Definition at line 414 of file gui.c.
References gui_window::root, and window_get_scroll().
Referenced by get_context_info(), and on_file_dropped().
char * gui_window_get_title | ( | struct gui_window * | gw | ) |
Definition at line 590 of file gui.c.
References gui_window::title.
Referenced by handle_event().
char * gui_window_get_url | ( | struct gui_window * | gw | ) |
Definition at line 582 of file gui.c.
References gui_window::url.
Referenced by handle_event().
|
static |
Definition at line 687 of file gui.c.
References atari_window_invalidate_area(), gui_window::root, and s_gui_win_root::win.
Referenced by gui_window_event().
|
static |
Place caret in window.
Definition at line 643 of file gui.c.
References s_gui_win_root::caret, CARET_STATE_ENABLED, height, gui_window::root, s_caret::state, and window_place_caret().
|
static |
clear window caret
Definition at line 656 of file gui.c.
References s_gui_win_root::caret, CARET_STATE_ENABLED, gui_window::root, s_caret::state, and window_place_caret().
Referenced by gui_window_event().
|
static |
Set a favicon for a gui window.
g | window to update. |
icon | handle to object to use as icon. |
Definition at line 676 of file gui.c.
References content_get_bitmap(), gui_window::icon, input_window, gui_window::root, and window_set_icon().
void gui_window_set_pointer | ( | struct gui_window * | gw, |
gui_pointer_shape | shape | ||
) |
set the pointer shape
Change mouse pointer shape.
Definition at line 482 of file gui.c.
References s_gem_cursors::appstarting, s_gem_cursors::arrow, s_gem_cursors::cross, gui_window::cursor, s_gem_cursors::deny, gem_cursors, gem_set_cursor(), GUI_POINTER_CARET, GUI_POINTER_CROSS, GUI_POINTER_DOWN, GUI_POINTER_HELP, GUI_POINTER_LD, GUI_POINTER_LEFT, GUI_POINTER_LU, GUI_POINTER_MENU, GUI_POINTER_MOVE, GUI_POINTER_NO_DROP, GUI_POINTER_NOT_ALLOWED, GUI_POINTER_POINT, GUI_POINTER_PROGRESS, GUI_POINTER_RD, GUI_POINTER_RIGHT, GUI_POINTER_RU, GUI_POINTER_UP, GUI_POINTER_WAIT, s_gem_cursors::hand, s_gem_cursors::help, s_gem_cursors::ibeam, input_window, s_gem_cursors::menu, s_gem_cursors::nodrop, s_gem_cursors::sizeall, s_gem_cursors::sizenesw, s_gem_cursors::sizens, s_gem_cursors::sizenwse, s_gem_cursors::sizewe, and s_gem_cursors::wait.
Referenced by gui_window_create().
|
static |
Set the scroll position of a atari browser window.
Scrolls the viewport to ensure the specified rectangle of the content is shown. The atari implementation scrolls the contents so the specified point in the content is at the top of the viewport.
gw | gui window to scroll |
rect | The rectangle to ensure is shown. |
Definition at line 436 of file gui.c.
References gui_window::browser, browser_window_has_content(), s_browser::bw, NSERROR_BAD_PARAMETER, NSERROR_OK, NSLOG, gui_window::root, window_scroll_by(), rect::x0, and rect::y0.
|
static |
Set the title of a window.
gw | window to update |
title | new window title |
Definition at line 322 of file gui.c.
References NS_ATARI_SYSINFO::aes_max_win_title_len, atari_sysinfo, input_window, MIN, NSERROR_OK, gui_window::root, gui_window::title, utf8_to_local_encoding(), and window_set_title().
|
static |
Definition at line 559 of file gui.c.
References s_gui_win_root::active_gui_window, input_window, NSERROR_OK, nsurl_access(), gui_window::root, s_gui_win_root::toolbar, toolbar_set_url(), and gui_window::url.
Referenced by gui_window_create().
|
static |
Definition at line 615 of file gui.c.
References atari_schedule(), rendering, gui_window::root, throbber_advance(), s_gui_win_root::toolbar, and toolbar_set_throbber_state().
Referenced by gui_window_event().
|
static |
Definition at line 625 of file gui.c.
References atari_schedule(), rendering, gui_window::root, s_throbber_widget::running, s_toolbar::throbber, throbber_advance(), s_gui_win_root::toolbar, and toolbar_set_throbber_state().
Referenced by gui_window_event().
|
static |
Update the extent of the inside of a browser window to that of the current content.
It seems this method is called when content size got adjusted, so that we can adjust scroll info. We also have to call it when tab change occurs.
gw | gui_window to update the extent of |
Definition at line 461 of file gui.c.
References gui_window::browser, BROWSER_AREA_CONTENT, browser_window_get_extents(), browser_window_has_content(), s_browser::bw, height, gui_window::root, width, window_get_active_gui_window(), window_get_grect(), window_schedule_redraw_grect(), window_set_content_size(), and window_update_back_forward().
Referenced by gui_window_event().
int main | ( | int | argc, |
char ** | argv | ||
) |
Entry point from OS.
Normal entry point from OS.
/param argc The number of arguments in the string vector. /param argv The argument string vector. /return The return code to the OS
Definition at line 1098 of file gui.c.
References atari_bitmap_table, atari_clipboard_table, atari_core_window_table, atari_download_table, atari_fetch_table, atari_file_table, atari_find_resource(), atari_layout_table, atari_misc_table, atari_poll(), atari_quit, atari_search_table, atari_utf8_table, atari_warn_user(), atari_window_table, browser_window_create(), BW_CREATE_HISTORY, die(), filesystem_llcache_table, gui_init(), init_os_info(), local_file_to_url(), messages_add_from_file(), messages_get_errorcode(), netsurf_table::misc, netsurf_exit(), netsurf_init(), netsurf_register(), NSERROR_OK, NSLOG, nslog_finalise(), nslog_init(), nsoption_commandline(), nsoption_init(), nsoption_read(), nsoptions, nsoptions_default, nsurl_create(), nsurl_unref(), option_homepage_url, options, PATH_MAX, set_defaults(), and store().
|
static |
Process commandline parameters.
Definition at line 817 of file gui.c.
References desk_area, NSLOG, nsoption_charp, nsoption_int, option_homepage_url, option_window_height, option_window_width, option_window_x, and option_window_y.
Referenced by gui_init().
|
static |
Set option defaults for atari frontend.
defaults | The option table to update. |
Definition at line 910 of file gui.c.
References NSERROR_BAD_PARAMETER, NSERROR_OK, NSLOG, nsoption_charp, and nsoption_setnull_charp.
Referenced by main(), and nsoption_init().
|
static |
Definition at line 598 of file gui.c.
References atari_schedule(), gui_window::root, s_throbber_widget::running, s_toolbar::throbber, throbber_advance(), s_gui_win_root::toolbar, and toolbar_throbber_progress().
Referenced by gui_window_start_throbber(), gui_window_stop_throbber(), and throbber_advance().
EVMULT_IN aes_event_in |
Definition at line 93 of file gui.c.
Referenced by atari_poll(), and gui_init().
EVMULT_OUT aes_event_out |
Definition at line 105 of file gui.c.
Referenced by atari_poll(), on_content_mouse_click(), on_content_mouse_move(), and toolbar_mouse_input().
short aes_msg_out[8] |
Definition at line 106 of file gui.c.
Referenced by atari_poll().
|
static |
Definition at line 1073 of file gui.c.
Referenced by main().
|
static |
Definition at line 1078 of file gui.c.
Referenced by main().
|
static |
Definition at line 1084 of file gui.c.
Referenced by main().
|
static |
Definition at line 72 of file gui.c.
Referenced by atari_poll(), and main().
|
static |
Definition at line 1056 of file gui.c.
Referenced by main().
GRECT desk_area |
Definition at line 79 of file gui.c.
Referenced by atari_cookie_manager_init(), atari_cookie_manager_open(), atari_global_history_init(), atari_global_history_open(), atari_hotlist_init(), atari_hotlist_open(), gui_download_window_create(), gui_init(), open_settings(), process_cmdline(), and window_create().
struct gui_window* input_window = NULL |
Definition at line 74 of file gui.c.
Referenced by atari_poll(), atari_window_set_status(), gui_get_input_window(), gui_set_input_gui_window(), gui_window_destroy(), gui_window_set_icon(), gui_window_set_pointer(), gui_window_set_title(), and gui_window_set_url().
const char* option_homepage_url |
Definition at line 88 of file gui.c.
Referenced by main(), and process_cmdline().
int option_window_height |
Definition at line 83 of file gui.c.
Referenced by gui_window_create(), menu_savewin(), and process_cmdline().
int option_window_width |
Definition at line 82 of file gui.c.
Referenced by gui_window_create(), menu_savewin(), and process_cmdline().
int option_window_x |
Definition at line 84 of file gui.c.
Referenced by gui_window_create(), menu_savewin(), and process_cmdline().
int option_window_y |
Definition at line 85 of file gui.c.
Referenced by gui_window_create(), menu_savewin(), and process_cmdline().
char options[PATH_MAX] |
Definition at line 91 of file gui.c.
Referenced by form_dom_to_data_select(), gui_init_replicant(), main(), menu_savewin(), and save_settings().
bool rendering = false |
Definition at line 78 of file gui.c.
Referenced by atari_poll(), gui_window_start_throbber(), and gui_window_stop_throbber().
|
static |
Definition at line 921 of file gui.c.
Referenced by gui_init().
struct gui_window* window_list = NULL |
Definition at line 75 of file gui.c.
Referenced by atari_poll(), gui_quit(), gui_resize(), gui_window_add_to_window_list(), gui_window_create(), gui_window_destroy(), and gui_window_remove_from_window_list().