summaryrefslogtreecommitdiff
path: root/module/grid
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2006-12-22 20:52:35 +0000
committerCharles.Forsyth <devnull@localhost>2006-12-22 20:52:35 +0000
commit46439007cf417cbd9ac8049bb4122c890097a0fa (patch)
tree6fdb25e5f3a2b6d5657eb23b35774b631d4d97e4 /module/grid
parent37da2899f40661e3e9631e497da8dc59b971cbd0 (diff)
20060303-partial
Diffstat (limited to 'module/grid')
-rw-r--r--module/grid/announce.m5
-rw-r--r--module/grid/browse.m43
-rw-r--r--module/grid/browser.m97
-rw-r--r--module/grid/demo/block.m14
-rw-r--r--module/grid/demo/exproc.m7
-rw-r--r--module/grid/fbrowse.m13
-rw-r--r--module/grid/pathreader.m3
-rw-r--r--module/grid/readjpg.m95
-rw-r--r--module/grid/regpoll.m6
-rw-r--r--module/grid/srvbrowse.m16
10 files changed, 299 insertions, 0 deletions
diff --git a/module/grid/announce.m b/module/grid/announce.m
new file mode 100644
index 00000000..a205c30c
--- /dev/null
+++ b/module/grid/announce.m
@@ -0,0 +1,5 @@
+Announce: module {
+ PATH: con "/dis/grid/lib/announce.dis";
+ init: fn();
+ announce: fn(): (string, ref Sys->Connection); # find a local address, any port, and return its name and an announced connection.
+};
diff --git a/module/grid/browse.m b/module/grid/browse.m
new file mode 100644
index 00000000..8c96817e
--- /dev/null
+++ b/module/grid/browse.m
@@ -0,0 +1,43 @@
+Browse: module
+{
+ PATH: con "/dis/grid/lib/browse.dis";
+
+ # panetype
+ SINGLEPANE: con 1; # does not work yet
+ SPLITPANE: con 2;
+ # filetype
+ DIRSONLY: con 3;
+ FILESONLY: con 4;
+ FILESORDIRS: con 5;
+ # selecttype
+ SINGLE: con 1;
+ MULTI: con 2;
+ SELECT: con 1;
+ TOGGLE: con 2;
+ NONE: con 3;
+ opened : list of string;
+ init : fn (top: ref Tk->Toplevel, rlabel, root: string, ptype, ftype, stype: int, pathrd : PathReader);
+ getselectedpath : fn (pane: int): string;
+ refresh : fn (top: ref Tk->Toplevel);
+ gotofile : fn (top: ref Tk->Toplevel, path:string, pnum: int);
+ opendir : fn (top: ref Tk->Toplevel, path, tkpath: string);
+ changepane : fn (top: ref Tk->Toplevel, ptype: int);
+ resizewin : fn (top: ref Tk->Toplevel, width, height: int);
+ selectfile : fn (top: ref Tk->Toplevel, pane, action: int, path, tkpath: string);
+ setscrollr : fn (top: ref Tk->Toplevel);
+ getpnum : fn (tkpath: string): int;
+ pane1see : fn (top: ref Tk->Toplevel);
+ gotopath : fn (top: ref Tk->Toplevel, dir: string, openfinal, pnum: int): string;
+ getpath : fn (top: ref Tk->Toplevel, f: string): string;
+ prevpath : fn (path: string): string;
+ setcentre : fn (top1, top2: ref Tk->Toplevel);
+ addselection : fn (top: ref Tk->Toplevel, file: string, val, args, dups: int, sval, sargs: string): string;
+ delselection : fn (top: ref Tk->Toplevel, n: string): string;
+ newfl : fn (top: ref Tk->Toplevel, rlabel, root: string);
+ setc3frame : fn (top: ref Tk->Toplevel, frame: string);
+ doargs : fn (top: ref Tk->Toplevel, lst: list of string);
+ getselected : fn (top: ref Tk->Toplevel, frame: string): list of (string, string, string);
+ movdiv : fn (top: ref Tk->Toplevel, x: int);
+ dialog : fn (ctxt: ref draw->Context, oldtop: ref Tk->Toplevel, butlist: list of string, title, msg: string): int;
+ getc3frame : fn (): string;
+}; \ No newline at end of file
diff --git a/module/grid/browser.m b/module/grid/browser.m
new file mode 100644
index 00000000..78dadebe
--- /dev/null
+++ b/module/grid/browser.m
@@ -0,0 +1,97 @@
+Browser: module {
+
+ PATH: con "/dis/grid/lib/browser.dis";
+
+ DESELECT: con 0;
+ SELECT: con 1;
+ TOGGLE: con 2;
+ OPEN: con 3;
+ CLOSE: con 4;
+
+ init: fn ();
+ dialog: fn (ctxt: ref draw->Context, oldtop: ref Tk->Toplevel, butlist: list of string, title, msg: string): int;
+ prevpath: fn (path: string): string;
+ setcentre: fn (top1, top2: ref Tk->Toplevel);
+
+ Browse: adt {
+ new: fn (top: ref Tk->Toplevel, tkchanname, root, rlabel: string, nopanes: int, reader: PathReader): ref Browse;
+ refresh: fn (b: self ref Browse);
+ defaultaction: fn (b: self ref Browse, lst: list of string, f: ref File);
+ getpath: fn (b: self ref Browse, tkpath: string): ref File;
+ opendir: fn (b: self ref Browse, file: File, tkpath: string, action: int): int;
+ newroot: fn (b: self ref Browse, root, rlabel: string);
+ changeview: fn (b: self ref Browse, nopanes: int);
+ selectfile: fn (b: self ref Browse, pane, action: int, file: File, tkpath: string);
+ gotoselectfile: fn (b: self ref Browse, file: File): string;
+ gotopath: fn (b: self ref Browse, dir: File, openfinal: int): (File, string);
+ getselected: fn (b: self ref Browse, pane: int): File;
+ addopened: fn (b: self ref Browse, file: File, add: int);
+ showpath: fn (b: self ref Browse, on: int);
+ resize: fn (b: self ref Browse);
+ top: ref Tk->Toplevel;
+ tkchan: string;
+ bgnorm, bgselect: string;
+ nopanes: int;
+ selected: array of Selected;
+ opened: list of File;
+ root, rlabel: string;
+ reader: PathReader;
+ pane1: File;
+ pane0width: string;
+ width: int;
+ showpathlabel: int;
+ released: int;
+ };
+
+ SELECTED: con 0;
+ UNSELECTED: con 1;
+ ALL: con 2;
+
+ Select: adt {
+ new: fn (top: ref Tk->Toplevel, tkchanname: string): ref Select;
+ addframe: fn (s: self ref Select, fname, title: string);
+ showframe: fn (s: self ref Select, fname: string);
+ delframe: fn (s: self ref Select, fname: string);
+ addselection: fn (s: self ref Select, fname, text: string, lp: list of ref Parameter, allowdups: int): string;
+ delselection: fn (s: self ref Select, fname, tkpath: string);
+ getselection: fn (s: self ref Select, fname: string): list of (string, list of ref Parameter);
+ getselected: fn (s: self ref Select, fname: string): string;
+ select: fn (s: self ref Select, fname, tkpath: string, action: int);
+ defaultaction: fn (s: self ref Select, lst: list of string);
+ resize: fn (s: self ref Select, width, height: int);
+ setscrollr: fn (s: self ref Select, fname: string);
+ top: ref Tk->Toplevel;
+ tkchan: string;
+ currfname, currfid: string;
+ frames: list of ref Frame;
+ };
+
+ Frame: adt {
+ name: string;
+ path: string;
+ selected: string;
+ };
+
+ Parameter: adt {
+ pick {
+ ArgIn =>
+ name, initval: string;
+ ArgOut =>
+ name, val: string;
+ IntIn =>
+ min, max, initval: int;
+ IntOut =>
+ val: int;
+ }
+ };
+
+ File: adt {
+ eq: fn (a,b: File): int;
+ path, qid: string;
+ };
+
+ Selected: adt {
+ file: File;
+ tkpath: string;
+ };
+}; \ No newline at end of file
diff --git a/module/grid/demo/block.m b/module/grid/demo/block.m
new file mode 100644
index 00000000..a20ab87a
--- /dev/null
+++ b/module/grid/demo/block.m
@@ -0,0 +1,14 @@
+Block : module
+{
+ PATH: con "/dis/grid/demo/block.dis";
+
+ init : fn (pathname: string, ep: Exproc);
+ slave : fn ();
+ writedata : fn (s: string);
+ masterinit : fn (noblocks: int);
+ reader : fn (noblocks: int, chanout: chan of string, sync: chan of int);
+ makefile : fn (block: int, let: string): string;
+ err : fn (s: string);
+ cleanfiles : fn (delpath: string);
+ isin : fn (l: list of string, s: string): int;
+}; \ No newline at end of file
diff --git a/module/grid/demo/exproc.m b/module/grid/demo/exproc.m
new file mode 100644
index 00000000..f4b7ec04
--- /dev/null
+++ b/module/grid/demo/exproc.m
@@ -0,0 +1,7 @@
+Exproc : module
+{
+ getslavedata : fn (lst: list of string);
+ doblock : fn (block: int, bpath: string);
+ readblock : fn (block: int, dir: string, chanout: chan of string): int;
+ finish : fn (waittime: int, tkchan: chan of string);
+}; \ No newline at end of file
diff --git a/module/grid/fbrowse.m b/module/grid/fbrowse.m
new file mode 100644
index 00000000..61107d20
--- /dev/null
+++ b/module/grid/fbrowse.m
@@ -0,0 +1,13 @@
+FBrowse : module
+{
+ PATH: con "/dis/grid/lib/fbrowse.dis";
+ NOTHING: con 0;
+ RUN: con 1;
+ OPEN: con 2;
+ WRITE: con 3;
+ ERROR: con -1;
+
+ init : fn (ctxt : ref Draw->Context, title, root, currdir: string): string;
+ readpath : fn (dir: Browser->File): (array of ref sys->Dir, int);
+};
+
diff --git a/module/grid/pathreader.m b/module/grid/pathreader.m
new file mode 100644
index 00000000..7ec4f0f4
--- /dev/null
+++ b/module/grid/pathreader.m
@@ -0,0 +1,3 @@
+PathReader : module {
+ readpath: fn (dir: Browser->File): (array of ref sys->Dir, int);
+}; \ No newline at end of file
diff --git a/module/grid/readjpg.m b/module/grid/readjpg.m
new file mode 100644
index 00000000..4576381c
--- /dev/null
+++ b/module/grid/readjpg.m
@@ -0,0 +1,95 @@
+Readjpg: module
+{
+
+ PATH: con "/dis/grid/readjpg.dis";
+
+ ImageSource: adt
+ {
+ width: int;
+ height: int;
+ origw: int;
+ origh: int;
+ i: int;
+ jstate: ref Jpegstate;
+ data: array of byte;
+ };
+
+ Jpegstate: adt
+ {
+ # variables in i/o routines
+ sr: int; # shift register, right aligned
+ cnt: int; # # bits in right part of sr
+
+ Nf: int;
+ comp: array of Framecomp;
+ mode: byte;
+ X,Y: int;
+ qt: array of array of int; # quantization tables
+ dcht: array of ref Huffman;
+ acht: array of ref Huffman;
+ Ns: int;
+ scomp: array of Scancomp;
+ Ss: int;
+ Se: int;
+ Ah: int;
+ Al: int;
+ ri: int;
+ nseg: int;
+ nblock: array of int;
+
+ # progressive scan
+ dccoeff: array of array of int;
+ accoeff: array of array of array of int; # only need 8 bits plus quantization
+ nacross: int;
+ ndown: int;
+ Hmax: int;
+ Vmax: int;
+ };
+
+ Huffman: adt
+ {
+ bits: array of int;
+ size: array of int;
+ code: array of int;
+ val: array of int;
+ mincode: array of int;
+ maxcode: array of int;
+ valptr: array of int;
+ # fast lookup
+ value: array of int;
+ shift: array of int;
+ };
+
+ Framecomp: adt # Frame component specifier from SOF marker
+ {
+ C: int;
+ H: int;
+ V: int;
+ Tq: int;
+ };
+
+ Scancomp: adt # Frame component specifier from SOF marker
+ {
+ C: int;
+ tdc: int;
+ tac: int;
+ };
+
+ # Constants, all preceded by byte 16rFF
+ SOF: con 16rC0; # Start of Frame
+ SOF2: con 16rC2; # Start of Frame; progressive Huffman
+ DHT: con 16rC4; # Define Huffman Tables
+ RST: con 16rD0; # Restart interval termination
+ SOI: con 16rD8; # Start of Image
+ EOI: con 16rD9; # End of Image
+ SOS: con 16rDA; # Start of Scan
+ DQT: con 16rDB; # Define quantization tables
+ DNL: con 16rDC; # Define number of lines
+ DRI: con 16rDD; # Define restart interval
+ APPn: con 16rE0; # Reserved for application segments
+ COM: con 16rFE; # Comment
+
+ init : fn (disp: ref Draw->Display);
+ fjpg2img : fn (fd: ref sys->FD, cachepath: string, chanin, chanout: chan of string): ref Image;
+ jpg2img : fn (filename, cachepath: string, chanin, chanout: chan of string): ref Image;
+}; \ No newline at end of file
diff --git a/module/grid/regpoll.m b/module/grid/regpoll.m
new file mode 100644
index 00000000..22ef09d2
--- /dev/null
+++ b/module/grid/regpoll.m
@@ -0,0 +1,6 @@
+RegPoll : module {
+ PATH: con "/usr/danny/res/regpoll.dis";
+
+ STOPPED, STARTED, ERROR: con iota;
+ init : fn (regaddr: string): (chan of int, chan of int);
+};
diff --git a/module/grid/srvbrowse.m b/module/grid/srvbrowse.m
new file mode 100644
index 00000000..a1da02f3
--- /dev/null
+++ b/module/grid/srvbrowse.m
@@ -0,0 +1,16 @@
+Srvbrowse: module
+{
+ PATH: con "/dis/grid/lib/srvbrowse.dis";
+
+ services : list of ref Registries->Service;
+
+ init : fn ();
+ refreshservices : fn (filter: list of list of (string, string));
+ servicepath2Service : fn (path, qid: string): list of ref Registries->Service;
+ servicepath2Dir : fn (path: string, qid: int): (array of ref sys->Dir, int);
+ getresname : fn (srvc: ref Registries->Service): (string, string);
+ getqid : fn (srvc: ref Registries->Service): string;
+ find : fn (filter: list of list of (string, string)): list of ref Registries->Service;
+ addservice: fn (srvc: ref Registries->Service);
+ searchwin: fn (ctxt: ref Draw->Context, chanout: chan of string, filter: list of list of (string, string));
+}; \ No newline at end of file