/* Authors: Arkeon */ /* Last update: 07.04.02 */ /* Version: 1.0 */ typeof class=S;; fun cbcomm(ui, cli, action, param, z) = let z->[o state] in if !strcmp action "state?" then UsendCli this nil ui "setState" itoa state else nil ;; fun activate(o, from, cli, action, param, rep, z) = let z->[_ state] in ( mutate z<-[_ state]; UsendCli this nil ObUi o "setState" itoa state ); 0 ;; fun newOb(o) = let [o if !strcmp hd UgetParam ObUi o "init" "on" then 1 else 0] -> z in ( ObRegisterAction o strcat ObName o ".linkS" mkfun7 @activate [o 1]; ObRegisterAction o strcat ObName o ".unlinkS" mkfun7 @activate [o 0]; UcbComm this ObUi o mkfun5 @cbcomm z ); 0 ;; fun IniPlug(file)= set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @newOb nil; 0 ;;