/******************************************************************************* Module Syscom Window client part Version: 1.0 Authors: Jean-Pierre Dandrieux, Julien Zorko, Gilles Marchal, Julien Ducoin Last update: 12/06/2001 1 to 1 Audio/Video/Text communication system *******************************************************************************/ struct SYCinfoCom = [ SYCsalonId : I, SYCid : I, SYCotherLogin : S, SYCwindos : ObjWin, SYCposSize : [I I I I], SYConVideo : ObjCheck, SYConSound : ObjCheck, SYConMyVideo : ObjCheck, SYConMySound : ObjCheck, SYCtextReceive : ObjText, SYCtextSend : ObjText, SYShangup : ObjButton, SYCcontainer : ObjContainer, SYCcompBitmap : CompBitmap, SYCbitmap : ObjBitmap, SYCbuffer : S, SYCinfoText : ObjRichText, SYCchatText : ObjText, SYCstatusBar : ObjText ]mkSYCinfoCom;; typeof ListContainer = ObjContainer;; typeof UsersListView = ListView;; typeof myInfoCom = [SYCinfoCom r1];; typeof SYCwinList = ObjWin;; typeof VSlideBmp = ObjBitmap;; typeof VSlideBmp8 = ObjBitmap8;; typeof HSlideBmp = ObjBitmap;; typeof HSlideBmp8 = ObjBitmap8;; typeof Path = S;; /* Path of the class */ proto EndCom = fun[I]I;; /* */ proto RemoveCaller = fun[I]I;; /* */ fun SearchInfoCom(id,infoCom)= if infoCom == nil then nil else let infoCom -> [a next] in if id == (a.SYCid) then a else SearchInfoCom id next ;; /******************************************************************************* definir le text pour la barre d'état. infoCom -> InfoCom: txt -> S: <- objtext *******************************************************************************/ fun setStatusText(infoCom, txt)= _SETtext infoCom.SYCstatusBar txt ;; /******************************************************************************* Ajout dans la zone Info du chat d'une chaine de caractère. infoCom -> InfoCom: login -> S: txt -> S: font -> S: font name. size -> I: font size. color -> I: font color. flag -> I: font flag. <- objrichtext *******************************************************************************/ fun setInfoText(infoCom, login, txt, font, size, color, flag)= if login==nil then _ADDtextRichText infoCom.SYCinfoText strcatn " >> "::txt::"\n"::nil (_loc this "INTERFACE_FONTNAME" nil) size color 4 else ( _ADDtextRichText infoCom.SYCinfoText (strcatn "<"::login::"> "::nil) (_loc this "INTERFACE_FONTNAME" nil) size (make_rgb 0 0 0) 4; _ADDtextRichText infoCom.SYCinfoText (strcatn txt::"\n"::nil) font size color flag; ); let _GETlineCountRichText infoCom.SYCinfoText -> l in ( _SCROLLrichText infoCom.SYCinfoText 0 (l-1); if l >= 30 then _DELlineRichText infoCom.SYCinfoText 0 else nil; ) ;; fun _end(s)= _DMSdelete this ;; /******************************************************************************* The following functions create the slidebars *******************************************************************************/ /******************************************************************************* Draw a vertical slide bar w -> I : weight of the slide bar h -> I : height of the slide bar <- AlphaBitmap : the alphabitmap containing the slide bar *******************************************************************************/ fun DrawVSlideBar(w, h) = /* set the transparency color of the source file */ let make_rgb 0 0 255 -> trans in /* creation of the two destination bitmap */ let _CRbitmap _channel w*3 h+18 -> tempBmp in let _CRbitmap8 _channel w*3 h+18 -> tempBmp8 in ( /* construction of the two final bitmap with the elements of the file */ _SCPbitmap tempBmp 0 0 15 12 VSlideBmp 34 16 49 28 nil; _SCPbitmap tempBmp 16 0 31 12 VSlideBmp 34 16 49 28 nil; _SCPbitmap tempBmp 32 0 47 12 VSlideBmp 51 16 66 28 nil; _SCPbitmap tempBmp 0 13 15 15 VSlideBmp 2 16 17 17 nil; _SCPbitmap tempBmp 16 13 31 15 VSlideBmp 2 16 17 17 nil; _SCPbitmap tempBmp 32 13 47 15 VSlideBmp 2 16 17 17 nil; _SCPbitmap tempBmp 0 16 15 h-18 VSlideBmp 2 18 17 23 nil; _SCPbitmap tempBmp 16 16 31 h-18 VSlideBmp 2 18 17 23 nil; _SCPbitmap tempBmp 32 16 47 h-18 VSlideBmp 2 18 17 23 nil; _SCPbitmap tempBmp 0 h-17 15 h-14 VSlideBmp 2 24 17 27 nil; _SCPbitmap tempBmp 16 h-17 31 h-14 VSlideBmp 2 24 17 27 nil; _SCPbitmap tempBmp 32 h-17 47 h-14 VSlideBmp 2 24 17 27 nil; _SCPbitmap tempBmp 0 h-13 15 h-1 VSlideBmp 34 30 49 42 nil; _SCPbitmap tempBmp 16 h-13 31 h-1 VSlideBmp 34 30 49 42 nil; _SCPbitmap tempBmp 32 h-13 47 h-1 VSlideBmp 51 30 66 42 nil; _SCPbitmap tempBmp 0 h 15 h+17 VSlideBmp 18 16 33 33 nil; _SCPbitmap tempBmp 16 h 31 h+17 VSlideBmp 18 16 33 33 nil; _SCPbitmap tempBmp 32 h 47 h+17 VSlideBmp 18 16 33 33 nil; _SCPbitmap8 tempBmp8 0 0 15 12 VSlideBmp8 34 16 49 28 nil; _SCPbitmap8 tempBmp8 16 0 31 12 VSlideBmp8 34 16 49 28 nil; _SCPbitmap8 tempBmp8 32 0 47 12 VSlideBmp8 51 16 66 28 nil; _SCPbitmap8 tempBmp8 0 13 15 15 VSlideBmp8 2 16 17 17 nil; _SCPbitmap8 tempBmp8 16 13 31 15 VSlideBmp8 2 16 17 17 nil; _SCPbitmap8 tempBmp8 32 13 47 15 VSlideBmp8 2 16 17 17 nil; _SCPbitmap8 tempBmp8 0 16 15 h-18 VSlideBmp8 2 18 17 23 nil; _SCPbitmap8 tempBmp8 16 16 31 h-18 VSlideBmp8 2 18 17 23 nil; _SCPbitmap8 tempBmp8 32 16 47 h-18 VSlideBmp8 2 18 17 23 nil; _SCPbitmap8 tempBmp8 0 h-17 15 h-14 VSlideBmp8 2 24 17 27 nil; _SCPbitmap8 tempBmp8 16 h-17 31 h-14 VSlideBmp8 2 24 17 27 nil; _SCPbitmap8 tempBmp8 32 h-17 47 h-14 VSlideBmp8 2 24 17 27 nil; _SCPbitmap8 tempBmp8 0 h-13 15 h-1 VSlideBmp8 34 30 49 42 nil; _SCPbitmap8 tempBmp8 16 h-13 31 h-1 VSlideBmp8 34 30 49 42 nil; _SCPbitmap8 tempBmp8 32 h-13 47 h-1 VSlideBmp8 51 30 66 42 nil; _SCPbitmap8 tempBmp8 0 h 15 h+17 VSlideBmp8 18 16 33 33 nil; _SCPbitmap8 tempBmp8 16 h 31 h+17 VSlideBmp8 18 16 33 33 nil; _SCPbitmap8 tempBmp8 32 h 47 h+17 VSlideBmp8 18 16 33 33 nil; /* creation of the new alphabitmap */ let _CRalphaBitmap _channel tempBmp tempBmp8 make_rgb 255 255 255 trans -> alphaBmp in let _DSbitmap tempBmp -> _ in let _DSbitmap8 tempBmp8 -> _ in alphaBmp ) ;; /*callback of resize of the list's vertical slidebar*/ fun cbResizeVSlide (cSlide, param, w, h, bmpcoords) = [DrawVSlideBar w/3 h [15 h-15 h]] ;; /******************************************************************************* Draw a horizontal slide bar w -> I : weight of the slide bar h -> I : height of the slide bar <- AlphaBitmap : the alphabitmap containing the slide bar *******************************************************************************/ fun DrawHSlideBar (w, h) = /* set the transparency color of the source file */ let make_rgb 0 0 255 -> trans in /* creation of the two destination bitmap */ let _CRbitmap _channel w+18 3*h -> tempBmp in let _CRbitmap8 _channel w+18 3*h -> tempBmp8 in ( /* construction of the two final bitmap with the elements of the file */ _SCPbitmap tempBmp 0 0 12 15 HSlideBmp 34 14 46 29 nil; _SCPbitmap tempBmp 0 16 12 31 HSlideBmp 34 14 46 29 nil; _SCPbitmap tempBmp 0 32 12 47 HSlideBmp 34 31 46 47 nil; _SCPbitmap tempBmp 13 0 17 15 HSlideBmp 2 14 6 29 nil; _SCPbitmap tempBmp 13 16 17 31 HSlideBmp 2 14 6 29 nil; _SCPbitmap tempBmp 13 32 17 47 HSlideBmp 2 14 6 29 nil; _SCPbitmap tempBmp 18 0 w-18 15 HSlideBmp 7 14 8 29 nil; _SCPbitmap tempBmp 18 16 w-18 31 HSlideBmp 7 14 8 29 nil; _SCPbitmap tempBmp 18 32 w-18 47 HSlideBmp 7 14 8 29 nil; _SCPbitmap tempBmp w-18 0 w-14 15 HSlideBmp 9 14 13 29 nil; _SCPbitmap tempBmp w-18 16 w-14 31 HSlideBmp 9 14 13 29 nil; _SCPbitmap tempBmp w-18 32 w-14 47 HSlideBmp 9 14 13 29 nil; _SCPbitmap tempBmp w-13 0 w-1 15 HSlideBmp 48 14 60 29 nil; _SCPbitmap tempBmp w-13 16 w-1 31 HSlideBmp 48 14 60 29 nil; _SCPbitmap tempBmp w-13 32 w-1 47 HSlideBmp 48 31 60 46 nil; _SCPbitmap tempBmp w 0 w+17 15 HSlideBmp 3 35 20 50 nil; _SCPbitmap tempBmp w 16 w+17 31 HSlideBmp 3 35 20 50 nil; _SCPbitmap tempBmp w 32 w+17 47 HSlideBmp 3 35 20 50 nil; _SCPbitmap8 tempBmp8 0 0 12 15 HSlideBmp8 34 14 46 29 nil; _SCPbitmap8 tempBmp8 0 16 12 31 HSlideBmp8 34 14 46 29 nil; _SCPbitmap8 tempBmp8 0 32 12 47 HSlideBmp8 34 31 46 47 nil; _SCPbitmap8 tempBmp8 13 0 17 15 HSlideBmp8 2 14 6 29 nil; _SCPbitmap8 tempBmp8 13 16 17 31 HSlideBmp8 2 14 6 29 nil; _SCPbitmap8 tempBmp8 13 32 17 47 HSlideBmp8 2 14 6 29 nil; _SCPbitmap8 tempBmp8 18 0 w-18 15 HSlideBmp8 7 14 8 29 nil; _SCPbitmap8 tempBmp8 18 16 w-18 31 HSlideBmp8 7 14 8 29 nil; _SCPbitmap8 tempBmp8 18 32 w-18 47 HSlideBmp8 7 14 8 29 nil; _SCPbitmap8 tempBmp8 w-18 0 w-14 15 HSlideBmp8 9 14 13 29 nil; _SCPbitmap8 tempBmp8 w-18 16 w-14 31 HSlideBmp8 9 14 13 29 nil; _SCPbitmap8 tempBmp8 w-18 32 w-14 47 HSlideBmp8 9 14 13 29 nil; _SCPbitmap8 tempBmp8 w-13 0 w-1 15 HSlideBmp8 48 14 60 29 nil; _SCPbitmap8 tempBmp8 w-13 16 w-1 31 HSlideBmp8 48 14 60 29 nil; _SCPbitmap8 tempBmp8 w-13 32 w-1 47 HSlideBmp8 48 31 60 46 nil; _SCPbitmap8 tempBmp8 w 0 w+17 15 HSlideBmp8 3 35 20 50 nil; _SCPbitmap8 tempBmp8 w 16 w+17 31 HSlideBmp8 3 35 20 50 nil; _SCPbitmap8 tempBmp8 w 32 w+17 47 HSlideBmp8 3 35 20 50 nil; /* creation of the new alphabitmap */ let _CRalphaBitmap _channel tempBmp tempBmp8 make_rgb 255 255 255 trans -> alphaBmp in let _DSbitmap tempBmp -> _ in let _DSbitmap8 tempBmp8 -> _ in alphaBmp ) ;; /*callback of resize of the list's vertical slidebar*/ fun cbResizeHSlide (cSlide, param, w, h, bmpcoords) = [DrawHSlideBar w h/3 [15 w-15 w]] ;; /******************************************************************************* The following functions draw the background *******************************************************************************/ /* display section */ fun cbResizeCompBmp ( compBmp, param, w, h, parambmp) = let param -> [channel motif trans] in let _GETalphaBitmapSize motif -> [mw mh] in let _FILLbitmap _CRbitmap channel w h trans-> bmp in let _SCPalphaBitmap bmp 0 0 w-1 h-1 motif 0 0 mw-1 mh-1 -> _ in let _CRalphaBitmap channel bmp nil trans trans -> abmp in ( _DSbitmap bmp; [abmp [0 0 w h]] ) ;; fun AlphaStretch (chan, source, sx, sy, sw, sh, w, h) = let _CRbitmap chan w h -> bmp in let _CRbitmap8 chan w h -> bmp8 in let _GETalphaBitmaps source -> [sBmp sBmp8] in let _SCPbitmap bmp 0 0 w-1 h-1 sBmp sx sy sx+sw-1 sy+sh-1 0 -> _ in let _SCPbitmap8 bmp8 0 0 w-1 h-1 sBmp8 sx sy sx+sw-1 sy+sh-1 0 -> _ in let _CRalphaBitmap chan bmp bmp8 nil nil -> abmp in ( _DSbitmap bmp; _DSbitmap8 bmp8; abmp ) ;; fun DrawBorders (cont) = let _GETcontainerPositionSize cont -> [_ _ w h] in let strcat Path "ressources/listframe.png" -> fileName in let _LDalphaBitmap _channel _checkpack fileName -> motif in /* bottom left corner */ let _CRcompBitmap _channel cont nil [0 h-38] OBJ_ENABLE|OBJ_VISIBLE|OBJ_LH_FLEX 0 motif 0 16 14 14 -> _ in /* bottom right corner */ let _CRcompBitmap _channel cont nil [w-38 h-38] OBJ_ENABLE|OBJ_VISIBLE|OBJ_LW_FLEX|OBJ_LH_FLEX 0 motif 16 16 14 14 -> _ in /* bottom border */ let AlphaStretch _channel motif 14 24 2 6 w-52 6 -> abmp in let _CRcompBitmap _channel cont nil [14 h-30] OBJ_ENABLE|OBJ_VISIBLE|OBJ_MW_FLEX|OBJ_LH_FLEX 0 abmp 0 0 w-52 6 -> b1 in let _CBcompBitmapResizeResource b1 @cbResizeCompBmp [_channel abmp nil] -> _ in /* left border */ let AlphaStretch _channel motif 0 14 6 2 6 h-52 -> abmp in let _CRcompBitmap _channel cont nil [0 14] OBJ_ENABLE|OBJ_VISIBLE|OBJ_MH_FLEX|OBJ_RW_FLEX 0 abmp 0 0 6 h-52 -> b1 in let _CBcompBitmapResizeResource b1 @cbResizeCompBmp [_channel abmp nil] -> _ in /* right border */ let AlphaStretch _channel motif 24 14 6 2 6 h-52 -> abmp in let _CRcompBitmap _channel cont nil [w-30 14] OBJ_ENABLE|OBJ_VISIBLE|OBJ_MH_FLEX|OBJ_LW_FLEX 0 abmp 0 0 6 h-52 -> b1 in let _CBcompBitmapResizeResource b1 @cbResizeCompBmp [_channel abmp nil] -> _ in let strcat Path "ressources/listtitle.png" -> fileName in let _LDalphaBitmap _channel _checkpack fileName -> motif in /* top left corner */ let _CRcompBitmap _channel cont nil [0 0] OBJ_ENABLE|OBJ_VISIBLE 0 motif 0 0 14 24 -> _ in /* top right corner */ let _CRcompBitmap _channel cont nil [w-38 0] OBJ_ENABLE|OBJ_VISIBLE|OBJ_LW_FLEX 0 motif 16 0 14 24 -> _ in /* top border */ let AlphaStretch _channel motif 14 0 2 6 w-52 6 -> abmp in let _CRcompBitmap _channel cont nil [14 0] OBJ_ENABLE|OBJ_VISIBLE|OBJ_MW_FLEX 0 abmp 0 0 w-52 6 -> b1 in let _CBcompBitmapResizeResource b1 @cbResizeCompBmp [_channel abmp nil] -> _ in cont ;; /******************************************************************************* Load bitmaps *******************************************************************************/ fun LoadBitmaps () = set Path = _DMSgetpath _DMSgetClass this; let strcat Path "ressources/lifts.png" -> fileName in let _GETalphaBitmaps _LDalphaBitmap _channel _checkpack fileName -> [tmpBmp tmpBmp8] in ( set VSlideBmp = tmpBmp; set VSlideBmp8 = tmpBmp8 ); let strcat Path "ressources/hlifts.png" -> fileName in let _GETalphaBitmaps _LDalphaBitmap _channel _checkpack fileName -> [tmpBmp tmpBmp8] in ( set HSlideBmp = tmpBmp; set HSlideBmp8 = tmpBmp8 ) ;; /******************************************************************************* Client list resize *******************************************************************************/ fun cbResizeListClient(coord, zone)= let coord -> [_ xi yi wi hi] in ( _SIZEEXcontainer ListContainer xi yi wi hi; let _GETcontainerPositionSize ListContainer -> [_ _ w h] in LISTVIEW_Resize UsersListView 6 6 w-35 h-35 ); 0 ;; fun cbResizeContListClient(cont, param, state, wi, hi)= /* let _GETcontainerExPositionSize ListContainer -> [xi yi _ _] in _SIZEEXcontainer ListContainer xi yi wi hi; */ let _GETcontainerPositionSize cont -> [_ _ w h] in LISTVIEW_Resize UsersListView 6 6 w-35 h-35; 0 ;; fun cbCloseContListClient (cont, param) = _SHOWcontainer cont CONTAINER_HIDDEN ;; /* -- drawListClient -- */ /* Affichage de l'interface graphique client. */ /* out */ /* listview : listview */ fun drawListClient () = LoadBitmaps; /* Création de la fenetre de listing des clients connectés. */ let _DMSgetZone this "userlist" @_end @cbResizeListClient @_end ->[win xi yi wi hi] in let ( if win == nil then let _CRcontainerFromObjCont _channel nil 100 100 350 250 CO_MENU|CO_SIZEBOX|CO_HIDE|CO_MINBOX|CO_MAXBOX (make_rgb 192 192 192) (_loc this "INTERFACE_TITLE_LISTVIEW" nil) -> cont in ( _CBcontainerSize cont @cbResizeContListClient nil; _CBcontainerPreDestroy cont @cbCloseContListClient nil ) else let _CRcontainerFromObjWin _channel win xi yi wi hi CO_NOBORDER|CO_CHILDINSIDE|CO_HIDE (make_rgb 192 192 192) "" -> cont in _SIZEEXcontainer cont xi yi wi hi ) -> mycontainer in let _GETcontainerPositionSize mycontainer -> [_ _ w h] in let DrawBorders mycontainer-> _ in /* vertical SlideBar */ let _CRcompSlideBar _channel mycontainer nil [w-20 0] OBJ_ENABLE|OBJ_VISIBLE|OBJ_LW_FLEX|OBJ_MH_FLEX|SLB_ROLLOVER 0 (DrawVSlideBar 16 h-20)/*alphabmp*/ [15 h-35 h-20] /* bmpcoords */ SLB_VERTICAL 0 2 1 -> vSlideBar in let _CBcompSlideBarResizeResource vSlideBar @cbResizeVSlide nil -> _ in /* horizontal Slidebar */ let _CRcompSlideBar _channel mycontainer nil [0 h-20] OBJ_ENABLE|OBJ_VISIBLE|OBJ_LH_FLEX|OBJ_MW_FLEX|SLB_ROLLOVER 0 (DrawHSlideBar w-20 16)/*alphabmp*/ [15 w-35 w-20] /* bmpcoords */ SLB_HORIZONTAL 0 1 10 -> hSlideBar in let _CBcompSlideBarResizeResource hSlideBar @cbResizeHSlide nil -> _ in let _CRfont _channel 12 0 FF_WEIGHT (_loc this "INTERFACE_FONTNAME" nil) -> myfont in let LISTVIEW_Create _channel mycontainer [6 6] w-36 h-36 OBJ_VISIBLE|OBJ_ENABLE|OBJ_MW_FLEX|LST_HIGHLIGHT_CLICKED OBJ_CONTAINER_MOVE|OBJ_CONTAINER_UNCLICK LISTVIEW_SELECTLINE 15/*itemsHeight*/ LST_VERTICAL myfont [(make_rgb 0 0 0) 0 0 (make_rgb 0 0 0) ] [(make_rgb 224 215 231) 60] (make_rgb 122 122 122) 18/*labelHeight*/ myfont [(make_rgb 255 255 255) 0 0 255] (make_rgb 108 167 198) (make_rgb 0 0 0) vSlideBar hSlideBar nil -> listview in let LISTVIEW_AddCol listview 0 (_loc this "INTERFACE_NAME_COL1" nil) LST_LEFT|LST_HIGHLIGHT_CLICKED 15 15 -> newcol in let LISTVIEW_AddCol listview 1 (_loc this "INTERFACE_NAME_COL2" nil) LST_LEFT|LST_HIGHLIGHT_CLICKED 100 5 -> newcol in let LISTVIEW_AddCol listview 2 (_loc this "INTERFACE_NAME_COL3" nil) LST_LEFT|LST_HIGHLIGHT_CLICKED 60 5 -> newcol in let LISTVIEW_AddCol listview 3 (_loc this "INTERFACE_NAME_COL4" nil) LST_LEFT|LST_HIGHLIGHT_CLICKED 50 5 -> newcol in let _GETwindowPositionSize win -> [_ _ wt ht] in ( set SYCwinList = win; set ListContainer = mycontainer; _PAINTcontainer mycontainer; set UsersListView = listview; ) ;; /* -- setVideoBitmap -- */ /* Redimensionne et insere une image bitmap dans */ /* le container de la fenetre de communication. */ /* in */ /* infoCom : SYCinfoCom */ /* mBitmap : Bitmap */ /* out */ /* SYSinfoCom */ fun setVideoBitmap(infoCom,mBitmap)= /*_DSbitmap (infoCom.SYCbitmap);*/ let _GETcontainerPositionSize (infoCom.SYCcontainer) -> [ _ _ wcont hcont] in let _CRbitmap _channel wcont hcont -> videobitmap in let _GETbitmapSize mBitmap -> [wbitmap hbitmap] in let _GETbitmapSize infoCom.SYCbitmap -> [wbmp hbmp] in /*let set infoCom.SYCbitmap=mBitmap -> _ in*/ let _SCPbitmap (infoCom.SYCbitmap) 0 0 wbmp hbmp mBitmap 0 0 wbitmap hbitmap nil -> _ in let _SCPbitmap videobitmap 0 0 wcont hcont mBitmap 0 0 wbitmap hbitmap nil -> _ in let _CRalphaBitmap _channel videobitmap nil nil nil -> myalphabitmap in let _CRcompBitmap _channel (infoCom.SYCcontainer) nil [0 0] OBJ_VISIBLE nil myalphabitmap 0 0 wcont hcont -> mycompBitmap in ( _PAINTcontainer (infoCom.SYCcontainer); _DSalphaBitmap myalphabitmap; _DSbitmap videobitmap; _DScompBitmap mycompBitmap; /*_DSbitmap mBitmap;*/ ); infoCom ;; /* #### CallBack -- SysCom Win #### */ fun cbResizeWinComm (obj, param, wi, hi)= /* redimensionnement de la fenètre de communication syscom.*/ let param -> infoCom in /*format 4/3 de l'image. */ let if ((wi-110) >= 32) then if (((wi-110)*3)/4) <= (hi-145) then [(wi-110) (((wi-110)*3)/4)] else [(((hi-145)*4)/3) (hi-145)] else [0 0]-> [wcont hcont] in let [5 5] -> [xcont ycont] in let _SIZEcontainer (infoCom.SYCcontainer) xcont ycont wcont hcont -> SYCcontainer in let 20 -> ypos in let _POSITIONtext infoCom.SYCtextSend (wi-80) 10 60 20 -> SYCtextSend in let _PAINTrectangle obj (wi-90) 5+ypos 80 60 DRAW_SOLID 1 (make_rgb 0 0 0) DRAW_INVISIBLE (make_rgb 255 255 255) -> win in let _POSITIONcheck (infoCom.SYConVideo) (wi-85) 10+ypos 70 25 -> SYConVideo in let _POSITIONcheck (infoCom.SYConSound) (wi-85) 35+ypos 70 25 -> SYConSound in let _POSITIONtext infoCom.SYCtextReceive (wi-80) 55+(2*ypos) 60 20 -> SYCtextReceive in let _PAINTrectangle obj (wi-90) 70+(2*ypos) 80 60 DRAW_SOLID 1 (make_rgb 0 0 0) DRAW_INVISIBLE (make_rgb 255 255 255) -> win in let _POSITIONcheck (infoCom.SYConMyVideo) (wi-85) 75+(2*ypos) 70 25 -> SYConMYVideo in let _POSITIONcheck (infoCom.SYConMySound) (wi-85) 100+(2*ypos) 70 25 -> SYConMySound in let _SIZEbutton (infoCom.SYShangup) 70 25 (wi-85) 180 -> Raccrobutton in let [5 (hi-50) (wi-10) 20 ] -> [xchat ychat wchat hchat] in let _POSITIONtext (infoCom.SYCchatText) xchat ychat wchat hchat -> SYCchatText in let _POSITIONtext (infoCom.SYCstatusBar) 0 (hi-20) wi 20 -> SYCstatusBar in let [5 (ycont+hcont+30) (wi-10) ((hi-60)-(ycont+hcont+30))] -> [xchat ychat wchat hchat] in let _POSITIONrichText (infoCom.SYCinfoText) xchat ychat wchat hchat -> SYCinfoText in let setVideoBitmap infoCom (infoCom.SYCbitmap) -> infoCom in ( mutate (infoCom.SYCposSize) <- [_ _ wi hi]; infoCom ) ;; fun EnableChat(salonId, idCli)= let SearchInfoCom idCli myInfoCom -> infoCom in ( _ENtext infoCom.SYCchatText 0; _PAINTtext infoCom.SYCchatText; ); 0 ;; fun CloseCom (infoCom) = /* envois vers l'interlocuteur de la déconnection du locuteur.*/ let SYCmyrecparams -> [_ _ textparams] in let strcatn textparams.Tid::" "::textparams.FontSize::" "::textparams.FontEffect::" "::textparams.FontName::" "::(itoa (make_rgb 255 0 0))::nil -> tparams in SYCrecText tparams strbuild ("text"::(_loc this "INTERFACE_DISCONNECT" DMSlogin::nil)::nil)::nil; /* fermeture du canal et de la fenetre graphique. */ let SYCgetSalonById SYCsalonList infoCom.SYCsalonId -> MySalon in set SYCsalonList = remove_from_list SYCsalonList MySalon; _DSwindow infoCom.SYCwindos; _DMSsend this SSYCtransmitScript[infoCom.SYCid (strcatn "RemoveSalon "::(itoh (infoCom.SYCsalonId))::" "::(itoh DMSid)::nil)]; if SYCsalonList==nil then ( SYChangUp; SYCstopRecVideo ) else nil; set myInfoCom = remove_from_list myInfoCom infoCom; EndCom infoCom.SYCid; /* -- enable la saisie du client encore connecté -- */ _DMSsend this SSYCtransmitScript[infoCom.SYCid (strcatn "EnableChat "::(itoh (infoCom.SYCsalonId))::" "::(itoh DMSid)::nil)]; 0 ;; fun cbHangDown(obj,param)= CloseCom param ;; fun RemoveSalon(salonId, callerId)= let SYCgetSalonById SYCsalonList salonId -> MySalon in ( set SYCsalonList = remove_from_list SYCsalonList MySalon; RemoveCaller callerId ) ;; fun cbWinClose(obj, param)= CloseCom param ;; fun cbWinDestroy(obj, param)= CloseCom param ;; fun cbWinPaint(obj, param)= let param -> infocom in let infocom.SYCposSize -> [xi yi wi hi] in ( _PAINTrichText infocom.SYCinfoText; let _GETlineCountRichText infocom.SYCinfoText -> l in _SCROLLrichText infocom.SYCinfoText 0 (l-1); setVideoBitmap infocom infocom.SYCbitmap; _PAINTtext infocom.SYCchatText; _PAINTtext infocom.SYCstatusBar; let 20 -> ypos in ( _PAINTrectangle obj (wi-90) 5+ypos 80 60 DRAW_SOLID 1 (make_rgb 0 0 0) DRAW_INVISIBLE (make_rgb 255 255 255); _PAINTrectangle obj (wi-90) 70+(2*ypos) 80 60 DRAW_SOLID 1 (make_rgb 0 0 0) DRAW_INVISIBLE (make_rgb 255 255 255); ) ); 0 ;; fun cbEditText(obj, param, str)= let param -> [infoCom login] in let SYCmyrecparams -> [_ _ textparams] in let strcatn textparams.Tid::" "::textparams.FontSize::" "::textparams.FontEffect::" "::textparams.FontName::" "::(itoa (make_rgb 20 185 20))::nil -> tparams in ( SYCrecText tparams strbuild ("login"::DMSlogin::nil)::("text"::str::nil)::nil; setInfoText infoCom DMSlogin str textparams.FontName (atoi textparams.FontSize) (make_rgb 0 0 255) (atoi textparams.FontEffect); _SETtext obj ""; ); 0 ;; fun cbOnVideo(obj, param, check)= let param -> infocom in let if check == 1 then -1 else 1 -> flag in __SYCiStopStartToReceive infocom.SYCsalonId DMSid infocom.SYCid 0 flag 0; 0 ;; fun cbOnSound(obj, param, check)= let param -> infocom in let if check == 1 then -1 else 1 -> flag in __SYCiStopStartToReceive infocom.SYCsalonId DMSid infocom.SYCid flag 0 0; 0 ;; fun cbOnMyVideo(obj, param, check)= let param -> infocom in let if check == 1 then -1 else 1 -> flag in SYCiStopSTartToSend infocom.SYCsalonId DMSid infocom.SYCid 0 flag 0; 0 ;; fun cbOnMySound(obj, param, check)= let param -> infocom in let if check == 1 then -1 else 1 -> flag in SYCiStopSTartToSend infocom.SYCsalonId DMSid infocom.SYCid flag 0 0; 0 ;; /* -- drawWindows -- */ /* Affichage de l'interface graphique client. */ /* in */ /* out */ /* listview : listview */ fun drawWinComm(IdSalon, Id ,login)= /* Création de la fenetre de dialogue Syscom Audio/Video/Text. */ let (make_rgb 207 170 238) -> backcolor in let [0 0 350 350] -> [xi yi wi hi] in let _CRwindow _channel SYCwinList xi yi wi hi WN_SIZEBOX|WN_DOWN|WN_MENU (strcatn " "::DMSlogin::" <--> "::login::nil) -> win in let _SETwindowMinSize win 350+8 350+29 -> win in /*format 4/3 de l'image. */ let if ((wi-110) >= 32) then if (((wi-110)*3)/4) <= (hi-145) then [(wi-110) (((wi-110)*3)/4)] else [(((hi-145)*4)/3) (hi-145)] else [0 0]-> [wcont hcont] in let [5 5] -> [xcont ycont] in let _CRcontainerFromObjWin _channel win xcont ycont wcont hcont CO_3DBORDER|CO_CHILDINSIDE nil "Video" -> myContainer in let 20 -> ypos in let _CRtext _channel win (wi-80) 10 60 20 ET_ALIGN_LEFT|ET_BORDER (_loc this "INTERFACE_LABEL1" nil) -> SYCtextSend in let _PAINTrectangle win (wi-90) 5+ypos 80 60 DRAW_SOLID 1 (make_rgb 0 0 0) DRAW_INVISIBLE (make_rgb 255 255 255) -> win in let _CRcheck _channel win (wi-85) 10+ypos 70 25 CH_TABFOCUS (_loc this "INTERFACE_CHECK_VIDEO" nil) -> SYConVideo in let _CRcheck _channel win (wi-85) 35+ypos 70 25 CH_TABFOCUS (_loc this "INTERFACE_CHECK_SOUND" nil) -> SYConSound in let _SETcheck SYConVideo 1 -> SYConVideo in let _SETcheck SYConSound 1 -> SYConSound in let _CRtext _channel win (wi-80) 55+(2*ypos) 60 20 ET_ALIGN_LEFT|ET_BORDER (_loc this "INTERFACE_LABEL2" nil)-> SYCtextReceive in let _PAINTrectangle win (wi-90) 70+(2*ypos) 80 60 DRAW_SOLID 1 (make_rgb 0 0 0) DRAW_INVISIBLE (make_rgb 255 255 255) -> win in let _CRcheck _channel win (wi-85) 75+(2*ypos) 70 25 CH_TABFOCUS (_loc this "INTERFACE_CHECK_VIDEO" nil) -> SYConMyVideo in let _CRcheck _channel win (wi-85) 100+(2*ypos) 70 25 CH_TABFOCUS (_loc this "INTERFACE_CHECK_SOUND" nil) -> SYConMySound in let _SETcheck SYConMyVideo 1 -> SYConMyVideo in let _SETcheck SYConMySound 1 -> SYConMySound in let _CRbutton _channel win (wi-85) 180 70 25 PB_DEFAULT (_loc this "INTERFACE_BUTTON_HANGUP" nil) -> Raccrobutton in let [5 (hi-50) (wi-10) 20 ] -> [xchat ychat wchat hchat] in let _CReditLine _channel win xchat ychat wchat hchat ET_DOWN "" -> myEditText in let [0 (hi-25) wi 20] -> [xchat ychat wchat hchat] in let _CRtext _channel win xchat ychat wchat hchat ET_DOWN "" -> MyStatusBar in let _ENtext MyStatusBar 0 -> MyStatusBar in let [5 (ycont+hcont+30) (wi-10) ((hi-60)-(ycont+hcont+30))] -> [xchat ychat wchat hchat] in let _CRrichText _channel win xchat ychat (wchat-10) (hchat-10) ET_ALIGN_LEFT|ET_DOWN|ET_VSCROLL|ET_AVSCROLL|ET_NOEDIT "" -> myInfoText in let _SIZErichText myInfoText wchat hchat xchat ychat -> myInfoText in /*evite un pb de refresh la première fois que l'on affiche le term*/ let _LDbitmap _channel _checkpack "logo.bmp" -> mBitmap in let mkSYCinfoCom [IdSalon Id login win [xi yi wi hi] SYConVideo SYConSound SYConMyVideo SYConMySound SYCtextReceive SYCtextSend Raccrobutton myContainer nil mBitmap nil myInfoText myEditText MyStatusBar ] -> infoCom in /* show the logo */ let setVideoBitmap infoCom (infoCom.SYCbitmap) -> infoCom in let _CBwinSize win @cbResizeWinComm infoCom -> win in let _CBwinPaint win @cbWinPaint infoCom -> win in let _CBwinClose win @cbWinClose infoCom -> win in let _CBwinDestroy win @cbWinDestroy infoCom -> win in let _CBbutton Raccrobutton @cbHangDown infoCom -> Raccrobutton in let _CBlineOk myEditText @cbEditText [infoCom login] -> myEditText in let _CBcheck SYConVideo @cbOnVideo infoCom -> SYConVideo in let _CBcheck SYConSound @cbOnSound infoCom -> SYConSound in let _CBcheck SYConMyVideo @cbOnMyVideo infoCom -> SYConMyVideo in let _CBcheck SYConMySound @cbOnMySound infoCom -> SYConMySound in let _PAINTwindow win -> win in let _PAINTrichText myInfoText -> myInfoText in infoCom ;;