NetSurf
arexx.c
Go to the documentation of this file.
1/*
2 * Copyright 2008-2025 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 {
306 int flags = BW_CREATE_TAB;
307 if(cmd->ac_ArgList[6]) {
308 flags |= BW_CREATE_FOREGROUND;
309 }
311 flags,
312 url,
313 NULL,
315 NULL);
316
317
318 }
319 }
320 else if(cmd->ac_ArgList[1])
321 {
323 url,
324 NULL,
325 NULL,
326 NULL);
327 }
328 else
329 {
330 if(gw)
331 {
333 url,
334 NULL,
336 NULL,
337 NULL,
338 NULL);
339 }
340 else
341 {
343 url,
344 NULL,
345 NULL,
346 NULL);
347 }
348 }
350}
351
352RXHOOKF(rx_save)
353{
354 BPTR fh = 0;
355 struct gui_window *gw = ami_gui_get_active_gw();
356
357 cmd->ac_RC = 0;
358
359 if((cmd->ac_ArgList[1]) && (cmd->ac_ArgList[2]))
360 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[1], *(ULONG *)cmd->ac_ArgList[2]);
361
362 if(!gw) return;
363
365
366 if((fh = FOpen((char *)cmd->ac_ArgList[0], MODE_NEWFILE, 0)))
367 {
368 const uint8_t *source_data;
369 size_t source_size;
371 source_data = content_get_source_data(h, &source_size);
372 if (source_data != NULL) {
373 FWrite(fh, source_data, 1, source_size);
374 }
375
376 FClose(fh);
377 SetComment((char *)cmd->ac_ArgList[0], nsurl_access(browser_window_access_url(ami_gui_get_browser_window(gw))));
378 }
379
381}
382
383RXHOOKF(rx_quit)
384{
385 cmd->ac_RC = 0;
387}
388
389RXHOOKF(rx_tofront)
390{
391 cmd->ac_RC = 0;
392 ScreenToFront(ami_gui_get_screen());
393}
394
395RXHOOKF(rx_geturl)
396{
397 struct gui_window *gw = ami_gui_get_active_gw();
398
399 cmd->ac_RC = 0;
400
401 if((cmd->ac_ArgList[0]) && (cmd->ac_ArgList[1]))
402 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[0], *(ULONG *)cmd->ac_ArgList[1]);
403
404 if(gw && ami_gui_get_browser_window(gw))
405 {
407 }
408 else
409 {
410 strcpy(result,"");
411 }
412
413 cmd->ac_Result = result;
414}
415
416RXHOOKF(rx_gettitle)
417{
418 struct gui_window *gw = ami_gui_get_active_gw();
419
420 cmd->ac_RC = 0;
421
422 if((cmd->ac_ArgList[0]) && (cmd->ac_ArgList[1]))
423 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[0], *(ULONG *)cmd->ac_ArgList[1]);
424
425 if(gw)
426 {
428 strcpy(result, ami_gui_get_tab_title(gw));
429 else
430 strcpy(result, ami_gui_get_win_title(gw));
431 }
432 else
433 {
434 strcpy(result,"");
435 }
436
437 cmd->ac_Result = result;
438}
439
440RXHOOKF(rx_version)
441{
442 cmd->ac_RC = 0;
443
444 if(cmd->ac_ArgList[2])
445 {
446 if(cmd->ac_ArgList[1])
447 {
448 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])))
449 {
450 strcpy(result,"1");
451 }
452 else
453 {
454 strcpy(result,"0");
455 }
456 }
457 else if(cmd->ac_ArgList[0])
458 {
459 if((netsurf_version_major >= *(int *)cmd->ac_ArgList[0]))
460 {
461 strcpy(result,"1");
462 }
463 else
464 {
465 strcpy(result,"0");
466 }
467 }
468 else
469 {
470 strcpy(result,netsurf_version);
471 }
472 }
473 else
474 {
475 if(cmd->ac_ArgList[1])
476 {
477 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])))
478 {
479 strcpy(result,"1");
480 }
481 else
482 {
483 strcpy(result,"0");
484 }
485 }
486 else if(cmd->ac_ArgList[0])
487 {
488 if((netsurf_version_major >= *(int *)cmd->ac_ArgList[0]))
489 {
490 strcpy(result,"1");
491 }
492 else
493 {
494 strcpy(result,"0");
495 }
496 }
497 else
498 {
499 strcpy(result,verarexx);
500 }
501 }
502
503 cmd->ac_Result = result;
504}
505
506RXHOOKF(rx_pubscreen)
507{
508 cmd->ac_RC = 0;
509
510 if(nsoption_charp(pubscreen_name) == NULL)
511 {
512 strcpy(result,"NetSurf");
513 }
514 else
515 {
516 strcpy(result, nsoption_charp(pubscreen_name));
517 }
518
519 cmd->ac_Result = result;
520}
521
522RXHOOKF(rx_back)
523{
524 struct gui_window *gw = ami_gui_get_active_gw();
525
526 cmd->ac_RC = 0;
527
528 if((cmd->ac_ArgList[0]) && (cmd->ac_ArgList[1]))
529 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[0], *(ULONG *)cmd->ac_ArgList[1]);
530
532}
533
534RXHOOKF(rx_forward)
535{
536 struct gui_window *gw = ami_gui_get_active_gw();
537
538 cmd->ac_RC = 0;
539
540 if((cmd->ac_ArgList[0]) && (cmd->ac_ArgList[1]))
541 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[0], *(ULONG *)cmd->ac_ArgList[1]);
542
543 if(gw) ami_gui_history(ami_gui_get_gui_window_2(gw), false);
544
545}
546
547RXHOOKF(rx_home)
548{
549 struct gui_window *gw = ami_gui_get_active_gw();
550 nsurl *url;
551
552 cmd->ac_RC = 0;
553
554 if((cmd->ac_ArgList[0]) && (cmd->ac_ArgList[1]))
555 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[0], *(ULONG *)cmd->ac_ArgList[1]);
556
557 if(gw == NULL) return;
558
559 if (nsurl_create(nsoption_charp(homepage_url), &url) != NSERROR_OK) {
560 amiga_warn_user("NoMemory", 0);
561 } else {
563 url,
564 NULL,
566 NULL,
567 NULL,
568 NULL);
570 }
571}
572
573RXHOOKF(rx_reload)
574{
575 struct gui_window *gw = ami_gui_get_active_gw();
576
577 cmd->ac_RC = 0;
578
579 if((cmd->ac_ArgList[1]) && (cmd->ac_ArgList[2]))
580 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[1], *(ULONG *)cmd->ac_ArgList[2]);
581
582 if(gw)
583 {
584 if(cmd->ac_ArgList[0]) /* FORCE */
585 {
587 }
588 else
589 {
591 }
592 }
593}
594
595RXHOOKF(rx_windows)
596{
597 int windows = 0, tabs = 0;
598 int window = 0;
599
600 if(cmd->ac_ArgList[0]) window = *(ULONG *)cmd->ac_ArgList[0];
601 cmd->ac_RC = 0;
602
603 windows = ami_gui_count_windows(window, &tabs);
604
605 if(cmd->ac_ArgList[0]) sprintf(result, "%d", tabs);
606 else sprintf(result, "%d", windows);
607 cmd->ac_Result = result;
608}
609
610RXHOOKF(rx_active)
611{
612 int window = 0, tab = 0;
613 struct gui_window *gw = ami_gui_get_active_gw();
614 struct nsObject *node, *nnode;
615 struct gui_window_2 *gwin = NULL;
616 struct MinList *window_list = ami_gui_get_window_list();
617
618 cmd->ac_RC = 0;
619
621 {
622 int windows = 0;
623
624 node = (struct nsObject *)GetHead((struct List *)window_list);
625
626 do
627 {
628 nnode=(struct nsObject *)GetSucc((struct Node *)node);
629
630 gwin = node->objstruct;
631
632 if(node->Type == AMINS_WINDOW)
633 {
634 windows++;
635 if(IS_CURRENT_GW(gwin,gw))
636 {
637 window = windows;
638 break;
639 }
640 }
641 } while((node = nnode));
642 }
643
644 if(cmd->ac_ArgList[0])
645 {
647 }
648
649 if(cmd->ac_ArgList[0]) sprintf(result, "%d", tab);
650 else sprintf(result, "%d", window);
651 cmd->ac_Result = result;
652}
653
654RXHOOKF(rx_close)
655{
656 struct gui_window *gw = ami_gui_get_active_gw();
657
658 cmd->ac_RC = 0;
659
660 if((cmd->ac_ArgList[0]) && (cmd->ac_ArgList[1]))
661 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[0], *(ULONG *)cmd->ac_ArgList[1]);
662 else if(cmd->ac_ArgList[0])
663 {
665 return;
666 }
667
669}
670
671RXHOOKF(rx_hotlist)
672{
673 cmd->ac_RC = 0;
674
675 if(strcasecmp((char *)cmd->ac_ArgList[0], "OPEN") == 0) {
677 } else if(strcasecmp((char *)cmd->ac_ArgList[0], "CLOSE") == 0) {
679 }
680}
681
682RXHOOKF(rx_exec)
683{
684 struct gui_window *gw = ami_gui_get_active_gw();
685 bool res = false;
686
687 if(nsoption_bool(arexx_allow_exec) == false) {
688 cmd->ac_RC = RETURN_FAIL;
689 return;
690 }
691
692 if((cmd->ac_ArgList[0]) && (cmd->ac_ArgList[1]))
693 gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[0], *(ULONG *)cmd->ac_ArgList[1]);
694
695 if(gw) {
696 NSLOG(netsurf, WARNING, "Executing js: %s", (char *)cmd->ac_ArgList[2]);
698 (char *)cmd->ac_ArgList[2], strlen((char *)cmd->ac_ArgList[2]));
699 }
700
701 if(res == false) {
702 cmd->ac_RC = RETURN_ERROR;
703 } else {
704 cmd->ac_RC = RETURN_OK;
705 }
706
707}
708
709RXHOOKF(rx_slabstats)
710{
711#ifndef __amigaos4__
712 BPTR fh = 0;
713
714 if(cmd->ac_ArgList[0] != NULL) {
715 fh = Open((char *)cmd->ac_ArgList[0], MODE_NEWFILE);
716 }
718
719 if(fh != 0) Close(fh);
720#endif
721}
722
static ULONG rxsig
Definition: gui.c:349
struct Screen * ami_gui_get_screen(void)
Get a pointer to the screen NetSurf is running on.
Definition: gui.c:405
void ami_gui_history(struct gui_window_2 *gwin, bool back)
Definition: gui.c:1690
void ami_gui_close_window(void *w)
Close a window and all tabs attached to it.
Definition: gui.c:5473
void ami_set_pointer(struct gui_window_2 *gwin, gui_pointer_shape shape, bool update)
Definition: gui.c:690
static struct MinList * window_list
Definition: gui.c:327
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:400
void ami_reset_pointer(struct gui_window_2 *gwin)
Definition: gui.c:698
const char * ami_gui_get_win_title(struct gui_window *gw)
Get window title from gui_window.
Definition: gui.c:451
const char * ami_gui_get_tab_title(struct gui_window *gw)
Get tab title from gui_window.
Definition: gui.c:458
struct gui_window * ami_gui2_get_gui_window(struct gui_window_2 *gwin)
Get gui_window from gui_window_2.
Definition: gui.c:445
struct List * ami_gui_get_download_list(struct gui_window *gw)
Get download list from gui_window.
Definition: gui.c:433
ULONG ami_gui2_get_tabs(struct gui_window_2 *gwin)
Get tabs from gui_window_2.
Definition: gui.c:470
struct List * ami_gui2_get_tab_list(struct gui_window_2 *gwin)
Get tab list from gui_window_2.
Definition: gui.c:476
int ami_gui_count_windows(int window, int *tabs)
Count windows, and optionally tabs.
Definition: gui.c:4349
struct browser_window * ami_gui_get_browser_window(struct gui_window *gw)
Get browser window from gui_window.
Definition: gui.c:421
struct MinList * ami_gui_get_window_list(void)
Get the window list.
Definition: gui.c:410
struct gui_window_2 * ami_gui_get_gui_window_2(struct gui_window *gw)
Get gui_window_2 from gui_window.
Definition: gui.c:439
void ami_quit_netsurf(void)
Definition: gui.c:3818
#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_CREATE_FOREGROUND
Request foreground opening.
@ 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:298
char * url
Definition: gui.h:154
int tab
Definition: gui.c:300
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:316
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.