31#include "atari/gemtk/gemtk.h"
32#include "atari/res/netsurf.rsh"
39#define CNT_SELECTION 256
40#define CNT_INTERACTIVE 512
63 if (POINT_WITHIN(mx, my, area)) {
111 const char * tmp_path_suffix =
"";
114 tmpdir = getenv(
"TMPDIR");
116 tmpdir = (
char*)
"u:\\tmp\\";
119 if(tmpdir[strlen(tmpdir)-1] !=
'\\'){
120 tmp_path_suffix =
"\\";
125 snprintf(tmpfilename,
PATH_MAX,
"%s%s%s%d%s", tmpdir,
126 tmp_path_suffix, prefix, i++, suffix);
128 }
while(file_exists(tmpfilename));
137#define POP_FIRST_ITEM POP_CTX_CUT_SEL
138#define POP_LAST_ITEM POP_CTX_SAVE_LINK_AS
148 char * tempfile = &cmdline[1];
150 MENU pop_menu, me_data;
152 pop = gemtk_obj_get_tree( POP_CTX );
161 SET_BIT(pop[ choice ].ob_state, OS_DISABLED, 1);
165 SET_BIT(pop[ POP_CTX_PASTE_SEL ].ob_state, OS_DISABLED, 0);
169 SET_BIT(pop[ POP_CTX_SELECT_ALL ].ob_state, OS_DISABLED, 0);
170 SET_BIT(pop[ POP_CTX_COPY_SEL ].ob_state, OS_DISABLED, 0);
171 SET_BIT(pop[ POP_CTX_VIEW_SOURCE ].ob_state, OS_DISABLED, 0);
175 SET_BIT(pop[ POP_CTX_COPY_LINK ].ob_state, OS_DISABLED, 0);
176 SET_BIT(pop[ POP_CTX_OPEN_NEW ].ob_state, OS_DISABLED, 0);
177 SET_BIT(pop[ POP_CTX_SAVE_LINK_AS ].ob_state, OS_DISABLED, 0);
181 SET_BIT(pop[ POP_CTX_SAVE_AS ].ob_state, OS_DISABLED, 0);
182 SET_BIT(pop[ POP_CTX_COPY_URL ].ob_state, OS_DISABLED, 0);
183 SET_BIT(pop[ POP_CTX_OPEN_NEW ].ob_state, OS_DISABLED, 0);
187 pop_menu.mn_tree = gemtk_obj_get_tree(POP_CTX);
188 pop_menu.mn_menu = 0;
189 pop_menu.mn_item = POP_CTX_CUT_SEL;
190 pop_menu.mn_scroll = SCROLL_NO;
191 pop_menu.mn_keystate = 0;
193 menu_popup(&pop_menu, x, y, &me_data);
194 choice = me_data.mn_item;
197 case POP_CTX_COPY_SEL:
201 case POP_CTX_CUT_SEL:
205 case POP_CTX_PASTE_SEL:
209 case POP_CTX_SELECT_ALL:
213 case POP_CTX_SAVE_AS:
228 case POP_CTX_SAVE_LINK_AS:
248 case POP_CTX_COPY_URL:
257 case POP_CTX_COPY_LINK:
264 case POP_CTX_OPEN_NEW:
281 case POP_CTX_VIEW_SOURCE:
283 if (editor != NULL && strlen(editor)>0) {
286 if (size > 0 && data != NULL){
290 cmdline[0] = (
unsigned char)strlen(tempfile);
292 "Creating temporay source file: %s\n",
294 fp_tmpfile = fopen(tempfile,
"w");
295 if (fp_tmpfile != NULL){
296 fwrite(data, size, 1, fp_tmpfile);
300 gemtk_send_msg(SH_WDRAW, 0, -1, 0, 0, 0, 0);
303 if(strlen(tempfile)<=125){
304 shel_write(1, 1, 1, editor, cmdline);
307 printf(
"Could not open temp file: %s!\n", tempfile );
315 form_alert(0,
"[1][Set option \"atari_editor\".][OK]");
int scrap_txt_write(char *str)
nserror atari_warn_user(const char *warning, const char *detail)
Warn the user of an event.
Browser window creation and manipulation interface.
nserror browser_window_get_features(struct browser_window *bw, int x, int y, struct browser_window_features *data)
Get access to any page features at the given coordinates.
nserror browser_window_navigate(struct browser_window *bw, struct nsurl *url, struct nsurl *referrer, enum browser_window_nav_flags flags, char *post_urlenc, struct fetch_multipart_data *post_multipart, struct hlcache_handle *parent)
Start fetching a page in a browser window.
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.
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)
@ BW_CREATE_CLONE
New gui_window to be clone of "existing" gui_window.
@ BW_NAVIGATE_DOWNLOAD
download rather than render the uri
@ CONTENT_IMAGE
All images.
@ CONTENT_HTML
content is HTML
nserror
Enumeration of error codes.
Public content interface.
struct nsurl * hlcache_handle_get_url(const struct hlcache_handle *handle)
Retrieve the URL associated with a high level cache handle.
const uint8_t * content_get_source_data(struct hlcache_handle *h, size_t *size)
Retrieve source of content.
content_type content_get_type(struct hlcache_handle *h)
Retrieve computed type of content.
Interface to key press operations.
bool browser_window_key_press(struct browser_window *bw, uint32_t key)
Handle key presses in a browser window.
#define NSLOG(catname, level, logmsg, args...)
const char * messages_get_errorcode(nserror code)
lookup of a message by errorcode from the standard Messages hash.
Localised message support (interface).
NetSurf URL handling (interface).
const char * nsurl_access(const nsurl *url)
Access a NetSurf URL object as a string.
void window_get_grect(ROOTWIN *rootwin, enum browser_area_e which, GRECT *d)
Page features at a specific spatial location.
struct hlcache_handle * object
Object at position or NULL.
enum browser_window_features::@56 form_features
type of form feature.
struct nsurl * link
URL of a link or NULL.
struct browser_window * bw
first entry in window list
struct s_gui_win_root * root
struct s_browser * browser
struct browser_window * bw
struct browser_window_features ccdata
Option reading and saving interface.
#define nsoption_charp(OPTION)
Get the value of a string option.