xref: /inferno-os/module/wmclient.m (revision 46439007cf417cbd9ac8049bb4122c890097a0fa)
1Wmclient: module
2{
3	PATH:		con "/dis/lib/wmclient.dis";
4
5	Resize,
6	Hide,
7	Help,
8	OK,
9	Popup,
10	Plain:		con 1 << iota;
11	Appl:		con Resize | Hide;
12
13	init:		fn();
14	makedrawcontext: fn(): ref Draw->Context;
15	window:		fn(ctxt: ref Draw->Context, title: string, buts: int): ref Window;
16	snarfput:		fn(buf: string);
17	snarfget:		fn(): string;
18	cursorspec:	fn(img: ref Draw->Image): string;
19
20	Window: adt{
21		display:	ref Draw->Display;
22		r: Draw->Rect;		# full rectangle of window, including titlebar.
23		image: ref Draw->Image;
24		displayr: Draw->Rect;
25		ctxt: ref Draw->Wmcontext;
26		bd:		int;
27		focused:	int;
28		ctl:		chan of string;
29
30		# private from here:
31		titlebar:	ref Tk->Toplevel;		# XXX i wish this didn't have to be visible to the application...
32		tbsize: 	Draw->Point;			# size requested by titlebar.
33		tbrect:	Draw->Rect;
34		screen:	ref Draw->Screen;
35		buttons:	int;
36		ptrfocus:	int;
37		saved:	Draw->Point;			# saved origin before task
38
39		startinput:	fn(w: self ref Window, devs: list of string);
40		wmctl:	fn(w: self ref Window, request: string): string;
41		settitle:	fn(w: self ref Window, name: string): string;
42		reshape:	fn(w: self ref Window, r: Draw->Rect);
43		onscreen:	fn(w: self ref Window, how: string);
44		screenr:	fn(w: self ref Window, sr: Draw->Rect): Draw->Rect;
45		imager:	fn(w: self ref Window, ir: Draw->Rect): Draw->Rect;
46		pointer:	fn(w: self ref Window, p: Draw->Pointer): int;
47	};
48
49};
50