include "sys.m"; include "draw.m"; include "wmlib.m"; wmlib := load Wmlib Wmlib->PATH; init: fn(); connect: fn(ctxt: ref Draw->Context): ref Draw->Wmcontext; startinput: fn(w: ref Draw->Wmcontext, devs: list of string): string; wmctl: fn(w: ref Draw->Wmcontext, request: string): (string, ref Draw->Image, string); snarfput: fn(buf: string); snarfget: fn(): string;
Init should be called once to initialise the internal state of Wmlib. Connect makes a connection to the window manager through ctxt (see draw-context(2)). Startinput tells the window manager to start queuing events on the input streams named in devs (e.g. ptr, kbd) so that they can be received by the application.
Wmctl sends request to the window manager. It returns a tuple, say (name, img, err). If a request fails, then name and img will be nil and the non-empty err gives the reason. If the request has resized or created an image, name gives the tag name of the image and img holds the new image. Wmlib interprets the exit request itself, by killing all processes in the current process group, and exiting.
Snarfget and snarfput retrieve and replace the contents of the window manager's snarf buffer.
|WMLIB(2 )||Rev: Tue Mar 31 02:42:39 GMT 2015|