NetSurf
arexx.c
Go to the documentation of this file.
1/*
2 * Copyright 2008-2010, 2016 Chris Young <chris@unsatisfactorysoftware.co.uk>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include "amiga/os3support.h"
20
21#include <stdlib.h>
22#include <string.h>
23#include <math.h>
24
25#include <proto/intuition.h>
26#include <proto/dos.h>
27#include <proto/exec.h>
28#include <proto/clicktab.h>
29#include <gadgets/clicktab.h>
30#include <reaction/reaction_macros.h>
31
32#include "utils/log.h"
33#include "utils/nsoption.h"
34#include "utils/nsurl.h"
35#include "netsurf/content.h"
37#include "desktop/version.h"
38
39#include "amiga/arexx.h"
40#include "amiga/gui.h"
41#include "amiga/download.h"
42#include "amiga/hotlist.h"
43#include "amiga/libs.h"
44#include "amiga/misc.h"
45#include "amiga/theme.h"
46
47#ifndef __amigaos4__
48#include "amiga/memory.h"
49#endif
50
51extern const char * const verarexx;
52extern const char * const wt_revid;
53
54enum
55{
74};
75
76static Object *arexx_obj = NULL;
77STATIC char result[100];
78
79#ifdef __amigaos4__
80#define RXHOOKF(func) static VOID func(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unused)))
81#else
82#define RXHOOKF(func) static ASM VOID func(REG(a0, struct ARexxCmd* cmd), REG(a1, struct RexxMsg* msg))
83#endif
84
85RXHOOKF(rx_open);
86RXHOOKF(rx_quit);
87RXHOOKF(rx_tofront);
88RXHOOKF(rx_geturl);
89RXHOOKF(rx_gettitle);
90RXHOOKF(rx_version);
91RXHOOKF(rx_save);
92RXHOOKF(rx_pubscreen);
93RXHOOKF(rx_back);
94RXHOOKF(rx_forward);
95RXHOOKF(rx_home);
96RXHOOKF(rx_reload);
97RXHOOKF(rx_windows);
98RXHOOKF(rx_active);
99RXHOOKF(rx_close);
100RXHOOKF(rx_hotlist);
101RXHOOKF(rx_slabstats);
102RXHOOKF(rx_exec);
103
104STATIC struct ARexxCmd Commands[] =
105{
106 {"OPEN",RX_OPEN,rx_open,"URL/A,NEW=NEWWINDOW/S,NEWTAB/S,SAVEAS/K,W=WINDOW/K/N,T=TAB/K/N,ACTIVE/S", 0, NULL, 0, 0, NULL },
107 {"QUIT",RX_QUIT,rx_quit,NULL, 0, NULL, 0, 0, NULL },
108 {"TOFRONT",RX_TOFRONT,rx_tofront,NULL, 0, NULL, 0, 0, NULL },
109 {"GETURL",RX_GETURL,rx_geturl, "W=WINDOW/K/N,T=TAB/K/N", 0, NULL, 0, 0, NULL },
110 {"GETTITLE",RX_GETTITLE,rx_gettitle, "W=WINDOW/K/N,T=TAB/K/N", 0, NULL, 0, 0, NULL },
111 {"VERSION",RX_VERSION,rx_version,"VERSION/N,SVN=REVISION/N,RELEASE/S", 0, NULL, 0, 0, NULL },
112 {"SAVE",RX_SAVE,rx_save,"FILENAME/A,W=WINDOW/K/N,T=TAB/K/N", 0, NULL, 0, 0, NULL },
113 {"GETSCREENNAME",RX_PUBSCREEN,rx_pubscreen,NULL, 0, NULL, 0, 0, NULL },
114 {"BACK", RX_BACK, rx_back, "W=WINDOW/K/N,T=TAB/K/N", 0, NULL, 0, 0, NULL },
115 {"FORWARD", RX_FORWARD, rx_forward, "W=WINDOW/K/N,T=TAB/K/N", 0, NULL, 0, 0, NULL },
116 {"HOME", RX_HOME, rx_home, "W=WINDOW/K/N,T=TAB/K/N", 0, NULL, 0, 0, NULL },
117 {"RELOAD", RX_RELOAD, rx_reload, "FORCE/S,W=WINDOW/K/N,T=TAB/K/N", 0, NULL, 0, 0, NULL },
118 {"WINDOWS", RX_WINDOWS, rx_windows, "W=WINDOW/K/N", 0, NULL, 0, 0, NULL },
119 {"ACTIVE", RX_ACTIVE, rx_active, "T=TAB/S", 0, NULL, 0, 0, NULL },
120 {"CLOSE", RX_CLOSE, rx_close, "W=WINDOW/K/N,T=TAB/K/N", 0, NULL, 0, 0, NULL },
121 {"HOTLIST", RX_HOTLIST, rx_hotlist, "A=ACTION/A", 0, NULL, 0, 0, NULL },
122 {"SLABSTATS", RX_SLABSTATS, rx_slabstats, "FILE", 0, NULL, 0, 0, NULL },
123 {"EXEC", RX_EXEC, rx_exec, "W=WINDOW/K/N,T=TAB/K/N,COMMAND/A/F", 0, NULL, 0, 0, NULL },
124 { NULL, 0, NULL, NULL, 0, NULL, 0, 0, NULL }
125};
126
128{
129 if((arexx_obj = ARexxObj,
130 AREXX_HostName,"NETSURF",
131 AREXX_Commands,Commands,
132 AREXX_NoSlot,TRUE,
133 AREXX_ReplyHook,NULL,
134 AREXX_DefExtension,"nsrx",
135 End))
136 {
137 GetAttr(AREXX_SigMask, arexx_obj, rxsig);
138 return true;
139 }
140 else
141 {
142/* Create a temporary ARexx port so we can send commands to the NetSurf which
143 * is already running */
145 AREXX_HostName,"NETSURF",
146 AREXX_Commands,Commands,
147 AREXX_NoSlot,FALSE,
148 AREXX_ReplyHook,NULL,
149 AREXX_DefExtension,"nsrx",
150 End;
151
152 return false;
153 }
154}
155
157{
158 RA_HandleRexx(arexx_obj);
159}
160
161static void ami_arexx_command(const char *cmd, const char *port)
162{
163 if(arexx_obj == NULL) return;
164 IDoMethod(arexx_obj, AM_EXECUTE, cmd, port, NULL, NULL, NULL, NULL);
165}
166
167void ami_arexx_self(const char *cmd)
168{
169 ami_arexx_command(cmd, "NETSURF");
170}
171
172void ami_arexx_execute(char *script)
173{
174 char full_script_path[1025];
175 BPTR lock;
176
177 if((lock = Lock(script, ACCESS_READ))) {
178 DevNameFromLock(lock, full_script_path, 1024, DN_FULLPATH);
179 NSLOG(netsurf, INFO, "Executing script: %s", full_script_path);
180 ami_arexx_command(full_script_path, NULL);
181 UnLock(lock);
182 }
183}
184
186{
187 if(arexx_obj) DisposeObject(arexx_obj);
188}
189
190static struct gui_window *ami_find_tab_gwin(struct gui_window_2 *gwin, int tab)
191{
192 int tabs = 0;
193 struct Node *ctab;
194 struct Node *ntab;
195 struct gui_window *gw;
196
197 if((tab == 0) || (ami_gui2_get_tabs(gwin) == 0)) return ami_gui2_get_gui_window(gwin);
198
199 ctab = GetHead(ami_gui2_get_tab_list(gwin));
200
201 do
202 {
203 tabs++;
204 ntab=GetSucc(ctab);
205 GetClickTabNodeAttrs(ctab,
206 TNA_UserData, &gw,
207 TAG_DONE);
208 if(tabs == tab) return gw;
209 } while((ctab=ntab));
210
211 return NULL;
212}
213
214static int ami_find_tab_bw(struct gui_window_2 *gwin, struct browser_window *bw)
215{
216 int tabs = 0;
217 struct Node *ctab;
218 struct Node *ntab;
219 struct gui_window *tgw = NULL;
220
221 if((bw == NULL) || (ami_gui2_get_tabs(gwin) == 0)) return 1;
222
223 ctab = GetHead(ami_gui2_get_tab_list(gwin));
224
225 do
226 {
227 tabs++;
228 ntab=GetSucc(ctab);
229 GetClickTabNodeAttrs(ctab,
230 TNA_UserData, &tgw,
231 TAG_DONE);
232 if(ami_gui_get_browser_window(tgw) == bw) return tabs;
233 } while((ctab=ntab));
234
235 return 0;
236}
237
238static struct gui_window *ami_find_tab(int window, int tab)
239{
240 struct nsObject *node, *nnode;
241 struct MinList *window_list = ami_gui_get_window_list();
242
244 {
245 int windows = 0;
246
247 node = (struct nsObject *)GetHead((struct List *)window_list);
248
249 do
250 {
251 nnode=(struct nsObject *)GetSucc((struct Node *)node);
252
253 if(node->Type == AMINS_WINDOW)
254 {
255 windows++;
256 if(windows == window)
257 return ami_find_tab_gwin(node->objstruct, tab);
258 }
259 } while((node = nnode));
260 }
261 return NULL;
262}
263
264RXHOOKF(rx_open)
265{
266 struct dlnode *dln;
267 struct gui_window *gw = ami_gui_get_active_gw();
268 nsurl *url;
269
270 cmd->ac_RC = 0;
271
272 if((cmd->ac_ArgList[4]) && (cmd->ac_ArgList[5]))
273 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[4], *(ULONG *)cmd->ac_ArgList[5]);
274
275 if (nsurl_create((char *)cmd->ac_ArgList[0], &url) != NSERROR_OK) {
276 amiga_warn_user("NoMemory", 0);
277 return;
278 }
279
280 if(cmd->ac_ArgList[3])
281 {
282 if(!gw) return;
283
284 dln = calloc(1, sizeof(struct dlnode));
285 dln->filename = strdup((char *)cmd->ac_ArgList[3]);
286 dln->node.ln_Name = strdup((char *)cmd->ac_ArgList[0]);
287 dln->node.ln_Type = NT_USER;
288 AddTail(ami_gui_get_download_list(gw), (struct Node *)dln);
290 url,
291 NULL,
293 NULL,
294 NULL,
295 NULL);
296 }
297 else if(cmd->ac_ArgList[2])
298 {
299 if(gw == NULL) {
301 url,
302 NULL,
303 NULL,
304 NULL);
305 } else {
308 url,
309 NULL,
311 NULL);
312
313 if(cmd->ac_ArgList[6]) {
315 }
316 }
317 }
318 else if(cmd->ac_ArgList[1])
319 {
321 url,
322 NULL,
323 NULL,
324 NULL);
325 }
326 else
327 {
328 if(gw)
329 {
331 url,
332 NULL,
334 NULL,
335 NULL,
336 NULL);
337 }
338 else
339 {
341 url,
342 NULL,
343 NULL,
344 NULL);
345 }
346 }
348}
349
350RXHOOKF(rx_save)
351{
352 BPTR fh = 0;
353 struct gui_window *gw = ami_gui_get_active_gw();
354
355 cmd->ac_RC = 0;
356
357 if((cmd->ac_ArgList[1]) && (cmd->ac_ArgList[2]))
358 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[1], *(ULONG *)cmd->ac_ArgList[2]);
359
360 if(!gw) return;
361
363
364 if((fh = FOpen((char *)cmd->ac_ArgList[0], MODE_NEWFILE, 0)))
365 {
366 const uint8_t *source_data;
367 size_t source_size;
369 source_data = content_get_source_data(h, &source_size);
370 if (source_data != NULL) {
371 FWrite(fh, source_data, 1, source_size);
372 }
373
374 FClose(fh);
375 SetComment((char *)cmd->ac_ArgList[0], nsurl_access(browser_window_access_url(ami_gui_get_browser_window(gw))));
376 }
377
379}
380
381RXHOOKF(rx_quit)
382{
383 cmd->ac_RC = 0;
385}
386
387RXHOOKF(rx_tofront)
388{
389 cmd->ac_RC = 0;
390 ScreenToFront(ami_gui_get_screen());
391}
392
393RXHOOKF(rx_geturl)
394{
395 struct gui_window *gw = ami_gui_get_active_gw();
396
397 cmd->ac_RC = 0;
398
399 if((cmd->ac_ArgList[0]) && (cmd->ac_ArgList[1]))
400 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[0], *(ULONG *)cmd->ac_ArgList[1]);
401
402 if(gw && ami_gui_get_browser_window(gw))
403 {
405 }
406 else
407 {
408 strcpy(result,"");
409 }
410
411 cmd->ac_Result = result;
412}
413
414RXHOOKF(rx_gettitle)
415{
416 struct gui_window *gw = ami_gui_get_active_gw();
417
418 cmd->ac_RC = 0;
419
420 if((cmd->ac_ArgList[0]) && (cmd->ac_ArgList[1]))
421 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[0], *(ULONG *)cmd->ac_ArgList[1]);
422
423 if(gw)
424 {
426 strcpy(result, ami_gui_get_tab_title(gw));
427 else
428 strcpy(result, ami_gui_get_win_title(gw));
429 }
430 else
431 {
432 strcpy(result,"");
433 }
434
435 cmd->ac_Result = result;
436}
437
438RXHOOKF(rx_version)
439{
440 cmd->ac_RC = 0;
441
442 if(cmd->ac_ArgList[2])
443 {
444 if(cmd->ac_ArgList[1])
445 {
446 if((netsurf_version_major > *(int *)cmd->ac_ArgList[0]) || ((netsurf_version_minor >= *(int *)cmd->ac_ArgList[1]) && (netsurf_version_major == *(int *)cmd->ac_ArgList[0])))
447 {
448 strcpy(result,"1");
449 }
450 else
451 {
452 strcpy(result,"0");
453 }
454 }
455 else if(cmd->ac_ArgList[0])
456 {
457 if((netsurf_version_major >= *(int *)cmd->ac_ArgList[0]))
458 {
459 strcpy(result,"1");
460 }
461 else
462 {
463 strcpy(result,"0");
464 }
465 }
466 else
467 {
468 strcpy(result,netsurf_version);
469 }
470 }
471 else
472 {
473 if(cmd->ac_ArgList[1])
474 {
475 if((netsurf_version_major > *(int *)cmd->ac_ArgList[0]) || ((atoi(wt_revid) >= *(int *)cmd->ac_ArgList[1]) && (netsurf_version_major == *(int *)cmd->ac_ArgList[0])))
476 {
477 strcpy(result,"1");
478 }
479 else
480 {
481 strcpy(result,"0");
482 }
483 }
484 else if(cmd->ac_ArgList[0])
485 {
486 if((netsurf_version_major >= *(int *)cmd->ac_ArgList[0]))
487 {
488 strcpy(result,"1");
489 }
490 else
491 {
492 strcpy(result,"0");
493 }
494 }
495 else
496 {
497 strcpy(result,verarexx);
498 }
499 }
500
501 cmd->ac_Result = result;
502}
503
504RXHOOKF(rx_pubscreen)
505{
506 cmd->ac_RC = 0;
507
508 if(nsoption_charp(pubscreen_name) == NULL)
509 {
510 strcpy(result,"NetSurf");
511 }
512 else
513 {
514 strcpy(result, nsoption_charp(pubscreen_name));
515 }
516
517 cmd->ac_Result = result;
518}
519
520RXHOOKF(rx_back)
521{
522 struct gui_window *gw = ami_gui_get_active_gw();
523
524 cmd->ac_RC = 0;
525
526 if((cmd->ac_ArgList[0]) && (cmd->ac_ArgList[1]))
527 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[0], *(ULONG *)cmd->ac_ArgList[1]);
528
530}
531
532RXHOOKF(rx_forward)
533{
534 struct gui_window *gw = ami_gui_get_active_gw();
535
536 cmd->ac_RC = 0;
537
538 if((cmd->ac_ArgList[0]) && (cmd->ac_ArgList[1]))
539 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[0], *(ULONG *)cmd->ac_ArgList[1]);
540
541 if(gw) ami_gui_history(ami_gui_get_gui_window_2(gw), false);
542
543}
544
545RXHOOKF(rx_home)
546{
547 struct gui_window *gw = ami_gui_get_active_gw();
548 nsurl *url;
549
550 cmd->ac_RC = 0;
551
552 if((cmd->ac_ArgList[0]) && (cmd->ac_ArgList[1]))
553 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[0], *(ULONG *)cmd->ac_ArgList[1]);
554
555 if(gw == NULL) return;
556
557 if (nsurl_create(nsoption_charp(homepage_url), &url) != NSERROR_OK) {
558 amiga_warn_user("NoMemory", 0);
559 } else {
561 url,
562 NULL,
564 NULL,
565 NULL,
566 NULL);
568 }
569}
570
571RXHOOKF(rx_reload)
572{
573 struct gui_window *gw = ami_gui_get_active_gw();
574
575 cmd->ac_RC = 0;
576
577 if((cmd->ac_ArgList[1]) && (cmd->ac_ArgList[2]))
578 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[1], *(ULONG *)cmd->ac_ArgList[2]);
579
580 if(gw)
581 {
582 if(cmd->ac_ArgList[0]) /* FORCE */
583 {
585 }
586 else
587 {
589 }
590 }
591}
592
593RXHOOKF(rx_windows)
594{
595 int windows = 0, tabs = 0;
596 int window = 0;
597
598 if(cmd->ac_ArgList[0]) window = *(ULONG *)cmd->ac_ArgList[0];
599 cmd->ac_RC = 0;
600
601 windows = ami_gui_count_windows(window, &tabs);
602
603 if(cmd->ac_ArgList[0]) sprintf(result, "%d", tabs);
604 else sprintf(result, "%d", windows);
605 cmd->ac_Result = result;
606}
607
608RXHOOKF(rx_active)
609{
610 int window = 0, tab = 0;
611 struct gui_window *gw = ami_gui_get_active_gw();
612 struct nsObject *node, *nnode;
613 struct gui_window_2 *gwin = NULL;
614 struct MinList *window_list = ami_gui_get_window_list();
615
616 cmd->ac_RC = 0;
617
619 {
620 int windows = 0;
621
622 node = (struct nsObject *)GetHead((struct List *)window_list);
623
624 do
625 {
626 nnode=(struct nsObject *)GetSucc((struct Node *)node);
627
628 gwin = node->objstruct;
629
630 if(node->Type == AMINS_WINDOW)
631 {
632 windows++;
633 if(IS_CURRENT_GW(gwin,gw))
634 {
635 window = windows;
636 break;
637 }
638 }
639 } while((node = nnode));
640 }
641
642 if(cmd->ac_ArgList[0])
643 {
645 }
646
647 if(cmd->ac_ArgList[0]) sprintf(result, "%d", tab);
648 else sprintf(result, "%d", window);
649 cmd->ac_Result = result;
650}
651
652RXHOOKF(rx_close)
653{
654 struct gui_window *gw = ami_gui_get_active_gw();
655
656 cmd->ac_RC = 0;
657
658 if((cmd->ac_ArgList[0]) && (cmd->ac_ArgList[1]))
659 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[0], *(ULONG *)cmd->ac_ArgList[1]);
660 else if(cmd->ac_ArgList[0])
661 {
663 return;
664 }
665
667}
668
669RXHOOKF(rx_hotlist)
670{
671 cmd->ac_RC = 0;
672
673 if(strcasecmp((char *)cmd->ac_ArgList[0], "OPEN") == 0) {
675 } else if(strcasecmp((char *)cmd->ac_ArgList[0], "CLOSE") == 0) {
677 }
678}
679
680RXHOOKF(rx_exec)
681{
682 struct gui_window *gw = ami_gui_get_active_gw();
683 bool res = false;
684
685 if(nsoption_bool(arexx_allow_exec) == false) {
686 cmd->ac_RC = RETURN_FAIL;
687 return;
688 }
689
690 if((cmd->ac_ArgList[0]) && (cmd->ac_ArgList[1]))
691 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[0], *(ULONG *)cmd->ac_ArgList[1]);
692
693 if(gw) {
694 NSLOG(netsurf, WARNING, "Executing js: %s", (char *)cmd->ac_ArgList[2]);
696 (char *)cmd->ac_ArgList[2], strlen((char *)cmd->ac_ArgList[2]));
697 }
698
699 if(res == false) {
700 cmd->ac_RC = RETURN_ERROR;
701 } else {
702 cmd->ac_RC = RETURN_OK;
703 }
704
705}
706
707RXHOOKF(rx_slabstats)
708{
709#ifndef __amigaos4__
710 BPTR fh = 0;
711
712 if(cmd->ac_ArgList[0] != NULL) {
713 fh = Open((char *)cmd->ac_ArgList[0], MODE_NEWFILE);
714 }
716
717 if(fh != 0) Close(fh);
718#endif
719}
720
static ULONG rxsig
Definition: gui.c:348
struct Screen * ami_gui_get_screen(void)
Get a pointer to the screen NetSurf is running on.
Definition: gui.c:404
void ami_gui_switch_to_new_tab(struct gui_window_2 *gwin)
Switch to the most-recently-opened tab.
Definition: gui.c:4379
void ami_gui_history(struct gui_window_2 *gwin, bool back)
Definition: gui.c:1689
void ami_gui_close_window(void *w)
Close a window and all tabs attached to it.
Definition: gui.c:5478
void ami_set_pointer(struct gui_window_2 *gwin, gui_pointer_shape shape, bool update)
Definition: gui.c:689
static struct MinList * window_list
Definition: gui.c:326
struct gui_window * ami_gui_get_active_gw(void)
Get a pointer to the gui_window which NetSurf considers to be the current/active one.
Definition: gui.c:399
void ami_reset_pointer(struct gui_window_2 *gwin)
Definition: gui.c:697
const char * ami_gui_get_win_title(struct gui_window *gw)
Get window title from gui_window.
Definition: gui.c:450
const char * ami_gui_get_tab_title(struct gui_window *gw)
Get tab title from gui_window.
Definition: gui.c:457
struct gui_window * ami_gui2_get_gui_window(struct gui_window_2 *gwin)
Get gui_window from gui_window_2.
Definition: gui.c:444
struct List * ami_gui_get_download_list(struct gui_window *gw)
Get download list from gui_window.
Definition: gui.c:432
ULONG ami_gui2_get_tabs(struct gui_window_2 *gwin)
Get tabs from gui_window_2.
Definition: gui.c:469
struct List * ami_gui2_get_tab_list(struct gui_window_2 *gwin)
Get tab list from gui_window_2.
Definition: gui.c:475
int ami_gui_count_windows(int window, int *tabs)
Count windows, and optionally tabs.
Definition: gui.c:4339
struct browser_window * ami_gui_get_browser_window(struct gui_window *gw)
Get browser window from gui_window.
Definition: gui.c:420
struct MinList * ami_gui_get_window_list(void)
Get the window list.
Definition: gui.c:409
struct gui_window_2 * ami_gui_get_gui_window_2(struct gui_window *gw)
Get gui_window_2 from gui_window.
Definition: gui.c:438
void ami_quit_netsurf(void)
Definition: gui.c:3808
#define IS_CURRENT_GW(GWIN, GW)
Definition: gui.h:78
nserror amiga_warn_user(const char *warning, const char *detail)
Warn the user of an event.
Definition: misc.c:79
const char *const wt_revid
@ RX_SAVE
Definition: arexx.c:62
@ RX_HOTLIST
Definition: arexx.c:71
@ RX_GETURL
Definition: arexx.c:59
@ RX_CLOSE
Definition: arexx.c:70
@ RX_RELOAD
Definition: arexx.c:67
@ RX_VERSION
Definition: arexx.c:61
@ RX_PUBSCREEN
Definition: arexx.c:63
@ RX_BACK
Definition: arexx.c:64
@ RX_ACTIVE
Definition: arexx.c:69
@ RX_OPEN
Definition: arexx.c:56
@ RX_TOFRONT
Definition: arexx.c:58
@ RX_QUIT
Definition: arexx.c:57
@ RX_HOME
Definition: arexx.c:66
@ RX_FORWARD
Definition: arexx.c:65
@ RX_WINDOWS
Definition: arexx.c:68
@ RX_EXEC
Definition: arexx.c:73
@ RX_GETTITLE
Definition: arexx.c:60
@ RX_SLABSTATS
Definition: arexx.c:72
static int ami_find_tab_bw(struct gui_window_2 *gwin, struct browser_window *bw)
Definition: arexx.c:214
void ami_arexx_cleanup(void)
Definition: arexx.c:185
static void ami_arexx_command(const char *cmd, const char *port)
Definition: arexx.c:161
STATIC struct ARexxCmd Commands[]
Definition: arexx.c:104
static Object * arexx_obj
Definition: arexx.c:76
const char *const verarexx
#define RXHOOKF(func)
Definition: arexx.c:82
STATIC char result[100]
Definition: arexx.c:77
static struct gui_window * ami_find_tab(int window, int tab)
Definition: arexx.c:238
bool ami_arexx_init(ULONG *rxsig)
Definition: arexx.c:127
static struct gui_window * ami_find_tab_gwin(struct gui_window_2 *gwin, int tab)
Definition: arexx.c:190
void ami_arexx_self(const char *cmd)
Definition: arexx.c:167
void ami_arexx_execute(char *script)
Definition: arexx.c:172
void ami_arexx_handle(void)
Definition: arexx.c:156
Browser window creation and manipulation interface.
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_exec(struct browser_window *bw, const char *src, size_t srclen)
Execute some JavaScript code in a browsing context.
void browser_window_destroy(struct browser_window *bw)
Close and destroy a browser window.
nserror browser_window_reload(struct browser_window *bw, bool all)
Reload the page in a browser window.
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_TAB
New gui_window to be tab in same window as "existing" gui_window.
@ BW_NAVIGATE_DOWNLOAD
download rather than render the uri
@ BW_NAVIGATE_HISTORY
this will form a new history node (don't set for back/reload/etc)
const int netsurf_version_minor
NetSuf browser minor version number.
Definition: version.c:30
const int netsurf_version_major
NetSuf browser major version number.
Definition: version.c:29
@ NSERROR_OK
No error.
Definition: errors.h:30
void ami_hotlist_close(void)
Close the hotlist viewer normally this shouldn't be used; only exists for ARexx use.
Definition: hotlist.c:603
nserror ami_hotlist_present(void)
Open the hotlist viewer.
Definition: hotlist.c:547
@ AMINS_WINDOW
Definition: object.h:28
const char *const netsurf_version
User friendly version string.
Definition: gui_menu.c:92
static CONST_STRPTR tabs[OPTS_MAX_TABS]
Definition: gui_options.c:254
Public content interface.
const uint8_t * content_get_source_data(struct hlcache_handle *h, size_t *size)
Retrieve source of content.
Definition: content.c:1209
@ GUI_POINTER_WAIT
Definition: mouse.h:127
#define ARexxObj
Definition: libs.h:51
#define NSLOG(catname, level, logmsg, args...)
Definition: log.h:116
void ami_memory_slab_dump(BPTR fh)
Definition: memory.c:122
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.
Definition: nsurl.h:31
struct Node * GetHead(struct List *list)
Definition: os3support.c:364
struct Node * GetSucc(struct Node *node)
Definition: os3support.c:381
Minimal compatibility header for AmigaOS 3.
#define DN_FULLPATH
Definition: os3support.h:123
#define IDoMethod
Definition: os3support.h:169
#define DevNameFromLock(A, B, C, D)
Definition: os3support.h:162
#define FOpen(A, B, C)
Definition: os3support.h:158
#define IsMinListEmpty(L)
Definition: os3support.h:54
#define FClose(A)
Definition: os3support.h:159
Interface to utility string handling.
Browser window data.
struct Node node
Definition: download.h:33
char * filename
Definition: download.h:34
first entry in window list
Definition: gui.c:297
char * url
Definition: gui.h:154
int tab
Definition: gui.c:299
struct fbtk_widget_s * window
Definition: gui.h:33
struct browser_window * bw
The 'content' window that is rendered in the gui_window.
Definition: gui.c:315
High-level cache handle.
Definition: hlcache.c:66
ULONG Type
Definition: object.h:45
void * objstruct
Definition: object.h:46
Option reading and saving interface.
#define nsoption_charp(OPTION)
Get the value of a string option.
Definition: nsoption.h:331
#define nsoption_bool(OPTION)
Get the value of a boolean option.
Definition: nsoption.h:304
Version information interface.