knotXW.sa


Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
 
-- Copyright (C) 1996 Kouji KODAMA
-- 1996/10
-- 1996/10  X Window system interface. Kouji KODAMA
-- Interface to knotXW.c

external C class KNOTXW is

	endprogram is
		-- "endprogram: Exit this program.\n";
		LOGOUT::Disconnect;
		UNIX::exit(0);
	end;

	repaint is
		-- repaint window for Expose event
		KNOTX::repaint;
	end;
	
	TrackEventM(event,button,mouseX,mouseY:INT) is
		KNOTX::TrackEventK(event,button,mouseX,mouseY);
	end;
	EditSelectM(select:INT):INT is
		return KNOTX::EditSelectK(select);
	end;
	EffectSelectM(select:INT):INT is
		return KNOTX::EffectSelectK(select);
	end;
	FilesSelectM(select:INT):INT is
		return KNOTX::FilesSelectK(select);
	end;
	InvSelectM(select:INT):INT is
		return KNOTX::InvSelectK(select);
	end;
	OtherSelectM(select:INT):INT is
		return KNOTX::OtherSelectK(select);
	end;

	
-- BraidPrim::BRAIDmaxSLen BRAIDmaxSLen:INT is -- r:INT:=#(BRAID::BRAIDmaxSLen); return 0; end; is_packBraid:BOOL is r:BOOL:=BRAID_CNV::packBraid; return r; end; spackBraid(p:INT) is BRAID_CNV::packBraid:=p.bool; end; maxNSLen:INT is return 0; -- return NDATA::maxNSLen; end; DrawKnotPic(width, height, margin, scalingMode:INT) is #OUT+"DrawKnotPic is not implemented.\n"; -- DrawKnots_DrawKnotPic end; NDataStr2Knot(str:EXT_OB):BOOL is wordStr:STR:=STR::create_from_c_string(str); res:BOOL:=NDATA_CNV::NDataStr2Knot(wordStr,inout K::Knot); if ~res then K::Knot.NoCompo0; end; return true; end; Knot2NDataStr(out str:C_PTR):BOOL is wordStr:STR:=#; res:BOOL:=NDATA_CNV::Knot2NDataStr(K::Knot,out wordStr); str:=wordStr.fstr.array.array_ptr; return res; end; BraidWord2RBraidWord(str1:EXT_OB,out str2:C_PTR):BOOL is wordStr:STR:=STR::create_from_c_string(str1); reply:BOOL:=BRAID_CNV::BraidWord2RBraidWord(inout wordStr); str2:=wordStr.fstr.array.array_ptr; return true; end; BraidWord2RArtinNormalForm(str1:EXT_OB,out str2:C_PTR):BOOL is wordStr:STR:=STR::create_from_c_string(str1); reply:BOOL:=BRAID_CNV::BraidWord2RArtinNormalForm(inout wordStr); str2:=wordStr.fstr.array.array_ptr; return true; end; Knot2BraidWord(out str:C_PTR):BOOL is -- C_CHAR_PTR or EXT_OB wordStr:STR:=#; res:BOOL:=BRAID_CNV::Knot2BraidWord(K::Knot,out wordStr); str:=wordStr.fstr.array.array_ptr; return res; end; BraidWord2Knot(str:EXT_OB):BOOL is wordStr:STR:=STR::create_from_c_string(str); res:BOOL:=BRAID_CNV::BraidWord2Knot(wordStr,inout K::Knot); if ~res then K::Knot.NoCompo0; end; return true; end; VPara(n:INT) is -- Jones poly. of n-parallel link. KNOTX::VPara(n); end; RepSearch(n,form,branchind,covlk,h1b,h1u,fndgr, covDistY,covDistBr,covDistLk, covDistH1B,covDistH1U:INT) is ------- group representation ------- KNOTX::RepSearch(n,form,branchind,covlk,h1b,h1u,fndgr, covDistY,covDistBr,covDistLk, covDistH1B,covDistH1U); end; ------- file read/write ------- ReadKnotN(str:EXT_OB):BOOL is name:STR:=STR::create_from_c_string(str); res:BOOL:=KNOTFIO::ReadKnotN(out K::Knot,name); if ~res then K::Knot.NoCompo0; end; return res; end; WriteKnotN(str:EXT_OB):BOOL is name:STR:=STR::create_from_c_string(str); res:BOOL:=KNOTFIO::WriteKnotN(K::Knot,name); return res; end; WriteKnotNVer1(str:EXT_OB):BOOL is name:STR:=STR::create_from_c_string(str); res:BOOL:=KNOTFIO::WriteKnotNVer1(K::Knot,name); return res; end; WriteBraidN(str:EXT_OB):BOOL is name:STR:=STR::create_from_c_string(str); res:BOOL:=KNOTFIO::WriteBraidN(K::Knot,name); return res; end; WriteNDataN(str:EXT_OB):BOOL is name:STR:=STR::create_from_c_string(str); res:BOOL:=KNOTFIO::WriteNDataN(K::Knot,name); return res; end;
GraphWidth:INT; GraphHeight:INT; WindowSw(s:INT); --context switch for Draw* 1:screen, 0:pixel knotXProc(argc:INT,argv:C_PTR); -- X main loop -- Use as KNOTXW::knotXProc(argv.size, argv.array_ptr); FlushPixel; -- copy from pixel to window DrawLine(x1,y1,x2,y2,palet:INT); DrawCircle(x,y,r,palet:INT, fill:BOOL); DrawPoint(x,y,palet:INT); ClearWindow; end;