Add commands BACK, FORWARD, HOME and RELOAD to correspond with the buttons on the GUI.

svn path=/trunk/netsurf/; revision=10628
This commit is contained in:
Chris Young 2010-07-11 15:34:35 +00:00
parent f6f1fe1cee
commit 1c48e85ce9
2 changed files with 63 additions and 2 deletions

View File

@ -43,7 +43,11 @@ enum
RX_GETTITLE,
RX_VERSION,
RX_SAVE,
RX_PUBSCREEN
RX_PUBSCREEN,
RX_BACK,
RX_FORWARD,
RX_HOME,
RX_RELOAD
};
STATIC char result[100];
@ -56,6 +60,10 @@ STATIC VOID rx_gettitle(struct ARexxCmd *, struct RexxMsg *);
STATIC VOID rx_version(struct ARexxCmd *, struct RexxMsg *);
STATIC VOID rx_save(struct ARexxCmd *, struct RexxMsg *);
STATIC VOID rx_pubscreen(struct ARexxCmd *, struct RexxMsg *);
STATIC VOID rx_back(struct ARexxCmd *, struct RexxMsg *);
STATIC VOID rx_forward(struct ARexxCmd *, struct RexxMsg *);
STATIC VOID rx_home(struct ARexxCmd *, struct RexxMsg *);
STATIC VOID rx_reload(struct ARexxCmd *, struct RexxMsg *);
STATIC struct ARexxCmd Commands[] =
{
@ -67,6 +75,10 @@ STATIC struct ARexxCmd Commands[] =
{"VERSION",RX_VERSION,rx_version,"VERSION/N,SVN=REVISION/N,RELEASE/S", 0, NULL, 0, 0, NULL },
{"SAVE",RX_SAVE,rx_save,"FILENAME/A", 0, NULL, 0, 0, NULL },
{"GETSCREENNAME",RX_PUBSCREEN,rx_pubscreen,NULL, 0, NULL, 0, 0, NULL },
{"BACK", RX_BACK, rx_back, "WINDOW/K/N, TAB/K/N", 0, NULL, 0, 0, NULL },
{"FORWARD", RX_FORWARD, rx_forward, "WINDOW/K/N, TAB/K/N", 0, NULL, 0, 0, NULL },
{"HOME", RX_HOME, rx_home, "WINDOW/K/N, TAB/K/N", 0, NULL, 0, 0, NULL },
{"RELOAD", RX_RELOAD, rx_reload, "FORCE/S, WINDOW/K/N, TAB/K/N", 0, NULL, 0, 0, NULL },
{ NULL, 0, NULL, NULL, 0, NULL, 0, 0, NULL }
};
@ -280,3 +292,48 @@ STATIC VOID rx_pubscreen(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__
cmd->ac_Result = result;
}
STATIC VOID rx_back(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unused)))
{
if(curbw)
{
if(browser_window_back_available(curbw))
{
history_back(curbw, curbw->history);
}
}
}
STATIC VOID rx_forward(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unused)))
{
if(curbw)
{
if(browser_window_forward_available(curbw))
{
history_forward(curbw, curbw->history);
}
}
}
STATIC VOID rx_home(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unused)))
{
if(curbw)
{
browser_window_go(curbw, option_homepage_url, NULL, true);
}
}
STATIC VOID rx_reload(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unused)))
{
if(curbw)
{
if(cmd->ac_ArgList[0]) /* FORCE */
{
browser_window_reload(curbw, true);
}
else
{
browser_window_reload(curbw, false);
}
}
}

View File

@ -77,7 +77,11 @@ Commands are:
@{b}TOFRONT@{ub} Brings NetSurf's screen to the front
@{b}GETURL@{ub} Puts the URL displayed in the current window/tab into RESULT
@{b}GETTITLE@{ub} Puts the title of the page displayed in the current window/tab into RESULT
@{b}GETSCREENNAME@{ub} (3.8303) Puts the name of the screen NetSurf is running on into RESULT.
@{b}GETSCREENNAME@{ub} (2.8303) Puts the name of the screen NetSurf is running on into RESULT.
@{b}BACK@{ub} (2.10626) Move back one page in history.
@{b}FORWARD@{ub} (2.10626) Move forward one page in history.
@{b}HOME@{ub} (2.10626) Move back to the home page.
@{b}RELOAD FORCE/S@{ub} (2.10626) Reload the current page, FORCE will do a full reload.
@{b}VERSION VERSION/N REVISION/N RELEASE/S@{ub} Returns the current version of NetSurf in RESULT. You can also do version checking by supplying a VERSION and optional REVISION to check against. If the version of NetSurf is the same or higher 1 will be returned, if it is older 0. If RELEASE is specified, the command operates on the release version rather than the internal version number.
The ARexx menu will be populated with scripts named #?.nsrx in @{"arexx_dir" link options 9}, up to a maximum of 20 entries. The titles of these entries will be the comments field of the file (or the filename if comments field is empty).