wmclient.m 1.4 KB

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