text.m 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. Textm : module {
  2. PATH : con "/dis/acme/text.dis";
  3. init : fn(mods : ref Dat->Mods);
  4. # Text.what
  5. Columntag, Rowtag, Tag, Body : con iota;
  6. newtext : fn() : ref Text;
  7. Text : adt {
  8. file : cyclic ref Filem->File;
  9. frame : ref Framem->Frame;
  10. reffont : ref Dat->Reffont;
  11. org : int;
  12. q0 : int;
  13. q1 : int;
  14. what : int;
  15. tabstop : int;
  16. w : cyclic ref Windowm->Window;
  17. scrollr : Draw->Rect;
  18. lastsr : Draw->Rect;
  19. all : Draw->Rect;
  20. row : cyclic ref Rowm->Row;
  21. col : cyclic ref Columnm->Column;
  22. eq0 : int; # start of typing for ESC
  23. cq0 : int; # cache position
  24. ncache : int; # storage for insert
  25. ncachealloc : int;
  26. cache : string;
  27. nofill : int;
  28. init : fn(t : self ref Text, f : ref Filem->File, r : Draw->Rect, rf : ref Dat->Reffont, cols : array of ref Draw->Image);
  29. redraw : fn(t : self ref Text, r : Draw->Rect, f : ref Draw->Font, b : ref Draw->Image, n : int);
  30. insert : fn(t : self ref Text, n : int, s : string, p : int, q : int, r : int);
  31. bsinsert : fn(t : self ref Text, n : int, s : string, p : int, q : int) : (int, int);
  32. delete : fn(t : self ref Text, n : int, p : int, q : int);
  33. loadx : fn(t : self ref Text, n : int, b : string, q : int) : int;
  34. typex : fn(t : self ref Text, r : int, echomode : int);
  35. select : fn(t : self ref Text, d : int);
  36. select2 : fn(t : self ref Text, p : int, q : int) : (int, ref Text, int, int);
  37. select3 : fn(t : self ref Text, p: int, q : int) : (int, int, int);
  38. setselect : fn(t : self ref Text, p : int, q : int);
  39. setselect0 : fn(t : self ref Text, p : int, q : int);
  40. show : fn(t : self ref Text, p : int, q : int, dosel : int);
  41. fill : fn(t : self ref Text);
  42. commit : fn(t : self ref Text, n : int);
  43. setorigin : fn(t : self ref Text, p : int, q : int);
  44. readc : fn(t : self ref Text, n : int) : int;
  45. reset : fn(t : self ref Text);
  46. reshape : fn(t : self ref Text, r : Draw->Rect) : int;
  47. close : fn(t : self ref Text);
  48. framescroll : fn(t : self ref Text, n : int);
  49. select23 : fn(t : self ref Text, p : int, q : int, i, it : ref Draw->Image, n : int) : (int, int, int);
  50. forwnl : fn(t : self ref Text, p : int, q : int) : int;
  51. backnl : fn(t : self ref Text, p : int, q : int) : int;
  52. bswidth : fn(t : self ref Text, r : int) : int;
  53. doubleclick : fn(t : self ref Text, p : int, q : int) : (int, int);
  54. clickmatch : fn(t : self ref Text, p : int, q : int, r : int, n : int) : (int, int);
  55. columnate : fn(t : self ref Text, d : array of ref Dat->Dirlist, n : int);
  56. };
  57. framescroll : fn(f : ref Framem->Frame, dl : int);
  58. setalphabet: fn(s: string);
  59. };