/*************************************************************************************************/ /* Desc:Dynamic Editor */ /* Written: J.Dumay */ /* Date : 20-04-2000 */ /* Version: 1.0 */ /*************************************************************************************************/ typeof allneeded=I;; typeof alreadyload=I;; typeof class = S;; var expl_refpath = "";; var expl_filem3d = "";; var expl_filetext = "";; var expl_filebox = "";; var expl_filem3d_u = "";; var expl_filetext_u = "";; var expl_filebox_u = "";; var expl_sizebmp = 16;; var expl_srvurl = "";; var expl_id = "";; var InitOk = 0;; var DYNautosave = 1;; typeof DYNEDITORmyOb = Ob;; proto initGlobalEditorView = fun [View3dManager View3d] I;; proto initExplorateur = fun [ObjWin UserI [S S] [S S] [S S] I S] I;; proto addFileInExplorator = fun [u0 u1 S] I;; proto changeModeGlobalEditorView = fun [u0 u1 S] I;; proto PLUGINBROWSER_Init = fun [Chn ObjWin] I;; /* callback de fin de chargement de tous les fichiers */ fun endclientNeeded(blurp,f, o)= dyndebg "dyneditorc.pkg"::"endclientNeeded"::nil; loadIniFile f; /* initialisation de la vue edition */ initGlobalEditorView MngW3d w3d; /* initialisation de l'explorateur */ initExplorateur w3d.V3dmanager.MV3dWin ObUi o [expl_filem3d expl_filem3d_u] [expl_filetext expl_filetext_u] [expl_filebox expl_filebox_u] expl_sizebmp expl_refpath; UcbMessage ObUi o ["addFileInExplorator" @addFileInExplorator ]:: ["DynChangeMode" @changeModeGlobalEditorView]:: nil; PLUGINBROWSER_Init w3d.V3dmanager.MV3dChannel w3d.V3dmanager.MV3dWin; set InitOk=1; _DMSeventTag this strcat ObName o ".initOK" nil nil nil; 0;; /* callback de fin de chargement du fichier */ fun endgetfile(f,name)= dyndebg "dyneditorc.pkg"::"endgetfile"::nil; if f==nil then getErr name else nil; 0;; /* requete de download du fichier file */ fun getfile(file,blurp)= dyndebg "dyneditorc.pkg"::"getfile"::nil; if file==nil then nil else _RSCdownload this file file mkfun2 @endgetfile file 3;; fun getClientNeeded(l)= if l==nil then nil else let l -> [line nxt] in if !strcmp (hd line) "clientNeeded" then conc tl line getClientNeeded nxt else getClientNeeded nxt;; /* callback de fin de chargement du .ini */ fun endgetinifile(f,o)= dyndebg "dyneditorc.pkg"::"endgetinifile"::nil; if f==nil then getErr f else { apply_on_list (getClientNeeded strextr _getpack _checkpack f) @getfile nil; /* fin du download des fichiers necessaires */ _RSCdownload this nil nil mkfun2 mkfun3 @endclientNeeded o f 1; nil }; 0;; fun dyngetparam(l,b)= dyndebg "dyneditorc.pkg"::"getparam"::nil; if l==nil then nil else let hd l -> s in { if !strcmp s "srvadr" then set expl_srvurl=nth_list l 1 else if !strcmp s "clientid" then set expl_id=nth_list l 1 else if !strcmp s "srvrefpath" then set expl_refpath=nth_list l 1 else if !strcmp s "srvm3d" then set expl_filem3d=nth_list l 1 else if !strcmp s "srvtext" then set expl_filetext=nth_list l 1 else if !strcmp s "srvbox" then set expl_filebox=nth_list l 1 else if !strcmp s "srvm3d_u" then set expl_filem3d_u=nth_list l 1 else if !strcmp s "srvtext_u" then set expl_filetext_u=nth_list l 1 else if !strcmp s "srvbox_u" then set expl_filebox_u=nth_list l 1 else if !strcmp s "srvbmpsize" then { set expl_sizebmp=atoi nth_list l 1; nil} else nil; };; fun init(from,action,param,ulist,tag,o)= let ObUi o -> ui in ( dyndebg "dyneditorc.pkg"::"init"::nil; /* recuperation des parametres de l'init */ apply_on_list strextr param @dyngetparam nil; /* initialisation du systeme des downloads */ DLinit expl_srvurl expl_id; set DYNautosave = atoi hd UgetParam ui "autosave"; C3Dautosave DYNautosave (atoi hd UgetParam ui "autosavedelay"); let hd UgetParam ui "ini" -> ini in /* recuperation des fichiers necessaires au lancement des scripts*/ _RSCdownload this ini ini mkfun2 @endgetinifile o 1; 0 ) ;; fun newOb(o)= dyndebg "dyneditorc.pkg"::"newOb"::nil; /* enregistrement des actions et des fonctions de communication*/ set DYNEDITORmyOb = o; _DMSdefineActions this [strcat ObName o ".init" mkfun6 @init o ]::nil; /* envoie d'une demande d'enregistrement */ _DMSeventTag this strcat ObName o ".register" nil (UgetUser ObUi o)::nil nil; 0;; proto unInitExplorateur = fun [] I;; proto unInitGlobalEditorView = fun [] I;; fun dsOb()= _DMSevent this (strcat class ".unregister") "" nil; if !InitOk then nil else { unInitExplorateur; unInitGlobalEditorView; }; set DYNEDITORmyOb = nil; 0;; fun IniPlug(file)= dyndebg "dyneditorc.pkg"::"IniPlug"::nil; set PlugChannel=_channel; set class=getInfo strextr _getpack _checkpack file "name"; set allneeded=0; set alreadyload=0; PlugRegister class @newOb @dsOb; 0;;