[Henning, you may be interested: the patch implements a --reload option] Hi, To implement the server and remote commands feature in Dillo, I'm going to go step by step. First, I'll implement commands to control Dillo at startup time, then I'll implement the server mode (where a Dillo instance can send the aforementioned commands to another Dillo instance). This is because I may try two differents approaches for the server mode part and because the commands are just a generalization of the command line options and can be implemented separately. Here is my first step: implement commands (like -c "open(URL)"). Patch is attached and is against CVS version. This is a generalization of the command line interface, and in fact, most of the old command line options are translated to a Dillo -c command. The advantage of such approach is that the commands can take optional parameters, like in: dillo -c "open(URL newwindow reload=10 fullwindow=yes)" which is approximately equivalent to: dillo -f -r 10 URL The commands are passed to Dillo as arguments to the -c, --command command line option: dillo -c "open(http://www.google.com)" 1. Command Syntax The argument to the -c command line option is of the form: CMD([STRING][ PARAM=VALUE]...) CMD: command name STRING: first and generic argument: in general a URL or yes|no PARAM: name of optional parameter VALUE: value of optional parameter. Currently, only booleans (yes|no) and integer values are supported. Boolean value can be omitted, in which case the value is considered to be "yes". Integer value cannot be omitted. Parameters are separated with a single space (no commas, to simplify the parser) Commands can be divided into two groups: actions commands, and options commands 2. Action Commands: They do some action: currently implemented commands: open(URL [ fullwindow[=yes|no]] [ reload=SECONDS] [ spamsafe[=yes|no]] [ xid=XID]) parameters speak for themselves. The "reload" parameter is a new feature: it allows to reload the URL each SECONDS seconds. The reload is halted when the page is not viewed and restarted if the user comes back to it. exit() exit the instance. This will be useful when passed to another Dillo instance running as a server. Other commands can be added. The framework is quite flexible and extensible. 3. Options Commands These commands set some options that will affect the following commands. For example, the parameters used in the open() command act only on that particular URL. But it can be useful to be able to set some defaults values. The currently implemented commands that influence these defaults are: fullwindow([yes|no]) reload(SECONDS) spamsafe([yes|no]) xid(XID) all open() commands that come after these options commands will have these default values, unless explicitly overridden. 4. Examples: dillo -c "open(http://www.google.com)" -c "open(file:///home/mhadasht/test.html newwindow spamsafe)" will open two windows: the first with google, and the second with the local file opened in spamsafe mode. dillo -c "reload(10)" -c "open(http://www.freshmeat.net)" -c "open(http://news.google.com newwindow)" will open 2 windows and will reload both URLs each 10s. This is equivalent to: dillo --reload 10 http://www.freshmeat.net http://news.google.com 5. Implementation details: 5.1. Command Line Parsing Command line options other than the help/version options are translated into a -c command and stored in a list. The list of commands is then executed (or, when the server mode will is implemented, sent to another Dillo instance) 5.2. Reload Function a URL can be set to auto-reload itself if it is currently viewed. For that, a new member (reload_interval [milliseconds]) to DilloUrl is added and set with a_Url_set_reload(). Each BrowserWindow can trigger a timer function if the viewed URL (Nav_open_url()) has a non-zero reload_interval. (As soon as another URL is viewed, or when the BrowserWindow is destroyed, the eventually pending timeout function is removed.) The timer is of the one-shot type: when it is triggered, it requests its BrowserWindow to reload the URL, then it stops itself. There is currently no UI to start/stop an auto-reload of a URL, but it is just a matter of using a_Url_set_reload() to a non-zero or a zero reload interval. 6. Remark The -c command and the normal command line options can be seen as two ways of doing the same thing: passing commands to Dillo. But the -c command is more generic and flexible and has a more powerful syntax. 7. Future Plans I plan to implement the server mode. After reading the dpi doc and source, I found that it cannot be used to make Dillo act as a plugin unless we accept to have only one Dillo server. This is because the socket names are tightly linked to the service name. Each service has only one socket. Whereas Dillo servers must have a distinct socket. If the we add another argument to the "start_plugin" cmd: <dpi cmd="start_plugin" msg="dillo" param="SERVER_NAME"> and if we modify the socket naming scheme, then it could be possible. I have to think about that again. But I may still use the communication infrastructure of the dpi. If I find this overkill, I'll revert to the straightforward approach I used before, that is, I won't use the dpi framework. OK, it's late, I hope I managed to be somewhat clear... Cheers. -- Melvin Hadasht