/* Term3d version 1.0 - part Editor */ /* by iri : info@irizone.net - 01/2004 */ /* rev. by iri - 03/2004 : add data "initTxt", events "in", "log" and "getTerm" and action "setTerm" */ /* rev. by iri - 05/2004 : add "FSbottom" = how display the term3d at the fullscreen mode ? add "ChgCliSize" = the client can (or not) change the position and size of the term3d add actionC ".getLink" eventC ".away" & ".back" add to manage links 3d add hilite color */ /* Copyright (c) 2004 iri. Ce fichier fait partie du plugin "Term3d". Term3d est un programme libre; vous pouvez le redistribuer et/ou le modifier selon les termes de la GNU General Public License (Licence Publique Générale GNU) telle qu'elle a été publiée par la Free Software Foundation : soit la version 2 de la licence, soit (comme vous le souhaitez) toute version ultérieure. Term3d est distribué dans l'espoir qu'il sera utile, mais SANS LA MOINDRE GARANTIE; pas même la garantie implicite de COMMERCIABILITE ou d'ADEQUATION A UN BUT PARTICULIER. Voir la GNU General Public License pour plus de détails. Vous devriez avoir reçu une copie de la GNU General Public License en même temps que ce programme (fichier "COPYING", version 2 de la GNU General Public License); sinon, merci d'écrire à la Free Software Foundation, Inc, 59 Temple Place, Suite 330, Boston, MA02111-1307 USA. De plus, Term3d peut être intégré à toute distribution de tout ou partie du SCS (Set Construction Set) et basé sur la technologie Scol, à l'exclusion de toute distribution complète ou partielle payante (autre que le prix d'envoi ou d'édition du support de la distribution). Vous devez respecter la GNU General Public License à tous les égards. Si vous modifiez ce fichier, vous pouvez étendre cette exception à votre version du fichier, mais n'êtes pas obligé de le faire. Si vous ne souhaitez pas le faire, supprimez cette déclaration l'exception de votre version. */ /******************************************************************/ /************************ OLD VERSION *****************************/ /******************************************************************/ typeof plugin = S;; typeof class = S;; typeof ed = PluginEditor;; typeof eFont = ObjText;; typeof eSize = ObjText;; typeof bgAv = ObjText;; typeof eX = ObjText;; typeof eY = ObjText;; typeof eW = ObjText;; typeof eH = ObjText;; typeof initTxt = ObjText;; typeof FSbottom = ObjCheck;; typeof ChgCliSize = ObjCheck;; typeof avList = ObjCheck;; typeof avListX = ObjCheck;; typeof avListY = ObjCheck;; typeof avListW = ObjText;; typeof avListH = ObjText;; typeof Trans = ObjCheck;; typeof Links = ObjCheck;; typeof menuItem = ObjText;; typeof okMenuItem = ObjCheck;; typeof pathsmileys = ObjText;; var colorFont = 0;; var colorFontHilite = 0;; proto save=fun [ [Inst r1] ] [[S r1] [S r1] [[S r1]r1] [[S r1]r1]];; fun InstName(UI)= UI.nameInst ;; /*** Ajouter un truc pour l'aide (FR/UK) ... ***/ fun cbAvList(obj, u, etat)= if etat then ( _ENcheck avListX 1; _ENcheck avListY 1; _ENtext avListW 1; _ENtext avListH 1; _ENcheck Trans 1; _ENtext bgAv 1; _ENcheck Links 1 ) else ( _ENcheck avListX 0; _ENcheck avListY 0; _ENtext avListW 0; _ENtext avListH 0; _ENcheck Trans 0; _ENtext bgAv 0; _ENcheck Links 0 ); 0;; fun cbMenu(Obj, u, etat)= if etat then _ENtext menuItem 1 else _ENtext menuItem 0; 0;; fun _chooseColor2(color)= if color != nil then ( set colorFontHilite = color; 0 ) else 0 ;; fun _chooseColor(color)= if color != nil then ( set colorFont = color; 0 ) else 0 ;; fun showColorMap2(button, ed) = _CRcolorMap _channel ed.PluginEditorEditWin 5 125 "choose a color" @_chooseColor2 0 ;; fun showColorMap(button, ed) = _CRcolorMap _channel ed.PluginEditorEditWin 5 125 "choose a color" @_chooseColor 0 ;; fun _paintE(a, b)= _PAINTrectangle ed.PluginEditorEditWin 90 30 20 20 DRAW_SOLID 1 0 DRAW_SOLID colorFont; _PAINTrectangle ed.PluginEditorEditWin 210 30 20 20 DRAW_SOLID 1 0 DRAW_SOLID colorFontHilite;; /* interface à refaire !! souk ! ;-) */ 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; _CRtext _channel ed.PluginEditorEditWin 5 5 80 20 ET_ALIGN_LEFT "Font :"; set eFont = _CReditLine _channel ed.PluginEditorEditWin 90 5 w-100 20 ET_BORDER|ET_DOWN let getInfo l "font" -> string in if (nil == string) then "Arial" else string; _CBbutton _CRbutton _channel ed.PluginEditorEditWin 5 30 80 20 nil "Color" @showColorMap ed; _CBbutton _CRbutton _channel ed.PluginEditorEditWin 125 30 80 20 nil "Hilite" @showColorMap2 ed; _CRtext _channel ed.PluginEditorEditWin 235 32 80 20 ET_ALIGN_LEFT "JPG Scroll Av :"; set bgAv = _CReditLine _channel ed.PluginEditorEditWin 320 30 170 20 ET_DOWN|ET_BORDER|ET_AHSCROLL let getInfo l "pathBgAv" -> string in if (nil == string) then "dms/3d/plugins/term3d/" else string; _CRtext _channel ed.PluginEditorEditWin 5 60 80 20 ET_ALIGN_LEFT "Size :"; set eSize = _CReditLine _channel ed.PluginEditorEditWin 90 60 w-100 20 ET_BORDER|ET_DOWN|ET_NUMBER let getInfo l "size" -> string in if (nil == string) then "" else string; _CRtext _channel ed.PluginEditorEditWin 5 90 80 20 ET_ALIGN_LEFT "coord. X :"; set eX = _CReditLine _channel ed.PluginEditorEditWin 90 90 50 20 ET_BORDER|ET_DOWN|ET_NUMBER let getInfo l "x" -> string in if (nil == string) then "" else string; _CRtext _channel ed.PluginEditorEditWin 145 90 50 20 ET_ALIGN_LEFT "width :"; set eW = _CReditLine _channel ed.PluginEditorEditWin 200 90 50 20 ET_BORDER|ET_DOWN|ET_NUMBER let getInfo l "w" -> string in if (nil == string) then "" else string; _CRtext _channel ed.PluginEditorEditWin 255 90 50 20 ET_ALIGN_LEFT "height :"; set eH = _CReditLine _channel ed.PluginEditorEditWin 320 90 60 20 ET_BORDER|ET_DOWN|ET_NUMBER let getInfo l "h" -> string in if (nil == string) then "" else string; _CRtext _channel ed.PluginEditorEditWin 5 120 80 20 ET_ALIGN_LEFT "coord. Y :"; _CRtext _channel ed.PluginEditorEditWin 145 120 w-150 20 ET_ALIGN_LEFT "!!! distance between bottom of the term and bottom of the view3d !!!"; set eY = _CReditLine _channel ed.PluginEditorEditWin 90 120 50 20 ET_BORDER|ET_DOWN|ET_NUMBER let getInfo l "y" -> string in if (nil == string) then "" else string; _CRtext _channel ed.PluginEditorEditWin 5 150 80 20 ET_ALIGN_LEFT "Custom menu item :"; set okMenuItem = _CRcheck _channel ed.PluginEditorEditWin 90 150 15 15 CH_DOWN ""; _SETcheck okMenuItem let getInfo l "customItem" -> string in if string == nil then 0 else atoi string; _CRtext _channel ed.PluginEditorEditWin 110 150 40 20 ET_ALIGN_LEFT "Name :"; set menuItem = _CReditLine _channel ed.PluginEditorEditWin 155 150 w-165 20 ET_BORDER|ET_DOWN|ET_AHSCROLL let getInfo l "customItemName" -> string in if string == nil then "Custom menu item ..." else string; let getInfo l "color" -> c in set colorFont = atoi c; let getInfo l "colorHilite" -> c in set colorFontHilite = atoi c; _CRtext _channel ed.PluginEditorEditWin 5 180 80 20 ET_ALIGN_LEFT "1st message :"; set initTxt = _CReditLine _channel ed.PluginEditorEditWin 90 180 w-100 20 ET_BORDER|ET_DOWN|ET_AHSCROLL let getInfo l "initTxt" -> string in if (nil == string) then "" else string; _CRtext _channel ed.PluginEditorEditWin 5 210 180 20 ET_ALIGN_LEFT "The term must stay in the bottom ?"; set FSbottom = _CRcheck _channel ed.PluginEditorEditWin 190 210 15 15 CH_DOWN ""; _SETcheck FSbottom let getInfo l "FSbottom" -> string in if (nil == string) then 1 else atoi string; _CRtext _channel ed.PluginEditorEditWin 220 210 170 20 ET_ALIGN_LEFT "The client can change the size ?"; set ChgCliSize = _CRcheck _channel ed.PluginEditorEditWin 400 210 15 15 CH_DOWN ""; _SETcheck ChgCliSize let getInfo l "ChgCliSize" -> string in if (nil == string) then 0 else atoi string; _CRtext _channel ed.PluginEditorEditWin 5 240 60 20 ET_ALIGN_LEFT "Links ?"; set Links = _CRcheck _channel ed.PluginEditorEditWin 70 240 15 15 CH_DOWN ""; _SETcheck Links let getInfo l "displayLinks" -> string in if string == nil then 0 else atoi string; _CRtext _channel ed.PluginEditorEditWin 85 240 140 20 ET_ALIGN_LEFT "Transparency (links & list): "; set Trans = _CRcheck _channel ed.PluginEditorEditWin 230 240 15 15 CH_DOWN ""; _SETcheck Trans let getInfo l "Trans" -> string in if string == nil then 1 else atoi string; _CRtext _channel ed.PluginEditorEditWin 250 240 50 20 ET_ALIGN_LEFT "Smileys :"; set pathsmileys = _CReditLine _channel ed.PluginEditorEditWin 305 240 w-310 20 ET_BORDER|ET_DOWN|ET_AHSCROLL let getInfo l "pathsmileys" -> string in if string == nil then "dms/3d/plugins/term3d/smileys" else string; _CRtext _channel ed.PluginEditorEditWin 5 270 60 20 ET_ALIGN_LEFT "AvList ?"; set avList = _CRcheck _channel ed.PluginEditorEditWin 70 270 15 15 CH_DOWN ""; _SETcheck avList let getInfo l "displayAvList" -> string in if string == nil then 0 else atoi string; _CRtext _channel ed.PluginEditorEditWin 95 270 60 20 ET_ALIGN_LEFT "UpLeft :"; set avListX = _CRcheck _channel ed.PluginEditorEditWin 160 270 15 15 CH_DOWN ""; _SETcheck avListX let getInfo l "xAvList" -> string in if string == nil then 0 else atoi string; _CRtext _channel ed.PluginEditorEditWin 180 270 60 20 ET_ALIGN_LEFT "DownLeft :"; set avListY = _CRcheck _channel ed.PluginEditorEditWin 245 270 15 15 CH_DOWN ""; _SETcheck avListX let getInfo l "yAvList" -> string in if string == nil then 0 else atoi string; _CRtext _channel ed.PluginEditorEditWin 265 270 20 20 ET_ALIGN_LEFT "w:"; set avListW = _CReditLine _channel ed.PluginEditorEditWin 295 270 40 20 ET_DOWN|ET_NUMBER let getInfo l "wAvList" -> string in if string == nil then "100" else string; _CRtext _channel ed.PluginEditorEditWin 345 270 20 20 ET_ALIGN_LEFT "h:"; set avListH = _CReditLine _channel ed.PluginEditorEditWin 375 270 40 20 ET_DOWN|ET_NUMBER let getInfo l "hAvList" -> string in if string == nil then "100" else string; cbAvList nil nil _GETcheck avList; cbMenu nil nil _GETcheck okMenuItem; _CBwinPaint ed.PluginEditorEditWin @_paintE nil; _CBcheck avList @cbAvList 0; _CBcheck okMenuItem @cbMenu 0; 0 ) ;; fun closeedit()= strbuild ("font" ::(_GETtext eFont)::nil):: ("size" ::(_GETtext eSize)::nil):: ("x" ::(_GETtext eX)::nil):: ("y" ::(_GETtext eY)::nil):: ("w" ::(_GETtext eW)::nil):: ("h" ::(_GETtext eH)::nil):: ("color" ::(itoa colorFont)::nil):: ("colorHilite" ::(itoa colorFontHilite)::nil):: ("pathBgAv" ::(_GETtext bgAv)::nil):: ("customItem" ::(itoa _GETcheck okMenuItem)::nil):: ("customItemName"::(_GETtext menuItem)::nil):: ("initTxt" ::(_GETtext initTxt)::nil):: ("FSbottom" ::(itoa _GETcheck FSbottom)::nil):: ("ChgCliSize" ::(itoa _GETcheck ChgCliSize)::nil):: ("displayLinks" ::(itoa _GETcheck Links)::nil):: ("trans" ::(itoa _GETcheck Trans)::nil):: ("displayAvList" ::(itoa _GETcheck avList)::nil):: ("xAvList" ::(itoa _GETcheck avListX)::nil):: ("yAvList" ::(itoa _GETcheck avListY)::nil):: ("wAvList" ::(_GETtext avListW)::nil):: ("hAvList" ::(_GETtext avListH)::nil):: ("smileys" ::("1")::nil):: /* auto */ ("pathsmileys" ::(_GETtext pathsmileys)::nil):: nil ;; fun suppactions(l)= if l == nil then nil else let l -> [UI nl] in let (InstName UI) -> name in ("action"::(strcat class ".broadInfo")::nil):: ("action"::(strcat class ".privateMsg")::nil):: ("action"::(strcat class ".!chgLogin")::nil):: ("action"::(strcat class ".!updateAv")::nil):: ("actionC"::(strcat class ".IgnoreFlag")::nil):: ("actionC"::(strcat class ".IgnChgLogin")::nil):: ("actionC"::(strcat class ".IgnLogout")::nil):: ("actionC"::(strcat class ".setTerm")::nil):: ("actionC"::(strcat class ".getLink")::nil):: (suppactions nl);; fun save(l) = let l -> [UI nl] in let if (InstName UI)==nil then class else InstName UI -> name in [ nil /* registerF */ nil /* register */ ("plugin"::plugin::nil)::nil /* supplemental Dat */ /* dmi */ ("eventC" ::(strcat class ".hidden")::nil):: ("eventC" ::(strcat class ".shown")::nil):: ("eventC" ::(strcat class ".getTerm")::nil):: ("eventC" ::(strcat class ".in")::nil):: ("eventC" ::(strcat class ".log")::nil):: ("eventC" ::(strcat class ".away")::nil):: ("eventC" ::(strcat class ".back")::nil):: ("eventC" ::(strcat class ".helpFR")::nil):: ("eventC" ::(strcat class ".helpUK")::nil):: ("eventC" ::(strcat class ".custom")::nil):: (suppactions l) ] ;; fun IniPlug(file) = set plugin=file; set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @save nil @openedit @closeedit ;;