diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2008-10-25 23:22:34 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2008-10-25 23:22:34 +0000 |
commit | 30b09368e7980def81ccfd7b4038225e7ec13ed9 (patch) | |
tree | 1f3859d4a17845ad03fd96789b8e74c421527d03 /amiga/arexx.c | |
parent | 2f4beda48c9780739ecdab639b47299108265d66 (diff) | |
download | netsurf-30b09368e7980def81ccfd7b4038225e7ec13ed9.tar.gz netsurf-30b09368e7980def81ccfd7b4038225e7ec13ed9.tar.bz2 |
Track the current/last used browser window (at the moment, just for ARexx).
Extended ARexx port. First two are primarily for openurl.library:
* OPEN now takes a parameter NEW=NEWWINDOW/S to open the URL in a new window (default
is
to open in the current browser window)
* TOFRONT will bring NetSurf's screen to the front (this may be extended in the future
to bring the current browser window to the front - which might be better for when it
is running on the WB screen)
Next is to make it easy to support getvideo.rexx:
* GETURL returns the URL of the current browser window in RESULT
GetVideo.nsrx script will get the current URL and pass it to rexx:getvideo.rexx
Currently there is no way to call ARexx scripts directly from NetSurf, or any way to
specify whether to save, play or saveplay the video without editing the script.
[clipboard.c/clipboard.h were missing from previous commit]
svn path=/trunk/netsurf/; revision=5631
Diffstat (limited to 'amiga/arexx.c')
-rwxr-xr-x | amiga/arexx.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/amiga/arexx.c b/amiga/arexx.c index 51fe0b835..bbd7b9aa8 100755 --- a/amiga/arexx.c +++ b/amiga/arexx.c @@ -27,15 +27,23 @@ enum { RX_OPEN=0, RX_QUIT, + RX_TOFRONT, + RX_GETURL }; +STATIC char result[100]; + STATIC VOID rx_open(struct ARexxCmd *, struct RexxMsg *); STATIC VOID rx_quit(struct ARexxCmd *, struct RexxMsg *); +STATIC VOID rx_tofront(struct ARexxCmd *, struct RexxMsg *); +STATIC VOID rx_geturl(struct ARexxCmd *, struct RexxMsg *); STATIC struct ARexxCmd Commands[] = { - {"OPEN",RX_OPEN,rx_open,"URL/A", 0, NULL, 0, 0, NULL }, + {"OPEN",RX_OPEN,rx_open,"URL/A,NEW=NEWWINDOW/S", 0, NULL, 0, 0, NULL }, {"QUIT",RX_QUIT,rx_quit,NULL, 0, NULL, 0, 0, NULL }, + {"TOFRONT",RX_TOFRONT,rx_tofront,NULL, 0, NULL, 0, 0, NULL }, + {"GETURL",RX_GETURL,rx_geturl,NULL, 0, NULL, 0, 0, NULL }, { NULL, 0, NULL, NULL, 0, NULL, 0, 0, NULL } }; @@ -65,10 +73,29 @@ void ami_arexx_cleanup() STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unused))) { - browser_window_create((char *)cmd->ac_ArgList[0],NULL,NULL,true,false); + if(cmd->ac_ArgList[1]) + { + browser_window_create((char *)cmd->ac_ArgList[0],NULL,NULL,true,false); + } + else + { + browser_window_go(curbw,(char *)cmd->ac_ArgList[0],NULL,true); + } } STATIC VOID rx_quit(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unused))) { ami_quit_netsurf(); } + +STATIC VOID rx_tofront(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unused))) +{ + ScreenToFront(scrn); +} + +STATIC VOID rx_geturl(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unused))) +{ + strcpy(result,curbw->current_content->url); + cmd->ac_Result = result; +} + |