/* snapedit.pkg : editeur du plugin snapshot - sept 99 - Sylvain Huet */ /* rev. April 00 - by Sebastien DENEUX */ /* rev June 00 - by Vincent BEAUDENON */ typeof plugin=S;; typeof class=S;; typeof ed = PluginEditor;; typeof RegOnly = ObjCheck;; typeof Loop = ObjCheck;; fun InstParam(ui)=ui.paramInst;; fun InstName(ui)=ui.nameInst;; fun testinst(l,c)= if l==nil then 0 else let l->[a n] in if !strcmp a.classInst c then 1 else testinst n c;; proto save=fun [ [Inst r1] ] [[S r1] [S r1] [[S r1]r1] [[S r1]r1]];; fun openedit(win,param)= let strextr param -> l in let _GETwindowSizePosition win -> [w h x y] in ( set ed = startPluginEditor _channel win 0 0 w h WN_CHILDINSIDE|WN_NOBORDER class; set RegOnly = _SETcheck _CRcheck _channel ed.PluginEditorEditWin 5 5 w-20 20 0 "Send video to registered clients only" if !strcmpi getInfo l "registeredClientsOnly" "yes" then 1 else 0; set Loop = _SETcheck _CRcheck _channel ed.PluginEditorEditWin 5 35 w-20 20 0 "Allow loop mode" if !strcmpi getInfo l "loop" "yes" then 1 else 0; 0 );; fun closeedit()= strbuild ("registeredClientsOnly"::(let _GETcheck RegOnly -> x in if x then "yes" else "no")::nil):: ("loop"::(let _GETcheck Loop -> x in if x then "yes" else "no")::nil)::nil;; /* strcat "InitURL " _GETtext InitURL;; */ fun savesuppdmi(l)= if l==nil then ("zoneC"::"SnapShotInterface"::nil)::nil /* supplemental Dmi */ else let l->[ui n] in let strextr (InstParam ui) -> param in let InstName ui -> name in if !strcmpi getInfo param "registeredClientsOnly" "yes" then ("actionC"::(strcat name ".modify")::nil):: ("action"::(strcat name ".reset")::nil):: ("action"::(strcat name ".register")::nil):: ("action"::(strcat name ".unregister")::nil) ::savesuppdmi n else ("actionC"::(strcat name ".modify")::nil):: ("action"::(strcat name ".reset")::nil) ::savesuppdmi n;; fun save(l)= [ nil /* registerF */ nil /* register */ ("plugin"::plugin::nil)::nil /* supplemental Dat */ savesuppdmi l /* supplemental Dmi */ ];; fun IniPlug(file)= set plugin=file; set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @save nil @openedit @closeedit;;