/* Template plugin PluginEditor - DMS - Oct 99 - by Christophe LOREK */ struct PluginEditor = [ PluginEditorChannel : Chn, PluginEditorFlag : I, PluginEditorClass : S, PluginEditorClassName : S, PluginEditorModName : S, PluginEditorPlugMajorV : I, PluginEditorPlugMinorV : I, PluginEditorXMainWin : I, PluginEditorYMainWin : I, PluginEditorWMainWin : I, PluginEditorHMainWin : I, PluginEditorXEditWin : I, PluginEditorYEditWin : I, PluginEditorWEditWin : I, PluginEditorHEditWin : I, PluginEditorMainWin : ObjWin, PluginEditorEditWin : ObjWin ] mkPluginEditor;; /* SCS PluginEditor */ fun getVersion (l)= if l == nil then nil else let hd l -> [keyword [val1 [val2 _]]] in if !strcmp keyword "version" then [atoi val1 atoi val2] else getVersion tl l;; proto rflOpenBrowseIcone = fun [OpenBox PluginEditor P] I;; fun endPluginEditor()= 0;; fun _quit (a, ed)= endPluginEditor;; fun _resizeT (a, t, x, y)= _SIZEtext t x-2 y-2 1 1;; fun rflDestroyMainWin (wn, ed)= endPluginEditor;; /* interface */ fun rflPainMainWin (wn, ed)= _PAINTwindow ed.PluginEditorEditWin;; fun rflSizeMainWin (wn, ed, w, h)= set ed.PluginEditorWMainWin = w; set ed.PluginEditorHMainWin = h; set ed.PluginEditorXEditWin = 0; set ed.PluginEditorYEditWin = 0; set ed.PluginEditorWEditWin = w; set ed.PluginEditorHEditWin = h; _SIZEwindow ed.PluginEditorEditWin ed.PluginEditorWEditWin ed.PluginEditorHEditWin ed.PluginEditorXEditWin ed.PluginEditorYEditWin;; fun rflMoveMainWin (wn, ed, x, y)= set ed.PluginEditorXMainWin=x; set ed.PluginEditorYMainWin=y;; fun startPluginEditor (chn, parent, x, y, w, h, winflag, _class)= let mkPluginEditor [ nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil ] -> ed in { set ed.PluginEditorChannel = chn; set ed.PluginEditorClass=_class; set ed.PluginEditorXMainWin = x; set ed.PluginEditorYMainWin = y; set ed.PluginEditorWMainWin = w; set ed.PluginEditorHMainWin = h; /* plugin version */ if ed.PluginEditorClass == nil then nil else { set ed.PluginEditorClassName = _class; set ed.PluginEditorPlugMajorV = 0; set ed.PluginEditorPlugMinorV = 0; }; /* main window */ set ed.PluginEditorMainWin= let _GETwindowSizePosition parent -> [parentw parenth _ _] in let _CRscrollWindow ed.PluginEditorChannel parent x y parentw parenth ed.PluginEditorWMainWin ed.PluginEditorHMainWin winflag if ed.PluginEditorClass==nil then "Black box" else strcatn ed.PluginEditorClassName::" v"::(itoa ed.PluginEditorPlugMajorV)::"."::(itoa ed.PluginEditorPlugMinorV)::" PluginEditor"::nil -> [win1 win2] in win2; _SETwindowMinSize ed.PluginEditorMainWin ed.PluginEditorWMainWin ed.PluginEditorHMainWin; _CBwinPaint ed.PluginEditorMainWin @rflPainMainWin ed; _CBwinDestroy ed.PluginEditorMainWin @rflDestroyMainWin ed; _CBwinSize ed.PluginEditorMainWin @rflSizeMainWin ed; _CBwinMove ed.PluginEditorMainWin @rflMoveMainWin ed; /* edit window */ set ed.PluginEditorXEditWin = 0; set ed.PluginEditorYEditWin = 0; set ed.PluginEditorWEditWin = w; set ed.PluginEditorHEditWin = h; set ed.PluginEditorEditWin = _CRwindow ed.PluginEditorChannel ed.PluginEditorMainWin ed.PluginEditorXEditWin ed.PluginEditorYEditWin ed.PluginEditorWEditWin ed.PluginEditorHEditWin WN_NOBORDER|WN_CHILD ""; ed };;