31#include "atari/res/netsurf.rsh"
32#include "atari/gemtk/gemtk.h"
81#define T_FILE MAINMENU_T_FILE - MAINMENU_T_FILE + 1
82#define T_EDIT MAINMENU_T_EDIT - MAINMENU_T_FILE + 1
83#define T_VIEW MAINMENU_T_VIEW - MAINMENU_T_FILE + 1
84#define T_NAV MAINMENU_T_NAVIGATE - MAINMENU_T_FILE + 1
85#define T_UTIL MAINMENU_T_UTIL - MAINMENU_T_FILE + 1
86#define T_HELP MAINMENU_T_NAVIGATE - MAINMENU_T_FILE + 1
88#define NUM_MENU_TITLES 7
98static void __CDECL
menu_cut(
short item,
short title,
void *data);
101static void __CDECL
menu_find(
short item,
short title,
void *data);
103static void __CDECL
menu_stop(
short item,
short title,
void *data);
112static void __CDECL
menu_back(
short item,
short title,
void *data);
114static void __CDECL
menu_home(
short item,
short title,
void *data);
120static void __CDECL
menu_vlog(
short item,
short title,
void *data);
156 {-1, -1, NULL,{0,0,0}, NULL }
211 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
216 addr = NETSURF_HOMEPAGE;
239 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
254 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
257 if( filename != NULL ){
283 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
291 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
292 static bool init =
true;
293 bool is_folder=
false;
309 }
while ((is_folder ==
false) && (
path != NULL));
318static void __CDECL
menu_quit(
short item,
short title,
void *data)
321 memset( &buff, 0,
sizeof(
short)*8 );
322 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
323 gemtk_wm_send_msg(NULL, AP_TERM, 0, 0, 0, 0);
326static void __CDECL
menu_cut(
short item,
short title,
void *data)
332static void __CDECL
menu_copy(
short item,
short title,
void *data)
334 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
339static void __CDECL
menu_paste(
short item,
short title,
void *data)
341 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
346static void __CDECL
menu_find(
short item,
short title,
void *data)
348 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
361 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
365static void __CDECL
menu_stop(
short item,
short title,
void *data)
367 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
376static void __CDECL
menu_reload(
short item,
short title,
void *data)
381 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
406 static int state = 0;
407 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
417 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
437 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
446 menu_icheck(
h_gem_menu, MAINMENU_M_DEBUG_RENDER,
466static void __CDECL
menu_back(
short item,
short title,
void *data)
468 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
476 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
482static void __CDECL
menu_home(
short item,
short title,
void *data)
484 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
492 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
499 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
505 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
518 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
524 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
528static void __CDECL
menu_vlog(
short item,
short title,
void *data)
530 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
537 NSLOG(netsurf, INFO,
"%s", __FUNCTION__);
571 bool is_std_shortcut =
false;
577 if ((strncmp(
" ", &str[i], 2) == 0) && (strlen(&str[i]) > 2)) {
580 "Standard Keyboard Shortcut: \"%s\"\n", &str[i]);
582 is_std_shortcut =
true;
587 NSLOG(netsurf, INFO,
"Keyboard Shortcut: \"%s\"\n",
599 if (is_std_shortcut ==
false) {
610 if (is_std_shortcut ==
false) {
616 else if (str[x] ==
'^') {
620 else if (str[x] == 0x01) {
621 accel->
mod = K_LSHIFT;
642 if(str[x] ==
'F' && ( str[x+1] >=
'1' && str[x+1] <=
'9') ){
644 short fkey = atoi( &str[x+1] );
645 if( (fkey >= 0) && (fkey <= 10) ){
646 accel->
keycode = NK_F1 - 1 + fkey;
649 else if (strncmp(&str[x],
"Home", 4) == 0) {
652 else if (strncmp(&str[x],
"Undo", 4) == 0) {
655 else if (strncmp(&str[x],
"Help", 4) == 0) {
659 accel->
ascii = str[x];
664 "Registered keyboard shortcut for \"%s\" => mod: %d, ""keycode: %ld, ascii: %c\n",
740 menu_tnormal(menu_root, item, 1);
741 menu_tnormal(menu_root, title, 1);
742 menu_bar(menu_root, 1);
776 sascii = gemtk_keybd2ascii(kcode, 0);
777 if(sascii >=
'a' && sascii <=
'z'){
778 sascii = gemtk_keybd2ascii(kcode, K_LSHIFT);
817 return((done==
true) ? 1 : 0);
static void gui_window_destroy(struct gui_window *g)
void atari_about_show(void)
void atari_cookie_manager_open(void)
char * local_file_to_url(const char *filename)
void atari_global_history_open(void)
const char * file_select(const char *title, const char *name)
Show default file selector.
nserror atari_warn_user(const char *warning, const char *detail)
Warn the user of an event.
Browser window creation and manipulation interface.
bool browser_window_has_content(struct browser_window *bw)
Find out if a browser window is currently showing a content.
struct nsurl * browser_window_access_url(const struct browser_window *bw)
Access a browser window's URL.
nserror browser_window_create(enum browser_window_create_flags flags, struct nsurl *url, struct nsurl *referrer, struct browser_window *existing, struct browser_window **bw)
Create and open a new root browser window with the given page.
nserror browser_window_set_scale(struct browser_window *bw, float scale, bool absolute)
Sets the scale of a browser window.
void browser_window_reformat(struct browser_window *bw, bool background, int width, int height)
Reformat a browser window contents to a new width or height.
struct hlcache_handle * browser_window_get_content(struct browser_window *bw)
Get a cache handle for the content within a browser window.
@ BW_CREATE_HISTORY
this will form a new history node (don't set for back/reload/etc)
nserror
Enumeration of error codes.
void atari_hotlist_open(void)
void atari_hotlist_add_page(const char *url, const char *title)
Interface to key press operations.
bool browser_window_key_press(struct browser_window *bw, uint32_t key)
Handle key presses in a browser window.
bool verbose_log
flag to enable verbose logging
#define NSLOG(catname, level, logmsg, args...)
const char * messages_get_errorcode(nserror code)
lookup of a message by errorcode from the standard Messages hash.
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).
nserror nsurl_create(const char *const url_s, nsurl **url)
Create a NetSurf URL object from a URL string.
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.
struct nsurl nsurl
NetSurf URL object.
void window_open_search(ROOTWIN *rootwin, bool reformat)
void window_close_search(ROOTWIN *rootwin)
void window_get_grect(ROOTWIN *rootwin, enum browser_area_e which, GRECT *d)
void save_complete_init(void)
Initialise save complete module.
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).
struct browser_window * bw
first entry in window list
struct s_search_form_session * search
struct s_gui_win_root * root
struct s_browser * browser
struct browser_window * bw
struct rect rect
Rectangle coordinates.
nserror nsoption_write(const char *path, struct nsoption_s *opts, struct nsoption_s *defs)
Write options that have changed from the defaults to a file.
Option reading and saving interface.
#define nsoption_charp(OPTION)
Get the value of a string option.
#define nsoption_set_int(OPTION, VALUE)
set an integer option in the default table
#define nsoption_set_bool(OPTION, VALUE)
set a boolean option in the default table
#define nsoption_bool(OPTION)
Get the value of a boolean option.
Interface to a number of general purpose functionality.
bool is_dir(const char *path)
Check if a directory exists.
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.