Bilan_Nanopore_20241030.svg 553 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
  3. <svg version="1.2" viewBox="0 0 33867 19050" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xml:space="preserve">
  4. <defs class="ClipPathGroup">
  5. <clipPath id="presentation_clip_path" clipPathUnits="userSpaceOnUse">
  6. <rect x="0" y="0" width="33867" height="19050"/>
  7. </clipPath>
  8. <clipPath id="presentation_clip_path_shrink" clipPathUnits="userSpaceOnUse">
  9. <rect x="33" y="19" width="33800" height="19012"/>
  10. </clipPath>
  11. </defs>
  12. <defs>
  13. <g id="ooo:meta_slides" ooo:number-of-slides="1" ooo:start-slide-number="0">
  14. <g id="ooo:meta_dummy_slide" ooo:slide="dummy-slide" ooo:master="dummy-master-page" ooo:background-visibility="hidden" ooo:master-objects-visibility="hidden" ooo:has-transition="false"/>
  15. <g id="ooo:meta_slide_0" ooo:slide="id1" ooo:master="id2" ooo:display-name="Slide 1" ooo:date-time-visibility="hidden" ooo:footer-visibility="hidden" ooo:has-transition="true"/>
  16. </g>
  17. </defs>
  18. <defs id="presentation-animations"/>
  19. <defs>
  20. <font id="EmbeddedFont_1" horiz-adv-x="2048">
  21. <font-face font-family="Calibri embedded" units-per-em="2048" font-weight="normal" font-style="normal" ascent="1879" descent="476"/>
  22. <missing-glyph horiz-adv-x="2048" d="M 0,0 L 2047,0 2047,2047 0,2047 0,0 Z"/>
  23. <glyph unicode="x" horiz-adv-x="1112" d="M 1124,1120 L 719,575 1145,0 928,0 602,440 276,0 59,0 494,586 96,1120 313,1120 610,721 907,1120 1124,1120 Z"/>
  24. <glyph unicode="v" horiz-adv-x="1112" d="M 61,1120 L 256,1120 606,180 956,1120 1151,1120 731,0 481,0 61,1120 Z"/>
  25. <glyph unicode="u" horiz-adv-x="953" d="M 174,442 L 174,1120 358,1120 358,449 C 358,343 379,264 420,211 461,158 523,131 606,131 705,131 784,163 842,226 899,289 928,376 928,485 L 928,1120 1112,1120 1112,0 928,0 928,172 C 883,104 832,54 773,21 714,-12 645,-29 567,-29 438,-29 341,11 274,91 207,171 174,288 174,442 Z "/>
  26. <glyph unicode="t" horiz-adv-x="715" d="M 375,1438 L 375,1120 754,1120 754,977 375,977 375,369 C 375,278 388,219 413,193 438,167 488,154 565,154 L 754,154 754,0 565,0 C 423,0 325,27 271,80 217,133 190,229 190,369 L 190,977 55,977 55,1120 190,1120 190,1438 375,1438 Z"/>
  27. <glyph unicode="s" horiz-adv-x="874" d="M 907,1087 L 907,913 C 855,940 801,960 745,973 689,986 631,993 571,993 480,993 411,979 366,951 320,923 297,881 297,825 297,782 313,749 346,725 379,700 444,677 543,655 L 606,641 C 737,613 830,574 885,523 940,472 967,400 967,309 967,205 926,123 844,62 761,1 648,-29 504,-29 444,-29 382,-23 317,-12 252,0 183,18 111,41 L 111,231 C 179,196 246,169 312,152 378,134 443,125 508,125 595,125 661,140 708,170 755,199 778,241 778,295 778,345 761,383 728,410 694,437 620,462 506,487 L 442,502 C 328,526 246,563 195,613 144,662 119,730 119,817 119,922 156,1004 231,1061 306,1118 412,1147 549,1147 617,1147 681,1142 741,1132 801,1122 856,1107 907,1087 Z"/>
  28. <glyph unicode="r" horiz-adv-x="663" d="M 842,948 C 821,960 799,969 775,975 750,980 723,983 694,983 590,983 510,949 455,882 399,814 371,717 371,590 L 371,0 186,0 186,1120 371,1120 371,946 C 410,1014 460,1065 522,1098 584,1131 659,1147 748,1147 761,1147 775,1146 790,1145 805,1143 822,1140 841,1137 L 842,948 Z"/>
  29. <glyph unicode="p" horiz-adv-x="1007" d="M 371,168 L 371,-426 186,-426 186,1120 371,1120 371,950 C 410,1017 459,1066 518,1099 577,1131 647,1147 729,1147 865,1147 976,1093 1061,985 1146,877 1188,735 1188,559 1188,383 1146,241 1061,133 976,25 865,-29 729,-29 647,-29 577,-13 518,20 459,52 410,101 371,168 Z M 997,559 C 997,694 969,801 914,878 858,955 781,993 684,993 587,993 510,955 455,878 399,801 371,694 371,559 371,424 399,318 455,241 510,164 587,125 684,125 781,125 858,164 914,241 969,318 997,424 997,559 Z"/>
  30. <glyph unicode="o" horiz-adv-x="1033" d="M 627,991 C 528,991 450,953 393,876 336,799 307,693 307,559 307,425 336,320 393,243 450,166 528,127 627,127 725,127 803,166 860,243 917,320 946,426 946,559 946,692 917,797 860,875 803,952 725,991 627,991 Z M 627,1147 C 787,1147 913,1095 1004,991 1095,887 1141,743 1141,559 1141,376 1095,232 1004,128 913,23 787,-29 627,-29 466,-29 341,23 250,128 159,232 113,376 113,559 113,743 159,887 250,991 341,1095 466,1147 627,1147 Z"/>
  31. <glyph unicode="n" horiz-adv-x="954" d="M 1124,676 L 1124,0 940,0 940,670 C 940,776 919,855 878,908 837,961 775,987 692,987 593,987 514,955 457,892 400,829 371,742 371,633 L 371,0 186,0 186,1120 371,1120 371,946 C 415,1013 467,1064 527,1097 586,1130 655,1147 733,1147 862,1147 959,1107 1025,1028 1091,948 1124,831 1124,676 Z"/>
  32. <glyph unicode="m" horiz-adv-x="1642" d="M 1065,905 C 1111,988 1166,1049 1230,1088 1294,1127 1369,1147 1456,1147 1573,1147 1663,1106 1726,1025 1789,943 1821,827 1821,676 L 1821,0 1636,0 1636,670 C 1636,777 1617,857 1579,909 1541,961 1483,987 1405,987 1310,987 1234,955 1179,892 1124,829 1096,742 1096,633 L 1096,0 911,0 911,670 C 911,778 892,858 854,910 816,961 757,987 678,987 584,987 509,955 454,892 399,828 371,742 371,633 L 371,0 186,0 186,1120 371,1120 371,946 C 413,1015 463,1065 522,1098 581,1131 650,1147 731,1147 812,1147 882,1126 939,1085 996,1044 1038,984 1065,905 Z"/>
  33. <glyph unicode="l" horiz-adv-x="213" d="M 193,1556 L 377,1556 377,0 193,0 193,1556 Z"/>
  34. <glyph unicode="k" horiz-adv-x="1007" d="M 186,1556 L 371,1556 371,637 920,1120 1155,1120 561,596 1180,0 940,0 371,547 371,0 186,0 186,1556 Z"/>
  35. <glyph unicode="j" horiz-adv-x="451" d="M 193,1120 L 377,1120 377,-20 C 377,-163 350,-266 296,-330 241,-394 154,-426 33,-426 L -37,-426 -37,-270 12,-270 C 82,-270 130,-254 155,-222 180,-189 193,-122 193,-20 L 193,1120 Z M 193,1556 L 377,1556 377,1323 193,1323 193,1556 Z"/>
  36. <glyph unicode="i" horiz-adv-x="213" d="M 193,1120 L 377,1120 377,0 193,0 193,1120 Z M 193,1556 L 377,1556 377,1323 193,1323 193,1556 Z"/>
  37. <glyph unicode="h" horiz-adv-x="954" d="M 1124,676 L 1124,0 940,0 940,670 C 940,776 919,855 878,908 837,961 775,987 692,987 593,987 514,955 457,892 400,829 371,742 371,633 L 371,0 186,0 186,1556 371,1556 371,946 C 415,1013 467,1064 527,1097 586,1130 655,1147 733,1147 862,1147 959,1107 1025,1028 1091,948 1124,831 1124,676 Z"/>
  38. <glyph unicode="f" horiz-adv-x="742" d="M 760,1556 L 760,1403 584,1403 C 518,1403 472,1390 447,1363 421,1336 408,1288 408,1219 L 408,1120 711,1120 711,977 408,977 408,0 223,0 223,977 47,977 47,1120 223,1120 223,1198 C 223,1323 252,1414 310,1471 368,1528 460,1556 586,1556 L 760,1556 Z"/>
  39. <glyph unicode="e" horiz-adv-x="1059" d="M 1151,606 L 1151,516 305,516 C 313,389 351,293 420,227 488,160 583,127 705,127 776,127 844,136 911,153 977,170 1043,196 1108,231 L 1108,57 C 1042,29 974,8 905,-7 836,-22 765,-29 694,-29 515,-29 374,23 270,127 165,231 113,372 113,549 113,732 163,878 262,986 361,1093 494,1147 662,1147 813,1147 932,1099 1020,1002 1107,905 1151,773 1151,606 Z M 967,659 C 966,760 938,841 883,901 828,961 755,991 664,991 561,991 479,962 418,904 356,846 320,764 311,659 L 967,659 Z"/>
  40. <glyph unicode="d" horiz-adv-x="1006" d="M 930,950 L 930,1556 1114,1556 1114,0 930,0 930,168 C 891,101 843,52 784,20 725,-13 654,-29 571,-29 436,-29 326,25 241,133 156,241 113,383 113,559 113,735 156,877 241,985 326,1093 436,1147 571,1147 654,1147 725,1131 784,1099 843,1066 891,1017 930,950 Z M 303,559 C 303,424 331,318 387,241 442,164 519,125 616,125 713,125 790,164 846,241 902,318 930,424 930,559 930,694 902,801 846,878 790,955 713,993 616,993 519,993 442,955 387,878 331,801 303,694 303,559 Z"/>
  41. <glyph unicode="c" horiz-adv-x="900" d="M 999,1077 L 999,905 C 947,934 895,955 843,970 790,984 737,991 684,991 565,991 472,953 406,878 340,802 307,696 307,559 307,422 340,316 406,241 472,165 565,127 684,127 737,127 790,134 843,149 895,163 947,184 999,213 L 999,43 C 948,19 895,1 840,-11 785,-23 726,-29 664,-29 495,-29 361,24 262,130 163,236 113,379 113,559 113,742 163,885 264,990 364,1095 501,1147 676,1147 733,1147 788,1141 842,1130 896,1118 948,1100 999,1077 Z"/>
  42. <glyph unicode="b" horiz-adv-x="1007" d="M 997,559 C 997,694 969,801 914,878 858,955 781,993 684,993 587,993 510,955 455,878 399,801 371,694 371,559 371,424 399,318 455,241 510,164 587,125 684,125 781,125 858,164 914,241 969,318 997,424 997,559 Z M 371,950 C 410,1017 459,1066 518,1099 577,1131 647,1147 729,1147 865,1147 976,1093 1061,985 1146,877 1188,735 1188,559 1188,383 1146,241 1061,133 976,25 865,-29 729,-29 647,-29 577,-13 518,20 459,52 410,101 371,168 L 371,0 186,0 186,1556 371,1556 371,950 Z"/>
  43. <glyph unicode="a" horiz-adv-x="980" d="M 702,563 C 553,563 450,546 393,512 336,478 307,420 307,338 307,273 329,221 372,183 415,144 473,125 547,125 649,125 731,161 793,234 854,306 885,402 885,522 L 885,563 702,563 Z M 1069,639 L 1069,0 885,0 885,170 C 843,102 791,52 728,20 665,-13 589,-29 498,-29 383,-29 292,3 225,68 157,132 123,218 123,326 123,452 165,547 250,611 334,675 460,707 627,707 L 885,707 885,725 C 885,810 857,875 802,922 746,968 668,991 567,991 503,991 441,983 380,968 319,953 261,930 205,899 L 205,1069 C 272,1095 338,1115 401,1128 464,1141 526,1147 586,1147 748,1147 869,1105 949,1021 1029,937 1069,810 1069,639 Z"/>
  44. <glyph unicode="T" horiz-adv-x="1297" d="M -6,1493 L 1257,1493 1257,1323 727,1323 727,0 524,0 524,1323 -6,1323 -6,1493 Z"/>
  45. <glyph unicode="S" horiz-adv-x="1060" d="M 1096,1444 L 1096,1247 C 1019,1284 947,1311 879,1329 811,1347 745,1356 682,1356 572,1356 487,1335 428,1292 368,1249 338,1189 338,1110 338,1044 358,994 398,961 437,927 512,900 623,879 L 745,854 C 896,825 1007,775 1079,703 1150,630 1186,533 1186,412 1186,267 1138,158 1041,83 944,8 801,-29 614,-29 543,-29 468,-21 389,-5 309,11 226,35 141,66 L 141,274 C 223,228 303,193 382,170 461,147 538,135 614,135 729,135 818,158 881,203 944,248 975,313 975,397 975,470 953,528 908,569 863,610 789,641 686,662 L 563,686 C 412,716 303,763 236,827 169,891 135,980 135,1094 135,1226 182,1330 275,1406 368,1482 496,1520 659,1520 729,1520 800,1514 873,1501 946,1488 1020,1469 1096,1444 Z"/>
  46. <glyph unicode="O" horiz-adv-x="1403" d="M 807,1356 C 660,1356 544,1301 458,1192 371,1083 328,934 328,745 328,557 371,408 458,299 544,190 660,135 807,135 954,135 1070,190 1156,299 1241,408 1284,557 1284,745 1284,934 1241,1083 1156,1192 1070,1301 954,1356 807,1356 Z M 807,1520 C 1016,1520 1184,1450 1309,1310 1434,1169 1497,981 1497,745 1497,510 1434,322 1309,182 1184,41 1016,-29 807,-29 597,-29 429,41 304,181 178,321 115,509 115,745 115,981 178,1169 304,1310 429,1450 597,1520 807,1520 Z"/>
  47. <glyph unicode="M" horiz-adv-x="1377" d="M 201,1493 L 502,1493 883,477 1266,1493 1567,1493 1567,0 1370,0 1370,1311 985,287 782,287 397,1311 397,0 201,0 201,1493 Z"/>
  48. <glyph unicode="L" horiz-adv-x="954" d="M 201,1493 L 403,1493 403,170 1130,170 1130,0 201,0 201,1493 Z"/>
  49. <glyph unicode="F" horiz-adv-x="874" d="M 201,1493 L 1059,1493 1059,1323 403,1323 403,883 995,883 995,713 403,713 403,0 201,0 201,1493 Z"/>
  50. <glyph unicode="D" horiz-adv-x="1271" d="M 403,1327 L 403,166 647,166 C 853,166 1004,213 1100,306 1195,399 1243,547 1243,748 1243,948 1195,1095 1100,1188 1004,1281 853,1327 647,1327 L 403,1327 Z M 201,1493 L 616,1493 C 905,1493 1118,1433 1253,1313 1388,1192 1456,1004 1456,748 1456,491 1388,302 1252,181 1116,60 904,0 616,0 L 201,0 201,1493 Z"/>
  51. <glyph unicode="C" horiz-adv-x="1218" d="M 1319,1378 L 1319,1165 C 1251,1228 1179,1276 1102,1307 1025,1338 943,1354 856,1354 685,1354 555,1302 464,1198 373,1093 328,942 328,745 328,548 373,398 464,294 555,189 685,137 856,137 943,137 1025,153 1102,184 1179,215 1251,263 1319,326 L 1319,115 C 1248,67 1174,31 1095,7 1016,-17 932,-29 844,-29 618,-29 440,40 310,179 180,317 115,506 115,745 115,985 180,1174 310,1313 440,1451 618,1520 844,1520 933,1520 1018,1508 1097,1485 1176,1461 1250,1425 1319,1378 Z"/>
  52. <glyph unicode="&gt;" horiz-adv-x="1297" d="M 217,1008 L 217,1190 1499,725 1499,559 217,94 217,276 1247,641 217,1008 Z"/>
  53. <glyph unicode="&lt;" horiz-adv-x="1297" d="M 1499,1008 L 467,641 1499,276 1499,94 217,559 217,725 1499,1190 1499,1008 Z"/>
  54. <glyph unicode=";" horiz-adv-x="319" d="M 240,1059 L 451,1059 451,805 240,805 240,1059 Z M 240,254 L 451,254 451,82 287,-238 158,-238 240,82 240,254 Z"/>
  55. <glyph unicode="9" horiz-adv-x="1059" d="M 225,31 L 225,215 C 276,191 327,173 379,160 431,147 482,141 532,141 665,141 767,186 838,276 908,365 948,501 958,684 919,627 870,583 811,552 752,521 686,506 614,506 465,506 347,551 260,642 173,732 129,855 129,1012 129,1165 174,1288 265,1381 356,1474 476,1520 627,1520 800,1520 932,1454 1023,1322 1114,1189 1159,997 1159,745 1159,510 1103,322 992,182 880,41 730,-29 541,-29 490,-29 439,-24 387,-14 335,-4 281,11 225,31 Z M 627,664 C 718,664 790,695 843,757 896,819 922,904 922,1012 922,1119 896,1204 843,1267 790,1329 718,1360 627,1360 536,1360 465,1329 412,1267 359,1204 332,1119 332,1012 332,904 359,819 412,757 465,695 536,664 627,664 Z"/>
  56. <glyph unicode="8" horiz-adv-x="1033" d="M 651,709 C 555,709 480,683 425,632 370,581 342,510 342,420 342,330 370,259 425,208 480,157 555,131 651,131 747,131 823,157 878,209 933,260 961,331 961,420 961,510 934,581 879,632 824,683 748,709 651,709 Z M 449,795 C 362,816 295,857 247,916 198,975 174,1048 174,1133 174,1252 217,1347 302,1416 387,1485 503,1520 651,1520 800,1520 916,1485 1001,1416 1086,1347 1128,1252 1128,1133 1128,1048 1104,975 1056,916 1007,857 940,816 854,795 951,772 1027,728 1082,662 1136,596 1163,515 1163,420 1163,275 1119,164 1031,87 942,10 816,-29 651,-29 486,-29 360,10 272,87 183,164 139,275 139,420 139,515 166,596 221,662 276,728 352,772 449,795 Z M 375,1114 C 375,1037 399,976 448,933 496,890 564,868 651,868 738,868 806,890 855,933 904,976 928,1037 928,1114 928,1191 904,1252 855,1295 806,1338 738,1360 651,1360 564,1360 496,1338 448,1295 399,1252 375,1191 375,1114 Z"/>
  57. <glyph unicode="7" horiz-adv-x="980" d="M 168,1493 L 1128,1493 1128,1407 586,0 375,0 885,1323 168,1323 168,1493 Z"/>
  58. <glyph unicode="6" horiz-adv-x="1060" d="M 676,827 C 585,827 514,796 461,734 408,672 381,587 381,479 381,372 408,287 461,225 514,162 585,131 676,131 767,131 839,162 892,225 945,287 971,372 971,479 971,587 945,672 892,734 839,796 767,827 676,827 Z M 1077,1460 L 1077,1276 C 1026,1300 975,1318 924,1331 872,1344 821,1350 770,1350 637,1350 535,1305 465,1215 394,1125 354,989 344,807 383,865 433,910 492,941 551,972 617,987 688,987 838,987 957,942 1044,851 1131,760 1174,636 1174,479 1174,326 1129,203 1038,110 947,17 827,-29 676,-29 503,-29 371,37 280,170 189,302 143,494 143,745 143,981 199,1169 311,1310 423,1450 573,1520 762,1520 813,1520 864,1515 916,1505 967,1495 1021,1480 1077,1460 Z"/>
  59. <glyph unicode="5" horiz-adv-x="1007" d="M 221,1493 L 1014,1493 1014,1323 406,1323 406,957 C 435,967 465,975 494,980 523,985 553,987 582,987 749,987 881,941 978,850 1075,759 1124,635 1124,479 1124,318 1074,194 974,105 874,16 733,-29 551,-29 488,-29 425,-24 360,-13 295,-2 227,14 158,35 L 158,238 C 218,205 280,181 344,165 408,149 476,141 547,141 662,141 754,171 821,232 888,293 922,375 922,479 922,583 888,665 821,726 754,787 662,817 547,817 493,817 439,811 386,799 332,787 277,768 221,743 L 221,1493 Z"/>
  60. <glyph unicode="4" horiz-adv-x="1113" d="M 774,1317 L 264,520 774,520 774,1317 Z M 721,1493 L 975,1493 975,520 1188,520 1188,352 975,352 975,0 774,0 774,352 100,352 100,547 721,1493 Z"/>
  61. <glyph unicode="3" horiz-adv-x="1007" d="M 831,805 C 928,784 1003,741 1058,676 1112,611 1139,530 1139,434 1139,287 1088,173 987,92 886,11 742,-29 555,-29 492,-29 428,-23 362,-11 295,2 227,20 156,45 L 156,240 C 212,207 273,183 340,166 407,149 476,141 549,141 676,141 772,166 839,216 905,266 938,339 938,434 938,522 907,591 846,641 784,690 698,715 588,715 L 414,715 414,881 596,881 C 695,881 771,901 824,941 877,980 903,1037 903,1112 903,1189 876,1248 822,1289 767,1330 689,1350 588,1350 533,1350 473,1344 410,1332 347,1320 277,1301 201,1276 L 201,1456 C 278,1477 350,1493 417,1504 484,1515 547,1520 606,1520 759,1520 881,1485 970,1416 1059,1346 1104,1252 1104,1133 1104,1050 1080,981 1033,924 986,867 918,827 831,805 Z"/>
  62. <glyph unicode="2" horiz-adv-x="980" d="M 393,170 L 1098,170 1098,0 150,0 150,170 C 227,249 331,356 464,490 596,623 679,709 713,748 778,821 823,882 849,933 874,983 887,1032 887,1081 887,1160 859,1225 804,1275 748,1325 675,1350 586,1350 523,1350 456,1339 386,1317 315,1295 240,1262 160,1217 L 160,1421 C 241,1454 317,1478 388,1495 459,1512 523,1520 582,1520 737,1520 860,1481 952,1404 1044,1327 1090,1223 1090,1094 1090,1033 1079,975 1056,920 1033,865 991,800 930,725 913,706 860,650 771,558 682,465 556,336 393,170 Z"/>
  63. <glyph unicode="1" horiz-adv-x="900" d="M 254,170 L 584,170 584,1309 225,1237 225,1421 582,1493 784,1493 784,170 1114,170 1114,0 254,0 254,170 Z"/>
  64. <glyph unicode="0" horiz-adv-x="1033" d="M 651,1360 C 547,1360 469,1309 417,1207 364,1104 338,950 338,745 338,540 364,387 417,285 469,182 547,131 651,131 756,131 834,182 887,285 939,387 965,540 965,745 965,950 939,1104 887,1207 834,1309 756,1360 651,1360 Z M 651,1520 C 818,1520 946,1454 1035,1322 1123,1189 1167,997 1167,745 1167,494 1123,302 1035,170 946,37 818,-29 651,-29 484,-29 356,37 268,170 179,302 135,494 135,745 135,997 179,1189 268,1322 356,1454 484,1520 651,1520 Z"/>
  65. <glyph unicode="/" horiz-adv-x="689" d="M 520,1493 L 690,1493 170,-190 0,-190 520,1493 Z"/>
  66. <glyph unicode="+" horiz-adv-x="1297" d="M 942,1284 L 942,727 1499,727 1499,557 942,557 942,0 774,0 774,557 217,557 217,727 774,727 774,1284 942,1284 Z"/>
  67. <glyph unicode="*" horiz-adv-x="927" d="M 963,1247 L 604,1053 963,858 905,760 569,963 569,586 455,586 455,963 119,760 61,858 420,1053 61,1247 119,1346 455,1143 455,1520 569,1520 569,1143 905,1346 963,1247 Z"/>
  68. <glyph unicode=" " horiz-adv-x="635"/>
  69. </font>
  70. </defs>
  71. <defs>
  72. <font id="EmbeddedFont_2" horiz-adv-x="2048">
  73. <font-face font-family="Calibri embedded" units-per-em="2048" font-weight="bold" font-style="normal" ascent="1879" descent="476"/>
  74. <missing-glyph horiz-adv-x="2048" d="M 0,0 L 2047,0 2047,2047 0,2047 0,0 Z"/>
  75. <glyph unicode="t" horiz-adv-x="928" d="M 563,1438 L 563,1120 932,1120 932,864 563,864 563,389 C 563,337 573,302 594,284 615,265 656,256 717,256 L 901,256 901,0 594,0 C 453,0 353,30 294,89 235,148 205,248 205,389 L 205,864 27,864 27,1120 205,1120 205,1438 563,1438 Z"/>
  76. <glyph unicode="s" horiz-adv-x="1060" d="M 1047,1085 L 1047,813 C 970,845 896,869 825,885 754,901 686,909 623,909 555,909 505,901 472,884 439,867 422,840 422,805 422,776 435,754 460,739 485,724 529,712 594,705 L 657,696 C 840,673 964,634 1027,581 1090,528 1122,444 1122,330 1122,211 1078,121 990,61 902,1 771,-29 596,-29 522,-29 446,-23 367,-12 288,0 206,18 123,41 L 123,313 C 194,278 268,252 343,235 418,218 494,209 571,209 641,209 694,219 729,238 764,257 782,286 782,324 782,356 770,380 746,396 721,411 673,423 600,432 L 537,440 C 378,460 266,497 202,551 138,605 106,687 106,797 106,916 147,1004 228,1061 309,1118 434,1147 602,1147 668,1147 737,1142 810,1132 883,1122 962,1106 1047,1085 Z"/>
  77. <glyph unicode="r" horiz-adv-x="847" d="M 1004,815 C 973,830 942,841 911,848 880,855 848,858 817,858 725,858 654,829 605,770 555,711 530,626 530,516 L 530,0 172,0 172,1120 530,1120 530,936 C 576,1009 629,1062 689,1095 748,1128 820,1145 903,1145 915,1145 928,1145 942,1145 956,1145 976,1143 1003,1139 L 1004,815 Z"/>
  78. <glyph unicode="p" horiz-adv-x="1218" d="M 530,162 L 530,-426 172,-426 172,1120 530,1120 530,956 C 579,1021 634,1070 694,1101 754,1132 823,1147 901,1147 1039,1147 1152,1092 1241,983 1330,873 1374,732 1374,559 1374,386 1330,245 1241,136 1152,26 1039,-29 901,-29 823,-29 754,-13 694,18 634,49 579,97 530,162 Z M 768,887 C 691,887 633,859 592,803 551,746 530,665 530,559 530,453 551,372 592,316 633,259 691,231 768,231 845,231 903,259 944,315 984,371 1004,452 1004,559 1004,666 984,747 944,803 903,859 845,887 768,887 Z"/>
  79. <glyph unicode="o" horiz-adv-x="1245" d="M 705,891 C 626,891 565,863 524,806 482,749 461,666 461,559 461,452 482,370 524,313 565,256 626,227 705,227 783,227 843,256 884,313 925,370 946,452 946,559 946,666 925,749 884,806 843,863 783,891 705,891 Z M 705,1147 C 898,1147 1048,1095 1157,991 1265,887 1319,743 1319,559 1319,375 1265,231 1157,127 1048,23 898,-29 705,-29 512,-29 361,23 252,127 143,231 88,375 88,559 88,743 143,887 252,991 361,1095 512,1147 705,1147 Z"/>
  80. <glyph unicode="n" horiz-adv-x="1138" d="M 1298,682 L 1298,0 938,0 938,111 938,522 C 938,619 936,685 932,722 927,759 920,786 909,803 895,826 876,845 852,858 828,871 801,877 770,877 695,877 637,848 594,791 551,733 530,653 530,551 L 530,0 172,0 172,1120 530,1120 530,956 C 584,1021 641,1070 702,1101 763,1132 830,1147 903,1147 1032,1147 1131,1107 1198,1028 1265,949 1298,833 1298,682 Z"/>
  81. <glyph unicode="l" horiz-adv-x="371" d="M 172,1556 L 530,1556 530,0 172,0 172,1556 Z"/>
  82. <glyph unicode="j" horiz-adv-x="609" d="M 172,1120 L 530,1120 530,20 C 530,-130 494,-244 422,-324 350,-402 246,-442 109,-442 L -68,-442 -68,-207 -6,-207 C 62,-207 109,-192 134,-161 159,-130 172,-70 172,20 L 172,1120 Z M 172,1556 L 530,1556 530,1264 172,1264 172,1556 Z"/>
  83. <glyph unicode="i" horiz-adv-x="371" d="M 172,1120 L 530,1120 530,0 172,0 172,1120 Z M 172,1556 L 530,1556 530,1264 172,1264 172,1556 Z"/>
  84. <glyph unicode="h" horiz-adv-x="1138" d="M 1298,682 L 1298,0 938,0 938,111 938,520 C 938,618 936,685 932,722 927,759 920,786 909,803 895,826 876,845 852,858 828,871 801,877 770,877 695,877 637,848 594,791 551,733 530,653 530,551 L 530,0 172,0 172,1556 530,1556 530,956 C 584,1021 641,1070 702,1101 763,1132 830,1147 903,1147 1032,1147 1131,1107 1198,1028 1265,949 1298,833 1298,682 Z"/>
  85. <glyph unicode="f" horiz-adv-x="901" d="M 909,1556 L 909,1321 711,1321 C 660,1321 625,1312 605,1294 585,1275 575,1243 575,1198 L 575,1120 881,1120 881,864 575,864 575,0 217,0 217,864 39,864 39,1120 217,1120 217,1198 C 217,1320 251,1410 319,1469 387,1527 492,1556 635,1556 L 909,1556 Z"/>
  86. <glyph unicode="e" horiz-adv-x="1218" d="M 1290,563 L 1290,461 453,461 C 462,377 492,314 544,272 596,230 669,209 762,209 837,209 915,220 994,243 1073,265 1154,299 1237,344 L 1237,68 C 1152,36 1068,12 983,-5 898,-21 814,-29 729,-29 526,-29 369,23 257,126 144,229 88,373 88,559 88,742 143,885 254,990 364,1095 516,1147 709,1147 885,1147 1026,1094 1132,988 1237,882 1290,740 1290,563 Z M 922,682 C 922,750 902,805 863,847 823,888 771,909 707,909 638,909 581,890 538,851 495,812 468,755 457,682 L 922,682 Z"/>
  87. <glyph unicode="d" horiz-adv-x="1218" d="M 934,956 L 934,1556 1294,1556 1294,0 934,0 934,162 C 885,96 830,48 771,17 712,-14 643,-29 565,-29 427,-29 314,26 225,136 136,245 92,386 92,559 92,732 136,873 225,983 314,1092 427,1147 565,1147 642,1147 711,1132 771,1101 830,1070 885,1021 934,956 Z M 698,231 C 775,231 833,259 874,315 914,371 934,452 934,559 934,666 914,747 874,803 833,859 775,887 698,887 622,887 564,859 524,803 483,747 463,666 463,559 463,452 483,371 524,315 564,259 622,231 698,231 Z"/>
  88. <glyph unicode="c" horiz-adv-x="1007" d="M 1077,1085 L 1077,793 C 1028,826 980,851 931,867 882,883 831,891 778,891 678,891 600,862 545,804 489,745 461,664 461,559 461,454 489,373 545,315 600,256 678,227 778,227 834,227 887,235 938,252 988,269 1034,293 1077,326 L 1077,33 C 1021,12 964,-3 907,-14 849,-24 791,-29 733,-29 531,-29 373,23 259,127 145,230 88,374 88,559 88,744 145,888 259,992 373,1095 531,1147 733,1147 792,1147 850,1142 907,1132 964,1121 1020,1106 1077,1085 Z"/>
  89. <glyph unicode="a" horiz-adv-x="1139" d="M 674,504 C 599,504 543,491 506,466 468,441 449,403 449,354 449,309 464,273 495,248 525,222 567,209 621,209 688,209 745,233 791,282 837,330 860,390 860,463 L 860,504 674,504 Z M 1221,639 L 1221,0 860,0 860,166 C 812,98 758,49 698,18 638,-13 565,-29 479,-29 363,-29 269,5 197,73 124,140 88,228 88,336 88,467 133,564 224,625 314,686 456,717 649,717 L 860,717 860,745 C 860,802 838,843 793,870 748,896 679,909 584,909 507,909 436,901 370,886 304,871 243,848 186,817 L 186,1090 C 263,1109 340,1123 417,1133 494,1142 572,1147 649,1147 851,1147 997,1107 1087,1028 1176,948 1221,818 1221,639 Z"/>
  90. <glyph unicode="Z" horiz-adv-x="1324" d="M 115,1493 L 1370,1493 1370,1260 569,291 1393,291 1393,0 92,0 92,233 893,1202 115,1202 115,1493 Z"/>
  91. <glyph unicode="X" horiz-adv-x="1510" d="M 1020,762 L 1538,0 1137,0 788,510 442,0 39,0 557,762 59,1493 461,1493 788,1012 1114,1493 1518,1493 1020,762 Z"/>
  92. <glyph unicode="W" horiz-adv-x="2144" d="M 61,1493 L 430,1493 688,408 944,1493 1315,1493 1571,408 1829,1493 2195,1493 1843,0 1399,0 1128,1135 860,0 416,0 61,1493 Z"/>
  93. <glyph unicode="T" horiz-adv-x="1403" d="M 10,1493 L 1386,1493 1386,1202 891,1202 891,0 506,0 506,1202 10,1202 10,1493 Z"/>
  94. <glyph unicode="S" horiz-adv-x="1192" d="M 1227,1446 L 1227,1130 C 1145,1167 1065,1194 987,1213 909,1232 835,1241 766,1241 674,1241 606,1228 562,1203 518,1178 496,1138 496,1085 496,1045 511,1014 541,992 570,969 624,950 702,934 L 866,901 C 1032,868 1150,817 1220,749 1290,681 1325,584 1325,459 1325,294 1276,172 1179,92 1081,11 932,-29 731,-29 636,-29 541,-20 446,-2 351,16 255,43 160,78 L 160,403 C 255,352 348,314 437,289 526,263 611,250 694,250 778,250 842,264 887,292 932,320 954,360 954,412 954,459 939,495 909,520 878,545 818,568 727,588 L 578,621 C 429,653 320,704 251,774 182,844 147,938 147,1057 147,1206 195,1320 291,1400 387,1480 525,1520 705,1520 787,1520 871,1514 958,1502 1045,1489 1134,1471 1227,1446 Z"/>
  95. <glyph unicode="R" horiz-adv-x="1351" d="M 735,831 C 816,831 874,846 909,876 944,906 961,955 961,1024 961,1092 944,1141 909,1170 874,1199 816,1214 735,1214 L 573,1214 573,831 735,831 Z M 573,565 L 573,0 188,0 188,1493 776,1493 C 973,1493 1117,1460 1209,1394 1300,1328 1346,1224 1346,1081 1346,982 1322,901 1275,838 1227,775 1155,728 1059,698 1112,686 1159,659 1201,617 1242,574 1284,510 1327,424 L 1536,0 1126,0 944,371 C 907,446 870,497 833,524 795,551 745,565 682,565 L 573,565 Z"/>
  96. <glyph unicode="P" horiz-adv-x="1245" d="M 188,1493 L 827,1493 C 1017,1493 1163,1451 1265,1367 1366,1282 1417,1162 1417,1006 1417,849 1366,729 1265,645 1163,560 1017,518 827,518 L 573,518 573,0 188,0 188,1493 Z M 573,1214 L 573,797 786,797 C 861,797 918,815 959,852 1000,888 1020,939 1020,1006 1020,1073 1000,1124 959,1160 918,1196 861,1214 786,1214 L 573,1214 Z"/>
  97. <glyph unicode="O" horiz-adv-x="1562" d="M 870,1241 C 753,1241 662,1198 597,1111 532,1024 500,902 500,745 500,588 532,467 597,380 662,293 753,250 870,250 988,250 1079,293 1144,380 1209,467 1241,588 1241,745 1241,902 1209,1024 1144,1111 1079,1198 988,1241 870,1241 Z M 870,1520 C 1110,1520 1298,1451 1434,1314 1570,1177 1638,987 1638,745 1638,504 1570,314 1434,177 1298,40 1110,-29 870,-29 631,-29 443,40 307,177 170,314 102,504 102,745 102,987 170,1177 307,1314 443,1451 631,1520 870,1520 Z"/>
  98. <glyph unicode="N" horiz-adv-x="1351" d="M 188,1493 L 618,1493 1161,469 1161,1493 1526,1493 1526,0 1096,0 553,1024 553,0 188,0 188,1493 Z"/>
  99. <glyph unicode="L" horiz-adv-x="1060" d="M 188,1493 L 573,1493 573,291 1249,291 1249,0 188,0 188,1493 Z"/>
  100. <glyph unicode="H" horiz-adv-x="1351" d="M 188,1493 L 573,1493 573,924 1141,924 1141,1493 1526,1493 1526,0 1141,0 1141,633 573,633 573,0 188,0 188,1493 Z"/>
  101. <glyph unicode="G" horiz-adv-x="1457" d="M 1530,111 C 1434,64 1334,29 1231,6 1128,-17 1021,-29 911,-29 662,-29 465,41 320,180 175,319 102,507 102,745 102,986 176,1175 324,1313 472,1451 675,1520 932,1520 1031,1520 1127,1511 1218,1492 1309,1473 1394,1446 1475,1409 L 1475,1100 C 1392,1147 1309,1183 1227,1206 1144,1229 1062,1241 979,1241 826,1241 708,1198 625,1113 542,1027 500,904 500,745 500,587 540,465 620,379 700,293 814,250 961,250 1001,250 1038,253 1073,258 1107,263 1138,270 1165,281 L 1165,571 930,571 930,829 1530,829 1530,111 Z"/>
  102. <glyph unicode="F" horiz-adv-x="1060" d="M 188,1493 L 1227,1493 1227,1202 573,1202 573,924 1188,924 1188,633 573,633 573,0 188,0 188,1493 Z"/>
  103. <glyph unicode="B" horiz-adv-x="1245" d="M 786,915 C 847,915 893,928 924,955 955,982 971,1021 971,1073 971,1124 955,1164 924,1191 893,1218 847,1231 786,1231 L 573,1231 573,915 786,915 Z M 799,262 C 876,262 935,278 974,311 1013,344 1032,393 1032,459 1032,524 1013,572 974,605 935,637 877,653 799,653 L 573,653 573,262 799,262 Z M 1157,799 C 1240,775 1304,731 1349,666 1394,601 1417,522 1417,428 1417,284 1368,177 1271,106 1174,35 1026,0 827,0 L 188,0 188,1493 766,1493 C 973,1493 1124,1462 1217,1399 1310,1336 1356,1236 1356,1098 1356,1025 1339,964 1305,913 1271,862 1222,824 1157,799 Z"/>
  104. <glyph unicode="A" horiz-adv-x="1589" d="M 1094,272 L 492,272 397,0 10,0 563,1493 1022,1493 1575,0 1188,0 1094,272 Z M 588,549 L 997,549 793,1143 588,549 Z"/>
  105. <glyph unicode="&lt;" horiz-adv-x="1297" d="M 1499,973 L 535,641 1499,311 1499,61 217,524 217,760 1499,1223 1499,973 Z"/>
  106. <glyph unicode="9" horiz-adv-x="1218" d="M 205,33 L 205,309 C 266,280 325,259 381,245 437,230 492,223 547,223 662,223 751,255 815,319 879,382 917,477 928,602 883,569 834,544 783,527 732,510 676,502 616,502 463,502 340,547 247,636 153,725 106,842 106,987 106,1148 158,1276 263,1373 367,1470 507,1518 682,1518 877,1518 1027,1452 1134,1321 1241,1190 1294,1004 1294,764 1294,517 1232,324 1107,183 982,42 811,-29 594,-29 524,-29 457,-24 393,-14 329,-3 266,12 205,33 Z M 680,752 C 747,752 798,774 832,818 866,861 883,927 883,1014 883,1101 866,1166 832,1210 798,1254 747,1276 680,1276 613,1276 562,1254 528,1210 494,1166 477,1101 477,1014 477,927 494,861 528,818 562,774 613,752 680,752 Z"/>
  107. <glyph unicode="8" horiz-adv-x="1191" d="M 713,668 C 641,668 586,648 547,609 508,570 489,513 489,440 489,367 508,311 547,272 586,233 641,213 713,213 784,213 839,233 877,272 915,311 934,367 934,440 934,514 915,571 877,610 839,649 784,668 713,668 Z M 432,795 C 341,822 273,864 227,921 181,978 158,1048 158,1133 158,1259 205,1355 299,1421 393,1487 531,1520 713,1520 894,1520 1031,1487 1125,1422 1219,1356 1266,1260 1266,1133 1266,1048 1243,978 1197,921 1150,864 1082,822 991,795 1092,767 1169,722 1221,659 1272,596 1298,516 1298,420 1298,272 1249,160 1151,85 1052,9 906,-29 713,-29 519,-29 373,9 274,85 175,160 125,272 125,420 125,516 151,596 203,659 254,722 331,767 432,795 Z M 522,1094 C 522,1035 539,989 572,957 605,925 652,909 713,909 773,909 819,925 852,957 885,989 901,1035 901,1094 901,1153 885,1199 852,1231 819,1262 773,1278 713,1278 652,1278 605,1262 572,1230 539,1198 522,1153 522,1094 Z"/>
  108. <glyph unicode="7" horiz-adv-x="1139" d="M 137,1493 L 1262,1493 1262,1276 680,0 305,0 856,1210 137,1210 137,1493 Z"/>
  109. <glyph unicode="6" horiz-adv-x="1218" d="M 741,737 C 674,737 623,715 590,672 556,628 539,562 539,475 539,388 556,322 590,279 623,235 674,213 741,213 809,213 860,235 894,279 927,322 944,388 944,475 944,562 927,628 894,672 860,715 809,737 741,737 Z M 1217,1454 L 1217,1178 C 1154,1208 1094,1230 1038,1245 982,1259 927,1266 874,1266 759,1266 670,1234 606,1171 542,1107 505,1012 494,887 538,920 586,944 637,961 688,977 744,985 805,985 958,985 1081,940 1175,851 1268,762 1315,645 1315,500 1315,340 1263,212 1158,116 1053,19 913,-29 737,-29 543,-29 393,37 287,168 180,299 127,484 127,725 127,972 189,1166 314,1307 438,1448 608,1518 825,1518 894,1518 960,1513 1025,1502 1090,1491 1154,1475 1217,1454 Z"/>
  110. <glyph unicode="4" horiz-adv-x="1271" d="M 754,1176 L 332,551 754,551 754,1176 Z M 690,1493 L 1118,1493 1118,551 1331,551 1331,272 1118,272 1118,0 754,0 754,272 92,272 92,602 690,1493 Z"/>
  111. <glyph unicode="3" horiz-adv-x="1139" d="M 954,805 C 1055,779 1131,734 1184,670 1236,605 1262,523 1262,424 1262,276 1205,164 1092,87 979,10 813,-29 596,-29 519,-29 443,-23 366,-11 289,2 212,20 137,45 L 137,342 C 209,306 281,279 352,261 423,242 492,233 561,233 663,233 741,251 796,286 850,321 877,372 877,438 877,506 849,558 794,593 738,628 656,645 547,645 L 393,645 393,893 555,893 C 652,893 724,908 771,939 818,969 842,1015 842,1077 842,1134 819,1179 773,1210 727,1241 662,1257 578,1257 516,1257 453,1250 390,1236 327,1222 264,1201 201,1174 L 201,1456 C 277,1477 352,1493 427,1504 502,1515 575,1520 647,1520 841,1520 986,1488 1083,1425 1179,1361 1227,1265 1227,1137 1227,1050 1204,978 1158,923 1112,867 1044,828 954,805 Z"/>
  112. <glyph unicode="2" horiz-adv-x="1086" d="M 590,283 L 1247,283 1247,0 162,0 162,283 707,764 C 756,808 792,851 815,893 838,935 850,979 850,1024 850,1094 827,1150 780,1193 733,1236 670,1257 592,1257 532,1257 466,1244 395,1219 324,1193 247,1155 166,1104 L 166,1432 C 253,1461 338,1483 423,1498 508,1513 591,1520 672,1520 851,1520 990,1481 1089,1402 1188,1323 1237,1214 1237,1073 1237,992 1216,916 1174,846 1132,775 1044,681 909,563 L 590,283 Z"/>
  113. <glyph unicode="1" horiz-adv-x="1085" d="M 240,266 L 580,266 580,1231 231,1159 231,1421 578,1493 944,1493 944,266 1284,266 1284,0 240,0 240,266 Z"/>
  114. <glyph unicode="0" horiz-adv-x="1245" d="M 942,748 C 942,935 925,1066 890,1143 855,1219 796,1257 713,1257 630,1257 571,1219 536,1143 501,1066 483,935 483,748 483,559 501,426 536,349 571,272 630,233 713,233 795,233 854,272 889,349 924,426 942,559 942,748 Z M 1327,745 C 1327,498 1274,307 1167,173 1060,38 909,-29 713,-29 516,-29 365,38 258,173 151,307 98,498 98,745 98,993 151,1184 258,1319 365,1453 516,1520 713,1520 909,1520 1060,1453 1167,1319 1274,1184 1327,993 1327,745 Z"/>
  115. <glyph unicode="-" horiz-adv-x="636" d="M 111,735 L 739,735 739,444 111,444 111,735 Z"/>
  116. <glyph unicode="*" horiz-adv-x="1007" d="M 1030,1217 L 700,1044 1030,870 954,729 621,913 621,569 451,569 451,913 117,729 41,870 375,1044 41,1217 117,1358 451,1176 451,1520 621,1520 621,1176 954,1358 1030,1217 Z"/>
  117. <glyph unicode=" " horiz-adv-x="714"/>
  118. </font>
  119. </defs>
  120. <defs>
  121. <font id="EmbeddedFont_3" horiz-adv-x="2048">
  122. <font-face font-family="Liberation Sans embedded" units-per-em="2048" font-weight="normal" font-style="normal" ascent="1852" descent="423"/>
  123. <missing-glyph horiz-adv-x="2048" d="M 0,0 L 2047,0 2047,2047 0,2047 0,0 Z"/>
  124. <glyph unicode="–" horiz-adv-x="1139" d="M 0,451 L 0,588 1138,588 1138,451 0,451 Z"/>
  125. <glyph unicode="é" horiz-adv-x="980" d="M 276,503 C 276,379 302,283 353,216 404,149 479,115 578,115 656,115 719,131 766,162 813,193 844,233 861,281 L 1019,236 C 954,65 807,-20 578,-20 418,-20 296,28 213,123 129,218 87,360 87,548 87,727 129,864 213,959 296,1054 416,1102 571,1102 889,1102 1048,910 1048,527 L 1048,503 276,503 Z M 862,641 C 852,755 823,838 775,891 727,943 658,969 568,969 481,969 412,940 361,882 310,823 282,743 278,641 L 862,641 Z M 440,1201 L 440,1221 657,1508 864,1508 864,1479 534,1201 440,1201 Z"/>
  126. <glyph unicode=" " horiz-adv-x="1"/>
  127. <glyph unicode="v" horiz-adv-x="1033" d="M 613,0 L 400,0 7,1082 199,1082 437,378 C 446,351 469,272 506,141 L 541,258 580,376 826,1082 1017,1082 613,0 Z"/>
  128. <glyph unicode="u" horiz-adv-x="874" d="M 314,1082 L 314,396 C 314,325 321,269 335,230 349,191 371,162 402,145 433,128 478,119 537,119 624,119 692,149 742,208 792,267 817,350 817,455 L 817,1082 997,1082 997,231 C 997,105 999,28 1003,0 L 833,0 C 832,3 832,12 831,27 830,42 830,59 829,78 828,97 826,132 825,185 L 822,185 C 781,110 733,58 679,27 624,-4 557,-20 476,-20 357,-20 271,10 216,69 161,128 133,225 133,361 L 133,1082 314,1082 Z"/>
  129. <glyph unicode="t" horiz-adv-x="531" d="M 554,8 C 495,-8 434,-16 372,-16 228,-16 156,66 156,229 L 156,951 31,951 31,1082 163,1082 216,1324 336,1324 336,1082 536,1082 536,951 336,951 336,268 C 336,216 345,180 362,159 379,138 408,127 450,127 474,127 509,132 554,141 L 554,8 Z"/>
  130. <glyph unicode="s" horiz-adv-x="901" d="M 950,299 C 950,197 912,118 835,63 758,8 650,-20 511,-20 376,-20 273,2 200,47 127,91 79,160 57,254 L 216,285 C 231,227 263,185 311,158 359,131 426,117 511,117 602,117 669,131 712,159 754,187 775,229 775,285 775,328 760,362 731,389 702,416 654,438 589,455 L 460,489 C 357,516 283,542 240,568 196,593 162,624 137,661 112,698 100,743 100,796 100,895 135,970 206,1022 276,1073 378,1099 513,1099 632,1099 727,1078 798,1036 868,994 912,927 931,834 L 769,814 C 759,862 732,899 689,925 645,950 586,963 513,963 432,963 372,951 333,926 294,901 275,864 275,814 275,783 283,758 299,738 315,718 339,701 370,687 401,673 467,654 568,629 663,605 732,583 774,563 816,542 849,520 874,495 898,470 917,442 930,410 943,377 950,340 950,299 Z"/>
  131. <glyph unicode="r" horiz-adv-x="530" d="M 142,0 L 142,830 C 142,906 140,990 136,1082 L 306,1082 C 311,959 314,886 314,861 L 318,861 C 347,954 380,1017 417,1051 454,1085 507,1102 575,1102 599,1102 623,1099 648,1092 L 648,927 C 624,934 592,937 552,937 477,937 420,905 381,841 342,776 322,684 322,564 L 322,0 142,0 Z"/>
  132. <glyph unicode="p" horiz-adv-x="953" d="M 1053,546 C 1053,169 920,-20 655,-20 488,-20 376,43 319,168 L 314,168 C 317,163 318,106 318,-2 L 318,-425 138,-425 138,861 C 138,972 136,1046 132,1082 L 306,1082 C 307,1079 308,1070 309,1054 310,1037 312,1012 314,978 315,944 316,921 316,908 L 320,908 C 352,975 394,1024 447,1055 500,1086 569,1101 655,1101 788,1101 888,1056 954,967 1020,878 1053,737 1053,546 Z M 864,542 C 864,693 844,800 803,865 762,930 698,962 609,962 538,962 482,947 442,917 401,887 371,840 350,777 329,713 318,630 318,528 318,386 341,281 386,214 431,147 505,113 607,113 696,113 762,146 803,212 844,277 864,387 864,542 Z"/>
  133. <glyph unicode="o" horiz-adv-x="980" d="M 1053,542 C 1053,353 1011,212 928,119 845,26 724,-20 565,-20 407,-20 288,28 207,125 126,221 86,360 86,542 86,915 248,1102 571,1102 736,1102 858,1057 936,966 1014,875 1053,733 1053,542 Z M 864,542 C 864,691 842,800 798,868 753,935 679,969 574,969 469,969 393,935 346,866 299,797 275,689 275,542 275,399 298,292 345,221 391,149 464,113 563,113 671,113 748,148 795,217 841,286 864,395 864,542 Z"/>
  134. <glyph unicode="n" horiz-adv-x="874" d="M 825,0 L 825,686 C 825,757 818,813 804,852 790,891 768,920 737,937 706,954 661,963 602,963 515,963 447,933 397,874 347,815 322,732 322,627 L 322,0 142,0 142,851 C 142,977 140,1054 136,1082 L 306,1082 C 307,1079 307,1070 308,1055 309,1040 310,1024 311,1005 312,986 313,950 314,897 L 317,897 C 358,972 406,1025 461,1056 515,1087 582,1102 663,1102 782,1102 869,1073 924,1014 979,955 1006,857 1006,721 L 1006,0 825,0 Z"/>
  135. <glyph unicode="m" horiz-adv-x="1457" d="M 768,0 L 768,686 C 768,791 754,863 725,903 696,943 645,963 570,963 493,963 433,934 388,875 343,816 321,734 321,627 L 321,0 142,0 142,851 C 142,977 140,1054 136,1082 L 306,1082 C 307,1079 307,1070 308,1055 309,1040 310,1024 311,1005 312,986 313,950 314,897 L 317,897 C 356,974 400,1027 450,1057 500,1087 561,1102 633,1102 715,1102 780,1086 828,1053 875,1020 908,968 927,897 L 930,897 C 967,970 1013,1022 1066,1054 1119,1086 1183,1102 1258,1102 1367,1102 1447,1072 1497,1013 1546,954 1571,856 1571,721 L 1571,0 1393,0 1393,686 C 1393,791 1379,863 1350,903 1321,943 1270,963 1195,963 1116,963 1055,934 1012,876 968,817 946,734 946,627 L 946,0 768,0 Z"/>
  136. <glyph unicode="k" horiz-adv-x="901" d="M 816,0 L 450,494 318,385 318,0 138,0 138,1484 318,1484 318,557 793,1082 1004,1082 565,617 1027,0 816,0 Z"/>
  137. <glyph unicode="i" horiz-adv-x="187" d="M 137,1312 L 137,1484 317,1484 317,1312 137,1312 Z M 137,0 L 137,1082 317,1082 317,0 137,0 Z"/>
  138. <glyph unicode="e" horiz-adv-x="980" d="M 276,503 C 276,379 302,283 353,216 404,149 479,115 578,115 656,115 719,131 766,162 813,193 844,233 861,281 L 1019,236 C 954,65 807,-20 578,-20 418,-20 296,28 213,123 129,218 87,360 87,548 87,727 129,864 213,959 296,1054 416,1102 571,1102 889,1102 1048,910 1048,527 L 1048,503 276,503 Z M 862,641 C 852,755 823,838 775,891 727,943 658,969 568,969 481,969 412,940 361,882 310,823 282,743 278,641 L 862,641 Z"/>
  139. <glyph unicode="d" horiz-adv-x="927" d="M 821,174 C 788,105 744,55 689,25 634,-5 565,-20 484,-20 347,-20 247,26 183,118 118,210 86,349 86,536 86,913 219,1102 484,1102 566,1102 634,1087 689,1057 744,1027 788,979 821,914 L 823,914 821,1035 821,1484 1001,1484 1001,223 C 1001,110 1003,36 1007,0 L 835,0 C 833,11 831,35 829,74 826,113 825,146 825,174 L 821,174 Z M 275,542 C 275,391 295,282 335,217 375,152 440,119 530,119 632,119 706,154 752,225 798,296 821,405 821,554 821,697 798,802 752,869 706,936 633,969 532,969 441,969 376,936 336,869 295,802 275,693 275,542 Z"/>
  140. <glyph unicode="c" horiz-adv-x="901" d="M 275,546 C 275,402 298,295 343,226 388,157 457,122 548,122 612,122 666,139 709,174 752,209 778,262 788,334 L 970,322 C 956,218 912,135 837,73 762,11 668,-20 553,-20 402,-20 286,28 207,124 127,219 87,359 87,542 87,724 127,863 207,959 287,1054 402,1102 551,1102 662,1102 754,1073 827,1016 900,959 945,880 964,779 L 779,765 C 770,825 746,873 708,908 670,943 616,961 546,961 451,961 382,929 339,866 296,803 275,696 275,546 Z"/>
  141. <glyph unicode="b" horiz-adv-x="953" d="M 1053,546 C 1053,169 920,-20 655,-20 573,-20 505,-5 451,25 396,54 352,102 318,168 L 316,168 C 316,147 315,116 312,74 309,31 307,7 306,0 L 132,0 C 136,36 138,110 138,223 L 138,1484 318,1484 318,1061 C 318,1018 317,967 314,908 L 318,908 C 351,977 396,1027 451,1057 506,1087 574,1102 655,1102 792,1102 892,1056 957,964 1021,872 1053,733 1053,546 Z M 864,540 C 864,691 844,800 804,865 764,930 699,963 609,963 508,963 434,928 388,859 341,790 318,680 318,529 318,387 341,282 386,215 431,147 505,113 607,113 698,113 763,147 804,214 844,281 864,389 864,540 Z"/>
  142. <glyph unicode="a" horiz-adv-x="1060" d="M 414,-20 C 305,-20 224,9 169,66 114,123 87,202 87,302 87,414 124,500 198,560 271,620 390,652 554,656 L 797,660 797,719 C 797,807 778,870 741,908 704,946 645,965 565,965 484,965 426,951 389,924 352,897 330,853 323,793 L 135,810 C 166,1005 310,1102 569,1102 705,1102 807,1071 876,1009 945,946 979,856 979,738 L 979,272 C 979,219 986,179 1000,152 1014,125 1041,111 1080,111 1097,111 1117,113 1139,118 L 1139,6 C 1094,-5 1047,-10 1000,-10 933,-10 885,8 855,43 824,78 807,132 803,207 L 797,207 C 751,124 698,66 637,32 576,-3 501,-20 414,-20 Z M 455,115 C 521,115 580,130 631,160 682,190 723,231 753,284 782,336 797,390 797,445 L 797,534 600,530 C 515,529 451,520 408,504 364,488 330,463 307,430 284,397 272,353 272,299 272,240 288,195 320,163 351,131 396,115 455,115 Z"/>
  143. <glyph unicode="W" horiz-adv-x="1932" d="M 1511,0 L 1283,0 1039,895 C 1023,951 1000,1051 969,1196 952,1119 937,1054 925,1002 913,950 822,616 652,0 L 424,0 9,1409 208,1409 461,514 C 491,402 519,287 544,168 560,241 579,321 600,408 621,495 713,828 877,1409 L 1060,1409 1305,532 C 1342,389 1372,267 1393,168 L 1402,203 C 1420,280 1435,342 1446,391 1457,439 1551,778 1727,1409 L 1926,1409 1511,0 Z"/>
  144. <glyph unicode="S" horiz-adv-x="1192" d="M 1272,389 C 1272,259 1221,158 1120,87 1018,16 875,-20 690,-20 347,-20 148,99 93,338 L 278,375 C 299,290 345,228 414,189 483,149 578,129 697,129 820,129 916,150 983,193 1050,235 1083,297 1083,379 1083,425 1073,462 1052,491 1031,520 1001,543 963,562 925,581 880,596 827,609 774,622 716,635 652,650 541,675 456,699 399,724 341,749 295,776 262,807 229,837 203,872 186,913 168,954 159,1000 159,1053 159,1174 205,1267 298,1332 390,1397 522,1430 694,1430 854,1430 976,1406 1061,1357 1146,1308 1205,1224 1239,1106 L 1051,1073 C 1030,1148 991,1202 933,1236 875,1269 795,1286 692,1286 579,1286 493,1267 434,1230 375,1193 345,1137 345,1063 345,1020 357,984 380,956 403,927 436,903 479,884 522,864 609,840 738,811 781,801 825,791 868,781 911,770 952,758 991,744 1030,729 1067,712 1102,693 1136,674 1166,650 1191,622 1216,594 1236,561 1251,523 1265,485 1272,440 1272,389 Z"/>
  145. <glyph unicode="R" horiz-adv-x="1244" d="M 1164,0 L 798,585 359,585 359,0 168,0 168,1409 831,1409 C 990,1409 1112,1374 1199,1303 1285,1232 1328,1133 1328,1006 1328,901 1298,813 1237,742 1176,671 1091,626 984,607 L 1384,0 1164,0 Z M 1136,1004 C 1136,1086 1108,1149 1053,1192 997,1235 917,1256 812,1256 L 359,1256 359,736 820,736 C 921,736 999,760 1054,807 1109,854 1136,919 1136,1004 Z"/>
  146. <glyph unicode="M" horiz-adv-x="1377" d="M 1366,0 L 1366,940 C 1366,1044 1369,1144 1375,1240 1342,1121 1313,1027 1287,960 L 923,0 789,0 420,960 364,1130 331,1240 334,1129 338,940 338,0 168,0 168,1409 419,1409 794,432 C 807,393 820,351 833,306 845,261 853,228 857,208 862,235 874,275 891,330 908,384 919,418 925,432 L 1293,1409 1538,1409 1538,0 1366,0 Z"/>
  147. <glyph unicode="J" horiz-adv-x="848" d="M 457,-20 C 218,-20 77,103 32,350 L 219,381 C 231,304 258,243 300,200 342,157 395,135 458,135 527,135 582,159 622,207 662,254 682,324 682,416 L 682,1253 411,1253 411,1409 872,1409 872,420 C 872,283 835,176 761,98 687,19 586,-20 457,-20 Z"/>
  148. <glyph unicode="G" horiz-adv-x="1377" d="M 103,711 C 103,940 164,1117 287,1242 410,1367 582,1430 804,1430 960,1430 1087,1404 1184,1351 1281,1298 1356,1214 1409,1098 L 1227,1044 C 1187,1124 1132,1182 1062,1219 991,1256 904,1274 799,1274 636,1274 512,1225 426,1127 340,1028 297,890 297,711 297,533 343,393 434,290 525,187 652,135 813,135 905,135 991,149 1071,177 1150,205 1215,243 1264,291 L 1264,545 843,545 843,705 1440,705 1440,219 C 1365,143 1274,84 1166,43 1057,1 940,-20 813,-20 666,-20 539,9 432,68 325,127 244,211 188,322 131,432 103,562 103,711 Z"/>
  149. <glyph unicode="F" horiz-adv-x="1006" d="M 359,1253 L 359,729 1145,729 1145,571 359,571 359,0 168,0 168,1409 1169,1409 1169,1253 359,1253 Z"/>
  150. <glyph unicode="C" horiz-adv-x="1324" d="M 792,1274 C 636,1274 515,1224 428,1124 341,1023 298,886 298,711 298,538 343,400 434,295 524,190 646,137 800,137 997,137 1146,235 1245,430 L 1401,352 C 1343,231 1262,138 1157,75 1052,12 930,-20 791,-20 649,-20 526,10 423,69 319,128 240,212 186,322 131,431 104,561 104,711 104,936 165,1112 286,1239 407,1366 575,1430 790,1430 940,1430 1065,1401 1166,1342 1267,1283 1341,1196 1388,1081 L 1207,1021 C 1174,1103 1122,1166 1050,1209 977,1252 891,1274 792,1274 Z"/>
  151. <glyph unicode=":" horiz-adv-x="213" d="M 187,875 L 187,1082 382,1082 382,875 187,875 Z M 187,0 L 187,207 382,207 382,0 187,0 Z"/>
  152. <glyph unicode="8" horiz-adv-x="980" d="M 1050,393 C 1050,263 1009,162 926,89 843,16 725,-20 570,-20 419,-20 302,16 217,87 132,158 89,260 89,391 89,483 115,560 168,623 221,686 288,724 370,737 L 370,741 C 293,759 233,798 189,858 144,918 122,988 122,1069 122,1176 162,1263 243,1330 323,1397 431,1430 566,1430 705,1430 814,1397 895,1332 975,1267 1015,1178 1015,1067 1015,986 993,916 948,856 903,796 842,758 765,743 L 765,739 C 855,724 925,686 975,625 1025,563 1050,486 1050,393 Z M 828,1057 C 828,1216 741,1296 566,1296 481,1296 417,1276 373,1236 328,1196 306,1136 306,1057 306,976 329,915 375,873 420,830 485,809 568,809 653,809 717,829 762,868 806,907 828,970 828,1057 Z M 863,410 C 863,497 837,563 785,608 733,652 660,674 566,674 475,674 403,650 352,603 301,555 275,489 275,406 275,212 374,115 572,115 670,115 743,139 791,186 839,233 863,307 863,410 Z"/>
  153. <glyph unicode="7" horiz-adv-x="954" d="M 1036,1263 C 892,1043 790,871 731,746 672,621 627,498 598,377 568,256 553,130 553,0 L 365,0 C 365,180 403,370 480,569 556,768 683,997 862,1256 L 105,1256 105,1409 1036,1409 1036,1263 Z"/>
  154. <glyph unicode="6" horiz-adv-x="980" d="M 1049,461 C 1049,312 1009,195 928,109 847,23 736,-20 594,-20 435,-20 314,39 230,157 146,275 104,447 104,672 104,916 148,1103 235,1234 322,1365 447,1430 608,1430 821,1430 955,1334 1010,1143 L 838,1112 C 803,1227 725,1284 606,1284 503,1284 424,1236 368,1141 311,1045 283,906 283,725 316,786 362,832 421,864 480,895 548,911 625,911 755,911 858,870 935,789 1011,708 1049,598 1049,461 Z M 866,453 C 866,555 841,634 791,689 741,744 671,772 582,772 498,772 430,748 379,699 327,650 301,582 301,496 301,387 328,298 382,229 435,160 504,125 588,125 675,125 743,154 792,213 841,271 866,351 866,453 Z"/>
  155. <glyph unicode="5" horiz-adv-x="980" d="M 1053,459 C 1053,310 1009,193 921,108 832,23 710,-20 553,-20 422,-20 316,9 235,66 154,123 103,206 82,315 L 264,336 C 302,197 400,127 557,127 654,127 729,156 784,215 839,273 866,353 866,455 866,544 839,615 784,670 729,725 654,752 561,752 512,752 467,744 425,729 383,714 341,688 299,651 L 123,651 170,1409 971,1409 971,1256 334,1256 307,809 C 385,869 482,899 598,899 737,899 847,858 930,777 1012,696 1053,590 1053,459 Z"/>
  156. <glyph unicode="4" horiz-adv-x="1060" d="M 881,319 L 881,0 711,0 711,319 47,319 47,459 692,1409 881,1409 881,461 1079,461 1079,319 881,319 Z M 711,1206 C 710,1202 700,1184 683,1153 666,1122 653,1100 644,1087 L 283,555 229,481 213,461 711,461 711,1206 Z"/>
  157. <glyph unicode="3" horiz-adv-x="1006" d="M 1049,389 C 1049,259 1008,158 925,87 842,16 724,-20 571,-20 428,-20 315,12 230,77 145,141 94,236 78,362 L 264,379 C 288,212 390,129 571,129 662,129 733,151 785,196 836,241 862,307 862,395 862,472 833,532 774,575 715,618 629,639 518,639 L 416,639 416,795 514,795 C 613,795 689,817 744,860 798,903 825,962 825,1038 825,1113 803,1173 759,1217 714,1260 648,1282 561,1282 482,1282 418,1262 369,1221 320,1180 291,1123 283,1049 L 102,1063 C 115,1178 163,1268 246,1333 328,1398 434,1430 563,1430 704,1430 814,1397 893,1332 971,1266 1010,1174 1010,1057 1010,967 985,894 935,838 884,781 811,743 715,723 L 715,719 C 820,708 902,672 961,613 1020,554 1049,479 1049,389 Z"/>
  158. <glyph unicode="2" horiz-adv-x="954" d="M 103,0 L 103,127 C 137,205 179,274 228,334 277,393 328,447 382,496 436,544 490,589 543,630 596,671 643,713 686,754 729,795 763,839 790,884 816,929 829,981 829,1038 829,1115 806,1175 761,1218 716,1261 653,1282 572,1282 495,1282 432,1261 383,1220 333,1178 304,1119 295,1044 L 111,1061 C 124,1174 172,1263 255,1330 337,1397 443,1430 572,1430 714,1430 823,1397 900,1330 976,1263 1014,1167 1014,1044 1014,989 1002,935 977,881 952,827 914,773 865,719 816,665 721,581 582,468 505,405 444,349 399,299 354,248 321,200 301,153 L 1036,153 1036,0 103,0 Z"/>
  159. <glyph unicode="1" horiz-adv-x="927" d="M 156,0 L 156,153 515,153 515,1237 197,1010 197,1180 530,1409 696,1409 696,153 1039,153 1039,0 156,0 Z"/>
  160. <glyph unicode="0" horiz-adv-x="980" d="M 1059,705 C 1059,470 1018,290 935,166 852,42 729,-20 567,-20 405,-20 283,42 202,165 121,288 80,468 80,705 80,947 120,1128 199,1249 278,1370 402,1430 573,1430 739,1430 862,1369 941,1247 1020,1125 1059,944 1059,705 Z M 876,705 C 876,908 853,1056 806,1147 759,1238 681,1284 573,1284 462,1284 383,1239 335,1149 286,1059 262,911 262,705 262,505 287,359 336,266 385,173 462,127 569,127 675,127 753,174 802,269 851,364 876,509 876,705 Z"/>
  161. <glyph unicode="." horiz-adv-x="213" d="M 187,0 L 187,219 382,219 382,0 187,0 Z"/>
  162. <glyph unicode="-" horiz-adv-x="531" d="M 91,464 L 91,624 591,624 591,464 91,464 Z"/>
  163. <glyph unicode=")" horiz-adv-x="557" d="M 555,528 C 555,335 525,162 465,9 404,-144 311,-289 186,-424 L 12,-424 C 137,-284 229,-136 287,19 345,174 374,344 374,530 374,716 345,887 287,1042 228,1197 137,1345 12,1484 L 186,1484 C 312,1348 405,1203 465,1050 525,896 555,723 555,532 L 555,528 Z"/>
  164. <glyph unicode="(" horiz-adv-x="583" d="M 127,532 C 127,725 157,898 218,1051 278,1204 371,1349 496,1484 L 670,1484 C 545,1345 454,1198 396,1042 337,886 308,715 308,530 308,345 337,175 395,20 452,-135 544,-283 670,-424 L 496,-424 C 370,-288 277,-143 217,11 157,164 127,337 127,528 L 127,532 Z"/>
  165. <glyph unicode=" " horiz-adv-x="556"/>
  166. </font>
  167. </defs>
  168. <defs>
  169. <font id="EmbeddedFont_4" horiz-adv-x="2048">
  170. <font-face font-family="Liberation Serif embedded" units-per-em="2048" font-weight="normal" font-style="normal" ascent="1826" descent="450"/>
  171. <missing-glyph horiz-adv-x="2048" d="M 0,0 L 2047,0 2047,2047 0,2047 0,0 Z"/>
  172. <glyph unicode="t" horiz-adv-x="557" d="M 334,-20 C 270,-20 222,-1 191,37 159,75 143,128 143,197 L 143,856 20,856 20,901 145,940 246,1153 309,1153 309,940 524,940 524,856 309,856 309,215 C 309,172 319,139 339,117 358,95 384,84 416,84 455,84 502,89 557,100 L 557,35 C 534,19 500,6 456,-5 412,-15 371,-20 334,-20 Z"/>
  173. <glyph unicode="r" horiz-adv-x="636" d="M 664,965 L 664,711 621,711 563,821 C 530,821 490,817 445,808 399,799 359,787 326,772 L 326,70 487,45 487,0 41,0 41,45 160,70 160,870 41,895 41,940 315,940 324,823 C 364,856 418,888 487,919 555,950 609,965 649,965 L 664,965 Z"/>
  174. <glyph unicode="o" horiz-adv-x="901" d="M 946,475 C 946,145 799,-20 506,-20 365,-20 258,22 186,107 114,192 78,314 78,475 78,634 114,755 186,839 258,923 367,965 514,965 657,965 764,924 837,842 910,759 946,637 946,475 Z M 766,475 C 766,619 745,723 703,788 661,853 595,885 506,885 419,885 356,854 317,792 278,730 258,624 258,475 258,324 278,217 318,154 357,91 420,59 506,59 594,59 659,92 702,157 745,222 766,328 766,475 Z"/>
  175. <glyph unicode="f" horiz-adv-x="636" d="M 225,856 L 63,856 63,905 225,944 225,1010 C 225,1149 253,1255 308,1330 363,1405 440,1442 539,1442 590,1442 638,1436 682,1423 L 682,1218 633,1218 588,1341 C 565,1355 538,1362 506,1362 464,1362 434,1343 417,1306 400,1269 391,1199 391,1096 L 391,940 641,940 641,856 391,856 391,78 594,45 594,0 86,0 86,45 225,78 225,856 Z"/>
  176. <glyph unicode="e" horiz-adv-x="769" d="M 260,473 L 260,455 C 260,363 270,292 291,241 311,190 342,151 385,124 427,97 482,84 551,84 587,84 630,87 679,93 728,99 769,106 801,113 L 801,57 C 769,36 726,18 671,3 616,-12 559,-20 502,-20 356,-20 249,19 182,98 114,177 80,303 80,477 80,641 114,763 183,844 252,925 350,965 477,965 718,965 838,828 838,555 L 838,473 260,473 Z M 477,885 C 408,885 355,857 318,801 281,745 262,662 262,553 L 664,553 C 664,672 649,758 618,809 587,860 540,885 477,885 Z"/>
  177. <glyph unicode="&gt;" horiz-adv-x="980" d="M 104,186 L 104,289 913,680 104,1071 104,1174 1057,705 1057,655 104,186 Z"/>
  178. <glyph unicode="&lt;" horiz-adv-x="980" d="M 102,655 L 102,705 1055,1174 1055,1071 246,680 1055,289 1055,186 102,655 Z"/>
  179. </font>
  180. </defs>
  181. <defs>
  182. <font id="EmbeddedFont_5" horiz-adv-x="2048">
  183. <font-face font-family="OpenSymbol embedded" units-per-em="2048" font-weight="normal" font-style="normal" ascent="1402" descent="450"/>
  184. <missing-glyph horiz-adv-x="2048" d="M 0,0 L 2047,0 2047,2047 0,2047 0,0 Z"/>
  185. <glyph unicode="●" horiz-adv-x="1191" d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z"/>
  186. <glyph unicode="–" horiz-adv-x="1165" d="M -4,459 L 1135,459 1135,606 -4,606 -4,459 Z"/>
  187. </font>
  188. </defs>
  189. <defs class="TextShapeIndex">
  190. <g ooo:slide="id1" ooo:id-list="id6 id7 id8"/>
  191. </defs>
  192. <defs class="EmbeddedBulletChars">
  193. <g id="bullet-char-template-57356" transform="scale(0.00048828125,-0.00048828125)">
  194. <path d="M 580,1141 L 1163,571 580,0 -4,571 580,1141 Z"/>
  195. </g>
  196. <g id="bullet-char-template-57354" transform="scale(0.00048828125,-0.00048828125)">
  197. <path d="M 8,1128 L 1137,1128 1137,0 8,0 8,1128 Z"/>
  198. </g>
  199. <g id="bullet-char-template-10146" transform="scale(0.00048828125,-0.00048828125)">
  200. <path d="M 174,0 L 602,739 174,1481 1456,739 174,0 Z M 1358,739 L 309,1346 659,739 1358,739 Z"/>
  201. </g>
  202. <g id="bullet-char-template-10132" transform="scale(0.00048828125,-0.00048828125)">
  203. <path d="M 2015,739 L 1276,0 717,0 1260,543 174,543 174,936 1260,936 717,1481 1274,1481 2015,739 Z"/>
  204. </g>
  205. <g id="bullet-char-template-10007" transform="scale(0.00048828125,-0.00048828125)">
  206. <path d="M 0,-2 C -7,14 -16,27 -25,37 L 356,567 C 262,823 215,952 215,954 215,979 228,992 255,992 264,992 276,990 289,987 310,991 331,999 354,1012 L 381,999 492,748 772,1049 836,1024 860,1049 C 881,1039 901,1025 922,1006 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 C 774,196 753,168 711,139 L 727,119 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 C 142,-110 111,-127 72,-127 30,-127 9,-110 8,-76 1,-67 -2,-52 -2,-32 -2,-23 -1,-13 0,-2 Z"/>
  207. </g>
  208. <g id="bullet-char-template-10004" transform="scale(0.00048828125,-0.00048828125)">
  209. <path d="M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 41,549 55,616 82,672 116,743 169,778 240,778 293,778 328,747 346,684 L 369,508 C 377,444 397,411 428,410 L 1163,1116 C 1174,1127 1196,1133 1229,1133 1271,1133 1292,1118 1292,1087 L 1292,965 C 1292,929 1282,901 1262,881 L 442,47 C 390,-6 338,-33 285,-33 Z"/>
  210. </g>
  211. <g id="bullet-char-template-9679" transform="scale(0.00048828125,-0.00048828125)">
  212. <path d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z"/>
  213. </g>
  214. <g id="bullet-char-template-8226" transform="scale(0.00048828125,-0.00048828125)">
  215. <path d="M 346,457 C 273,457 209,483 155,535 101,586 74,649 74,723 74,796 101,859 155,911 209,963 273,989 346,989 419,989 480,963 531,910 582,859 608,796 608,723 608,648 583,586 532,535 482,483 420,457 346,457 Z"/>
  216. </g>
  217. <g id="bullet-char-template-8211" transform="scale(0.00048828125,-0.00048828125)">
  218. <path d="M -4,459 L 1135,459 1135,606 -4,606 -4,459 Z"/>
  219. </g>
  220. <g id="bullet-char-template-61548" transform="scale(0.00048828125,-0.00048828125)">
  221. <path d="M 173,740 C 173,903 231,1043 346,1159 462,1274 601,1332 765,1332 928,1332 1067,1274 1183,1159 1299,1043 1357,903 1357,740 1357,577 1299,437 1183,322 1067,206 928,148 765,148 601,148 462,206 346,322 231,437 173,577 173,740 Z"/>
  222. </g>
  223. </defs>
  224. <defs>
  225. <g id="dummy-master-page" ooo:name="dummy-master-page" class="Master_Slide">
  226. <g id="bg-dummy-master-page" class="Background" visibility="hidden"/>
  227. <g id="bo-dummy-master-page" class="BackgroundObjects" visibility="hidden"/>
  228. </g>
  229. <g id="id2" ooo:name="Vide" class="Master_Slide">
  230. <g id="bg-id2" class="Background">
  231. <path fill="rgb(255,255,255)" stroke="none" d="M 16920,19036 L -13,19036 -13,-13 33853,-13 33853,19036 16920,19036 Z"/>
  232. </g>
  233. <g id="bo-id2" class="BackgroundObjects">
  234. <g visibility="hidden" ooo:text-adjust="left" class="DateTime">
  235. <g id="id3">
  236. <rect class="BoundingBox" stroke="none" fill="none" x="2328" y="17657" width="7620" height="1014"/>
  237. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="423px" font-weight="400"><tspan class="TextPosition" x="2582" y="18333"><tspan class="PlaceholderText DateTime" fill="rgb(139,139,139)" stroke="none" style="white-space: pre">&lt;date/time&gt;</tspan></tspan></tspan></text>
  238. </g>
  239. </g>
  240. <g visibility="hidden" ooo:text-adjust="left" class="Footer">
  241. <g id="id4">
  242. <rect class="BoundingBox" stroke="none" fill="none" x="11218" y="17657" width="11430" height="1014"/>
  243. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Serif, serif" font-size="493px" font-weight="400"><tspan class="TextPosition" x="16071" y="18361"><tspan class="PlaceholderText Footer" fill="rgb(0,0,0)" stroke="none" style="white-space: pre">&lt;footer&gt;</tspan></tspan></tspan></text>
  244. </g>
  245. </g>
  246. <g visibility="hidden" ooo:text-adjust="left" class="PageNumber">
  247. <g id="id5">
  248. <rect class="BoundingBox" stroke="none" fill="none" x="23918" y="17657" width="7620" height="1014"/>
  249. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="423px" font-weight="400"><tspan class="TextPosition" x="28926" y="18333"><tspan class="PlaceholderText PageNumber" fill="rgb(139,139,139)" stroke="none" style="white-space: pre">&lt;number&gt;</tspan></tspan></tspan></text>
  250. </g>
  251. </g>
  252. </g>
  253. </g>
  254. </defs>
  255. <g class="DummySlide">
  256. <g>
  257. <g id="dummy-slide" class="Slide" clip-path="url(#presentation_clip_path)">
  258. <g ooo:name="dummy-page" class="Page"/>
  259. </g>
  260. </g>
  261. </g>
  262. <g class="SlideGroup">
  263. <g visibility="hidden">
  264. <g id="container-id1">
  265. <g id="id1" class="Slide" clip-path="url(#presentation_clip_path)">
  266. <g ooo:name="page1" class="Page">
  267. <g class="com.sun.star.drawing.CustomShape">
  268. <g id="id6">
  269. <rect class="BoundingBox" stroke="none" fill="none" x="8216" y="558" width="15439" height="1266"/>
  270. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="847px" font-weight="700"><tspan class="TextPosition" x="8466" y="1530"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">Bilan WGS Nanopore par projet</tspan></tspan></tspan></text>
  271. </g>
  272. </g>
  273. <g class="Graphic">
  274. <g id="id7">
  275. <rect class="BoundingBox" stroke="none" fill="none" x="4711" y="1800" width="22595" height="12806"/>
  276. <defs>
  277. <clipPath id="clip_path_1" clipPathUnits="userSpaceOnUse">
  278. <path d="M 4737,1826 L 27279,1826 27279,14579 4737,14579 4737,1826 Z"/>
  279. </clipPath>
  280. </defs>
  281. <g clip-path="url(#clip_path_1)">
  282. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,1800 L 27304,1800 27304,2356 4711,2356 4711,1800 Z"/>
  283. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,2330 L 5107,2330 5107,3417 4711,3417 4711,2330 Z"/>
  284. <path fill="rgb(242,242,242)" stroke="none" d="M 5082,2330 L 12471,2330 12471,3417 5082,3417 5082,2330 Z"/>
  285. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,2330 L 17027,2330 17027,3417 12446,3417 12446,2330 Z"/>
  286. <path fill="rgb(242,242,242)" stroke="none" d="M 17001,2330 L 24973,2330 24973,3417 17001,3417 17001,2330 Z"/>
  287. <path fill="rgb(255,255,255)" stroke="none" d="M 24948,2330 L 27304,2330 27304,3417 24948,3417 24948,2330 Z"/>
  288. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,3390 L 5107,3390 5107,3946 4711,3946 4711,3390 Z"/>
  289. <path fill="rgb(180,198,231)" stroke="none" d="M 5082,3390 L 12471,3390 12471,3946 5082,3946 5082,3390 Z"/>
  290. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,3390 L 17027,3390 17027,3946 12446,3946 12446,3390 Z"/>
  291. <path fill="rgb(180,198,231)" stroke="none" d="M 17001,3390 L 18669,3390 18669,3946 17001,3946 17001,3390 Z"/>
  292. <path fill="rgb(198,224,180)" stroke="none" d="M 18644,3390 L 24973,3390 24973,3946 18644,3946 18644,3390 Z"/>
  293. <path fill="rgb(255,255,255)" stroke="none" d="M 24948,3390 L 27304,3390 27304,3946 24948,3946 24948,3390 Z"/>
  294. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,3921 L 5107,3921 5107,4370 4711,4370 4711,3921 Z"/>
  295. <path fill="rgb(221,235,247)" stroke="none" d="M 5082,3921 L 12471,3921 12471,4370 5082,4370 5082,3921 Z"/>
  296. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,3921 L 17027,3921 17027,4370 12446,4370 12446,3921 Z"/>
  297. <path fill="rgb(221,235,247)" stroke="none" d="M 17001,3921 L 24973,3921 24973,4370 17001,4370 17001,3921 Z"/>
  298. <path fill="rgb(255,255,255)" stroke="none" d="M 24948,3921 L 27304,3921 27304,4370 24948,4370 24948,3921 Z"/>
  299. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,4345 L 27304,4345 27304,4424 4711,4424 4711,4345 Z"/>
  300. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,4398 L 5107,4398 5107,4954 4711,4954 4711,4398 Z"/>
  301. <path fill="rgb(180,198,231)" stroke="none" d="M 5082,4398 L 12471,4398 12471,4954 5082,4954 5082,4398 Z"/>
  302. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,4398 L 17027,4398 17027,4954 12446,4954 12446,4398 Z"/>
  303. <path fill="rgb(180,198,231)" stroke="none" d="M 17001,4398 L 24973,4398 24973,4954 17001,4954 17001,4398 Z"/>
  304. <path fill="rgb(255,255,255)" stroke="none" d="M 24948,4398 L 27304,4398 27304,4954 24948,4954 24948,4398 Z"/>
  305. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,4928 L 5107,4928 5107,5377 4711,5377 4711,4928 Z"/>
  306. <path fill="rgb(221,235,247)" stroke="none" d="M 5082,4928 L 12471,4928 12471,5377 5082,5377 5082,4928 Z"/>
  307. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,4928 L 17027,4928 17027,5377 12446,5377 12446,4928 Z"/>
  308. <path fill="rgb(221,235,247)" stroke="none" d="M 17001,4928 L 24973,4928 24973,5377 17001,5377 17001,4928 Z"/>
  309. <path fill="rgb(255,255,255)" stroke="none" d="M 24948,4928 L 27304,4928 27304,5377 24948,5377 24948,4928 Z"/>
  310. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,5353 L 27304,5353 27304,5432 4711,5432 4711,5353 Z"/>
  311. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,5406 L 5107,5406 5107,5961 4711,5961 4711,5406 Z"/>
  312. <path fill="rgb(180,198,231)" stroke="none" d="M 5082,5406 L 12471,5406 12471,5961 5082,5961 5082,5406 Z"/>
  313. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,5406 L 17027,5406 17027,5961 12446,5961 12446,5406 Z"/>
  314. <path fill="rgb(180,198,231)" stroke="none" d="M 17001,5406 L 18669,5406 18669,5961 17001,5961 17001,5406 Z"/>
  315. <path fill="rgb(198,224,180)" stroke="none" d="M 18644,5406 L 24973,5406 24973,5961 18644,5961 18644,5406 Z"/>
  316. <path fill="rgb(255,255,255)" stroke="none" d="M 24948,5406 L 27304,5406 27304,5961 24948,5961 24948,5406 Z"/>
  317. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,5936 L 5107,5936 5107,6386 4711,6386 4711,5936 Z"/>
  318. <path fill="rgb(221,235,247)" stroke="none" d="M 5082,5936 L 12471,5936 12471,6386 5082,6386 5082,5936 Z"/>
  319. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,5936 L 17027,5936 17027,6386 12446,6386 12446,5936 Z"/>
  320. <path fill="rgb(221,235,247)" stroke="none" d="M 17001,5936 L 24973,5936 24973,6386 17001,6386 17001,5936 Z"/>
  321. <path fill="rgb(255,255,255)" stroke="none" d="M 24948,5936 L 27304,5936 27304,6386 24948,6386 24948,5936 Z"/>
  322. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,6360 L 27304,6360 27304,6439 4711,6439 4711,6360 Z"/>
  323. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,6413 L 5107,6413 5107,6969 4711,6969 4711,6413 Z"/>
  324. <path fill="rgb(180,198,231)" stroke="none" d="M 5082,6413 L 12471,6413 12471,6969 5082,6969 5082,6413 Z"/>
  325. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,6413 L 17027,6413 17027,6969 12446,6969 12446,6413 Z"/>
  326. <path fill="rgb(180,198,231)" stroke="none" d="M 17001,6413 L 24973,6413 24973,6969 17001,6969 17001,6413 Z"/>
  327. <path fill="rgb(255,255,255)" stroke="none" d="M 24948,6413 L 27304,6413 27304,6969 24948,6969 24948,6413 Z"/>
  328. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,6943 L 5107,6943 5107,7393 4711,7393 4711,6943 Z"/>
  329. <path fill="rgb(221,235,247)" stroke="none" d="M 5082,6943 L 12471,6943 12471,7393 5082,7393 5082,6943 Z"/>
  330. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,6943 L 17027,6943 17027,7393 12446,7393 12446,6943 Z"/>
  331. <path fill="rgb(221,235,247)" stroke="none" d="M 17001,6943 L 24973,6943 24973,7393 17001,7393 17001,6943 Z"/>
  332. <path fill="rgb(255,255,255)" stroke="none" d="M 24948,6943 L 27304,6943 27304,7393 24948,7393 24948,6943 Z"/>
  333. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,7367 L 27304,7367 27304,7446 4711,7446 4711,7367 Z"/>
  334. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,7420 L 5107,7420 5107,7976 4711,7976 4711,7420 Z"/>
  335. <path fill="rgb(180,198,231)" stroke="none" d="M 5082,7420 L 12471,7420 12471,7976 5082,7976 5082,7420 Z"/>
  336. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,7420 L 17027,7420 17027,7976 12446,7976 12446,7420 Z"/>
  337. <path fill="rgb(180,198,231)" stroke="none" d="M 17001,7420 L 18669,7420 18669,7976 17001,7976 17001,7420 Z"/>
  338. <path fill="rgb(198,224,180)" stroke="none" d="M 18644,7420 L 24973,7420 24973,7976 18644,7976 18644,7420 Z"/>
  339. <path fill="rgb(255,255,255)" stroke="none" d="M 24948,7420 L 27304,7420 27304,7976 24948,7976 24948,7420 Z"/>
  340. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,7950 L 5107,7950 5107,8400 4711,8400 4711,7950 Z"/>
  341. <path fill="rgb(221,235,247)" stroke="none" d="M 5082,7950 L 12471,7950 12471,8400 5082,8400 5082,7950 Z"/>
  342. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,7950 L 17027,7950 17027,8400 12446,8400 12446,7950 Z"/>
  343. <path fill="rgb(221,235,247)" stroke="none" d="M 17001,7950 L 24973,7950 24973,8400 17001,8400 17001,7950 Z"/>
  344. <path fill="rgb(255,255,255)" stroke="none" d="M 24948,7950 L 27304,7950 27304,8400 24948,8400 24948,7950 Z"/>
  345. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,8375 L 27304,8375 27304,8454 4711,8454 4711,8375 Z"/>
  346. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,8428 L 5107,8428 5107,8984 4711,8984 4711,8428 Z"/>
  347. <path fill="rgb(180,198,231)" stroke="none" d="M 5082,8428 L 12471,8428 12471,8984 5082,8984 5082,8428 Z"/>
  348. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,8428 L 17027,8428 17027,8984 12446,8984 12446,8428 Z"/>
  349. <path fill="rgb(180,198,231)" stroke="none" d="M 17001,8428 L 24973,8428 24973,8984 17001,8984 17001,8428 Z"/>
  350. <path fill="rgb(255,255,255)" stroke="none" d="M 24948,8428 L 27304,8428 27304,8984 24948,8984 24948,8428 Z"/>
  351. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,8958 L 5107,8958 5107,9407 4711,9407 4711,8958 Z"/>
  352. <path fill="rgb(221,235,247)" stroke="none" d="M 5082,8958 L 12471,8958 12471,9407 5082,9407 5082,8958 Z"/>
  353. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,8958 L 17027,8958 17027,9407 12446,9407 12446,8958 Z"/>
  354. <path fill="rgb(221,235,247)" stroke="none" d="M 17001,8958 L 24973,8958 24973,9407 17001,9407 17001,8958 Z"/>
  355. <path fill="rgb(255,255,255)" stroke="none" d="M 24948,8958 L 27304,8958 27304,9407 24948,9407 24948,8958 Z"/>
  356. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,9382 L 27304,9382 27304,9461 4711,9461 4711,9382 Z"/>
  357. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,9435 L 5107,9435 5107,9991 4711,9991 4711,9435 Z"/>
  358. <path fill="rgb(180,198,231)" stroke="none" d="M 5082,9435 L 12471,9435 12471,9991 5082,9991 5082,9435 Z"/>
  359. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,9435 L 17027,9435 17027,9991 12446,9991 12446,9435 Z"/>
  360. <path fill="rgb(180,198,231)" stroke="none" d="M 17001,9435 L 24973,9435 24973,9991 17001,9991 17001,9435 Z"/>
  361. <path fill="rgb(255,255,255)" stroke="none" d="M 24948,9435 L 27304,9435 27304,9991 24948,9991 24948,9435 Z"/>
  362. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,9966 L 5107,9966 5107,10415 4711,10415 4711,9966 Z"/>
  363. <path fill="rgb(221,235,247)" stroke="none" d="M 5082,9966 L 12471,9966 12471,10415 5082,10415 5082,9966 Z"/>
  364. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,9966 L 17027,9966 17027,10415 12446,10415 12446,9966 Z"/>
  365. <path fill="rgb(221,235,247)" stroke="none" d="M 17001,9966 L 24973,9966 24973,10415 17001,10415 17001,9966 Z"/>
  366. <path fill="rgb(255,255,255)" stroke="none" d="M 24948,9966 L 27304,9966 27304,10415 24948,10415 24948,9966 Z"/>
  367. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,10390 L 27304,10390 27304,10469 4711,10469 4711,10390 Z"/>
  368. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,10443 L 5107,10443 5107,10998 4711,10998 4711,10443 Z"/>
  369. <path fill="rgb(180,198,231)" stroke="none" d="M 5082,10443 L 12471,10443 12471,10998 5082,10998 5082,10443 Z"/>
  370. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,10443 L 17027,10443 17027,10998 12446,10998 12446,10443 Z"/>
  371. <path fill="rgb(180,198,231)" stroke="none" d="M 17001,10443 L 24973,10443 24973,10998 17001,10998 17001,10443 Z"/>
  372. <path fill="rgb(255,255,255)" stroke="none" d="M 24948,10443 L 27304,10443 27304,10998 24948,10998 24948,10443 Z"/>
  373. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,10973 L 5107,10973 5107,11423 4711,11423 4711,10973 Z"/>
  374. <path fill="rgb(221,235,247)" stroke="none" d="M 5082,10973 L 12471,10973 12471,11423 5082,11423 5082,10973 Z"/>
  375. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,10973 L 17027,10973 17027,11423 12446,11423 12446,10973 Z"/>
  376. <path fill="rgb(221,235,247)" stroke="none" d="M 17001,10973 L 24973,10973 24973,11423 17001,11423 17001,10973 Z"/>
  377. <path fill="rgb(255,255,255)" stroke="none" d="M 24948,10973 L 27304,10973 27304,11423 24948,11423 24948,10973 Z"/>
  378. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,11397 L 27304,11397 27304,13014 4711,13014 4711,11397 Z"/>
  379. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,12987 L 5107,12987 5107,13543 4711,13543 4711,12987 Z"/>
  380. <path fill="rgb(255,255,255)" stroke="none" d="M 12446,12987 L 27304,12987 27304,13543 12446,13543 12446,12987 Z"/>
  381. <path fill="rgb(255,255,255)" stroke="none" d="M 4711,13518 L 27304,13518 27304,15134 4711,15134 4711,13518 Z"/>
  382. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="5161" y="3283"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">projet</tspan></tspan></tspan></text>
  383. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="7810" y="3283"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">patients</tspan></tspan></tspan></text>
  384. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="10221" y="3283"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">echantillions</tspan></tspan></tspan></text>
  385. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="17080" y="3283"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">projet</tspan></tspan></tspan></text>
  386. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="19438" y="3283"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">patients</tspan></tspan></tspan></text>
  387. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="22192" y="3283"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">echantillions</tspan></tspan></tspan></text>
  388. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="5161" y="3813"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">&lt; 3ans</tspan></tspan></tspan></text>
  389. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="8313" y="3813"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">20</tspan></tspan></tspan></text>
  390. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="11095" y="3813"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">40</tspan></tspan></tspan></text>
  391. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="17080" y="3813"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">&lt; 3ans</tspan></tspan></tspan></text>
  392. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="20021" y="3813"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">0</tspan></tspan></tspan></text>
  393. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="23172" y="3813"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">0</tspan></tspan></tspan></text>
  394. </g>
  395. <defs>
  396. <clipPath id="clip_path_2" clipPathUnits="userSpaceOnUse">
  397. <path d="M 4737,3947 L 27279,3947 27279,4318 4737,4318 4737,3947 Z"/>
  398. </clipPath>
  399. </defs>
  400. <g clip-path="url(#clip_path_2)">
  401. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="344px" font-weight="400"><tspan class="TextPosition" x="7942" y="4240"><tspan fill="rgb(117,113,113)" stroke="none" style="white-space: pre">20 D+M</tspan></tspan></tspan></text>
  402. </g>
  403. <defs>
  404. <clipPath id="clip_path_3" clipPathUnits="userSpaceOnUse">
  405. <path d="M 4737,1826 L 27279,1826 27279,14579 4737,14579 4737,1826 Z"/>
  406. </clipPath>
  407. </defs>
  408. <g clip-path="url(#clip_path_3)">
  409. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="5161" y="4821"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">TLX3 ped</tspan></tspan></tspan></text>
  410. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="8313" y="4821"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">13</tspan></tspan></tspan></text>
  411. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="11095" y="4821"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">24</tspan></tspan></tspan></text>
  412. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="17080" y="4821"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">TLX3 ped</tspan></tspan></tspan></text>
  413. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="20021" y="4821"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">1</tspan></tspan></tspan></text>
  414. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="23172" y="4821"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">2</tspan></tspan></tspan></text>
  415. </g>
  416. <defs>
  417. <clipPath id="clip_path_4" clipPathUnits="userSpaceOnUse">
  418. <path d="M 4737,4955 L 27279,4955 27279,5326 4737,5326 4737,4955 Z"/>
  419. </clipPath>
  420. </defs>
  421. <g clip-path="url(#clip_path_4)">
  422. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="344px" font-weight="400"><tspan class="TextPosition" x="7625" y="5248"><tspan fill="rgb(117,113,113)" stroke="none" style="white-space: pre">11 D+M; 2 D</tspan></tspan></tspan></text>
  423. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="344px" font-weight="400"><tspan class="TextPosition" x="19650" y="5248"><tspan fill="rgb(117,113,113)" stroke="none" style="white-space: pre">1 D+M</tspan></tspan></tspan></text>
  424. </g>
  425. <defs>
  426. <clipPath id="clip_path_5" clipPathUnits="userSpaceOnUse">
  427. <path d="M 4737,1826 L 27279,1826 27279,14579 4737,14579 4737,1826 Z"/>
  428. </clipPath>
  429. </defs>
  430. <g clip-path="url(#clip_path_5)">
  431. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="5161" y="5828"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">TLX3 ad</tspan></tspan></tspan></text>
  432. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="8313" y="5828"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">13</tspan></tspan></tspan></text>
  433. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="11095" y="5828"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">25</tspan></tspan></tspan></text>
  434. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="17080" y="5828"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">TLX3 ad</tspan></tspan></tspan></text>
  435. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="20021" y="5828"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">0</tspan></tspan></tspan></text>
  436. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="23172" y="5828"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">0</tspan></tspan></tspan></text>
  437. </g>
  438. <defs>
  439. <clipPath id="clip_path_6" clipPathUnits="userSpaceOnUse">
  440. <path d="M 4737,5962 L 27279,5962 27279,6334 4737,6334 4737,5962 Z"/>
  441. </clipPath>
  442. </defs>
  443. <g clip-path="url(#clip_path_6)">
  444. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="344px" font-weight="400"><tspan class="TextPosition" x="7625" y="6256"><tspan fill="rgb(117,113,113)" stroke="none" style="white-space: pre">12 D+M; 1 D</tspan></tspan></tspan></text>
  445. </g>
  446. <defs>
  447. <clipPath id="clip_path_7" clipPathUnits="userSpaceOnUse">
  448. <path d="M 4737,1826 L 27279,1826 27279,14579 4737,14579 4737,1826 Z"/>
  449. </clipPath>
  450. </defs>
  451. <g clip-path="url(#clip_path_7)">
  452. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="5161" y="6836"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">TAL1</tspan></tspan></tspan></text>
  453. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="8313" y="6836"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">14</tspan></tspan></tspan></text>
  454. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="11095" y="6836"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">20</tspan></tspan></tspan></text>
  455. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="17080" y="6836"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">TAL1</tspan></tspan></tspan></text>
  456. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="20021" y="6836"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">3</tspan></tspan></tspan></text>
  457. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="23172" y="6836"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">5</tspan></tspan></tspan></text>
  458. </g>
  459. <defs>
  460. <clipPath id="clip_path_8" clipPathUnits="userSpaceOnUse">
  461. <path d="M 4737,6970 L 27279,6970 27279,7341 4737,7341 4737,6970 Z"/>
  462. </clipPath>
  463. </defs>
  464. <g clip-path="url(#clip_path_8)">
  465. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="344px" font-weight="400"><tspan class="TextPosition" x="7704" y="7263"><tspan fill="rgb(117,113,113)" stroke="none" style="white-space: pre">6 D+M; 8 D</tspan></tspan></tspan></text>
  466. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="344px" font-weight="400"><tspan class="TextPosition" x="19279" y="7263"><tspan fill="rgb(117,113,113)" stroke="none" style="white-space: pre">2 D+M ; 1 D</tspan></tspan></tspan></text>
  467. </g>
  468. <defs>
  469. <clipPath id="clip_path_9" clipPathUnits="userSpaceOnUse">
  470. <path d="M 4737,1826 L 27279,1826 27279,14579 4737,14579 4737,1826 Z"/>
  471. </clipPath>
  472. </defs>
  473. <g clip-path="url(#clip_path_9)">
  474. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="5161" y="7843"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">TLX1</tspan></tspan></tspan></text>
  475. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="8313" y="7843"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">17</tspan></tspan></tspan></text>
  476. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="11095" y="7843"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">28</tspan></tspan></tspan></text>
  477. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="17080" y="7843"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">TLX1</tspan></tspan></tspan></text>
  478. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="20021" y="7843"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">0</tspan></tspan></tspan></text>
  479. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="23172" y="7843"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">0</tspan></tspan></tspan></text>
  480. </g>
  481. <defs>
  482. <clipPath id="clip_path_10" clipPathUnits="userSpaceOnUse">
  483. <path d="M 4737,7977 L 27279,7977 27279,8348 4737,8348 4737,7977 Z"/>
  484. </clipPath>
  485. </defs>
  486. <g clip-path="url(#clip_path_10)">
  487. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="344px" font-weight="400"><tspan class="TextPosition" x="7625" y="8270"><tspan fill="rgb(117,113,113)" stroke="none" style="white-space: pre">11 D+M; 6 D</tspan></tspan></tspan></text>
  488. </g>
  489. <defs>
  490. <clipPath id="clip_path_11" clipPathUnits="userSpaceOnUse">
  491. <path d="M 4737,1826 L 27279,1826 27279,14579 4737,14579 4737,1826 Z"/>
  492. </clipPath>
  493. </defs>
  494. <g clip-path="url(#clip_path_11)">
  495. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="5161" y="8850"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">HOXA</tspan></tspan></tspan></text>
  496. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="8313" y="8850"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">17</tspan></tspan></tspan></text>
  497. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="11095" y="8850"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">34</tspan></tspan></tspan></text>
  498. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="17080" y="8850"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">HOXA</tspan></tspan></tspan></text>
  499. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="20021" y="8850"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">8</tspan></tspan></tspan></text>
  500. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="23067" y="8850"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">16</tspan></tspan></tspan></text>
  501. </g>
  502. <defs>
  503. <clipPath id="clip_path_12" clipPathUnits="userSpaceOnUse">
  504. <path d="M 4737,8985 L 27279,8985 27279,9355 4737,9355 4737,8985 Z"/>
  505. </clipPath>
  506. </defs>
  507. <g clip-path="url(#clip_path_12)">
  508. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="344px" font-weight="400"><tspan class="TextPosition" x="7942" y="9277"><tspan fill="rgb(117,113,113)" stroke="none" style="white-space: pre">17 D+M</tspan></tspan></tspan></text>
  509. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="344px" font-weight="400"><tspan class="TextPosition" x="19650" y="9277"><tspan fill="rgb(117,113,113)" stroke="none" style="white-space: pre">8 D+M</tspan></tspan></tspan></text>
  510. </g>
  511. <defs>
  512. <clipPath id="clip_path_13" clipPathUnits="userSpaceOnUse">
  513. <path d="M 4737,1826 L 27279,1826 27279,14579 4737,14579 4737,1826 Z"/>
  514. </clipPath>
  515. </defs>
  516. <g clip-path="url(#clip_path_13)">
  517. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="5161" y="9858"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">LBL-T</tspan></tspan></tspan></text>
  518. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="8393" y="9858"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">9</tspan></tspan></tspan></text>
  519. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="11095" y="9858"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">16</tspan></tspan></tspan></text>
  520. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="17080" y="9858"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">LBL-T</tspan></tspan></tspan></text>
  521. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="20021" y="9858"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">8</tspan></tspan></tspan></text>
  522. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="23067" y="9858"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">16</tspan></tspan></tspan></text>
  523. </g>
  524. <defs>
  525. <clipPath id="clip_path_14" clipPathUnits="userSpaceOnUse">
  526. <path d="M 4737,9992 L 27279,9992 27279,10364 4737,10364 4737,9992 Z"/>
  527. </clipPath>
  528. </defs>
  529. <g clip-path="url(#clip_path_14)">
  530. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="344px" font-weight="400"><tspan class="TextPosition" x="7704" y="10286"><tspan fill="rgb(117,113,113)" stroke="none" style="white-space: pre">7 D+M; 2 D</tspan></tspan></tspan></text>
  531. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="344px" font-weight="400"><tspan class="TextPosition" x="19650" y="10286"><tspan fill="rgb(117,113,113)" stroke="none" style="white-space: pre">8 D+M</tspan></tspan></tspan></text>
  532. </g>
  533. <defs>
  534. <clipPath id="clip_path_15" clipPathUnits="userSpaceOnUse">
  535. <path d="M 4737,1826 L 27279,1826 27279,14579 4737,14579 4737,1826 Z"/>
  536. </clipPath>
  537. </defs>
  538. <g clip-path="url(#clip_path_15)">
  539. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="5161" y="10865"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">ZFP36L2</tspan></tspan></tspan></text>
  540. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="8393" y="10865"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">1</tspan></tspan></tspan></text>
  541. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="11201" y="10865"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">2</tspan></tspan></tspan></text>
  542. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="17080" y="10865"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">ZFP36L2</tspan></tspan></tspan></text>
  543. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="20021" y="10865"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">1</tspan></tspan></tspan></text>
  544. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="23172" y="10865"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">2</tspan></tspan></tspan></text>
  545. </g>
  546. <defs>
  547. <clipPath id="clip_path_16" clipPathUnits="userSpaceOnUse">
  548. <path d="M 4737,10999 L 27279,10999 27279,11371 4737,11371 4737,10999 Z"/>
  549. </clipPath>
  550. </defs>
  551. <g clip-path="url(#clip_path_16)">
  552. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="344px" font-weight="400"><tspan class="TextPosition" x="8022" y="11293"><tspan fill="rgb(117,113,113)" stroke="none" style="white-space: pre">1 D+M</tspan></tspan></tspan></text>
  553. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="344px" font-weight="400"><tspan class="TextPosition" x="19650" y="11293"><tspan fill="rgb(117,113,113)" stroke="none" style="white-space: pre">1 D+M</tspan></tspan></tspan></text>
  554. </g>
  555. <defs>
  556. <clipPath id="clip_path_17" clipPathUnits="userSpaceOnUse">
  557. <path d="M 4737,1826 L 27279,1826 27279,14579 4737,14579 4737,1826 Z"/>
  558. </clipPath>
  559. </defs>
  560. <g clip-path="url(#clip_path_17)">
  561. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="318px" font-weight="700"><tspan class="TextPosition" x="5161" y="11825"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">TOTAL</tspan></tspan></tspan></text>
  562. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="318px" font-weight="700"><tspan class="TextPosition" x="8260" y="11825"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">104</tspan></tspan></tspan></text>
  563. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="318px" font-weight="700"><tspan class="TextPosition" x="11041" y="11825"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">189</tspan></tspan></tspan></text>
  564. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="17080" y="11819"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">TOTAL</tspan></tspan></tspan></text>
  565. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="19915" y="11819"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">21</tspan></tspan></tspan></text>
  566. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="23067" y="11819"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">41</tspan></tspan></tspan></text>
  567. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="5161" y="12350"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">TOTAL *</tspan></tspan></tspan></text>
  568. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="8313" y="12350"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">98</tspan></tspan></tspan></text>
  569. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="11015" y="12350"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">179</tspan></tspan></tspan></text>
  570. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="344px" font-weight="400"><tspan class="TextPosition" x="7519" y="12830"><tspan fill="rgb(117,113,113)" stroke="none" style="white-space: pre">81 D+M; 17 D</tspan></tspan></tspan></text>
  571. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="400"><tspan class="TextPosition" x="5161" y="13941"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre"> * 6 patients comuns entre les projets </tspan></tspan></tspan></text>
  572. </g>
  573. <defs>
  574. <clipPath id="clip_path_18" clipPathUnits="userSpaceOnUse">
  575. <path d="M 6883,2357 L 12419,2357 12419,2834 6883,2834 6883,2357 Z"/>
  576. </clipPath>
  577. </defs>
  578. <g clip-path="url(#clip_path_18)">
  579. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="8048" y="2726"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">Fait WGS Nanopore</tspan></tspan></tspan></text>
  580. </g>
  581. <defs>
  582. <clipPath id="clip_path_19" clipPathUnits="userSpaceOnUse">
  583. <path d="M 18670,2357 L 24921,2357 24921,2834 18670,2834 18670,2357 Z"/>
  584. </clipPath>
  585. </defs>
  586. <g clip-path="url(#clip_path_19)">
  587. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Calibri, sans-serif" font-size="398px" font-weight="700"><tspan class="TextPosition" x="20789" y="2726"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">Reste a faire</tspan></tspan></tspan></text>
  588. </g>
  589. <defs>
  590. <clipPath id="clip_path_20" clipPathUnits="userSpaceOnUse">
  591. <path d="M 4711,1800 L 27279,1800 27279,14579 4711,14579 4711,1800 Z"/>
  592. </clipPath>
  593. </defs>
  594. <g clip-path="url(#clip_path_20)">
  595. <path fill="none" stroke="rgb(212,212,212)" d="M 6856,13015 L 6856,13518"/>
  596. <path fill="rgb(212,212,212)" stroke="none" d="M 6856,13015 L 6881,13015 6881,13518 6856,13518 6856,13015 Z"/>
  597. <path fill="none" stroke="rgb(212,212,212)" d="M 10088,13015 L 10088,13518"/>
  598. <path fill="rgb(212,212,212)" stroke="none" d="M 10088,13015 L 10114,13015 10114,13518 10088,13518 10088,13015 Z"/>
  599. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,1800 L 27331,1800"/>
  600. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,1800 L 27330,1800 27330,1825 27305,1825 27305,1800 Z"/>
  601. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,2330 L 27331,2330"/>
  602. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,2330 L 27330,2330 27330,2356 27305,2356 27305,2330 Z"/>
  603. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,2861 L 27331,2861"/>
  604. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,2861 L 27330,2861 27330,2886 27305,2886 27305,2861 Z"/>
  605. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,3390 L 27331,3390"/>
  606. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,3390 L 27330,3390 27330,3416 27305,3416 27305,3390 Z"/>
  607. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,3921 L 27331,3921"/>
  608. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,3921 L 27330,3921 27330,3946 27305,3946 27305,3921 Z"/>
  609. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,4345 L 27331,4345"/>
  610. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,4345 L 27330,4345 27330,4370 27305,4370 27305,4345 Z"/>
  611. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,4398 L 27331,4398"/>
  612. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,4398 L 27330,4398 27330,4424 27305,4424 27305,4398 Z"/>
  613. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,4928 L 27331,4928"/>
  614. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,4928 L 27330,4928 27330,4953 27305,4953 27305,4928 Z"/>
  615. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,5353 L 27331,5353"/>
  616. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,5353 L 27330,5353 27330,5378 27305,5378 27305,5353 Z"/>
  617. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,5406 L 27331,5406"/>
  618. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,5406 L 27330,5406 27330,5431 27305,5431 27305,5406 Z"/>
  619. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,5936 L 27331,5936"/>
  620. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,5936 L 27330,5936 27330,5961 27305,5961 27305,5936 Z"/>
  621. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,6360 L 27331,6360"/>
  622. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,6360 L 27330,6360 27330,6386 27305,6386 27305,6360 Z"/>
  623. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,6413 L 27331,6413"/>
  624. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,6413 L 27330,6413 27330,6438 27305,6438 27305,6413 Z"/>
  625. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,6943 L 27331,6943"/>
  626. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,6943 L 27330,6943 27330,6969 27305,6969 27305,6943 Z"/>
  627. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,7367 L 27331,7367"/>
  628. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,7367 L 27330,7367 27330,7393 27305,7393 27305,7367 Z"/>
  629. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,7420 L 27331,7420"/>
  630. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,7420 L 27330,7420 27330,7445 27305,7445 27305,7420 Z"/>
  631. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,7950 L 27331,7950"/>
  632. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,7950 L 27330,7950 27330,7976 27305,7976 27305,7950 Z"/>
  633. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,8375 L 27331,8375"/>
  634. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,8375 L 27330,8375 27330,8400 27305,8400 27305,8375 Z"/>
  635. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,8428 L 27331,8428"/>
  636. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,8428 L 27330,8428 27330,8454 27305,8454 27305,8428 Z"/>
  637. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,8958 L 27331,8958"/>
  638. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,8958 L 27330,8958 27330,8983 27305,8983 27305,8958 Z"/>
  639. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,9382 L 27331,9382"/>
  640. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,9382 L 27330,9382 27330,9407 27305,9407 27305,9382 Z"/>
  641. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,9435 L 27331,9435"/>
  642. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,9435 L 27330,9435 27330,9461 27305,9461 27305,9435 Z"/>
  643. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,9966 L 27331,9966"/>
  644. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,9966 L 27330,9966 27330,9991 27305,9991 27305,9966 Z"/>
  645. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,10390 L 27331,10390"/>
  646. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,10390 L 27330,10390 27330,10415 27305,10415 27305,10390 Z"/>
  647. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,10443 L 27331,10443"/>
  648. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,10443 L 27330,10443 27330,10468 27305,10468 27305,10443 Z"/>
  649. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,10973 L 27331,10973"/>
  650. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,10973 L 27330,10973 27330,10998 27305,10998 27305,10973 Z"/>
  651. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,11397 L 27331,11397"/>
  652. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,11397 L 27330,11397 27330,11423 27305,11423 27305,11397 Z"/>
  653. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,11928 L 27331,11928"/>
  654. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,11928 L 27330,11928 27330,11953 27305,11953 27305,11928 Z"/>
  655. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,12458 L 27331,12458"/>
  656. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,12458 L 27330,12458 27330,12483 27305,12483 27305,12458 Z"/>
  657. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,12987 L 27331,12987"/>
  658. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,12987 L 27330,12987 27330,13013 27305,13013 27305,12987 Z"/>
  659. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,13518 L 27331,13518"/>
  660. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,13518 L 27330,13518 27330,13543 27305,13543 27305,13518 Z"/>
  661. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,14048 L 27331,14048"/>
  662. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,14048 L 27330,14048 27330,14074 27305,14074 27305,14048 Z"/>
  663. <path fill="none" stroke="rgb(212,212,212)" d="M 27305,14579 L 27331,14579"/>
  664. <path fill="rgb(212,212,212)" stroke="none" d="M 27305,14579 L 27330,14579 27330,14604 27305,14604 27305,14579 Z"/>
  665. </g>
  666. </g>
  667. </g>
  668. <g ooo:text-adjust="left" class="TextShape">
  669. <g id="id8">
  670. <rect class="BoundingBox" stroke="none" fill="none" x="13460" y="12700" width="14481" height="6986"/>
  671. <text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="423px" font-weight="400"><tspan class="TextPosition" x="13710" y="13210"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre"> </tspan><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">commandes FC WGS : </tspan></tspan></tspan><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="423px" font-weight="400"><tspan class="TextPosition" x="13710" y="14254"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">1-      Commande en Mai de 40 pack de FC (soit 160 FC)</tspan></tspan></tspan><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="423px" font-weight="400"><tspan class="TextPosition" x="13710" y="15298"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">a.       Réception de 5 pack (20 FC) en Juin – reste 0</tspan></tspan></tspan><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="423px" font-weight="400"><tspan class="TextPosition" x="13710" y="16342"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">b.       Réception de  4 pack (16 FC) en septembre  - reste 16</tspan></tspan></tspan><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="423px" font-weight="400"><tspan class="TextPosition" x="13710" y="17386"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">2-      Réception prévu en décembre : 13 pack (52 FC) – reste 52</tspan></tspan></tspan><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="423px" font-weight="400"><tspan class="TextPosition" x="13710" y="18430"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">3-      Réception prévu en Mars 2025 : 17 pack ( 68 FC) – reste 68</tspan></tspan></tspan></text>
  672. </g>
  673. </g>
  674. </g>
  675. </g>
  676. </g>
  677. </g>
  678. </g>
  679. <script type="text/ecmascript"><![CDATA[
  680. (function(window, document, exportName, undefined) {
  681. 'use strict';
  682. var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];
  683. var TEST_ELEMENT = document.createElement('div');
  684. var TYPE_FUNCTION = 'function';
  685. var round = Math.round;
  686. var abs = Math.abs;
  687. var now = Date.now;
  688. if (!Math.trunc) {
  689. Math.trunc = function (v) {
  690. return v < 0 ? Math.ceil(v) : Math.floor(v);
  691. };
  692. }
  693. function setTimeoutContext(fn, timeout, context) {
  694. return setTimeout(bindFn(fn, context), timeout);
  695. }
  696. function invokeArrayArg(arg, fn, context) {
  697. if (Array.isArray(arg)) {
  698. each(arg, context[fn], context);
  699. return true;
  700. }
  701. return false;
  702. }
  703. function each(obj, iterator, context) {
  704. var i;
  705. if (!obj) {
  706. return;
  707. }
  708. if (obj.forEach) {
  709. obj.forEach(iterator, context);
  710. } else if (obj.length !== undefined) {
  711. i = 0;
  712. while (i < obj.length) {
  713. iterator.call(context, obj[i], i, obj);
  714. i++;
  715. }
  716. } else {
  717. for (i in obj) {
  718. obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
  719. }
  720. }
  721. }
  722. function deprecate(method, name, message) {
  723. var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\n' + message + ' AT \n';
  724. return function() {
  725. var e = new Error('get-stack-trace');
  726. var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '')
  727. .replace(/^\s+at\s+/gm, '')
  728. .replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';
  729. var log = window.console && (window.console.warn || window.console.log);
  730. if (log) {
  731. log.call(window.console, deprecationMessage, stack);
  732. }
  733. return method.apply(this, arguments);
  734. };
  735. }
  736. var assign;
  737. if (typeof Object.assign !== 'function') {
  738. assign = function assign(target) {
  739. if (target === undefined || target === null) {
  740. throw new TypeError('Cannot convert undefined or null to object');
  741. }
  742. var output = Object(target);
  743. for (var index = 1; index < arguments.length; index++) {
  744. var source = arguments[index];
  745. if (source !== undefined && source !== null) {
  746. for (var nextKey in source) {
  747. if (source.hasOwnProperty(nextKey)) {
  748. output[nextKey] = source[nextKey];
  749. }
  750. }
  751. }
  752. }
  753. return output;
  754. };
  755. } else {
  756. assign = Object.assign;
  757. }
  758. var extend = deprecate(function extend(dest, src, merge) {
  759. var keys = Object.keys(src);
  760. var i = 0;
  761. while (i < keys.length) {
  762. if (!merge || (merge && dest[keys[i]] === undefined)) {
  763. dest[keys[i]] = src[keys[i]];
  764. }
  765. i++;
  766. }
  767. return dest;
  768. }, 'extend', 'Use `assign`.');
  769. var merge = deprecate(function merge(dest, src) {
  770. return extend(dest, src, true);
  771. }, 'merge', 'Use `assign`.');
  772. function inherit(child, base, properties) {
  773. var baseP = base.prototype,
  774. childP;
  775. childP = child.prototype = Object.create(baseP);
  776. childP.constructor = child;
  777. childP._super = baseP;
  778. if (properties) {
  779. assign(childP, properties);
  780. }
  781. }
  782. function bindFn(fn, context) {
  783. return function boundFn() {
  784. return fn.apply(context, arguments);
  785. };
  786. }
  787. function boolOrFn(val, args) {
  788. if (typeof val == TYPE_FUNCTION) {
  789. return val.apply(args ? args[0] || undefined : undefined, args);
  790. }
  791. return val;
  792. }
  793. function ifUndefined(val1, val2) {
  794. return (val1 === undefined) ? val2 : val1;
  795. }
  796. function addEventListeners(target, types, handler) {
  797. each(splitStr(types), function(type) {
  798. target.addEventListener(type, handler, false);
  799. });
  800. }
  801. function removeEventListeners(target, types, handler) {
  802. each(splitStr(types), function(type) {
  803. target.removeEventListener(type, handler, false);
  804. });
  805. }
  806. function hasParent(node, parent) {
  807. while (node) {
  808. if (node == parent) {
  809. return true;
  810. }
  811. node = node.parentNode;
  812. }
  813. return false;
  814. }
  815. function inStr(str, find) {
  816. return str.indexOf(find) > -1;
  817. }
  818. function splitStr(str) {
  819. return str.trim().split(/\s+/g);
  820. }
  821. function inArray(src, find, findByKey) {
  822. if (src.indexOf && !findByKey) {
  823. return src.indexOf(find);
  824. } else {
  825. var i = 0;
  826. while (i < src.length) {
  827. if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {
  828. return i;
  829. }
  830. i++;
  831. }
  832. return -1;
  833. }
  834. }
  835. function toArray(obj) {
  836. return Array.prototype.slice.call(obj, 0);
  837. }
  838. function uniqueArray(src, key, sort) {
  839. var results = [];
  840. var values = [];
  841. var i = 0;
  842. while (i < src.length) {
  843. var val = key ? src[i][key] : src[i];
  844. if (inArray(values, val) < 0) {
  845. results.push(src[i]);
  846. }
  847. values[i] = val;
  848. i++;
  849. }
  850. if (sort) {
  851. if (!key) {
  852. results = results.sort();
  853. } else {
  854. results = results.sort(function sortUniqueArray(a, b) {
  855. return a[key] > b[key];
  856. });
  857. }
  858. }
  859. return results;
  860. }
  861. function prefixed(obj, property) {
  862. if (obj === undefined) {
  863. return undefined;
  864. }
  865. var prefix, prop;
  866. var camelProp = property[0].toUpperCase() + property.slice(1);
  867. var i = 0;
  868. while (i < VENDOR_PREFIXES.length) {
  869. prefix = VENDOR_PREFIXES[i];
  870. prop = (prefix) ? prefix + camelProp : property;
  871. if (prop in obj) {
  872. return prop;
  873. }
  874. i++;
  875. }
  876. return undefined;
  877. }
  878. var _uniqueId = 1;
  879. function uniqueId() {
  880. return _uniqueId++;
  881. }
  882. function getWindowForElement(element) {
  883. var doc = element.ownerDocument || element;
  884. return (doc.defaultView || doc.parentWindow || window);
  885. }
  886. var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
  887. var SUPPORT_TOUCH = ('ontouchstart' in window);
  888. var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;
  889. var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
  890. var INPUT_TYPE_TOUCH = 'touch';
  891. var INPUT_TYPE_PEN = 'pen';
  892. var INPUT_TYPE_MOUSE = 'mouse';
  893. var INPUT_TYPE_KINECT = 'kinect';
  894. var COMPUTE_INTERVAL = 25;
  895. var INPUT_START = 1;
  896. var INPUT_MOVE = 2;
  897. var INPUT_END = 4;
  898. var INPUT_CANCEL = 8;
  899. var DIRECTION_NONE = 1;
  900. var DIRECTION_LEFT = 2;
  901. var DIRECTION_RIGHT = 4;
  902. var DIRECTION_UP = 8;
  903. var DIRECTION_DOWN = 16;
  904. var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
  905. var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
  906. var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
  907. var PROPS_XY = ['x', 'y'];
  908. var PROPS_CLIENT_XY = ['clientX', 'clientY'];
  909. function Input(manager, callback) {
  910. var self = this;
  911. this.manager = manager;
  912. this.callback = callback;
  913. this.element = manager.element;
  914. this.target = manager.options.inputTarget;
  915. this.domHandler = function(ev) {
  916. if (boolOrFn(manager.options.enable, [manager])) {
  917. self.handler(ev);
  918. }
  919. };
  920. this.init();
  921. }
  922. Input.prototype = {
  923. handler: function() { },
  924. init: function() {
  925. this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
  926. this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
  927. this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
  928. },
  929. destroy: function() {
  930. this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
  931. this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
  932. this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
  933. }
  934. };
  935. function createInputInstance(manager) {
  936. var Type;
  937. var inputClass = manager.options.inputClass;
  938. if (inputClass) {
  939. Type = inputClass;
  940. } else if (!SUPPORT_TOUCH && SUPPORT_POINTER_EVENTS) {
  941. Type = PointerEventInput;
  942. } else if (SUPPORT_ONLY_TOUCH) {
  943. Type = TouchInput;
  944. } else if (!SUPPORT_TOUCH) {
  945. Type = MouseInput;
  946. } else {
  947. Type = TouchMouseInput;
  948. }
  949. return new (Type)(manager, inputHandler);
  950. }
  951. function inputHandler(manager, eventType, input) {
  952. var pointersLen = input.pointers.length;
  953. var changedPointersLen = input.changedPointers.length;
  954. var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));
  955. var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));
  956. input.isFirst = !!isFirst;
  957. input.isFinal = !!isFinal;
  958. if (isFirst) {
  959. manager.session = {};
  960. }
  961. input.eventType = eventType;
  962. computeInputData(manager, input);
  963. manager.emit('hammer.input', input);
  964. manager.recognize(input);
  965. manager.session.prevInput = input;
  966. }
  967. function computeInputData(manager, input) {
  968. var session = manager.session;
  969. var pointers = input.pointers;
  970. var pointersLength = pointers.length;
  971. if (!session.firstInput) {
  972. session.firstInput = simpleCloneInputData(input);
  973. }
  974. if (pointersLength > 1 && !session.firstMultiple) {
  975. session.firstMultiple = simpleCloneInputData(input);
  976. } else if (pointersLength === 1) {
  977. session.firstMultiple = false;
  978. }
  979. var firstInput = session.firstInput;
  980. var firstMultiple = session.firstMultiple;
  981. var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
  982. var center = input.center = getCenter(pointers);
  983. input.timeStamp = now();
  984. input.deltaTime = input.timeStamp - firstInput.timeStamp;
  985. input.angle = getAngle(offsetCenter, center);
  986. input.distance = getDistance(offsetCenter, center);
  987. computeDeltaXY(session, input);
  988. input.offsetDirection = getDirection(input.deltaX, input.deltaY);
  989. var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
  990. input.overallVelocityX = overallVelocity.x;
  991. input.overallVelocityY = overallVelocity.y;
  992. input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;
  993. input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
  994. input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
  995. input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >
  996. session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);
  997. computeIntervalInputData(session, input);
  998. var target = manager.element;
  999. if (hasParent(input.srcEvent.target, target)) {
  1000. target = input.srcEvent.target;
  1001. }
  1002. input.target = target;
  1003. }
  1004. function computeDeltaXY(session, input) {
  1005. var center = input.center;
  1006. var offset = session.offsetDelta || {};
  1007. var prevDelta = session.prevDelta || {};
  1008. var prevInput = session.prevInput || {};
  1009. if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
  1010. prevDelta = session.prevDelta = {
  1011. x: prevInput.deltaX || 0,
  1012. y: prevInput.deltaY || 0
  1013. };
  1014. offset = session.offsetDelta = {
  1015. x: center.x,
  1016. y: center.y
  1017. };
  1018. }
  1019. input.deltaX = prevDelta.x + (center.x - offset.x);
  1020. input.deltaY = prevDelta.y + (center.y - offset.y);
  1021. }
  1022. function computeIntervalInputData(session, input) {
  1023. var last = session.lastInterval || input,
  1024. deltaTime = input.timeStamp - last.timeStamp,
  1025. velocity, velocityX, velocityY, direction;
  1026. if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
  1027. var deltaX = input.deltaX - last.deltaX;
  1028. var deltaY = input.deltaY - last.deltaY;
  1029. var v = getVelocity(deltaTime, deltaX, deltaY);
  1030. velocityX = v.x;
  1031. velocityY = v.y;
  1032. velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;
  1033. direction = getDirection(deltaX, deltaY);
  1034. session.lastInterval = input;
  1035. } else {
  1036. velocity = last.velocity;
  1037. velocityX = last.velocityX;
  1038. velocityY = last.velocityY;
  1039. direction = last.direction;
  1040. }
  1041. input.velocity = velocity;
  1042. input.velocityX = velocityX;
  1043. input.velocityY = velocityY;
  1044. input.direction = direction;
  1045. }
  1046. function simpleCloneInputData(input) {
  1047. var pointers = [];
  1048. var i = 0;
  1049. while (i < input.pointers.length) {
  1050. pointers[i] = {
  1051. clientX: round(input.pointers[i].clientX),
  1052. clientY: round(input.pointers[i].clientY)
  1053. };
  1054. i++;
  1055. }
  1056. return {
  1057. timeStamp: now(),
  1058. pointers: pointers,
  1059. center: getCenter(pointers),
  1060. deltaX: input.deltaX,
  1061. deltaY: input.deltaY
  1062. };
  1063. }
  1064. function getCenter(pointers) {
  1065. var pointersLength = pointers.length;
  1066. if (pointersLength === 1) {
  1067. return {
  1068. x: round(pointers[0].clientX),
  1069. y: round(pointers[0].clientY)
  1070. };
  1071. }
  1072. var x = 0, y = 0, i = 0;
  1073. while (i < pointersLength) {
  1074. x += pointers[i].clientX;
  1075. y += pointers[i].clientY;
  1076. i++;
  1077. }
  1078. return {
  1079. x: round(x / pointersLength),
  1080. y: round(y / pointersLength)
  1081. };
  1082. }
  1083. function getVelocity(deltaTime, x, y) {
  1084. return {
  1085. x: x / deltaTime || 0,
  1086. y: y / deltaTime || 0
  1087. };
  1088. }
  1089. function getDirection(x, y) {
  1090. if (x === y) {
  1091. return DIRECTION_NONE;
  1092. }
  1093. if (abs(x) >= abs(y)) {
  1094. return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
  1095. }
  1096. return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
  1097. }
  1098. function getDistance(p1, p2, props) {
  1099. if (!props) {
  1100. props = PROPS_XY;
  1101. }
  1102. var x = p2[props[0]] - p1[props[0]],
  1103. y = p2[props[1]] - p1[props[1]];
  1104. return Math.sqrt((x * x) + (y * y));
  1105. }
  1106. function getAngle(p1, p2, props) {
  1107. if (!props) {
  1108. props = PROPS_XY;
  1109. }
  1110. var x = p2[props[0]] - p1[props[0]],
  1111. y = p2[props[1]] - p1[props[1]];
  1112. return Math.atan2(y, x) * 180 / Math.PI;
  1113. }
  1114. function getRotation(start, end) {
  1115. return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);
  1116. }
  1117. function getScale(start, end) {
  1118. return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
  1119. }
  1120. var MOUSE_INPUT_MAP = {
  1121. mousedown: INPUT_START,
  1122. mousemove: INPUT_MOVE,
  1123. mouseup: INPUT_END
  1124. };
  1125. var MOUSE_ELEMENT_EVENTS = 'mousedown';
  1126. var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
  1127. function MouseInput() {
  1128. this.evEl = MOUSE_ELEMENT_EVENTS;
  1129. this.evWin = MOUSE_WINDOW_EVENTS;
  1130. this.pressed = false; // mousedown state
  1131. Input.apply(this, arguments);
  1132. }
  1133. inherit(MouseInput, Input, {
  1134. handler: function MEhandler(ev) {
  1135. var eventType = MOUSE_INPUT_MAP[ev.type];
  1136. if (eventType & INPUT_START && ev.button === 0) {
  1137. this.pressed = true;
  1138. }
  1139. if (eventType & INPUT_MOVE && ev.which !== 1) {
  1140. eventType = INPUT_END;
  1141. }
  1142. if (!this.pressed) {
  1143. return;
  1144. }
  1145. if (eventType & INPUT_END) {
  1146. this.pressed = false;
  1147. }
  1148. this.callback(this.manager, eventType, {
  1149. pointers: [ev],
  1150. changedPointers: [ev],
  1151. pointerType: INPUT_TYPE_MOUSE,
  1152. srcEvent: ev
  1153. });
  1154. }
  1155. });
  1156. var POINTER_INPUT_MAP = {
  1157. pointerdown: INPUT_START,
  1158. pointermove: INPUT_MOVE,
  1159. pointerup: INPUT_END,
  1160. pointercancel: INPUT_CANCEL,
  1161. pointerout: INPUT_CANCEL
  1162. };
  1163. var IE10_POINTER_TYPE_ENUM = {
  1164. 2: INPUT_TYPE_TOUCH,
  1165. 3: INPUT_TYPE_PEN,
  1166. 4: INPUT_TYPE_MOUSE,
  1167. 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816
  1168. };
  1169. var POINTER_ELEMENT_EVENTS = 'pointerdown';
  1170. var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
  1171. if (window.MSPointerEvent && !window.PointerEvent) {
  1172. POINTER_ELEMENT_EVENTS = 'MSPointerDown';
  1173. POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
  1174. }
  1175. function PointerEventInput() {
  1176. this.evEl = POINTER_ELEMENT_EVENTS;
  1177. this.evWin = POINTER_WINDOW_EVENTS;
  1178. Input.apply(this, arguments);
  1179. this.store = (this.manager.session.pointerEvents = []);
  1180. }
  1181. inherit(PointerEventInput, Input, {
  1182. handler: function PEhandler(ev) {
  1183. var store = this.store;
  1184. var removePointer = false;
  1185. var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
  1186. var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
  1187. var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
  1188. var isTouch = (pointerType == INPUT_TYPE_TOUCH);
  1189. var storeIndex = inArray(store, ev.pointerId, 'pointerId');
  1190. if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
  1191. if (storeIndex < 0) {
  1192. store.push(ev);
  1193. storeIndex = store.length - 1;
  1194. }
  1195. } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
  1196. removePointer = true;
  1197. }
  1198. if (storeIndex < 0) {
  1199. return;
  1200. }
  1201. store[storeIndex] = ev;
  1202. this.callback(this.manager, eventType, {
  1203. pointers: store,
  1204. changedPointers: [ev],
  1205. pointerType: pointerType,
  1206. srcEvent: ev
  1207. });
  1208. if (removePointer) {
  1209. store.splice(storeIndex, 1);
  1210. }
  1211. }
  1212. });
  1213. var SINGLE_TOUCH_INPUT_MAP = {
  1214. touchstart: INPUT_START,
  1215. touchmove: INPUT_MOVE,
  1216. touchend: INPUT_END,
  1217. touchcancel: INPUT_CANCEL
  1218. };
  1219. var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
  1220. var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
  1221. function SingleTouchInput() {
  1222. this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
  1223. this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
  1224. this.started = false;
  1225. Input.apply(this, arguments);
  1226. }
  1227. inherit(SingleTouchInput, Input, {
  1228. handler: function TEhandler(ev) {
  1229. var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
  1230. if (type === INPUT_START) {
  1231. this.started = true;
  1232. }
  1233. if (!this.started) {
  1234. return;
  1235. }
  1236. var touches = normalizeSingleTouches.call(this, ev, type);
  1237. if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
  1238. this.started = false;
  1239. }
  1240. this.callback(this.manager, type, {
  1241. pointers: touches[0],
  1242. changedPointers: touches[1],
  1243. pointerType: INPUT_TYPE_TOUCH,
  1244. srcEvent: ev
  1245. });
  1246. }
  1247. });
  1248. function normalizeSingleTouches(ev, type) {
  1249. var all = toArray(ev.touches);
  1250. var changed = toArray(ev.changedTouches);
  1251. if (type & (INPUT_END | INPUT_CANCEL)) {
  1252. all = uniqueArray(all.concat(changed), 'identifier', true);
  1253. }
  1254. return [all, changed];
  1255. }
  1256. var TOUCH_INPUT_MAP = {
  1257. touchstart: INPUT_START,
  1258. touchmove: INPUT_MOVE,
  1259. touchend: INPUT_END,
  1260. touchcancel: INPUT_CANCEL
  1261. };
  1262. var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
  1263. function TouchInput() {
  1264. this.evTarget = TOUCH_TARGET_EVENTS;
  1265. this.targetIds = {};
  1266. Input.apply(this, arguments);
  1267. }
  1268. inherit(TouchInput, Input, {
  1269. handler: function MTEhandler(ev) {
  1270. var type = TOUCH_INPUT_MAP[ev.type];
  1271. var touches = getTouches.call(this, ev, type);
  1272. if (!touches) {
  1273. return;
  1274. }
  1275. this.callback(this.manager, type, {
  1276. pointers: touches[0],
  1277. changedPointers: touches[1],
  1278. pointerType: INPUT_TYPE_TOUCH,
  1279. srcEvent: ev
  1280. });
  1281. }
  1282. });
  1283. function getTouches(ev, type) {
  1284. var allTouches = toArray(ev.touches);
  1285. var targetIds = this.targetIds;
  1286. if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
  1287. targetIds[allTouches[0].identifier] = true;
  1288. return [allTouches, allTouches];
  1289. }
  1290. var i,
  1291. targetTouches,
  1292. changedTouches = toArray(ev.changedTouches),
  1293. changedTargetTouches = [],
  1294. target = this.target;
  1295. targetTouches = allTouches.filter(function(touch) {
  1296. return hasParent(touch.target, target);
  1297. });
  1298. if (type === INPUT_START) {
  1299. i = 0;
  1300. while (i < targetTouches.length) {
  1301. targetIds[targetTouches[i].identifier] = true;
  1302. i++;
  1303. }
  1304. }
  1305. i = 0;
  1306. while (i < changedTouches.length) {
  1307. if (targetIds[changedTouches[i].identifier]) {
  1308. changedTargetTouches.push(changedTouches[i]);
  1309. }
  1310. if (type & (INPUT_END | INPUT_CANCEL)) {
  1311. delete targetIds[changedTouches[i].identifier];
  1312. }
  1313. i++;
  1314. }
  1315. if (!changedTargetTouches.length) {
  1316. return;
  1317. }
  1318. return [
  1319. uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),
  1320. changedTargetTouches
  1321. ];
  1322. }
  1323. var DEDUP_TIMEOUT = 2500;
  1324. var DEDUP_DISTANCE = 25;
  1325. function TouchMouseInput() {
  1326. Input.apply(this, arguments);
  1327. var handler = bindFn(this.handler, this);
  1328. this.touch = new TouchInput(this.manager, handler);
  1329. this.mouse = new MouseInput(this.manager, handler);
  1330. this.primaryTouch = null;
  1331. this.lastTouches = [];
  1332. }
  1333. inherit(TouchMouseInput, Input, {
  1334. handler: function TMEhandler(manager, inputEvent, inputData) {
  1335. var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),
  1336. isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);
  1337. if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {
  1338. return;
  1339. }
  1340. if (isTouch) {
  1341. recordTouches.call(this, inputEvent, inputData);
  1342. } else if (isMouse && isSyntheticEvent.call(this, inputData)) {
  1343. return;
  1344. }
  1345. this.callback(manager, inputEvent, inputData);
  1346. },
  1347. destroy: function destroy() {
  1348. this.touch.destroy();
  1349. this.mouse.destroy();
  1350. }
  1351. });
  1352. function recordTouches(eventType, eventData) {
  1353. if (eventType & INPUT_START) {
  1354. this.primaryTouch = eventData.changedPointers[0].identifier;
  1355. setLastTouch.call(this, eventData);
  1356. } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
  1357. setLastTouch.call(this, eventData);
  1358. }
  1359. }
  1360. function setLastTouch(eventData) {
  1361. var touch = eventData.changedPointers[0];
  1362. if (touch.identifier === this.primaryTouch) {
  1363. var lastTouch = {x: touch.clientX, y: touch.clientY};
  1364. this.lastTouches.push(lastTouch);
  1365. var lts = this.lastTouches;
  1366. var removeLastTouch = function() {
  1367. var i = lts.indexOf(lastTouch);
  1368. if (i > -1) {
  1369. lts.splice(i, 1);
  1370. }
  1371. };
  1372. setTimeout(removeLastTouch, DEDUP_TIMEOUT);
  1373. }
  1374. }
  1375. function isSyntheticEvent(eventData) {
  1376. var x = eventData.srcEvent.clientX, y = eventData.srcEvent.clientY;
  1377. for (var i = 0; i < this.lastTouches.length; i++) {
  1378. var t = this.lastTouches[i];
  1379. var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y);
  1380. if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {
  1381. return true;
  1382. }
  1383. }
  1384. return false;
  1385. }
  1386. var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
  1387. var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
  1388. var TOUCH_ACTION_COMPUTE = 'compute';
  1389. var TOUCH_ACTION_AUTO = 'auto';
  1390. var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
  1391. var TOUCH_ACTION_NONE = 'none';
  1392. var TOUCH_ACTION_PAN_X = 'pan-x';
  1393. var TOUCH_ACTION_PAN_Y = 'pan-y';
  1394. var TOUCH_ACTION_MAP = getTouchActionProps();
  1395. function TouchAction(manager, value) {
  1396. this.manager = manager;
  1397. this.set(value);
  1398. }
  1399. TouchAction.prototype = {
  1400. set: function(value) {
  1401. if (value == TOUCH_ACTION_COMPUTE) {
  1402. value = this.compute();
  1403. }
  1404. if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {
  1405. this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
  1406. }
  1407. this.actions = value.toLowerCase().trim();
  1408. },
  1409. update: function() {
  1410. this.set(this.manager.options.touchAction);
  1411. },
  1412. compute: function() {
  1413. var actions = [];
  1414. each(this.manager.recognizers, function(recognizer) {
  1415. if (boolOrFn(recognizer.options.enable, [recognizer])) {
  1416. actions = actions.concat(recognizer.getTouchAction());
  1417. }
  1418. });
  1419. return cleanTouchActions(actions.join(' '));
  1420. },
  1421. preventDefaults: function(input) {
  1422. var srcEvent = input.srcEvent;
  1423. var direction = input.offsetDirection;
  1424. if (this.manager.session.prevented) {
  1425. srcEvent.preventDefault();
  1426. return;
  1427. }
  1428. var actions = this.actions;
  1429. var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];
  1430. var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];
  1431. var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];
  1432. if (hasNone) {
  1433. var isTapPointer = input.pointers.length === 1;
  1434. var isTapMovement = input.distance < 2;
  1435. var isTapTouchTime = input.deltaTime < 250;
  1436. if (isTapPointer && isTapMovement && isTapTouchTime) {
  1437. return;
  1438. }
  1439. }
  1440. if (hasPanX && hasPanY) {
  1441. return;
  1442. }
  1443. if (hasNone ||
  1444. (hasPanY && direction & DIRECTION_HORIZONTAL) ||
  1445. (hasPanX && direction & DIRECTION_VERTICAL)) {
  1446. return this.preventSrc(srcEvent);
  1447. }
  1448. },
  1449. preventSrc: function(srcEvent) {
  1450. this.manager.session.prevented = true;
  1451. srcEvent.preventDefault();
  1452. }
  1453. };
  1454. function cleanTouchActions(actions) {
  1455. if (inStr(actions, TOUCH_ACTION_NONE)) {
  1456. return TOUCH_ACTION_NONE;
  1457. }
  1458. var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
  1459. var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
  1460. if (hasPanX && hasPanY) {
  1461. return TOUCH_ACTION_NONE;
  1462. }
  1463. if (hasPanX || hasPanY) {
  1464. return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
  1465. }
  1466. if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
  1467. return TOUCH_ACTION_MANIPULATION;
  1468. }
  1469. return TOUCH_ACTION_AUTO;
  1470. }
  1471. function getTouchActionProps() {
  1472. if (!NATIVE_TOUCH_ACTION) {
  1473. return false;
  1474. }
  1475. var touchMap = {};
  1476. var cssSupports = window.CSS && window.CSS.supports;
  1477. ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function(val) {
  1478. touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true;
  1479. });
  1480. return touchMap;
  1481. }
  1482. var STATE_POSSIBLE = 1;
  1483. var STATE_BEGAN = 2;
  1484. var STATE_CHANGED = 4;
  1485. var STATE_ENDED = 8;
  1486. var STATE_RECOGNIZED = STATE_ENDED;
  1487. var STATE_CANCELLED = 16;
  1488. var STATE_FAILED = 32;
  1489. function Recognizer(options) {
  1490. this.options = assign({}, this.defaults, options || {});
  1491. this.id = uniqueId();
  1492. this.manager = null;
  1493. this.options.enable = ifUndefined(this.options.enable, true);
  1494. this.state = STATE_POSSIBLE;
  1495. this.simultaneous = {};
  1496. this.requireFail = [];
  1497. }
  1498. Recognizer.prototype = {
  1499. defaults: {},
  1500. set: function(options) {
  1501. assign(this.options, options);
  1502. this.manager && this.manager.touchAction.update();
  1503. return this;
  1504. },
  1505. recognizeWith: function(otherRecognizer) {
  1506. if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
  1507. return this;
  1508. }
  1509. var simultaneous = this.simultaneous;
  1510. otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
  1511. if (!simultaneous[otherRecognizer.id]) {
  1512. simultaneous[otherRecognizer.id] = otherRecognizer;
  1513. otherRecognizer.recognizeWith(this);
  1514. }
  1515. return this;
  1516. },
  1517. dropRecognizeWith: function(otherRecognizer) {
  1518. if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
  1519. return this;
  1520. }
  1521. otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
  1522. delete this.simultaneous[otherRecognizer.id];
  1523. return this;
  1524. },
  1525. requireFailure: function(otherRecognizer) {
  1526. if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
  1527. return this;
  1528. }
  1529. var requireFail = this.requireFail;
  1530. otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
  1531. if (inArray(requireFail, otherRecognizer) === -1) {
  1532. requireFail.push(otherRecognizer);
  1533. otherRecognizer.requireFailure(this);
  1534. }
  1535. return this;
  1536. },
  1537. dropRequireFailure: function(otherRecognizer) {
  1538. if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
  1539. return this;
  1540. }
  1541. otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
  1542. var index = inArray(this.requireFail, otherRecognizer);
  1543. if (index > -1) {
  1544. this.requireFail.splice(index, 1);
  1545. }
  1546. return this;
  1547. },
  1548. hasRequireFailures: function() {
  1549. return this.requireFail.length > 0;
  1550. },
  1551. canRecognizeWith: function(otherRecognizer) {
  1552. return !!this.simultaneous[otherRecognizer.id];
  1553. },
  1554. emit: function(input) {
  1555. var self = this;
  1556. var state = this.state;
  1557. function emit(event) {
  1558. self.manager.emit(event, input);
  1559. }
  1560. if (state < STATE_ENDED) {
  1561. emit(self.options.event + stateStr(state));
  1562. }
  1563. emit(self.options.event); // simple 'eventName' events
  1564. if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...)
  1565. emit(input.additionalEvent);
  1566. }
  1567. if (state >= STATE_ENDED) {
  1568. emit(self.options.event + stateStr(state));
  1569. }
  1570. },
  1571. tryEmit: function(input) {
  1572. if (this.canEmit()) {
  1573. return this.emit(input);
  1574. }
  1575. this.state = STATE_FAILED;
  1576. },
  1577. canEmit: function() {
  1578. var i = 0;
  1579. while (i < this.requireFail.length) {
  1580. if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
  1581. return false;
  1582. }
  1583. i++;
  1584. }
  1585. return true;
  1586. },
  1587. recognize: function(inputData) {
  1588. var inputDataClone = assign({}, inputData);
  1589. if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
  1590. this.reset();
  1591. this.state = STATE_FAILED;
  1592. return;
  1593. }
  1594. if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
  1595. this.state = STATE_POSSIBLE;
  1596. }
  1597. this.state = this.process(inputDataClone);
  1598. if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
  1599. this.tryEmit(inputDataClone);
  1600. }
  1601. },
  1602. process: function(inputData) { }, // jshint ignore:line
  1603. getTouchAction: function() { },
  1604. reset: function() { }
  1605. };
  1606. function stateStr(state) {
  1607. if (state & STATE_CANCELLED) {
  1608. return 'cancel';
  1609. } else if (state & STATE_ENDED) {
  1610. return 'end';
  1611. } else if (state & STATE_CHANGED) {
  1612. return 'move';
  1613. } else if (state & STATE_BEGAN) {
  1614. return 'start';
  1615. }
  1616. return '';
  1617. }
  1618. function directionStr(direction) {
  1619. if (direction == DIRECTION_DOWN) {
  1620. return 'down';
  1621. } else if (direction == DIRECTION_UP) {
  1622. return 'up';
  1623. } else if (direction == DIRECTION_LEFT) {
  1624. return 'left';
  1625. } else if (direction == DIRECTION_RIGHT) {
  1626. return 'right';
  1627. }
  1628. return '';
  1629. }
  1630. function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
  1631. var manager = recognizer.manager;
  1632. if (manager) {
  1633. return manager.get(otherRecognizer);
  1634. }
  1635. return otherRecognizer;
  1636. }
  1637. function AttrRecognizer() {
  1638. Recognizer.apply(this, arguments);
  1639. }
  1640. inherit(AttrRecognizer, Recognizer, {
  1641. defaults: {
  1642. pointers: 1
  1643. },
  1644. attrTest: function(input) {
  1645. var optionPointers = this.options.pointers;
  1646. return optionPointers === 0 || input.pointers.length === optionPointers;
  1647. },
  1648. process: function(input) {
  1649. var state = this.state;
  1650. var eventType = input.eventType;
  1651. var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
  1652. var isValid = this.attrTest(input);
  1653. if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
  1654. return state | STATE_CANCELLED;
  1655. } else if (isRecognized || isValid) {
  1656. if (eventType & INPUT_END) {
  1657. return state | STATE_ENDED;
  1658. } else if (!(state & STATE_BEGAN)) {
  1659. return STATE_BEGAN;
  1660. }
  1661. return state | STATE_CHANGED;
  1662. }
  1663. return STATE_FAILED;
  1664. }
  1665. });
  1666. function PanRecognizer() {
  1667. AttrRecognizer.apply(this, arguments);
  1668. this.pX = null;
  1669. this.pY = null;
  1670. }
  1671. inherit(PanRecognizer, AttrRecognizer, {
  1672. defaults: {
  1673. event: 'pan',
  1674. threshold: 10,
  1675. pointers: 1,
  1676. direction: DIRECTION_ALL
  1677. },
  1678. getTouchAction: function() {
  1679. var direction = this.options.direction;
  1680. var actions = [];
  1681. if (direction & DIRECTION_HORIZONTAL) {
  1682. actions.push(TOUCH_ACTION_PAN_Y);
  1683. }
  1684. if (direction & DIRECTION_VERTICAL) {
  1685. actions.push(TOUCH_ACTION_PAN_X);
  1686. }
  1687. return actions;
  1688. },
  1689. directionTest: function(input) {
  1690. var options = this.options;
  1691. var hasMoved = true;
  1692. var distance = input.distance;
  1693. var direction = input.direction;
  1694. var x = input.deltaX;
  1695. var y = input.deltaY;
  1696. if (!(direction & options.direction)) {
  1697. if (options.direction & DIRECTION_HORIZONTAL) {
  1698. direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
  1699. hasMoved = x != this.pX;
  1700. distance = Math.abs(input.deltaX);
  1701. } else {
  1702. direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;
  1703. hasMoved = y != this.pY;
  1704. distance = Math.abs(input.deltaY);
  1705. }
  1706. }
  1707. input.direction = direction;
  1708. return hasMoved && distance > options.threshold && direction & options.direction;
  1709. },
  1710. attrTest: function(input) {
  1711. return AttrRecognizer.prototype.attrTest.call(this, input) &&
  1712. (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));
  1713. },
  1714. emit: function(input) {
  1715. this.pX = input.deltaX;
  1716. this.pY = input.deltaY;
  1717. var direction = directionStr(input.direction);
  1718. if (direction) {
  1719. input.additionalEvent = this.options.event + direction;
  1720. }
  1721. this._super.emit.call(this, input);
  1722. }
  1723. });
  1724. function PinchRecognizer() {
  1725. AttrRecognizer.apply(this, arguments);
  1726. }
  1727. inherit(PinchRecognizer, AttrRecognizer, {
  1728. defaults: {
  1729. event: 'pinch',
  1730. threshold: 0,
  1731. pointers: 2
  1732. },
  1733. getTouchAction: function() {
  1734. return [TOUCH_ACTION_NONE];
  1735. },
  1736. attrTest: function(input) {
  1737. return this._super.attrTest.call(this, input) &&
  1738. (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
  1739. },
  1740. emit: function(input) {
  1741. if (input.scale !== 1) {
  1742. var inOut = input.scale < 1 ? 'in' : 'out';
  1743. input.additionalEvent = this.options.event + inOut;
  1744. }
  1745. this._super.emit.call(this, input);
  1746. }
  1747. });
  1748. function PressRecognizer() {
  1749. Recognizer.apply(this, arguments);
  1750. this._timer = null;
  1751. this._input = null;
  1752. }
  1753. inherit(PressRecognizer, Recognizer, {
  1754. defaults: {
  1755. event: 'press',
  1756. pointers: 1,
  1757. time: 251, // minimal time of the pointer to be pressed
  1758. threshold: 9 // a minimal movement is ok, but keep it low
  1759. },
  1760. getTouchAction: function() {
  1761. return [TOUCH_ACTION_AUTO];
  1762. },
  1763. process: function(input) {
  1764. var options = this.options;
  1765. var validPointers = input.pointers.length === options.pointers;
  1766. var validMovement = input.distance < options.threshold;
  1767. var validTime = input.deltaTime > options.time;
  1768. this._input = input;
  1769. if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {
  1770. this.reset();
  1771. } else if (input.eventType & INPUT_START) {
  1772. this.reset();
  1773. this._timer = setTimeoutContext(function() {
  1774. this.state = STATE_RECOGNIZED;
  1775. this.tryEmit();
  1776. }, options.time, this);
  1777. } else if (input.eventType & INPUT_END) {
  1778. return STATE_RECOGNIZED;
  1779. }
  1780. return STATE_FAILED;
  1781. },
  1782. reset: function() {
  1783. clearTimeout(this._timer);
  1784. },
  1785. emit: function(input) {
  1786. if (this.state !== STATE_RECOGNIZED) {
  1787. return;
  1788. }
  1789. if (input && (input.eventType & INPUT_END)) {
  1790. this.manager.emit(this.options.event + 'up', input);
  1791. } else {
  1792. this._input.timeStamp = now();
  1793. this.manager.emit(this.options.event, this._input);
  1794. }
  1795. }
  1796. });
  1797. function RotateRecognizer() {
  1798. AttrRecognizer.apply(this, arguments);
  1799. }
  1800. inherit(RotateRecognizer, AttrRecognizer, {
  1801. defaults: {
  1802. event: 'rotate',
  1803. threshold: 0,
  1804. pointers: 2
  1805. },
  1806. getTouchAction: function() {
  1807. return [TOUCH_ACTION_NONE];
  1808. },
  1809. attrTest: function(input) {
  1810. return this._super.attrTest.call(this, input) &&
  1811. (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
  1812. }
  1813. });
  1814. function SwipeRecognizer() {
  1815. AttrRecognizer.apply(this, arguments);
  1816. }
  1817. inherit(SwipeRecognizer, AttrRecognizer, {
  1818. defaults: {
  1819. event: 'swipe',
  1820. threshold: 10,
  1821. velocity: 0.3,
  1822. direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
  1823. pointers: 1
  1824. },
  1825. getTouchAction: function() {
  1826. return PanRecognizer.prototype.getTouchAction.call(this);
  1827. },
  1828. attrTest: function(input) {
  1829. var direction = this.options.direction;
  1830. var velocity;
  1831. if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
  1832. velocity = input.overallVelocity;
  1833. } else if (direction & DIRECTION_HORIZONTAL) {
  1834. velocity = input.overallVelocityX;
  1835. } else if (direction & DIRECTION_VERTICAL) {
  1836. velocity = input.overallVelocityY;
  1837. }
  1838. return this._super.attrTest.call(this, input) &&
  1839. direction & input.offsetDirection &&
  1840. input.distance > this.options.threshold &&
  1841. input.maxPointers == this.options.pointers &&
  1842. abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
  1843. },
  1844. emit: function(input) {
  1845. var direction = directionStr(input.offsetDirection);
  1846. if (direction) {
  1847. this.manager.emit(this.options.event + direction, input);
  1848. }
  1849. this.manager.emit(this.options.event, input);
  1850. }
  1851. });
  1852. function TapRecognizer() {
  1853. Recognizer.apply(this, arguments);
  1854. this.pTime = false;
  1855. this.pCenter = false;
  1856. this._timer = null;
  1857. this._input = null;
  1858. this.count = 0;
  1859. }
  1860. inherit(TapRecognizer, Recognizer, {
  1861. defaults: {
  1862. event: 'tap',
  1863. pointers: 1,
  1864. taps: 1,
  1865. interval: 300, // max time between the multi-tap taps
  1866. time: 250, // max time of the pointer to be down (like finger on the screen)
  1867. threshold: 9, // a minimal movement is ok, but keep it low
  1868. posThreshold: 10 // a multi-tap can be a bit off the initial position
  1869. },
  1870. getTouchAction: function() {
  1871. return [TOUCH_ACTION_MANIPULATION];
  1872. },
  1873. process: function(input) {
  1874. var options = this.options;
  1875. var validPointers = input.pointers.length === options.pointers;
  1876. var validMovement = input.distance < options.threshold;
  1877. var validTouchTime = input.deltaTime < options.time;
  1878. this.reset();
  1879. if ((input.eventType & INPUT_START) && (this.count === 0)) {
  1880. return this.failTimeout();
  1881. }
  1882. if (validMovement && validTouchTime && validPointers) {
  1883. if (input.eventType != INPUT_END) {
  1884. return this.failTimeout();
  1885. }
  1886. var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;
  1887. var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
  1888. this.pTime = input.timeStamp;
  1889. this.pCenter = input.center;
  1890. if (!validMultiTap || !validInterval) {
  1891. this.count = 1;
  1892. } else {
  1893. this.count += 1;
  1894. }
  1895. this._input = input;
  1896. var tapCount = this.count % options.taps;
  1897. if (tapCount === 0) {
  1898. if (!this.hasRequireFailures()) {
  1899. return STATE_RECOGNIZED;
  1900. } else {
  1901. this._timer = setTimeoutContext(function() {
  1902. this.state = STATE_RECOGNIZED;
  1903. this.tryEmit();
  1904. }, options.interval, this);
  1905. return STATE_BEGAN;
  1906. }
  1907. }
  1908. }
  1909. return STATE_FAILED;
  1910. },
  1911. failTimeout: function() {
  1912. this._timer = setTimeoutContext(function() {
  1913. this.state = STATE_FAILED;
  1914. }, this.options.interval, this);
  1915. return STATE_FAILED;
  1916. },
  1917. reset: function() {
  1918. clearTimeout(this._timer);
  1919. },
  1920. emit: function() {
  1921. if (this.state == STATE_RECOGNIZED) {
  1922. this._input.tapCount = this.count;
  1923. this.manager.emit(this.options.event, this._input);
  1924. }
  1925. }
  1926. });
  1927. function Hammer(element, options) {
  1928. options = options || {};
  1929. options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
  1930. return new Manager(element, options);
  1931. }
  1932. Hammer.VERSION = '2.0.7';
  1933. Hammer.defaults = {
  1934. domEvents: false,
  1935. touchAction: TOUCH_ACTION_COMPUTE,
  1936. enable: true,
  1937. inputTarget: null,
  1938. inputClass: null,
  1939. preset: [
  1940. [RotateRecognizer, {enable: false}],
  1941. [PinchRecognizer, {enable: false}, ['rotate']],
  1942. [SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}],
  1943. [PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']],
  1944. [TapRecognizer],
  1945. [TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']],
  1946. [PressRecognizer]
  1947. ],
  1948. cssProps: {
  1949. userSelect: 'none',
  1950. touchSelect: 'none',
  1951. touchCallout: 'none',
  1952. contentZooming: 'none',
  1953. userDrag: 'none',
  1954. tapHighlightColor: 'rgba(0,0,0,0)'
  1955. }
  1956. };
  1957. var STOP = 1;
  1958. var FORCED_STOP = 2;
  1959. function Manager(element, options) {
  1960. this.options = assign({}, Hammer.defaults, options || {});
  1961. this.options.inputTarget = this.options.inputTarget || element;
  1962. this.handlers = {};
  1963. this.session = {};
  1964. this.recognizers = [];
  1965. this.oldCssProps = {};
  1966. this.element = element;
  1967. this.input = createInputInstance(this);
  1968. this.touchAction = new TouchAction(this, this.options.touchAction);
  1969. toggleCssProps(this, true);
  1970. each(this.options.recognizers, function(item) {
  1971. var recognizer = this.add(new (item[0])(item[1]));
  1972. item[2] && recognizer.recognizeWith(item[2]);
  1973. item[3] && recognizer.requireFailure(item[3]);
  1974. }, this);
  1975. }
  1976. Manager.prototype = {
  1977. set: function(options) {
  1978. assign(this.options, options);
  1979. if (options.touchAction) {
  1980. this.touchAction.update();
  1981. }
  1982. if (options.inputTarget) {
  1983. this.input.destroy();
  1984. this.input.target = options.inputTarget;
  1985. this.input.init();
  1986. }
  1987. return this;
  1988. },
  1989. stop: function(force) {
  1990. this.session.stopped = force ? FORCED_STOP : STOP;
  1991. },
  1992. recognize: function(inputData) {
  1993. var session = this.session;
  1994. if (session.stopped) {
  1995. return;
  1996. }
  1997. this.touchAction.preventDefaults(inputData);
  1998. var recognizer;
  1999. var recognizers = this.recognizers;
  2000. var curRecognizer = session.curRecognizer;
  2001. if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {
  2002. curRecognizer = session.curRecognizer = null;
  2003. }
  2004. var i = 0;
  2005. while (i < recognizers.length) {
  2006. recognizer = recognizers[i];
  2007. if (session.stopped !== FORCED_STOP && ( // 1
  2008. !curRecognizer || recognizer == curRecognizer || // 2
  2009. recognizer.canRecognizeWith(curRecognizer))) { // 3
  2010. recognizer.recognize(inputData);
  2011. } else {
  2012. recognizer.reset();
  2013. }
  2014. if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
  2015. curRecognizer = session.curRecognizer = recognizer;
  2016. }
  2017. i++;
  2018. }
  2019. },
  2020. get: function(recognizer) {
  2021. if (recognizer instanceof Recognizer) {
  2022. return recognizer;
  2023. }
  2024. var recognizers = this.recognizers;
  2025. for (var i = 0; i < recognizers.length; i++) {
  2026. if (recognizers[i].options.event == recognizer) {
  2027. return recognizers[i];
  2028. }
  2029. }
  2030. return null;
  2031. },
  2032. add: function(recognizer) {
  2033. if (invokeArrayArg(recognizer, 'add', this)) {
  2034. return this;
  2035. }
  2036. var existing = this.get(recognizer.options.event);
  2037. if (existing) {
  2038. this.remove(existing);
  2039. }
  2040. this.recognizers.push(recognizer);
  2041. recognizer.manager = this;
  2042. this.touchAction.update();
  2043. return recognizer;
  2044. },
  2045. remove: function(recognizer) {
  2046. if (invokeArrayArg(recognizer, 'remove', this)) {
  2047. return this;
  2048. }
  2049. recognizer = this.get(recognizer);
  2050. if (recognizer) {
  2051. var recognizers = this.recognizers;
  2052. var index = inArray(recognizers, recognizer);
  2053. if (index !== -1) {
  2054. recognizers.splice(index, 1);
  2055. this.touchAction.update();
  2056. }
  2057. }
  2058. return this;
  2059. },
  2060. on: function(events, handler) {
  2061. if (events === undefined) {
  2062. return;
  2063. }
  2064. if (handler === undefined) {
  2065. return;
  2066. }
  2067. var handlers = this.handlers;
  2068. each(splitStr(events), function(event) {
  2069. handlers[event] = handlers[event] || [];
  2070. handlers[event].push(handler);
  2071. });
  2072. return this;
  2073. },
  2074. off: function(events, handler) {
  2075. if (events === undefined) {
  2076. return;
  2077. }
  2078. var handlers = this.handlers;
  2079. each(splitStr(events), function(event) {
  2080. if (!handler) {
  2081. delete handlers[event];
  2082. } else {
  2083. handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
  2084. }
  2085. });
  2086. return this;
  2087. },
  2088. emit: function(event, data) {
  2089. if (this.options.domEvents) {
  2090. triggerDomEvent(event, data);
  2091. }
  2092. var handlers = this.handlers[event] && this.handlers[event].slice();
  2093. if (!handlers || !handlers.length) {
  2094. return;
  2095. }
  2096. data.type = event;
  2097. data.preventDefault = function() {
  2098. data.srcEvent.preventDefault();
  2099. };
  2100. var i = 0;
  2101. while (i < handlers.length) {
  2102. handlers[i](data);
  2103. i++;
  2104. }
  2105. },
  2106. destroy: function() {
  2107. this.element && toggleCssProps(this, false);
  2108. this.handlers = {};
  2109. this.session = {};
  2110. this.input.destroy();
  2111. this.element = null;
  2112. }
  2113. };
  2114. function toggleCssProps(manager, add) {
  2115. var element = manager.element;
  2116. if (!element.style) {
  2117. return;
  2118. }
  2119. var prop;
  2120. each(manager.options.cssProps, function(value, name) {
  2121. prop = prefixed(element.style, name);
  2122. if (add) {
  2123. manager.oldCssProps[prop] = element.style[prop];
  2124. element.style[prop] = value;
  2125. } else {
  2126. element.style[prop] = manager.oldCssProps[prop] || '';
  2127. }
  2128. });
  2129. if (!add) {
  2130. manager.oldCssProps = {};
  2131. }
  2132. }
  2133. function triggerDomEvent(event, data) {
  2134. var gestureEvent = document.createEvent('Event');
  2135. gestureEvent.initEvent(event, true, true);
  2136. gestureEvent.gesture = data;
  2137. data.target.dispatchEvent(gestureEvent);
  2138. }
  2139. assign(Hammer, {
  2140. INPUT_START: INPUT_START,
  2141. INPUT_MOVE: INPUT_MOVE,
  2142. INPUT_END: INPUT_END,
  2143. INPUT_CANCEL: INPUT_CANCEL,
  2144. STATE_POSSIBLE: STATE_POSSIBLE,
  2145. STATE_BEGAN: STATE_BEGAN,
  2146. STATE_CHANGED: STATE_CHANGED,
  2147. STATE_ENDED: STATE_ENDED,
  2148. STATE_RECOGNIZED: STATE_RECOGNIZED,
  2149. STATE_CANCELLED: STATE_CANCELLED,
  2150. STATE_FAILED: STATE_FAILED,
  2151. DIRECTION_NONE: DIRECTION_NONE,
  2152. DIRECTION_LEFT: DIRECTION_LEFT,
  2153. DIRECTION_RIGHT: DIRECTION_RIGHT,
  2154. DIRECTION_UP: DIRECTION_UP,
  2155. DIRECTION_DOWN: DIRECTION_DOWN,
  2156. DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
  2157. DIRECTION_VERTICAL: DIRECTION_VERTICAL,
  2158. DIRECTION_ALL: DIRECTION_ALL,
  2159. Manager: Manager,
  2160. Input: Input,
  2161. TouchAction: TouchAction,
  2162. TouchInput: TouchInput,
  2163. MouseInput: MouseInput,
  2164. PointerEventInput: PointerEventInput,
  2165. TouchMouseInput: TouchMouseInput,
  2166. SingleTouchInput: SingleTouchInput,
  2167. Recognizer: Recognizer,
  2168. AttrRecognizer: AttrRecognizer,
  2169. Tap: TapRecognizer,
  2170. Pan: PanRecognizer,
  2171. Swipe: SwipeRecognizer,
  2172. Pinch: PinchRecognizer,
  2173. Rotate: RotateRecognizer,
  2174. Press: PressRecognizer,
  2175. on: addEventListeners,
  2176. off: removeEventListeners,
  2177. each: each,
  2178. merge: merge,
  2179. extend: extend,
  2180. assign: assign,
  2181. inherit: inherit,
  2182. bindFn: bindFn,
  2183. prefixed: prefixed
  2184. });
  2185. var freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line
  2186. freeGlobal.Hammer = Hammer;
  2187. if (typeof define === 'function' && define.amd) {
  2188. define(function() {
  2189. return Hammer;
  2190. });
  2191. } else if (typeof module != 'undefined' && module.exports) {
  2192. module.exports = Hammer;
  2193. } else {
  2194. window[exportName] = Hammer;
  2195. }
  2196. })(window, document, 'Hammer');
  2197. /*****
  2198. * @licstart
  2199. *
  2200. * The following is the license notice for the part of JavaScript code of this
  2201. * page included between the '@jessyinkstart' and the '@jessyinkend' notes.
  2202. */
  2203. /***** ******************************************************************
  2204. *
  2205. * Copyright 2008-2013 Hannes Hochreiner
  2206. *
  2207. * The JavaScript code included between the start note '@jessyinkstart'
  2208. * and the end note '@jessyinkend' is subject to the terms of the Mozilla
  2209. * Public License, v. 2.0. If a copy of the MPL was not distributed with
  2210. * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
  2211. *
  2212. * Alternatively, you can redistribute and/or that part of this file
  2213. * under the terms of the GNU General Public License as published by
  2214. * the Free Software Foundation, either version 3 of the License, or
  2215. * (at your option) any later version.
  2216. *
  2217. * This program is distributed in the hope that it will be useful,
  2218. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  2219. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2220. * GNU General Public License for more details.
  2221. *
  2222. * You should have received a copy of the GNU General Public License
  2223. * along with this program. If not, see http://www.gnu.org/licenses/.
  2224. */
  2225. /*****
  2226. * You can find the complete source code of the JessyInk project at:
  2227. * @source http://code.google.com/p/jessyink/
  2228. */
  2229. /*****
  2230. * @licend
  2231. *
  2232. * The above is the license notice for the part of JavaScript code of this
  2233. * page included between the '@jessyinkstart' and the '@jessyinkend' notes.
  2234. */
  2235. /*****
  2236. * @jessyinkstart
  2237. *
  2238. * The following code is a derivative work of some parts of the JessyInk
  2239. * project.
  2240. * @source http://code.google.com/p/jessyink/
  2241. */
  2242. function getElementsByProperty( node, name )
  2243. {
  2244. var elements = [];
  2245. if( node.getAttribute( name ) )
  2246. elements.push( node );
  2247. for( var counter = 0; counter < node.childNodes.length; ++counter )
  2248. {
  2249. if( node.childNodes[counter].nodeType == 1 )
  2250. {
  2251. var subElements = getElementsByProperty( node.childNodes[counter], name );
  2252. elements = elements.concat( subElements );
  2253. }
  2254. }
  2255. return elements;
  2256. }
  2257. function onKeyDown( aEvt )
  2258. {
  2259. if ( !aEvt )
  2260. aEvt = window.event;
  2261. var code = aEvt.keyCode || aEvt.charCode;
  2262. if (code == 0 && aEvt.key != undefined) {
  2263. switch (aEvt.key) {
  2264. case 'UIKeyInputLeftArrow':
  2265. code = LEFT_KEY;
  2266. break;
  2267. case 'UIKeyInputUpArrow':
  2268. code = UP_KEY;
  2269. break;
  2270. case 'UIKeyInputRightArrow':
  2271. code = RIGHT_KEY;
  2272. break;
  2273. case 'UIKeyInputDownArrow':
  2274. code = DOWN_KEY;
  2275. break;
  2276. }
  2277. }
  2278. if( !processingEffect && keyCodeDictionary[currentMode] && keyCodeDictionary[currentMode][code] )
  2279. {
  2280. return keyCodeDictionary[currentMode][code]();
  2281. }
  2282. else
  2283. {
  2284. document.onkeypress = onKeyPress;
  2285. return null;
  2286. }
  2287. }
  2288. document.onkeydown = onKeyDown;
  2289. function onKeyPress( aEvt )
  2290. {
  2291. document.onkeypress = null;
  2292. if ( !aEvt )
  2293. aEvt = window.event;
  2294. var str = String.fromCharCode( aEvt.keyCode || aEvt.charCode );
  2295. if ( !processingEffect && charCodeDictionary[currentMode] && charCodeDictionary[currentMode][str] )
  2296. return charCodeDictionary[currentMode][str]();
  2297. return null;
  2298. }
  2299. function getDefaultKeyCodeDictionary()
  2300. {
  2301. var keyCodeDict = {};
  2302. keyCodeDict[SLIDE_MODE] = {};
  2303. keyCodeDict[INDEX_MODE] = {};
  2304. keyCodeDict[SLIDE_MODE][LEFT_KEY]
  2305. = function() { return aSlideShow.rewindEffect(); };
  2306. keyCodeDict[SLIDE_MODE][RIGHT_KEY]
  2307. = function() { return dispatchEffects(1); };
  2308. keyCodeDict[SLIDE_MODE][UP_KEY]
  2309. = function() { return aSlideShow.rewindEffect(); };
  2310. keyCodeDict[SLIDE_MODE][DOWN_KEY]
  2311. = function() { return skipEffects(1); };
  2312. keyCodeDict[SLIDE_MODE][PAGE_UP_KEY]
  2313. = function() { return aSlideShow.rewindAllEffects(); };
  2314. keyCodeDict[SLIDE_MODE][PAGE_DOWN_KEY]
  2315. = function() { return skipAllEffects(); };
  2316. keyCodeDict[SLIDE_MODE][HOME_KEY]
  2317. = function() { return aSlideShow.displaySlide( 0, true ); };
  2318. keyCodeDict[SLIDE_MODE][END_KEY]
  2319. = function() { return aSlideShow.displaySlide( theMetaDoc.nNumberOfSlides - 1, true ); };
  2320. keyCodeDict[SLIDE_MODE][SPACE_KEY]
  2321. = function() { return dispatchEffects(1); };
  2322. keyCodeDict[SLIDE_MODE][ESCAPE_KEY]
  2323. = function() { return aSlideShow.exitSlideShowInApp(); };
  2324. keyCodeDict[SLIDE_MODE][Q_KEY]
  2325. = function() { return aSlideShow.exitSlideShowInApp(); };
  2326. keyCodeDict[INDEX_MODE][LEFT_KEY]
  2327. = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex - 1 ); };
  2328. keyCodeDict[INDEX_MODE][RIGHT_KEY]
  2329. = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex + 1 ); };
  2330. keyCodeDict[INDEX_MODE][UP_KEY]
  2331. = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex - theSlideIndexPage.indexColumns ); };
  2332. keyCodeDict[INDEX_MODE][DOWN_KEY]
  2333. = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex + theSlideIndexPage.indexColumns ); };
  2334. keyCodeDict[INDEX_MODE][PAGE_UP_KEY]
  2335. = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex - theSlideIndexPage.getTotalThumbnails() ); };
  2336. keyCodeDict[INDEX_MODE][PAGE_DOWN_KEY]
  2337. = function() { return indexSetPageSlide( theSlideIndexPage.selectedSlideIndex + theSlideIndexPage.getTotalThumbnails() ); };
  2338. keyCodeDict[INDEX_MODE][HOME_KEY]
  2339. = function() { return indexSetPageSlide( 0 ); };
  2340. keyCodeDict[INDEX_MODE][END_KEY]
  2341. = function() { return indexSetPageSlide( theMetaDoc.nNumberOfSlides - 1 ); };
  2342. keyCodeDict[INDEX_MODE][ENTER_KEY]
  2343. = function() { return toggleSlideIndex(); };
  2344. keyCodeDict[INDEX_MODE][SPACE_KEY]
  2345. = function() { return toggleSlideIndex(); };
  2346. keyCodeDict[INDEX_MODE][ESCAPE_KEY]
  2347. = function() { return abandonIndexMode(); };
  2348. return keyCodeDict;
  2349. }
  2350. function getDefaultCharCodeDictionary()
  2351. {
  2352. var charCodeDict = {};
  2353. charCodeDict[SLIDE_MODE] = {};
  2354. charCodeDict[INDEX_MODE] = {};
  2355. charCodeDict[SLIDE_MODE]['i']
  2356. = function () { return toggleSlideIndex(); };
  2357. charCodeDict[INDEX_MODE]['i']
  2358. = function () { return toggleSlideIndex(); };
  2359. charCodeDict[INDEX_MODE]['-']
  2360. = function () { return theSlideIndexPage.decreaseNumberOfColumns(); };
  2361. charCodeDict[INDEX_MODE]['=']
  2362. = function () { return theSlideIndexPage.increaseNumberOfColumns(); };
  2363. charCodeDict[INDEX_MODE]['+']
  2364. = function () { return theSlideIndexPage.increaseNumberOfColumns(); };
  2365. charCodeDict[INDEX_MODE]['0']
  2366. = function () { return theSlideIndexPage.resetNumberOfColumns(); };
  2367. return charCodeDict;
  2368. }
  2369. function slideOnMouseUp( aEvt )
  2370. {
  2371. if (!aEvt)
  2372. aEvt = window.event;
  2373. var nOffset = 0;
  2374. if( aEvt.button == 0 )
  2375. nOffset = 1;
  2376. else if( aEvt.button == 2 )
  2377. nOffset = -1;
  2378. if( 0 != nOffset )
  2379. dispatchEffects( nOffset );
  2380. return true; // the click has been handled
  2381. }
  2382. document.handleClick = slideOnMouseUp;
  2383. function slideOnMouseWheel(aEvt)
  2384. {
  2385. var delta = 0;
  2386. if (!aEvt)
  2387. aEvt = window.event;
  2388. if (aEvt.wheelDelta)
  2389. { // IE Opera
  2390. delta = aEvt.wheelDelta/120;
  2391. }
  2392. else if (aEvt.detail)
  2393. { // MOZ
  2394. delta = -aEvt.detail/3;
  2395. }
  2396. if (delta > 0)
  2397. skipEffects(-1);
  2398. else if (delta < 0)
  2399. skipEffects(1);
  2400. if (aEvt.preventDefault)
  2401. aEvt.preventDefault();
  2402. aEvt.returnValue = false;
  2403. }
  2404. if( window.addEventListener )
  2405. {
  2406. window.addEventListener( 'DOMMouseScroll', function( aEvt ) { return mouseHandlerDispatch( aEvt, MOUSE_WHEEL ); }, false );
  2407. }
  2408. window.onmousewheel
  2409. = function( aEvt ) { return mouseHandlerDispatch( aEvt, MOUSE_WHEEL ); };
  2410. function mouseHandlerDispatch( aEvt, anAction )
  2411. {
  2412. if( !aEvt )
  2413. aEvt = window.event;
  2414. var retVal = true;
  2415. if ( mouseHandlerDictionary[currentMode] && mouseHandlerDictionary[currentMode][anAction] )
  2416. {
  2417. var subRetVal = mouseHandlerDictionary[currentMode][anAction]( aEvt );
  2418. if( subRetVal != null && subRetVal != undefined )
  2419. retVal = subRetVal;
  2420. }
  2421. if( aEvt.preventDefault && !retVal )
  2422. aEvt.preventDefault();
  2423. aEvt.returnValue = retVal;
  2424. return retVal;
  2425. }
  2426. document.onmouseup = function( aEvt ) { return mouseHandlerDispatch( aEvt, MOUSE_UP ); };
  2427. function mouseClickHelper( aEvt )
  2428. {
  2429. if( !Detect.isMozilla )
  2430. {
  2431. var aWindowObject = document.defaultView;
  2432. if( aWindowObject )
  2433. {
  2434. var aTextSelection = aWindowObject.getSelection();
  2435. var sSelectedText = aTextSelection.toString();
  2436. if( sSelectedText )
  2437. {
  2438. DBGLOG( 'text selection: ' + sSelectedText );
  2439. if( sLastSelectedText !== sSelectedText )
  2440. {
  2441. bTextHasBeenSelected = true;
  2442. sLastSelectedText = sSelectedText;
  2443. }
  2444. else
  2445. {
  2446. bTextHasBeenSelected = false;
  2447. }
  2448. return null;
  2449. }
  2450. else if( bTextHasBeenSelected )
  2451. {
  2452. bTextHasBeenSelected = false;
  2453. sLastSelectedText = '';
  2454. return null;
  2455. }
  2456. }
  2457. else
  2458. {
  2459. log( 'error: HyperlinkElement.handleClick: invalid window object.' );
  2460. }
  2461. }
  2462. var aSlideAnimationsHandler = theMetaDoc.aMetaSlideSet[nCurSlide].aSlideAnimationsHandler;
  2463. if( aSlideAnimationsHandler )
  2464. {
  2465. var aCurrentEventMultiplexer = aSlideAnimationsHandler.aEventMultiplexer;
  2466. if( aCurrentEventMultiplexer )
  2467. {
  2468. if( aCurrentEventMultiplexer.hasRegisteredMouseClickHandlers() )
  2469. {
  2470. return aCurrentEventMultiplexer.notifyMouseClick( aEvt );
  2471. }
  2472. }
  2473. }
  2474. return slideOnMouseUp( aEvt );
  2475. }
  2476. function getDefaultMouseHandlerDictionary()
  2477. {
  2478. var mouseHandlerDict = {};
  2479. mouseHandlerDict[SLIDE_MODE] = {};
  2480. mouseHandlerDict[INDEX_MODE] = {};
  2481. mouseHandlerDict[SLIDE_MODE][MOUSE_UP]
  2482. = mouseClickHelper;
  2483. mouseHandlerDict[SLIDE_MODE][MOUSE_WHEEL]
  2484. = function( aEvt ) { return slideOnMouseWheel( aEvt ); };
  2485. mouseHandlerDict[INDEX_MODE][MOUSE_UP]
  2486. = function( ) { return toggleSlideIndex(); };
  2487. return mouseHandlerDict;
  2488. }
  2489. function indexSetPageSlide( nIndex )
  2490. {
  2491. var aMetaSlideSet = theMetaDoc.aMetaSlideSet;
  2492. nIndex = getSafeIndex( nIndex, 0, aMetaSlideSet.length - 1 );
  2493. var nSelectedThumbnailIndex = nIndex % theSlideIndexPage.getTotalThumbnails();
  2494. var offset = nIndex - nSelectedThumbnailIndex;
  2495. if( offset < 0 )
  2496. offset = 0;
  2497. if( offset != INDEX_OFFSET )
  2498. {
  2499. INDEX_OFFSET = offset;
  2500. displayIndex( INDEX_OFFSET );
  2501. }
  2502. theSlideIndexPage.setSelection( nSelectedThumbnailIndex );
  2503. }
  2504. /*****
  2505. * @jessyinkend
  2506. *
  2507. * The above code is a derivative work of some parts of the JessyInk project.
  2508. * @source http://code.google.com/p/jessyink/
  2509. */
  2510. /*****
  2511. * @licstart
  2512. *
  2513. * The following is the license notice for the part of JavaScript code of this
  2514. * page included between the '@dojostart' and the '@dojoend' notes.
  2515. */
  2516. /***** **********************************************************************
  2517. *
  2518. * The 'New' BSD License:
  2519. * **********************
  2520. * Copyright (c) 2005-2012, The Dojo Foundation
  2521. * All rights reserved.
  2522. *
  2523. * Redistribution and use in source and binary forms, with or without
  2524. * modification, are permitted provided that the following conditions are met:
  2525. *
  2526. * * Redistributions of source code must retain the above copyright notice,
  2527. * this list of conditions and the following disclaimer.
  2528. * * Redistributions in binary form must reproduce the above copyright notice,
  2529. * this list of conditions and the following disclaimer in the documentation
  2530. * and/or other materials provided with the distribution.
  2531. * * Neither the name of the Dojo Foundation nor the names of its contributors
  2532. * may be used to endorse or promote products derived from this software
  2533. * without specific prior written permission.
  2534. *
  2535. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
  2536. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  2537. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  2538. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
  2539. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  2540. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  2541. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  2542. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  2543. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  2544. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2545. *
  2546. ****************************************************************************/
  2547. /*****
  2548. * @licend
  2549. *
  2550. * The above is the license notice for the part of JavaScript code of this
  2551. * page included between the '@dojostart' and the '@dojoend' notes.
  2552. */
  2553. /*****
  2554. * @dojostart
  2555. *
  2556. * The following code is a derivative work of some part of the dojox.gfx library.
  2557. * @source http://svn.dojotoolkit.org/src/dojox/trunk/_base/sniff.js
  2558. */
  2559. function has( name )
  2560. {
  2561. return has.cache[name];
  2562. }
  2563. has.cache = {};
  2564. has.add = function( name, test )
  2565. {
  2566. has.cache[name] = test;
  2567. };
  2568. function configureDetectionTools()
  2569. {
  2570. if( !navigator )
  2571. {
  2572. log( 'error: configureDetectionTools: configuration failed' );
  2573. return null;
  2574. }
  2575. var n = navigator,
  2576. dua = n.userAgent,
  2577. dav = n.appVersion,
  2578. tv = parseFloat(dav);
  2579. has.add('air', dua.indexOf('AdobeAIR') >= 0);
  2580. has.add('khtml', dav.indexOf('Konqueror') >= 0 ? tv : undefined);
  2581. has.add('webkit', parseFloat(dua.split('WebKit/')[1]) || undefined);
  2582. has.add('chrome', parseFloat(dua.split('Chrome/')[1]) || undefined);
  2583. has.add('safari', dav.indexOf('Safari')>=0 && !has('chrome') ? parseFloat(dav.split('Version/')[1]) : undefined);
  2584. has.add('mac', dav.indexOf('Macintosh') >= 0);
  2585. has.add('quirks', document.compatMode == 'BackCompat');
  2586. has.add('ios', /iPhone|iPod|iPad/.test(dua));
  2587. has.add('android', parseFloat(dua.split('Android ')[1]) || undefined);
  2588. if(!has('webkit')){
  2589. if(dua.indexOf('Opera') >= 0){
  2590. has.add('opera', tv >= 9.8 ? parseFloat(dua.split('Version/')[1]) || tv : tv);
  2591. }
  2592. if(dua.indexOf('Gecko') >= 0 && !has('khtml') && !has('webkit')){
  2593. has.add('mozilla', tv);
  2594. }
  2595. if(has('mozilla')){
  2596. has.add('ff', parseFloat(dua.split('Firefox/')[1] || dua.split('Minefield/')[1]) || undefined);
  2597. }
  2598. if(document.all && !has('opera')){
  2599. var isIE = parseFloat(dav.split('MSIE ')[1]) || undefined;
  2600. var mode = document.documentMode;
  2601. if(mode && mode != 5 && Math.floor(isIE) != mode){
  2602. isIE = mode;
  2603. }
  2604. has.add('ie', isIE);
  2605. }
  2606. has.add('wii', typeof opera != 'undefined' && opera.wiiremote);
  2607. }
  2608. var detect =
  2609. {
  2610. isFF: has('ff'),
  2611. isIE: has('ie'),
  2612. isKhtml: has('khtml'),
  2613. isWebKit: has('webkit'),
  2614. isMozilla: has('mozilla'),
  2615. isMoz: has('mozilla'),
  2616. isOpera: has('opera'),
  2617. isSafari: has('safari'),
  2618. isChrome: has('chrome'),
  2619. isMac: has('mac'),
  2620. isIos: has('ios'),
  2621. isAndroid: has('android'),
  2622. isWii: has('wii'),
  2623. isQuirks: has('quirks'),
  2624. isAir: has('air')
  2625. };
  2626. return detect;
  2627. }
  2628. /*****
  2629. * @dojoend
  2630. *
  2631. * The above code is a derivative work of some part of the dojox.gfx library.
  2632. * @source http://svn.dojotoolkit.org/src/dojox/trunk/_base/sniff.js
  2633. */
  2634. /*****
  2635. * @licstart
  2636. *
  2637. * The following is the license notice for the part of JavaScript code of this
  2638. * file included between the '@svgpathstart' and the '@svgpathend' notes.
  2639. */
  2640. /***** **********************************************************************
  2641. *
  2642. * Copyright 2015 The Chromium Authors. All rights reserved.
  2643. *
  2644. * The Chromium Authors can be found at
  2645. * http://src.chromium.org/svn/trunk/src/AUTHORS
  2646. *
  2647. * Redistribution and use in source and binary forms, with or without
  2648. * modification, are permitted provided that the following conditions are
  2649. * met:
  2650. *
  2651. * * Redistributions of source code must retain the above copyright
  2652. * notice, this list of conditions and the following disclaimer.
  2653. * * Redistributions in binary form must reproduce the above
  2654. * copyright notice, this list of conditions and the following disclaimer
  2655. * in the documentation and/or other materials provided with the
  2656. * distribution.
  2657. * * Neither the name of Google Inc. nor the names of its
  2658. * contributors may be used to endorse or promote products derived from
  2659. * this software without specific prior written permission.
  2660. *
  2661. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  2662. * 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  2663. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  2664. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  2665. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  2666. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  2667. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  2668. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  2669. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  2670. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  2671. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2672. *
  2673. ****************************************************************************/
  2674. /*****
  2675. * @licend
  2676. *
  2677. * The above is the license notice for the part of JavaScript code of this
  2678. * file included between the '@svgpathstart' and the '@svgpathend' notes.
  2679. */
  2680. /*****
  2681. * @svgpathstart
  2682. *
  2683. * The following code is a derivative work of some part of the SVGPathSeg API.
  2684. *
  2685. * This API is a drop-in replacement for the SVGPathSeg and SVGPathSegList APIs that were removed from
  2686. * SVG2 (https://lists.w3.org/Archives/Public/www-svg/2015Jun/0044.html), including the latest spec
  2687. * changes which were implemented in Firefox 43 and Chrome 46.
  2688. *
  2689. * @source https://github.com/progers/pathseg
  2690. */
  2691. (function() { 'use strict';
  2692. if (!('SVGPathSeg' in window)) {
  2693. window.SVGPathSeg = function(type, typeAsLetter, owningPathSegList) {
  2694. this.pathSegType = type;
  2695. this.pathSegTypeAsLetter = typeAsLetter;
  2696. this._owningPathSegList = owningPathSegList;
  2697. }
  2698. window.SVGPathSeg.prototype.classname = 'SVGPathSeg';
  2699. window.SVGPathSeg.PATHSEG_UNKNOWN = 0;
  2700. window.SVGPathSeg.PATHSEG_CLOSEPATH = 1;
  2701. window.SVGPathSeg.PATHSEG_MOVETO_ABS = 2;
  2702. window.SVGPathSeg.PATHSEG_MOVETO_REL = 3;
  2703. window.SVGPathSeg.PATHSEG_LINETO_ABS = 4;
  2704. window.SVGPathSeg.PATHSEG_LINETO_REL = 5;
  2705. window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS = 6;
  2706. window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL = 7;
  2707. window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS = 8;
  2708. window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL = 9;
  2709. window.SVGPathSeg.PATHSEG_ARC_ABS = 10;
  2710. window.SVGPathSeg.PATHSEG_ARC_REL = 11;
  2711. window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS = 12;
  2712. window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL = 13;
  2713. window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS = 14;
  2714. window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL = 15;
  2715. window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16;
  2716. window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17;
  2717. window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18;
  2718. window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19;
  2719. window.SVGPathSeg.prototype._segmentChanged = function() {
  2720. if (this._owningPathSegList)
  2721. this._owningPathSegList.segmentChanged(this);
  2722. }
  2723. window.SVGPathSegClosePath = function(owningPathSegList) {
  2724. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CLOSEPATH, 'z', owningPathSegList);
  2725. }
  2726. window.SVGPathSegClosePath.prototype = Object.create(window.SVGPathSeg.prototype);
  2727. window.SVGPathSegClosePath.prototype.toString = function() { return '[object SVGPathSegClosePath]'; }
  2728. window.SVGPathSegClosePath.prototype._asPathString = function() { return this.pathSegTypeAsLetter; }
  2729. window.SVGPathSegClosePath.prototype.clone = function() { return new window.SVGPathSegClosePath(undefined); }
  2730. window.SVGPathSegMovetoAbs = function(owningPathSegList, x, y) {
  2731. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_MOVETO_ABS, 'M', owningPathSegList);
  2732. this._x = x;
  2733. this._y = y;
  2734. }
  2735. window.SVGPathSegMovetoAbs.prototype = Object.create(window.SVGPathSeg.prototype);
  2736. window.SVGPathSegMovetoAbs.prototype.toString = function() { return '[object SVGPathSegMovetoAbs]'; }
  2737. window.SVGPathSegMovetoAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }
  2738. window.SVGPathSegMovetoAbs.prototype.clone = function() { return new window.SVGPathSegMovetoAbs(undefined, this._x, this._y); }
  2739. Object.defineProperty(window.SVGPathSegMovetoAbs.prototype, 'x', { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
  2740. Object.defineProperty(window.SVGPathSegMovetoAbs.prototype, 'y', { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
  2741. window.SVGPathSegMovetoRel = function(owningPathSegList, x, y) {
  2742. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_MOVETO_REL, 'm', owningPathSegList);
  2743. this._x = x;
  2744. this._y = y;
  2745. }
  2746. window.SVGPathSegMovetoRel.prototype = Object.create(window.SVGPathSeg.prototype);
  2747. window.SVGPathSegMovetoRel.prototype.toString = function() { return '[object SVGPathSegMovetoRel]'; }
  2748. window.SVGPathSegMovetoRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }
  2749. window.SVGPathSegMovetoRel.prototype.clone = function() { return new window.SVGPathSegMovetoRel(undefined, this._x, this._y); }
  2750. Object.defineProperty(window.SVGPathSegMovetoRel.prototype, 'x', { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
  2751. Object.defineProperty(window.SVGPathSegMovetoRel.prototype, 'y', { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
  2752. window.SVGPathSegLinetoAbs = function(owningPathSegList, x, y) {
  2753. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_ABS, 'L', owningPathSegList);
  2754. this._x = x;
  2755. this._y = y;
  2756. }
  2757. window.SVGPathSegLinetoAbs.prototype = Object.create(window.SVGPathSeg.prototype);
  2758. window.SVGPathSegLinetoAbs.prototype.toString = function() { return '[object SVGPathSegLinetoAbs]'; }
  2759. window.SVGPathSegLinetoAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }
  2760. window.SVGPathSegLinetoAbs.prototype.clone = function() { return new window.SVGPathSegLinetoAbs(undefined, this._x, this._y); }
  2761. Object.defineProperty(window.SVGPathSegLinetoAbs.prototype, 'x', { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
  2762. Object.defineProperty(window.SVGPathSegLinetoAbs.prototype, 'y', { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
  2763. window.SVGPathSegLinetoRel = function(owningPathSegList, x, y) {
  2764. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_REL, 'l', owningPathSegList);
  2765. this._x = x;
  2766. this._y = y;
  2767. }
  2768. window.SVGPathSegLinetoRel.prototype = Object.create(window.SVGPathSeg.prototype);
  2769. window.SVGPathSegLinetoRel.prototype.toString = function() { return '[object SVGPathSegLinetoRel]'; }
  2770. window.SVGPathSegLinetoRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }
  2771. window.SVGPathSegLinetoRel.prototype.clone = function() { return new window.SVGPathSegLinetoRel(undefined, this._x, this._y); }
  2772. Object.defineProperty(window.SVGPathSegLinetoRel.prototype, 'x', { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
  2773. Object.defineProperty(window.SVGPathSegLinetoRel.prototype, 'y', { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
  2774. window.SVGPathSegCurvetoCubicAbs = function(owningPathSegList, x, y, x1, y1, x2, y2) {
  2775. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS, 'C', owningPathSegList);
  2776. this._x = x;
  2777. this._y = y;
  2778. this._x1 = x1;
  2779. this._y1 = y1;
  2780. this._x2 = x2;
  2781. this._y2 = y2;
  2782. }
  2783. window.SVGPathSegCurvetoCubicAbs.prototype = Object.create(window.SVGPathSeg.prototype);
  2784. window.SVGPathSegCurvetoCubicAbs.prototype.toString = function() { return '[object SVGPathSegCurvetoCubicAbs]'; }
  2785. window.SVGPathSegCurvetoCubicAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; }
  2786. window.SVGPathSegCurvetoCubicAbs.prototype.clone = function() { return new window.SVGPathSegCurvetoCubicAbs(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); }
  2787. Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, 'x', { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
  2788. Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, 'y', { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
  2789. Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, 'x1', { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true });
  2790. Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, 'y1', { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true });
  2791. Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, 'x2', { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true });
  2792. Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, 'y2', { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true });
  2793. window.SVGPathSegCurvetoCubicRel = function(owningPathSegList, x, y, x1, y1, x2, y2) {
  2794. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL, 'c', owningPathSegList);
  2795. this._x = x;
  2796. this._y = y;
  2797. this._x1 = x1;
  2798. this._y1 = y1;
  2799. this._x2 = x2;
  2800. this._y2 = y2;
  2801. }
  2802. window.SVGPathSegCurvetoCubicRel.prototype = Object.create(window.SVGPathSeg.prototype);
  2803. window.SVGPathSegCurvetoCubicRel.prototype.toString = function() { return '[object SVGPathSegCurvetoCubicRel]'; }
  2804. window.SVGPathSegCurvetoCubicRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; }
  2805. window.SVGPathSegCurvetoCubicRel.prototype.clone = function() { return new window.SVGPathSegCurvetoCubicRel(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); }
  2806. Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, 'x', { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
  2807. Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, 'y', { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
  2808. Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, 'x1', { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true });
  2809. Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, 'y1', { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true });
  2810. Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, 'x2', { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true });
  2811. Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, 'y2', { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true });
  2812. window.SVGPathSegCurvetoQuadraticAbs = function(owningPathSegList, x, y, x1, y1) {
  2813. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS, 'Q', owningPathSegList);
  2814. this._x = x;
  2815. this._y = y;
  2816. this._x1 = x1;
  2817. this._y1 = y1;
  2818. }
  2819. window.SVGPathSegCurvetoQuadraticAbs.prototype = Object.create(window.SVGPathSeg.prototype);
  2820. window.SVGPathSegCurvetoQuadraticAbs.prototype.toString = function() { return '[object SVGPathSegCurvetoQuadraticAbs]'; }
  2821. window.SVGPathSegCurvetoQuadraticAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x + ' ' + this._y; }
  2822. window.SVGPathSegCurvetoQuadraticAbs.prototype.clone = function() { return new window.SVGPathSegCurvetoQuadraticAbs(undefined, this._x, this._y, this._x1, this._y1); }
  2823. Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, 'x', { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
  2824. Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, 'y', { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
  2825. Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, 'x1', { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true });
  2826. Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, 'y1', { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true });
  2827. window.SVGPathSegCurvetoQuadraticRel = function(owningPathSegList, x, y, x1, y1) {
  2828. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL, 'q', owningPathSegList);
  2829. this._x = x;
  2830. this._y = y;
  2831. this._x1 = x1;
  2832. this._y1 = y1;
  2833. }
  2834. window.SVGPathSegCurvetoQuadraticRel.prototype = Object.create(window.SVGPathSeg.prototype);
  2835. window.SVGPathSegCurvetoQuadraticRel.prototype.toString = function() { return '[object SVGPathSegCurvetoQuadraticRel]'; }
  2836. window.SVGPathSegCurvetoQuadraticRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._x1 + ' ' + this._y1 + ' ' + this._x + ' ' + this._y; }
  2837. window.SVGPathSegCurvetoQuadraticRel.prototype.clone = function() { return new window.SVGPathSegCurvetoQuadraticRel(undefined, this._x, this._y, this._x1, this._y1); }
  2838. Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, 'x', { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
  2839. Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, 'y', { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
  2840. Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, 'x1', { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true });
  2841. Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, 'y1', { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true });
  2842. window.SVGPathSegArcAbs = function(owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
  2843. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_ARC_ABS, 'A', owningPathSegList);
  2844. this._x = x;
  2845. this._y = y;
  2846. this._r1 = r1;
  2847. this._r2 = r2;
  2848. this._angle = angle;
  2849. this._largeArcFlag = largeArcFlag;
  2850. this._sweepFlag = sweepFlag;
  2851. }
  2852. window.SVGPathSegArcAbs.prototype = Object.create(window.SVGPathSeg.prototype);
  2853. window.SVGPathSegArcAbs.prototype.toString = function() { return '[object SVGPathSegArcAbs]'; }
  2854. window.SVGPathSegArcAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._r1 + ' ' + this._r2 + ' ' + this._angle + ' ' + (this._largeArcFlag ? '1' : '0') + ' ' + (this._sweepFlag ? '1' : '0') + ' ' + this._x + ' ' + this._y; }
  2855. window.SVGPathSegArcAbs.prototype.clone = function() { return new window.SVGPathSegArcAbs(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); }
  2856. Object.defineProperty(window.SVGPathSegArcAbs.prototype, 'x', { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
  2857. Object.defineProperty(window.SVGPathSegArcAbs.prototype, 'y', { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
  2858. Object.defineProperty(window.SVGPathSegArcAbs.prototype, 'r1', { get: function() { return this._r1; }, set: function(r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true });
  2859. Object.defineProperty(window.SVGPathSegArcAbs.prototype, 'r2', { get: function() { return this._r2; }, set: function(r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true });
  2860. Object.defineProperty(window.SVGPathSegArcAbs.prototype, 'angle', { get: function() { return this._angle; }, set: function(angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true });
  2861. Object.defineProperty(window.SVGPathSegArcAbs.prototype, 'largeArcFlag', { get: function() { return this._largeArcFlag; }, set: function(largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true });
  2862. Object.defineProperty(window.SVGPathSegArcAbs.prototype, 'sweepFlag', { get: function() { return this._sweepFlag; }, set: function(sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true });
  2863. window.SVGPathSegArcRel = function(owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) {
  2864. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_ARC_REL, 'a', owningPathSegList);
  2865. this._x = x;
  2866. this._y = y;
  2867. this._r1 = r1;
  2868. this._r2 = r2;
  2869. this._angle = angle;
  2870. this._largeArcFlag = largeArcFlag;
  2871. this._sweepFlag = sweepFlag;
  2872. }
  2873. window.SVGPathSegArcRel.prototype = Object.create(window.SVGPathSeg.prototype);
  2874. window.SVGPathSegArcRel.prototype.toString = function() { return '[object SVGPathSegArcRel]'; }
  2875. window.SVGPathSegArcRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._r1 + ' ' + this._r2 + ' ' + this._angle + ' ' + (this._largeArcFlag ? '1' : '0') + ' ' + (this._sweepFlag ? '1' : '0') + ' ' + this._x + ' ' + this._y; }
  2876. window.SVGPathSegArcRel.prototype.clone = function() { return new window.SVGPathSegArcRel(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); }
  2877. Object.defineProperty(window.SVGPathSegArcRel.prototype, 'x', { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
  2878. Object.defineProperty(window.SVGPathSegArcRel.prototype, 'y', { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
  2879. Object.defineProperty(window.SVGPathSegArcRel.prototype, 'r1', { get: function() { return this._r1; }, set: function(r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true });
  2880. Object.defineProperty(window.SVGPathSegArcRel.prototype, 'r2', { get: function() { return this._r2; }, set: function(r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true });
  2881. Object.defineProperty(window.SVGPathSegArcRel.prototype, 'angle', { get: function() { return this._angle; }, set: function(angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true });
  2882. Object.defineProperty(window.SVGPathSegArcRel.prototype, 'largeArcFlag', { get: function() { return this._largeArcFlag; }, set: function(largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true });
  2883. Object.defineProperty(window.SVGPathSegArcRel.prototype, 'sweepFlag', { get: function() { return this._sweepFlag; }, set: function(sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true });
  2884. window.SVGPathSegLinetoHorizontalAbs = function(owningPathSegList, x) {
  2885. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS, 'H', owningPathSegList);
  2886. this._x = x;
  2887. }
  2888. window.SVGPathSegLinetoHorizontalAbs.prototype = Object.create(window.SVGPathSeg.prototype);
  2889. window.SVGPathSegLinetoHorizontalAbs.prototype.toString = function() { return '[object SVGPathSegLinetoHorizontalAbs]'; }
  2890. window.SVGPathSegLinetoHorizontalAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._x; }
  2891. window.SVGPathSegLinetoHorizontalAbs.prototype.clone = function() { return new window.SVGPathSegLinetoHorizontalAbs(undefined, this._x); }
  2892. Object.defineProperty(window.SVGPathSegLinetoHorizontalAbs.prototype, 'x', { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
  2893. window.SVGPathSegLinetoHorizontalRel = function(owningPathSegList, x) {
  2894. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL, 'h', owningPathSegList);
  2895. this._x = x;
  2896. }
  2897. window.SVGPathSegLinetoHorizontalRel.prototype = Object.create(window.SVGPathSeg.prototype);
  2898. window.SVGPathSegLinetoHorizontalRel.prototype.toString = function() { return '[object SVGPathSegLinetoHorizontalRel]'; }
  2899. window.SVGPathSegLinetoHorizontalRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._x; }
  2900. window.SVGPathSegLinetoHorizontalRel.prototype.clone = function() { return new window.SVGPathSegLinetoHorizontalRel(undefined, this._x); }
  2901. Object.defineProperty(window.SVGPathSegLinetoHorizontalRel.prototype, 'x', { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
  2902. window.SVGPathSegLinetoVerticalAbs = function(owningPathSegList, y) {
  2903. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS, 'V', owningPathSegList);
  2904. this._y = y;
  2905. }
  2906. window.SVGPathSegLinetoVerticalAbs.prototype = Object.create(window.SVGPathSeg.prototype);
  2907. window.SVGPathSegLinetoVerticalAbs.prototype.toString = function() { return '[object SVGPathSegLinetoVerticalAbs]'; }
  2908. window.SVGPathSegLinetoVerticalAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._y; }
  2909. window.SVGPathSegLinetoVerticalAbs.prototype.clone = function() { return new window.SVGPathSegLinetoVerticalAbs(undefined, this._y); }
  2910. Object.defineProperty(window.SVGPathSegLinetoVerticalAbs.prototype, 'y', { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
  2911. window.SVGPathSegLinetoVerticalRel = function(owningPathSegList, y) {
  2912. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL, 'v', owningPathSegList);
  2913. this._y = y;
  2914. }
  2915. window.SVGPathSegLinetoVerticalRel.prototype = Object.create(window.SVGPathSeg.prototype);
  2916. window.SVGPathSegLinetoVerticalRel.prototype.toString = function() { return '[object SVGPathSegLinetoVerticalRel]'; }
  2917. window.SVGPathSegLinetoVerticalRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._y; }
  2918. window.SVGPathSegLinetoVerticalRel.prototype.clone = function() { return new window.SVGPathSegLinetoVerticalRel(undefined, this._y); }
  2919. Object.defineProperty(window.SVGPathSegLinetoVerticalRel.prototype, 'y', { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
  2920. window.SVGPathSegCurvetoCubicSmoothAbs = function(owningPathSegList, x, y, x2, y2) {
  2921. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, 'S', owningPathSegList);
  2922. this._x = x;
  2923. this._y = y;
  2924. this._x2 = x2;
  2925. this._y2 = y2;
  2926. }
  2927. window.SVGPathSegCurvetoCubicSmoothAbs.prototype = Object.create(window.SVGPathSeg.prototype);
  2928. window.SVGPathSegCurvetoCubicSmoothAbs.prototype.toString = function() { return '[object SVGPathSegCurvetoCubicSmoothAbs]'; }
  2929. window.SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; }
  2930. window.SVGPathSegCurvetoCubicSmoothAbs.prototype.clone = function() { return new window.SVGPathSegCurvetoCubicSmoothAbs(undefined, this._x, this._y, this._x2, this._y2); }
  2931. Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, 'x', { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
  2932. Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, 'y', { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
  2933. Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, 'x2', { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true });
  2934. Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, 'y2', { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true });
  2935. window.SVGPathSegCurvetoCubicSmoothRel = function(owningPathSegList, x, y, x2, y2) {
  2936. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL, 's', owningPathSegList);
  2937. this._x = x;
  2938. this._y = y;
  2939. this._x2 = x2;
  2940. this._y2 = y2;
  2941. }
  2942. window.SVGPathSegCurvetoCubicSmoothRel.prototype = Object.create(window.SVGPathSeg.prototype);
  2943. window.SVGPathSegCurvetoCubicSmoothRel.prototype.toString = function() { return '[object SVGPathSegCurvetoCubicSmoothRel]'; }
  2944. window.SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._x2 + ' ' + this._y2 + ' ' + this._x + ' ' + this._y; }
  2945. window.SVGPathSegCurvetoCubicSmoothRel.prototype.clone = function() { return new window.SVGPathSegCurvetoCubicSmoothRel(undefined, this._x, this._y, this._x2, this._y2); }
  2946. Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, 'x', { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
  2947. Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, 'y', { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
  2948. Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, 'x2', { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true });
  2949. Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, 'y2', { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true });
  2950. window.SVGPathSegCurvetoQuadraticSmoothAbs = function(owningPathSegList, x, y) {
  2951. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, 'T', owningPathSegList);
  2952. this._x = x;
  2953. this._y = y;
  2954. }
  2955. window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype = Object.create(window.SVGPathSeg.prototype);
  2956. window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString = function() { return '[object SVGPathSegCurvetoQuadraticSmoothAbs]'; }
  2957. window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }
  2958. window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone = function() { return new window.SVGPathSegCurvetoQuadraticSmoothAbs(undefined, this._x, this._y); }
  2959. Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype, 'x', { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
  2960. Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype, 'y', { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
  2961. window.SVGPathSegCurvetoQuadraticSmoothRel = function(owningPathSegList, x, y) {
  2962. window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, 't', owningPathSegList);
  2963. this._x = x;
  2964. this._y = y;
  2965. }
  2966. window.SVGPathSegCurvetoQuadraticSmoothRel.prototype = Object.create(window.SVGPathSeg.prototype);
  2967. window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString = function() { return '[object SVGPathSegCurvetoQuadraticSmoothRel]'; }
  2968. window.SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + ' ' + this._x + ' ' + this._y; }
  2969. window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone = function() { return new window.SVGPathSegCurvetoQuadraticSmoothRel(undefined, this._x, this._y); }
  2970. Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype, 'x', { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true });
  2971. Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype, 'y', { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true });
  2972. window.SVGPathElement.prototype.createSVGPathSegClosePath = function() { return new window.SVGPathSegClosePath(undefined); }
  2973. window.SVGPathElement.prototype.createSVGPathSegMovetoAbs = function(x, y) { return new window.SVGPathSegMovetoAbs(undefined, x, y); }
  2974. window.SVGPathElement.prototype.createSVGPathSegMovetoRel = function(x, y) { return new window.SVGPathSegMovetoRel(undefined, x, y); }
  2975. window.SVGPathElement.prototype.createSVGPathSegLinetoAbs = function(x, y) { return new window.SVGPathSegLinetoAbs(undefined, x, y); }
  2976. window.SVGPathElement.prototype.createSVGPathSegLinetoRel = function(x, y) { return new window.SVGPathSegLinetoRel(undefined, x, y); }
  2977. window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs = function(x, y, x1, y1, x2, y2) { return new window.SVGPathSegCurvetoCubicAbs(undefined, x, y, x1, y1, x2, y2); }
  2978. window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel = function(x, y, x1, y1, x2, y2) { return new window.SVGPathSegCurvetoCubicRel(undefined, x, y, x1, y1, x2, y2); }
  2979. window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs = function(x, y, x1, y1) { return new window.SVGPathSegCurvetoQuadraticAbs(undefined, x, y, x1, y1); }
  2980. window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel = function(x, y, x1, y1) { return new window.SVGPathSegCurvetoQuadraticRel(undefined, x, y, x1, y1); }
  2981. window.SVGPathElement.prototype.createSVGPathSegArcAbs = function(x, y, r1, r2, angle, largeArcFlag, sweepFlag) { return new window.SVGPathSegArcAbs(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); }
  2982. window.SVGPathElement.prototype.createSVGPathSegArcRel = function(x, y, r1, r2, angle, largeArcFlag, sweepFlag) { return new window.SVGPathSegArcRel(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); }
  2983. window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs = function(x) { return new window.SVGPathSegLinetoHorizontalAbs(undefined, x); }
  2984. window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel = function(x) { return new window.SVGPathSegLinetoHorizontalRel(undefined, x); }
  2985. window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs = function(y) { return new window.SVGPathSegLinetoVerticalAbs(undefined, y); }
  2986. window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel = function(y) { return new window.SVGPathSegLinetoVerticalRel(undefined, y); }
  2987. window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs = function(x, y, x2, y2) { return new window.SVGPathSegCurvetoCubicSmoothAbs(undefined, x, y, x2, y2); }
  2988. window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel = function(x, y, x2, y2) { return new window.SVGPathSegCurvetoCubicSmoothRel(undefined, x, y, x2, y2); }
  2989. window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs = function(x, y) { return new window.SVGPathSegCurvetoQuadraticSmoothAbs(undefined, x, y); }
  2990. window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel = function(x, y) { return new window.SVGPathSegCurvetoQuadraticSmoothRel(undefined, x, y); }
  2991. if (!('getPathSegAtLength' in window.SVGPathElement.prototype)) {
  2992. window.SVGPathElement.prototype.getPathSegAtLength = function(distance) {
  2993. if (distance === undefined || !isFinite(distance))
  2994. throw 'Invalid arguments.';
  2995. var measurementElement = document.createElementNS('http://www.w3.org/2000/svg', 'path');
  2996. measurementElement.setAttribute('d', this.getAttribute('d'));
  2997. var lastPathSegment = measurementElement.pathSegList.numberOfItems - 1;
  2998. if (lastPathSegment <= 0)
  2999. return 0;
  3000. do {
  3001. measurementElement.pathSegList.removeItem(lastPathSegment);
  3002. if (distance > measurementElement.getTotalLength())
  3003. break;
  3004. lastPathSegment--;
  3005. } while (lastPathSegment > 0);
  3006. return lastPathSegment;
  3007. }
  3008. }
  3009. }
  3010. if (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.prototype)) {
  3011. window.SVGPathSegList = function(pathElement) {
  3012. this._pathElement = pathElement;
  3013. this._list = this._parsePath(this._pathElement.getAttribute('d'));
  3014. this._mutationObserverConfig = { 'attributes': true, 'attributeFilter': ['d'] };
  3015. this._pathElementMutationObserver = new MutationObserver(this._updateListFromPathMutations.bind(this));
  3016. this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);
  3017. }
  3018. window.SVGPathSegList.prototype.classname = 'SVGPathSegList';
  3019. Object.defineProperty(window.SVGPathSegList.prototype, 'numberOfItems', {
  3020. get: function() {
  3021. this._checkPathSynchronizedToList();
  3022. return this._list.length;
  3023. },
  3024. enumerable: true
  3025. });
  3026. Object.defineProperty(window.SVGPathSegList.prototype, 'length', {
  3027. get: function() {
  3028. this._checkPathSynchronizedToList();
  3029. return this._list.length;
  3030. },
  3031. enumerable: true
  3032. });
  3033. Object.defineProperty(window.SVGPathElement.prototype, 'pathSegList', {
  3034. get: function() {
  3035. if (!this._pathSegList)
  3036. this._pathSegList = new window.SVGPathSegList(this);
  3037. return this._pathSegList;
  3038. },
  3039. enumerable: true
  3040. });
  3041. Object.defineProperty(window.SVGPathElement.prototype, 'normalizedPathSegList', { get: function() { return this.pathSegList; }, enumerable: true });
  3042. Object.defineProperty(window.SVGPathElement.prototype, 'animatedPathSegList', { get: function() { return this.pathSegList; }, enumerable: true });
  3043. Object.defineProperty(window.SVGPathElement.prototype, 'animatedNormalizedPathSegList', { get: function() { return this.pathSegList; }, enumerable: true });
  3044. window.SVGPathSegList.prototype._checkPathSynchronizedToList = function() {
  3045. this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords());
  3046. }
  3047. window.SVGPathSegList.prototype._updateListFromPathMutations = function(mutationRecords) {
  3048. if (!this._pathElement)
  3049. return;
  3050. var hasPathMutations = false;
  3051. mutationRecords.forEach(function(record) {
  3052. if (record.attributeName == 'd')
  3053. hasPathMutations = true;
  3054. });
  3055. if (hasPathMutations)
  3056. this._list = this._parsePath(this._pathElement.getAttribute('d'));
  3057. }
  3058. window.SVGPathSegList.prototype._writeListToPath = function() {
  3059. this._pathElementMutationObserver.disconnect();
  3060. this._pathElement.setAttribute('d', window.SVGPathSegList._pathSegArrayAsString(this._list));
  3061. this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);
  3062. }
  3063. window.SVGPathSegList.prototype.segmentChanged = function(pathSeg) {
  3064. this._writeListToPath();
  3065. }
  3066. window.SVGPathSegList.prototype.clear = function() {
  3067. this._checkPathSynchronizedToList();
  3068. this._list.forEach(function(pathSeg) {
  3069. pathSeg._owningPathSegList = null;
  3070. });
  3071. this._list = [];
  3072. this._writeListToPath();
  3073. }
  3074. window.SVGPathSegList.prototype.initialize = function(newItem) {
  3075. this._checkPathSynchronizedToList();
  3076. this._list = [newItem];
  3077. newItem._owningPathSegList = this;
  3078. this._writeListToPath();
  3079. return newItem;
  3080. }
  3081. window.SVGPathSegList.prototype._checkValidIndex = function(index) {
  3082. if (isNaN(index) || index < 0 || index >= this.numberOfItems)
  3083. throw 'INDEX_SIZE_ERR';
  3084. }
  3085. window.SVGPathSegList.prototype.getItem = function(index) {
  3086. this._checkPathSynchronizedToList();
  3087. this._checkValidIndex(index);
  3088. return this._list[index];
  3089. }
  3090. window.SVGPathSegList.prototype.insertItemBefore = function(newItem, index) {
  3091. this._checkPathSynchronizedToList();
  3092. if (index > this.numberOfItems)
  3093. index = this.numberOfItems;
  3094. if (newItem._owningPathSegList) {
  3095. newItem = newItem.clone();
  3096. }
  3097. this._list.splice(index, 0, newItem);
  3098. newItem._owningPathSegList = this;
  3099. this._writeListToPath();
  3100. return newItem;
  3101. }
  3102. window.SVGPathSegList.prototype.replaceItem = function(newItem, index) {
  3103. this._checkPathSynchronizedToList();
  3104. if (newItem._owningPathSegList) {
  3105. newItem = newItem.clone();
  3106. }
  3107. this._checkValidIndex(index);
  3108. this._list[index] = newItem;
  3109. newItem._owningPathSegList = this;
  3110. this._writeListToPath();
  3111. return newItem;
  3112. }
  3113. window.SVGPathSegList.prototype.removeItem = function(index) {
  3114. this._checkPathSynchronizedToList();
  3115. this._checkValidIndex(index);
  3116. var item = this._list[index];
  3117. this._list.splice(index, 1);
  3118. this._writeListToPath();
  3119. return item;
  3120. }
  3121. window.SVGPathSegList.prototype.appendItem = function(newItem) {
  3122. this._checkPathSynchronizedToList();
  3123. if (newItem._owningPathSegList) {
  3124. newItem = newItem.clone();
  3125. }
  3126. this._list.push(newItem);
  3127. newItem._owningPathSegList = this;
  3128. this._writeListToPath();
  3129. return newItem;
  3130. };
  3131. window.SVGPathSegList.prototype.matrixTransform = function(aSVGMatrix) {
  3132. this._checkPathSynchronizedToList();
  3133. var nLength = this._list.length;
  3134. for( var i = 0; i < nLength; ++i )
  3135. {
  3136. var nX;
  3137. var aPathSeg = this._list[i];
  3138. switch( aPathSeg.pathSegTypeAsLetter )
  3139. {
  3140. case 'C':
  3141. nX = aPathSeg._x2;
  3142. aPathSeg._x2 = aSVGMatrix.a * nX + aSVGMatrix.c * aPathSeg._y2 + aSVGMatrix.e;
  3143. aPathSeg._y2 = aSVGMatrix.b * nX + aSVGMatrix.d * aPathSeg._y2 + aSVGMatrix.f;
  3144. case 'Q':
  3145. nX = aPathSeg._x1;
  3146. aPathSeg._x1 = aSVGMatrix.a * nX + aSVGMatrix.c * aPathSeg._y1 + aSVGMatrix.e;
  3147. aPathSeg._y1 = aSVGMatrix.b * nX + aSVGMatrix.d * aPathSeg._y1 + aSVGMatrix.f;
  3148. case 'M':
  3149. case 'L':
  3150. nX = aPathSeg._x;
  3151. aPathSeg._x = aSVGMatrix.a * nX + aSVGMatrix.c * aPathSeg._y + aSVGMatrix.e;
  3152. aPathSeg._y = aSVGMatrix.b * nX + aSVGMatrix.d * aPathSeg._y + aSVGMatrix.f;
  3153. break;
  3154. default:
  3155. log( 'SVGPathSeg.matrixTransform: unexpected path segment type: '
  3156. + aPathSeg.pathSegTypeAsLetter );
  3157. }
  3158. }
  3159. this._writeListToPath();
  3160. };
  3161. window.SVGPathSegList.prototype.changeOrientation = function() {
  3162. this._checkPathSynchronizedToList();
  3163. var aPathSegList = this._list;
  3164. var nLength = aPathSegList.length;
  3165. if( nLength == 0 ) return;
  3166. var nCurrentX = 0;
  3167. var nCurrentY = 0;
  3168. var aPathSeg = aPathSegList[0];
  3169. if( aPathSeg.pathSegTypeAsLetter == 'M' )
  3170. {
  3171. nCurrentX = aPathSeg.x;
  3172. nCurrentY = aPathSeg.y;
  3173. aPathSegList.shift();
  3174. --nLength;
  3175. }
  3176. var i;
  3177. for( i = 0; i < nLength; ++i )
  3178. {
  3179. aPathSeg = aPathSegList[i];
  3180. switch( aPathSeg.pathSegTypeAsLetter )
  3181. {
  3182. case 'C':
  3183. var nX = aPathSeg._x1;
  3184. aPathSeg._x1 = aPathSeg._x2;
  3185. aPathSeg._x2 = nX;
  3186. var nY = aPathSeg._y1;
  3187. aPathSeg._y1 = aPathSeg._y2;
  3188. aPathSeg._y2 = nY;
  3189. case 'M':
  3190. case 'L':
  3191. case 'Q':
  3192. var aPoint = { x: aPathSeg._x, y: aPathSeg._y };
  3193. aPathSeg._x = nCurrentX;
  3194. aPathSeg._y = nCurrentY;
  3195. nCurrentX = aPoint.x;
  3196. nCurrentY = aPoint.y;
  3197. break;
  3198. default:
  3199. log( 'SVGPathSegList.changeOrientation: unexpected path segment type: '
  3200. + aPathSeg.pathSegTypeAsLetter );
  3201. }
  3202. }
  3203. aPathSegList.reverse();
  3204. var aMovePathSeg = new window.SVGPathSegMovetoAbs( this, nCurrentX, nCurrentY );
  3205. aPathSegList.unshift( aMovePathSeg );
  3206. this._writeListToPath();
  3207. };
  3208. window.SVGPathSegList._pathSegArrayAsString = function(pathSegArray) {
  3209. var string = '';
  3210. var first = true;
  3211. pathSegArray.forEach(function(pathSeg) {
  3212. if (first) {
  3213. first = false;
  3214. string += pathSeg._asPathString();
  3215. } else {
  3216. string += ' ' + pathSeg._asPathString();
  3217. }
  3218. });
  3219. return string;
  3220. }
  3221. window.SVGPathSegList.prototype._parsePath = function(string) {
  3222. if (!string || string.length == 0)
  3223. return [];
  3224. var owningPathSegList = this;
  3225. var Builder = function() {
  3226. this.pathSegList = [];
  3227. }
  3228. Builder.prototype.appendSegment = function(pathSeg) {
  3229. this.pathSegList.push(pathSeg);
  3230. }
  3231. var Source = function(string) {
  3232. this._string = string;
  3233. this._currentIndex = 0;
  3234. this._endIndex = this._string.length;
  3235. this._previousCommand = window.SVGPathSeg.PATHSEG_UNKNOWN;
  3236. this._skipOptionalSpaces();
  3237. }
  3238. Source.prototype._isCurrentSpace = function() {
  3239. var character = this._string[this._currentIndex];
  3240. return character <= ' ' && (character == ' ' || character == '\n' || character == '\t' || character == '\r' || character == '\f');
  3241. }
  3242. Source.prototype._skipOptionalSpaces = function() {
  3243. while (this._currentIndex < this._endIndex && this._isCurrentSpace())
  3244. this._currentIndex++;
  3245. return this._currentIndex < this._endIndex;
  3246. }
  3247. Source.prototype._skipOptionalSpacesOrDelimiter = function() {
  3248. if (this._currentIndex < this._endIndex && !this._isCurrentSpace() && this._string.charAt(this._currentIndex) != ',')
  3249. return false;
  3250. if (this._skipOptionalSpaces()) {
  3251. if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == ',') {
  3252. this._currentIndex++;
  3253. this._skipOptionalSpaces();
  3254. }
  3255. }
  3256. return this._currentIndex < this._endIndex;
  3257. }
  3258. Source.prototype.hasMoreData = function() {
  3259. return this._currentIndex < this._endIndex;
  3260. }
  3261. Source.prototype.peekSegmentType = function() {
  3262. var lookahead = this._string[this._currentIndex];
  3263. return this._pathSegTypeFromChar(lookahead);
  3264. }
  3265. Source.prototype._pathSegTypeFromChar = function(lookahead) {
  3266. switch (lookahead) {
  3267. case 'Z':
  3268. case 'z':
  3269. return window.SVGPathSeg.PATHSEG_CLOSEPATH;
  3270. case 'M':
  3271. return window.SVGPathSeg.PATHSEG_MOVETO_ABS;
  3272. case 'm':
  3273. return window.SVGPathSeg.PATHSEG_MOVETO_REL;
  3274. case 'L':
  3275. return window.SVGPathSeg.PATHSEG_LINETO_ABS;
  3276. case 'l':
  3277. return window.SVGPathSeg.PATHSEG_LINETO_REL;
  3278. case 'C':
  3279. return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;
  3280. case 'c':
  3281. return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;
  3282. case 'Q':
  3283. return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;
  3284. case 'q':
  3285. return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;
  3286. case 'A':
  3287. return window.SVGPathSeg.PATHSEG_ARC_ABS;
  3288. case 'a':
  3289. return window.SVGPathSeg.PATHSEG_ARC_REL;
  3290. case 'H':
  3291. return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;
  3292. case 'h':
  3293. return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;
  3294. case 'V':
  3295. return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;
  3296. case 'v':
  3297. return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;
  3298. case 'S':
  3299. return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;
  3300. case 's':
  3301. return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;
  3302. case 'T':
  3303. return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;
  3304. case 't':
  3305. return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;
  3306. default:
  3307. return window.SVGPathSeg.PATHSEG_UNKNOWN;
  3308. }
  3309. }
  3310. Source.prototype._nextCommandHelper = function(lookahead, previousCommand) {
  3311. if ((lookahead == '+' || lookahead == '-' || lookahead == '.' || (lookahead >= '0' && lookahead <= '9')) && previousCommand != window.SVGPathSeg.PATHSEG_CLOSEPATH) {
  3312. if (previousCommand == window.SVGPathSeg.PATHSEG_MOVETO_ABS)
  3313. return window.SVGPathSeg.PATHSEG_LINETO_ABS;
  3314. if (previousCommand == window.SVGPathSeg.PATHSEG_MOVETO_REL)
  3315. return window.SVGPathSeg.PATHSEG_LINETO_REL;
  3316. return previousCommand;
  3317. }
  3318. return window.SVGPathSeg.PATHSEG_UNKNOWN;
  3319. }
  3320. Source.prototype.initialCommandIsMoveTo = function() {
  3321. if (!this.hasMoreData())
  3322. return true;
  3323. var command = this.peekSegmentType();
  3324. return command == window.SVGPathSeg.PATHSEG_MOVETO_ABS || command == window.SVGPathSeg.PATHSEG_MOVETO_REL;
  3325. }
  3326. Source.prototype._parseNumber = function() {
  3327. var exponent = 0;
  3328. var integer = 0;
  3329. var frac = 1;
  3330. var decimal = 0;
  3331. var sign = 1;
  3332. var expsign = 1;
  3333. var startIndex = this._currentIndex;
  3334. this._skipOptionalSpaces();
  3335. if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == '+')
  3336. this._currentIndex++;
  3337. else if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == '-') {
  3338. this._currentIndex++;
  3339. sign = -1;
  3340. }
  3341. if (this._currentIndex == this._endIndex || ((this._string.charAt(this._currentIndex) < '0' || this._string.charAt(this._currentIndex) > '9') && this._string.charAt(this._currentIndex) != '.'))
  3342. return undefined;
  3343. var startIntPartIndex = this._currentIndex;
  3344. while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= '0' && this._string.charAt(this._currentIndex) <= '9')
  3345. this._currentIndex++; // Advance to first non-digit.
  3346. if (this._currentIndex != startIntPartIndex) {
  3347. var scanIntPartIndex = this._currentIndex - 1;
  3348. var multiplier = 1;
  3349. while (scanIntPartIndex >= startIntPartIndex) {
  3350. integer += multiplier * (this._string.charAt(scanIntPartIndex--) - '0');
  3351. multiplier *= 10;
  3352. }
  3353. }
  3354. if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == '.') {
  3355. this._currentIndex++;
  3356. if (this._currentIndex >= this._endIndex || this._string.charAt(this._currentIndex) < '0' || this._string.charAt(this._currentIndex) > '9')
  3357. return undefined;
  3358. while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= '0' && this._string.charAt(this._currentIndex) <= '9') {
  3359. frac *= 10;
  3360. decimal += (this._string.charAt(this._currentIndex) - '0') / frac;
  3361. this._currentIndex += 1;
  3362. }
  3363. }
  3364. if (this._currentIndex != startIndex && this._currentIndex + 1 < this._endIndex && (this._string.charAt(this._currentIndex) == 'e' || this._string.charAt(this._currentIndex) == 'E') && (this._string.charAt(this._currentIndex + 1) != 'x' && this._string.charAt(this._currentIndex + 1) != 'm')) {
  3365. this._currentIndex++;
  3366. if (this._string.charAt(this._currentIndex) == '+') {
  3367. this._currentIndex++;
  3368. } else if (this._string.charAt(this._currentIndex) == '-') {
  3369. this._currentIndex++;
  3370. expsign = -1;
  3371. }
  3372. if (this._currentIndex >= this._endIndex || this._string.charAt(this._currentIndex) < '0' || this._string.charAt(this._currentIndex) > '9')
  3373. return undefined;
  3374. while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= '0' && this._string.charAt(this._currentIndex) <= '9') {
  3375. exponent *= 10;
  3376. exponent += (this._string.charAt(this._currentIndex) - '0');
  3377. this._currentIndex++;
  3378. }
  3379. }
  3380. var number = integer + decimal;
  3381. number *= sign;
  3382. if (exponent)
  3383. number *= Math.pow(10, expsign * exponent);
  3384. if (startIndex == this._currentIndex)
  3385. return undefined;
  3386. this._skipOptionalSpacesOrDelimiter();
  3387. return number;
  3388. }
  3389. Source.prototype._parseArcFlag = function() {
  3390. if (this._currentIndex >= this._endIndex)
  3391. return undefined;
  3392. var flag = false;
  3393. var flagChar = this._string.charAt(this._currentIndex++);
  3394. if (flagChar == '0')
  3395. flag = false;
  3396. else if (flagChar == '1')
  3397. flag = true;
  3398. else
  3399. return undefined;
  3400. this._skipOptionalSpacesOrDelimiter();
  3401. return flag;
  3402. }
  3403. Source.prototype.parseSegment = function() {
  3404. var lookahead = this._string[this._currentIndex];
  3405. var command = this._pathSegTypeFromChar(lookahead);
  3406. if (command == window.SVGPathSeg.PATHSEG_UNKNOWN) {
  3407. if (this._previousCommand == window.SVGPathSeg.PATHSEG_UNKNOWN)
  3408. return null;
  3409. command = this._nextCommandHelper(lookahead, this._previousCommand);
  3410. if (command == window.SVGPathSeg.PATHSEG_UNKNOWN)
  3411. return null;
  3412. } else {
  3413. this._currentIndex++;
  3414. }
  3415. this._previousCommand = command;
  3416. switch (command) {
  3417. case window.SVGPathSeg.PATHSEG_MOVETO_REL:
  3418. return new window.SVGPathSegMovetoRel(owningPathSegList, this._parseNumber(), this._parseNumber());
  3419. case window.SVGPathSeg.PATHSEG_MOVETO_ABS:
  3420. return new window.SVGPathSegMovetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber());
  3421. case window.SVGPathSeg.PATHSEG_LINETO_REL:
  3422. return new window.SVGPathSegLinetoRel(owningPathSegList, this._parseNumber(), this._parseNumber());
  3423. case window.SVGPathSeg.PATHSEG_LINETO_ABS:
  3424. return new window.SVGPathSegLinetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber());
  3425. case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:
  3426. return new window.SVGPathSegLinetoHorizontalRel(owningPathSegList, this._parseNumber());
  3427. case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:
  3428. return new window.SVGPathSegLinetoHorizontalAbs(owningPathSegList, this._parseNumber());
  3429. case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:
  3430. return new window.SVGPathSegLinetoVerticalRel(owningPathSegList, this._parseNumber());
  3431. case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:
  3432. return new window.SVGPathSegLinetoVerticalAbs(owningPathSegList, this._parseNumber());
  3433. case window.SVGPathSeg.PATHSEG_CLOSEPATH:
  3434. this._skipOptionalSpaces();
  3435. return new window.SVGPathSegClosePath(owningPathSegList);
  3436. case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:
  3437. var points = {x1: this._parseNumber(), y1: this._parseNumber(), x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};
  3438. return new window.SVGPathSegCurvetoCubicRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2);
  3439. case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:
  3440. var points = {x1: this._parseNumber(), y1: this._parseNumber(), x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};
  3441. return new window.SVGPathSegCurvetoCubicAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2);
  3442. case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
  3443. var points = {x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};
  3444. return new window.SVGPathSegCurvetoCubicSmoothRel(owningPathSegList, points.x, points.y, points.x2, points.y2);
  3445. case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
  3446. var points = {x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};
  3447. return new window.SVGPathSegCurvetoCubicSmoothAbs(owningPathSegList, points.x, points.y, points.x2, points.y2);
  3448. case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:
  3449. var points = {x1: this._parseNumber(), y1: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};
  3450. return new window.SVGPathSegCurvetoQuadraticRel(owningPathSegList, points.x, points.y, points.x1, points.y1);
  3451. case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:
  3452. var points = {x1: this._parseNumber(), y1: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()};
  3453. return new window.SVGPathSegCurvetoQuadraticAbs(owningPathSegList, points.x, points.y, points.x1, points.y1);
  3454. case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
  3455. return new window.SVGPathSegCurvetoQuadraticSmoothRel(owningPathSegList, this._parseNumber(), this._parseNumber());
  3456. case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
  3457. return new window.SVGPathSegCurvetoQuadraticSmoothAbs(owningPathSegList, this._parseNumber(), this._parseNumber());
  3458. case window.SVGPathSeg.PATHSEG_ARC_REL:
  3459. var points = {x1: this._parseNumber(), y1: this._parseNumber(), arcAngle: this._parseNumber(), arcLarge: this._parseArcFlag(), arcSweep: this._parseArcFlag(), x: this._parseNumber(), y: this._parseNumber()};
  3460. return new window.SVGPathSegArcRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep);
  3461. case window.SVGPathSeg.PATHSEG_ARC_ABS:
  3462. var points = {x1: this._parseNumber(), y1: this._parseNumber(), arcAngle: this._parseNumber(), arcLarge: this._parseArcFlag(), arcSweep: this._parseArcFlag(), x: this._parseNumber(), y: this._parseNumber()};
  3463. return new window.SVGPathSegArcAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep);
  3464. default:
  3465. throw 'Unknown path seg type.'
  3466. }
  3467. }
  3468. var builder = new Builder();
  3469. var source = new Source(string);
  3470. if (!source.initialCommandIsMoveTo())
  3471. return [];
  3472. while (source.hasMoreData()) {
  3473. var pathSeg = source.parseSegment();
  3474. if (!pathSeg)
  3475. return [];
  3476. builder.appendSegment(pathSeg);
  3477. }
  3478. return builder.pathSegList;
  3479. }
  3480. }
  3481. }());
  3482. /*****
  3483. * @svgpathend
  3484. *
  3485. * The above code is a derivative work of some part of the SVGPathSeg API.
  3486. *
  3487. * This API is a drop-in replacement for the SVGPathSeg and SVGPathSegList APIs that were removed from
  3488. * SVG2 (https://lists.w3.org/Archives/Public/www-svg/2015Jun/0044.html), including the latest spec
  3489. * changes which were implemented in Firefox 43 and Chrome 46.
  3490. *
  3491. * @source https://github.com/progers/pathseg
  3492. */
  3493. /*****
  3494. * @licstart
  3495. *
  3496. * The following is the license notice for the part of JavaScript code of
  3497. * this page included between the '@libreofficestart' and the '@libreofficeend'
  3498. * notes.
  3499. */
  3500. /***** ******************************************************************
  3501. *
  3502. * This file is part of the LibreOffice project.
  3503. *
  3504. * This Source Code Form is subject to the terms of the Mozilla Public
  3505. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3506. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  3507. *
  3508. * This file incorporates work covered by the following license notice:
  3509. *
  3510. * Licensed to the Apache Software Foundation (ASF) under one or more
  3511. * contributor license agreements. See the NOTICE file distributed
  3512. * with this work for additional information regarding copyright
  3513. * ownership. The ASF licenses this file to you under the Apache
  3514. * License, Version 2.0 (the 'License'); you may not use this file
  3515. * except in compliance with the License. You may obtain a copy of
  3516. * the License at http://www.apache.org/licenses/LICENSE-2.0 .
  3517. *
  3518. ************************************************************************/
  3519. /*****
  3520. * @licend
  3521. *
  3522. * The above is the license notice for the part of JavaScript code of
  3523. * this page included between the '@libreofficestart' and the '@libreofficeend'
  3524. * notes.
  3525. */
  3526. /*****
  3527. * @libreofficestart
  3528. *
  3529. * Several parts of the following code are the result of the porting,
  3530. * started on August 2011, of the C++ code included in the source
  3531. * files placed under the folder '/slideshow/source' and
  3532. * sub-folders. This got later rebased onto the AL2-licensed versions
  3533. * of those files in early 2013.
  3534. * @source https://cgit.freedesktop.org/libreoffice/core/tree/slideshow/source
  3535. *
  3536. */
  3537. window.onload = init;
  3538. var aOOOElemMetaSlides = 'ooo:meta_slides';
  3539. var aOOOElemMetaSlide = 'ooo:meta_slide';
  3540. var aOOOElemTextField = 'ooo:text_field';
  3541. var aPresentationClipPathId = 'presentation_clip_path';
  3542. var aPresentationClipPathShrinkId = 'presentation_clip_path_shrink';
  3543. var aOOOAttrNumberOfSlides = 'number-of-slides';
  3544. var aOOOAttrStartSlideNumber= 'start-slide-number';
  3545. var aOOOAttrNumberingType = 'page-numbering-type';
  3546. var aOOOAttrListItemNumberingType= 'numbering-type';
  3547. var aOOOAttrUsePositionedChars = 'use-positioned-chars';
  3548. var aOOOAttrSlide = 'slide';
  3549. var aOOOAttrMaster = 'master';
  3550. var aOOOAttrDisplayName = 'display-name';
  3551. var aOOOAttrSlideDuration = 'slide-duration';
  3552. var aOOOAttrHasTransition = 'has-transition';
  3553. var aOOOAttrHasCustomBackground = 'has-custom-background';
  3554. var aOOOAttrBackgroundVisibility = 'background-visibility';
  3555. var aOOOAttrMasterObjectsVisibility = 'master-objects-visibility';
  3556. var aOOOAttrPageNumberVisibility = 'page-number-visibility';
  3557. var aOOOAttrDateTimeVisibility = 'date-time-visibility';
  3558. var aOOOAttrFooterVisibility = 'footer-visibility';
  3559. var aOOOAttrHeaderVisibility = 'header-visibility';
  3560. var aOOOAttrDateTimeField = 'date-time-field';
  3561. var aOOOAttrFooterField = 'footer-field';
  3562. var aOOOAttrHeaderField = 'header-field';
  3563. var aOOOAttrDateTimeFormat = 'date-time-format';
  3564. var aOOOAttrTextAdjust = 'text-adjust';
  3565. var aClipPathGroupClassName = 'ClipPathGroup';
  3566. var aPageClassName = 'Page';
  3567. var aSlideNumberClassName = 'PageNumber';
  3568. var aDateTimeClassName = 'DateTime';
  3569. var aFooterClassName = 'Footer';
  3570. var aHeaderClassName = 'Header';
  3571. var aDateClassName = 'Date';
  3572. var aTimeClassName = 'Time';
  3573. var aSlideNameClassName='PageName';
  3574. var NSS = {};
  3575. NSS['svg']='http://www.w3.org/2000/svg';
  3576. NSS['rdf']='http://www.w3.org/1999/02/22-rdf-syntax-ns#';
  3577. NSS['xlink']='http://www.w3.org/1999/xlink';
  3578. NSS['xml']='http://www.w3.org/XML/1998/namespace';
  3579. NSS['ooo'] = 'http://xml.openoffice.org/svg/export';
  3580. NSS['presentation'] = 'http://sun.com/xmlns/staroffice/presentation';
  3581. NSS['smil'] = 'http://www.w3.org/2001/SMIL20/';
  3582. NSS['anim'] = 'urn:oasis:names:tc:opendocument:xmlns:animation:1.0';
  3583. var SLIDE_MODE = 1;
  3584. var INDEX_MODE = 2;
  3585. var MOUSE_UP = 1;
  3586. var MOUSE_DOWN = 2; // eslint-disable-line no-unused-vars
  3587. var MOUSE_MOVE = 3; // eslint-disable-line no-unused-vars
  3588. var MOUSE_WHEEL = 4;
  3589. var LEFT_KEY = 37; // cursor left keycode
  3590. var UP_KEY = 38; // cursor up keycode
  3591. var RIGHT_KEY = 39; // cursor right keycode
  3592. var DOWN_KEY = 40; // cursor down keycode
  3593. var PAGE_UP_KEY = 33; // page up keycode
  3594. var PAGE_DOWN_KEY = 34; // page down keycode
  3595. var HOME_KEY = 36; // home keycode
  3596. var END_KEY = 35; // end keycode
  3597. var ENTER_KEY = 13;
  3598. var SPACE_KEY = 32;
  3599. var ESCAPE_KEY = 27;
  3600. var Q_KEY = 81;
  3601. var HIDDEN = 0;
  3602. var VISIBLE = 1;
  3603. var INHERIT = 2;
  3604. var aVisibilityAttributeValue = [ 'hidden', 'visible', 'inherit' ]; // eslint-disable-line no-unused-vars
  3605. var aVisibilityValue = { 'hidden' : HIDDEN, 'visible' : VISIBLE, 'inherit' : INHERIT };
  3606. var ROOT_NODE = document.getElementsByTagNameNS( NSS['svg'], 'svg' )[0];
  3607. var WIDTH = 0;
  3608. var HEIGHT = 0;
  3609. var INDEX_COLUMNS_DEFAULT = 3;
  3610. var INDEX_OFFSET = 0;
  3611. var Detect = configureDetectionTools();
  3612. var theMetaDoc;
  3613. var theSlideIndexPage;
  3614. var currentMode = SLIDE_MODE;
  3615. var processingEffect = false;
  3616. var nCurSlide = undefined;
  3617. var bTextHasBeenSelected = false;
  3618. var sLastSelectedText = '';
  3619. var charCodeDictionary = getDefaultCharCodeDictionary();
  3620. var keyCodeDictionary = getDefaultKeyCodeDictionary();
  3621. var mouseHandlerDictionary = getDefaultMouseHandlerDictionary();
  3622. function object( aObject )
  3623. {
  3624. var F = function() {};
  3625. F.prototype = aObject;
  3626. return new F();
  3627. }
  3628. function extend( aSubType, aSuperType )
  3629. {
  3630. if (!aSuperType || !aSubType)
  3631. {
  3632. alert('extend failed, verify dependencies');
  3633. }
  3634. var OP = Object.prototype;
  3635. var sp = aSuperType.prototype;
  3636. var rp = object( sp );
  3637. aSubType.prototype = rp;
  3638. rp.constructor = aSubType;
  3639. aSubType.superclass = sp;
  3640. if (aSuperType != Object && sp.constructor == OP.constructor)
  3641. {
  3642. sp.constructor = aSuperType;
  3643. }
  3644. return aSubType;
  3645. }
  3646. function instantiate( TemplateClass, BaseType )
  3647. {
  3648. if( !TemplateClass.instanceSet )
  3649. TemplateClass.instanceSet = [];
  3650. var nSize = TemplateClass.instanceSet.length;
  3651. for( var i = 0; i < nSize; ++i )
  3652. {
  3653. if( TemplateClass.instanceSet[i].base === BaseType )
  3654. return TemplateClass.instanceSet[i].instance;
  3655. }
  3656. TemplateClass.instanceSet[ nSize ] = {};
  3657. TemplateClass.instanceSet[ nSize ].base = BaseType;
  3658. TemplateClass.instanceSet[ nSize ].instance = TemplateClass( BaseType );
  3659. return TemplateClass.instanceSet[ nSize ].instance;
  3660. }
  3661. function Rectangle( aSVGRectElem )
  3662. {
  3663. var x = parseInt( aSVGRectElem.getAttribute( 'x' ) );
  3664. var y = parseInt( aSVGRectElem.getAttribute( 'y' ) );
  3665. var width = parseInt( aSVGRectElem.getAttribute( 'width' ) );
  3666. var height = parseInt( aSVGRectElem.getAttribute( 'height' ) );
  3667. this.left = x;
  3668. this.right = x + width;
  3669. this.top = y;
  3670. this.bottom = y + height;
  3671. }
  3672. function getKeyByValue(aObj, value) {
  3673. for(var key in aObj) {
  3674. if(aObj[key] == value)
  3675. return key;
  3676. }
  3677. return null;
  3678. }
  3679. function log( message )
  3680. {
  3681. if( typeof console == 'object' )
  3682. {
  3683. console.log( message );
  3684. }
  3685. else if( typeof opera == 'object' )
  3686. {
  3687. opera.postError( message );
  3688. }
  3689. else if( typeof java == 'object' && typeof java.lang == 'object' )
  3690. {
  3691. java.lang.System.out.println( message );
  3692. }
  3693. }
  3694. function getNSAttribute( sNSPrefix, aElem, sAttrName )
  3695. {
  3696. if( !aElem ) return null;
  3697. if( 'getAttributeNS' in aElem )
  3698. {
  3699. return aElem.getAttributeNS( NSS[sNSPrefix], sAttrName );
  3700. }
  3701. else
  3702. {
  3703. return aElem.getAttribute( sNSPrefix + ':' + sAttrName );
  3704. }
  3705. }
  3706. function getOOOAttribute( aElem, sAttrName )
  3707. {
  3708. return getNSAttribute( 'ooo', aElem, sAttrName );
  3709. }
  3710. function setNSAttribute( sNSPrefix, aElem, sAttrName, aValue )
  3711. {
  3712. if( !aElem ) return false;
  3713. if( 'setAttributeNS' in aElem )
  3714. {
  3715. aElem.setAttributeNS( NSS[sNSPrefix], sAttrName, aValue );
  3716. return true;
  3717. }
  3718. else
  3719. {
  3720. aElem.setAttribute(sNSPrefix + ':' + sAttrName, aValue );
  3721. return true;
  3722. }
  3723. }
  3724. function getElementsByClassName( aElem, sClassName )
  3725. {
  3726. var aElementSet = [];
  3727. if( 'getElementsByClassName' in aElem )
  3728. {
  3729. aElementSet = aElem.getElementsByClassName( sClassName );
  3730. }
  3731. else
  3732. {
  3733. var aElementSetByClassProperty = getElementsByProperty( aElem, 'class' );
  3734. for( var i = 0; i < aElementSetByClassProperty.length; ++i )
  3735. {
  3736. var sAttrClassName = aElementSetByClassProperty[i].getAttribute( 'class' );
  3737. if( sAttrClassName == sClassName )
  3738. {
  3739. aElementSet.push( aElementSetByClassProperty[i] );
  3740. }
  3741. }
  3742. }
  3743. return aElementSet;
  3744. }
  3745. function getElementByClassName( aElem, sClassName /*, sTagName */)
  3746. {
  3747. var aElementSet = getElementsByClassName( aElem, sClassName );
  3748. if ( aElementSet.length == 1 )
  3749. return aElementSet[0];
  3750. else
  3751. return null;
  3752. }
  3753. function getClassAttribute( aElem )
  3754. {
  3755. if( aElem )
  3756. return aElem.getAttribute( 'class' );
  3757. return '';
  3758. }
  3759. function createElementGroup( aParentElement, aElementList, nFrom, nCount, sGroupClass, sGroupId )
  3760. {
  3761. var nTo = nFrom + nCount;
  3762. if( nCount < 1 || aElementList.length < nTo )
  3763. {
  3764. log( 'createElementGroup: not enough elements available.' );
  3765. return;
  3766. }
  3767. var firstElement = aElementList[nFrom];
  3768. if( !firstElement )
  3769. {
  3770. log( 'createElementGroup: element not found.' );
  3771. return;
  3772. }
  3773. var aGroupElement = document.createElementNS( NSS['svg'], 'g' );
  3774. if( sGroupId )
  3775. aGroupElement.setAttribute( 'id', sGroupId );
  3776. if( sGroupClass )
  3777. aGroupElement.setAttribute( 'class', sGroupClass );
  3778. aParentElement.insertBefore( aGroupElement, firstElement );
  3779. var i = nFrom;
  3780. for( ; i < nTo; ++i )
  3781. {
  3782. aParentElement.removeChild( aElementList[i] );
  3783. aGroupElement.appendChild( aElementList[i] );
  3784. }
  3785. }
  3786. function initVisibilityProperty( aElement )
  3787. {
  3788. var nVisibility = VISIBLE;
  3789. var sVisibility = aElement.getAttribute( 'visibility' );
  3790. if( sVisibility ) nVisibility = aVisibilityValue[ sVisibility ];
  3791. return nVisibility;
  3792. }
  3793. function getSafeIndex( nIndex, nMin, nMax )
  3794. {
  3795. if( nIndex < nMin )
  3796. return nMin;
  3797. else if( nIndex > nMax )
  3798. return nMax;
  3799. else
  3800. return nIndex;
  3801. }
  3802. function getUrlParameter(name)
  3803. {
  3804. name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
  3805. var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
  3806. var results = regex.exec(window.location.search);
  3807. return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
  3808. }
  3809. function getRandomInt( nMax )
  3810. {
  3811. return Math.floor( Math.random() * nMax );
  3812. }
  3813. function DebugPrinter()
  3814. {
  3815. this.bEnabled = false;
  3816. }
  3817. DebugPrinter.prototype.on = function()
  3818. {
  3819. this.bEnabled = true;
  3820. };
  3821. DebugPrinter.prototype.off = function()
  3822. {
  3823. this.bEnabled = false;
  3824. };
  3825. DebugPrinter.prototype.isEnabled = function()
  3826. {
  3827. return this.bEnabled;
  3828. };
  3829. DebugPrinter.prototype.print = function( sMessage, nTime )
  3830. {
  3831. if( this.isEnabled() )
  3832. {
  3833. var sInfo = 'DBG: ' + sMessage;
  3834. if( nTime )
  3835. sInfo += ' (at: ' + String( nTime / 1000 ) + 's)';
  3836. log( sInfo );
  3837. }
  3838. };
  3839. var aGenericDebugPrinter = new DebugPrinter();
  3840. aGenericDebugPrinter.off();
  3841. var DBGLOG = bind2( DebugPrinter.prototype.print, aGenericDebugPrinter );
  3842. var NAVDBG = new DebugPrinter();
  3843. NAVDBG.off();
  3844. var ANIMDBG = new DebugPrinter();
  3845. ANIMDBG.off();
  3846. var aRegisterEventDebugPrinter = new DebugPrinter();
  3847. aRegisterEventDebugPrinter.off();
  3848. var aTimerEventQueueDebugPrinter = new DebugPrinter();
  3849. aTimerEventQueueDebugPrinter.off();
  3850. var aEventMultiplexerDebugPrinter = new DebugPrinter();
  3851. aEventMultiplexerDebugPrinter.off();
  3852. var aNextEffectEventArrayDebugPrinter = new DebugPrinter();
  3853. aNextEffectEventArrayDebugPrinter.off();
  3854. var aActivityQueueDebugPrinter = new DebugPrinter();
  3855. aActivityQueueDebugPrinter.off();
  3856. var aAnimatedElementDebugPrinter = new DebugPrinter();
  3857. aAnimatedElementDebugPrinter.off();
  3858. function MetaDocument()
  3859. {
  3860. var aMetaDocElem = document.getElementById( aOOOElemMetaSlides );
  3861. assert( aMetaDocElem, 'MetaDocument: the svg element with id:' + aOOOElemMetaSlides + 'is not valid.');
  3862. this.nNumberOfSlides = parseInt( aMetaDocElem.getAttributeNS( NSS['ooo'], aOOOAttrNumberOfSlides ) );
  3863. assert( typeof this.nNumberOfSlides == 'number' && this.nNumberOfSlides > 0,
  3864. 'MetaDocument: number of slides is zero or undefined.' );
  3865. this.nStartSlideNumber = parseInt( aMetaDocElem.getAttributeNS( NSS['ooo'], aOOOAttrStartSlideNumber ) ) || 0;
  3866. var aParmStartSlideNumber = getUrlParameter('StartSlideNumber');
  3867. if (aParmStartSlideNumber !== '')
  3868. {
  3869. this.nStartSlideNumber = parseInt(aParmStartSlideNumber);
  3870. }
  3871. this.sPageNumberingType = aMetaDocElem.getAttributeNS( NSS['ooo'], aOOOAttrNumberingType ) || 'arabic';
  3872. this.bIsUsePositionedChars = ( aMetaDocElem.getAttributeNS( NSS['ooo'], aOOOAttrUsePositionedChars ) === 'true' );
  3873. this.aClipPathGroup = getElementByClassName( ROOT_NODE, aClipPathGroupClassName );
  3874. assert( this.aClipPathGroup, 'MetaDocument: the clip path group element is not valid.');
  3875. this.aPresentationClipPath = document.getElementById( aPresentationClipPathId );
  3876. assert( this.aPresentationClipPath,
  3877. 'MetaDocument: the presentation clip path element element is not valid.');
  3878. this.aMetaSlideSet = [];
  3879. this.aMasterPageSet = {};
  3880. this.aTextFieldHandlerSet = {};
  3881. this.aTextFieldContentProviderSet = [];
  3882. this.aSlideNumberProvider = new SlideNumberProvider( this.nStartSlideNumber + 1, this.sPageNumberingType );
  3883. this.aCurrentDateProvider = new CurrentDateTimeProvider( null, '<date>' );
  3884. this.aCurrentTimeProvider = new CurrentDateTimeProvider( null, '<time>' );
  3885. this.bIsAnimated = false;
  3886. this.aSlideAnimationsMap = {};
  3887. this.initSlideAnimationsMap();
  3888. this.theMetaDummySlide = new MetaSlide( 'ooo:meta_dummy_slide', this );
  3889. for( var i = 0; i < this.nNumberOfSlides; ++i )
  3890. {
  3891. var sMetaSlideId = aOOOElemMetaSlide + '_' + i;
  3892. this.aMetaSlideSet.push( new MetaSlide( sMetaSlideId, this ) );
  3893. }
  3894. assert( this.aMetaSlideSet.length == this.nNumberOfSlides,
  3895. 'MetaDocument: aMetaSlideSet.length != nNumberOfSlides.' );
  3896. }
  3897. MetaDocument.prototype =
  3898. {
  3899. getCurrentSlide : function()
  3900. {
  3901. return this.aMetaSlideSet[nCurSlide];
  3902. },
  3903. setCurrentSlide : function( nSlideIndex )
  3904. {
  3905. if( nSlideIndex >= 0 && nSlideIndex < this.nNumberOfSlides )
  3906. {
  3907. if( nCurSlide !== undefined )
  3908. this.aMetaSlideSet[nCurSlide].hide();
  3909. this.aMetaSlideSet[nSlideIndex].show();
  3910. nCurSlide = nSlideIndex;
  3911. }
  3912. else
  3913. {
  3914. log('MetaDocument.setCurrentSlide: slide index out of range: ' + nSlideIndex );
  3915. }
  3916. },
  3917. initSlideAnimationsMap : function()
  3918. {
  3919. var aAnimationsSection = document.getElementById( 'presentation-animations' );
  3920. if( aAnimationsSection )
  3921. {
  3922. var aAnimationsDefSet = aAnimationsSection.getElementsByTagName( 'defs' );
  3923. this.bIsAnimated = ( typeof aAnimationsDefSet.length =='number' &&
  3924. aAnimationsDefSet.length > 0 );
  3925. for( var i = 0; i < aAnimationsDefSet.length; ++i )
  3926. {
  3927. var sSlideId = aAnimationsDefSet[i].getAttributeNS( NSS['ooo'], aOOOAttrSlide );
  3928. var aChildSet = getElementChildren( aAnimationsDefSet[i] );
  3929. if( sSlideId && ( aChildSet.length === 1 ) )
  3930. {
  3931. this.aSlideAnimationsMap[ sSlideId ] = aChildSet[0];
  3932. }
  3933. }
  3934. }
  3935. }
  3936. }; // end MetaDocument prototype
  3937. function MetaSlide( sMetaSlideId, aMetaDoc )
  3938. {
  3939. this.theDocument = document;
  3940. this.id = sMetaSlideId;
  3941. this.theMetaDoc = aMetaDoc;
  3942. this.element = this.theDocument.getElementById( this.id );
  3943. assert( this.element,
  3944. 'MetaSlide: meta_slide element <' + this.id + '> not found.' );
  3945. this.slideId = this.element.getAttributeNS( NSS['ooo'], aOOOAttrSlide );
  3946. this.slideElement = this.theDocument.getElementById( this.slideId );
  3947. assert( this.slideElement,
  3948. 'MetaSlide: slide element <' + this.slideId + '> not found.' );
  3949. if( this.slideId !== 'dummy_slide' )
  3950. this.nSlideNumber = parseInt( this.slideId.substr(2) );
  3951. else
  3952. this.nSlideNumber= -1;
  3953. this.slideName = this.element.getAttributeNS( NSS['ooo'], aOOOAttrDisplayName );
  3954. this.aContainerElement = this.slideElement.parentNode;
  3955. this.slideContainerId = this.aContainerElement.getAttribute( 'id' );
  3956. this.aVisibilityStatusElement = this.aContainerElement.parentNode;
  3957. this.pageElement = getElementByClassName( this.slideElement, aPageClassName );
  3958. assert( this.pageElement,
  3959. 'MetaSlide: page element <' + this.slideId + '> not found.' );
  3960. this.backgroundElement = getElementByClassName( this.pageElement, 'Background' );
  3961. if( this.backgroundElement )
  3962. {
  3963. this.backgroundId = this.backgroundElement.getAttribute( 'id' );
  3964. }
  3965. this.initPlaceholderElements();
  3966. this.masterPage = this.initMasterPage();
  3967. this.bHasCustomBackground = this.initHasCustomBackground();
  3968. this.nAreMasterObjectsVisible = this.initVisibilityProperty( aOOOAttrMasterObjectsVisibility, VISIBLE );
  3969. this.nIsBackgroundVisible = this.initVisibilityProperty( aOOOAttrBackgroundVisibility, VISIBLE );
  3970. this.nIsPageNumberVisible = this.initVisibilityProperty( aOOOAttrPageNumberVisibility, HIDDEN );
  3971. this.nIsDateTimeVisible = this.initVisibilityProperty( aOOOAttrDateTimeVisibility, VISIBLE );
  3972. this.nIsFooterVisible = this.initVisibilityProperty( aOOOAttrFooterVisibility, VISIBLE );
  3973. this.nIsHeaderVisible = this.initVisibilityProperty( aOOOAttrHeaderVisibility, VISIBLE );
  3974. this.bIsDateTimeVariable = undefined;
  3975. this.aTextFieldContentProviderSet = {};
  3976. this.aTextFieldContentProviderSet[aSlideNumberClassName] = this.initSlideNumberFieldContentProvider();
  3977. this.aTextFieldContentProviderSet[aDateTimeClassName] = this.initDateTimeFieldContentProvider( aOOOAttrDateTimeField );
  3978. this.aTextFieldContentProviderSet[aFooterClassName] = this.initFixedTextFieldContentProvider( aOOOAttrFooterField );
  3979. this.aTextFieldContentProviderSet[aHeaderClassName] = this.initFixedTextFieldContentProvider( aOOOAttrHeaderField );
  3980. this.aTextFieldContentProviderSet[aDateClassName] = this.theMetaDoc.aCurrentDateProvider;
  3981. this.aTextFieldContentProviderSet[aTimeClassName] = this.theMetaDoc.aCurrentTimeProvider;
  3982. this.aTextFieldContentProviderSet[aSlideNameClassName] = new FixedTextProvider( this.slideName );
  3983. this.fDuration = this.initSlideDuration();
  3984. this.aTransitionHandler = null;
  3985. this.bHasTransition = this.initHasTransition() || true;
  3986. if( this.bHasTransition )
  3987. {
  3988. this.aTransitionHandler = new SlideTransition( this.getSlideAnimationsRoot(), this.slideId );
  3989. }
  3990. this.aSlideAnimationsHandler = new SlideAnimations( aSlideShow.getContext() );
  3991. this.aSlideAnimationsHandler.importAnimations( this.getSlideAnimationsRoot() );
  3992. this.aSlideAnimationsHandler.parseElements();
  3993. if( false && this.aSlideAnimationsHandler.aRootNode )
  3994. log( this.aSlideAnimationsHandler.aRootNode.info( true ) );
  3995. this.aTextShapeSet = this.collectTextShapes();
  3996. this.aHyperlinkSet = this.initHyperlinks();
  3997. }
  3998. MetaSlide.prototype =
  3999. {
  4000. show : function()
  4001. {
  4002. this.updateMasterPageView();
  4003. this.aVisibilityStatusElement.setAttribute( 'visibility', 'inherit' );
  4004. },
  4005. hide : function()
  4006. {
  4007. this.aVisibilityStatusElement.setAttribute( 'visibility', 'hidden' );
  4008. },
  4009. updateMasterPageView : function()
  4010. {
  4011. if( !this.aMasterPageView )
  4012. {
  4013. this.aMasterPageView = new MasterPageView( this );
  4014. this.aMasterPageView.attachToSlide();
  4015. }
  4016. this.aMasterPageView.update();
  4017. },
  4018. initPlaceholderElements : function()
  4019. {
  4020. var aPlaceholderList = getElementsByClassName(this.pageElement , 'PlaceholderText' );
  4021. var i = 0;
  4022. for( ; i < aPlaceholderList.length; ++i )
  4023. {
  4024. var aPlaceholderElem = aPlaceholderList[i];
  4025. var sClass = aPlaceholderElem.getAttribute('class');
  4026. var sFieldType = sClass.split(' ')[1];
  4027. if( sFieldType === aDateClassName)
  4028. aPlaceholderElem.textContent = new Date().toLocaleDateString();
  4029. else if( sFieldType === aTimeClassName )
  4030. aPlaceholderElem.textContent = new Date().toLocaleTimeString();
  4031. }
  4032. },
  4033. initMasterPage : function()
  4034. {
  4035. var sMasterPageId = this.element.getAttributeNS( NSS['ooo'], aOOOAttrMaster );
  4036. if( !this.theMetaDoc.aMasterPageSet.hasOwnProperty( sMasterPageId ) )
  4037. {
  4038. this.theMetaDoc.aMasterPageSet[ sMasterPageId ] = new MasterPage( sMasterPageId, this );
  4039. this.theMetaDoc.aTextFieldHandlerSet[ sMasterPageId ] = {};
  4040. }
  4041. return this.theMetaDoc.aMasterPageSet[ sMasterPageId ];
  4042. },
  4043. initSlideDuration : function()
  4044. {
  4045. var sSlideDuration = this.element.getAttributeNS( NSS['ooo'], aOOOAttrSlideDuration );
  4046. if( sSlideDuration && sSlideDuration.length > 0 )
  4047. return parseFloat( sSlideDuration );
  4048. else
  4049. return -1;
  4050. },
  4051. initHasTransition : function()
  4052. {
  4053. var sHasTransition = this.element.getAttributeNS( NSS['ooo'], aOOOAttrHasTransition );
  4054. return ( sHasTransition === 'true' );
  4055. },
  4056. initHasCustomBackground : function()
  4057. {
  4058. var sHasCustomBackground = this.element.getAttributeNS( NSS['ooo'], aOOOAttrHasCustomBackground );
  4059. return ( sHasCustomBackground === 'true' );
  4060. },
  4061. initVisibilityProperty : function( aVisibilityAttribute, nDefaultValue )
  4062. {
  4063. var nVisibility = nDefaultValue;
  4064. var sVisibility = getOOOAttribute( this.element, aVisibilityAttribute );
  4065. if( sVisibility )
  4066. nVisibility = aVisibilityValue[ sVisibility ];
  4067. return nVisibility;
  4068. },
  4069. initSlideNumberFieldContentProvider : function()
  4070. {
  4071. return this.theMetaDoc.aSlideNumberProvider;
  4072. },
  4073. initDateTimeFieldContentProvider : function( aOOOAttrDateTimeField )
  4074. {
  4075. var sTextFieldId = getOOOAttribute( this.element, aOOOAttrDateTimeField );
  4076. if( !sTextFieldId ) return null;
  4077. var nLength = aOOOElemTextField.length + 1;
  4078. var nIndex = parseInt(sTextFieldId.substring( nLength ) );
  4079. if( typeof nIndex != 'number') return null;
  4080. if( !this.theMetaDoc.aTextFieldContentProviderSet[ nIndex ] )
  4081. {
  4082. var aTextField;
  4083. var aTextFieldElem = document.getElementById( sTextFieldId );
  4084. var sClassName = getClassAttribute( aTextFieldElem );
  4085. if( sClassName == 'FixedDateTimeField' )
  4086. {
  4087. aTextField = new FixedTextByElementProvider( aTextFieldElem );
  4088. this.bIsDateTimeVariable = false;
  4089. }
  4090. else if( sClassName == 'VariableDateTimeField' )
  4091. {
  4092. aTextField = new CurrentDateTimeProvider( aTextFieldElem );
  4093. this.bIsDateTimeVariable = true;
  4094. }
  4095. else
  4096. {
  4097. aTextField = null;
  4098. }
  4099. this.theMetaDoc.aTextFieldContentProviderSet[ nIndex ] = aTextField;
  4100. }
  4101. return this.theMetaDoc.aTextFieldContentProviderSet[ nIndex ];
  4102. },
  4103. initFixedTextFieldContentProvider : function( aOOOAttribute )
  4104. {
  4105. var sTextFieldId = getOOOAttribute( this.element, aOOOAttribute );
  4106. if( !sTextFieldId ) return null;
  4107. var nLength = aOOOElemTextField.length + 1;
  4108. var nIndex = parseInt( sTextFieldId.substring( nLength ) );
  4109. if( typeof nIndex != 'number') return null;
  4110. if( !this.theMetaDoc.aTextFieldContentProviderSet[ nIndex ] )
  4111. {
  4112. var aTextFieldElem = document.getElementById( sTextFieldId );
  4113. this.theMetaDoc.aTextFieldContentProviderSet[ nIndex ]
  4114. = new FixedTextByElementProvider( aTextFieldElem );
  4115. }
  4116. return this.theMetaDoc.aTextFieldContentProviderSet[ nIndex ];
  4117. },
  4118. collectTextShapes : function()
  4119. {
  4120. var aTextShapeSet = [];
  4121. var aTextShapeIndexElem = getElementByClassName( document, 'TextShapeIndex' );
  4122. if( aTextShapeIndexElem )
  4123. {
  4124. var aIndexEntryList = getElementChildren( aTextShapeIndexElem );
  4125. var i;
  4126. for( i = 0; i < aIndexEntryList.length; ++i )
  4127. {
  4128. var sSlideId = getOOOAttribute( aIndexEntryList[i], 'slide' );
  4129. if( sSlideId === this.slideId )
  4130. {
  4131. var sTextShapeIds = getOOOAttribute( aIndexEntryList[i], 'id-list' );
  4132. if( sTextShapeIds )
  4133. {
  4134. var aTextShapeIdSet = sTextShapeIds.split( ' ' );
  4135. var j;
  4136. for( j = 0; j < aTextShapeIdSet.length; ++j )
  4137. {
  4138. var aTextShapeElem = document.getElementById( aTextShapeIdSet[j] );
  4139. if( aTextShapeElem )
  4140. {
  4141. aTextShapeSet.push( aTextShapeElem );
  4142. }
  4143. else
  4144. {
  4145. log( 'warning: MetaSlide.collectTextShapes: text shape with id <' + aTextShapeIdSet[j] + '> is not valid.' );
  4146. }
  4147. }
  4148. }
  4149. break;
  4150. }
  4151. }
  4152. }
  4153. return aTextShapeSet;
  4154. },
  4155. initHyperlinks : function()
  4156. {
  4157. var aHyperlinkSet = {};
  4158. var i;
  4159. for( i = 0; i < this.aTextShapeSet.length; ++i )
  4160. {
  4161. if( this.aTextShapeSet[i] )
  4162. {
  4163. var aHyperlinkIdList = getElementByClassName( this.aTextShapeSet[i], 'HyperlinkIdList' );
  4164. if( aHyperlinkIdList )
  4165. {
  4166. var sHyperlinkIds = aHyperlinkIdList.textContent;
  4167. if( sHyperlinkIds )
  4168. {
  4169. var aHyperlinkIdSet = sHyperlinkIds.trim().split( ' ' );
  4170. var j;
  4171. for( j = 0; j < aHyperlinkIdSet.length; ++j )
  4172. {
  4173. var sId = aHyperlinkIdSet[j];
  4174. aHyperlinkSet[ sId ] = new HyperlinkElement( sId, this.aSlideAnimationsHandler.aEventMultiplexer );
  4175. }
  4176. }
  4177. }
  4178. }
  4179. }
  4180. return aHyperlinkSet;
  4181. },
  4182. getSlideAnimationsRoot : function()
  4183. {
  4184. return this.theMetaDoc.aSlideAnimationsMap[ this.slideId ];
  4185. }
  4186. }; // end MetaSlide prototype
  4187. function removeRedundantParagraphFromTextFieldShape( aObject )
  4188. {
  4189. var aTextElem = getElementByClassName( aObject, 'SVGTextShape' );
  4190. if( aTextElem )
  4191. {
  4192. var aPlaceholderElement = getElementsByClassName(aTextElem, 'PlaceholderText');
  4193. if( aPlaceholderElement )
  4194. {
  4195. var aTextParagraphSet = getElementsByClassName(aTextElem, 'TextParagraph');
  4196. if( aTextParagraphSet.length > 1 )
  4197. {
  4198. var i = aTextParagraphSet.length;
  4199. while( i > 1 )
  4200. {
  4201. aTextElem.removeChild(aTextParagraphSet[i - 1]);
  4202. --i;
  4203. }
  4204. }
  4205. }
  4206. }
  4207. }
  4208. function getTextFieldType ( elem ) {
  4209. var sFieldType = null;
  4210. var sClass = elem.getAttribute('class');
  4211. if( sClass === 'TextShape' )
  4212. {
  4213. var aPlaceholderElement = getElementByClassName(elem, 'PlaceholderText');
  4214. if( aPlaceholderElement )
  4215. {
  4216. var sClassAttr = aPlaceholderElement.getAttribute('class');
  4217. var classes = sClassAttr.split(' ');
  4218. sFieldType = classes[1];
  4219. }
  4220. }
  4221. return sFieldType;
  4222. }
  4223. function isTextFieldByClassName ( sClassName )
  4224. {
  4225. return sClassName.indexOf( aDateTimeClassName ) == 0 || sClassName.indexOf( aFooterClassName ) == 0
  4226. || sClassName.indexOf( aHeaderClassName ) == 0 || sClassName.indexOf( aSlideNumberClassName ) == 0
  4227. || sClassName.indexOf( aDateClassName ) == 0 || sClassName.indexOf( aTimeClassName ) == 0
  4228. || sClassName.indexOf( aSlideNameClassName ) == 0;
  4229. }
  4230. function MasterPage( sMasterPageId, aMetaSlide )
  4231. {
  4232. this.id = sMasterPageId;
  4233. this.metaSlide = aMetaSlide;
  4234. this.element = document.getElementById( this.id );
  4235. assert( this.element,
  4236. 'MasterPage: master page element <' + this.id + '> not found.' );
  4237. this.background = getElementByClassName( this.element, 'Background' );
  4238. if( this.background )
  4239. {
  4240. this.backgroundId = this.background.getAttribute( 'id' );
  4241. this.backgroundVisibility = initVisibilityProperty( this.background );
  4242. }
  4243. else
  4244. {
  4245. this.backgroundId = '';
  4246. log( 'MasterPage: the background element is not valid.' );
  4247. }
  4248. this.backgroundObjects = getElementByClassName( this.element, 'BackgroundObjects' );
  4249. this.aBackgroundObjectSubGroupIdList = [];
  4250. if( this.backgroundObjects )
  4251. {
  4252. this.backgroundObjectsId = this.backgroundObjects.getAttribute( 'id' );
  4253. this.backgroundObjectsVisibility = initVisibilityProperty( this.backgroundObjects );
  4254. if( this.backgroundObjectsVisibility != HIDDEN )
  4255. {
  4256. var aBackgroundObjectList = getElementChildren( this.backgroundObjects );
  4257. var nFrom = 0;
  4258. var nCount = 0;
  4259. var nSubGroupId = 1;
  4260. var sClass;
  4261. var sId = '';
  4262. var i = 0;
  4263. for( ; i < aBackgroundObjectList.length; ++i )
  4264. {
  4265. var aObject = aBackgroundObjectList[i];
  4266. removeRedundantParagraphFromTextFieldShape( aObject );
  4267. sClass = null;
  4268. var sFieldType = getTextFieldType( aObject );
  4269. if( sFieldType && aObject.firstElementChild )
  4270. {
  4271. var sObjId = aObject.firstElementChild.getAttribute( 'id' );
  4272. if( sObjId )
  4273. {
  4274. sClass = sFieldType + '.' + sObjId;
  4275. aObject.setAttribute('class', sClass);
  4276. }
  4277. }
  4278. if( !sClass )
  4279. {
  4280. sClass = aBackgroundObjectList[i].getAttribute('class');
  4281. if( sClass === aDateTimeClassName || sClass === aFooterClassName
  4282. || sClass === aHeaderClassName || sClass === aSlideNumberClassName)
  4283. {
  4284. sClass += '.Default';
  4285. aObject.setAttribute('class', sClass);
  4286. }
  4287. }
  4288. if( !sClass || !isTextFieldByClassName( sClass ) )
  4289. {
  4290. if( nCount === 0 )
  4291. {
  4292. nFrom = i;
  4293. sId = this.backgroundObjectsId + '.' + nSubGroupId;
  4294. ++nSubGroupId;
  4295. this.aBackgroundObjectSubGroupIdList.push( sId );
  4296. }
  4297. ++nCount;
  4298. }
  4299. else
  4300. {
  4301. this.aBackgroundObjectSubGroupIdList.push( sClass );
  4302. if( nCount !== 0 )
  4303. {
  4304. createElementGroup( this.backgroundObjects, aBackgroundObjectList, nFrom, nCount, 'BackgroundObjectSubgroup', sId );
  4305. nCount = 0;
  4306. }
  4307. }
  4308. }
  4309. if( nCount !== 0 )
  4310. {
  4311. createElementGroup( this.backgroundObjects, aBackgroundObjectList, nFrom, nCount, 'BackgroundObjectSubgroup', sId );
  4312. }
  4313. }
  4314. }
  4315. else
  4316. {
  4317. this.backgroundObjectsId = '';
  4318. log( 'MasterPage: the background objects element is not valid.' );
  4319. }
  4320. this.aPlaceholderShapeSet = {};
  4321. this.initPlaceholderShapes();
  4322. }
  4323. MasterPage.prototype =
  4324. {
  4325. initPlaceholderShapes : function()
  4326. {
  4327. var sClassName;
  4328. var i = 0;
  4329. for( ; i < this.aBackgroundObjectSubGroupIdList.length; ++i )
  4330. {
  4331. sClassName = this.aBackgroundObjectSubGroupIdList[i];
  4332. if( isTextFieldByClassName( sClassName ) )
  4333. this.aPlaceholderShapeSet[ sClassName ] = new PlaceholderShape( this, sClassName );
  4334. }
  4335. }
  4336. }; // end MasterPage prototype
  4337. function PlaceholderShape( aMasterPage, sClassName )
  4338. {
  4339. this.masterPage = aMasterPage;
  4340. this.className = sClassName;
  4341. this.element = null;
  4342. this.textElement = null;
  4343. this.init();
  4344. }
  4345. PlaceholderShape.prototype.isValid = function()
  4346. {
  4347. return ( this.element && this.textElement );
  4348. };
  4349. PlaceholderShape.prototype.init = function()
  4350. {
  4351. var aTextFieldElement = getElementByClassName( this.masterPage.backgroundObjects, this.className );
  4352. if( aTextFieldElement )
  4353. {
  4354. var aTextElem = getElementByClassName( aTextFieldElement, 'SVGTextShape' );
  4355. if( aTextElem )
  4356. {
  4357. var aPlaceholderElement = getElementByClassName(aTextElem, 'PlaceholderText');
  4358. if( aPlaceholderElement )
  4359. {
  4360. var aSVGRectElem = getElementByClassName( aTextFieldElement, 'BoundingBox' );
  4361. if( aSVGRectElem )
  4362. {
  4363. var aRect = new Rectangle( aSVGRectElem );
  4364. var sTextAdjust = getOOOAttribute( aTextFieldElement, aOOOAttrTextAdjust );
  4365. var nMargin = 250; // 1000th mm
  4366. var sTextAnchor, sX;
  4367. if( sTextAdjust == 'left' )
  4368. {
  4369. sTextAnchor = 'start';
  4370. sX = String( Math.trunc( aRect.left + nMargin ) );
  4371. }
  4372. else if( sTextAdjust == 'right' )
  4373. {
  4374. sTextAnchor = 'end';
  4375. sX = String( Math.trunc( aRect.right - nMargin ) );
  4376. }
  4377. else if( sTextAdjust == 'center' )
  4378. {
  4379. sTextAnchor = 'middle';
  4380. var nMiddle = ( aRect.left + aRect.right ) / 2;
  4381. sX = String( parseInt( String( nMiddle ) ) );
  4382. }
  4383. if( sTextAnchor )
  4384. {
  4385. aTextElem.setAttribute( 'text-anchor', sTextAnchor );
  4386. if( sX )
  4387. aTextElem.setAttribute( 'x', sX );
  4388. var aTSpanElements = getElementsByClassName( aTextElem, 'TextPosition' );
  4389. if( aTSpanElements )
  4390. {
  4391. var i = 0;
  4392. for( ; i < aTSpanElements.length; ++i )
  4393. {
  4394. var aTSpanElem = aTSpanElements[i];
  4395. aTSpanElem.removeAttribute( 'x' );
  4396. if( i !== 0 )
  4397. aTSpanElem.removeAttribute( 'y' );
  4398. }
  4399. }
  4400. }
  4401. }
  4402. if( this.masterPage.metaSlide.theMetaDoc.bIsUsePositionedChars )
  4403. {
  4404. var aTextLineGroupElem = aPlaceholderElement.parentNode.parentNode;
  4405. if( aTextLineGroupElem )
  4406. {
  4407. var sFontFamilyAttr = aTextLineGroupElem.getAttribute( 'font-family' );
  4408. if( sFontFamilyAttr )
  4409. {
  4410. var aChildSet = getElementChildren( aTextLineGroupElem );
  4411. if( aChildSet.length > 1 )
  4412. var i = 1;
  4413. for( ; i < aChildSet.length; ++i )
  4414. {
  4415. aTextLineGroupElem.removeChild( aChildSet[i] );
  4416. }
  4417. }
  4418. }
  4419. }
  4420. this.textElement = aPlaceholderElement;
  4421. }
  4422. }
  4423. this.element = aTextFieldElement;
  4424. }
  4425. };
  4426. function MasterPageView( aMetaSlide )
  4427. {
  4428. this.aMetaSlide = aMetaSlide;
  4429. this.aSlideElement = aMetaSlide.slideElement;
  4430. this.aPageElement = aMetaSlide.pageElement;
  4431. this.aMasterPage = aMetaSlide.masterPage;
  4432. this.aMPVElement = this.createElement();
  4433. this.bIsAttached = false;
  4434. }
  4435. MasterPageView.prototype.attachToSlide = function()
  4436. {
  4437. if( !this.bIsAttached )
  4438. {
  4439. var aInsertedElement = this.aSlideElement.insertBefore( this.aMPVElement, this.aPageElement );
  4440. assert( aInsertedElement === this.aMPVElement,
  4441. 'MasterPageView.attachToSlide: aInsertedElement != this.aMPVElement' );
  4442. this.bIsAttached = true;
  4443. }
  4444. };
  4445. MasterPageView.prototype.detachFromSlide = function()
  4446. {
  4447. if( this.bIsAttached )
  4448. {
  4449. this.aSlideElement.removeChild( this.aMPVElement );
  4450. this.bIsAttached = false;
  4451. }
  4452. };
  4453. MasterPageView.prototype.update = function()
  4454. {
  4455. if( this.aDateTimeFieldHandler && this.aMetaSlide.bIsDateTimeVariable )
  4456. this.aDateTimeFieldHandler.update();
  4457. };
  4458. MasterPageView.prototype.createElement = function()
  4459. {
  4460. var theDocument = document;
  4461. var aMasterPageViewElement = theDocument.createElementNS( NSS['svg'], 'g' );
  4462. assert( aMasterPageViewElement,
  4463. 'MasterPageView.createElement: failed to create a master page view element.' );
  4464. aMasterPageViewElement.setAttribute( 'class', 'MasterPageView' );
  4465. var aWhiteRect = theDocument.createElementNS( NSS['svg'], 'rect' );
  4466. var nWidthExt = WIDTH / 1000;
  4467. var nHeightExt = HEIGHT / 1000;
  4468. aWhiteRect.setAttribute( 'x', String( -nWidthExt / 2 ) );
  4469. aWhiteRect.setAttribute( 'y', String( -nHeightExt / 2 ) );
  4470. aWhiteRect.setAttribute( 'width', String( WIDTH + nWidthExt ) );
  4471. aWhiteRect.setAttribute( 'height', String( HEIGHT + nHeightExt ) );
  4472. aWhiteRect.setAttribute( 'fill', '#FFFFFF' );
  4473. aMasterPageViewElement.appendChild( aWhiteRect );
  4474. if( this.aMetaSlide.nIsBackgroundVisible )
  4475. {
  4476. var nBackgroundId = this.aMetaSlide.bHasCustomBackground ? this.aMetaSlide.backgroundId : this.aMasterPage.backgroundId;
  4477. this.aBackgroundElement = theDocument.createElementNS( NSS['svg'], 'use' );
  4478. this.aBackgroundElement.setAttribute( 'class', 'Background' );
  4479. setNSAttribute( 'xlink', this.aBackgroundElement,
  4480. 'href', '#' + nBackgroundId );
  4481. aMasterPageViewElement.appendChild( this.aBackgroundElement );
  4482. }
  4483. if( this.aMetaSlide.nAreMasterObjectsVisible )
  4484. {
  4485. this.aBackgroundObjectsElement = theDocument.createElementNS( NSS['svg'], 'g' );
  4486. this.aBackgroundObjectsElement.setAttribute( 'class', 'BackgroundObjects' );
  4487. var aBackgroundObjectSubGroupIdList = this.aMasterPage.aBackgroundObjectSubGroupIdList;
  4488. this.aBackgroundSubGroupElementSet = [];
  4489. var aPlaceholderShapeSet = this.aMasterPage.aPlaceholderShapeSet;
  4490. var aTextFieldContentProviderSet = this.aMetaSlide.aTextFieldContentProviderSet;
  4491. var aDefsElement = this.aMetaSlide.element.parentNode;
  4492. var aTextFieldHandlerSet = this.aMetaSlide.theMetaDoc.aTextFieldHandlerSet;
  4493. var sMasterSlideId = this.aMasterPage.id;
  4494. var i = 0;
  4495. var sId;
  4496. for( ; i < aBackgroundObjectSubGroupIdList.length; ++i )
  4497. {
  4498. sId = aBackgroundObjectSubGroupIdList[i];
  4499. if( sId.indexOf( aSlideNumberClassName ) == 0 )
  4500. {
  4501. var nIsPageNumberVisible = sId === (aSlideNumberClassName + '.Default') ? this.aMetaSlide.nIsPageNumberVisible : true;
  4502. if( aPlaceholderShapeSet[sId] &&
  4503. aPlaceholderShapeSet[sId].isValid() &&
  4504. nIsPageNumberVisible &&
  4505. aTextFieldContentProviderSet[aSlideNumberClassName] )
  4506. {
  4507. var aSlideNumberFieldHandler =
  4508. new SlideNumberFieldHandler( aPlaceholderShapeSet[sId],
  4509. aTextFieldContentProviderSet[aSlideNumberClassName] );
  4510. aSlideNumberFieldHandler.update( this.aMetaSlide.nSlideNumber );
  4511. aSlideNumberFieldHandler.appendTo( this.aBackgroundObjectsElement );
  4512. if ( sId === aSlideNumberClassName + '.Default' )
  4513. this.aSlideNumberFieldHandler = aSlideNumberFieldHandler;
  4514. }
  4515. }
  4516. else if( sId === aDateTimeClassName + '.Default' )
  4517. {
  4518. if( this.aMetaSlide.nIsDateTimeVisible )
  4519. {
  4520. this.aDateTimeFieldHandler =
  4521. this.initTextFieldHandler( sId, aPlaceholderShapeSet,
  4522. aTextFieldContentProviderSet, aDefsElement,
  4523. aTextFieldHandlerSet, sMasterSlideId );
  4524. }
  4525. }
  4526. else if( sId === aFooterClassName + '.Default' )
  4527. {
  4528. if( this.aMetaSlide.nIsFooterVisible )
  4529. {
  4530. this.aFooterFieldHandler =
  4531. this.initTextFieldHandler( sId, aPlaceholderShapeSet,
  4532. aTextFieldContentProviderSet, aDefsElement,
  4533. aTextFieldHandlerSet, sMasterSlideId );
  4534. }
  4535. }
  4536. else if( sId === aHeaderClassName + '.Default' )
  4537. {
  4538. if( this.aMetaSlide.nIsHeaderVisible )
  4539. {
  4540. this.aHeaderFieldHandler =
  4541. this.initTextFieldHandler( sId, aPlaceholderShapeSet,
  4542. aTextFieldContentProviderSet, aDefsElement,
  4543. aTextFieldHandlerSet, sMasterSlideId );
  4544. }
  4545. }
  4546. else if( sId.indexOf( aDateTimeClassName ) == 0
  4547. || sId.indexOf( aFooterClassName ) == 0
  4548. || sId.indexOf( aHeaderClassName ) == 0
  4549. || sId.indexOf( aDateClassName ) == 0
  4550. || sId.indexOf( aTimeClassName ) == 0
  4551. || sId.indexOf( aSlideNameClassName ) == 0 )
  4552. {
  4553. this.initTextFieldHandler( sId, aPlaceholderShapeSet,
  4554. aTextFieldContentProviderSet, aDefsElement,
  4555. aTextFieldHandlerSet, sMasterSlideId );
  4556. }
  4557. else
  4558. {
  4559. var aBackgroundSubGroupElement = theDocument.createElementNS( NSS['svg'], 'use' );
  4560. aBackgroundSubGroupElement.setAttribute( 'class', 'BackgroundObjectSubGroup' );
  4561. setNSAttribute( 'xlink', aBackgroundSubGroupElement,
  4562. 'href', '#' + sId );
  4563. this.aBackgroundSubGroupElementSet.push( aBackgroundSubGroupElement );
  4564. this.aBackgroundObjectsElement.appendChild( aBackgroundSubGroupElement );
  4565. }
  4566. }
  4567. aMasterPageViewElement.appendChild( this.aBackgroundObjectsElement );
  4568. }
  4569. return aMasterPageViewElement;
  4570. };
  4571. MasterPageView.prototype.initTextFieldHandler =
  4572. function( sId, aPlaceholderShapeSet, aTextFieldContentProviderSet,
  4573. aDefsElement, aTextFieldHandlerSet, sMasterSlideId )
  4574. {
  4575. var sRefId = null;
  4576. var aTextFieldHandler = null;
  4577. var sClassName = sId.split('.')[0];
  4578. var aPlaceholderShape = aPlaceholderShapeSet[sId];
  4579. var aTextFieldContentProvider = aTextFieldContentProviderSet[sClassName];
  4580. if( aPlaceholderShape && aPlaceholderShape.isValid()
  4581. && aTextFieldContentProvider )
  4582. {
  4583. var sTextFiedHandlerKey = aTextFieldContentProvider.sId + '.' + sId;
  4584. if ( !aTextFieldHandlerSet[ sMasterSlideId ][ sTextFiedHandlerKey ] )
  4585. {
  4586. aTextFieldHandlerSet[ sMasterSlideId ][ sTextFiedHandlerKey ] =
  4587. new TextFieldHandler( aPlaceholderShape,
  4588. aTextFieldContentProvider );
  4589. aTextFieldHandler = aTextFieldHandlerSet[ sMasterSlideId ][ sTextFiedHandlerKey ];
  4590. aTextFieldHandler.update();
  4591. aTextFieldHandler.appendTo( aDefsElement );
  4592. }
  4593. else
  4594. {
  4595. aTextFieldHandler = aTextFieldHandlerSet[ sMasterSlideId ][ sTextFiedHandlerKey ];
  4596. }
  4597. sRefId = aTextFieldHandler.sId;
  4598. }
  4599. else if( aPlaceholderShape && aPlaceholderShape.element && aPlaceholderShape.element.firstElementChild
  4600. && !aPlaceholderShape.textElement && !aTextFieldContentProvider )
  4601. {
  4602. sRefId = aPlaceholderShape.element.firstElementChild.getAttribute('id');
  4603. }
  4604. if( sRefId )
  4605. {
  4606. var aTextFieldElement = document.createElementNS(NSS['svg'], 'use');
  4607. aTextFieldElement.setAttribute('class', sClassName);
  4608. setNSAttribute('xlink', aTextFieldElement,
  4609. 'href', '#' + sRefId);
  4610. this.aBackgroundObjectsElement.appendChild( aTextFieldElement );
  4611. }
  4612. return aTextFieldHandler;
  4613. };
  4614. function TextFieldHandler( aPlaceholderShape, aTextContentProvider )
  4615. {
  4616. this.aPlaceHolderShape = aPlaceholderShape;
  4617. this.aTextContentProvider = aTextContentProvider;
  4618. assert( this.aTextContentProvider,
  4619. 'TextFieldHandler: text content provider not defined.' );
  4620. this.sId = 'tf' + String( TextFieldHandler.getUniqueId() );
  4621. this.aTextFieldElement = null;
  4622. this.aTextPlaceholderElement = null;
  4623. this.cloneElement();
  4624. }
  4625. TextFieldHandler.CURR_UNIQUE_ID = 0;
  4626. TextFieldHandler.getUniqueId = function()
  4627. {
  4628. ++TextFieldHandler.CURR_UNIQUE_ID;
  4629. return TextFieldHandler.CURR_UNIQUE_ID;
  4630. };
  4631. TextFieldHandler.prototype.cloneElement = function()
  4632. {
  4633. assert( this.aPlaceHolderShape && this.aPlaceHolderShape.isValid(),
  4634. 'TextFieldHandler.cloneElement: placeholder shape is not valid.' );
  4635. this.aTextFieldElement = this.aPlaceHolderShape.element.cloneNode( true /* deep clone */ );
  4636. assert( this.aTextFieldElement,
  4637. 'TextFieldHandler.cloneElement: aTextFieldElement is not defined' );
  4638. this.aTextFieldElement.setAttribute( 'id', this.sId );
  4639. this.aTextFieldElement.removeAttribute( 'visibility' );
  4640. this.aTextPlaceholderElement = getElementByClassName( this.aTextFieldElement, 'PlaceholderText' );
  4641. assert( this.aTextPlaceholderElement,
  4642. 'TextFieldHandler.cloneElement: aTextPlaceholderElement is not defined' );
  4643. };
  4644. TextFieldHandler.prototype.appendTo = function( aParentNode )
  4645. {
  4646. if( !this.aTextFieldElement )
  4647. {
  4648. log( 'TextFieldHandler.appendTo: aTextFieldElement is not defined' );
  4649. return;
  4650. }
  4651. if( !aParentNode )
  4652. {
  4653. log( 'TextFieldHandler.appendTo: parent node is not defined' );
  4654. return;
  4655. }
  4656. aParentNode.appendChild( this.aTextFieldElement );
  4657. };
  4658. TextFieldHandler.prototype.setTextContent = function( sText )
  4659. {
  4660. if( !this.aTextPlaceholderElement )
  4661. {
  4662. log( 'PlaceholderShape.setTextContent: text element is not valid in placeholder of type '
  4663. + this.className + ' that belongs to master slide ' + this.masterPage.id );
  4664. return;
  4665. }
  4666. this.aTextPlaceholderElement.textContent = sText;
  4667. };
  4668. TextFieldHandler.prototype.update = function()
  4669. {
  4670. if( !this.aTextContentProvider )
  4671. log('TextFieldHandler.update: text content provider not defined.');
  4672. else
  4673. this.aTextContentProvider.update( this );
  4674. };
  4675. function SlideNumberFieldHandler( aPlaceholderShape, aTextContentProvider )
  4676. {
  4677. SlideNumberFieldHandler.superclass.constructor.call( this, aPlaceholderShape, aTextContentProvider );
  4678. }
  4679. extend( SlideNumberFieldHandler, TextFieldHandler );
  4680. SlideNumberFieldHandler.prototype.update = function( nPageNumber )
  4681. {
  4682. if( !this.aTextContentProvider )
  4683. log('TextFieldHandler.update: text content provider not defined.');
  4684. else
  4685. this.aTextContentProvider.update( this, nPageNumber );
  4686. };
  4687. function TextFieldContentProvider()
  4688. {
  4689. this.sId = TextFieldContentProvider.getUniqueId();
  4690. }
  4691. TextFieldContentProvider.CURR_UNIQUE_ID = 0;
  4692. TextFieldContentProvider.getUniqueId = function()
  4693. {
  4694. ++TextFieldContentProvider.CURR_UNIQUE_ID;
  4695. return TextFieldContentProvider.CURR_UNIQUE_ID;
  4696. };
  4697. function FixedTextProvider( aText )
  4698. {
  4699. FixedTextProvider.superclass.constructor.call( this );
  4700. this.text = aText;
  4701. }
  4702. extend( FixedTextProvider, TextFieldContentProvider );
  4703. FixedTextProvider.prototype.update = function( aFixedTextField )
  4704. {
  4705. aFixedTextField.setTextContent( this.text );
  4706. };
  4707. function FixedTextByElementProvider( aTextFieldContentElement )
  4708. {
  4709. FixedTextByElementProvider.superclass.constructor.call( this, aTextFieldContentElement.textContent );
  4710. }
  4711. extend( FixedTextByElementProvider, FixedTextProvider );
  4712. function CurrentDateTimeProvider( aTextFieldContentElement, sDateTimeFormat )
  4713. {
  4714. CurrentDateTimeProvider.superclass.constructor.call( this, aTextFieldContentElement );
  4715. if( aTextFieldContentElement )
  4716. this.dateTimeFormat = getOOOAttribute( aTextFieldContentElement, aOOOAttrDateTimeFormat );
  4717. else
  4718. {
  4719. this.dateTimeFormat = sDateTimeFormat;
  4720. }
  4721. }
  4722. extend( CurrentDateTimeProvider, TextFieldContentProvider );
  4723. CurrentDateTimeProvider.prototype.update = function( aDateTimeField )
  4724. {
  4725. var sText = this.createDateTimeText();
  4726. aDateTimeField.setTextContent( sText );
  4727. };
  4728. CurrentDateTimeProvider.prototype.createDateTimeText = function()
  4729. {
  4730. var sDate;
  4731. if( this.dateTimeFormat === '<date>' )
  4732. sDate = new Date().toLocaleDateString();
  4733. else if( this.dateTimeFormat === '<time>' )
  4734. sDate = new Date().toLocaleTimeString();
  4735. else
  4736. sDate = new Date().toLocaleDateString();
  4737. return sDate;
  4738. };
  4739. function SlideNumberProvider( nInitialSlideNumber, sPageNumberingType )
  4740. {
  4741. SlideNumberProvider.superclass.constructor.call( this );
  4742. this.nInitialSlideNumber = nInitialSlideNumber;
  4743. this.pageNumberingType = sPageNumberingType;
  4744. }
  4745. extend( SlideNumberProvider, TextFieldContentProvider );
  4746. SlideNumberProvider.prototype.getNumberingType = function()
  4747. {
  4748. return this.pageNumberingType;
  4749. };
  4750. SlideNumberProvider.prototype.update = function( aSlideNumberField, nSlideNumber )
  4751. {
  4752. if( nSlideNumber === undefined )
  4753. {
  4754. if( nCurSlide === undefined )
  4755. nSlideNumber = this.nInitialSlideNumber;
  4756. else
  4757. nSlideNumber = nCurSlide + 1;
  4758. }
  4759. var sText = this.createSlideNumberText( nSlideNumber, this.getNumberingType() );
  4760. aSlideNumberField.setTextContent( sText );
  4761. };
  4762. SlideNumberProvider.prototype.createSlideNumberText = function( nSlideNumber /*, sNumberingType*/ )
  4763. {
  4764. return String( nSlideNumber );
  4765. };
  4766. function SlideIndexPage()
  4767. {
  4768. this.pageElementId = 'slide_index';
  4769. this.pageBgColor = 'rgb(252,252,252)';
  4770. this.pageElement = this.createPageElement();
  4771. assert( this.pageElement, 'SlideIndexPage: pageElement is not valid' );
  4772. this.indexColumns = INDEX_COLUMNS_DEFAULT;
  4773. this.totalThumbnails = this.indexColumns * this.indexColumns;
  4774. this.selectedSlideIndex = undefined;
  4775. this.xSpacingFactor = 600/28000;
  4776. this.ySpacingFactor = 450/21000;
  4777. this.xSpacing = WIDTH * this.xSpacingFactor;
  4778. this.ySpacing = HEIGHT * this.ySpacingFactor;
  4779. this.halfBorderWidthFactor = ( 300/28000 ) * ( this.indexColumns / 3 );
  4780. this.halfBorderWidth = WIDTH * this.halfBorderWidthFactor;
  4781. this.borderWidth = 2 * this.halfBorderWidth;
  4782. this.scaleFactor = ( 1 - ( this.indexColumns + 1 ) * this.xSpacingFactor ) /
  4783. ( this.indexColumns * ( 1 + 2 * this.halfBorderWidthFactor ) );
  4784. this.thumbnailMouseAreaTemplateId = 'thumbnail_mouse_area';
  4785. this.thumbnailMouseAreaTemplateElement = null;
  4786. this.thumbnailBorderTemplateId = 'thumbnail_border';
  4787. this.thumbnailBorderTemplateElement = null;
  4788. this.createTemplateElements();
  4789. this.aThumbnailSet = new Array( this.totalThumbnails );
  4790. for( var i = 0; i < this.totalThumbnails; ++i )
  4791. {
  4792. this.aThumbnailSet[i] = new Thumbnail( this, i );
  4793. this.aThumbnailSet[i].updateView();
  4794. }
  4795. this.curThumbnailIndex = 0;
  4796. }
  4797. SlideIndexPage.prototype.getTotalThumbnails = function()
  4798. {
  4799. return this.totalThumbnails;
  4800. };
  4801. SlideIndexPage.prototype.show = function()
  4802. {
  4803. this.pageElement.setAttribute( 'display', 'inherit' );
  4804. };
  4805. SlideIndexPage.prototype.hide = function()
  4806. {
  4807. this.pageElement.setAttribute( 'display', 'none' );
  4808. };
  4809. SlideIndexPage.prototype.setSelection = function( nIndex )
  4810. {
  4811. nIndex = getSafeIndex( nIndex, 0, this.getTotalThumbnails() - 1 );
  4812. if( this.curThumbnailIndex != nIndex )
  4813. {
  4814. this.aThumbnailSet[ this.curThumbnailIndex ].unselect();
  4815. this.aThumbnailSet[ nIndex ].select();
  4816. this.curThumbnailIndex = nIndex;
  4817. }
  4818. this.selectedSlideIndex = this.aThumbnailSet[ nIndex ].slideIndex;
  4819. };
  4820. SlideIndexPage.prototype.createPageElement = function()
  4821. {
  4822. var aPageElement = document.createElementNS( NSS['svg'], 'g' );
  4823. aPageElement.setAttribute( 'id', this.pageElementId );
  4824. aPageElement.setAttribute( 'display', 'none' );
  4825. aPageElement.setAttribute( 'visibility', 'visible' );
  4826. var sPageBgColor = this.pageBgColor + ';';
  4827. var aRectElement = document.createElementNS( NSS['svg'], 'rect' );
  4828. aRectElement.setAttribute( 'x', 0 );
  4829. aRectElement.setAttribute( 'y', 0 );
  4830. aRectElement.setAttribute( 'width', WIDTH );
  4831. aRectElement.setAttribute( 'height', HEIGHT );
  4832. aRectElement.setAttribute( 'style', 'stroke:none;fill:' + sPageBgColor );
  4833. aPageElement.appendChild( aRectElement );
  4834. ROOT_NODE.appendChild( aPageElement );
  4835. return( document.getElementById( this.pageElementId ) );
  4836. };
  4837. SlideIndexPage.prototype.createTemplateElements = function()
  4838. {
  4839. var aDefsElement = document.createElementNS( NSS['svg'], 'defs' );
  4840. var aRectElement = document.createElementNS( NSS['svg'], 'rect' );
  4841. aRectElement.setAttribute( 'id', this.thumbnailBorderTemplateId );
  4842. aRectElement.setAttribute( 'x', -this.halfBorderWidth );
  4843. aRectElement.setAttribute( 'y', -this.halfBorderWidth );
  4844. aRectElement.setAttribute( 'rx', this.halfBorderWidth );
  4845. aRectElement.setAttribute( 'ry', this.halfBorderWidth );
  4846. aRectElement.setAttribute( 'width', WIDTH + this.halfBorderWidth );
  4847. aRectElement.setAttribute( 'height', HEIGHT + this.halfBorderWidth );
  4848. aRectElement.setAttribute( 'stroke-width', this.borderWidth );
  4849. aRectElement.setAttribute( 'fill', 'none' );
  4850. aDefsElement.appendChild( aRectElement );
  4851. aRectElement = document.createElementNS( NSS['svg'], 'rect' );
  4852. aRectElement.setAttribute( 'id', this.thumbnailMouseAreaTemplateId );
  4853. aRectElement.setAttribute( 'x', 0 );
  4854. aRectElement.setAttribute( 'y', 0 );
  4855. aRectElement.setAttribute( 'width', WIDTH );
  4856. aRectElement.setAttribute( 'height', HEIGHT );
  4857. aRectElement.setAttribute( 'fill', this.pageBgColor );
  4858. aDefsElement.appendChild( aRectElement );
  4859. this.pageElement.appendChild( aDefsElement );
  4860. this.thumbnailMouseAreaTemplateElement = document.getElementById( this.thumbnailMouseAreaTemplateId );
  4861. this.thumbnailBorderTemplateElement = document.getElementById( this.thumbnailBorderTemplateId );
  4862. };
  4863. SlideIndexPage.prototype.decreaseNumberOfColumns = function()
  4864. {
  4865. this.setNumberOfColumns( this.indexColumns - 1 );
  4866. };
  4867. SlideIndexPage.prototype.increaseNumberOfColumns = function()
  4868. {
  4869. this.setNumberOfColumns( this.indexColumns + 1 );
  4870. };
  4871. SlideIndexPage.prototype.resetNumberOfColumns = function()
  4872. {
  4873. this.setNumberOfColumns( INDEX_COLUMNS_DEFAULT );
  4874. };
  4875. SlideIndexPage.prototype.setNumberOfColumns = function( nNumberOfColumns )
  4876. {
  4877. if( this.indexColumns == nNumberOfColumns ) return;
  4878. if( nNumberOfColumns < 2 || nNumberOfColumns > 6 ) return;
  4879. var suspendHandle = ROOT_NODE.suspendRedraw(500);
  4880. var nOldTotalThumbnails = this.totalThumbnails;
  4881. this.indexColumns = nNumberOfColumns;
  4882. this.totalThumbnails = nNumberOfColumns * nNumberOfColumns;
  4883. this.aThumbnailSet[this.curThumbnailIndex].unselect();
  4884. var i;
  4885. for( i = this.totalThumbnails; i < nOldTotalThumbnails; ++i )
  4886. {
  4887. this.aThumbnailSet[i].removeElement();
  4888. }
  4889. for( i = nOldTotalThumbnails; i < this.totalThumbnails; ++i )
  4890. {
  4891. this.aThumbnailSet[i] = new Thumbnail( this, i );
  4892. }
  4893. this.halfBorderWidthFactor = ( 300/28000 ) * ( this.indexColumns / 3 );
  4894. this.halfBorderWidth = WIDTH * this.halfBorderWidthFactor;
  4895. this.borderWidth = 2 * this.halfBorderWidth;
  4896. this.scaleFactor = ( 1 - ( this.indexColumns + 1 ) * this.xSpacingFactor ) /
  4897. ( this.indexColumns * ( 1 + 2 * this.halfBorderWidthFactor ) );
  4898. var aRectElement = this.thumbnailBorderTemplateElement;
  4899. aRectElement.setAttribute( 'x', -this.halfBorderWidth );
  4900. aRectElement.setAttribute( 'y', -this.halfBorderWidth );
  4901. aRectElement.setAttribute( 'rx', this.halfBorderWidth );
  4902. aRectElement.setAttribute( 'ry', this.halfBorderWidth );
  4903. aRectElement.setAttribute( 'width', WIDTH + this.halfBorderWidth );
  4904. aRectElement.setAttribute( 'height', HEIGHT + this.halfBorderWidth );
  4905. aRectElement.setAttribute( 'stroke-width', this.borderWidth );
  4906. for( i = 0; i < this.totalThumbnails; ++i )
  4907. {
  4908. this.aThumbnailSet[i].updateView();
  4909. }
  4910. this.curThumbnailIndex = this.selectedSlideIndex % this.totalThumbnails;
  4911. this.aThumbnailSet[this.curThumbnailIndex].select();
  4912. INDEX_OFFSET = -1;
  4913. indexSetPageSlide( this.selectedSlideIndex );
  4914. ROOT_NODE.unsuspendRedraw( suspendHandle );
  4915. ROOT_NODE.forceRedraw();
  4916. };
  4917. function Thumbnail( aSlideIndexPage, nIndex )
  4918. {
  4919. this.container = aSlideIndexPage;
  4920. this.index = nIndex;//= getSafeIndex( nIndex, 0, this.container.getTotalThumbnails() );
  4921. this.pageElement = this.container.pageElement;
  4922. this.thumbnailId = 'thumbnail' + this.index;
  4923. this.thumbnailElement = this.createThumbnailElement();
  4924. this.slideElement = getElementByClassName( this.thumbnailElement, 'Slide' );
  4925. this.borderElement = getElementByClassName( this.thumbnailElement, 'Border' );
  4926. this.mouseAreaElement = getElementByClassName( this.thumbnailElement, 'MouseArea' );
  4927. this.aTransformSet = new Array( 3 );
  4928. this.visibility = VISIBLE;
  4929. this.isSelected = false;
  4930. }
  4931. Thumbnail.prototype.sNormalBorderColor = 'rgb(216,216,216)';
  4932. Thumbnail.prototype.sSelectionBorderColor = 'rgb(92,92,255)';
  4933. Thumbnail.prototype.removeElement = function()
  4934. {
  4935. if( this.thumbnailElement )
  4936. this.container.pageElement.removeChild( this.thumbnailElement );
  4937. };
  4938. Thumbnail.prototype.show = function()
  4939. {
  4940. if( this.visibility == HIDDEN )
  4941. {
  4942. this.thumbnailElement.setAttribute( 'display', 'inherit' );
  4943. this.visibility = VISIBLE;
  4944. }
  4945. };
  4946. Thumbnail.prototype.hide = function()
  4947. {
  4948. if( this.visibility == VISIBLE )
  4949. {
  4950. this.thumbnailElement.setAttribute( 'display', 'none' );
  4951. this.visibility = HIDDEN;
  4952. }
  4953. };
  4954. Thumbnail.prototype.select = function()
  4955. {
  4956. if( !this.isSelected )
  4957. {
  4958. this.borderElement.setAttribute( 'stroke', this.sSelectionBorderColor );
  4959. this.isSelected = true;
  4960. }
  4961. };
  4962. Thumbnail.prototype.unselect = function()
  4963. {
  4964. if( this.isSelected )
  4965. {
  4966. this.borderElement.setAttribute( 'stroke', this.sNormalBorderColor );
  4967. this.isSelected = false;
  4968. }
  4969. };
  4970. Thumbnail.prototype.updateView = function()
  4971. {
  4972. this.column = this.index % this.container.indexColumns;
  4973. this.row = ( this.index - this.column ) / this.container.indexColumns;
  4974. this.halfBorderWidth = this.container.halfBorderWidth;
  4975. this.borderWidth = this.container.borderWidth;
  4976. this.width = ( WIDTH + this.borderWidth ) * this.container.scaleFactor;
  4977. this.height = ( HEIGHT + this.borderWidth ) * this.container.scaleFactor;
  4978. this.aTransformSet[2] = 'translate(' + this.halfBorderWidth + ' ' + this.halfBorderWidth + ')';
  4979. this.aTransformSet[1] = 'scale(' + this.container.scaleFactor + ')';
  4980. var sTransformAttrValue = this.computeTransform();
  4981. this.thumbnailElement.setAttribute( 'transform', sTransformAttrValue );
  4982. this.mouseAreaElement.setAttribute( 'onmouseover', 'theSlideIndexPage.aThumbnailSet[' + this.index + '].onMouseOver()' );
  4983. };
  4984. Thumbnail.prototype.update = function( nIndex )
  4985. {
  4986. if( this.slideIndex == nIndex ) return;
  4987. var aMetaSlide = theMetaDoc.aMetaSlideSet[nIndex];
  4988. aMetaSlide.updateMasterPageView();
  4989. setNSAttribute( 'xlink', this.slideElement, 'href', '#' + aMetaSlide.slideId );
  4990. this.slideIndex = nIndex;
  4991. };
  4992. Thumbnail.prototype.clear = function( )
  4993. {
  4994. setNSAttribute( 'xlink', this.slideElement, 'href', '' );
  4995. };
  4996. Thumbnail.prototype.createThumbnailElement = function()
  4997. {
  4998. var aThumbnailElement = document.createElementNS( NSS['svg'], 'g' );
  4999. aThumbnailElement.setAttribute( 'id', this.thumbnailId );
  5000. aThumbnailElement.setAttribute( 'display', 'inherit' );
  5001. var aSlideElement = document.createElementNS( NSS['svg'], 'use' );
  5002. setNSAttribute( 'xlink', aSlideElement, 'href', '' );
  5003. aSlideElement.setAttribute( 'class', 'Slide' );
  5004. aThumbnailElement.appendChild( aSlideElement );
  5005. var aMouseAreaElement = document.createElementNS( NSS['svg'], 'use' );
  5006. setNSAttribute( 'xlink', aMouseAreaElement, 'href', '#' + this.container.thumbnailMouseAreaTemplateId );
  5007. aMouseAreaElement.setAttribute( 'class', 'MouseArea' );
  5008. aMouseAreaElement.setAttribute( 'opacity', 0.0 );
  5009. aThumbnailElement.appendChild( aMouseAreaElement );
  5010. var aBorderElement = document.createElementNS( NSS['svg'], 'use' );
  5011. setNSAttribute( 'xlink', aBorderElement, 'href', '#' + this.container.thumbnailBorderTemplateId );
  5012. aBorderElement.setAttribute( 'stroke', this.sNormalBorderColor );
  5013. aBorderElement.setAttribute( 'class', 'Border' );
  5014. aThumbnailElement.appendChild( aBorderElement );
  5015. this.container.pageElement.appendChild( aThumbnailElement );
  5016. return( document.getElementById( this.thumbnailId ) );
  5017. };
  5018. Thumbnail.prototype.computeTransform = function()
  5019. {
  5020. var nXSpacing = this.container.xSpacing;
  5021. var nYSpacing = this.container.ySpacing;
  5022. var nXOffset = nXSpacing + ( this.width + nXSpacing ) * this.column;
  5023. var nYOffset = nYSpacing + ( this.height + nYSpacing ) * this.row;
  5024. this.aTransformSet[0] = 'translate(' + nXOffset + ' ' + nYOffset + ')';
  5025. var sTransform = this.aTransformSet.join( ' ' );
  5026. return sTransform;
  5027. };
  5028. Thumbnail.prototype.onMouseOver = function()
  5029. {
  5030. if( ( currentMode == INDEX_MODE ) && ( this.container.curThumbnailIndex != this.index ) )
  5031. {
  5032. this.container.setSelection( this.index );
  5033. }
  5034. };
  5035. function init()
  5036. {
  5037. var VIEWBOX = ROOT_NODE.getAttribute('viewBox');
  5038. if( VIEWBOX )
  5039. {
  5040. WIDTH = ROOT_NODE.viewBox.animVal.width;
  5041. HEIGHT = ROOT_NODE.viewBox.animVal.height;
  5042. }
  5043. aSlideShow = new SlideShow();
  5044. theMetaDoc = new MetaDocument();
  5045. aSlideShow.bIsEnabled = theMetaDoc.bIsAnimated;
  5046. theSlideIndexPage = new SlideIndexPage();
  5047. aSlideShow.displaySlide( theMetaDoc.nStartSlideNumber, false );
  5048. var hammer = new Hammer(ROOT_NODE);
  5049. hammer.on('swipeleft', function() {
  5050. switchSlide(1, false);
  5051. });
  5052. hammer.on('swiperight', function() {
  5053. switchSlide(-1, false);
  5054. });
  5055. hammer.get('swipe').set({ direction: Hammer.DIRECTION_ALL });
  5056. hammer.on('swipeup', function() {
  5057. aSlideShow.exitSlideShowInApp();
  5058. });
  5059. hammer.on('swipedown', function() {
  5060. aSlideShow.exitSlideShowInApp();
  5061. });
  5062. }
  5063. function presentationEngineStop(message)
  5064. {
  5065. alert( message + '\nThe presentation engine will be stopped' );
  5066. document.onkeydown = null;
  5067. document.onkeypress = null;
  5068. document.onclick = null;
  5069. window.onmousewheel = null;
  5070. }
  5071. function assert( condition, message )
  5072. {
  5073. if (!condition)
  5074. {
  5075. presentationEngineStop( message );
  5076. if (typeof console == 'object')
  5077. console.trace();
  5078. throw new Error( message );
  5079. }
  5080. }
  5081. function dispatchEffects(dir)
  5082. {
  5083. if( dir == 1 )
  5084. {
  5085. var bRet = aSlideShow.nextEffect();
  5086. if( !bRet )
  5087. {
  5088. switchSlide( 1, false );
  5089. }
  5090. }
  5091. else
  5092. {
  5093. switchSlide( dir, false );
  5094. }
  5095. }
  5096. function skipAllEffects()
  5097. {
  5098. var bRet = aSlideShow.skipAllEffects();
  5099. if( !bRet )
  5100. {
  5101. switchSlide( 1, true );
  5102. }
  5103. }
  5104. function skipEffects(dir)
  5105. {
  5106. if( dir == 1 )
  5107. {
  5108. var bRet = aSlideShow.skipPlayingOrNextEffect();
  5109. if( !bRet )
  5110. {
  5111. switchSlide( 1, true );
  5112. }
  5113. }
  5114. else
  5115. {
  5116. switchSlide( dir, true );
  5117. }
  5118. }
  5119. function switchSlide( nOffset, bSkipTransition )
  5120. {
  5121. var nNextSlide = nCurSlide + nOffset;
  5122. aSlideShow.displaySlide( nNextSlide, bSkipTransition );
  5123. }
  5124. function displayIndex( offsetNumber )
  5125. {
  5126. var aMetaSlideSet = theMetaDoc.aMetaSlideSet;
  5127. offsetNumber = getSafeIndex( offsetNumber, 0, aMetaSlideSet.length - 1 );
  5128. var nTotalThumbnails = theSlideIndexPage.getTotalThumbnails();
  5129. var nEnd = Math.min( offsetNumber + nTotalThumbnails, aMetaSlideSet.length);
  5130. var aThumbnailSet = theSlideIndexPage.aThumbnailSet;
  5131. var j = 0;
  5132. for( var i = offsetNumber; i < nEnd; ++i, ++j )
  5133. {
  5134. aThumbnailSet[j].update( i );
  5135. aThumbnailSet[j].show();
  5136. }
  5137. for( ; j < nTotalThumbnails; ++j )
  5138. {
  5139. aThumbnailSet[j].hide();
  5140. }
  5141. if (INDEX_OFFSET != offsetNumber)
  5142. INDEX_OFFSET = offsetNumber;
  5143. }
  5144. function toggleSlideIndex()
  5145. {
  5146. if( currentMode == SLIDE_MODE )
  5147. {
  5148. theMetaDoc.getCurrentSlide().hide();
  5149. INDEX_OFFSET = -1;
  5150. indexSetPageSlide( nCurSlide );
  5151. theSlideIndexPage.show();
  5152. currentMode = INDEX_MODE;
  5153. }
  5154. else if( currentMode == INDEX_MODE )
  5155. {
  5156. theSlideIndexPage.hide();
  5157. var nNewSlide = theSlideIndexPage.selectedSlideIndex;
  5158. aSlideShow.displaySlide( nNewSlide, true );
  5159. currentMode = SLIDE_MODE;
  5160. }
  5161. }
  5162. function abandonIndexMode()
  5163. {
  5164. theSlideIndexPage.selectedSlideIndex = nCurSlide;
  5165. toggleSlideIndex();
  5166. }
  5167. var CURR_UNIQUE_ID = 0;
  5168. function getUniqueId()
  5169. {
  5170. ++CURR_UNIQUE_ID;
  5171. return CURR_UNIQUE_ID;
  5172. }
  5173. function mem_fn( sMethodName )
  5174. {
  5175. return function( aObject )
  5176. {
  5177. var aMethod = aObject[ sMethodName ];
  5178. if( aMethod )
  5179. aMethod.call( aObject );
  5180. else
  5181. log( 'method sMethodName not found' );
  5182. };
  5183. }
  5184. function bind( aObject, aMethod )
  5185. {
  5186. return function()
  5187. {
  5188. return aMethod.call( aObject, arguments[0] );
  5189. };
  5190. }
  5191. function bind2( aFunction )
  5192. {
  5193. if( !aFunction )
  5194. log( 'bind2: passed function is not valid.' );
  5195. var aBoundArgList = arguments;
  5196. var aResultFunction = null;
  5197. switch( aBoundArgList.length )
  5198. {
  5199. case 1: aResultFunction = function()
  5200. {
  5201. return aFunction.call( arguments[0], arguments[1],
  5202. arguments[2], arguments[3],
  5203. arguments[4] );
  5204. };
  5205. break;
  5206. case 2: aResultFunction = function()
  5207. {
  5208. return aFunction.call( aBoundArgList[1], arguments[0],
  5209. arguments[1], arguments[2],
  5210. arguments[3] );
  5211. };
  5212. break;
  5213. case 3: aResultFunction = function()
  5214. {
  5215. return aFunction.call( aBoundArgList[1], aBoundArgList[2],
  5216. arguments[0], arguments[1],
  5217. arguments[2] );
  5218. };
  5219. break;
  5220. case 4: aResultFunction = function()
  5221. {
  5222. return aFunction.call( aBoundArgList[1], aBoundArgList[2],
  5223. aBoundArgList[3], arguments[0],
  5224. arguments[1] );
  5225. };
  5226. break;
  5227. case 5: aResultFunction = function()
  5228. {
  5229. return aFunction.call( aBoundArgList[1], aBoundArgList[2],
  5230. aBoundArgList[3], aBoundArgList[4],
  5231. arguments[0] );
  5232. };
  5233. break;
  5234. default:
  5235. log( 'bind2: arity not handled.' );
  5236. }
  5237. return aResultFunction;
  5238. }
  5239. function getCurrentSystemTime()
  5240. {
  5241. return ( new Date() ).getTime();
  5242. }
  5243. function getSlideAnimationsRoot( sSlideId )
  5244. {
  5245. return theMetaDoc.aSlideAnimationsMap[ sSlideId ];
  5246. }
  5247. function getElementChildren( aElement )
  5248. {
  5249. var aChildrenArray = [];
  5250. var nSize = aElement.childNodes.length;
  5251. for( var i = 0; i < nSize; ++i )
  5252. {
  5253. if( aElement.childNodes[i].nodeType == 1 )
  5254. aChildrenArray.push( aElement.childNodes[i] );
  5255. }
  5256. return aChildrenArray;
  5257. }
  5258. function removeWhiteSpaces( str )
  5259. {
  5260. if( !str )
  5261. return '';
  5262. var re = / */;
  5263. var aSplitString = str.split( re );
  5264. return aSplitString.join('');
  5265. }
  5266. function clamp( nValue, nMinimum, nMaximum )
  5267. {
  5268. if( nValue < nMinimum )
  5269. {
  5270. return nMinimum;
  5271. }
  5272. else if( nValue > nMaximum )
  5273. {
  5274. return nMaximum;
  5275. }
  5276. else
  5277. {
  5278. return nValue;
  5279. }
  5280. }
  5281. function makeMatrixString( a, b, c, d, e, f )
  5282. {
  5283. var s = 'matrix(';
  5284. s += a + ', ';
  5285. s += b + ', ';
  5286. s += c + ', ';
  5287. s += d + ', ';
  5288. s += e + ', ';
  5289. s += f + ')';
  5290. return s;
  5291. }
  5292. function matrixToString( aSVGMatrix )
  5293. {
  5294. return makeMatrixString( aSVGMatrix.a, aSVGMatrix.b, aSVGMatrix.c,
  5295. aSVGMatrix.d, aSVGMatrix.e, aSVGMatrix.f );
  5296. }
  5297. function numberParser( sValue )
  5298. {
  5299. if( typeof sValue !== 'string' )
  5300. return undefined;
  5301. if( sValue === '.' )
  5302. return undefined;
  5303. var reFloatNumber = /^[+-]?[0-9]*[.]?[0-9]*$/;
  5304. if( reFloatNumber.test( sValue ) )
  5305. return parseFloat( sValue );
  5306. else
  5307. return undefined;
  5308. }
  5309. function booleanParser( sValue )
  5310. {
  5311. if( typeof sValue !== 'string' )
  5312. return undefined;
  5313. sValue = sValue.toLowerCase();
  5314. if( sValue === 'true' )
  5315. return true;
  5316. else if( sValue === 'false' )
  5317. return false;
  5318. else
  5319. return undefined;
  5320. }
  5321. function colorParser( sValue )
  5322. {
  5323. if( typeof sValue !== 'string' )
  5324. return undefined;
  5325. function hsl( nHue, nSaturation, nLuminance )
  5326. {
  5327. return new HSLColor( nHue, nSaturation / 100, nLuminance / 100 );
  5328. }
  5329. function rgb( nRed, nGreen, nBlue )
  5330. {
  5331. return new RGBColor( nRed / 255, nGreen / 255, nBlue / 255 );
  5332. }
  5333. function prgb( nRed, nGreen, nBlue )
  5334. {
  5335. return new RGBColor( nRed / 100, nGreen / 100, nBlue / 100 );
  5336. }
  5337. var sCommaPattern = ' *[,] *';
  5338. var sIntegerPattern = '[+-]?[0-9]+';
  5339. var sHexDigitPattern = '[0-9A-Fa-f]';
  5340. var sHexColorPattern = '#(' + sHexDigitPattern + '{2})('
  5341. + sHexDigitPattern + '{2})('
  5342. + sHexDigitPattern + '{2})';
  5343. var sRGBIntegerPattern = 'rgb[(] *' + sIntegerPattern + sCommaPattern
  5344. + sIntegerPattern + sCommaPattern
  5345. + sIntegerPattern + ' *[)]';
  5346. var sRGBPercentPattern = 'rgb[(] *' + sIntegerPattern + '%' + sCommaPattern
  5347. + sIntegerPattern + '%' + sCommaPattern
  5348. + sIntegerPattern + '%' + ' *[)]';
  5349. var sHSLPercentPattern = 'hsl[(] *' + sIntegerPattern + sCommaPattern
  5350. + sIntegerPattern + '%' + sCommaPattern
  5351. + sIntegerPattern + '%' + ' *[)]';
  5352. var reHexColor = new RegExp( sHexColorPattern );
  5353. var reRGBInteger = new RegExp( sRGBIntegerPattern );
  5354. var reRGBPercent = new RegExp( sRGBPercentPattern );
  5355. var reHSLPercent = new RegExp( sHSLPercentPattern );
  5356. if( reHexColor.test( sValue ) )
  5357. {
  5358. var aRGBTriple = reHexColor.exec( sValue );
  5359. var nRed = parseInt( aRGBTriple[1], 16 ) / 255;
  5360. var nGreen = parseInt( aRGBTriple[2], 16 ) / 255;
  5361. var nBlue = parseInt( aRGBTriple[3], 16 ) / 255;
  5362. return new RGBColor( nRed, nGreen, nBlue );
  5363. }
  5364. else if( reHSLPercent.test( sValue ) )
  5365. {
  5366. sValue = sValue.replace( '%', '' ).replace( '%', '' );
  5367. return eval( sValue );
  5368. }
  5369. else if( reRGBInteger.test( sValue ) )
  5370. {
  5371. return eval( sValue );
  5372. }
  5373. else if( reRGBPercent.test( sValue ) )
  5374. {
  5375. sValue = 'p' + sValue.replace( '%', '' ).replace( '%', '' ).replace( '%', '' );
  5376. return eval( sValue );
  5377. }
  5378. else
  5379. {
  5380. return null;
  5381. }
  5382. }
  5383. function RGBColor( nRed, nGreen, nBlue )
  5384. {
  5385. this.eColorSpace = COLOR_SPACE_RGB;
  5386. this.nRed = nRed;
  5387. this.nGreen = nGreen;
  5388. this.nBlue = nBlue;
  5389. }
  5390. RGBColor.prototype.clone = function()
  5391. {
  5392. return new RGBColor( this.nRed, this.nGreen, this.nBlue );
  5393. };
  5394. RGBColor.prototype.equal = function( aRGBColor )
  5395. {
  5396. return ( this.nRed == aRGBColor.nRed ) &&
  5397. ( this.nGreen == aRGBColor.nGreen ) &&
  5398. ( this.nBlue == aRGBColor.nBlue );
  5399. };
  5400. RGBColor.prototype.add = function( aRGBColor )
  5401. {
  5402. this.nRed += aRGBColor.nRed;
  5403. this.nGreen += aRGBColor.nGreen;
  5404. this.nBlue += aRGBColor.nBlue;
  5405. return this;
  5406. };
  5407. RGBColor.prototype.scale = function( aT )
  5408. {
  5409. this.nRed *= aT;
  5410. this.nGreen *= aT;
  5411. this.nBlue *= aT;
  5412. return this;
  5413. };
  5414. RGBColor.clamp = function( aRGBColor )
  5415. {
  5416. var aClampedRGBColor = new RGBColor( 0, 0, 0 );
  5417. aClampedRGBColor.nRed = clamp( aRGBColor.nRed, 0.0, 1.0 );
  5418. aClampedRGBColor.nGreen = clamp( aRGBColor.nGreen, 0.0, 1.0 );
  5419. aClampedRGBColor.nBlue = clamp( aRGBColor.nBlue, 0.0, 1.0 );
  5420. return aClampedRGBColor;
  5421. };
  5422. RGBColor.prototype.convertToHSL = function()
  5423. {
  5424. var nRed = clamp( this.nRed, 0.0, 1.0 );
  5425. var nGreen = clamp( this.nGreen, 0.0, 1.0 );
  5426. var nBlue = clamp( this.nBlue, 0.0, 1.0 );
  5427. var nMax = Math.max( nRed, nGreen, nBlue );
  5428. var nMin = Math.min( nRed, nGreen, nBlue );
  5429. var nDelta = nMax - nMin;
  5430. var nLuminance = ( nMax + nMin ) / 2.0;
  5431. var nSaturation = 0.0;
  5432. var nHue = 0.0;
  5433. if( nDelta !== 0 )
  5434. {
  5435. nSaturation = ( nLuminance > 0.5 ) ?
  5436. ( nDelta / ( 2.0 - nMax - nMin) ) :
  5437. ( nDelta / ( nMax + nMin ) );
  5438. if( nRed == nMax )
  5439. nHue = ( nGreen - nBlue ) / nDelta;
  5440. else if( nGreen == nMax )
  5441. nHue = 2.0 + ( nBlue - nRed ) / nDelta;
  5442. else if( nBlue == nMax )
  5443. nHue = 4.0 + ( nRed - nGreen ) / nDelta;
  5444. nHue *= 60.0;
  5445. if( nHue < 0.0 )
  5446. nHue += 360.0;
  5447. }
  5448. return new HSLColor( nHue, nSaturation, nLuminance );
  5449. };
  5450. RGBColor.prototype.toString = function( bClamped )
  5451. {
  5452. var aRGBColor;
  5453. if( bClamped )
  5454. {
  5455. aRGBColor = RGBColor.clamp( this );
  5456. }
  5457. else
  5458. {
  5459. aRGBColor = this;
  5460. }
  5461. var nRed = Math.round( aRGBColor.nRed * 255 );
  5462. var nGreen = Math.round( aRGBColor.nGreen * 255 );
  5463. var nBlue = Math.round( aRGBColor.nBlue * 255 );
  5464. return ( 'rgb(' + nRed + ',' + nGreen + ',' + nBlue + ')' );
  5465. };
  5466. RGBColor.interpolate = function( aStartRGB , aEndRGB, nT )
  5467. {
  5468. var aResult = aStartRGB.clone();
  5469. var aTEndRGB = aEndRGB.clone();
  5470. aResult.scale( 1.0 - nT );
  5471. aTEndRGB.scale( nT );
  5472. aResult.add( aTEndRGB );
  5473. return aResult;
  5474. };
  5475. function HSLColor( nHue, nSaturation, nLuminance )
  5476. {
  5477. this.eColorSpace = COLOR_SPACE_HSL;
  5478. this.nHue = nHue;
  5479. this.nSaturation = nSaturation;
  5480. this.nLuminance = nLuminance;
  5481. this.normalizeHue();
  5482. }
  5483. HSLColor.prototype.clone = function()
  5484. {
  5485. return new HSLColor( this.nHue, this.nSaturation, this.nLuminance );
  5486. };
  5487. HSLColor.prototype.equal = function( aHSLColor )
  5488. {
  5489. return ( this.nHue == aHSLColor.nHue ) &&
  5490. ( this.nSaturation += aHSLColor.nSaturation ) &&
  5491. ( this.nLuminance += aHSLColor.nLuminance );
  5492. };
  5493. HSLColor.prototype.add = function( aHSLColor )
  5494. {
  5495. this.nHue += aHSLColor.nHue;
  5496. this.nSaturation += aHSLColor.nSaturation;
  5497. this.nLuminance += aHSLColor.nLuminance;
  5498. this.normalizeHue();
  5499. return this;
  5500. };
  5501. HSLColor.prototype.scale = function( aT )
  5502. {
  5503. this.nHue *= aT;
  5504. this.nSaturation *= aT;
  5505. this.nLuminance *= aT;
  5506. this.normalizeHue();
  5507. return this;
  5508. };
  5509. HSLColor.clamp = function( aHSLColor )
  5510. {
  5511. var aClampedHSLColor = new HSLColor( 0, 0, 0 );
  5512. aClampedHSLColor.nHue = aHSLColor.nHue % 360;
  5513. if( aClampedHSLColor.nHue < 0 )
  5514. aClampedHSLColor.nHue += 360;
  5515. aClampedHSLColor.nSaturation = clamp( aHSLColor.nSaturation, 0.0, 1.0 );
  5516. aClampedHSLColor.nLuminance = clamp( aHSLColor.nLuminance, 0.0, 1.0 );
  5517. };
  5518. HSLColor.prototype.normalizeHue = function()
  5519. {
  5520. this.nHue = this.nHue % 360;
  5521. if( this.nHue < 0 ) this.nHue += 360;
  5522. };
  5523. HSLColor.prototype.toString = function()
  5524. {
  5525. return 'hsl(' + this.nHue.toFixed( 3 ) + ','
  5526. + this.nSaturation.toFixed( 3 ) + ','
  5527. + this.nLuminance.toFixed( 3 ) + ')';
  5528. };
  5529. HSLColor.prototype.convertToRGB = function()
  5530. {
  5531. var nHue = this.nHue % 360;
  5532. if( nHue < 0 ) nHue += 360;
  5533. var nSaturation = clamp( this.nSaturation, 0.0, 1.0 );
  5534. var nLuminance = clamp( this.nLuminance, 0.0, 1.0 );
  5535. if( nSaturation === 0 )
  5536. {
  5537. return new RGBColor( nLuminance, nLuminance, nLuminance );
  5538. }
  5539. var nVal1 = ( nLuminance <= 0.5 ) ?
  5540. ( nLuminance * (1.0 + nSaturation) ) :
  5541. ( nLuminance + nSaturation - nLuminance * nSaturation );
  5542. var nVal2 = 2.0 * nLuminance - nVal1;
  5543. var nRed = HSLColor.hsl2rgbHelper( nVal2, nVal1, nHue + 120 );
  5544. var nGreen = HSLColor.hsl2rgbHelper( nVal2, nVal1, nHue );
  5545. var nBlue = HSLColor.hsl2rgbHelper( nVal2, nVal1, nHue - 120 );
  5546. return new RGBColor( nRed, nGreen, nBlue );
  5547. };
  5548. HSLColor.hsl2rgbHelper = function( nValue1, nValue2, nHue )
  5549. {
  5550. nHue = nHue % 360;
  5551. if( nHue < 0 )
  5552. nHue += 360;
  5553. if( nHue < 60.0 )
  5554. return nValue1 + ( nValue2 - nValue1 ) * nHue / 60.0;
  5555. else if( nHue < 180.0 )
  5556. return nValue2;
  5557. else if( nHue < 240.0 )
  5558. return ( nValue1 + ( nValue2 - nValue1 ) * ( 240.0 - nHue ) / 60.0 );
  5559. else
  5560. return nValue1;
  5561. };
  5562. HSLColor.interpolate = function( aFrom, aTo, nT, bCCW )
  5563. {
  5564. var nS = 1.0 - nT;
  5565. var nHue = 0.0;
  5566. if( aFrom.nHue <= aTo.nHue && !bCCW )
  5567. {
  5568. nHue = nS * (aFrom.nHue + 360.0) + nT * aTo.nHue;
  5569. }
  5570. else if( aFrom.nHue > aTo.nHue && bCCW )
  5571. {
  5572. nHue = nS * aFrom.nHue + nT * (aTo.nHue + 360.0);
  5573. }
  5574. else
  5575. {
  5576. nHue = nS * aFrom.nHue + nT * aTo.nHue;
  5577. }
  5578. var nSaturation = nS * aFrom.nSaturation + nT * aTo.nSaturation;
  5579. var nLuminance = nS * aFrom.nLuminance + nT * aTo.nLuminance;
  5580. return new HSLColor( nHue, nSaturation, nLuminance );
  5581. };
  5582. var SVGIdentityMatrix = document.documentElement.createSVGMatrix();
  5583. SVGMatrix.prototype.setToIdentity = function()
  5584. {
  5585. this.a = this.d = 1;
  5586. this.b = this.c = this.d = this.e = 0;
  5587. };
  5588. SVGMatrix.prototype.setToRotationAroundPoint = function( nX, nY, nAngle )
  5589. {
  5590. nAngle = Math.PI * nAngle / 180;
  5591. var nSin = Math.sin( nAngle );
  5592. var nCos = Math.cos( nAngle );
  5593. this.a = nCos; this.c = -nSin; this.e = nX * (1 - nCos) + nY * nSin;
  5594. this.b = nSin; this.d = nCos; this.f = nY * (1 - nCos) - nX * nSin;
  5595. };
  5596. SVGPathElement.prototype.prependPath = function( aPath )
  5597. {
  5598. var sPathData = aPath.getAttribute( 'd' );
  5599. sPathData += ( ' ' + this.getAttribute( 'd' ) );
  5600. this.setAttribute( 'd', sPathData );
  5601. };
  5602. SVGPathElement.prototype.appendPath = function( aPath )
  5603. {
  5604. var sPathData = this.getAttribute( 'd' );
  5605. sPathData += ( ' ' + aPath.getAttribute( 'd' ) );
  5606. this.setAttribute( 'd', sPathData );
  5607. };
  5608. function flipOnYAxis( aPath )
  5609. {
  5610. var aPolyPath = aPath.cloneNode(true);
  5611. var aTransform = document.documentElement.createSVGMatrix();
  5612. aTransform.a = -1;
  5613. aTransform.e = 1;
  5614. aPolyPath.matrixTransform(aTransform);
  5615. return aPolyPath;
  5616. }
  5617. function flipOnXAxis( aPath )
  5618. {
  5619. var aPolyPath = aPath.cloneNode(true);
  5620. var aTransform = document.documentElement.createSVGMatrix();
  5621. aTransform.d = -1;
  5622. aTransform.f = 1;
  5623. aPolyPath.matrixTransform(aTransform);
  5624. return aPolyPath;
  5625. }
  5626. SVGPathElement.prototype.matrixTransform = function( aSVGMatrix )
  5627. {
  5628. if( SVGPathSegList.prototype.matrixTransform )
  5629. {
  5630. this.pathSegList.matrixTransform( aSVGMatrix );
  5631. return;
  5632. }
  5633. var aPathSegList = this.pathSegList;
  5634. var nLength = aPathSegList.numberOfItems;
  5635. var i;
  5636. for( i = 0; i < nLength; ++i )
  5637. {
  5638. aPathSegList.getItem( i ).matrixTransform( aSVGMatrix );
  5639. }
  5640. };
  5641. SVGPathElement.prototype.changeOrientation = function()
  5642. {
  5643. var aPathSegList = this.pathSegList;
  5644. var nLength = aPathSegList.numberOfItems;
  5645. if( nLength == 0 ) return;
  5646. if( SVGPathSegList.prototype.changeOrientation )
  5647. {
  5648. aPathSegList.changeOrientation();
  5649. return;
  5650. }
  5651. var nCurrentX = 0;
  5652. var nCurrentY = 0;
  5653. var aPathSeg = aPathSegList.getItem( 0 );
  5654. if( aPathSeg.pathSegTypeAsLetter == 'M' )
  5655. {
  5656. nCurrentX = aPathSeg.x;
  5657. nCurrentY = aPathSeg.y;
  5658. aPathSegList.removeItem( 0 );
  5659. --nLength;
  5660. }
  5661. var i;
  5662. for( i = 0; i < nLength; ++i )
  5663. {
  5664. aPathSeg = aPathSegList.getItem( i );
  5665. var aPoint = aPathSeg.changeOrientation( nCurrentX, nCurrentY );
  5666. nCurrentX = aPoint.x;
  5667. nCurrentY = aPoint.y;
  5668. }
  5669. for( i = nLength - 2; i >= 0; --i )
  5670. {
  5671. aPathSeg = aPathSegList.removeItem( i );
  5672. aPathSegList.appendItem( aPathSeg );
  5673. }
  5674. var aMovePathSeg = this.createSVGPathSegMovetoAbs( nCurrentX, nCurrentY );
  5675. aPathSegList.insertItemBefore( aMovePathSeg, 0 );
  5676. };
  5677. try
  5678. { // Firefox, Google Chrome, Internet Explorer, Safari.
  5679. SVGPathSegMovetoAbs.prototype.matrixTransform = function( aSVGMatrix )
  5680. {
  5681. SVGPathMatrixTransform( this, aSVGMatrix );
  5682. };
  5683. SVGPathSegLinetoAbs.prototype.matrixTransform = function( aSVGMatrix )
  5684. {
  5685. SVGPathMatrixTransform( this, aSVGMatrix );
  5686. };
  5687. SVGPathSegCurvetoQuadraticAbs.prototype.matrixTransform = function( aSVGMatrix )
  5688. {
  5689. SVGPathMatrixTransform( this, aSVGMatrix );
  5690. var nX = this.x1;
  5691. this.x1 = aSVGMatrix.a * nX + aSVGMatrix.c * this.y1 + aSVGMatrix.e;
  5692. this.y1 = aSVGMatrix.b * nX + aSVGMatrix.d * this.y1 + aSVGMatrix.f;
  5693. };
  5694. SVGPathSegCurvetoCubicAbs.prototype.matrixTransform = function( aSVGMatrix )
  5695. {
  5696. SVGPathMatrixTransform( this, aSVGMatrix );
  5697. var nX = this.x1;
  5698. this.x1 = aSVGMatrix.a * nX + aSVGMatrix.c * this.y1 + aSVGMatrix.e;
  5699. this.y1 = aSVGMatrix.b * nX + aSVGMatrix.d * this.y1 + aSVGMatrix.f;
  5700. nX = this.x2;
  5701. this.x2 = aSVGMatrix.a * nX + aSVGMatrix.c * this.y2 + aSVGMatrix.e;
  5702. this.y2 = aSVGMatrix.b * nX + aSVGMatrix.d * this.y2 + aSVGMatrix.f;
  5703. };
  5704. SVGPathSegMovetoAbs.prototype.changeOrientation = function( nCurrentX, nCurrentY )
  5705. {
  5706. var aPoint = { x: this.x, y: this.y };
  5707. this.x = nCurrentX;
  5708. this.y = nCurrentY;
  5709. return aPoint;
  5710. };
  5711. SVGPathSegLinetoAbs.prototype.changeOrientation = function( nCurrentX, nCurrentY )
  5712. {
  5713. var aPoint = { x: this.x, y: this.y };
  5714. this.x = nCurrentX;
  5715. this.y = nCurrentY;
  5716. return aPoint;
  5717. };
  5718. SVGPathSegCurvetoQuadraticAbs.prototype.changeOrientation = function( nCurrentX, nCurrentY )
  5719. {
  5720. var aPoint = { x: this.x, y: this.y };
  5721. this.x = nCurrentX;
  5722. this.y = nCurrentY;
  5723. return aPoint;
  5724. };
  5725. SVGPathSegCurvetoCubicAbs.prototype.changeOrientation = function( nCurrentX, nCurrentY )
  5726. {
  5727. var aPoint = { x: this.x, y: this.y };
  5728. this.x = nCurrentX;
  5729. this.y = nCurrentY;
  5730. var nX = this.x1;
  5731. this.x1 = this.x2;
  5732. this.x2 = nX;
  5733. var nY = this.y1;
  5734. this.y1 = this.y2;
  5735. this.y2 = nY;
  5736. return aPoint;
  5737. };
  5738. }
  5739. catch( e )
  5740. { // Opera
  5741. if( e.name == 'ReferenceError' )
  5742. {
  5743. SVGPathSeg.prototype.matrixTransform = function( aSVGMatrix )
  5744. {
  5745. var nX;
  5746. switch( this.pathSegTypeAsLetter )
  5747. {
  5748. case 'C':
  5749. nX = this.x2;
  5750. this.x2 = aSVGMatrix.a * nX + aSVGMatrix.c * this.y2 + aSVGMatrix.e;
  5751. this.y2 = aSVGMatrix.b * nX + aSVGMatrix.d * this.y2 + aSVGMatrix.f;
  5752. case 'Q':
  5753. nX = this.x1;
  5754. this.x1 = aSVGMatrix.a * nX + aSVGMatrix.c * this.y1 + aSVGMatrix.e;
  5755. this.y1 = aSVGMatrix.b * nX + aSVGMatrix.d * this.y1 + aSVGMatrix.f;
  5756. case 'M':
  5757. case 'L':
  5758. SVGPathMatrixTransform( this, aSVGMatrix );
  5759. break;
  5760. default:
  5761. log( 'SVGPathSeg.matrixTransform: unexpected path segment type: '
  5762. + this.pathSegTypeAsLetter );
  5763. }
  5764. };
  5765. SVGPathSeg.prototype.changeOrientation = function( nCurrentX, nCurrentY )
  5766. {
  5767. switch( this.pathSegTypeAsLetter )
  5768. {
  5769. case 'C':
  5770. var nX = this.x1;
  5771. this.x1 = this.x2;
  5772. this.x2 = nX;
  5773. var nY = this.y1;
  5774. this.y1 = this.y2;
  5775. this.y2 = nY;
  5776. case 'M':
  5777. case 'L':
  5778. case 'Q':
  5779. var aPoint = { x: this.x, y: this.y };
  5780. this.x = nCurrentX;
  5781. this.y = nCurrentY;
  5782. return aPoint;
  5783. default:
  5784. log( 'SVGPathSeg.changeOrientation: unexpected path segment type: '
  5785. + this.pathSegTypeAsLetter );
  5786. return null;
  5787. }
  5788. }
  5789. }
  5790. else throw e;
  5791. }
  5792. function SVGPathMatrixTransform( aPath, aSVGMatrix )
  5793. {
  5794. var nX = aPath.x;
  5795. aPath.x = aSVGMatrix.a * nX + aSVGMatrix.c * aPath.y + aSVGMatrix.e;
  5796. aPath.y = aSVGMatrix.b * nX + aSVGMatrix.d * aPath.y + aSVGMatrix.f;
  5797. }
  5798. function PriorityQueue( aCompareFunc )
  5799. {
  5800. this.aSequence = [];
  5801. this.aCompareFunc = aCompareFunc;
  5802. }
  5803. PriorityQueue.prototype.clone = function()
  5804. {
  5805. var aCopy = new PriorityQueue( this.aCompareFunc );
  5806. var src = this.aSequence;
  5807. var dest = [];
  5808. var i, l;
  5809. for( i = 0, l = src.length; i < l; ++i )
  5810. {
  5811. if( i in src )
  5812. {
  5813. dest.push( src[i] );
  5814. }
  5815. }
  5816. aCopy.aSequence = dest;
  5817. return aCopy;
  5818. };
  5819. PriorityQueue.prototype.top = function()
  5820. {
  5821. return this.aSequence[this.aSequence.length - 1];
  5822. };
  5823. PriorityQueue.prototype.isEmpty = function()
  5824. {
  5825. return ( this.aSequence.length === 0 );
  5826. };
  5827. PriorityQueue.prototype.push = function( aValue )
  5828. {
  5829. this.aSequence.unshift( aValue );
  5830. this.aSequence.sort(this.aCompareFunc);
  5831. };
  5832. PriorityQueue.prototype.clear = function()
  5833. {
  5834. this.aSequence = [];
  5835. };
  5836. PriorityQueue.prototype.pop = function()
  5837. {
  5838. return this.aSequence.pop();
  5839. };
  5840. var ANIMATION_NODE_CUSTOM = 0;
  5841. var ANIMATION_NODE_PAR = 1;
  5842. var ANIMATION_NODE_SEQ = 2;
  5843. var ANIMATION_NODE_ITERATE = 3;
  5844. var ANIMATION_NODE_ANIMATE = 4;
  5845. var ANIMATION_NODE_SET = 5;
  5846. var ANIMATION_NODE_ANIMATEMOTION = 6;
  5847. var ANIMATION_NODE_ANIMATECOLOR = 7;
  5848. var ANIMATION_NODE_ANIMATETRANSFORM = 8;
  5849. var ANIMATION_NODE_TRANSITIONFILTER = 9;
  5850. var ANIMATION_NODE_AUDIO = 10;
  5851. var ANIMATION_NODE_COMMAND = 11;
  5852. var aAnimationNodeTypeInMap = {
  5853. 'par' : ANIMATION_NODE_PAR,
  5854. 'seq' : ANIMATION_NODE_SEQ,
  5855. 'iterate' : ANIMATION_NODE_ITERATE,
  5856. 'animate' : ANIMATION_NODE_ANIMATE,
  5857. 'set' : ANIMATION_NODE_SET,
  5858. 'animatemotion' : ANIMATION_NODE_ANIMATEMOTION,
  5859. 'animatecolor' : ANIMATION_NODE_ANIMATECOLOR,
  5860. 'animatetransform' : ANIMATION_NODE_ANIMATETRANSFORM,
  5861. 'transitionfilter' : ANIMATION_NODE_TRANSITIONFILTER,
  5862. 'audio' : ANIMATION_NODE_AUDIO,
  5863. 'command' : ANIMATION_NODE_COMMAND
  5864. };
  5865. function getAnimationElementType( aElement )
  5866. {
  5867. var sName = aElement.localName.toLowerCase();
  5868. if( sName && aAnimationNodeTypeInMap[ sName ] )
  5869. return aAnimationNodeTypeInMap[ sName ];
  5870. else
  5871. return ANIMATION_NODE_CUSTOM;
  5872. }
  5873. var INVALID_NODE = 0;
  5874. var UNRESOLVED_NODE = 1;
  5875. var RESOLVED_NODE = 2;
  5876. var ACTIVE_NODE = 4;
  5877. var FROZEN_NODE = 8;
  5878. var ENDED_NODE = 16;
  5879. function getNodeStateName( eNodeState )
  5880. {
  5881. switch( eNodeState )
  5882. {
  5883. case INVALID_NODE:
  5884. return 'INVALID';
  5885. case UNRESOLVED_NODE:
  5886. return 'UNRESOLVED';
  5887. case RESOLVED_NODE:
  5888. return 'RESOLVED';
  5889. case ACTIVE_NODE:
  5890. return 'ACTIVE';
  5891. case FROZEN_NODE:
  5892. return 'FROZEN';
  5893. case ENDED_NODE:
  5894. return 'ENDED';
  5895. default:
  5896. return 'UNKNOWN';
  5897. }
  5898. }
  5899. var IMPRESS_DEFAULT_NODE = 0;
  5900. var IMPRESS_ON_CLICK_NODE = 1;
  5901. var IMPRESS_WITH_PREVIOUS_NODE = 2;
  5902. var IMPRESS_AFTER_PREVIOUS_NODE = 3;
  5903. var IMPRESS_MAIN_SEQUENCE_NODE = 4;
  5904. var IMPRESS_TIMING_ROOT_NODE = 5;
  5905. var IMPRESS_INTERACTIVE_SEQUENCE_NODE = 6;
  5906. var aImpressNodeTypeInMap = {
  5907. 'on-click' : IMPRESS_ON_CLICK_NODE,
  5908. 'with-previous' : IMPRESS_WITH_PREVIOUS_NODE,
  5909. 'after-previous' : IMPRESS_AFTER_PREVIOUS_NODE,
  5910. 'main-sequence' : IMPRESS_MAIN_SEQUENCE_NODE,
  5911. 'timing-root' : IMPRESS_TIMING_ROOT_NODE,
  5912. 'interactive-sequence' : IMPRESS_INTERACTIVE_SEQUENCE_NODE
  5913. };
  5914. var aImpressNodeTypeOutMap = [ 'default', 'on-click', 'with-previous', 'after-previous',
  5915. 'main-sequence', 'timing-root', 'interactive-sequence' ];
  5916. var aPresetClassInMap = {};
  5917. var aPresetIdInMap = {};
  5918. var RESTART_MODE_DEFAULT = 0;
  5919. var RESTART_MODE_INHERIT = 0; // eslint-disable-line no-unused-vars
  5920. var RESTART_MODE_ALWAYS = 1;
  5921. var RESTART_MODE_WHEN_NOT_ACTIVE = 2;
  5922. var RESTART_MODE_NEVER = 3;
  5923. var aRestartModeInMap = {
  5924. 'inherit' : RESTART_MODE_DEFAULT,
  5925. 'always' : RESTART_MODE_ALWAYS,
  5926. 'whenNotActive' : RESTART_MODE_WHEN_NOT_ACTIVE,
  5927. 'never' : RESTART_MODE_NEVER
  5928. };
  5929. var aRestartModeOutMap = [ 'inherit','always', 'whenNotActive', 'never' ];
  5930. var FILL_MODE_DEFAULT = 0;
  5931. var FILL_MODE_INHERIT = 0; // eslint-disable-line no-unused-vars
  5932. var FILL_MODE_REMOVE = 1;
  5933. var FILL_MODE_FREEZE = 2;
  5934. var FILL_MODE_HOLD = 3;
  5935. var FILL_MODE_TRANSITION = 4;
  5936. var FILL_MODE_AUTO = 5;
  5937. var aFillModeInMap = {
  5938. 'inherit' : FILL_MODE_DEFAULT,
  5939. 'remove' : FILL_MODE_REMOVE,
  5940. 'freeze' : FILL_MODE_FREEZE,
  5941. 'hold' : FILL_MODE_HOLD,
  5942. 'transition' : FILL_MODE_TRANSITION,
  5943. 'auto' : FILL_MODE_AUTO
  5944. };
  5945. var aFillModeOutMap = [ 'inherit', 'remove', 'freeze', 'hold', 'transition', 'auto' ];
  5946. var ADDITIVE_MODE_UNKNOWN = 0; // eslint-disable-line no-unused-vars
  5947. var ADDITIVE_MODE_BASE = 1;
  5948. var ADDITIVE_MODE_SUM = 2;
  5949. var ADDITIVE_MODE_REPLACE = 3;
  5950. var ADDITIVE_MODE_MULTIPLY = 4;
  5951. var ADDITIVE_MODE_NONE = 5;
  5952. var aAddittiveModeInMap = {
  5953. 'base' : ADDITIVE_MODE_BASE,
  5954. 'sum' : ADDITIVE_MODE_SUM,
  5955. 'replace' : ADDITIVE_MODE_REPLACE,
  5956. 'multiply' : ADDITIVE_MODE_MULTIPLY,
  5957. 'none' : ADDITIVE_MODE_NONE
  5958. };
  5959. var aAddittiveModeOutMap = [ 'unknown', 'base', 'sum', 'replace', 'multiply', 'none' ];
  5960. var ACCUMULATE_MODE_NONE = 0;
  5961. var ACCUMULATE_MODE_SUM = 1;
  5962. var aAccumulateModeOutMap = [ 'none', 'sum' ];
  5963. var CALC_MODE_DISCRETE = 1;
  5964. var CALC_MODE_LINEAR = 2;
  5965. var CALC_MODE_PACED = 3;
  5966. var CALC_MODE_SPLINE = 4;
  5967. var aCalcModeInMap = {
  5968. 'discrete' : CALC_MODE_DISCRETE,
  5969. 'linear' : CALC_MODE_LINEAR,
  5970. 'paced' : CALC_MODE_PACED,
  5971. 'spline' : CALC_MODE_SPLINE
  5972. };
  5973. var aCalcModeOutMap = [ 'unknown', 'discrete', 'linear', 'paced', 'spline' ];
  5974. var COLOR_SPACE_RGB = 0;
  5975. var COLOR_SPACE_HSL = 1;
  5976. var aColorSpaceInMap = { 'rgb': COLOR_SPACE_RGB, 'hsl': COLOR_SPACE_HSL };
  5977. var aColorSpaceOutMap = [ 'rgb', 'hsl' ];
  5978. var CLOCKWISE = 0;
  5979. var COUNTERCLOCKWISE = 1;
  5980. var aClockDirectionInMap = { 'clockwise': CLOCKWISE, 'counter-clockwise': COUNTERCLOCKWISE };
  5981. var aClockDirectionOutMap = [ 'clockwise', 'counter-clockwise' ];
  5982. var UNKNOWN_PROPERTY = 0; // eslint-disable-line no-unused-vars
  5983. var NUMBER_PROPERTY = 1;
  5984. var ENUM_PROPERTY = 2;
  5985. var COLOR_PROPERTY = 3;
  5986. var STRING_PROPERTY = 4;
  5987. var BOOL_PROPERTY = 5;
  5988. var TUPLE_NUMBER_PROPERTY = 6;
  5989. var aValueTypeOutMap = [ 'unknown', 'number', 'enum', 'color', 'string', 'boolean' ];
  5990. var aAttributeMap =
  5991. {
  5992. 'height': { 'type': NUMBER_PROPERTY,
  5993. 'get': 'getHeight',
  5994. 'set': 'setHeight',
  5995. 'getmod': 'makeScaler( 1/nHeight )',
  5996. 'setmod': 'makeScaler( nHeight)' },
  5997. 'opacity': { 'type': NUMBER_PROPERTY,
  5998. 'get': 'getOpacity',
  5999. 'set': 'setOpacity' },
  6000. 'scale': { 'type': TUPLE_NUMBER_PROPERTY,
  6001. 'get': 'getSize',
  6002. 'set': 'setSize' },
  6003. 'translate': { 'type': TUPLE_NUMBER_PROPERTY,
  6004. 'get': 'getPos',
  6005. 'set': 'setPos' },
  6006. 'rotate': { 'type': NUMBER_PROPERTY,
  6007. 'get': 'getRotationAngle',
  6008. 'set': 'setRotationAngle' },
  6009. 'width': { 'type': NUMBER_PROPERTY,
  6010. 'get': 'getWidth',
  6011. 'set': 'setWidth',
  6012. 'getmod': 'makeScaler( 1/nWidth )',
  6013. 'setmod': 'makeScaler( nWidth)' },
  6014. 'x': { 'type': NUMBER_PROPERTY,
  6015. 'get': 'getX',
  6016. 'set': 'setX',
  6017. 'getmod': 'makeScaler( 1/nWidth )',
  6018. 'setmod': 'makeScaler( nWidth)' },
  6019. 'y': { 'type': NUMBER_PROPERTY,
  6020. 'get': 'getY',
  6021. 'set': 'setY',
  6022. 'getmod': 'makeScaler( 1/nHeight )',
  6023. 'setmod': 'makeScaler( nHeight)' },
  6024. 'fill': { 'type': ENUM_PROPERTY,
  6025. 'get': 'getFillStyle',
  6026. 'set': 'setFillStyle' },
  6027. 'stroke': { 'type': ENUM_PROPERTY,
  6028. 'get': 'getStrokeStyle',
  6029. 'set': 'setStrokeStyle' },
  6030. 'visibility': { 'type': ENUM_PROPERTY,
  6031. 'get': 'getVisibility',
  6032. 'set': 'setVisibility' },
  6033. 'fill-color': { 'type': COLOR_PROPERTY,
  6034. 'get': 'getFillColor',
  6035. 'set': 'setFillColor' },
  6036. 'stroke-color': { 'type': COLOR_PROPERTY,
  6037. 'get': 'getStrokeColor',
  6038. 'set': 'setStrokeColor' },
  6039. 'color': { 'type': COLOR_PROPERTY,
  6040. 'get': 'getFontColor',
  6041. 'set': 'setFontColor' }
  6042. };
  6043. var TRANSITION_INVALID = 0; // Invalid type
  6044. var TRANSITION_CLIP_POLYPOLYGON = 1; // Transition expressed by parametric clip polygon
  6045. var TRANSITION_SPECIAL = 2; // Transition expressed by hand-crafted function
  6046. var BARWIPE_TRANSITION = 1;
  6047. var BOXWIPE_TRANSITION = 2;
  6048. var FOURBOXWIPE_TRANSITION = 3;
  6049. var ELLIPSEWIPE_TRANSITION = 4; // 17
  6050. var CLOCKWIPE_TRANSITION = 5; // 22
  6051. var PINWHEELWIPE_TRANSITION = 6; // 23
  6052. var PUSHWIPE_TRANSITION = 7; // 35
  6053. var SLIDEWIPE_TRANSITION = 8; // 36
  6054. var FADE_TRANSITION = 9; // 37
  6055. var RANDOMBARWIPE_TRANSITION = 10; // 38
  6056. var CHECKERBOARDWIPE_TRANSITION = 11; // 39
  6057. var DISSOLVE_TRANSITION = 12; // 40
  6058. var SNAKEWIPE_TRANSITION = 13; // 30
  6059. var PARALLELSNAKESWIPE_TRANSITION = 14; // 32
  6060. var IRISWIPE_TRANSITION = 15; // 12
  6061. var BARNDOORWIPE_TRANSITION = 16; // 4
  6062. var VEEWIPE_TRANSITION = 17; // 8
  6063. var ZIGZAGWIPE_TRANSITION = 18; // 10
  6064. var BARNZIGZAGWIPE_TRANSITION = 19; // 11
  6065. var FANWIPE_TRANSITION = 20; // 25
  6066. var SINGLESWEEPWIPE_TRANSITION = 21; // 24
  6067. var WATERFALLWIPE_TRANSITION = 22; // 34
  6068. var SPIRALWIPE_TRANSITION = 23; // 31
  6069. var MISCDIAGONALWIPE_TRANSITION = 24; // 7
  6070. var BOXSNAKESWIPE_TRANSITION = 25; // 33
  6071. var aTransitionTypeInMap = {
  6072. 'barWipe' : BARWIPE_TRANSITION,
  6073. 'boxWipe' : BOXWIPE_TRANSITION,
  6074. 'barnDoorWipe' : BARNDOORWIPE_TRANSITION,
  6075. 'fourBoxWipe' : FOURBOXWIPE_TRANSITION,
  6076. 'ellipseWipe' : ELLIPSEWIPE_TRANSITION,
  6077. 'clockWipe' : CLOCKWIPE_TRANSITION,
  6078. 'pinWheelWipe' : PINWHEELWIPE_TRANSITION,
  6079. 'miscDiagonalWipe' : MISCDIAGONALWIPE_TRANSITION,
  6080. 'pushWipe' : PUSHWIPE_TRANSITION,
  6081. 'slideWipe' : SLIDEWIPE_TRANSITION,
  6082. 'fade' : FADE_TRANSITION,
  6083. 'fanWipe' : FANWIPE_TRANSITION,
  6084. 'randomBarWipe' : RANDOMBARWIPE_TRANSITION,
  6085. 'checkerBoardWipe' : CHECKERBOARDWIPE_TRANSITION,
  6086. 'dissolve' : DISSOLVE_TRANSITION,
  6087. 'singleSweepWipe' : SINGLESWEEPWIPE_TRANSITION,
  6088. 'snakeWipe' : SNAKEWIPE_TRANSITION,
  6089. 'parallelSnakesWipe': PARALLELSNAKESWIPE_TRANSITION,
  6090. 'spiralWipe' : SPIRALWIPE_TRANSITION,
  6091. 'boxSnakesWipe' : BOXSNAKESWIPE_TRANSITION,
  6092. 'irisWipe' : IRISWIPE_TRANSITION,
  6093. 'veeWipe' : VEEWIPE_TRANSITION,
  6094. 'zigZagWipe' : ZIGZAGWIPE_TRANSITION,
  6095. 'barnZigZagWipe' : BARNZIGZAGWIPE_TRANSITION,
  6096. 'waterfallWipe' : WATERFALLWIPE_TRANSITION
  6097. };
  6098. var DEFAULT_TRANS_SUBTYPE = 0;
  6099. var LEFTTORIGHT_TRANS_SUBTYPE = 1;
  6100. var TOPTOBOTTOM_TRANS_SUBTYPE = 2;
  6101. var CORNERSIN_TRANS_SUBTYPE = 3; // 11
  6102. var CORNERSOUT_TRANS_SUBTYPE = 4;
  6103. var VERTICAL_TRANS_SUBTYPE = 5;
  6104. var HORIZONTAL_TRANS_SUBTYPE = 6; // 14
  6105. var DOWN_TRANS_SUBTYPE = 7; // 19
  6106. var CIRCLE_TRANS_SUBTYPE = 8; // 27
  6107. var CLOCKWISETWELVE_TRANS_SUBTYPE = 9; // 33
  6108. var CLOCKWISETHREE_TRANS_SUBTYPE = 10;
  6109. var CLOCKWISESIX_TRANS_SUBTYPE = 11;
  6110. var CLOCKWISENINE_TRANS_SUBTYPE = 12;
  6111. var TWOBLADEVERTICAL_TRANS_SUBTYPE = 13;
  6112. var TWOBLADEHORIZONTAL_TRANS_SUBTYPE = 14;
  6113. var FOURBLADE_TRANS_SUBTYPE = 15; // 39
  6114. var FROMLEFT_TRANS_SUBTYPE = 16; // 97
  6115. var FROMTOP_TRANS_SUBTYPE = 17;
  6116. var FROMRIGHT_TRANS_SUBTYPE = 18;
  6117. var FROMBOTTOM_TRANS_SUBTYPE = 19;
  6118. var CROSSFADE_TRANS_SUBTYPE = 20;
  6119. var FADETOCOLOR_TRANS_SUBTYPE = 21;
  6120. var FADEFROMCOLOR_TRANS_SUBTYPE = 22;
  6121. var FADEOVERCOLOR_TRANS_SUBTYPE = 23;
  6122. var THREEBLADE_TRANS_SUBTYPE = 24;
  6123. var EIGHTBLADE_TRANS_SUBTYPE = 25;
  6124. var ONEBLADE_TRANS_SUBTYPE = 26; // 107
  6125. var ACROSS_TRANS_SUBTYPE = 27;
  6126. var TOPLEFTVERTICAL_TRANS_SUBTYPE = 28; // 109
  6127. var TOPLEFTHORIZONTAL_TRANS_SUBTYPE = 29; // 64
  6128. var TOPLEFTDIAGONAL_TRANS_SUBTYPE = 30; // 65
  6129. var TOPRIGHTDIAGONAL_TRANS_SUBTYPE = 31; // 66
  6130. var BOTTOMRIGHTDIAGONAL_TRANS_SUBTYPE = 32; // 67
  6131. var BOTTOMLEFTDIAGONAL_TRANS_SUBTYPE = 33; // 68
  6132. var RECTANGLE_TRANS_SUBTYPE = 34; // 101
  6133. var DIAMOND_TRANS_SUBTYPE = 35; // 102
  6134. var TOPLEFT_TRANS_SUBTYPE = 36; // 3
  6135. var TOPRIGHT_TRANS_SUBTYPE = 37; // 4
  6136. var BOTTOMRIGHT_TRANS_SUBTYPE = 38; // 5
  6137. var BOTTOMLEFT_TRANS_SUBTYPE = 39; // 6
  6138. var TOPCENTER_TRANS_SUBTYPE = 40; // 7
  6139. var RIGHTCENTER_TRANS_SUBTYPE = 41; // 8
  6140. var BOTTOMCENTER_TRANS_SUBTYPE = 42; // 9
  6141. var LEFTCENTER_TRANS_SUBTYPE = 43; // 10
  6142. var LEFT_TRANS_SUBTYPE = 44; // 20
  6143. var UP_TRANS_SUBTYPE = 45; // 21
  6144. var RIGHT_TRANS_SUBTYPE = 46; // 22
  6145. var DIAGONALBOTTOMLEFT_TRANS_SUBTYPE = 47; // 15
  6146. var DIAGONALTOPLEFT_TRANS_SUBTYPE = 48; // 16
  6147. var CENTERTOP_TRANS_SUBTYPE = 49; // 48
  6148. var CENTERRIGHT_TRANS_SUBTYPE = 50; // 49
  6149. var TOP_TRANS_SUBTYPE = 51; // 50
  6150. var BOTTOM_TRANS_SUBTYPE = 52; // 52
  6151. var CLOCKWISETOP_TRANS_SUBTYPE = 53; // 40
  6152. var CLOCKWISERIGHT_TRANS_SUBTYPE = 54; // 41
  6153. var CLOCKWISEBOTTOM_TRANS_SUBTYPE = 55; // 42
  6154. var CLOCKWISELEFT_TRANS_SUBTYPE = 56; // 43
  6155. var CLOCKWISETOPLEFT_TRANS_SUBTYPE = 57; // 44
  6156. var COUNTERCLOCKWISEBOTTOMLEFT_TRANS_SUBTYPE = 58; // 45
  6157. var CLOCKWISEBOTTOMRIGHT_TRANS_SUBTYPE = 59; // 46
  6158. var COUNTERCLOCKWISETOPRIGHT_TRANS_SUBTYPE = 60; // 47
  6159. var VERTICALLEFT_TRANS_SUBTYPE = 61; // 93
  6160. var VERTICALRIGHT_TRANS_SUBTYPE = 62; // 94
  6161. var HORIZONTALLEFT_TRANS_SUBTYPE = 63; // 95
  6162. var HORIZONTALRIGHT_TRANS_SUBTYPE = 64; // 96
  6163. var TOPLEFTCLOCKWISE_TRANS_SUBTYPE = 65; // 69
  6164. var TOPRIGHTCLOCKWISE_TRANS_SUBTYPE = 66; // 70
  6165. var BOTTOMRIGHTCLOCKWISE_TRANS_SUBTYPE = 67; // 71
  6166. var BOTTOMLEFTCLOCKWISE_TRANS_SUBTYPE = 68; // 72
  6167. var TOPLEFTCOUNTERCLOCKWISE_TRANS_SUBTYPE = 69; // 73
  6168. var TOPRIGHTCOUNTERCLOCKWISE_TRANS_SUBTYPE = 70; // 74
  6169. var BOTTOMRIGHTCOUNTERCLOCKWISE_TRANS_SUBTYPE = 71; // 75
  6170. var BOTTOMLEFTCOUNTERCLOCKWISE_TRANS_SUBTYPE = 72; // 76
  6171. var DOUBLEBARNDOOR_TRANS_SUBTYPE = 73; // 17
  6172. var DOUBLEDIAMOND_TRANS_SUBTYPE = 74; // 18
  6173. var VERTICALTOPSAME_TRANS_SUBTYPE = 75; // 77
  6174. var VERTICALBOTTOMSAME_TRANS_SUBTYPE = 76; // 78
  6175. var VERTICALTOPLEFTOPPOSITE_TRANS_SUBTYPE = 77; // 79
  6176. var VERTICALBOTTOMLEFTOPPOSITE_TRANS_SUBTYPE = 78; // 80
  6177. var HORIZONTALLEFTSAME_TRANS_SUBTYPE = 79; // 81
  6178. var HORIZONTALRIGHTSAME_TRANS_SUBTYPE = 80; // 82
  6179. var HORIZONTALTOPLEFTOPPOSITE_TRANS_SUBTYPE = 81; // 83
  6180. var HORIZONTALTOPRIGHTOPPOSITE_TRANS_SUBTYPE = 82; // 84
  6181. var DIAGONALBOTTOMLEFTOPPOSITE_TRANS_SUBTYPE = 83; // 85
  6182. var DIAGONALTOPLEFTOPPOSITE_TRANS_SUBTYPE = 84; // 86
  6183. var TWOBOXTOP_TRANS_SUBTYPE = 85; // 87
  6184. var TWOBOXBOTTOM_TRANS_SUBTYPE = 86; // 88
  6185. var TWOBOXLEFT_TRANS_SUBTYPE = 87; // 89
  6186. var TWOBOXRIGHT_TRANS_SUBTYPE = 88; // 90
  6187. var FOURBOXVERTICAL_TRANS_SUBTYPE = 89; // 91
  6188. var FOURBOXHORIZONTAL_TRANS_SUBTYPE = 90; // 92
  6189. var aTransitionSubtypeInMap = {
  6190. 'default' : DEFAULT_TRANS_SUBTYPE,
  6191. 'leftToRight' : LEFTTORIGHT_TRANS_SUBTYPE,
  6192. 'topToBottom' : TOPTOBOTTOM_TRANS_SUBTYPE,
  6193. 'cornersIn' : CORNERSIN_TRANS_SUBTYPE,
  6194. 'cornersOut' : CORNERSOUT_TRANS_SUBTYPE,
  6195. 'vertical' : VERTICAL_TRANS_SUBTYPE,
  6196. 'centerTop' : CENTERTOP_TRANS_SUBTYPE,
  6197. 'centerRight' : CENTERRIGHT_TRANS_SUBTYPE,
  6198. 'top' : TOP_TRANS_SUBTYPE,
  6199. 'right' : RIGHT_TRANS_SUBTYPE,
  6200. 'bottom' : BOTTOM_TRANS_SUBTYPE,
  6201. 'left' : LEFT_TRANS_SUBTYPE,
  6202. 'horizontal' : HORIZONTAL_TRANS_SUBTYPE,
  6203. 'down' : DOWN_TRANS_SUBTYPE,
  6204. 'circle' : CIRCLE_TRANS_SUBTYPE,
  6205. 'clockwiseTwelve' : CLOCKWISETWELVE_TRANS_SUBTYPE,
  6206. 'clockwiseThree' : CLOCKWISETHREE_TRANS_SUBTYPE,
  6207. 'clockwiseSix' : CLOCKWISESIX_TRANS_SUBTYPE,
  6208. 'clockwiseNine' : CLOCKWISENINE_TRANS_SUBTYPE,
  6209. 'clockwiseRight' : CLOCKWISERIGHT_TRANS_SUBTYPE,
  6210. 'clockwiseTop' : CLOCKWISETOP_TRANS_SUBTYPE,
  6211. 'clockwiseBottom' : CLOCKWISEBOTTOM_TRANS_SUBTYPE,
  6212. 'clockwiseLeft' : CLOCKWISELEFT_TRANS_SUBTYPE,
  6213. 'clockwiseTopLeft' : CLOCKWISETOPLEFT_TRANS_SUBTYPE,
  6214. 'counterClockwiseBottomLeft' : COUNTERCLOCKWISEBOTTOMLEFT_TRANS_SUBTYPE,
  6215. 'clockwiseBottomRight' : CLOCKWISEBOTTOMRIGHT_TRANS_SUBTYPE,
  6216. 'counterClockwiseTopRight' : COUNTERCLOCKWISETOPRIGHT_TRANS_SUBTYPE,
  6217. 'twoBladeVertical' : TWOBLADEVERTICAL_TRANS_SUBTYPE,
  6218. 'twoBladeHorizontal' : TWOBLADEHORIZONTAL_TRANS_SUBTYPE,
  6219. 'fourBlade' : FOURBLADE_TRANS_SUBTYPE,
  6220. 'fromLeft' : FROMLEFT_TRANS_SUBTYPE,
  6221. 'fromTop' : FROMTOP_TRANS_SUBTYPE,
  6222. 'fromRight' : FROMRIGHT_TRANS_SUBTYPE,
  6223. 'fromBottom' : FROMBOTTOM_TRANS_SUBTYPE,
  6224. 'crossfade' : CROSSFADE_TRANS_SUBTYPE,
  6225. 'fadeToColor' : FADETOCOLOR_TRANS_SUBTYPE,
  6226. 'fadeFromColor' : FADEFROMCOLOR_TRANS_SUBTYPE,
  6227. 'fadeOverColor' : FADEOVERCOLOR_TRANS_SUBTYPE,
  6228. 'threeBlade' : THREEBLADE_TRANS_SUBTYPE,
  6229. 'eightBlade' : EIGHTBLADE_TRANS_SUBTYPE,
  6230. 'oneBlade' : ONEBLADE_TRANS_SUBTYPE,
  6231. 'across' : ACROSS_TRANS_SUBTYPE,
  6232. 'topLeftVertical' : TOPLEFTVERTICAL_TRANS_SUBTYPE,
  6233. 'topLeftHorizontal' : TOPLEFTHORIZONTAL_TRANS_SUBTYPE,
  6234. 'topLeftDiagonal' : TOPLEFTDIAGONAL_TRANS_SUBTYPE,
  6235. 'topRightDiagonal' : TOPRIGHTDIAGONAL_TRANS_SUBTYPE,
  6236. 'bottomRightDiagonal' : BOTTOMRIGHTDIAGONAL_TRANS_SUBTYPE,
  6237. 'topLeftClockwise' : TOPLEFTCLOCKWISE_TRANS_SUBTYPE,
  6238. 'topRightClockwise' : TOPRIGHTCLOCKWISE_TRANS_SUBTYPE,
  6239. 'bottomRightClockwise' : BOTTOMRIGHTCLOCKWISE_TRANS_SUBTYPE,
  6240. 'bottomLeftClockwise' : BOTTOMLEFTCLOCKWISE_TRANS_SUBTYPE,
  6241. 'topLeftCounterClockwise' : TOPLEFTCOUNTERCLOCKWISE_TRANS_SUBTYPE,
  6242. 'topRightCounterClockwise' : TOPRIGHTCOUNTERCLOCKWISE_TRANS_SUBTYPE,
  6243. 'bottomRightCounterClockwise' : BOTTOMRIGHTCOUNTERCLOCKWISE_TRANS_SUBTYPE,
  6244. 'bottomLeftCounterClockwise' : BOTTOMLEFTCOUNTERCLOCKWISE_TRANS_SUBTYPE,
  6245. 'bottomLeftDiagonal' : BOTTOMLEFTDIAGONAL_TRANS_SUBTYPE,
  6246. 'rectangle' : RECTANGLE_TRANS_SUBTYPE,
  6247. 'diamond' : DIAMOND_TRANS_SUBTYPE,
  6248. 'topLeft' : TOPLEFT_TRANS_SUBTYPE,
  6249. 'topRight' : TOPRIGHT_TRANS_SUBTYPE,
  6250. 'bottomRight' : BOTTOMRIGHT_TRANS_SUBTYPE,
  6251. 'bottomLeft' : BOTTOMLEFT_TRANS_SUBTYPE,
  6252. 'topCenter' : TOPCENTER_TRANS_SUBTYPE,
  6253. 'rightCenter' : RIGHTCENTER_TRANS_SUBTYPE,
  6254. 'bottomCenter' : BOTTOMCENTER_TRANS_SUBTYPE,
  6255. 'leftCenter' : LEFTCENTER_TRANS_SUBTYPE,
  6256. 'up' : UP_TRANS_SUBTYPE,
  6257. 'diagonalBottomLeft' : DIAGONALBOTTOMLEFT_TRANS_SUBTYPE,
  6258. 'diagonalTopLeft' : DIAGONALTOPLEFT_TRANS_SUBTYPE,
  6259. 'verticalLeft' : VERTICALLEFT_TRANS_SUBTYPE,
  6260. 'verticalRight' : VERTICALRIGHT_TRANS_SUBTYPE,
  6261. 'horizontalLeft' : HORIZONTALLEFT_TRANS_SUBTYPE,
  6262. 'horizontalRight' : HORIZONTALRIGHT_TRANS_SUBTYPE,
  6263. 'doubleBarnDoor' : DOUBLEBARNDOOR_TRANS_SUBTYPE,
  6264. 'doubleDiamond' : DOUBLEDIAMOND_TRANS_SUBTYPE,
  6265. 'verticalTopSame' : VERTICALTOPSAME_TRANS_SUBTYPE,
  6266. 'verticalBottomSame' : VERTICALBOTTOMSAME_TRANS_SUBTYPE,
  6267. 'verticalTopLeftOpposite' : VERTICALTOPLEFTOPPOSITE_TRANS_SUBTYPE,
  6268. 'verticalBottomLeftOpposite' : VERTICALBOTTOMLEFTOPPOSITE_TRANS_SUBTYPE,
  6269. 'horizontalLeftSame' : HORIZONTALLEFTSAME_TRANS_SUBTYPE,
  6270. 'horizontalRightSame' : HORIZONTALRIGHTSAME_TRANS_SUBTYPE,
  6271. 'horizontalTopLeftOpposite' : HORIZONTALTOPLEFTOPPOSITE_TRANS_SUBTYPE,
  6272. 'horizontalTopRightOpposite' : HORIZONTALTOPRIGHTOPPOSITE_TRANS_SUBTYPE,
  6273. 'diagonalBottomLeftOpposite' : DIAGONALBOTTOMLEFTOPPOSITE_TRANS_SUBTYPE,
  6274. 'diagonalTopLeftOpposite' : DIAGONALTOPLEFTOPPOSITE_TRANS_SUBTYPE,
  6275. 'twoBoxTop' : TWOBOXTOP_TRANS_SUBTYPE,
  6276. 'twoBoxBottom' : TWOBOXBOTTOM_TRANS_SUBTYPE,
  6277. 'twoBoxLeft' : TWOBOXLEFT_TRANS_SUBTYPE,
  6278. 'twoBoxRight' : TWOBOXRIGHT_TRANS_SUBTYPE,
  6279. 'fourBoxVertical' : FOURBOXVERTICAL_TRANS_SUBTYPE,
  6280. 'fourBoxHorizontal' : FOURBOXHORIZONTAL_TRANS_SUBTYPE
  6281. };
  6282. var TRANSITION_MODE_IN = 1;
  6283. var TRANSITION_MODE_OUT = 0;
  6284. var aTransitionModeOutMap = [ 'out', 'in' ];
  6285. var REVERSEMETHOD_IGNORE = 0;
  6286. var REVERSEMETHOD_INVERT_SWEEP = 1;
  6287. var REVERSEMETHOD_SUBTRACT_POLYGON = 2;
  6288. var REVERSEMETHOD_SUBTRACT_AND_INVERT = 3;
  6289. var REVERSEMETHOD_ROTATE_180 = 4;
  6290. var REVERSEMETHOD_FLIP_X = 5;
  6291. var REVERSEMETHOD_FLIP_Y = 6;
  6292. var aReverseMethodOutMap = ['ignore', 'invert sweep', 'subtract polygon',
  6293. 'subtract and invert', 'rotate 180', 'flip x', 'flip y'];
  6294. var aTransitionInfoTable = {};
  6295. aTransitionInfoTable[0] = {};
  6296. aTransitionInfoTable[0][0] =
  6297. {
  6298. 'class' : TRANSITION_INVALID,
  6299. 'rotationAngle' : 0.0,
  6300. 'scaleX' : 0.0,
  6301. 'scaleY' : 0.0,
  6302. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6303. 'outInvertsSweep' : false,
  6304. 'scaleIsotropically' : false
  6305. };
  6306. aTransitionInfoTable[SNAKEWIPE_TRANSITION] = {};
  6307. aTransitionInfoTable[SNAKEWIPE_TRANSITION][TOPLEFTVERTICAL_TRANS_SUBTYPE] =
  6308. {
  6309. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6310. 'rotationAngle' : -90.0,
  6311. 'scaleX' : 1.0,
  6312. 'scaleY' : 1.0,
  6313. 'reverseMethod' : REVERSEMETHOD_ROTATE_180,
  6314. 'outInvertsSweep' : true,
  6315. 'scaleIsotropically' : false
  6316. };
  6317. aTransitionInfoTable[SNAKEWIPE_TRANSITION][TOPLEFTHORIZONTAL_TRANS_SUBTYPE] =
  6318. {
  6319. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6320. 'rotationAngle' : 0.0,
  6321. 'scaleX' : 1.0,
  6322. 'scaleY' : 1.0,
  6323. 'reverseMethod' : REVERSEMETHOD_ROTATE_180,
  6324. 'outInvertSweep' : true,
  6325. 'scaleIsotropically' : false
  6326. };
  6327. aTransitionInfoTable[SNAKEWIPE_TRANSITION][TOPLEFTDIAGONAL_TRANS_SUBTYPE] =
  6328. {
  6329. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6330. 'rotationAngle' : 0.0,
  6331. 'scaleX' : 1.0,
  6332. 'scaleY' : 1.0,
  6333. 'reverseMethod' : REVERSEMETHOD_ROTATE_180,
  6334. 'outInvertSweep' : true,
  6335. 'scaleIsotropically' : false
  6336. };
  6337. aTransitionInfoTable[SNAKEWIPE_TRANSITION][TOPRIGHTDIAGONAL_TRANS_SUBTYPE] =
  6338. {
  6339. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6340. 'rotationAngle' : 0.0,
  6341. 'scaleX' : 1.0,
  6342. 'scaleY' : 1.0,
  6343. 'reverseMethod' : REVERSEMETHOD_ROTATE_180,
  6344. 'outInvertSweep' : true,
  6345. 'scaleIsotropically' : false
  6346. };
  6347. aTransitionInfoTable[SNAKEWIPE_TRANSITION][BOTTOMRIGHTDIAGONAL_TRANS_SUBTYPE] =
  6348. {
  6349. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6350. 'rotationAngle' : 180.0,
  6351. 'scaleX' : 1.0,
  6352. 'scaleY' : 1.0,
  6353. 'reverseMethod' : REVERSEMETHOD_ROTATE_180,
  6354. 'outInvertSweep' : true,
  6355. 'scaleIsotropically' : false
  6356. };
  6357. aTransitionInfoTable[SNAKEWIPE_TRANSITION][BOTTOMLEFTDIAGONAL_TRANS_SUBTYPE] =
  6358. {
  6359. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6360. 'rotationAngle' : 180.0,
  6361. 'scaleX' : 1.0,
  6362. 'scaleY' : 1.0,
  6363. 'reverseMethod' : REVERSEMETHOD_ROTATE_180,
  6364. 'outInvertSweep' : true,
  6365. 'scaleIsotropically' : false
  6366. }
  6367. aTransitionInfoTable[PARALLELSNAKESWIPE_TRANSITION] = {};
  6368. aTransitionInfoTable[PARALLELSNAKESWIPE_TRANSITION][VERTICALTOPSAME_TRANS_SUBTYPE] =
  6369. {
  6370. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6371. 'rotationAngle' : 0.0,
  6372. 'scaleX' : 1.0,
  6373. 'scaleY' : 1.0,
  6374. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6375. 'outInvertSweep' : true,
  6376. 'scaleIsotropically' : false
  6377. };
  6378. aTransitionInfoTable[PARALLELSNAKESWIPE_TRANSITION][VERTICALBOTTOMSAME_TRANS_SUBTYPE] =
  6379. {
  6380. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6381. 'rotationAngle' : 180.0,
  6382. 'scaleX' : 1.0,
  6383. 'scaleY' : 1.0,
  6384. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6385. 'outInvertSweep' : true,
  6386. 'scaleIsotropically' : false
  6387. };
  6388. aTransitionInfoTable[PARALLELSNAKESWIPE_TRANSITION][VERTICALTOPLEFTOPPOSITE_TRANS_SUBTYPE] =
  6389. {
  6390. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6391. 'rotationAngle' : 0.0,
  6392. 'scaleX' : 1.0,
  6393. 'scaleY' : 1.0,
  6394. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6395. 'outInvertSweep' : true,
  6396. 'scaleIsotropically' : false
  6397. };
  6398. aTransitionInfoTable[PARALLELSNAKESWIPE_TRANSITION][VERTICALBOTTOMLEFTOPPOSITE_TRANS_SUBTYPE] =
  6399. {
  6400. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6401. 'rotationAngle' : 0.0,
  6402. 'scaleX' : 1.0,
  6403. 'scaleY' : 1.0,
  6404. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6405. 'outInvertSweep' : true,
  6406. 'scaleIsotropically' : false
  6407. };
  6408. aTransitionInfoTable[PARALLELSNAKESWIPE_TRANSITION][HORIZONTALLEFTSAME_TRANS_SUBTYPE] =
  6409. {
  6410. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6411. 'rotationAngle' : -90.0,
  6412. 'scaleX' : 1.0,
  6413. 'scaleY' : 1.0,
  6414. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6415. 'outInvertSweep' : true,
  6416. 'scaleIsotropically' : false
  6417. };
  6418. aTransitionInfoTable[PARALLELSNAKESWIPE_TRANSITION][HORIZONTALRIGHTSAME_TRANS_SUBTYPE] =
  6419. {
  6420. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6421. 'rotationAngle' : 90.0,
  6422. 'scaleX' : 1.0,
  6423. 'scaleY' : 1.0,
  6424. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6425. 'outInvertSweep' : true,
  6426. 'scaleIsotropically' : false
  6427. };
  6428. aTransitionInfoTable[PARALLELSNAKESWIPE_TRANSITION][HORIZONTALTOPLEFTOPPOSITE_TRANS_SUBTYPE] =
  6429. {
  6430. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6431. 'rotationAngle' : -90.0,
  6432. 'scaleX' : 1.0,
  6433. 'scaleY' : 1.0,
  6434. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6435. 'outInvertSweep' : true,
  6436. 'scaleIsotropically' : false
  6437. };
  6438. aTransitionInfoTable[PARALLELSNAKESWIPE_TRANSITION][HORIZONTALTOPRIGHTOPPOSITE_TRANS_SUBTYPE] =
  6439. {
  6440. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6441. 'rotationAngle' : -90.0,
  6442. 'scaleX' : 1.0,
  6443. 'scaleY' : 1.0,
  6444. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6445. 'outInvertSweep' : true,
  6446. 'scaleIsotropically' : false
  6447. };
  6448. aTransitionInfoTable[PARALLELSNAKESWIPE_TRANSITION][DIAGONALTOPLEFTOPPOSITE_TRANS_SUBTYPE] =
  6449. {
  6450. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6451. 'rotationAngle' : 0.0,
  6452. 'scaleX' : 1.0,
  6453. 'scaleY' : 1.0,
  6454. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6455. 'outInvertSweep' : true,
  6456. 'scaleIsotropically' : false
  6457. };
  6458. aTransitionInfoTable[PARALLELSNAKESWIPE_TRANSITION][DIAGONALBOTTOMLEFTOPPOSITE_TRANS_SUBTYPE] =
  6459. {
  6460. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6461. 'rotationAngle' : 0.0,
  6462. 'scaleX' : 1.0,
  6463. 'scaleY' : 1.0,
  6464. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6465. 'outInvertSweep' : true,
  6466. 'scaleIsotropically' : false
  6467. };
  6468. aTransitionInfoTable[SPIRALWIPE_TRANSITION] = {};
  6469. aTransitionInfoTable[SPIRALWIPE_TRANSITION][TOPLEFTCLOCKWISE_TRANS_SUBTYPE] =
  6470. {
  6471. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6472. 'rotationAngle' : 0.0,
  6473. 'scaleX' : 1.0,
  6474. 'scaleY' : 1.0,
  6475. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6476. 'outInvertSweep' : true,
  6477. 'scaleIsotropically' : false
  6478. };
  6479. aTransitionInfoTable[SPIRALWIPE_TRANSITION][TOPRIGHTCLOCKWISE_TRANS_SUBTYPE] =
  6480. {
  6481. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6482. 'rotationAngle' : 90.0,
  6483. 'scaleX' : 1.0,
  6484. 'scaleY' : 1.0,
  6485. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6486. 'outInvertSweep' : true,
  6487. 'scaleIsotropically' : false
  6488. };
  6489. aTransitionInfoTable[SPIRALWIPE_TRANSITION][BOTTOMRIGHTCLOCKWISE_TRANS_SUBTYPE] =
  6490. {
  6491. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6492. 'rotationAngle' : 180.0,
  6493. 'scaleX' : 1.0,
  6494. 'scaleY' : 1.0,
  6495. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6496. 'outInvertSweep' : true,
  6497. 'scaleIsotropically' : false
  6498. };
  6499. aTransitionInfoTable[SPIRALWIPE_TRANSITION][BOTTOMLEFTCLOCKWISE_TRANS_SUBTYPE] =
  6500. {
  6501. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6502. 'rotationAngle' : 270.0,
  6503. 'scaleX' : 1.0,
  6504. 'scaleY' : 1.0,
  6505. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6506. 'outInvertSweep' : true,
  6507. 'scaleIsotropically' : false
  6508. };
  6509. aTransitionInfoTable[SPIRALWIPE_TRANSITION][TOPLEFTCOUNTERCLOCKWISE_TRANS_SUBTYPE] =
  6510. {
  6511. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6512. 'rotationAngle' : 90.0,
  6513. 'scaleX' : 1.0,
  6514. 'scaleY' : 1.0,
  6515. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6516. 'outInvertSweep' : true,
  6517. 'scaleIsotropically' : false
  6518. };
  6519. aTransitionInfoTable[SPIRALWIPE_TRANSITION][TOPRIGHTCOUNTERCLOCKWISE_TRANS_SUBTYPE] =
  6520. {
  6521. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6522. 'rotationAngle' : 180.0,
  6523. 'scaleX' : 1.0,
  6524. 'scaleY' : 1.0,
  6525. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6526. 'outInvertSweep' : true,
  6527. 'scaleIsotropically' : false
  6528. };
  6529. aTransitionInfoTable[SPIRALWIPE_TRANSITION][BOTTOMRIGHTCOUNTERCLOCKWISE_TRANS_SUBTYPE] =
  6530. {
  6531. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6532. 'rotationAngle' : 270.0,
  6533. 'scaleX' : 1.0,
  6534. 'scaleY' : 1.0,
  6535. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6536. 'outInvertSweep' : true,
  6537. 'scaleIsotropically' : false
  6538. };
  6539. aTransitionInfoTable[SPIRALWIPE_TRANSITION][BOTTOMLEFTCOUNTERCLOCKWISE_TRANS_SUBTYPE] =
  6540. {
  6541. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6542. 'rotationAngle' : 0.0,
  6543. 'scaleX' : 1.0,
  6544. 'scaleY' : 1.0,
  6545. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6546. 'outInvertSweep' : true,
  6547. 'scaleIsotropically' : false
  6548. };
  6549. aTransitionInfoTable[BOXSNAKESWIPE_TRANSITION] = {};
  6550. aTransitionInfoTable[BOXSNAKESWIPE_TRANSITION][TWOBOXTOP_TRANS_SUBTYPE] =
  6551. {
  6552. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6553. 'rotationAngle' : 90.0,
  6554. 'scaleX' : 1.0,
  6555. 'scaleY' : 1.0,
  6556. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6557. 'outInvertSweep' : true,
  6558. 'scaleIsotropically' : false
  6559. };
  6560. aTransitionInfoTable[BOXSNAKESWIPE_TRANSITION][TWOBOXBOTTOM_TRANS_SUBTYPE] =
  6561. {
  6562. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6563. 'rotationAngle' : -90.0,
  6564. 'scaleX' : 1.0,
  6565. 'scaleY' : 1.0,
  6566. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6567. 'outInvertSweep' : true,
  6568. 'scaleIsotropically' : false
  6569. };
  6570. aTransitionInfoTable[BOXSNAKESWIPE_TRANSITION][TWOBOXLEFT_TRANS_SUBTYPE] =
  6571. {
  6572. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6573. 'rotationAngle' : 0.0,
  6574. 'scaleX' : 1.0,
  6575. 'scaleY' : 1.0,
  6576. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6577. 'outInvertSweep' : true,
  6578. 'scaleIsotropically' : false
  6579. };
  6580. aTransitionInfoTable[BOXSNAKESWIPE_TRANSITION][TWOBOXRIGHT_TRANS_SUBTYPE] =
  6581. {
  6582. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6583. 'rotationAngle' : 180.0,
  6584. 'scaleX' : 1.0,
  6585. 'scaleY' : 1.0,
  6586. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6587. 'outInvertSweep' : true,
  6588. 'scaleIsotropically' : false
  6589. };
  6590. aTransitionInfoTable[BOXSNAKESWIPE_TRANSITION][FOURBOXVERTICAL_TRANS_SUBTYPE] =
  6591. {
  6592. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6593. 'rotationAngle' : 90.0,
  6594. 'scaleX' : 1.0,
  6595. 'scaleY' : 1.0,
  6596. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6597. 'outInvertSweep' : true,
  6598. 'scaleIsotropically' : false
  6599. };
  6600. aTransitionInfoTable[BOXSNAKESWIPE_TRANSITION][FOURBOXHORIZONTAL_TRANS_SUBTYPE] =
  6601. {
  6602. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6603. 'rotationAngle' : 0.0,
  6604. 'scaleX' : 1.0,
  6605. 'scaleY' : 1.0,
  6606. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6607. 'outInvertSweep' : true,
  6608. 'scaleIsotropically' : false
  6609. };
  6610. aTransitionInfoTable[BARNDOORWIPE_TRANSITION] = {};
  6611. aTransitionInfoTable[BARNDOORWIPE_TRANSITION][VERTICAL_TRANS_SUBTYPE] =
  6612. {
  6613. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6614. 'rotationAngle': 0.0,
  6615. 'scaleX': 1.0,
  6616. 'scaleY': 1.0,
  6617. 'reverseMethod': REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6618. 'outInvertsSweep': true,
  6619. 'scaleIsotropically': false
  6620. };
  6621. aTransitionInfoTable[BARNDOORWIPE_TRANSITION][HORIZONTAL_TRANS_SUBTYPE] =
  6622. {
  6623. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6624. 'rotationAngle': 90.0,
  6625. 'scaleX': 1.0,
  6626. 'scaleY': 1.0,
  6627. 'reverseMethod': REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6628. 'outInvertsSweep': true,
  6629. 'scaleIsotropically': false
  6630. };
  6631. aTransitionInfoTable[BARNDOORWIPE_TRANSITION][DIAGONALBOTTOMLEFT_TRANS_SUBTYPE] =
  6632. {
  6633. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6634. 'rotationAngle': 45.0,
  6635. 'scaleX': Math.SQRT2,
  6636. 'scaleY': Math.SQRT2,
  6637. 'reverseMethod': REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6638. 'outInvertsSweep': true,
  6639. 'scaleIsotropically': false
  6640. };
  6641. aTransitionInfoTable[BARNDOORWIPE_TRANSITION][DIAGONALTOPLEFT_TRANS_SUBTYPE] =
  6642. {
  6643. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6644. 'rotationAngle': -45.0,
  6645. 'scaleX': Math.SQRT2,
  6646. 'scaleY': Math.SQRT2,
  6647. 'reverseMethod': REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6648. 'outInvertsSweep': true,
  6649. 'scaleIsotropically': false
  6650. };
  6651. aTransitionInfoTable[MISCDIAGONALWIPE_TRANSITION] = {};
  6652. aTransitionInfoTable[MISCDIAGONALWIPE_TRANSITION][DOUBLEBARNDOOR_TRANS_SUBTYPE] =
  6653. {
  6654. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6655. 'rotationAngle': 45.0,
  6656. 'scaleX': Math.SQRT2,
  6657. 'scaleY': Math.SQRT2,
  6658. 'reverseMethod': REVERSEMETHOD_IGNORE,
  6659. 'outInvertsSweep': true,
  6660. 'scaleIsotropically': false
  6661. };
  6662. aTransitionInfoTable[MISCDIAGONALWIPE_TRANSITION][DOUBLEDIAMOND_TRANS_SUBTYPE] =
  6663. {
  6664. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6665. 'rotationAngle': 0.0,
  6666. 'scaleX': 1,
  6667. 'scaleY': 1,
  6668. 'reverseMethod': REVERSEMETHOD_IGNORE,
  6669. 'outInvertsSweep': true,
  6670. 'scaleIsotropically': false
  6671. };
  6672. aTransitionInfoTable[IRISWIPE_TRANSITION] = {};
  6673. aTransitionInfoTable[IRISWIPE_TRANSITION][RECTANGLE_TRANS_SUBTYPE] =
  6674. {
  6675. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6676. 'rotationAngle': 0.0,
  6677. 'scaleX': 1.0,
  6678. 'scaleY': 1.0,
  6679. 'reverseMethod': REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6680. 'outInvertsSweep': true,
  6681. 'scaleIsotropically': false
  6682. };
  6683. aTransitionInfoTable[IRISWIPE_TRANSITION][DIAMOND_TRANS_SUBTYPE] =
  6684. {
  6685. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6686. 'rotationAngle': 45.0,
  6687. 'scaleX': Math.SQRT2,
  6688. 'scaleY': Math.SQRT2,
  6689. 'reverseMethod': REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6690. 'outInvertsSweep': true,
  6691. 'scaleIsotropically': false
  6692. };
  6693. aTransitionInfoTable[ZIGZAGWIPE_TRANSITION] = {};
  6694. aTransitionInfoTable[ZIGZAGWIPE_TRANSITION][LEFTTORIGHT_TRANS_SUBTYPE] =
  6695. {
  6696. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6697. 'rotationAngle' : 0.0,
  6698. 'scaleX' : 1.0,
  6699. 'scaleY' : 1.0,
  6700. 'reverseMethod' : REVERSEMETHOD_FLIP_X,
  6701. 'outInvertsSweep' : true,
  6702. 'scaleIsotropically' : false
  6703. };
  6704. aTransitionInfoTable[ZIGZAGWIPE_TRANSITION][TOPTOBOTTOM_TRANS_SUBTYPE] =
  6705. {
  6706. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6707. 'rotationAngle' : 90.0,
  6708. 'scaleX' : 1.0,
  6709. 'scaleY' : 1.0,
  6710. 'reverseMethod' : REVERSEMETHOD_FLIP_Y,
  6711. 'outInvertsSweep' : true,
  6712. 'scaleIsotropically' : false
  6713. };
  6714. aTransitionInfoTable[BARNZIGZAGWIPE_TRANSITION] = {};
  6715. aTransitionInfoTable[BARNZIGZAGWIPE_TRANSITION][VERTICAL_TRANS_SUBTYPE] =
  6716. {
  6717. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6718. 'rotationAngle' : 0.0,
  6719. 'scaleX' : 1.0,
  6720. 'scaleY' : 1.0,
  6721. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6722. 'outInvertsSweep' : true,
  6723. 'scaleIsotropically' : false
  6724. };
  6725. aTransitionInfoTable[BARNZIGZAGWIPE_TRANSITION][HORIZONTAL_TRANS_SUBTYPE] =
  6726. {
  6727. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6728. 'rotationAngle' : 90.0,
  6729. 'scaleX' : 1.0,
  6730. 'scaleY' : 1.0,
  6731. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6732. 'outInvertsSweep' : true,
  6733. 'scaleIsotropically' : false
  6734. };
  6735. aTransitionInfoTable[BARWIPE_TRANSITION] = {};
  6736. aTransitionInfoTable[BARWIPE_TRANSITION][LEFTTORIGHT_TRANS_SUBTYPE] =
  6737. {
  6738. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6739. 'rotationAngle' : 0.0,
  6740. 'scaleX' : 1.0,
  6741. 'scaleY' : 1.0,
  6742. 'reverseMethod' : REVERSEMETHOD_FLIP_X,
  6743. 'outInvertsSweep' : false,
  6744. 'scaleIsotropically' : false
  6745. };
  6746. aTransitionInfoTable[BARWIPE_TRANSITION][TOPTOBOTTOM_TRANS_SUBTYPE] =
  6747. {
  6748. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6749. 'rotationAngle' : 90.0,
  6750. 'scaleX' : 1.0,
  6751. 'scaleY' : 1.0,
  6752. 'reverseMethod' : REVERSEMETHOD_FLIP_Y,
  6753. 'outInvertsSweep' : false,
  6754. 'scaleIsotropically' : false
  6755. };
  6756. aTransitionInfoTable[WATERFALLWIPE_TRANSITION] = {};
  6757. aTransitionInfoTable[WATERFALLWIPE_TRANSITION][VERTICALLEFT_TRANS_SUBTYPE] =
  6758. {
  6759. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6760. 'rotationAngle' : 0.0,
  6761. 'scaleX' : 1.0,
  6762. 'scaleY' : 1.0,
  6763. 'reverseMethod' : REVERSEMETHOD_ROTATE_180,
  6764. 'outInvertsSweep' : true,
  6765. 'scaleIsotropically' : false
  6766. };
  6767. aTransitionInfoTable[WATERFALLWIPE_TRANSITION][VERTICALRIGHT_TRANS_SUBTYPE] =
  6768. {
  6769. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6770. 'rotationAngle' : 0.0,
  6771. 'scaleX' : 1.0,
  6772. 'scaleY' : 1.0,
  6773. 'reverseMethod' : REVERSEMETHOD_ROTATE_180,
  6774. 'outInvertsSweep' : true,
  6775. 'scaleIsotropically' : false
  6776. };
  6777. aTransitionInfoTable[WATERFALLWIPE_TRANSITION][HORIZONTALLEFT_TRANS_SUBTYPE] =
  6778. {
  6779. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6780. 'rotationAngle' : -90.0,
  6781. 'scaleX' : 1.0,
  6782. 'scaleY' : 1.0,
  6783. 'reverseMethod' : REVERSEMETHOD_ROTATE_180,
  6784. 'outInvertsSweep' : true,
  6785. 'scaleIsotropically' : false
  6786. };
  6787. aTransitionInfoTable[WATERFALLWIPE_TRANSITION][HORIZONTALRIGHT_TRANS_SUBTYPE] =
  6788. {
  6789. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6790. 'rotationAngle' : 90.0,
  6791. 'scaleX' : 1.0,
  6792. 'scaleY' : 1.0,
  6793. 'reverseMethod' : REVERSEMETHOD_ROTATE_180,
  6794. 'outInvertsSweep' : true,
  6795. 'scaleIsotropically' : false
  6796. };
  6797. aTransitionInfoTable[BOXWIPE_TRANSITION] = {};
  6798. aTransitionInfoTable[BOXWIPE_TRANSITION][TOPLEFT_TRANS_SUBTYPE] =
  6799. {
  6800. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6801. 'rotationAngle' : 0.0,
  6802. 'scaleX' : 1.0,
  6803. 'scaleY' : 1.0,
  6804. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6805. 'outInvertsSweep' : true,
  6806. 'scaleIsotropically' : false
  6807. };
  6808. aTransitionInfoTable[BOXWIPE_TRANSITION][TOPRIGHT_TRANS_SUBTYPE] =
  6809. {
  6810. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6811. 'rotationAngle' : 90.0,
  6812. 'scaleX' : 1.0,
  6813. 'scaleY' : 1.0,
  6814. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6815. 'outInvertsSweep' : true,
  6816. 'scaleIsotropically' : false
  6817. };
  6818. aTransitionInfoTable[BOXWIPE_TRANSITION][BOTTOMRIGHT_TRANS_SUBTYPE] =
  6819. {
  6820. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6821. 'rotationAngle' : 180.0,
  6822. 'scaleX' : 1.0,
  6823. 'scaleY' : 1.0,
  6824. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6825. 'outInvertsSweep' : true,
  6826. 'scaleIsotropically' : false
  6827. };
  6828. aTransitionInfoTable[BOXWIPE_TRANSITION][BOTTOMLEFT_TRANS_SUBTYPE] =
  6829. {
  6830. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6831. 'rotationAngle' : -90.0,
  6832. 'scaleX' : 1.0,
  6833. 'scaleY' : 1.0,
  6834. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  6835. 'outInvertsSweep' : true,
  6836. 'scaleIsotropically' : false
  6837. };
  6838. aTransitionInfoTable[BOXWIPE_TRANSITION][TOPCENTER_TRANS_SUBTYPE] =
  6839. {
  6840. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6841. 'rotationAngle' : 0.0,
  6842. 'scaleX' : 1.0,
  6843. 'scaleY' : 1.0,
  6844. 'reverseMethod' : REVERSEMETHOD_FLIP_Y,
  6845. 'outInvertsSweep' : true,
  6846. 'scaleIsotropically' : false
  6847. };
  6848. aTransitionInfoTable[BOXWIPE_TRANSITION][RIGHTCENTER_TRANS_SUBTYPE] =
  6849. {
  6850. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6851. 'rotationAngle' : 90.0,
  6852. 'scaleX' : 1.0,
  6853. 'scaleY' : 1.0,
  6854. 'reverseMethod' : REVERSEMETHOD_FLIP_X,
  6855. 'outInvertsSweep' : true,
  6856. 'scaleIsotropically' : false
  6857. };
  6858. aTransitionInfoTable[BOXWIPE_TRANSITION][BOTTOMCENTER_TRANS_SUBTYPE] =
  6859. {
  6860. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6861. 'rotationAngle' : 180.0,
  6862. 'scaleX' : 1.0,
  6863. 'scaleY' : 1.0,
  6864. 'reverseMethod' : REVERSEMETHOD_FLIP_Y,
  6865. 'outInvertsSweep' : true,
  6866. 'scaleIsotropically' : false
  6867. };
  6868. aTransitionInfoTable[BOXWIPE_TRANSITION][LEFTCENTER_TRANS_SUBTYPE] =
  6869. {
  6870. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6871. 'rotationAngle' : -90.0,
  6872. 'scaleX' : 1.0,
  6873. 'scaleY' : 1.0,
  6874. 'reverseMethod' : REVERSEMETHOD_FLIP_X,
  6875. 'outInvertsSweep' : true,
  6876. 'scaleIsotropically' : false
  6877. };
  6878. aTransitionInfoTable[FOURBOXWIPE_TRANSITION] = {};
  6879. aTransitionInfoTable[FOURBOXWIPE_TRANSITION][CORNERSIN_TRANS_SUBTYPE] =
  6880. aTransitionInfoTable[FOURBOXWIPE_TRANSITION][CORNERSOUT_TRANS_SUBTYPE] =
  6881. {
  6882. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6883. 'rotationAngle' : 0.0,
  6884. 'scaleX' : 1.0,
  6885. 'scaleY' : 1.0,
  6886. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6887. 'outInvertsSweep' : true,
  6888. 'scaleIsotropically' : false
  6889. };
  6890. aTransitionInfoTable[ELLIPSEWIPE_TRANSITION] = {};
  6891. aTransitionInfoTable[ELLIPSEWIPE_TRANSITION][CIRCLE_TRANS_SUBTYPE] =
  6892. {
  6893. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6894. 'rotationAngle' : 0.0,
  6895. 'scaleX' : 1.0,
  6896. 'scaleY' : 1.0,
  6897. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6898. 'outInvertsSweep' : true,
  6899. 'scaleIsotropically' : true
  6900. };
  6901. aTransitionInfoTable[ELLIPSEWIPE_TRANSITION][HORIZONTAL_TRANS_SUBTYPE] =
  6902. {
  6903. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6904. 'rotationAngle' : 0.0,
  6905. 'scaleX' : 1.0,
  6906. 'scaleY' : 1.0,
  6907. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6908. 'outInvertsSweep' : true,
  6909. 'scaleIsotropically' : false
  6910. };
  6911. aTransitionInfoTable[ELLIPSEWIPE_TRANSITION][VERTICAL_TRANS_SUBTYPE] =
  6912. {
  6913. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6914. 'rotationAngle' : 90.0,
  6915. 'scaleX' : 1.0,
  6916. 'scaleY' : 1.0,
  6917. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  6918. 'outInvertsSweep' : true,
  6919. 'scaleIsotropically' : false
  6920. };
  6921. aTransitionInfoTable[CLOCKWIPE_TRANSITION] = {};
  6922. aTransitionInfoTable[CLOCKWIPE_TRANSITION][CLOCKWISETWELVE_TRANS_SUBTYPE] =
  6923. {
  6924. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6925. 'rotationAngle' : 0.0,
  6926. 'scaleX' : 1.0,
  6927. 'scaleY' : 1.0,
  6928. 'reverseMethod' : REVERSEMETHOD_FLIP_X,
  6929. 'outInvertsSweep' : true,
  6930. 'scaleIsotropically' : false
  6931. };
  6932. aTransitionInfoTable[CLOCKWIPE_TRANSITION][CLOCKWISETHREE_TRANS_SUBTYPE] =
  6933. {
  6934. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6935. 'rotationAngle' : 90.0,
  6936. 'scaleX' : 1.0,
  6937. 'scaleY' : 1.0,
  6938. 'reverseMethod' : REVERSEMETHOD_FLIP_Y,
  6939. 'outInvertsSweep' : true,
  6940. 'scaleIsotropically' : false
  6941. };
  6942. aTransitionInfoTable[CLOCKWIPE_TRANSITION][CLOCKWISESIX_TRANS_SUBTYPE] =
  6943. {
  6944. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6945. 'rotationAngle' : 180.0,
  6946. 'scaleX' : 1.0,
  6947. 'scaleY' : 1.0,
  6948. 'reverseMethod' : REVERSEMETHOD_FLIP_X,
  6949. 'outInvertsSweep' : true,
  6950. 'scaleIsotropically' : false
  6951. };
  6952. aTransitionInfoTable[CLOCKWIPE_TRANSITION][CLOCKWISENINE_TRANS_SUBTYPE] =
  6953. {
  6954. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6955. 'rotationAngle' : 270.0,
  6956. 'scaleX' : 1.0,
  6957. 'scaleY' : 1.0,
  6958. 'reverseMethod' : REVERSEMETHOD_FLIP_Y,
  6959. 'outInvertsSweep' : true,
  6960. 'scaleIsotropically' : false
  6961. };
  6962. aTransitionInfoTable[VEEWIPE_TRANSITION] = {};
  6963. aTransitionInfoTable[VEEWIPE_TRANSITION][DOWN_TRANS_SUBTYPE] =
  6964. {
  6965. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6966. 'rotationAngle' : 0.0,
  6967. 'scaleX' : 1.0,
  6968. 'scaleY' : 1.0,
  6969. 'reverseMethod' : REVERSEMETHOD_FLIP_Y,
  6970. 'outInvertsSweep' : true,
  6971. 'scaleIsotropically' : false
  6972. };
  6973. aTransitionInfoTable[VEEWIPE_TRANSITION][LEFT_TRANS_SUBTYPE] =
  6974. {
  6975. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6976. 'rotationAngle' : 90.0,
  6977. 'scaleX' : 1.0,
  6978. 'scaleY' : 1.0,
  6979. 'reverseMethod' : REVERSEMETHOD_FLIP_X,
  6980. 'outInvertsSweep' : true,
  6981. 'scaleIsotropically' : false
  6982. };
  6983. aTransitionInfoTable[VEEWIPE_TRANSITION][UP_TRANS_SUBTYPE] =
  6984. {
  6985. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6986. 'rotationAngle' : 180.0,
  6987. 'scaleX' : 1.0,
  6988. 'scaleY' : 1.0,
  6989. 'reverseMethod' : REVERSEMETHOD_FLIP_Y,
  6990. 'outInvertsSweep' : true,
  6991. 'scaleIsotropically' : false
  6992. };
  6993. aTransitionInfoTable[VEEWIPE_TRANSITION][RIGHT_TRANS_SUBTYPE] =
  6994. {
  6995. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  6996. 'rotationAngle' : -90.0,
  6997. 'scaleX' : 1.0,
  6998. 'scaleY' : 1.0,
  6999. 'reverseMethod' : REVERSEMETHOD_FLIP_X,
  7000. 'outInvertsSweep' : true,
  7001. 'scaleIsotropically' : false
  7002. };
  7003. aTransitionInfoTable[FANWIPE_TRANSITION] = {};
  7004. aTransitionInfoTable[FANWIPE_TRANSITION][CENTERTOP_TRANS_SUBTYPE] =
  7005. {
  7006. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7007. 'rotationAngle' : 0.0,
  7008. 'scaleX' : 1.0,
  7009. 'scaleY' : 1.0,
  7010. 'reverseMethod' : REVERSEMETHOD_FLIP_Y,
  7011. 'outInvertsSweep' : true,
  7012. 'scaleIsotropically' : false
  7013. };
  7014. aTransitionInfoTable[FANWIPE_TRANSITION][CENTERRIGHT_TRANS_SUBTYPE] =
  7015. {
  7016. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7017. 'rotationAngle' : 90.0,
  7018. 'scaleX' : 1.0,
  7019. 'scaleY' : 1.0,
  7020. 'reverseMethod' : REVERSEMETHOD_FLIP_X,
  7021. 'outInvertsSweep' : true,
  7022. 'scaleIsotropically' : false
  7023. };
  7024. aTransitionInfoTable[FANWIPE_TRANSITION][TOP_TRANS_SUBTYPE] =
  7025. {
  7026. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7027. 'rotationAngle' : 180.0,
  7028. 'scaleX' : 1.0,
  7029. 'scaleY' : 1.0,
  7030. 'reverseMethod' : REVERSEMETHOD_FLIP_Y,
  7031. 'outInvertsSweep' : true,
  7032. 'scaleIsotropically' : false
  7033. };
  7034. aTransitionInfoTable[FANWIPE_TRANSITION][RIGHT_TRANS_SUBTYPE] =
  7035. {
  7036. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7037. 'rotationAngle' : -90.0,
  7038. 'scaleX' : 1.0,
  7039. 'scaleY' : 1.0,
  7040. 'reverseMethod' : REVERSEMETHOD_FLIP_X,
  7041. 'outInvertsSweep' : true,
  7042. 'scaleIsotropically' : false
  7043. };
  7044. aTransitionInfoTable[FANWIPE_TRANSITION][BOTTOM_TRANS_SUBTYPE] =
  7045. {
  7046. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7047. 'rotationAngle' : 180.0,
  7048. 'scaleX' : 1.0,
  7049. 'scaleY' : 1.0,
  7050. 'reverseMethod' : REVERSEMETHOD_FLIP_Y,
  7051. 'outInvertsSweep' : true,
  7052. 'scaleIsotropically' : false
  7053. };
  7054. aTransitionInfoTable[FANWIPE_TRANSITION][LEFT_TRANS_SUBTYPE] =
  7055. {
  7056. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7057. 'rotationAngle' : 90.0,
  7058. 'scaleX' : 1.0,
  7059. 'scaleY' : 1.0,
  7060. 'reverseMethod' : REVERSEMETHOD_FLIP_X,
  7061. 'outInvertsSweep' : true,
  7062. 'scaleIsotropically' : false
  7063. };
  7064. aTransitionInfoTable[PINWHEELWIPE_TRANSITION] = {};
  7065. aTransitionInfoTable[PINWHEELWIPE_TRANSITION][ONEBLADE_TRANS_SUBTYPE] =
  7066. aTransitionInfoTable[PINWHEELWIPE_TRANSITION][TWOBLADEVERTICAL_TRANS_SUBTYPE] =
  7067. aTransitionInfoTable[PINWHEELWIPE_TRANSITION][THREEBLADE_TRANS_SUBTYPE] =
  7068. aTransitionInfoTable[PINWHEELWIPE_TRANSITION][FOURBLADE_TRANS_SUBTYPE] =
  7069. aTransitionInfoTable[PINWHEELWIPE_TRANSITION][EIGHTBLADE_TRANS_SUBTYPE] =
  7070. {
  7071. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7072. 'rotationAngle' : 0.0,
  7073. 'scaleX' : 1.0,
  7074. 'scaleY' : 1.0,
  7075. 'reverseMethod' : REVERSEMETHOD_FLIP_X,
  7076. 'outInvertsSweep' : true,
  7077. 'scaleIsotropically' : true
  7078. };
  7079. aTransitionInfoTable[PINWHEELWIPE_TRANSITION][TWOBLADEHORIZONTAL_TRANS_SUBTYPE] =
  7080. {
  7081. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7082. 'rotationAngle' : -90.0,
  7083. 'scaleX' : 1.0,
  7084. 'scaleY' : 1.0,
  7085. 'reverseMethod' : REVERSEMETHOD_FLIP_Y,
  7086. 'outInvertsSweep' : true,
  7087. 'scaleIsotropically' : true
  7088. };
  7089. aTransitionInfoTable[PUSHWIPE_TRANSITION] = {};
  7090. aTransitionInfoTable[PUSHWIPE_TRANSITION][FROMLEFT_TRANS_SUBTYPE] =
  7091. aTransitionInfoTable[PUSHWIPE_TRANSITION][FROMTOP_TRANS_SUBTYPE] =
  7092. aTransitionInfoTable[PUSHWIPE_TRANSITION][FROMRIGHT_TRANS_SUBTYPE] =
  7093. aTransitionInfoTable[PUSHWIPE_TRANSITION][FROMBOTTOM_TRANS_SUBTYPE] =
  7094. {
  7095. 'class' : TRANSITION_SPECIAL,
  7096. 'rotationAngle' : 0.0,
  7097. 'scaleX' : 1.0,
  7098. 'scaleY' : 1.0,
  7099. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  7100. 'outInvertsSweep' : true,
  7101. 'scaleIsotropically' : false
  7102. };
  7103. aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION] = {};
  7104. aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION][CLOCKWISETOP_TRANS_SUBTYPE] =
  7105. {
  7106. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7107. 'rotationAngle' : 0.0,
  7108. 'scaleX' : 1.0,
  7109. 'scaleY' : 1.0,
  7110. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  7111. 'outInvertsSweep' : true,
  7112. 'scaleIsotropically' : false
  7113. };
  7114. aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION][CLOCKWISERIGHT_TRANS_SUBTYPE] =
  7115. {
  7116. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7117. 'rotationAngle' : 90.0,
  7118. 'scaleX' : 1.0,
  7119. 'scaleY' : 1.0,
  7120. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  7121. 'outInvertsSweep' : true,
  7122. 'scaleIsotropically' : false
  7123. };
  7124. aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION][CLOCKWISEBOTTOM_TRANS_SUBTYPE] =
  7125. {
  7126. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7127. 'rotationAngle' : 180.0,
  7128. 'scaleX' : 1.0,
  7129. 'scaleY' : 1.0,
  7130. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  7131. 'outInvertsSweep' : true,
  7132. 'scaleIsotropically' : false
  7133. };
  7134. aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION][CLOCKWISELEFT_TRANS_SUBTYPE] =
  7135. {
  7136. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7137. 'rotationAngle' : 270.0,
  7138. 'scaleX' : 1.0,
  7139. 'scaleY' : 1.0,
  7140. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  7141. 'outInvertsSweep' : true,
  7142. 'scaleIsotropically' : false
  7143. };
  7144. aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION][CLOCKWISETOPLEFT_TRANS_SUBTYPE] =
  7145. {
  7146. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7147. 'rotationAngle' : 0.0,
  7148. 'scaleX' : 1.0,
  7149. 'scaleY' : 1.0,
  7150. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  7151. 'outInvertsSweep' : true,
  7152. 'scaleIsotropically' : false
  7153. };
  7154. aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION][COUNTERCLOCKWISEBOTTOMLEFT_TRANS_SUBTYPE] =
  7155. {
  7156. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7157. 'rotationAngle' : 180.0,
  7158. 'scaleX' : 1.0,
  7159. 'scaleY' : 1.0,
  7160. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  7161. 'outInvertsSweep' : true,
  7162. 'scaleIsotropically' : false
  7163. };
  7164. aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION][CLOCKWISEBOTTOMRIGHT_TRANS_SUBTYPE] =
  7165. {
  7166. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7167. 'rotationAngle' : 180.0,
  7168. 'scaleX' : 1.0,
  7169. 'scaleY' : 1.0,
  7170. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  7171. 'outInvertsSweep' : true,
  7172. 'scaleIsotropically' : false
  7173. };
  7174. aTransitionInfoTable[SINGLESWEEPWIPE_TRANSITION][COUNTERCLOCKWISETOPRIGHT_TRANS_SUBTYPE] =
  7175. {
  7176. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7177. 'rotationAngle' : 0.0,
  7178. 'scaleX' : 1.0,
  7179. 'scaleY' : 1.0,
  7180. 'reverseMethod' : REVERSEMETHOD_SUBTRACT_AND_INVERT,
  7181. 'outInvertsSweep' : true,
  7182. 'scaleIsotropically' : false
  7183. };
  7184. aTransitionInfoTable[SLIDEWIPE_TRANSITION] = {};
  7185. aTransitionInfoTable[SLIDEWIPE_TRANSITION][FROMLEFT_TRANS_SUBTYPE] =
  7186. aTransitionInfoTable[SLIDEWIPE_TRANSITION][FROMTOP_TRANS_SUBTYPE] =
  7187. aTransitionInfoTable[SLIDEWIPE_TRANSITION][FROMRIGHT_TRANS_SUBTYPE] =
  7188. aTransitionInfoTable[SLIDEWIPE_TRANSITION][FROMBOTTOM_TRANS_SUBTYPE] =
  7189. {
  7190. 'class' : TRANSITION_SPECIAL,
  7191. 'rotationAngle' : 0.0,
  7192. 'scaleX' : 1.0,
  7193. 'scaleY' : 1.0,
  7194. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  7195. 'outInvertsSweep' : true,
  7196. 'scaleIsotropically' : false
  7197. };
  7198. aTransitionInfoTable[FADE_TRANSITION] = {};
  7199. aTransitionInfoTable[FADE_TRANSITION][CROSSFADE_TRANS_SUBTYPE] =
  7200. aTransitionInfoTable[FADE_TRANSITION][FADETOCOLOR_TRANS_SUBTYPE] =
  7201. aTransitionInfoTable[FADE_TRANSITION][FADEFROMCOLOR_TRANS_SUBTYPE] =
  7202. aTransitionInfoTable[FADE_TRANSITION][FADEOVERCOLOR_TRANS_SUBTYPE] =
  7203. {
  7204. 'class' : TRANSITION_SPECIAL,
  7205. 'rotationAngle' : 0.0,
  7206. 'scaleX' : 1.0,
  7207. 'scaleY' : 1.0,
  7208. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  7209. 'outInvertsSweep' : true,
  7210. 'scaleIsotropically' : false
  7211. };
  7212. aTransitionInfoTable[RANDOMBARWIPE_TRANSITION] = {};
  7213. aTransitionInfoTable[RANDOMBARWIPE_TRANSITION][VERTICAL_TRANS_SUBTYPE] =
  7214. {
  7215. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7216. 'rotationAngle' : 90.0,
  7217. 'scaleX' : 1.0,
  7218. 'scaleY' : 1.0,
  7219. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  7220. 'outInvertsSweep' : true,
  7221. 'scaleIsotropically' : false
  7222. };
  7223. aTransitionInfoTable[RANDOMBARWIPE_TRANSITION][HORIZONTAL_TRANS_SUBTYPE] =
  7224. {
  7225. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7226. 'rotationAngle' : 0.0,
  7227. 'scaleX' : 1.0,
  7228. 'scaleY' : 1.0,
  7229. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  7230. 'outInvertsSweep' : true,
  7231. 'scaleIsotropically' : false
  7232. };
  7233. aTransitionInfoTable[CHECKERBOARDWIPE_TRANSITION] = {};
  7234. aTransitionInfoTable[CHECKERBOARDWIPE_TRANSITION][DOWN_TRANS_SUBTYPE] =
  7235. {
  7236. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7237. 'rotationAngle' : 90.0,
  7238. 'scaleX' : 1.0,
  7239. 'scaleY' : 1.0,
  7240. 'reverseMethod' : REVERSEMETHOD_FLIP_Y,
  7241. 'outInvertsSweep' : true,
  7242. 'scaleIsotropically' : false
  7243. };
  7244. aTransitionInfoTable[CHECKERBOARDWIPE_TRANSITION][ACROSS_TRANS_SUBTYPE] =
  7245. {
  7246. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7247. 'rotationAngle' : 0.0,
  7248. 'scaleX' : 1.0,
  7249. 'scaleY' : 1.0,
  7250. 'reverseMethod' : REVERSEMETHOD_FLIP_X,
  7251. 'outInvertsSweep' : true,
  7252. 'scaleIsotropically' : false
  7253. };
  7254. aTransitionInfoTable[DISSOLVE_TRANSITION] = {};
  7255. aTransitionInfoTable[DISSOLVE_TRANSITION][DEFAULT_TRANS_SUBTYPE] =
  7256. {
  7257. 'class' : TRANSITION_CLIP_POLYPOLYGON,
  7258. 'rotationAngle' : 0.0,
  7259. 'scaleX' : 1.0,
  7260. 'scaleY' : 1.0,
  7261. 'reverseMethod' : REVERSEMETHOD_IGNORE,
  7262. 'outInvertsSweep' : true,
  7263. 'scaleIsotropically' : true
  7264. };
  7265. function createStateTransitionTable()
  7266. {
  7267. var aSTT = {};
  7268. aSTT[RESTART_MODE_NEVER] = {};
  7269. aSTT[RESTART_MODE_WHEN_NOT_ACTIVE] = {};
  7270. aSTT[RESTART_MODE_ALWAYS] = {};
  7271. var aTable =
  7272. aSTT[RESTART_MODE_NEVER][FILL_MODE_REMOVE] = {};
  7273. aTable[INVALID_NODE] = INVALID_NODE;
  7274. aTable[UNRESOLVED_NODE] = RESOLVED_NODE | ENDED_NODE;
  7275. aTable[RESOLVED_NODE] = ACTIVE_NODE | ENDED_NODE;
  7276. aTable[ACTIVE_NODE] = ENDED_NODE;
  7277. aTable[FROZEN_NODE] = INVALID_NODE; // this state is unreachable here
  7278. aTable[ENDED_NODE] = ENDED_NODE; // this state is a sink here (cannot restart)
  7279. aTable =
  7280. aSTT[RESTART_MODE_NEVER][FILL_MODE_FREEZE] =
  7281. aSTT[RESTART_MODE_NEVER][FILL_MODE_HOLD] =
  7282. aSTT[RESTART_MODE_NEVER][FILL_MODE_TRANSITION] = {};
  7283. aTable[INVALID_NODE] = INVALID_NODE;
  7284. aTable[UNRESOLVED_NODE] = RESOLVED_NODE | ENDED_NODE;
  7285. aTable[RESOLVED_NODE] = ACTIVE_NODE | ENDED_NODE;
  7286. aTable[ACTIVE_NODE] = FROZEN_NODE | ENDED_NODE;
  7287. aTable[FROZEN_NODE] = ENDED_NODE;
  7288. aTable[ENDED_NODE] = ENDED_NODE; // this state is a sink here (cannot restart)
  7289. aTable =
  7290. aSTT[RESTART_MODE_WHEN_NOT_ACTIVE][FILL_MODE_REMOVE] = {};
  7291. aTable[INVALID_NODE] = INVALID_NODE;
  7292. aTable[UNRESOLVED_NODE] = RESOLVED_NODE | ENDED_NODE;
  7293. aTable[RESOLVED_NODE] = ACTIVE_NODE | ENDED_NODE;
  7294. aTable[ACTIVE_NODE] = ENDED_NODE;
  7295. aTable[FROZEN_NODE] = INVALID_NODE; // this state is unreachable here
  7296. aTable[ENDED_NODE] = RESOLVED_NODE | ACTIVE_NODE | ENDED_NODE; // restart is possible
  7297. aTable =
  7298. aSTT[RESTART_MODE_WHEN_NOT_ACTIVE][FILL_MODE_FREEZE] =
  7299. aSTT[RESTART_MODE_WHEN_NOT_ACTIVE][FILL_MODE_HOLD] =
  7300. aSTT[RESTART_MODE_WHEN_NOT_ACTIVE][FILL_MODE_TRANSITION] = {};
  7301. aTable[INVALID_NODE] = INVALID_NODE;
  7302. aTable[UNRESOLVED_NODE] = RESOLVED_NODE | ENDED_NODE;
  7303. aTable[RESOLVED_NODE] = ACTIVE_NODE | ENDED_NODE;
  7304. aTable[ACTIVE_NODE] = FROZEN_NODE | ENDED_NODE;
  7305. aTable[FROZEN_NODE] = RESOLVED_NODE | ACTIVE_NODE | ENDED_NODE; // restart is possible
  7306. aTable[ENDED_NODE] = RESOLVED_NODE | ACTIVE_NODE | ENDED_NODE; // restart is possible
  7307. aTable =
  7308. aSTT[RESTART_MODE_ALWAYS][FILL_MODE_REMOVE] = {};
  7309. aTable[INVALID_NODE] = INVALID_NODE;
  7310. aTable[UNRESOLVED_NODE] = RESOLVED_NODE | ENDED_NODE;
  7311. aTable[RESOLVED_NODE] = ACTIVE_NODE | ENDED_NODE;
  7312. aTable[ACTIVE_NODE] = RESOLVED_NODE | ACTIVE_NODE | ENDED_NODE; // restart is possible
  7313. aTable[FROZEN_NODE] = INVALID_NODE; // this state is unreachable here
  7314. aTable[ENDED_NODE] = RESOLVED_NODE | ACTIVE_NODE | ENDED_NODE; // restart is possible
  7315. aTable =
  7316. aSTT[RESTART_MODE_ALWAYS][FILL_MODE_FREEZE] =
  7317. aSTT[RESTART_MODE_ALWAYS][FILL_MODE_HOLD] =
  7318. aSTT[RESTART_MODE_ALWAYS][FILL_MODE_TRANSITION] = {};
  7319. aTable[INVALID_NODE] = INVALID_NODE;
  7320. aTable[UNRESOLVED_NODE] = RESOLVED_NODE | ENDED_NODE;
  7321. aTable[RESOLVED_NODE] = ACTIVE_NODE | ENDED_NODE;
  7322. aTable[ACTIVE_NODE] = RESOLVED_NODE | ACTIVE_NODE | FROZEN_NODE | ENDED_NODE;
  7323. aTable[FROZEN_NODE] = RESOLVED_NODE | ACTIVE_NODE | ENDED_NODE; // restart is possible
  7324. aTable[ENDED_NODE] = RESOLVED_NODE | ACTIVE_NODE | ENDED_NODE; // restart is possible
  7325. return aSTT;
  7326. }
  7327. var aStateTransitionTable = createStateTransitionTable();
  7328. function getTransitionTable( eRestartMode, eFillMode )
  7329. {
  7330. if( eRestartMode == RESTART_MODE_DEFAULT )
  7331. {
  7332. log( 'getTransitionTable: unexpected restart mode: ' + eRestartMode
  7333. + '. Used NEVER instead.');
  7334. eRestartMode = RESTART_MODE_NEVER;
  7335. }
  7336. if( eFillMode == FILL_MODE_DEFAULT ||
  7337. eFillMode == FILL_MODE_AUTO )
  7338. {
  7339. eFillMode = FILL_MODE_REMOVE;
  7340. }
  7341. return aStateTransitionTable[eRestartMode][eFillMode];
  7342. }
  7343. var EVENT_TRIGGER_UNKNOWN = 0;
  7344. var EVENT_TRIGGER_ON_SLIDE_BEGIN = 1; // eslint-disable-line no-unused-vars
  7345. var EVENT_TRIGGER_ON_SLIDE_END = 2; // eslint-disable-line no-unused-vars
  7346. var EVENT_TRIGGER_BEGIN_EVENT = 3;
  7347. var EVENT_TRIGGER_END_EVENT = 4;
  7348. var EVENT_TRIGGER_ON_CLICK = 5;
  7349. var EVENT_TRIGGER_ON_DBL_CLICK = 6; // eslint-disable-line no-unused-vars
  7350. var EVENT_TRIGGER_ON_MOUSE_ENTER = 7; // eslint-disable-line no-unused-vars
  7351. var EVENT_TRIGGER_ON_MOUSE_LEAVE = 8; // eslint-disable-line no-unused-vars
  7352. var EVENT_TRIGGER_ON_NEXT_EFFECT = 9;
  7353. var EVENT_TRIGGER_ON_PREV_EFFECT = 10;
  7354. var EVENT_TRIGGER_REPEAT = 11; // eslint-disable-line no-unused-vars
  7355. var aEventTriggerOutMap = [ 'unknown', 'slideBegin', 'slideEnd', 'begin', 'end', 'click',
  7356. 'doubleClick', 'mouseEnter', 'mouseLeave', 'next', 'previous', 'repeat' ];
  7357. function getEventTriggerType( sEventTrigger )
  7358. {
  7359. if( sEventTrigger == 'begin' )
  7360. return EVENT_TRIGGER_BEGIN_EVENT;
  7361. else if( sEventTrigger == 'end' )
  7362. return EVENT_TRIGGER_END_EVENT;
  7363. else if( sEventTrigger == 'next' )
  7364. return EVENT_TRIGGER_ON_NEXT_EFFECT;
  7365. else if( sEventTrigger == 'prev' )
  7366. return EVENT_TRIGGER_ON_PREV_EFFECT;
  7367. else if( sEventTrigger == 'click' )
  7368. return EVENT_TRIGGER_ON_CLICK;
  7369. else
  7370. return EVENT_TRIGGER_UNKNOWN;
  7371. }
  7372. var UNKNOWN_TIMING = 0;
  7373. var OFFSET_TIMING = 1;
  7374. var WALLCLOCK_TIMING = 2; // eslint-disable-line no-unused-vars
  7375. var INDEFINITE_TIMING = 3;
  7376. var EVENT_TIMING = 4;
  7377. var SYNCBASE_TIMING = 5;
  7378. var MEDIA_TIMING = 6; // eslint-disable-line no-unused-vars
  7379. var aTimingTypeOutMap = [ 'unknown', 'offset', 'wallclock', 'indefinite', 'event', 'syncbase', 'media' ];
  7380. var CHARCODE_PLUS = '+'.charCodeAt(0);
  7381. var CHARCODE_MINUS = '-'.charCodeAt(0);
  7382. var CHARCODE_0 = '0'.charCodeAt(0);
  7383. var CHARCODE_9 = '9'.charCodeAt(0);
  7384. function Timing( aAnimationNode, sTimingAttribute )
  7385. {
  7386. this.aAnimationNode = aAnimationNode; // the node, the timing attribute belongs to
  7387. this.sTimingDescription = removeWhiteSpaces( sTimingAttribute );
  7388. this.eTimingType = UNKNOWN_TIMING;
  7389. this.nOffset = 0.0; // in seconds
  7390. this.sEventBaseElementId = ''; // the element id for event based timing
  7391. this.eEventType = EVENT_TRIGGER_UNKNOWN; // the event type
  7392. }
  7393. Timing.prototype.getAnimationNode = function()
  7394. {
  7395. return this.aAnimationNode;
  7396. };
  7397. Timing.prototype.getType = function()
  7398. {
  7399. return this.eTimingType;
  7400. };
  7401. Timing.prototype.getOffset = function()
  7402. {
  7403. return this.nOffset;
  7404. };
  7405. Timing.prototype.getEventBaseElementId = function()
  7406. {
  7407. return this.sEventBaseElementId;
  7408. };
  7409. Timing.prototype.getEventType = function()
  7410. {
  7411. return this.eEventType;
  7412. };
  7413. Timing.prototype.parse = function()
  7414. {
  7415. if( !this.sTimingDescription )
  7416. {
  7417. this.eTimingType = OFFSET_TIMING;
  7418. return;
  7419. }
  7420. if( this.sTimingDescription == 'indefinite' )
  7421. this.eTimingType = INDEFINITE_TIMING;
  7422. else
  7423. {
  7424. var nFirstCharCode = this.sTimingDescription.charCodeAt(0);
  7425. var bPositiveOffset = !( nFirstCharCode == CHARCODE_MINUS );
  7426. if ( ( nFirstCharCode == CHARCODE_PLUS ) ||
  7427. ( nFirstCharCode == CHARCODE_MINUS ) ||
  7428. ( ( nFirstCharCode >= CHARCODE_0 ) && ( nFirstCharCode <= CHARCODE_9 ) ) )
  7429. {
  7430. var sClockValue
  7431. = ( ( nFirstCharCode == CHARCODE_PLUS ) || ( nFirstCharCode == CHARCODE_MINUS ) )
  7432. ? this.sTimingDescription.substr( 1 )
  7433. : this.sTimingDescription;
  7434. var TimeInSec = Timing.parseClockValue( sClockValue );
  7435. if( TimeInSec != undefined )
  7436. {
  7437. this.eTimingType = OFFSET_TIMING;
  7438. this.nOffset = bPositiveOffset ? TimeInSec : -TimeInSec;
  7439. }
  7440. }
  7441. else
  7442. {
  7443. var aTimingSplit = [];
  7444. bPositiveOffset = true;
  7445. if( this.sTimingDescription.indexOf( '+' ) != -1 )
  7446. {
  7447. aTimingSplit = this.sTimingDescription.split( '+' );
  7448. }
  7449. else if( this.sTimingDescription.indexOf( '-' ) != -1 )
  7450. {
  7451. aTimingSplit = this.sTimingDescription.split( '-' );
  7452. bPositiveOffset = false;
  7453. }
  7454. else
  7455. {
  7456. aTimingSplit[0] = this.sTimingDescription;
  7457. aTimingSplit[1] = '';
  7458. }
  7459. if( aTimingSplit[0].indexOf( '.' ) != -1 )
  7460. {
  7461. var aEventSplit = aTimingSplit[0].split( '.' );
  7462. this.sEventBaseElementId = aEventSplit[0];
  7463. this.eEventType = getEventTriggerType( aEventSplit[1] );
  7464. }
  7465. else
  7466. {
  7467. this.eEventType = getEventTriggerType( aTimingSplit[0] );
  7468. }
  7469. if( this.eEventType == EVENT_TRIGGER_UNKNOWN )
  7470. return;
  7471. if( ( this.eEventType == EVENT_TRIGGER_BEGIN_EVENT ) ||
  7472. ( this.eEventType == EVENT_TRIGGER_END_EVENT ) )
  7473. {
  7474. this.eTimingType = SYNCBASE_TIMING;
  7475. }
  7476. else
  7477. {
  7478. this.eTimingType = EVENT_TIMING;
  7479. }
  7480. if( aTimingSplit[1] )
  7481. {
  7482. sClockValue = aTimingSplit[1];
  7483. TimeInSec = Timing.parseClockValue( sClockValue );
  7484. if( TimeInSec != undefined )
  7485. {
  7486. this.nOffset = ( bPositiveOffset ) ? TimeInSec : -TimeInSec;
  7487. }
  7488. else
  7489. {
  7490. this.eTimingType = UNKNOWN_TIMING;
  7491. }
  7492. }
  7493. }
  7494. }
  7495. };
  7496. Timing.parseClockValue = function( sClockValue )
  7497. {
  7498. if( !sClockValue )
  7499. return 0.0;
  7500. var nTimeInSec = undefined;
  7501. var reFullClockValue = /^([0-9]+):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?$/;
  7502. var rePartialClockValue = /^([0-5][0-9]):([0-5][0-9])(.[0-9]+)?$/;
  7503. var reTimeCountValue = /^([0-9]+)(.[0-9]+)?(h|min|s|ms)?$/;
  7504. if( reFullClockValue.test( sClockValue ) )
  7505. {
  7506. var aClockTimeParts = reFullClockValue.exec( sClockValue );
  7507. var nHours = parseInt( aClockTimeParts[1] );
  7508. var nMinutes = parseInt( aClockTimeParts[2] );
  7509. var nSeconds = parseInt( aClockTimeParts[3] );
  7510. if( aClockTimeParts[4] )
  7511. nSeconds += parseFloat( aClockTimeParts[4] );
  7512. nTimeInSec = ( ( nHours * 60 ) + nMinutes ) * 60 + nSeconds;
  7513. }
  7514. else if( rePartialClockValue.test( sClockValue ) )
  7515. {
  7516. aClockTimeParts = rePartialClockValue.exec( sClockValue );
  7517. nMinutes = parseInt( aClockTimeParts[1] );
  7518. nSeconds = parseInt( aClockTimeParts[2] );
  7519. if( aClockTimeParts[3] )
  7520. nSeconds += parseFloat( aClockTimeParts[3] );
  7521. nTimeInSec = nMinutes * 60 + nSeconds;
  7522. }
  7523. else if( reTimeCountValue.test( sClockValue ) )
  7524. {
  7525. aClockTimeParts = reTimeCountValue.exec( sClockValue );
  7526. var nTimeCount = parseInt( aClockTimeParts[1] );
  7527. if( aClockTimeParts[2] )
  7528. nTimeCount += parseFloat( aClockTimeParts[2] );
  7529. if( aClockTimeParts[3] )
  7530. {
  7531. if( aClockTimeParts[3] == 'h' )
  7532. {
  7533. nTimeInSec = nTimeCount * 3600;
  7534. }
  7535. else if( aClockTimeParts[3] == 'min' )
  7536. {
  7537. nTimeInSec = nTimeCount * 60;
  7538. }
  7539. else if( aClockTimeParts[3] == 's' )
  7540. {
  7541. nTimeInSec = nTimeCount;
  7542. }
  7543. else if( aClockTimeParts[3] == 'ms' )
  7544. {
  7545. nTimeInSec = nTimeCount / 1000;
  7546. }
  7547. }
  7548. else
  7549. {
  7550. nTimeInSec = nTimeCount;
  7551. }
  7552. }
  7553. if( nTimeInSec )
  7554. nTimeInSec = parseFloat( nTimeInSec.toFixed( 3 ) );
  7555. return nTimeInSec;
  7556. };
  7557. Timing.prototype.info = function( bVerbose )
  7558. {
  7559. var sInfo = '';
  7560. if( bVerbose )
  7561. {
  7562. sInfo = 'description: ' + this.sTimingDescription + ', ';
  7563. sInfo += ', type: ' + aTimingTypeOutMap[ this.getType() ];
  7564. sInfo += ', offset: ' + this.getOffset();
  7565. sInfo += ', event base element id: ' + this.getEventBaseElementId();
  7566. sInfo += ', timing event type: ' + aEventTriggerOutMap[ this.getEventType() ];
  7567. }
  7568. else
  7569. {
  7570. switch( this.getType() )
  7571. {
  7572. case INDEFINITE_TIMING:
  7573. sInfo += 'indefinite';
  7574. break;
  7575. case OFFSET_TIMING:
  7576. sInfo += this.getOffset();
  7577. break;
  7578. case EVENT_TIMING:
  7579. case SYNCBASE_TIMING:
  7580. if( this.getEventBaseElementId() )
  7581. sInfo += this.getEventBaseElementId() + '.';
  7582. sInfo += aEventTriggerOutMap[ this.getEventType() ];
  7583. if( this.getOffset() )
  7584. {
  7585. if( this.getOffset() > 0 )
  7586. sInfo += '+';
  7587. sInfo += this.getOffset();
  7588. }
  7589. }
  7590. }
  7591. return sInfo;
  7592. };
  7593. function Duration( sDurationAttribute )
  7594. {
  7595. this.bIndefinite = false;
  7596. this.bMedia = false;
  7597. this.nValue = undefined;
  7598. this.bDefined = false;
  7599. if( !sDurationAttribute )
  7600. return;
  7601. if( sDurationAttribute == 'indefinite' )
  7602. this.bIndefinite = true;
  7603. else if( sDurationAttribute == 'media' )
  7604. this.bMedia = true;
  7605. else
  7606. {
  7607. this.nValue = Timing.parseClockValue( sDurationAttribute );
  7608. if( this.nValue <= 0.0 )
  7609. this.nValue = 0.001; // duration must be always greater than 0
  7610. }
  7611. this.bDefined = true;
  7612. }
  7613. Duration.prototype.isSet = function()
  7614. {
  7615. return this.bDefined;
  7616. };
  7617. Duration.prototype.isIndefinite = function()
  7618. {
  7619. return this.bIndefinite;
  7620. };
  7621. Duration.prototype.isMedia = function()
  7622. {
  7623. return this.bMedia;
  7624. };
  7625. Duration.prototype.isValue = function()
  7626. {
  7627. return this.nValue != undefined;
  7628. };
  7629. Duration.prototype.getValue= function()
  7630. {
  7631. return this.nValue;
  7632. };
  7633. Duration.prototype.info= function()
  7634. {
  7635. var sInfo;
  7636. if( this.isIndefinite() )
  7637. sInfo = 'indefinite';
  7638. else if( this.isMedia() )
  7639. sInfo = 'media';
  7640. else if( this.getValue() )
  7641. sInfo = this.getValue();
  7642. return sInfo;
  7643. };
  7644. function AnimationNode()
  7645. {
  7646. }
  7647. AnimationNode.prototype.init = function() {};
  7648. AnimationNode.prototype.resolve = function() {};
  7649. AnimationNode.prototype.activate = function() {};
  7650. AnimationNode.prototype.deactivate = function() {};
  7651. AnimationNode.prototype.end = function() {};
  7652. AnimationNode.prototype.getState = function() {};
  7653. AnimationNode.prototype.registerDeactivatingListener = function() {};
  7654. AnimationNode.prototype.notifyDeactivating = function() {};
  7655. function NodeContext( aSlideShowContext )
  7656. {
  7657. this.aContext = aSlideShowContext;
  7658. this.aAnimationNodeMap = null;
  7659. this.aAnimatedElementMap = null;
  7660. this.aSourceEventElementMap = null;
  7661. this.nStartDelay = 0.0;
  7662. this.bFirstRun = undefined;
  7663. this.bIsInvalid = false;
  7664. this.aSlideHeight = HEIGHT;
  7665. this.aSlideWidth = WIDTH;
  7666. }
  7667. NodeContext.prototype.makeSourceEventElement = function( sId, aEventBaseElem )
  7668. {
  7669. if( !aEventBaseElem )
  7670. {
  7671. log( 'NodeContext.makeSourceEventElement: event base element is not valid' );
  7672. return null;
  7673. }
  7674. if( !this.aContext.aEventMultiplexer )
  7675. {
  7676. log( 'NodeContext.makeSourceEventElement: event multiplexer not initialized' );
  7677. return null;
  7678. }
  7679. if( !this.aSourceEventElementMap[ sId ] )
  7680. {
  7681. this.aSourceEventElementMap[ sId ] = new SourceEventElement( sId, aEventBaseElem, this.aContext.aEventMultiplexer );
  7682. }
  7683. return this.aSourceEventElementMap[ sId ];
  7684. };
  7685. function StateTransition( aBaseNode )
  7686. {
  7687. this.aNode = aBaseNode;
  7688. this.eToState = INVALID_NODE;
  7689. }
  7690. StateTransition.prototype.enter = function( eNodeState, bForce )
  7691. {
  7692. if( !bForce ) bForce = false;
  7693. if( this.eToState != INVALID_NODE )
  7694. {
  7695. log( 'StateTransition.enter: commit() before enter()ing again!' );
  7696. return false;
  7697. }
  7698. if( !bForce && !this.aNode.isTransition( this.aNode.getState(), eNodeState ) )
  7699. return false;
  7700. if( ( this.aNode.nCurrentStateTransition & eNodeState ) != 0 )
  7701. return false; // already in wanted transition
  7702. this.aNode.nCurrentStateTransition |= eNodeState;
  7703. this.eToState = eNodeState;
  7704. return true;
  7705. };
  7706. StateTransition.prototype.commit = function()
  7707. {
  7708. if( this.eToState != INVALID_NODE )
  7709. {
  7710. this.aNode.eCurrentState = this.eToState;
  7711. this.clear();
  7712. }
  7713. };
  7714. StateTransition.prototype.clear = function()
  7715. {
  7716. if( this.eToState != INVALID_NODE )
  7717. {
  7718. this.aNode.nCurrentStateTransition &= ~this.eToState;
  7719. this.eToState = INVALID_NODE;
  7720. }
  7721. };
  7722. function BaseNode( aAnimElem, aParentNode, aNodeContext )
  7723. {
  7724. this.nId = getUniqueId();
  7725. this.sClassName = 'BaseNode';
  7726. if( !aAnimElem )
  7727. log( 'BaseNode(id:' + this.nId + ') constructor: aAnimElem is not valid' );
  7728. if( !aNodeContext )
  7729. log( 'BaseNode(id:' + this.nId + ') constructor: aNodeContext is not valid' );
  7730. if( !aNodeContext.aContext )
  7731. log( 'BaseNode(id:' + this.nId + ') constructor: aNodeContext.aContext is not valid' );
  7732. this.bIsContainer = false;
  7733. this.aElement = aAnimElem;
  7734. this.aParentNode = aParentNode;
  7735. this.aNodeContext = aNodeContext;
  7736. this.aContext = aNodeContext.aContext;
  7737. this.nStartDelay = aNodeContext.nStartDelay;
  7738. this.eCurrentState = UNRESOLVED_NODE;
  7739. this.nCurrentStateTransition = 0;
  7740. this.aDeactivatingListenerArray = [];
  7741. this.aActivationEvent = null;
  7742. this.aDeactivationEvent = null;
  7743. this.aBegin = null;
  7744. this.aDuration = null;
  7745. this.aEnd = null;
  7746. this.bMainSequenceRootNode = false;
  7747. this.bInteractiveSequenceRootNode = false;
  7748. this.eFillMode = FILL_MODE_FREEZE;
  7749. this.eRestartMode = RESTART_MODE_NEVER;
  7750. this.nRepeatCount = undefined;
  7751. this.nAccelerate = 0.0;
  7752. this.nDecelerate = 0.0;
  7753. this.bAutoReverse = false;
  7754. }
  7755. extend( BaseNode, AnimationNode );
  7756. BaseNode.prototype.getId = function()
  7757. {
  7758. return this.nId;
  7759. };
  7760. BaseNode.prototype.parseElement = function()
  7761. {
  7762. var aAnimElem = this.aElement;
  7763. var sIdAttr = aAnimElem.getAttributeNS( NSS['xml'], 'id' );
  7764. if( sIdAttr )
  7765. this.aNodeContext.aAnimationNodeMap[ sIdAttr ] = this;
  7766. this.aBegin = null;
  7767. var sBeginAttr = aAnimElem.getAttributeNS( NSS['smil'], 'begin' );
  7768. this.aBegin = new Timing( this, sBeginAttr );
  7769. this.aBegin.parse();
  7770. this.aEnd = null;
  7771. var sEndAttr = aAnimElem.getAttributeNS( NSS['smil'], 'end' );
  7772. if( sEndAttr )
  7773. {
  7774. this.aEnd = new Timing( this, sEndAttr );
  7775. this.aEnd.parse();
  7776. }
  7777. this.aDuration = null;
  7778. var sDurAttr = aAnimElem.getAttributeNS( NSS['smil'], 'dur' );
  7779. this.aDuration = new Duration( sDurAttr );
  7780. if( !this.aDuration.isSet() )
  7781. {
  7782. if( this.isContainer() )
  7783. this.aDuration = null;
  7784. else
  7785. this.aDuration = new Duration( 'indefinite' );
  7786. }
  7787. var sFillAttr = aAnimElem.getAttributeNS( NSS['smil'], 'fill' );
  7788. if( sFillAttr && aFillModeInMap[ sFillAttr ])
  7789. this.eFillMode = aFillModeInMap[ sFillAttr ];
  7790. else
  7791. this.eFillMode = FILL_MODE_DEFAULT;
  7792. var sRestartAttr = aAnimElem.getAttributeNS( NSS['smil'], 'restart' );
  7793. if( sRestartAttr && aRestartModeInMap[ sRestartAttr ] )
  7794. this.eRestartMode = aRestartModeInMap[ sRestartAttr ];
  7795. else
  7796. this.eRestartMode = RESTART_MODE_DEFAULT;
  7797. var sRepeatCount = aAnimElem.getAttributeNS( NSS['smil'], 'repeatCount' );
  7798. if( !sRepeatCount )
  7799. this.nRepeatCount = 1;
  7800. else
  7801. this.nRepeatCount = parseFloat( sRepeatCount );
  7802. if( ( isNaN(this.nRepeatCount) ) && ( sRepeatCount != 'indefinite' ) )
  7803. this.nRepeatCount = 1;
  7804. this.nAccelerate = 0.0;
  7805. var sAccelerateAttr = aAnimElem.getAttributeNS( NSS['smil'], 'accelerate' );
  7806. if( sAccelerateAttr )
  7807. this.nAccelerate = parseFloat( sAccelerateAttr );
  7808. if( isNaN(this.nAccelerate) )
  7809. this.nAccelerate = 0.0;
  7810. this.nDecelerate = 0.0;
  7811. var sDecelerateAttr = aAnimElem.getAttributeNS( NSS['smil'], 'decelerate' );
  7812. if( sDecelerateAttr )
  7813. this.nDecelerate = parseFloat( sDecelerateAttr );
  7814. if( isNaN(this.nDecelerate) )
  7815. this.nDecelerate = 0.0;
  7816. this.bAutoreverse = false;
  7817. var sAutoReverseAttr = aAnimElem.getAttributeNS( NSS['smil'], 'autoReverse' );
  7818. if( sAutoReverseAttr == 'true' )
  7819. this.bAutoreverse = true;
  7820. if( this.eFillMode == FILL_MODE_DEFAULT )
  7821. if( this.getParentNode() )
  7822. this.eFillMode = this.getParentNode().getFillMode();
  7823. else
  7824. this.eFillMode = FILL_MODE_AUTO;
  7825. if( this.eFillMode == FILL_MODE_AUTO ) // see SMIL recommendation document
  7826. {
  7827. this.eFillMode = ( this.aEnd ||
  7828. ( this.nRepeatCount != 1) ||
  7829. ( this.aDuration && !this.aDuration.isIndefinite() ) )
  7830. ? FILL_MODE_REMOVE
  7831. : FILL_MODE_FREEZE;
  7832. }
  7833. if( this.eRestartMode == RESTART_MODE_DEFAULT )
  7834. if( this.getParentNode() )
  7835. this.eRestartMode = this.getParentNode().getRestartMode();
  7836. else
  7837. this.eRestartMode = RESTART_MODE_ALWAYS;
  7838. if( ( this.nAccelerate + this.nDecelerate ) > 1.0 )
  7839. {
  7840. this.nAccelerate = 0.0;
  7841. this.nDecelerate = 0.0;
  7842. }
  7843. this.aStateTransTable = getTransitionTable( this.getRestartMode(), this.getFillMode() );
  7844. return true;
  7845. };
  7846. BaseNode.prototype.getParentNode = function()
  7847. {
  7848. return this.aParentNode;
  7849. };
  7850. BaseNode.prototype.init = function()
  7851. {
  7852. this.DBG( this.callInfo( 'init' ) );
  7853. if( ! this.checkValidNode() )
  7854. return false;
  7855. if( this.aActivationEvent )
  7856. this.aActivationEvent.dispose();
  7857. if( this.aDeactivationEvent )
  7858. this.aDeactivationEvent.dispose();
  7859. this.eCurrentState = UNRESOLVED_NODE;
  7860. return this.init_st();
  7861. };
  7862. BaseNode.prototype.resolve = function()
  7863. {
  7864. if( this.aNodeContext.bIsInvalid || ! this.checkValidNode() )
  7865. return false;
  7866. this.DBG( this.callInfo( 'resolve' ) );
  7867. if( this.eCurrentState == RESOLVED_NODE )
  7868. log( 'BaseNode.resolve: already in RESOLVED state' );
  7869. var aStateTrans = new StateTransition( this );
  7870. if( aStateTrans.enter( RESOLVED_NODE ) &&
  7871. this.isTransition( RESOLVED_NODE, ACTIVE_NODE ) &&
  7872. this.resolve_st() )
  7873. {
  7874. aStateTrans.commit();
  7875. if( this.aActivationEvent )
  7876. {
  7877. this.aActivationEvent.charge();
  7878. }
  7879. else
  7880. {
  7881. this.aActivationEvent = makeDelay( bind( this, this.activate ), this.getBegin().getOffset() + this.nStartDelay );
  7882. }
  7883. registerEvent( this.getId(), this.getBegin(), this.aActivationEvent, this.aNodeContext );
  7884. return true;
  7885. }
  7886. return false;
  7887. };
  7888. BaseNode.prototype.activate = function()
  7889. {
  7890. if( ! this.checkValidNode() )
  7891. return false;
  7892. if( this.eCurrentState == ACTIVE_NODE )
  7893. log( 'BaseNode.activate: already in ACTIVE state' );
  7894. this.DBG( this.callInfo( 'activate' ), getCurrentSystemTime() );
  7895. var aStateTrans = new StateTransition( this );
  7896. if( aStateTrans.enter( ACTIVE_NODE ) )
  7897. {
  7898. this.activate_st();
  7899. aStateTrans.commit();
  7900. if( !this.aContext.aEventMultiplexer )
  7901. log( 'BaseNode.activate: this.aContext.aEventMultiplexer is not valid' );
  7902. this.aContext.aEventMultiplexer.notifyEvent( EVENT_TRIGGER_BEGIN_EVENT, this.getId() );
  7903. return true;
  7904. }
  7905. return false;
  7906. };
  7907. BaseNode.prototype.deactivate = function()
  7908. {
  7909. if( this.inStateOrTransition( ENDED_NODE | FROZEN_NODE ) || !this.checkValidNode() )
  7910. return;
  7911. if( this.isTransition( this.eCurrentState, FROZEN_NODE ) )
  7912. {
  7913. this.DBG( this.callInfo( 'deactivate' ), getCurrentSystemTime() );
  7914. var aStateTrans = new StateTransition( this );
  7915. if( aStateTrans.enter( FROZEN_NODE, true /* FORCE */ ) )
  7916. {
  7917. this.deactivate_st( FROZEN_NODE );
  7918. aStateTrans.commit();
  7919. this.notifyEndListeners();
  7920. if( this.aActivationEvent )
  7921. this.aActivationEvent.dispose();
  7922. if( this.aDeactivationEvent )
  7923. this.aDeactivationEvent.dispose();
  7924. }
  7925. }
  7926. else
  7927. {
  7928. this.end();
  7929. }
  7930. };
  7931. BaseNode.prototype.end = function()
  7932. {
  7933. var bIsFrozenOrInTransitionToFrozen = this.inStateOrTransition( FROZEN_NODE );
  7934. if( this.inStateOrTransition( ENDED_NODE ) || !this.checkValidNode() )
  7935. return;
  7936. if( !(this.isTransition( this.eCurrentState, ENDED_NODE ) ) )
  7937. log( 'BaseNode.end: end state not reachable in transition table' );
  7938. this.DBG( this.callInfo( 'end' ), getCurrentSystemTime() );
  7939. var aStateTrans = new StateTransition( this );
  7940. if( aStateTrans.enter( ENDED_NODE, true /* FORCE */ ) )
  7941. {
  7942. this.deactivate_st( ENDED_NODE );
  7943. aStateTrans.commit();
  7944. if( !bIsFrozenOrInTransitionToFrozen )
  7945. this.notifyEndListeners();
  7946. if( this.aActivationEvent )
  7947. this.aActivationEvent.dispose();
  7948. if( this.aDeactivationEvent )
  7949. this.aDeactivationEvent.dispose();
  7950. }
  7951. };
  7952. BaseNode.prototype.dispose = function()
  7953. {
  7954. if( this.aActivationEvent )
  7955. this.aActivationEvent.dispose();
  7956. if( this.aDeactivationEvent )
  7957. this.aDeactivationEvent.dispose();
  7958. this.aDeactivatingListenerArray = [];
  7959. };
  7960. BaseNode.prototype.getState = function()
  7961. {
  7962. return this.eCurrentState;
  7963. };
  7964. BaseNode.prototype.registerDeactivatingListener = function( aNotifiee )
  7965. {
  7966. if (! this.checkValidNode())
  7967. return false;
  7968. if( !aNotifiee )
  7969. {
  7970. log( 'BaseNode.registerDeactivatingListener(): invalid notifiee' );
  7971. return false;
  7972. }
  7973. this.aDeactivatingListenerArray.push( aNotifiee );
  7974. return true;
  7975. };
  7976. BaseNode.prototype.notifyDeactivating = function( aNotifier )
  7977. {
  7978. assert( ( aNotifier.getState() == FROZEN_NODE ) || ( aNotifier.getState() == ENDED_NODE ),
  7979. 'BaseNode.notifyDeactivating: Notifier node is neither in FROZEN nor in ENDED state' );
  7980. };
  7981. BaseNode.prototype.isMainSequenceRootNode = function()
  7982. {
  7983. return this.bMainSequenceRootNode;
  7984. };
  7985. BaseNode.prototype.isInteractiveSequenceRootNode = function()
  7986. {
  7987. return this.bInteractiveSequenceRootNode;
  7988. };
  7989. BaseNode.prototype.makeDeactivationEvent = function( nDelay )
  7990. {
  7991. if( this.aDeactivationEvent )
  7992. {
  7993. this.aDeactivationEvent.charge();
  7994. }
  7995. else
  7996. {
  7997. if( typeof( nDelay ) == typeof(0) )
  7998. this.aDeactivationEvent = makeDelay( bind( this, this.deactivate ), nDelay );
  7999. else
  8000. this.aDeactivationEvent = null;
  8001. }
  8002. return this.aDeactivationEvent;
  8003. };
  8004. BaseNode.prototype.scheduleDeactivationEvent = function( aEvent )
  8005. {
  8006. this.DBG( this.callInfo( 'scheduleDeactivationEvent' ) );
  8007. if( !aEvent )
  8008. {
  8009. if( this.getDuration() && this.getDuration().isValue() )
  8010. aEvent = this.makeDeactivationEvent( this.getDuration().getValue() );
  8011. }
  8012. if( aEvent )
  8013. {
  8014. this.aContext.aTimerEventQueue.addEvent( aEvent );
  8015. }
  8016. };
  8017. BaseNode.prototype.checkValidNode = function()
  8018. {
  8019. return ( this.eCurrentState != INVALID_NODE );
  8020. };
  8021. BaseNode.prototype.init_st = function()
  8022. {
  8023. return true;
  8024. };
  8025. BaseNode.prototype.resolve_st = function()
  8026. {
  8027. return true;
  8028. };
  8029. BaseNode.prototype.activate_st = function()
  8030. {
  8031. this.scheduleDeactivationEvent();
  8032. };
  8033. BaseNode.prototype.deactivate_st = function( /*aNodeState*/ )
  8034. {
  8035. };
  8036. BaseNode.prototype.notifyEndListeners = function()
  8037. {
  8038. var nDeactivatingListenerCount = this.aDeactivatingListenerArray.length;
  8039. for( var i = 0; i < nDeactivatingListenerCount; ++i )
  8040. {
  8041. this.aDeactivatingListenerArray[i].notifyDeactivating( this );
  8042. }
  8043. this.aContext.aEventMultiplexer.notifyEvent( EVENT_TRIGGER_END_EVENT, this.getId() );
  8044. if( this.getParentNode() && this.getParentNode().isMainSequenceRootNode() )
  8045. this.aContext.aEventMultiplexer.notifyNextEffectEndEvent();
  8046. if( this.isMainSequenceRootNode() )
  8047. this.aContext.aEventMultiplexer.notifyAnimationsEndEvent();
  8048. };
  8049. BaseNode.prototype.getContext = function()
  8050. {
  8051. return this.aContext;
  8052. };
  8053. BaseNode.prototype.isTransition = function( eFromState, eToState )
  8054. {
  8055. return ( ( this.aStateTransTable[ eFromState ] & eToState ) != 0 );
  8056. };
  8057. BaseNode.prototype.inStateOrTransition = function( nMask )
  8058. {
  8059. return ( ( ( this.eCurrentState & nMask ) != 0 ) || ( ( this.nCurrentStateTransition & nMask ) != 0 ) );
  8060. };
  8061. BaseNode.prototype.isContainer = function()
  8062. {
  8063. return this.bIsContainer;
  8064. };
  8065. BaseNode.prototype.getBegin = function()
  8066. {
  8067. return this.aBegin;
  8068. };
  8069. BaseNode.prototype.getDuration = function()
  8070. {
  8071. return this.aDuration;
  8072. };
  8073. BaseNode.prototype.getEnd = function()
  8074. {
  8075. return this.aEnd;
  8076. };
  8077. BaseNode.prototype.getFillMode = function()
  8078. {
  8079. return this.eFillMode;
  8080. };
  8081. BaseNode.prototype.getRestartMode = function()
  8082. {
  8083. return this.eRestartMode;
  8084. };
  8085. BaseNode.prototype.getRepeatCount = function()
  8086. {
  8087. return this.nRepeatCount;
  8088. };
  8089. BaseNode.prototype.getAccelerateValue = function()
  8090. {
  8091. return this.nAccelerate;
  8092. };
  8093. BaseNode.prototype.getDecelerateValue = function()
  8094. {
  8095. return this.nDecelerate;
  8096. };
  8097. BaseNode.prototype.isAutoReverseEnabled = function()
  8098. {
  8099. return this.bAutoreverse;
  8100. };
  8101. BaseNode.prototype.info = function( bVerbose )
  8102. {
  8103. var sInfo = 'class name: ' + this.sClassName;
  8104. sInfo += '; element name: ' + this.aElement.localName;
  8105. sInfo += '; id: ' + this.getId();
  8106. sInfo += '; state: ' + getNodeStateName( this.getState() );
  8107. if( bVerbose )
  8108. {
  8109. sInfo += '; is container: ' + this.isContainer();
  8110. if( this.getBegin() )
  8111. sInfo += '; begin: ' + this.getBegin().info();
  8112. if( this.getDuration() )
  8113. sInfo += '; dur: ' + this.getDuration().info();
  8114. if( this.getEnd() )
  8115. sInfo += '; end: ' + this.getEnd().info();
  8116. if( this.getFillMode() )
  8117. sInfo += '; fill: ' + aFillModeOutMap[ this.getFillMode() ];
  8118. if( this.getRestartMode() )
  8119. sInfo += '; restart: ' + aRestartModeOutMap[ this.getRestartMode() ];
  8120. if( this.getRepeatCount() && ( this.getRepeatCount() != 1.0 ) )
  8121. sInfo += '; repeatCount: ' + this.getRepeatCount();
  8122. if( this.getAccelerateValue() )
  8123. sInfo += '; accelerate: ' + this.getAccelerateValue();
  8124. if( this.getDecelerateValue() )
  8125. sInfo += '; decelerate: ' + this.getDecelerateValue();
  8126. if( this.isAutoReverseEnabled() )
  8127. sInfo += '; autoReverse: true';
  8128. }
  8129. return sInfo;
  8130. };
  8131. BaseNode.prototype.callInfo = function( sMethodName )
  8132. {
  8133. var sInfo = this.sClassName +
  8134. '( ' + this.getId() +
  8135. ', ' + getNodeStateName( this.getState() ) +
  8136. ' ).' + sMethodName;
  8137. return sInfo;
  8138. };
  8139. BaseNode.prototype.DBG = function( sMessage, nTime )
  8140. {
  8141. ANIMDBG.print( sMessage, nTime );
  8142. };
  8143. function AnimationBaseNode( aAnimElem, aParentNode, aNodeContext )
  8144. {
  8145. AnimationBaseNode.superclass.constructor.call( this, aAnimElem, aParentNode, aNodeContext );
  8146. this.sClassName = 'AnimationBaseNode';
  8147. this.bIsContainer = false;
  8148. this.aTargetElement = null;
  8149. this.bIsTargetTextElement = false;
  8150. this.aAnimatedElement = null;
  8151. this.aActivity = null;
  8152. this.nMinFrameCount = undefined;
  8153. this.eAdditiveMode = undefined;
  8154. }
  8155. extend( AnimationBaseNode, BaseNode );
  8156. AnimationBaseNode.prototype.parseElement = function()
  8157. {
  8158. var bRet = AnimationBaseNode.superclass.parseElement.call( this );
  8159. var aAnimElem = this.aElement;
  8160. this.aTargetElement = null;
  8161. var sTargetElementAttr = aAnimElem.getAttributeNS( NSS['smil'], 'targetElement' );
  8162. if( sTargetElementAttr )
  8163. this.aTargetElement = document.getElementById( sTargetElementAttr );
  8164. if( !this.aTargetElement )
  8165. {
  8166. this.eCurrentState = INVALID_NODE;
  8167. log( 'AnimationBaseNode.parseElement: target element not found: ' + sTargetElementAttr );
  8168. }
  8169. var sSubItemAttr = aAnimElem.getAttributeNS( NSS['anim'], 'sub-item' );
  8170. this.bIsTargetTextElement = ( sSubItemAttr && ( sSubItemAttr === 'text' ) );
  8171. var sAdditiveAttr = aAnimElem.getAttributeNS( NSS['smil'], 'additive' );
  8172. if( sAdditiveAttr && aAddittiveModeInMap[sAdditiveAttr] )
  8173. this.eAdditiveMode = aAddittiveModeInMap[sAdditiveAttr];
  8174. else
  8175. this.eAdditiveMode = ADDITIVE_MODE_REPLACE;
  8176. this.nMinFrameCount = ( this.getDuration().isValue() )
  8177. ? ( this.getDuration().getValue() * MINIMUM_FRAMES_PER_SECONDS )
  8178. : MINIMUM_FRAMES_PER_SECONDS;
  8179. if( this.nMinFrameCount < 1.0 )
  8180. this.nMinFrameCount = 1;
  8181. else if( this.nMinFrameCount > MINIMUM_FRAMES_PER_SECONDS )
  8182. this.nMinFrameCount = MINIMUM_FRAMES_PER_SECONDS;
  8183. if( this.aTargetElement )
  8184. {
  8185. if( aAnimElem.getAttributeNS( NSS['smil'], 'attributeName' ) === 'visibility' )
  8186. {
  8187. if( aAnimElem.getAttributeNS( NSS['smil'], 'to' ) === 'visible' )
  8188. this.aTargetElement.setAttribute( 'visibility', 'hidden' );
  8189. }
  8190. if( !this.aNodeContext.aAnimatedElementMap[ sTargetElementAttr ] )
  8191. {
  8192. if( this.bIsTargetTextElement )
  8193. {
  8194. this.aNodeContext.aAnimatedElementMap[ sTargetElementAttr ]
  8195. = new AnimatedTextElement( this.aTargetElement );
  8196. }
  8197. else
  8198. {
  8199. this.aNodeContext.aAnimatedElementMap[ sTargetElementAttr ]
  8200. = new AnimatedElement( this.aTargetElement );
  8201. }
  8202. }
  8203. this.aAnimatedElement = this.aNodeContext.aAnimatedElementMap[ sTargetElementAttr ];
  8204. this.aAnimatedElement.setAdditiveMode( this.eAdditiveMode );
  8205. }
  8206. return bRet;
  8207. };
  8208. AnimationBaseNode.prototype.init_st = function()
  8209. {
  8210. if( this.aActivity )
  8211. this.aActivity.activate( makeEvent( bind( this, this.deactivate ) ) );
  8212. else
  8213. this.aActivity = this.createActivity();
  8214. return true;
  8215. };
  8216. AnimationBaseNode.prototype.resolve_st = function()
  8217. {
  8218. return true;
  8219. };
  8220. AnimationBaseNode.prototype.activate_st = function()
  8221. {
  8222. if( this.aActivity )
  8223. {
  8224. this.saveStateOfAnimatedElement();
  8225. this.aActivity.setTargets( this.getAnimatedElement() );
  8226. if( this.getContext().bIsSkipping )
  8227. {
  8228. this.aActivity.end();
  8229. }
  8230. else
  8231. {
  8232. this.getContext().aActivityQueue.addActivity( this.aActivity );
  8233. }
  8234. }
  8235. else
  8236. {
  8237. AnimationBaseNode.superclass.scheduleDeactivationEvent.call( this );
  8238. }
  8239. };
  8240. AnimationBaseNode.prototype.deactivate_st = function( eDestState )
  8241. {
  8242. if( eDestState == FROZEN_NODE )
  8243. {
  8244. if( this.aActivity )
  8245. this.aActivity.end();
  8246. }
  8247. if( eDestState == ENDED_NODE )
  8248. {
  8249. if( this.aActivity )
  8250. this.aActivity.dispose();
  8251. if( ( this.getFillMode() == FILL_MODE_REMOVE ) && this.getAnimatedElement() )
  8252. this.removeEffect();
  8253. }
  8254. };
  8255. AnimationBaseNode.prototype.createActivity = function()
  8256. {
  8257. log( 'AnimationBaseNode.createActivity: abstract method called' );
  8258. };
  8259. AnimationBaseNode.prototype.fillActivityParams = function()
  8260. {
  8261. var nDuration = 0.001;
  8262. if( this.getDuration().isValue() )
  8263. {
  8264. nDuration = this.getDuration().getValue();
  8265. }
  8266. else
  8267. {
  8268. log( 'AnimationBaseNode.fillActivityParams: duration is not a number' );
  8269. }
  8270. var aActivityParamSet = new ActivityParamSet();
  8271. aActivityParamSet.aEndEvent = makeEvent( bind( this, this.deactivate ) );
  8272. aActivityParamSet.aTimerEventQueue = this.aContext.aTimerEventQueue;
  8273. aActivityParamSet.aActivityQueue = this.aContext.aActivityQueue;
  8274. aActivityParamSet.nMinDuration = nDuration;
  8275. aActivityParamSet.nMinNumberOfFrames = this.getMinFrameCount();
  8276. aActivityParamSet.bAutoReverse = this.isAutoReverseEnabled();
  8277. aActivityParamSet.nRepeatCount = this.getRepeatCount();
  8278. aActivityParamSet.nAccelerationFraction = this.getAccelerateValue();
  8279. aActivityParamSet.nDecelerationFraction = this.getDecelerateValue();
  8280. aActivityParamSet.nSlideWidth = this.aNodeContext.aSlideWidth;
  8281. aActivityParamSet.nSlideHeight = this.aNodeContext.aSlideHeight;
  8282. return aActivityParamSet;
  8283. };
  8284. AnimationBaseNode.prototype.hasPendingAnimation = function()
  8285. {
  8286. return true;
  8287. };
  8288. AnimationBaseNode.prototype.saveStateOfAnimatedElement = function()
  8289. {
  8290. this.getAnimatedElement().saveState( this.getId() );
  8291. };
  8292. AnimationBaseNode.prototype.removeEffect = function()
  8293. {
  8294. this.getAnimatedElement().restoreState( this.getId() );
  8295. };
  8296. AnimationBaseNode.prototype.getTargetElement = function()
  8297. {
  8298. return this.aTargetElement;
  8299. };
  8300. AnimationBaseNode.prototype.getAnimatedElement = function()
  8301. {
  8302. return this.aAnimatedElement;
  8303. };
  8304. AnimationBaseNode.prototype.dispose= function()
  8305. {
  8306. if( this.aActivity )
  8307. this.aActivity.dispose();
  8308. AnimationBaseNode.superclass.dispose.call( this );
  8309. };
  8310. AnimationBaseNode.prototype.getMinFrameCount = function()
  8311. {
  8312. return this.nMinFrameCount;
  8313. };
  8314. AnimationBaseNode.prototype.getAdditiveMode = function()
  8315. {
  8316. return this.eAdditiveMode;
  8317. };
  8318. AnimationBaseNode.prototype.info = function( bVerbose )
  8319. {
  8320. var sInfo = AnimationBaseNode.superclass.info.call( this, bVerbose );
  8321. if( bVerbose )
  8322. {
  8323. if( this.getMinFrameCount() )
  8324. sInfo += '; min frame count: ' + this.getMinFrameCount();
  8325. sInfo += '; additive: ' + aAddittiveModeOutMap[ this.getAdditiveMode() ];
  8326. if( this.getTargetElement() )
  8327. {
  8328. var sElemId = this.getTargetElement().getAttribute( 'id' );
  8329. sInfo += '; targetElement: ' + sElemId;
  8330. }
  8331. }
  8332. return sInfo;
  8333. };
  8334. function AnimationBaseNode2( aAnimElem, aParentNode, aNodeContext )
  8335. {
  8336. AnimationBaseNode2.superclass.constructor.call( this, aAnimElem, aParentNode, aNodeContext );
  8337. this.sAttributeName = '';
  8338. this.aToValue = null;
  8339. }
  8340. extend( AnimationBaseNode2, AnimationBaseNode );
  8341. AnimationBaseNode2.prototype.parseElement = function()
  8342. {
  8343. var bRet = AnimationBaseNode2.superclass.parseElement.call( this );
  8344. var aAnimElem = this.aElement;
  8345. this.sAttributeName = aAnimElem.getAttributeNS( NSS['smil'], 'attributeName' );
  8346. if( !this.sAttributeName )
  8347. {
  8348. this.eCurrentState = INVALID_NODE;
  8349. log( 'AnimationBaseNode2.parseElement: target attribute name not found: ' + this.sAttributeName );
  8350. }
  8351. this.aToValue = aAnimElem.getAttributeNS( NSS['smil'], 'to' );
  8352. return bRet;
  8353. };
  8354. AnimationBaseNode2.prototype.getAttributeName = function()
  8355. {
  8356. return this.sAttributeName;
  8357. };
  8358. AnimationBaseNode2.prototype.getToValue = function()
  8359. {
  8360. return this.aToValue;
  8361. };
  8362. AnimationBaseNode2.prototype.info = function( bVerbose )
  8363. {
  8364. var sInfo = AnimationBaseNode2.superclass.info.call( this, bVerbose );
  8365. if( bVerbose )
  8366. {
  8367. if( this.getAttributeName() )
  8368. sInfo += '; attributeName: ' + this.getAttributeName();
  8369. if( this.getToValue() )
  8370. sInfo += '; to: ' + this.getToValue();
  8371. }
  8372. return sInfo;
  8373. };
  8374. function AnimationBaseNode3( aAnimElem, aParentNode, aNodeContext )
  8375. {
  8376. AnimationBaseNode3.superclass.constructor.call( this, aAnimElem, aParentNode, aNodeContext );
  8377. this.eAccumulate = undefined;
  8378. this.eCalcMode = undefined;
  8379. this.aFromValue = null;
  8380. this.aByValue = null;
  8381. this.aKeyTimes = null;
  8382. this.aValues = null;
  8383. this.aFormula= null;
  8384. }
  8385. extend( AnimationBaseNode3, AnimationBaseNode2 );
  8386. AnimationBaseNode3.prototype.parseElement = function()
  8387. {
  8388. var bRet = AnimationBaseNode3.superclass.parseElement.call( this );
  8389. var aAnimElem = this.aElement;
  8390. this.eAccumulate = ACCUMULATE_MODE_NONE;
  8391. var sAccumulateAttr = aAnimElem.getAttributeNS( NSS['smil'], 'accumulate' );
  8392. if( sAccumulateAttr == 'sum' )
  8393. this.eAccumulate = ACCUMULATE_MODE_SUM;
  8394. this.eCalcMode = CALC_MODE_LINEAR;
  8395. var sCalcModeAttr = aAnimElem.getAttributeNS( NSS['smil'], 'calcMode' );
  8396. if( sCalcModeAttr && aCalcModeInMap[ sCalcModeAttr ] )
  8397. this.eCalcMode = aCalcModeInMap[ sCalcModeAttr ];
  8398. this.aFromValue = aAnimElem.getAttributeNS( NSS['smil'], 'from' );
  8399. this.aByValue = aAnimElem.getAttributeNS( NSS['smil'], 'by' );
  8400. this.aKeyTimes = [];
  8401. var sKeyTimesAttr = aAnimElem.getAttributeNS( NSS['smil'], 'keyTimes' );
  8402. sKeyTimesAttr = removeWhiteSpaces( sKeyTimesAttr );
  8403. if( sKeyTimesAttr )
  8404. {
  8405. var aKeyTimes = sKeyTimesAttr.split( ';' );
  8406. for( var i = 0; i < aKeyTimes.length; ++i )
  8407. this.aKeyTimes.push( parseFloat( aKeyTimes[i] ) );
  8408. }
  8409. var sValuesAttr = aAnimElem.getAttributeNS( NSS['smil'], 'values' );
  8410. if( sValuesAttr )
  8411. {
  8412. this.aValues = sValuesAttr.split( ';' );
  8413. }
  8414. else
  8415. {
  8416. this.aValues = [];
  8417. }
  8418. this.aFormula = aAnimElem.getAttributeNS( NSS['anim'], 'formula' );
  8419. return bRet;
  8420. };
  8421. AnimationBaseNode3.prototype.getAccumulate = function()
  8422. {
  8423. return this.eAccumulate;
  8424. };
  8425. AnimationBaseNode3.prototype.getCalcMode = function()
  8426. {
  8427. return this.eCalcMode;
  8428. };
  8429. AnimationBaseNode3.prototype.getFromValue = function()
  8430. {
  8431. return this.aFromValue;
  8432. };
  8433. AnimationBaseNode3.prototype.getByValue = function()
  8434. {
  8435. return this.aByValue;
  8436. };
  8437. AnimationBaseNode3.prototype.getKeyTimes = function()
  8438. {
  8439. return this.aKeyTimes;
  8440. };
  8441. AnimationBaseNode3.prototype.getValues = function()
  8442. {
  8443. return this.aValues;
  8444. };
  8445. AnimationBaseNode3.prototype.getFormula = function()
  8446. {
  8447. return this.aFormula;
  8448. };
  8449. AnimationBaseNode3.prototype.info = function( bVerbose )
  8450. {
  8451. var sInfo = AnimationBaseNode3.superclass.info.call( this, bVerbose );
  8452. if( bVerbose )
  8453. {
  8454. if( this.getAccumulate() )
  8455. sInfo += '; accumulate: ' + aAccumulateModeOutMap[ this.getAccumulate() ];
  8456. sInfo += '; calcMode: ' + aCalcModeOutMap[ this.getCalcMode() ];
  8457. if( this.getFromValue() )
  8458. sInfo += '; from: ' + this.getFromValue();
  8459. if( this.getByValue() )
  8460. sInfo += '; by: ' + this.getByValue();
  8461. if( this.getKeyTimes().length )
  8462. sInfo += '; keyTimes: ' + this.getKeyTimes().join( ',' );
  8463. if( this.getValues().length )
  8464. sInfo += '; values: ' + this.getValues().join( ',' );
  8465. if( this.getFormula() )
  8466. sInfo += '; formula: ' + this.getFormula();
  8467. }
  8468. return sInfo;
  8469. };
  8470. function BaseContainerNode( aAnimElem, aParentNode, aNodeContext )
  8471. {
  8472. BaseContainerNode.superclass.constructor.call( this, aAnimElem, aParentNode, aNodeContext );
  8473. this.sClassName = 'BaseContainerNode';
  8474. this.bIsContainer = true;
  8475. this.aChildrenArray = [];
  8476. this.nFinishedChildren = 0;
  8477. this.bDurationIndefinite = false;
  8478. this.nLeftIterations = 1;
  8479. this.eImpressNodeType = undefined;
  8480. this.ePresetClass = undefined;
  8481. this.ePresetId = undefined;
  8482. }
  8483. extend( BaseContainerNode, BaseNode );
  8484. BaseContainerNode.prototype.parseElement= function()
  8485. {
  8486. var bRet = BaseContainerNode.superclass.parseElement.call( this );
  8487. var aAnimElem = this.aElement;
  8488. this.eImpressNodeType = IMPRESS_DEFAULT_NODE;
  8489. var sNodeTypeAttr = aAnimElem.getAttributeNS( NSS['presentation'], 'node-type' );
  8490. if( sNodeTypeAttr && aImpressNodeTypeInMap[ sNodeTypeAttr ] )
  8491. this.eImpressNodeType = aImpressNodeTypeInMap[ sNodeTypeAttr ];
  8492. this.bMainSequenceRootNode = ( this.eImpressNodeType == IMPRESS_MAIN_SEQUENCE_NODE );
  8493. this.bInteractiveSequenceRootNode = ( this.eImpressNodeType == IMPRESS_INTERACTIVE_SEQUENCE_NODE );
  8494. this.ePresetClass = undefined;
  8495. var sPresetClassAttr = aAnimElem.getAttributeNS( NSS['presentation'], 'preset-class' );
  8496. if( sPresetClassAttr && aPresetClassInMap[ sPresetClassAttr ] )
  8497. this.ePresetClass = aPresetClassInMap[ sPresetClassAttr ];
  8498. this.ePresetId = undefined;
  8499. var sPresetIdAttr = aAnimElem.getAttributeNS( NSS['presentation'], 'preset-id' );
  8500. if( sPresetIdAttr && aPresetIdInMap[ sPresetIdAttr ] )
  8501. this.ePresetId = aPresetIdInMap[ sPresetIdAttr ];
  8502. var nChildrenCount = this.aChildrenArray.length;
  8503. for( var i = 0; i < nChildrenCount; ++i )
  8504. {
  8505. this.aChildrenArray[i].parseElement();
  8506. }
  8507. this.bDurationIndefinite
  8508. = ( !this.getDuration() || this.getDuration().isIndefinite() ) &&
  8509. ( !this.getEnd() || ( this.getEnd().getType() != OFFSET_TIMING ) );
  8510. return bRet;
  8511. };
  8512. BaseContainerNode.prototype.appendChildNode = function( aAnimationNode )
  8513. {
  8514. if( ! this.checkValidNode() )
  8515. return ;
  8516. if( aAnimationNode.registerDeactivatingListener( this ) )
  8517. this.aChildrenArray.push( aAnimationNode );
  8518. };
  8519. BaseContainerNode.prototype.removeAllChildrenNodes = function()
  8520. {
  8521. this.aChildrenArray = [];
  8522. };
  8523. BaseContainerNode.prototype.init_st = function()
  8524. {
  8525. this.nLeftIterations = this.getRepeatCount();
  8526. return this.init_children();
  8527. };
  8528. BaseContainerNode.prototype.init_children = function()
  8529. {
  8530. this.nFinishedChildren = 0;
  8531. var nChildrenCount = this.aChildrenArray.length;
  8532. var nInitChildren = 0;
  8533. for( var i = 0; i < nChildrenCount; ++i )
  8534. {
  8535. if( this.aChildrenArray[i].init() )
  8536. {
  8537. ++nInitChildren;
  8538. }
  8539. }
  8540. return ( nChildrenCount == nInitChildren );
  8541. };
  8542. BaseContainerNode.prototype.deactivate_st = function( eDestState )
  8543. {
  8544. this.nLeftIterations = 0;
  8545. if( eDestState == FROZEN_NODE )
  8546. {
  8547. this.forEachChildNode( mem_fn( 'deactivate' ), ~( FROZEN_NODE | ENDED_NODE ) );
  8548. }
  8549. else
  8550. {
  8551. this.forEachChildNode( mem_fn( 'end' ), ~ENDED_NODE );
  8552. if( this.getFillMode() == FILL_MODE_REMOVE )
  8553. this.removeEffect();
  8554. }
  8555. };
  8556. BaseContainerNode.prototype.hasPendingAnimation = function()
  8557. {
  8558. var nChildrenCount = this.aChildrenArray.length;
  8559. for( var i = 0; i < nChildrenCount; ++i )
  8560. {
  8561. if( this.aChildrenArray[i].hasPendingAnimation() )
  8562. return true;
  8563. }
  8564. return false;
  8565. };
  8566. BaseContainerNode.prototype.activate_st = function()
  8567. {
  8568. log( 'BaseContainerNode.activate_st: abstract method called' );
  8569. };
  8570. BaseContainerNode.prototype.notifyDeactivating = function( /*aAnimationNode*/ )
  8571. {
  8572. log( 'BaseContainerNode.notifyDeactivating: abstract method called' );
  8573. };
  8574. BaseContainerNode.prototype.isDurationIndefinite = function()
  8575. {
  8576. return this.bDurationIndefinite;
  8577. };
  8578. BaseContainerNode.prototype.isChildNode = function( aAnimationNode )
  8579. {
  8580. var nChildrenCount = this.aChildrenArray.length;
  8581. for( var i = 0; i < nChildrenCount; ++i )
  8582. {
  8583. if( this.aChildrenArray[i].getId() == aAnimationNode.getId() )
  8584. return true;
  8585. }
  8586. return false;
  8587. };
  8588. BaseContainerNode.prototype.notifyDeactivatedChild = function( aChildNode )
  8589. {
  8590. assert( ( aChildNode.getState() == FROZEN_NODE ) || ( aChildNode.getState() == ENDED_NODE ),
  8591. 'BaseContainerNode.notifyDeactivatedChild: passed child node is neither in FROZEN nor in ENDED state' );
  8592. assert( this.getState() != INVALID_NODE,
  8593. 'BaseContainerNode.notifyDeactivatedChild: this node is invalid' );
  8594. if( !this.isChildNode( aChildNode ) )
  8595. {
  8596. log( 'BaseContainerNode.notifyDeactivatedChild: unknown child notifier!' );
  8597. return false;
  8598. }
  8599. var nChildrenCount = this.aChildrenArray.length;
  8600. assert( ( this.nFinishedChildren < nChildrenCount ),
  8601. 'BaseContainerNode.notifyDeactivatedChild: assert(this.nFinishedChildren < nChildrenCount) failed' );
  8602. ++this.nFinishedChildren;
  8603. var bFinished = ( this.nFinishedChildren >= nChildrenCount );
  8604. if( bFinished && this.isDurationIndefinite() )
  8605. {
  8606. if( this.nLeftIterations >= 1.0 )
  8607. {
  8608. this.nLeftIterations -= 1.0;
  8609. }
  8610. if( this.nLeftIterations >= 1.0 )
  8611. {
  8612. bFinished = false;
  8613. var aRepetitionEvent = makeDelay( bind( this, this.repeat ), 0.0 );
  8614. this.aContext.aTimerEventQueue.addEvent( aRepetitionEvent );
  8615. }
  8616. else
  8617. {
  8618. this.deactivate();
  8619. }
  8620. }
  8621. return bFinished;
  8622. };
  8623. BaseContainerNode.prototype.repeat = function()
  8624. {
  8625. this.forEachChildNode( mem_fn( 'end' ), ~ENDED_NODE );
  8626. this.removeEffect();
  8627. var bInitialized = this.init_children();
  8628. if( bInitialized )
  8629. this.activate_st();
  8630. return bInitialized;
  8631. };
  8632. BaseContainerNode.prototype.removeEffect = function()
  8633. {
  8634. var nChildrenCount = this.aChildrenArray.length;
  8635. if( nChildrenCount == 0 )
  8636. return;
  8637. for( var i = nChildrenCount - 1; i >= 0; --i )
  8638. {
  8639. if( ( this.aChildrenArray[i].getState() & ( FROZEN_NODE | ENDED_NODE ) ) == 0 )
  8640. {
  8641. log( 'BaseContainerNode.removeEffect: child(id:'
  8642. + this.aChildrenArray[i].getId() + ') is neither frozen nor ended;'
  8643. + ' state: '
  8644. + aTransitionModeOutMap[ this.aChildrenArray[i].getState() ] );
  8645. continue;
  8646. }
  8647. this.aChildrenArray[i].removeEffect();
  8648. }
  8649. };
  8650. BaseContainerNode.prototype.saveStateOfAnimatedElement = function()
  8651. {
  8652. var nChildrenCount = this.aChildrenArray.length;
  8653. for( var i = 0; i < nChildrenCount; ++i )
  8654. {
  8655. this.aChildrenArray[i].saveStateOfAnimatedElement();
  8656. }
  8657. };
  8658. BaseContainerNode.prototype.forEachChildNode = function( aFunction, eNodeStateMask )
  8659. {
  8660. if( !eNodeStateMask )
  8661. eNodeStateMask = -1;
  8662. var nChildrenCount = this.aChildrenArray.length;
  8663. for( var i = 0; i < nChildrenCount; ++i )
  8664. {
  8665. if( ( eNodeStateMask != -1 ) && ( ( this.aChildrenArray[i].getState() & eNodeStateMask ) == 0 ) )
  8666. continue;
  8667. aFunction( this.aChildrenArray[i] );
  8668. }
  8669. };
  8670. BaseContainerNode.prototype.dispose = function()
  8671. {
  8672. var nChildrenCount = this.aChildrenArray.length;
  8673. for( var i = 0; i < nChildrenCount; ++i )
  8674. {
  8675. this.aChildrenArray[i].dispose();
  8676. }
  8677. BaseContainerNode.superclass.dispose.call( this );
  8678. };
  8679. BaseContainerNode.prototype.getImpressNodeType = function()
  8680. {
  8681. return this.eImpressNodeType;
  8682. };
  8683. BaseContainerNode.prototype.info = function( bVerbose )
  8684. {
  8685. var sInfo = BaseContainerNode.superclass.info.call( this, bVerbose );
  8686. if( bVerbose )
  8687. {
  8688. if( this.getImpressNodeType() )
  8689. sInfo += '; node-type: ' + aImpressNodeTypeOutMap[ this.getImpressNodeType() ];
  8690. }
  8691. var nChildrenCount = this.aChildrenArray.length;
  8692. for( var i = 0; i < nChildrenCount; ++i )
  8693. {
  8694. sInfo += '\n';
  8695. sInfo += this.aChildrenArray[i].info( bVerbose );
  8696. }
  8697. return sInfo;
  8698. };
  8699. function ParallelTimeContainer( aAnimElem, aParentNode, aNodeContext )
  8700. {
  8701. ParallelTimeContainer.superclass.constructor.call( this, aAnimElem, aParentNode, aNodeContext );
  8702. this.sClassName = 'ParallelTimeContainer';
  8703. }
  8704. extend( ParallelTimeContainer, BaseContainerNode );
  8705. ParallelTimeContainer.prototype.activate_st = function()
  8706. {
  8707. var nChildrenCount = this.aChildrenArray.length;
  8708. var nResolvedChildren = 0;
  8709. for( var i = 0; i < nChildrenCount; ++i )
  8710. {
  8711. if( this.aChildrenArray[i].resolve() )
  8712. {
  8713. ++nResolvedChildren;
  8714. }
  8715. }
  8716. if( nChildrenCount != nResolvedChildren )
  8717. {
  8718. log( 'ParallelTimeContainer.activate_st: resolving all children failed' );
  8719. return;
  8720. }
  8721. if( this.isDurationIndefinite() && ( nChildrenCount == 0 ) )
  8722. {
  8723. this.scheduleDeactivationEvent( this.makeDeactivationEvent( 0.0 ) );
  8724. }
  8725. else
  8726. {
  8727. this.scheduleDeactivationEvent();
  8728. }
  8729. };
  8730. ParallelTimeContainer.prototype.notifyDeactivating = function( aAnimationNode )
  8731. {
  8732. this.notifyDeactivatedChild( aAnimationNode );
  8733. };
  8734. function SequentialTimeContainer( aAnimElem, aParentNode, aNodeContext )
  8735. {
  8736. SequentialTimeContainer.superclass.constructor.call( this, aAnimElem, aParentNode, aNodeContext );
  8737. this.sClassName = 'SequentialTimeContainer';
  8738. this.bIsRewinding = false;
  8739. this.aCurrentSkipEvent = null;
  8740. this.aRewindCurrentEffectEvent = null;
  8741. this.aRewindLastEffectEvent = null;
  8742. }
  8743. extend( SequentialTimeContainer, BaseContainerNode );
  8744. SequentialTimeContainer.prototype.activate_st = function()
  8745. {
  8746. var nChildrenCount = this.aChildrenArray.length;
  8747. for( ; this.nFinishedChildren < nChildrenCount; ++this.nFinishedChildren )
  8748. {
  8749. if( this.resolveChild( this.aChildrenArray[ this.nFinishedChildren ] ) )
  8750. break;
  8751. else
  8752. log( 'SequentialTimeContainer.activate_st: resolving child failed!' );
  8753. }
  8754. if( this.isDurationIndefinite() && ( ( nChildrenCount == 0 ) || ( this.nFinishedChildren >= nChildrenCount ) ) )
  8755. {
  8756. this.scheduleDeactivationEvent( this.makeDeactivationEvent( 0.0 ) );
  8757. }
  8758. else
  8759. {
  8760. this.scheduleDeactivationEvent();
  8761. }
  8762. };
  8763. SequentialTimeContainer.prototype.notifyDeactivating = function( aNotifier )
  8764. {
  8765. if( this.bIsRewinding )
  8766. return;
  8767. if( this.notifyDeactivatedChild( aNotifier ) )
  8768. return;
  8769. assert( this.nFinishedChildren < this.aChildrenArray.length,
  8770. 'SequentialTimeContainer.notifyDeactivating: assertion (this.nFinishedChildren < this.aChildrenArray.length) failed' );
  8771. var aNextChild = this.aChildrenArray[ this.nFinishedChildren ];
  8772. assert( aNextChild.getState() == UNRESOLVED_NODE,
  8773. 'SequentialTimeContainer.notifyDeactivating: assertion (aNextChild.getState == UNRESOLVED_NODE) failed' );
  8774. if( !this.resolveChild( aNextChild ) )
  8775. {
  8776. this.deactivate();
  8777. }
  8778. };
  8779. SequentialTimeContainer.prototype.skipEffect = function( aChildNode )
  8780. {
  8781. if( this.isChildNode( aChildNode ) )
  8782. {
  8783. this.getContext().aActivityQueue.endAll();
  8784. this.getContext().bIsSkipping = true;
  8785. this.getContext().aTimerEventQueue.forceEmpty();
  8786. this.getContext().bIsSkipping = false;
  8787. var aEvent = makeEvent( bind2( aChildNode.deactivate, aChildNode ) );
  8788. this.getContext().aTimerEventQueue.addEvent( aEvent );
  8789. }
  8790. else
  8791. {
  8792. log( 'SequentialTimeContainer.skipEffect: unknown child: '
  8793. + aChildNode.getId() );
  8794. }
  8795. };
  8796. SequentialTimeContainer.prototype.rewindCurrentEffect = function( aChildNode )
  8797. {
  8798. if( this.isChildNode( aChildNode ) )
  8799. {
  8800. assert( !this.bIsRewinding,
  8801. 'SequentialTimeContainer.rewindCurrentEffect: is already rewinding.' );
  8802. this.bIsRewinding = true;
  8803. this.getContext().aActivityQueue.endAll();
  8804. this.getContext().bIsSkipping = true;
  8805. this.getContext().aTimerEventQueue.forceEmpty();
  8806. this.getContext().bIsSkipping = false;
  8807. this.getContext().aActivityQueue.endAll();
  8808. aChildNode.end();
  8809. aChildNode.removeEffect();
  8810. aChildNode.init();
  8811. this.resolveChild( aChildNode );
  8812. this.notifyRewindedEvent( aChildNode );
  8813. this.bIsRewinding = false;
  8814. }
  8815. else
  8816. {
  8817. log( 'SequentialTimeContainer.rewindCurrentEffect: unknown child: '
  8818. + aChildNode.getId() );
  8819. }
  8820. };
  8821. SequentialTimeContainer.prototype.rewindLastEffect = function( aChildNode )
  8822. {
  8823. if( this.isChildNode( aChildNode ) )
  8824. {
  8825. assert( !this.bIsRewinding,
  8826. 'SequentialTimeContainer.rewindLastEffect: is already rewinding.' );
  8827. this.bIsRewinding = true;
  8828. this.getContext().aTimerEventQueue.forceEmpty();
  8829. this.getContext().aActivityQueue.clear();
  8830. aChildNode.end();
  8831. --this.nFinishedChildren;
  8832. var aPreviousChildNode = this.aChildrenArray[ this.nFinishedChildren ];
  8833. aPreviousChildNode.removeEffect();
  8834. aPreviousChildNode.init();
  8835. aChildNode.init();
  8836. this.resolveChild( aPreviousChildNode );
  8837. this.notifyRewindedEvent( aChildNode );
  8838. this.bIsRewinding = false;
  8839. }
  8840. else
  8841. {
  8842. log( 'SequentialTimeContainer.rewindLastEffect: unknown child: '
  8843. + aChildNode.getId() );
  8844. }
  8845. };
  8846. SequentialTimeContainer.prototype.resolveChild = function( aChildNode )
  8847. {
  8848. var bResolved = aChildNode.resolve();
  8849. if( bResolved && ( this.isMainSequenceRootNode() || this.isInteractiveSequenceRootNode() ) )
  8850. {
  8851. if( this.aCurrentSkipEvent )
  8852. this.aCurrentSkipEvent.dispose();
  8853. this.aCurrentSkipEvent = makeEvent( bind2( SequentialTimeContainer.prototype.skipEffect, this, aChildNode ) );
  8854. if( this.aRewindCurrentEffectEvent )
  8855. this.aRewindCurrentEffectEvent.dispose();
  8856. this.aRewindCurrentEffectEvent = makeEvent( bind2( SequentialTimeContainer.prototype.rewindCurrentEffect, this, aChildNode ) );
  8857. if( this.aRewindLastEffectEvent )
  8858. this.aRewindLastEffectEvent.dispose();
  8859. this.aRewindLastEffectEvent = makeEvent( bind2( SequentialTimeContainer.prototype.rewindLastEffect, this, aChildNode ) );
  8860. if( this.isMainSequenceRootNode() )
  8861. {
  8862. this.aContext.aEventMultiplexer.registerSkipEffectEvent( this.aCurrentSkipEvent );
  8863. this.aContext.aEventMultiplexer.registerRewindCurrentEffectEvent( this.aRewindCurrentEffectEvent );
  8864. this.aContext.aEventMultiplexer.registerRewindLastEffectEvent( this.aRewindLastEffectEvent );
  8865. }
  8866. else if( this.isInteractiveSequenceRootNode() )
  8867. {
  8868. this.aContext.aEventMultiplexer.registerSkipInteractiveEffectEvent( aChildNode.getId(), this.aCurrentSkipEvent );
  8869. this.aContext.aEventMultiplexer.registerRewindRunningInteractiveEffectEvent( aChildNode.getId(), this.aRewindCurrentEffectEvent );
  8870. this.aContext.aEventMultiplexer.registerRewindEndedInteractiveEffectEvent( aChildNode.getId(), this.aRewindLastEffectEvent );
  8871. }
  8872. }
  8873. return bResolved;
  8874. };
  8875. SequentialTimeContainer.prototype.notifyRewindedEvent = function( aChildNode )
  8876. {
  8877. if( this.isInteractiveSequenceRootNode() )
  8878. {
  8879. this.aContext.aEventMultiplexer.notifyRewindedEffectEvent( aChildNode.getId() );
  8880. var sId = aChildNode.getBegin().getEventBaseElementId();
  8881. if( sId )
  8882. {
  8883. this.aContext.aEventMultiplexer.notifyRewindedEffectEvent( sId );
  8884. }
  8885. }
  8886. };
  8887. SequentialTimeContainer.prototype.dispose = function()
  8888. {
  8889. if( this.aCurrentSkipEvent )
  8890. this.aCurrentSkipEvent.dispose();
  8891. SequentialTimeContainer.superclass.dispose.call( this );
  8892. };
  8893. function PropertyAnimationNode( aAnimElem, aParentNode, aNodeContext )
  8894. {
  8895. PropertyAnimationNode.superclass.constructor.call( this, aAnimElem, aParentNode, aNodeContext );
  8896. this.sClassName = 'PropertyAnimationNode';
  8897. }
  8898. extend( PropertyAnimationNode, AnimationBaseNode3 );
  8899. PropertyAnimationNode.prototype.createActivity = function()
  8900. {
  8901. var aActivityParamSet = this.fillActivityParams();
  8902. var aAnimation = createPropertyAnimation( this.getAttributeName(),
  8903. this.getAnimatedElement(),
  8904. this.aNodeContext.aSlideWidth,
  8905. this.aNodeContext.aSlideHeight );
  8906. var aInterpolator = null; // createActivity will compute it;
  8907. return createActivity( aActivityParamSet, this, aAnimation, aInterpolator );
  8908. };
  8909. function isValidTransformation( sType )
  8910. {
  8911. return ( sType === 'translate' || sType === 'scale' || sType === 'rotate'
  8912. || sType === 'skewX' || sType === 'skewY' );
  8913. }
  8914. function AnimationTransformNode( aAnimElem, aParentNode, aNodeContext )
  8915. {
  8916. AnimationTransformNode.superclass.constructor.call( this, aAnimElem, aParentNode, aNodeContext );
  8917. this.sClassName = 'AnimationTransformNode';
  8918. }
  8919. extend( AnimationTransformNode, AnimationBaseNode3 );
  8920. AnimationTransformNode.prototype.parseElement = function()
  8921. {
  8922. var bRet = AnimationTransformNode.superclass.parseElement.call(this);
  8923. var aAnimElem = this.aElement;
  8924. var sTransformType = aAnimElem.getAttribute( 'svg:type' );
  8925. if( !isValidTransformation( sTransformType ) )
  8926. {
  8927. this.eCurrentState = INVALID_NODE;
  8928. log( 'AnimationTransformNode.parseElement: transformation type not found: ' + sTransformType );
  8929. }
  8930. else
  8931. {
  8932. this.sAttributeName = sTransformType;
  8933. }
  8934. return bRet;
  8935. }
  8936. AnimationTransformNode.prototype.createActivity = function()
  8937. {
  8938. var aActivityParamSet = this.fillActivityParams();
  8939. var aAnimation;
  8940. if( this.getAttributeName() === 'scale' || this.getAttributeName() === 'translate' )
  8941. {
  8942. aAnimation = createPairPropertyAnimation( this.getAttributeName(),
  8943. this.getAnimatedElement(),
  8944. this.aNodeContext.aSlideWidth,
  8945. this.aNodeContext.aSlideHeight );
  8946. }
  8947. else
  8948. {
  8949. aAnimation = createPropertyAnimation( this.getAttributeName(),
  8950. this.getAnimatedElement(),
  8951. this.aNodeContext.aSlideWidth,
  8952. this.aNodeContext.aSlideHeight );
  8953. }
  8954. var aInterpolator = null; // createActivity will compute it;
  8955. return createActivity( aActivityParamSet, this, aAnimation, aInterpolator );
  8956. };
  8957. function AnimationSetNode( aAnimElem, aParentNode, aNodeContext )
  8958. {
  8959. AnimationSetNode.superclass.constructor.call( this, aAnimElem, aParentNode, aNodeContext );
  8960. this.sClassName = 'AnimationSetNode';
  8961. }
  8962. extend( AnimationSetNode, AnimationBaseNode2 );
  8963. AnimationSetNode.prototype.createActivity = function()
  8964. {
  8965. var aAnimation = createPropertyAnimation( this.getAttributeName(),
  8966. this.getAnimatedElement(),
  8967. this.aNodeContext.aSlideWidth,
  8968. this.aNodeContext.aSlideHeight );
  8969. var aActivityParamSet = this.fillActivityParams();
  8970. return new SetActivity( aActivityParamSet, aAnimation, this.getToValue() );
  8971. };
  8972. function AnimationColorNode( aAnimElem, aParentNode, aNodeContext )
  8973. {
  8974. AnimationColorNode.superclass.constructor.call( this, aAnimElem, aParentNode, aNodeContext );
  8975. this.sClassName = 'AnimationColorNode';
  8976. this.eColorInterpolation = undefined;
  8977. this.eColorInterpolationDirection = undefined;
  8978. }
  8979. extend( AnimationColorNode, AnimationBaseNode3 );
  8980. AnimationColorNode.prototype.parseElement = function()
  8981. {
  8982. var bRet = AnimationColorNode.superclass.parseElement.call( this );
  8983. var aAnimElem = this.aElement;
  8984. this.eColorInterpolation = COLOR_SPACE_RGB;
  8985. var sColorInterpolationAttr = aAnimElem.getAttributeNS( NSS['anim'], 'color-interpolation' );
  8986. if( sColorInterpolationAttr && aColorSpaceInMap[ sColorInterpolationAttr ] )
  8987. this.eColorInterpolation = aColorSpaceInMap[ sColorInterpolationAttr ];
  8988. this.eColorInterpolationDirection = CLOCKWISE;
  8989. var sColorInterpolationDirectionAttr = aAnimElem.getAttributeNS( NSS['anim'], 'color-interpolation-direction' );
  8990. if( sColorInterpolationDirectionAttr && aClockDirectionInMap[ sColorInterpolationDirectionAttr ] )
  8991. this.eColorInterpolationDirection = aClockDirectionInMap[ sColorInterpolationDirectionAttr ];
  8992. return bRet;
  8993. };
  8994. AnimationColorNode.prototype.createActivity = function()
  8995. {
  8996. var aActivityParamSet = this.fillActivityParams();
  8997. var aAnimation = createPropertyAnimation( this.getAttributeName(),
  8998. this.getAnimatedElement(),
  8999. this.aNodeContext.aSlideWidth,
  9000. this.aNodeContext.aSlideHeight );
  9001. var aColorAnimation;
  9002. var aInterpolator;
  9003. if( this.getColorInterpolation() === COLOR_SPACE_HSL )
  9004. {
  9005. ANIMDBG.print( 'AnimationColorNode.createActivity: color space hsl' );
  9006. aColorAnimation = new HSLAnimationWrapper( aAnimation );
  9007. var aInterpolatorMaker = aInterpolatorHandler.getInterpolator( this.getCalcMode(),
  9008. COLOR_PROPERTY,
  9009. COLOR_SPACE_HSL );
  9010. aInterpolator = aInterpolatorMaker( this.getColorInterpolationDirection() );
  9011. }
  9012. else
  9013. {
  9014. ANIMDBG.print( 'AnimationColorNode.createActivity: color space rgb' );
  9015. aColorAnimation = aAnimation;
  9016. aInterpolator = aInterpolatorHandler.getInterpolator( this.getCalcMode(),
  9017. COLOR_PROPERTY,
  9018. COLOR_SPACE_RGB );
  9019. }
  9020. return createActivity( aActivityParamSet, this, aColorAnimation, aInterpolator );
  9021. };
  9022. AnimationColorNode.prototype.getColorInterpolation = function()
  9023. {
  9024. return this.eColorInterpolation;
  9025. };
  9026. AnimationColorNode.prototype.getColorInterpolationDirection = function()
  9027. {
  9028. return this.eColorInterpolationDirection;
  9029. };
  9030. AnimationColorNode.prototype.info = function( bVerbose )
  9031. {
  9032. var sInfo = AnimationColorNode.superclass.info.call( this, bVerbose );
  9033. if( bVerbose )
  9034. {
  9035. sInfo += '; color-interpolation: ' + aColorSpaceOutMap[ this.getColorInterpolation() ];
  9036. sInfo += '; color-interpolation-direction: ' + aClockDirectionOutMap[ this.getColorInterpolationDirection() ];
  9037. }
  9038. return sInfo;
  9039. };
  9040. function AnimationTransitionFilterNode( aAnimElem, aParentNode, aNodeContext )
  9041. {
  9042. AnimationTransitionFilterNode.superclass.constructor.call( this, aAnimElem, aParentNode, aNodeContext );
  9043. this.sClassName = 'AnimationTransitionFilterNode';
  9044. this.eTransitionType = undefined;
  9045. this.eTransitionSubType = undefined;
  9046. this.bReverseDirection = undefined;
  9047. this.eTransitionMode = undefined;
  9048. }
  9049. extend( AnimationTransitionFilterNode, AnimationBaseNode );
  9050. AnimationTransitionFilterNode.prototype.createActivity = function()
  9051. {
  9052. var aActivityParamSet = this.fillActivityParams();
  9053. return createShapeTransition( aActivityParamSet,
  9054. this.getAnimatedElement(),
  9055. this.aNodeContext.aSlideWidth,
  9056. this.aNodeContext.aSlideHeight,
  9057. this );
  9058. };
  9059. AnimationTransitionFilterNode.prototype.parseElement = function()
  9060. {
  9061. var bRet = AnimationTransitionFilterNode.superclass.parseElement.call( this );
  9062. var bIsValidTransition = true;
  9063. var aAnimElem = this.aElement;
  9064. this.eTransitionType = undefined;
  9065. var sTypeAttr = aAnimElem.getAttributeNS( NSS['smil'], 'type' );
  9066. if( sTypeAttr && aTransitionTypeInMap[ sTypeAttr ] )
  9067. {
  9068. this.eTransitionType = aTransitionTypeInMap[ sTypeAttr ];
  9069. }
  9070. else
  9071. {
  9072. bIsValidTransition = false;
  9073. log( 'AnimationTransitionFilterNode.parseElement: transition type not valid: ' + sTypeAttr );
  9074. }
  9075. this.eTransitionSubType = undefined;
  9076. var sSubTypeAttr = aAnimElem.getAttributeNS( NSS['smil'], 'subtype' );
  9077. if( sSubTypeAttr === null )
  9078. sSubTypeAttr = 'default';
  9079. if( sSubTypeAttr && ( aTransitionSubtypeInMap[ sSubTypeAttr ] !== undefined ) )
  9080. {
  9081. this.eTransitionSubType = aTransitionSubtypeInMap[ sSubTypeAttr ];
  9082. }
  9083. else
  9084. {
  9085. bIsValidTransition = false;
  9086. log( 'AnimationTransitionFilterNode.parseElement: transition subtype not valid: ' + sSubTypeAttr );
  9087. }
  9088. if( !bIsValidTransition )
  9089. {
  9090. this.eTransitionType = FADE_TRANSITION;
  9091. this.eTransitionSubType = CROSSFADE_TRANS_SUBTYPE;
  9092. log( 'AnimationTransitionFilterNode.parseElement: in place of the invalid transition a crossfade transition is used' );
  9093. }
  9094. this.bReverseDirection = false;
  9095. var sDirectionAttr = aAnimElem.getAttributeNS( NSS['smil'], 'direction' );
  9096. if( sDirectionAttr == 'reverse' )
  9097. this.bReverseDirection = true;
  9098. this.eTransitionMode = TRANSITION_MODE_IN;
  9099. var sModeAttr = aAnimElem.getAttributeNS( NSS['smil'], 'mode' );
  9100. if( sModeAttr === 'out' )
  9101. this.eTransitionMode = TRANSITION_MODE_OUT;
  9102. return bRet;
  9103. };
  9104. AnimationTransitionFilterNode.prototype.getTransitionType = function()
  9105. {
  9106. return this.eTransitionType;
  9107. };
  9108. AnimationTransitionFilterNode.prototype.getTransitionSubType = function()
  9109. {
  9110. return this.eTransitionSubType;
  9111. };
  9112. AnimationTransitionFilterNode.prototype.getTransitionMode = function()
  9113. {
  9114. return this.eTransitionMode;
  9115. };
  9116. AnimationTransitionFilterNode.prototype.getReverseDirection = function()
  9117. {
  9118. return this.bReverseDirection;
  9119. };
  9120. AnimationTransitionFilterNode.prototype.info = function( bVerbose )
  9121. {
  9122. var sInfo = AnimationTransitionFilterNode.superclass.info.call( this, bVerbose );
  9123. if( bVerbose )
  9124. {
  9125. sInfo += '; type: ' + getKeyByValue(aTransitionTypeInMap, this.getTransitionType());
  9126. sInfo += '; subtype: ' + getKeyByValue(aTransitionSubtypeInMap, this.getTransitionSubType());
  9127. if( this.getReverseDirection() )
  9128. sInfo += '; direction: reverse';
  9129. }
  9130. return sInfo;
  9131. };
  9132. function createAnimationTree( aRootElement, aNodeContext )
  9133. {
  9134. return createAnimationNode( aRootElement, null, aNodeContext );
  9135. }
  9136. function createAnimationNode( aElement, aParentNode, aNodeContext )
  9137. {
  9138. assert( aElement, 'createAnimationNode: invalid animation element' );
  9139. var eAnimationNodeType = getAnimationElementType( aElement );
  9140. var aCreatedNode = null;
  9141. var aCreatedContainer = null;
  9142. switch( eAnimationNodeType )
  9143. {
  9144. case ANIMATION_NODE_PAR:
  9145. aCreatedNode = aCreatedContainer =
  9146. new ParallelTimeContainer( aElement, aParentNode, aNodeContext );
  9147. break;
  9148. case ANIMATION_NODE_ITERATE:
  9149. aCreatedNode = aCreatedContainer =
  9150. new ParallelTimeContainer( aElement, aParentNode, aNodeContext );
  9151. break;
  9152. case ANIMATION_NODE_SEQ:
  9153. aCreatedNode = aCreatedContainer =
  9154. new SequentialTimeContainer( aElement, aParentNode, aNodeContext );
  9155. break;
  9156. case ANIMATION_NODE_ANIMATE:
  9157. aCreatedNode = new PropertyAnimationNode( aElement, aParentNode, aNodeContext );
  9158. break;
  9159. case ANIMATION_NODE_SET:
  9160. aCreatedNode = new AnimationSetNode( aElement, aParentNode, aNodeContext );
  9161. break;
  9162. case ANIMATION_NODE_ANIMATEMOTION:
  9163. log( 'createAnimationNode: ANIMATEMOTION not implemented' );
  9164. return null;
  9165. case ANIMATION_NODE_ANIMATECOLOR:
  9166. aCreatedNode = new AnimationColorNode( aElement, aParentNode, aNodeContext );
  9167. break;
  9168. case ANIMATION_NODE_ANIMATETRANSFORM:
  9169. aCreatedNode = new AnimationTransformNode( aElement, aParentNode, aNodeContext );
  9170. break;
  9171. case ANIMATION_NODE_TRANSITIONFILTER:
  9172. aCreatedNode = new AnimationTransitionFilterNode( aElement, aParentNode, aNodeContext );
  9173. break;
  9174. case ANIMATION_NODE_AUDIO:
  9175. log( 'createAnimationNode: AUDIO not implemented' );
  9176. return null;
  9177. case ANIMATION_NODE_COMMAND:
  9178. log( 'createAnimationNode: COMMAND not implemented' );
  9179. return null;
  9180. default:
  9181. log( 'createAnimationNode: invalid Animation Node Type: ' + eAnimationNodeType );
  9182. return null;
  9183. }
  9184. if( aCreatedContainer )
  9185. {
  9186. if( eAnimationNodeType == ANIMATION_NODE_ITERATE )
  9187. {
  9188. createIteratedNodes( aElement, aCreatedContainer, aNodeContext );
  9189. }
  9190. else
  9191. {
  9192. var aChildrenArray = getElementChildren( aElement );
  9193. for( var i = 0; i < aChildrenArray.length; ++i )
  9194. {
  9195. if( !createChildNode( aChildrenArray[i], aCreatedContainer, aNodeContext ) )
  9196. {
  9197. aCreatedContainer.removeAllChildrenNodes();
  9198. break;
  9199. }
  9200. }
  9201. }
  9202. }
  9203. return aCreatedNode;
  9204. }
  9205. function createChildNode( aElement, aParentNode, aNodeContext )
  9206. {
  9207. var aChildNode = createAnimationNode( aElement, aParentNode, aNodeContext );
  9208. if( !aChildNode )
  9209. {
  9210. log( 'createChildNode: child node creation failed' );
  9211. return false;
  9212. }
  9213. else
  9214. {
  9215. aParentNode.appendChildNode( aChildNode );
  9216. return true;
  9217. }
  9218. }
  9219. function createIteratedNodes( /*aElement, aContainerNode, aNodeContext*/ )
  9220. {
  9221. }
  9222. function makeScaler( nScale )
  9223. {
  9224. if( ( typeof( nScale ) !== typeof( 0 ) ) || !isFinite( nScale ) )
  9225. {
  9226. log( 'makeScaler: not valid param passed: ' + nScale );
  9227. return null;
  9228. }
  9229. return function( nValue )
  9230. {
  9231. return ( nScale * nValue );
  9232. };
  9233. }
  9234. function createPropertyAnimation( sAttrName, aAnimatedElement, nWidth, nHeight )
  9235. {
  9236. if( !aAttributeMap[ sAttrName ] )
  9237. {
  9238. log( 'createPropertyAnimation: attribute is unknown' );
  9239. return null;
  9240. }
  9241. var aFunctorSet = aAttributeMap[ sAttrName ];
  9242. var sGetValueMethod = aFunctorSet.get;
  9243. var sSetValueMethod = aFunctorSet.set;
  9244. if( !sGetValueMethod || !sSetValueMethod )
  9245. {
  9246. log( 'createPropertyAnimation: attribute is not handled' );
  9247. return null;
  9248. }
  9249. var aGetModifier = eval( aFunctorSet.getmod );
  9250. var aSetModifier = eval( aFunctorSet.setmod );
  9251. return new GenericAnimation( bind( aAnimatedElement, aAnimatedElement[ sGetValueMethod ] ),
  9252. bind( aAnimatedElement, aAnimatedElement[ sSetValueMethod ] ),
  9253. aGetModifier,
  9254. aSetModifier);
  9255. }
  9256. function createPairPropertyAnimation( sTransformType, aAnimatedElement, nWidth, nHeight )
  9257. {
  9258. var aFunctorSet = aAttributeMap[ sTransformType ];
  9259. var sGetValueMethod = aFunctorSet.get;
  9260. var sSetValueMethod = aFunctorSet.set;
  9261. var aDefaultValue = [];
  9262. var aSizeReference = [];
  9263. if( sTransformType === 'scale' )
  9264. {
  9265. aDefaultValue[0] = aSizeReference[0] = aAnimatedElement.getBaseBBox().width;
  9266. aDefaultValue[1] = aSizeReference[1] = aAnimatedElement.getBaseBBox().height;
  9267. }
  9268. else if( sTransformType === 'translate' )
  9269. {
  9270. aDefaultValue[0] = aAnimatedElement.getBaseCenterX();
  9271. aDefaultValue[1] = aAnimatedElement.getBaseCenterY();
  9272. aSizeReference[0] = nWidth;
  9273. aSizeReference[1] = nHeight;
  9274. }
  9275. else
  9276. {
  9277. log( 'createPairPropertyAnimation: transform type is not handled' );
  9278. return null;
  9279. }
  9280. return new TupleAnimation( bind( aAnimatedElement, aAnimatedElement[ sGetValueMethod ] ),
  9281. bind( aAnimatedElement, aAnimatedElement[ sSetValueMethod ] ),
  9282. aDefaultValue,
  9283. aSizeReference );
  9284. }
  9285. function createShapeTransition( aActivityParamSet, aAnimatedElement,
  9286. nSlideWidth, nSlideHeight,
  9287. aAnimatedTransitionFilterNode )
  9288. {
  9289. if( !aAnimatedTransitionFilterNode )
  9290. {
  9291. log( 'createShapeTransition: the animated transition filter node is not valid.' );
  9292. return null;
  9293. }
  9294. var eTransitionType = aAnimatedTransitionFilterNode.getTransitionType();
  9295. var eTransitionSubType = aAnimatedTransitionFilterNode.getTransitionSubType();
  9296. var bDirectionForward = ! aAnimatedTransitionFilterNode.getReverseDirection();
  9297. var bModeIn = ( aAnimatedTransitionFilterNode.getTransitionMode() == FORWARD );
  9298. var aTransitionInfo = aTransitionInfoTable[eTransitionType][eTransitionSubType];
  9299. var eTransitionClass = aTransitionInfo['class'];
  9300. switch( eTransitionClass )
  9301. {
  9302. default:
  9303. case TRANSITION_INVALID:
  9304. log( 'createShapeTransition: transition class: TRANSITION_INVALID' );
  9305. return null;
  9306. case TRANSITION_CLIP_POLYPOLYGON:
  9307. var aParametricPolyPolygon
  9308. = createClipPolyPolygon( eTransitionType, eTransitionSubType );
  9309. var aClippingAnimation
  9310. = new ClippingAnimation( aParametricPolyPolygon, aTransitionInfo,
  9311. bDirectionForward, bModeIn );
  9312. return new SimpleActivity( aActivityParamSet, aClippingAnimation, true );
  9313. case TRANSITION_SPECIAL:
  9314. switch( eTransitionType )
  9315. {
  9316. default:
  9317. var aAnimation
  9318. = createPropertyAnimation( 'opacity',
  9319. aAnimatedElement,
  9320. nSlideWidth,
  9321. nSlideHeight );
  9322. return new SimpleActivity( aActivityParamSet, aAnimation, bModeIn );
  9323. }
  9324. }
  9325. }
  9326. function ClippingAnimation( aParametricPolyPolygon, aTransitionInfo,
  9327. bDirectionForward, bModeIn )
  9328. {
  9329. this.aClippingFunctor = new ClippingFunctor( aParametricPolyPolygon,
  9330. aTransitionInfo,
  9331. bDirectionForward, bModeIn );
  9332. this.bAnimationStarted = false;
  9333. }
  9334. ClippingAnimation.prototype.start = function( aAnimatableElement )
  9335. {
  9336. assert( aAnimatableElement,
  9337. 'ClippingAnimation.start: animatable element is not valid' );
  9338. this.aAnimatableElement = aAnimatableElement;
  9339. this.aAnimatableElement.initClipPath();
  9340. this.aAnimatableElement.notifyAnimationStart();
  9341. if( !this.bAnimationStarted )
  9342. this.bAnimationStarted = true;
  9343. };
  9344. ClippingAnimation.prototype.end = function()
  9345. {
  9346. if( this.bAnimationStarted )
  9347. {
  9348. this.aAnimatableElement.cleanClipPath();
  9349. this.bAnimationStarted = false;
  9350. this.aAnimatableElement.notifyAnimationEnd();
  9351. }
  9352. };
  9353. ClippingAnimation.prototype.perform = function( nValue )
  9354. {
  9355. var nWidth = this.aAnimatableElement.aClippingBBox.width;
  9356. var nHeight = this.aAnimatableElement.aClippingBBox.height;
  9357. var aPolyPolygonElement = this.aClippingFunctor.perform( nValue, nWidth, nHeight );
  9358. this.aAnimatableElement.setClipPath( aPolyPolygonElement );
  9359. };
  9360. ClippingAnimation.prototype.getUnderlyingValue = function()
  9361. {
  9362. return 0.0;
  9363. };
  9364. function GenericAnimation( aGetValueFunc, aSetValueFunc, aGetModifier, aSetModifier )
  9365. {
  9366. assert( aGetValueFunc && aSetValueFunc,
  9367. 'GenericAnimation constructor: get value functor and/or set value functor are not valid' );
  9368. this.aGetValueFunc = aGetValueFunc;
  9369. this.aSetValueFunc = aSetValueFunc;
  9370. this.aGetModifier = aGetModifier;
  9371. this.aSetModifier = aSetModifier;
  9372. this.aAnimatableElement = null;
  9373. this.bAnimationStarted = false;
  9374. }
  9375. GenericAnimation.prototype.start = function( aAnimatableElement )
  9376. {
  9377. assert( aAnimatableElement, 'GenericAnimation.start: animatable element is not valid' );
  9378. this.aAnimatableElement = aAnimatableElement;
  9379. this.aAnimatableElement.notifyAnimationStart();
  9380. if( !this.bAnimationStarted )
  9381. this.bAnimationStarted = true;
  9382. };
  9383. GenericAnimation.prototype.end = function()
  9384. {
  9385. if( this.bAnimationStarted )
  9386. {
  9387. this.bAnimationStarted = false;
  9388. this.aAnimatableElement.notifyAnimationEnd();
  9389. }
  9390. };
  9391. GenericAnimation.prototype.perform = function( aValue )
  9392. {
  9393. if( this.aSetModifier )
  9394. aValue = this.aSetModifier( aValue );
  9395. this.aSetValueFunc( aValue );
  9396. };
  9397. GenericAnimation.prototype.getUnderlyingValue = function()
  9398. {
  9399. var aValue = this.aGetValueFunc();
  9400. if( this.aGetModifier )
  9401. aValue = this.aGetModifier( aValue );
  9402. return aValue;
  9403. };
  9404. function TupleAnimation( aGetValueFunc, aSetValueFunc, aDefaultValue, aReferenceSize )
  9405. {
  9406. TupleAnimation.superclass.constructor.call( this, aGetValueFunc, aSetValueFunc );
  9407. assert( aDefaultValue && aReferenceSize,
  9408. 'TupleAnimation constructor: default value functor and/or reference size are not valid' );
  9409. this.aDefaultValue = aDefaultValue;
  9410. this.aReferenceSize = aReferenceSize;
  9411. }
  9412. extend( TupleAnimation, GenericAnimation );
  9413. TupleAnimation.prototype.perform = function( aNormValue )
  9414. {
  9415. assert(aNormValue.length === this.aReferenceSize.length);
  9416. var aValue = [];
  9417. for( var i = 0; i < aNormValue.length; ++i )
  9418. {
  9419. aValue.push( aNormValue[i] * this.aReferenceSize[i] );
  9420. }
  9421. this.aSetValueFunc( aValue );
  9422. };
  9423. TupleAnimation.prototype.getUnderlyingValue = function()
  9424. {
  9425. var aValue = this.aGetValueFunc();
  9426. assert(aValue.length === this.aReferenceSize.length);
  9427. var aNormValue = [];
  9428. for( var i = 0; i < aValue.length; ++i )
  9429. {
  9430. aNormValue.push( aValue[i] / this.aReferenceSize[i] );
  9431. }
  9432. return aNormValue;
  9433. };
  9434. function HSLAnimationWrapper( aColorAnimation )
  9435. {
  9436. assert( aColorAnimation,
  9437. 'HSLAnimationWrapper constructor: invalid color animation delegate' );
  9438. this.aAnimation = aColorAnimation;
  9439. }
  9440. HSLAnimationWrapper.prototype.start = function( aAnimatableElement )
  9441. {
  9442. this.aAnimation.start( aAnimatableElement );
  9443. };
  9444. HSLAnimationWrapper.prototype.end = function()
  9445. {
  9446. this.aAnimation.end();
  9447. };
  9448. HSLAnimationWrapper.prototype.perform = function( aHSLValue )
  9449. {
  9450. this.aAnimation.perform( aHSLValue.convertToRGB() );
  9451. };
  9452. HSLAnimationWrapper.prototype.getUnderlyingValue = function()
  9453. {
  9454. return this.aAnimation.getUnderlyingValue().convertToHSL();
  9455. };
  9456. function SlideChangeBase(aLeavingSlide, aEnteringSlide)
  9457. {
  9458. this.aLeavingSlide = aLeavingSlide;
  9459. this.aEnteringSlide = aEnteringSlide;
  9460. this.bIsFinished = false;
  9461. }
  9462. SlideChangeBase.prototype.start = function()
  9463. {
  9464. };
  9465. SlideChangeBase.prototype.end = function()
  9466. {
  9467. if( this.bIsFinished )
  9468. return;
  9469. this.aLeavingSlide.hide();
  9470. this.aEnteringSlide.reset();
  9471. this.aLeavingSlide.reset();
  9472. this.bIsFinished = true;
  9473. };
  9474. SlideChangeBase.prototype.perform = function( nValue )
  9475. {
  9476. if( this.bIsFinished ) return false;
  9477. if( this.aLeavingSlide )
  9478. this.performOut( nValue );
  9479. if( this.aEnteringSlide )
  9480. this.performIn( nValue );
  9481. return true;
  9482. };
  9483. SlideChangeBase.prototype.getUnderlyingValue = function()
  9484. {
  9485. return 0.0;
  9486. };
  9487. SlideChangeBase.prototype.performIn = function( )
  9488. {
  9489. log( 'SlideChangeBase.performIn: abstract method called' );
  9490. };
  9491. SlideChangeBase.prototype.performOut = function( )
  9492. {
  9493. log( 'SlideChangeBase.performOut: abstract method called' );
  9494. };
  9495. function FadingSlideChange( aLeavingSlide, aEnteringSlide )
  9496. {
  9497. FadingSlideChange.superclass.constructor.call( this, aLeavingSlide, aEnteringSlide );
  9498. this.bFirstRun = true;
  9499. }
  9500. extend( FadingSlideChange, SlideChangeBase );
  9501. FadingSlideChange.prototype.start = function()
  9502. {
  9503. FadingSlideChange.superclass.start.call( this );
  9504. this.aEnteringSlide.notifyUsedAttribute( 'opacity' );
  9505. this.aLeavingSlide.notifyUsedAttribute( 'opacity' );
  9506. this.aEnteringSlide.setOpacity( 0.0 );
  9507. this.aEnteringSlide.show();
  9508. };
  9509. FadingSlideChange.prototype.performIn = function( nT )
  9510. {
  9511. this.aEnteringSlide.setOpacity( nT );
  9512. };
  9513. FadingSlideChange.prototype.performOut = function( nT )
  9514. {
  9515. this.aLeavingSlide.setOpacity( 1 - nT );
  9516. };
  9517. function FadingOverColorSlideChange( aLeavingSlide, aEnteringSlide, sFadeColor )
  9518. {
  9519. FadingSlideChange.superclass.constructor.call( this, aLeavingSlide, aEnteringSlide );
  9520. this.sFadeColor = sFadeColor;
  9521. if( !this.sFadeColor )
  9522. {
  9523. log( 'FadingOverColorSlideChange: sFadeColor not valid.' );
  9524. this.sFadeColor = '#000000';
  9525. }
  9526. this.aColorPlaneElement = this.createColorPlaneElement();
  9527. }
  9528. extend( FadingOverColorSlideChange, SlideChangeBase );
  9529. FadingOverColorSlideChange.prototype.start = function()
  9530. {
  9531. FadingOverColorSlideChange.superclass.start.call( this );
  9532. this.aEnteringSlide.notifyUsedAttribute( 'opacity' );
  9533. this.aLeavingSlide.notifyUsedAttribute( 'opacity' );
  9534. this.aLeavingSlide.insertBefore( this.aColorPlaneElement );
  9535. this.aEnteringSlide.setOpacity( 0.0 );
  9536. this.aEnteringSlide.show();
  9537. };
  9538. FadingOverColorSlideChange.prototype.end = function()
  9539. {
  9540. FadingOverColorSlideChange.superclass.end.call( this );
  9541. this.aLeavingSlide.removeElement( this.aColorPlaneElement );
  9542. };
  9543. FadingOverColorSlideChange.prototype.performIn = function( nT )
  9544. {
  9545. this.aEnteringSlide.setOpacity( (nT > 0.55) ? 2.0*(nT-0.55) : 0.0 );
  9546. };
  9547. FadingOverColorSlideChange.prototype.performOut = function( nT )
  9548. {
  9549. this.aLeavingSlide.setOpacity( (nT > 0.45) ? 0.0 : 2.0*(0.45-nT) );
  9550. };
  9551. FadingOverColorSlideChange.prototype.createColorPlaneElement = function()
  9552. {
  9553. var aColorPlaneElement = document.createElementNS( NSS['svg'], 'rect' );
  9554. aColorPlaneElement.setAttribute( 'width', String( this.aLeavingSlide.getWidth() ) );
  9555. aColorPlaneElement.setAttribute( 'height', String( this.aLeavingSlide.getHeight() ) );
  9556. aColorPlaneElement.setAttribute( 'fill', this.sFadeColor );
  9557. return aColorPlaneElement;
  9558. };
  9559. function MovingSlideChange( aLeavingSlide, aEnteringSlide,
  9560. aLeavingDirection, aEnteringDirection )
  9561. {
  9562. MovingSlideChange.superclass.constructor.call( this, aLeavingSlide, aEnteringSlide );
  9563. this.aLeavingDirection = aLeavingDirection;
  9564. this.aEnteringDirection = aEnteringDirection;
  9565. }
  9566. extend( MovingSlideChange, SlideChangeBase );
  9567. MovingSlideChange.prototype.start = function()
  9568. {
  9569. MovingSlideChange.superclass.start.call( this );
  9570. this.aEnteringSlide.notifyUsedAttribute( 'transform' );
  9571. this.aLeavingSlide.notifyUsedAttribute( 'transform' );
  9572. this.performIn( 0 );
  9573. this.aEnteringSlide.show();
  9574. };
  9575. MovingSlideChange.prototype.performIn = function( nT )
  9576. {
  9577. var nS = nT - 1;
  9578. var dx = nS * this.aEnteringDirection.x * this.aEnteringSlide.getWidth();
  9579. var dy = nS * this.aEnteringDirection.y * this.aEnteringSlide.getHeight();
  9580. this.aEnteringSlide.translate( dx, dy );
  9581. };
  9582. MovingSlideChange.prototype.performOut = function( nT )
  9583. {
  9584. var dx = nT * this.aLeavingDirection.x * this.aLeavingSlide.getWidth();
  9585. var dy = nT * this.aLeavingDirection.y * this.aLeavingSlide.getHeight();
  9586. this.aLeavingSlide.translate( dx, dy );
  9587. };
  9588. function ClippedSlideChange( aLeavingSlide, aEnteringSlide, aParametricPolyPolygon,
  9589. aTransitionInfo, bIsDirectionForward )
  9590. {
  9591. ClippedSlideChange.superclass.constructor.call( this, aLeavingSlide, aEnteringSlide );
  9592. var bIsModeIn = true;
  9593. this.aClippingFunctor= new ClippingFunctor( aParametricPolyPolygon, aTransitionInfo,
  9594. bIsDirectionForward, bIsModeIn );
  9595. }
  9596. extend( ClippedSlideChange, SlideChangeBase );
  9597. ClippedSlideChange.prototype.start = function()
  9598. {
  9599. ClippedSlideChange.superclass.start.call( this );
  9600. this.aEnteringSlide.notifyUsedAttribute( 'clip-path' );
  9601. this.performIn( 0 );
  9602. this.aEnteringSlide.show();
  9603. };
  9604. ClippedSlideChange.prototype.performIn = function( nT )
  9605. {
  9606. var nWidth = this.aEnteringSlide.getWidth();
  9607. var nHeight = this.aEnteringSlide.getHeight();
  9608. var aPolyPolygonElement = this.aClippingFunctor.perform( nT, nWidth, nHeight );
  9609. this.aEnteringSlide.setClipPath( aPolyPolygonElement );
  9610. };
  9611. ClippedSlideChange.prototype.performOut = function( )
  9612. {
  9613. };
  9614. function ClippingFunctor( aParametricPolyPolygon, aTransitionInfo,
  9615. bIsDirectionForward, bIsModeIn)
  9616. {
  9617. this.aParametricPolyPolygon = aParametricPolyPolygon;
  9618. this.aStaticTransformation = null;
  9619. this.bForwardParameterSweep = true;
  9620. this.bSubtractPolygon = false;
  9621. this.bScaleIsotropically = aTransitionInfo.scaleIsotropically;
  9622. this.bFlip = false;
  9623. assert( this.aParametricPolyPolygon,
  9624. 'ClippingFunctor: parametric polygon is not valid' );
  9625. if( aTransitionInfo.rotationAngle != 0.0 ||
  9626. aTransitionInfo.scaleX != 1.0 || aTransitionInfo.scaleY != 1.0 )
  9627. {
  9628. this.aStaticTransformation = SVGIdentityMatrix.translate( 0.5, 0.5 );
  9629. if( aTransitionInfo.scaleX != 1.0 || aTransitionInfo.scaleY != 1.0 )
  9630. this.aStaticTransformation
  9631. = this.aStaticTransformation.scaleNonUniform( aTransitionInfo.scaleX,
  9632. aTransitionInfo.scaleY );
  9633. if( aTransitionInfo.rotationAngle != 0.0 )
  9634. this.aStaticTransformation
  9635. = this.aStaticTransformation.rotate( aTransitionInfo.rotationAngle );
  9636. this.aStaticTransformation = this.aStaticTransformation.translate( -0.5, -0.5 );
  9637. }
  9638. else
  9639. {
  9640. this.aStaticTransformation = document.documentElement.createSVGMatrix();
  9641. }
  9642. if( !bIsDirectionForward )
  9643. {
  9644. var aMatrix = null;
  9645. switch( aTransitionInfo.reverseMethod )
  9646. {
  9647. default:
  9648. log( 'ClippingFunctor: unexpected reverse method.' );
  9649. break;
  9650. case REVERSEMETHOD_IGNORE:
  9651. break;
  9652. case REVERSEMETHOD_INVERT_SWEEP:
  9653. this.bForwardParameterSweep = !this.bForwardParameterSweep;
  9654. break;
  9655. case REVERSEMETHOD_SUBTRACT_POLYGON:
  9656. this.bSubtractPolygon = !this.bSubtractPolygon;
  9657. break;
  9658. case REVERSEMETHOD_SUBTRACT_AND_INVERT:
  9659. this.bForwardParameterSweep = !this.bForwardParameterSweep;
  9660. this.bSubtractPolygon = !this.bSubtractPolygon;
  9661. break;
  9662. case REVERSEMETHOD_ROTATE_180:
  9663. aMatrix = document.documentElement.createSVGMatrix();
  9664. aMatrix.setToRotationAroundPoint( 0.5, 0.5, 180 );
  9665. this.aStaticTransformation = aMatrix.multiply( this.aStaticTransformation );
  9666. break;
  9667. case REVERSEMETHOD_FLIP_X:
  9668. aMatrix = document.documentElement.createSVGMatrix();
  9669. aMatrix.a = -1; aMatrix.e = 1.0;
  9670. this.aStaticTransformation = aMatrix.multiply( this.aStaticTransformation );
  9671. this.bFlip = true;
  9672. break;
  9673. case REVERSEMETHOD_FLIP_Y:
  9674. aMatrix = document.documentElement.createSVGMatrix();
  9675. aMatrix.d = -1; aMatrix.f = 1.0;
  9676. this.aStaticTransformation = aMatrix.multiply( this.aStaticTransformation );
  9677. this.bFlip = true;
  9678. break;
  9679. }
  9680. }
  9681. if( !bIsModeIn )
  9682. {
  9683. if( aTransitionInfo.outInvertsSweep )
  9684. {
  9685. this.bForwardParameterSweep = !this.bForwardParameterSweep;
  9686. }
  9687. else
  9688. {
  9689. this.bSubtractPolygon = !this.bSubtractPolygon;
  9690. }
  9691. }
  9692. }
  9693. ClippingFunctor.aBoundingPath = document.createElementNS( NSS['svg'], 'path' );
  9694. ClippingFunctor.aBoundingPath.setAttribute( 'd', 'M -1 -1 L 2 -1 L 2 2 L -1 2 L -1 -1' );
  9695. ClippingFunctor.prototype.perform = function( nT, nWidth, nHeight )
  9696. {
  9697. var aClipPoly = this.aParametricPolyPolygon.perform( this.bForwardParameterSweep ? nT : (1 - nT) );
  9698. if( this.bSubtractPolygon )
  9699. {
  9700. aClipPoly.changeOrientation();
  9701. aClipPoly.prependPath( ClippingFunctor.aBoundingPath );
  9702. }
  9703. var aMatrix;
  9704. if( this.bScaleIsotropically )
  9705. {
  9706. var nScaleFactor = Math.max( nWidth, nHeight );
  9707. aMatrix = SVGIdentityMatrix.translate( -( nScaleFactor - nWidth ) / 2.0,
  9708. -( nScaleFactor - nHeight ) / 2.0 );
  9709. aMatrix = aMatrix.scale( nScaleFactor );
  9710. aMatrix = aMatrix.multiply( this.aStaticTransformation );
  9711. }
  9712. else
  9713. {
  9714. aMatrix = SVGIdentityMatrix.scaleNonUniform( nWidth, nHeight );
  9715. aMatrix = aMatrix.multiply( this.aStaticTransformation );
  9716. }
  9717. aClipPoly.matrixTransform( aMatrix );
  9718. return aClipPoly;
  9719. };
  9720. function createClipPolyPolygon( nType, nSubtype )
  9721. {
  9722. switch( nType )
  9723. {
  9724. default:
  9725. log( 'createClipPolyPolygon: unknown transition type: ' + nType );
  9726. return null;
  9727. case BARWIPE_TRANSITION:
  9728. return new BarWipePath( 1 );
  9729. case FOURBOXWIPE_TRANSITION:
  9730. return new FourBoxWipePath( nSubtype === CORNERSOUT_TRANS_SUBTYPE );
  9731. case BOXWIPE_TRANSITION:
  9732. return new BoxWipePath( nSubtype == LEFTCENTER_TRANS_SUBTYPE ||
  9733. nSubtype == TOPCENTER_TRANS_SUBTYPE ||
  9734. nSubtype == RIGHTCENTER_TRANS_SUBTYPE ||
  9735. nSubtype == BOTTOMCENTER_TRANS_SUBTYPE );
  9736. case ELLIPSEWIPE_TRANSITION:
  9737. return new EllipseWipePath( nSubtype );
  9738. case FANWIPE_TRANSITION:
  9739. return new FanWipePath(nSubtype == CENTERTOP_TRANS_SUBTYPE ||
  9740. nSubtype == CENTERRIGHT_TRANS_SUBTYPE, true, false);
  9741. case PINWHEELWIPE_TRANSITION:
  9742. var nBlades;
  9743. switch( nSubtype )
  9744. {
  9745. case ONEBLADE_TRANS_SUBTYPE:
  9746. nBlades = 1;
  9747. break;
  9748. case DEFAULT_TRANS_SUBTYPE:
  9749. case TWOBLADEVERTICAL_TRANS_SUBTYPE:
  9750. nBlades = 2;
  9751. break;
  9752. case TWOBLADEHORIZONTAL_TRANS_SUBTYPE:
  9753. nBlades = 2;
  9754. break;
  9755. case THREEBLADE_TRANS_SUBTYPE:
  9756. nBlades = 3;
  9757. break;
  9758. case FOURBLADE_TRANS_SUBTYPE:
  9759. nBlades = 4;
  9760. break;
  9761. case EIGHTBLADE_TRANS_SUBTYPE:
  9762. nBlades = 8;
  9763. break;
  9764. default:
  9765. log( 'createClipPolyPolygon: unknown subtype: ' + nSubtype );
  9766. return null;
  9767. }
  9768. return new PinWheelWipePath( nBlades );
  9769. case CLOCKWIPE_TRANSITION:
  9770. return new ClockWipePath();
  9771. case RANDOMBARWIPE_TRANSITION:
  9772. return new RandomWipePath( 128, true /* bars */ );
  9773. case CHECKERBOARDWIPE_TRANSITION:
  9774. return new CheckerBoardWipePath( 10 );
  9775. case ZIGZAGWIPE_TRANSITION:
  9776. return new ZigZagWipePath( 5 );
  9777. case BARNZIGZAGWIPE_TRANSITION:
  9778. return new BarnZigZagWipePath( 5 );
  9779. case IRISWIPE_TRANSITION:
  9780. switch(nSubtype)
  9781. {
  9782. case RECTANGLE_TRANS_SUBTYPE:
  9783. return new IrisWipePath(0);
  9784. case DIAMOND_TRANS_SUBTYPE:
  9785. return new IrisWipePath(1);
  9786. default:
  9787. log( 'createClipPolyPolygon: unknown subtype: ' + nSubtype );
  9788. return null;
  9789. }
  9790. case BARNDOORWIPE_TRANSITION:
  9791. return new BarnDoorWipePath(false);
  9792. case SINGLESWEEPWIPE_TRANSITION:
  9793. return new SweepWipePath(
  9794. nSubtype == CLOCKWISETOP_TRANS_SUBTYPE ||
  9795. nSubtype == CLOCKWISERIGHT_TRANS_SUBTYPE ||
  9796. nSubtype == CLOCKWISEBOTTOM_TRANS_SUBTYPE ||
  9797. nSubtype == CLOCKWISELEFT_TRANS_SUBTYPE,
  9798. true,
  9799. false,
  9800. nSubtype == COUNTERCLOCKWISEBOTTOMLEFT_TRANS_SUBTYPE ||
  9801. nSubtype == COUNTERCLOCKWISETOPRIGHT_TRANS_SUBTYPE );
  9802. case WATERFALLWIPE_TRANSITION:
  9803. return new WaterfallWipePath(128, // flipOnYAxis
  9804. nSubtype == VERTICALRIGHT_TRANS_SUBTYPE ||
  9805. nSubtype == HORIZONTALLEFT_TRANS_SUBTYPE);
  9806. case MISCDIAGONALWIPE_TRANSITION:
  9807. switch(nSubtype) {
  9808. case DOUBLEBARNDOOR_TRANS_SUBTYPE:
  9809. return new BarnDoorWipePath(true /* Doubled */);
  9810. case DOUBLEDIAMOND_TRANS_SUBTYPE:
  9811. return new DoubleDiamondWipePath();
  9812. default:
  9813. log( 'createClipPolyPolygon: unhandled subtype: ' + nSubtype );
  9814. return null;
  9815. }
  9816. case DISSOLVE_TRANSITION:
  9817. return new RandomWipePath( 16 * 16, false /* dissolve */ );
  9818. case VEEWIPE_TRANSITION:
  9819. return new VeeWipePath();
  9820. case SNAKEWIPE_TRANSITION:
  9821. return new SnakeWipePath( 8 * 8, // diagonal
  9822. nSubtype == TOPLEFTDIAGONAL_TRANS_SUBTYPE ||
  9823. nSubtype == TOPRIGHTDIAGONAL_TRANS_SUBTYPE ||
  9824. nSubtype == BOTTOMRIGHTDIAGONAL_TRANS_SUBTYPE ||
  9825. nSubtype == BOTTOMLEFTDIAGONAL_TRANS_SUBTYPE ,
  9826. nSubtype == TOPLEFTVERTICAL_TRANS_SUBTYPE ||
  9827. nSubtype == TOPRIGHTDIAGONAL_TRANS_SUBTYPE ||
  9828. nSubtype == BOTTOMLEFTDIAGONAL_TRANS_SUBTYPE
  9829. );
  9830. case PARALLELSNAKESWIPE_TRANSITION:
  9831. return new ParallelSnakesWipePath(
  9832. 8 * 8, // elements
  9833. nSubtype == DIAGONALBOTTOMLEFTOPPOSITE_TRANS_SUBTYPE ||
  9834. nSubtype == DIAGONALTOPLEFTOPPOSITE_TRANS_SUBTYPE,
  9835. nSubtype == VERTICALBOTTOMLEFTOPPOSITE_TRANS_SUBTYPE ||
  9836. nSubtype == HORIZONTALTOPLEFTOPPOSITE_TRANS_SUBTYPE ||
  9837. nSubtype == DIAGONALTOPLEFTOPPOSITE_TRANS_SUBTYPE,
  9838. nSubtype == VERTICALTOPLEFTOPPOSITE_TRANS_SUBTYPE ||
  9839. nSubtype == VERTICALBOTTOMLEFTOPPOSITE_TRANS_SUBTYPE ||
  9840. nSubtype == HORIZONTALTOPLEFTOPPOSITE_TRANS_SUBTYPE ||
  9841. nSubtype == HORIZONTALTOPRIGHTOPPOSITE_TRANS_SUBTYPE ||
  9842. nSubtype == DIAGONALBOTTOMLEFTOPPOSITE_TRANS_SUBTYPE ||
  9843. nSubtype == DIAGONALTOPLEFTOPPOSITE_TRANS_SUBTYPE
  9844. );
  9845. case SPIRALWIPE_TRANSITION:
  9846. return new SpiralWipePath(
  9847. 8 * 8, // elements
  9848. nSubtype == TOPLEFTCOUNTERCLOCKWISE_TRANS_SUBTYPE ||
  9849. nSubtype == TOPRIGHTCOUNTERCLOCKWISE_TRANS_SUBTYPE ||
  9850. nSubtype == BOTTOMRIGHTCOUNTERCLOCKWISE_TRANS_SUBTYPE ||
  9851. nSubtype == BOTTOMLEFTCOUNTERCLOCKWISE_TRANS_SUBTYPE );
  9852. case BOXSNAKESWIPE_TRANSITION:
  9853. return new BoxSnakesWipePath(
  9854. 8 * 8,
  9855. nSubtype == FOURBOXVERTICAL_TRANS_SUBTYPE ||
  9856. nSubtype == FOURBOXHORIZONTAL_TRANS_SUBTYPE );
  9857. }
  9858. }
  9859. function createUnitSquarePath()
  9860. {
  9861. var aPath = document.createElementNS( NSS['svg'], 'path' );
  9862. var sD = 'M 0 0 L 1 0 L 1 1 L 0 1 L 0 0';
  9863. aPath.setAttribute( 'd', sD );
  9864. return aPath;
  9865. }
  9866. function createEmptyPath()
  9867. {
  9868. var aPath = document.createElementNS( NSS['svg'], 'path' );
  9869. var sD = 'M 0 0 L 0 0';
  9870. aPath.setAttribute( 'd', sD );
  9871. return aPath;
  9872. }
  9873. function pruneScaleValue( nVal )
  9874. {
  9875. if( nVal < 0.0 )
  9876. return (nVal < -0.00001 ? nVal : -0.00001);
  9877. else
  9878. return (nVal > 0.00001 ? nVal : 0.00001);
  9879. }
  9880. function BarWipePath( nBars /* nBars > 1: blinds effect */ )
  9881. {
  9882. this.nBars = nBars;
  9883. if( this.nBars === undefined || this.nBars < 1 )
  9884. this.nBars = 1;
  9885. this.aBasePath = createUnitSquarePath();
  9886. }
  9887. BarWipePath.prototype.perform = function( nT )
  9888. {
  9889. var aMatrix = SVGIdentityMatrix.scaleNonUniform( pruneScaleValue( nT / this.nBars ), 1.0 );
  9890. var aPolyPath = this.aBasePath.cloneNode( true );
  9891. aPolyPath.matrixTransform( aMatrix );
  9892. if( this.nBars > 1 )
  9893. {
  9894. var i;
  9895. var aTransform;
  9896. var aPath;
  9897. for( i = this.nBars - 1; i > 0; --i )
  9898. {
  9899. aTransform = SVGIdentityMatrix.translate( i / this.nBars, 0.0 );
  9900. aTransform = aTransform.multiply( aMatrix );
  9901. aPath = this.aBasePath.cloneNode( true );
  9902. aPath.matrixTransform( aTransform );
  9903. aPolyPath.appendPath( aPath );
  9904. }
  9905. }
  9906. return aPolyPath;
  9907. };
  9908. function BoxWipePath(bIsTopCentered) {
  9909. this.bIsTopCentered = bIsTopCentered;
  9910. this.aBasePath = createUnitSquarePath();
  9911. }
  9912. BoxWipePath.prototype.perform = function( nT ) {
  9913. var d = pruneScaleValue(nT);
  9914. var aTransform = SVGIdentityMatrix;
  9915. if(this.bIsTopCentered) {
  9916. aTransform = aTransform.translate(-0.5, 0.0).scale(d, d).translate(0.5, 0.0);
  9917. }
  9918. else {
  9919. aTransform = aTransform.scale(d, d);
  9920. }
  9921. var aPath = this.aBasePath.cloneNode(true);
  9922. aPath.matrixTransform(aTransform);
  9923. return aPath;
  9924. }
  9925. function SweepWipePath(bCenter, bSingle, bOppositeVertical, bFlipOnYAxis) {
  9926. this.bCenter = bCenter;
  9927. this.bSingle = bSingle;
  9928. this.bOppositeVertical = bOppositeVertical;
  9929. this.bFlipOnYAxis = bFlipOnYAxis;
  9930. this.aBasePath = createUnitSquarePath();
  9931. }
  9932. SweepWipePath.prototype.perform = function( nT ) {
  9933. nT /= 2.0;
  9934. if(!this.bCenter)
  9935. nT /= 2.0;
  9936. if(!this.bSingle && !this.bOppositeVertical)
  9937. nT /= 2.0;
  9938. var poly = PinWheelWipePath.calcCenteredClock( nT + 0.25, 1.0 );
  9939. var aTransform;
  9940. if(this.bCenter) {
  9941. aTransform = SVGIdentityMatrix.translate(0.5, 0.0);
  9942. poly.matrixTransform(aTransform);
  9943. }
  9944. var res = poly;
  9945. if(!this.bSingle) {
  9946. if(this.bOppositeVertical) {
  9947. aTransform = SVGIdentityMatrix.scale(1.0, -1.0);
  9948. aTransform.translate(0.0, 1.0);
  9949. poly.matrixTransform(aTransform);
  9950. poly.changeOrientation();
  9951. }
  9952. else {
  9953. aTransform = SVGIdentityMatrix.translate(-0.5, -0.5);
  9954. aTransform.rotate(Math.PI);
  9955. aTransform.translate(0.5, 0.5);
  9956. poly.matrixTransform(aTransform);
  9957. }
  9958. res.appendPath(poly);
  9959. }
  9960. return this.bFlipOnYAxis ? flipOnYAxis(res) : res;
  9961. }
  9962. function FourBoxWipePath( bCornersOut )
  9963. {
  9964. this.bCornersOut = bCornersOut;
  9965. this.aBasePath = createUnitSquarePath();
  9966. }
  9967. FourBoxWipePath.prototype.perform = function( nT )
  9968. {
  9969. var aMatrix;
  9970. var d = pruneScaleValue( nT / 2.0 );
  9971. if( this.bCornersOut )
  9972. {
  9973. aMatrix = SVGIdentityMatrix.translate( -0.25, -0.25 ).scale( d ).translate( -0.5, -0.5 );
  9974. }
  9975. else
  9976. {
  9977. aMatrix = SVGIdentityMatrix.translate( -0.5, -0.5 ).scale( d );
  9978. }
  9979. var aTransform = aMatrix;
  9980. var aSquare = this.aBasePath.cloneNode( true );
  9981. aSquare.matrixTransform( aTransform );
  9982. var aPolyPath = aSquare;
  9983. aMatrix = SVGIdentityMatrix.flipY();
  9984. aTransform = aMatrix.multiply( aTransform );
  9985. aSquare = this.aBasePath.cloneNode( true );
  9986. aSquare.matrixTransform( aTransform );
  9987. aSquare.changeOrientation();
  9988. aPolyPath.appendPath( aSquare );
  9989. aMatrix = SVGIdentityMatrix.flipX();
  9990. aTransform = aMatrix.multiply( aTransform );
  9991. aSquare = this.aBasePath.cloneNode( true );
  9992. aSquare.matrixTransform( aTransform );
  9993. aPolyPath.appendPath( aSquare );
  9994. aMatrix = SVGIdentityMatrix.flipY();
  9995. aTransform = aMatrix.multiply( aTransform );
  9996. aSquare = this.aBasePath.cloneNode( true );
  9997. aSquare.matrixTransform( aTransform );
  9998. aSquare.changeOrientation();
  9999. aPolyPath.appendPath( aSquare );
  10000. aMatrix = SVGIdentityMatrix.translate( 0.5, 0.5 );
  10001. aMatrix = aMatrix.scale( 1.1 );
  10002. aPolyPath.matrixTransform( aMatrix );
  10003. return aPolyPath;
  10004. };
  10005. function EllipseWipePath( eSubtype )
  10006. {
  10007. this.eSubtype = eSubtype;
  10008. var sPathData = 'M 0.5 -0.207107 ' +
  10009. 'C 0.687536 -0.207107 0.867392 -0.132608 1 0 ' +
  10010. 'C 1.13261 0.132608 1.20711 0.312464 1.20711 0.5 ' +
  10011. 'C 1.20711 0.687536 1.13261 0.867392 1 1 ' +
  10012. 'C 0.867392 1.13261 0.687536 1.20711 0.5 1.20711 ' +
  10013. 'C 0.312464 1.20711 0.132608 1.13261 0 1 ' +
  10014. 'C -0.132608 0.867392 -0.207107 0.687536 -0.207107 0.5 ' +
  10015. 'C -0.207107 0.312464 -0.132608 0.132608 0 0 ' +
  10016. 'C 0.132608 -0.132608 0.312464 -0.207107 0.5 -0.207107';
  10017. this.aBasePath = document.createElementNS( NSS['svg'], 'path' );
  10018. this.aBasePath.setAttribute( 'd', sPathData );
  10019. }
  10020. EllipseWipePath.prototype.perform = function( nT )
  10021. {
  10022. var aTransform = SVGIdentityMatrix.translate( 0.5, 0.5 ).scale( nT ).translate( -0.5, -0.5 );
  10023. var aEllipse = this.aBasePath.cloneNode( true );
  10024. aEllipse.matrixTransform( aTransform );
  10025. return aEllipse;
  10026. };
  10027. function FanWipePath(bIsCenter, bIsSingle, bIsFanIn) {
  10028. this.bCenter = bIsCenter;
  10029. this.bSingle = bIsSingle;
  10030. this.bFanIn = bIsFanIn;
  10031. this.aBasePath = createUnitSquarePath();
  10032. }
  10033. FanWipePath.prototype.perform = function( nT ) {
  10034. var res = this.aBasePath.cloneNode(true);
  10035. var poly = PinWheelWipePath.calcCenteredClock(
  10036. nT / ((this.bCenter && this.bSingle) ? 2.0 : 4.0), 1.0);
  10037. res.appendPath(poly);
  10038. var aTransform = SVGIdentityMatrix.flipY();
  10039. aTransform = aTransform.scaleNonUniform(-1.0, 1.0);
  10040. poly.matrixTransform(aTransform);
  10041. res.appendPath(poly);
  10042. if(this.bCenter) {
  10043. aTransform = SVGIdentityMatrix.scaleNonUniform(0.5, 0.5).translate(0.5, 0.5);
  10044. res.matrixTransform(aTransform);
  10045. if(!this.bSingle)
  10046. res.appendPath(flipOnXAxis(res));
  10047. }
  10048. else {
  10049. aTransform = SVGIdentityMatrix.scaleNonUniform(0.5, 1.0).translate(0.5, 1.0);
  10050. res.matrixTransform(aTransform);
  10051. }
  10052. return res;
  10053. }
  10054. function ClockWipePath() { }
  10055. ClockWipePath.prototype.perform = function( nT ) {
  10056. const aTransform = SVGIdentityMatrix.scaleNonUniform(0.5, 0.5).translate(0.5, 0.5);
  10057. var aPolyPath = PinWheelWipePath.calcCenteredClock(nT, 1.0);
  10058. aPolyPath.matrixTransform( aTransform );
  10059. return aPolyPath;
  10060. }
  10061. function PinWheelWipePath( nBlades )
  10062. {
  10063. this.nBlades = nBlades;
  10064. if( !this.nBlades || this.nBlades < 1 )
  10065. this.nBlades = 1;
  10066. }
  10067. PinWheelWipePath.calcCenteredClock = function( nT, nE )
  10068. {
  10069. var nMAX_EDGE = 2;
  10070. var aTransform = SVGIdentityMatrix.rotate( nT * 360 );
  10071. var aPoint = document.documentElement.createSVGPoint();
  10072. aPoint.y = -nMAX_EDGE;
  10073. aPoint = aPoint.matrixTransform( aTransform );
  10074. var sPathData = 'M ' + aPoint.x + ' ' + aPoint.y + ' ';
  10075. if( nT >= 0.875 )
  10076. sPathData += 'L ' + '-' + nE + ' -' + nE + ' ';
  10077. if( nT >= 0.625 )
  10078. sPathData += 'L ' + '-' + nE + ' ' + nE + ' ';
  10079. if( nT >= 0.375 )
  10080. sPathData += 'L ' + nE + ' ' + nE + ' ';
  10081. if( nT >= 0.125 )
  10082. sPathData += 'L ' + nE + ' -' + nE + ' ';
  10083. sPathData += 'L 0 -' + nE + ' ';
  10084. sPathData += 'L 0 0 ';
  10085. sPathData += 'L ' + aPoint.x + ' ' + aPoint.y;
  10086. var aPath = document.createElementNS( NSS['svg'], 'path' );
  10087. aPath.setAttribute( 'd', sPathData );
  10088. return aPath;
  10089. };
  10090. PinWheelWipePath.prototype.perform = function( nT )
  10091. {
  10092. var aBasePath = PinWheelWipePath.calcCenteredClock( nT / this.nBlades,
  10093. 2.0 /* max edge when rotating */ );
  10094. var aPolyPath = aBasePath.cloneNode( true );
  10095. var aPath;
  10096. var aRotation;
  10097. var i;
  10098. for( i = this.nBlades - 1; i > 0; --i )
  10099. {
  10100. aRotation = SVGIdentityMatrix.rotate( (i * 360) / this.nBlades );
  10101. aPath = aBasePath.cloneNode( true );
  10102. aPath.matrixTransform( aRotation );
  10103. aPolyPath.appendPath( aPath );
  10104. }
  10105. var aTransform = SVGIdentityMatrix.translate( 0.5, 0.5 ).scale( 0.5 );
  10106. aPolyPath.matrixTransform( aTransform );
  10107. return aPolyPath;
  10108. };
  10109. function BarnDoorWipePath(doubled) {
  10110. this.aBasePath = createUnitSquarePath();
  10111. this.doubled = doubled;
  10112. }
  10113. BarnDoorWipePath.prototype.perform = function( nT ) {
  10114. if(this.doubled)
  10115. nT /= 2.0;
  10116. var aTransform = SVGIdentityMatrix.translate(-0.5, -0.5);
  10117. aTransform = aTransform.scaleNonUniform(pruneScaleValue(nT), 1.0).translate(0.5, 0.5);
  10118. var aPath = this.aBasePath.cloneNode(true);
  10119. aPath.matrixTransform(aTransform);
  10120. var res = aPath;
  10121. if(this.doubled) {
  10122. aTransform = SVGIdentityMatrix.translate(-0.5, -0.5);
  10123. aTransform = aTransform.rotate(Math.PI / 2).translate(0.5, 0.5);
  10124. aPath.matrixTransform(aTransform);
  10125. res.appendPath(aPath);
  10126. }
  10127. return res;
  10128. }
  10129. function WaterfallWipePath(nElements, bFlipOnYAxis) {
  10130. this.bFlipOnYAxis = bFlipOnYAxis;
  10131. var sqrtElements = Math.floor(Math.sqrt(nElements));
  10132. var elementEdge = 1.0/sqrtElements;
  10133. var aPath = 'M '+ 0.0 + ' ' + -1.0 + ' ';
  10134. for(var pos = sqrtElements; pos--; ) {
  10135. var xPos = sqrtElements - pos - 1;
  10136. var yPos = pruneScaleValue( ((pos+1) * elementEdge) - 1.0);
  10137. aPath += 'L ' + pruneScaleValue(xPos * elementEdge) + ' ' + yPos + ' ';
  10138. aPath += 'L ' + pruneScaleValue((xPos+1)*elementEdge) + ' ' + yPos + ' ';
  10139. }
  10140. aPath += 'L ' + 1.0 + ' ' + -1.0 + ' ';
  10141. aPath += 'L ' + 0.0 + ' ' + -1.0 + ' ';
  10142. this.aBasePath = document.createElementNS( NSS['svg'], 'path');
  10143. this.aBasePath.setAttribute('d', aPath);
  10144. }
  10145. WaterfallWipePath.prototype.perform = function( nT ) {
  10146. var poly = this.aBasePath.cloneNode(true);
  10147. var aTransform = SVGIdentityMatrix.translate(0.0, pruneScaleValue(2.0 * nT));
  10148. poly.matrixTransform(aTransform);
  10149. var aHead = 'M ' + 0.0 + ' ' + -1.0 + ' ';
  10150. var aHeadPath= document.createElementNS( NSS['svg'], 'path');
  10151. aHeadPath.setAttribute('d', aHead);
  10152. var aTail = 'M ' + 1.0 + ' ' + -1.0 + ' ';
  10153. var aTailPath = document.createElementNS( NSS['svg'], 'path');
  10154. aTailPath.setAttribute('d', aTail);
  10155. poly.prependPath(aHeadPath);
  10156. poly.appendPath(aTailPath);
  10157. return this.bFlipOnYAxis ? flipOnYAxis(poly) : poly;
  10158. }
  10159. function DoubleDiamondWipePath() { }
  10160. DoubleDiamondWipePath.prototype.perform = function( nT ) {
  10161. var a = pruneScaleValue(0.25 + (nT * 0.75));
  10162. var aPath = 'M ' + (0.5 + a) + ' ' + 0.5 + ' ';
  10163. aPath += 'L ' + 0.5 + ' ' + (0.5 - a) + ' ';
  10164. aPath += 'L ' + (0.5 - a) + ' ' + 0.5 + ' ';
  10165. aPath += 'L ' + 0.5 + ' ' + (0.5 + a) + ' ';
  10166. aPath += 'L ' + (0.5 + a) + ' ' + 0.5 + ' ';
  10167. var poly = document.createElementNS( NSS['svg'], 'path');
  10168. poly.setAttribute('d', aPath);
  10169. var res = poly.cloneNode(true);
  10170. var b = pruneScaleValue( (1.0 - nT) * 0.25);
  10171. aPath = 'M ' + (0.5 + b) + ' ' + 0.5 + ' ';
  10172. aPath += 'L ' + 0.5 + ' ' + (0.5 + b) + ' ';
  10173. aPath += 'L ' + (0.5 - b) + ' ' + 0.5 + ' ';
  10174. aPath += 'L ' + 0.5 + ' ' + (0.5 - b) + ' ';
  10175. aPath += 'L ' + (0.5 + b) + ' ' + 0.5 + ' ';
  10176. poly = document.createElementNS( NSS['svg'], 'path');
  10177. poly.setAttribute('d', aPath);
  10178. res.appendPath(poly);
  10179. return res;
  10180. }
  10181. function IrisWipePath(unitRect) {
  10182. this.unitRect = unitRect;
  10183. this.aBasePath = createUnitSquarePath();
  10184. }
  10185. IrisWipePath.prototype.perform = function( nT ) {
  10186. var d = pruneScaleValue(nT);
  10187. var aTransform = SVGIdentityMatrix.translate(-0.5, -0.5);
  10188. aTransform = aTransform.multiply(SVGIdentityMatrix.scaleNonUniform(d, d).translate(0.5, 0.5));
  10189. var aPath = this.aBasePath.cloneNode(true);
  10190. aPath.matrixTransform(aTransform);
  10191. return aPath;
  10192. }
  10193. function ZigZagWipePath(nZigs) {
  10194. this.zigEdge = 1.0/nZigs;
  10195. const d = this.zigEdge;
  10196. const d2 = (d / 2.0);
  10197. this.aBasePath = 'M ' + (-1.0 - d) + ' ' + -d + ' ';
  10198. this.aBasePath += 'L ' + (-1.0 - d) + ' ' + (1.0 + d) + ' ';
  10199. this.aBasePath += 'L ' + -d + ' ' + (1.0 + d) + ' ';
  10200. for(var pos = (nZigs + 2); pos--; ) {
  10201. this.aBasePath += 'L ' + 0.0 + ' ' + ((pos - 1) * d + d2) + ' ';
  10202. this.aBasePath += 'L ' + -d + ' ' + (pos - 1) * d + ' ';
  10203. }
  10204. this.aBasePath += 'L ' + (-1.0 - d) + ' ' + -d + ' ';
  10205. }
  10206. ZigZagWipePath.prototype.perform = function( nT ) {
  10207. var res = document.createElementNS( NSS['svg'], 'path');
  10208. res.setAttribute('d', this.aBasePath);
  10209. res.matrixTransform(SVGIdentityMatrix.translate((1.0 + this.zigEdge) * nT, 0.0));
  10210. return res;
  10211. }
  10212. function BarnZigZagWipePath( nZigs ) { ZigZagWipePath.call(this, nZigs); }
  10213. BarnZigZagWipePath.prototype = Object.create(ZigZagWipePath);
  10214. BarnZigZagWipePath.prototype.perform = function( nT ) {
  10215. var res = createEmptyPath();
  10216. var poly = document.createElementNS( NSS['svg'], 'path');
  10217. var aTransform = SVGIdentityMatrix.translate(
  10218. ((1.0 + this.zigEdge) * (1.0 - nT)) / 2.0, 0.0);
  10219. poly.setAttribute('d', this.aBasePath);
  10220. poly.changeOrientation();
  10221. poly.matrixTransform(aTransform);
  10222. res.appendPath(poly);
  10223. aTransform = SVGIdentityMatrix.scale(-1.0, 1.0);
  10224. aTransform.translate(1.0, this.zigEdge / 2.0);
  10225. poly = document.createElementNS( NSS['svg'], 'path');
  10226. poly.setAttribute('d', this.aBasePath);
  10227. poly.matrixTransform(aTransform);
  10228. res.appendPath(poly);
  10229. return res;
  10230. }
  10231. function CheckerBoardWipePath( unitsPerEdge )
  10232. {
  10233. this.unitsPerEdge = unitsPerEdge;
  10234. if( this.unitsPerEdge === undefined || this.unitsPerEdge < 1 )
  10235. this.unitsPerEdge = 10;
  10236. this.aBasePath = createUnitSquarePath();
  10237. }
  10238. CheckerBoardWipePath.prototype.perform = function( nT )
  10239. {
  10240. var d = pruneScaleValue(1.0 / this.unitsPerEdge);
  10241. var aMatrix = SVGIdentityMatrix.scaleNonUniform(pruneScaleValue( d*2.0*nT ),
  10242. pruneScaleValue( d ) );
  10243. var aPolyPath = null;
  10244. var i, j;
  10245. var aTransform;
  10246. var aPath;
  10247. for ( i = this.unitsPerEdge; i--; )
  10248. {
  10249. aTransform = SVGIdentityMatrix;
  10250. if ((i % 2) == 1) // odd line
  10251. aTransform = aTransform.translate( -d, 0.0 );
  10252. aTransform = aTransform.multiply( aMatrix );
  10253. for ( j = (this.unitsPerEdge / 2) + 1; j--;)
  10254. {
  10255. aPath = this.aBasePath.cloneNode( true );
  10256. aPath.matrixTransform( aTransform );
  10257. if (aPolyPath == null) aPolyPath = aPath;
  10258. else aPolyPath.appendPath( aPath );
  10259. aTransform = SVGIdentityMatrix.translate( d*2.0, 0.0 ).multiply( aTransform );
  10260. }
  10261. aMatrix = SVGIdentityMatrix.translate( 0.0, d ).multiply( aMatrix ); // next line
  10262. }
  10263. return aPolyPath;
  10264. };
  10265. function RandomWipePath( nElements, bRandomBars )
  10266. {
  10267. this.nElements = nElements;
  10268. this.aBasePath = createUnitSquarePath();
  10269. this.aPositionArray = new Array( nElements );
  10270. this.aClipPath = createEmptyPath();
  10271. this.nAlreadyAppendedElements = 0;
  10272. var fEdgeLength, nPos, aTransform;
  10273. if( bRandomBars ) // random bar wipe
  10274. {
  10275. fEdgeLength = 1.0 / nElements;
  10276. for( nPos = 0; nPos < nElements; ++nPos )
  10277. {
  10278. this.aPositionArray[nPos] = { x: 0.0, y: pruneScaleValue( nPos * fEdgeLength ) }
  10279. }
  10280. aTransform = SVGIdentityMatrix.scaleNonUniform( 1.0, pruneScaleValue( fEdgeLength ) );
  10281. }
  10282. else // dissolve wipe
  10283. {
  10284. var nSqrtElements = Math.round( Math.sqrt( nElements ) );
  10285. fEdgeLength = 1.0 / nSqrtElements;
  10286. for( nPos = 0; nPos < nElements; ++nPos )
  10287. {
  10288. this.aPositionArray[nPos] = {
  10289. x: pruneScaleValue( ( nPos % nSqrtElements ) * fEdgeLength ),
  10290. y: pruneScaleValue( ( nPos / nSqrtElements ) * fEdgeLength ) }
  10291. }
  10292. aTransform = SVGIdentityMatrix.scale( pruneScaleValue( fEdgeLength ) );
  10293. }
  10294. this.aBasePath.matrixTransform( aTransform );
  10295. var nPos1, nPos2;
  10296. var tmp;
  10297. for( nPos1 = nElements - 1; nPos1 > 0; --nPos1 )
  10298. {
  10299. nPos2 = getRandomInt( nPos1 + 1 );
  10300. tmp = this.aPositionArray[nPos1];
  10301. this.aPositionArray[nPos1] = this.aPositionArray[nPos2];
  10302. this.aPositionArray[nPos2] = tmp;
  10303. }
  10304. }
  10305. RandomWipePath.prototype.perform = function( nT )
  10306. {
  10307. var aPolyPath = createEmptyPath();
  10308. var aPoint;
  10309. var aPath;
  10310. var aTransform;
  10311. var nElements = Math.round( nT * this.nElements );
  10312. if( nElements === 0 )
  10313. {
  10314. return aPolyPath;
  10315. }
  10316. if( this.nAlreadyAppendedElements >= nElements )
  10317. {
  10318. this.nAlreadyAppendedElements = 0;
  10319. this.aClipPath = createEmptyPath();
  10320. }
  10321. var nPos;
  10322. for( nPos = this.nAlreadyAppendedElements; nPos < nElements; ++nPos )
  10323. {
  10324. aPoint = this.aPositionArray[nPos];
  10325. aPath = this.aBasePath.cloneNode( true );
  10326. aTransform = SVGIdentityMatrix.translate( aPoint.x, aPoint.y );
  10327. aPath.matrixTransform( aTransform );
  10328. aPolyPath.appendPath( aPath );
  10329. }
  10330. this.nAlreadyAppendedElements = nElements;
  10331. this.aClipPath.appendPath( aPolyPath );
  10332. return this.aClipPath.cloneNode( true );
  10333. };
  10334. function SnakeWipePath(nElements, bDiagonal, bflipOnYAxis)
  10335. {
  10336. this.sqrtElements = Math.floor(Math.sqrt(nElements));
  10337. this.elementEdge = (1.0 / this.sqrtElements);
  10338. this.diagonal = bDiagonal;
  10339. this.flipOnYAxis = bflipOnYAxis;
  10340. this.aBasePath = createUnitSquarePath();
  10341. }
  10342. SnakeWipePath.prototype.calcSnake = function(t)
  10343. {
  10344. var aPolyPath = createEmptyPath();
  10345. const area = (t * this.sqrtElements * this.sqrtElements);
  10346. const line_ = Math.floor(area) / this.sqrtElements;
  10347. const line = pruneScaleValue(line_ / this.sqrtElements);
  10348. const col = pruneScaleValue((area - (line_ * this.sqrtElements)) / this.sqrtElements);
  10349. if(line != 0) {
  10350. let aPath = 'M '+ 0.0 + ' ' + 0.0 + ' ';
  10351. aPath += 'L ' + 0.0 + ' ' + line + ' ';
  10352. aPath += 'L ' + 1.0 + ' ' + line + ' ';
  10353. aPath += 'L ' + 1.0 + ' ' + 0.0 + ' ';
  10354. aPath += 'L 0 0 ';
  10355. let poly = document.createElementNS( NSS['svg'], 'path');
  10356. poly.setAttribute('d', aPath);
  10357. aPolyPath.appendPath(poly);
  10358. }
  10359. if(col != 0) {
  10360. var offset = 0.0;
  10361. if((line_ & 1) == 1) {
  10362. offset = (1.0 - col);
  10363. }
  10364. let aPath = 'M ' + offset + ' ' + line + ' ';
  10365. aPath += 'L '+ offset + ' ' + (line + this.elementEdge) + ' ';
  10366. aPath += 'L ' + (offset+col) + ' ' + (line + this.elementEdge) + ' ';
  10367. aPath += 'L ' + (offset+col) + ' ' + line + ' ';
  10368. aPath += 'L ' + offset + ' ' + line + ' ';
  10369. let poly = document.createElementNS( NSS['svg'], 'path');
  10370. poly.setAttribute('d', aPath);
  10371. aPolyPath.appendPath(poly);
  10372. }
  10373. return aPolyPath;
  10374. }
  10375. SnakeWipePath.prototype.calcHalfDiagonalSnake = function(nT, bIn) {
  10376. var res = createEmptyPath();
  10377. if(bIn) {
  10378. const sqrtArea2 = Math.sqrt(nT * this.sqrtElements * this.sqrtElements);
  10379. const edge = pruneScaleValue(sqrtArea2 / this.sqrtElements);
  10380. var aPath, aPoint = document.documentElement.createSVGPoint();
  10381. if(edge) {
  10382. aPath = 'M ' + aPoint.x + ' ' + aPoint.y + ' ';
  10383. aPoint.y = edge;
  10384. aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
  10385. aPoint.x = edge;
  10386. aPoint.y = 0.0;
  10387. aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
  10388. aPoint.x = 0.0;
  10389. aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
  10390. const poly = document.createElementNS( NSS['svg'], 'path');
  10391. poly.setAttribute('d', aPath);
  10392. res.appendPath(poly);
  10393. }
  10394. const a = (Math.SQRT1_2 / this.sqrtElements);
  10395. const d = (sqrtArea2 - Math.floor(sqrtArea2));
  10396. const len = (nT * Math.SQRT1_2 * d);
  10397. const height = pruneScaleValue(Math.SQRT1_2 / this.sqrtElements);
  10398. aPath = 'M ' + aPoint.x + ' ' + aPoint.y + ' ';
  10399. aPoint.y = height;
  10400. aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
  10401. aPoint.x = len + a;
  10402. aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
  10403. aPoint.y = 0.0;
  10404. aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
  10405. aPoint.x = 0.0;
  10406. aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
  10407. const poly = document.createElementNS( NSS['svg'], 'path');
  10408. poly.setAttribute('d', aPath);
  10409. let aTransform;
  10410. if((Math.floor(sqrtArea2) & 1) == 1) {
  10411. aTransform = SVGIdentityMatrix.rotate((Math.PI)/2 + (Math.PI)/4);
  10412. aTransform.translate(edge + this.elementEdge, 0.0);
  10413. }
  10414. else {
  10415. aTransform = SVGIdentityMatrix.translate(-a, 0.0);
  10416. aTransform.rotate(-(Math.PI/4));
  10417. aTransform.translate(0.0, edge);
  10418. }
  10419. poly.matrixTransform(aTransform);
  10420. res.appendPath(poly);
  10421. }
  10422. else { //out
  10423. const sqrtArea2 = Math.sqrt(nT * this.sqrtElements * this.sqrtElements);
  10424. const edge = pruneScaleValue(Math.floor(sqrtArea2)/this.sqrtElements);
  10425. let aPath, aPoint = document.documentElement.createSVGPoint();
  10426. if(edge != 0) {
  10427. aPoint.y = 1.0;
  10428. aPath = 'M ' + aPoint.x + ' ' + aPoint.y + ' ';
  10429. aPoint.x = edge;
  10430. aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
  10431. aPoint.x = 1.0;
  10432. aPoint.y = edge;
  10433. aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
  10434. aPoint.y = 0.0;
  10435. aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
  10436. aPoint.x = 0.0;
  10437. aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
  10438. const poly = document.createElementNS( NSS['svg'], 'path');
  10439. poly.setAttribute('d', aPath);
  10440. res.appendPath(poly);
  10441. }
  10442. const a = (Math.SQRT1_2 / this.sqrtElements);
  10443. const d = (sqrtArea2 - Math.floor(sqrtArea2));
  10444. const len = ((1.0 - nT) * Math.SQRT2 * d);
  10445. const height = pruneScaleValue(Math.SQRT1_2 / this.sqrtElements);
  10446. aPath = 'M ' + aPoint.x + ' ' + aPoint.y + ' ';
  10447. aPoint.y = height;
  10448. aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
  10449. aPoint.x = len + a;
  10450. aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
  10451. aPoint.y = 0.0;
  10452. aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
  10453. aPoint.x = 0.0;
  10454. aPath += 'L ' + aPoint.x + ' ' + aPoint.y + ' ';
  10455. const poly = document.createElementNS( NSS['svg'], 'path');
  10456. poly.setAttribute('d', aPath);
  10457. let aTransform;
  10458. if((Math.floor(sqrtArea2) & 1) == 1) {
  10459. aTransform = SVGIdentityMatrix.translate(0.0, -height);
  10460. aTransform.rotate(Math.PI/2 + Math.PI/4);
  10461. aTransform.translate(1.0, edge);
  10462. }
  10463. else {
  10464. aTransform = SVGIdentityMatrix.rotate(-(Math.PI/4));
  10465. aTransform = aTransform.translate(edge, 1.0);
  10466. }
  10467. poly.matrixTransform(aTransform);
  10468. res.appendPath(poly);
  10469. }
  10470. return res;
  10471. }
  10472. SnakeWipePath.prototype.perform = function(nT) {
  10473. var res = createEmptyPath();
  10474. if(this.diagonal) {
  10475. if(nT >= 0.5) {
  10476. res.appendPath(this.calcHalfDiagonalSnake(1.0, true));
  10477. res.appendPath(this.calcHalfDiagonalSnake(2.0*(nT-0.5), false));
  10478. }
  10479. else
  10480. res.appendPath(this.calcHalfDiagonalSnake(2.0*nT, true));
  10481. }
  10482. else
  10483. res = this.calcSnake(nT);
  10484. return this.flipOnYAxis ? flipOnYAxis(res) : res;
  10485. }
  10486. function ParallelSnakesWipePath(nElements, bDiagonal, bFlipOnYAxis, bOpposite) {
  10487. SnakeWipePath.call(this, nElements, bDiagonal, bFlipOnYAxis);
  10488. this.bOpposite = bOpposite;
  10489. }
  10490. ParallelSnakesWipePath.prototype = Object.create(SnakeWipePath);
  10491. ParallelSnakesWipePath.prototype.perform = function( nT ) {
  10492. var res = createEmptyPath(), half, aTransform;
  10493. if(this.diagonal) {
  10494. assert(this.bOpposite);
  10495. half = SnakeWipePath.prototype.calcHalfDiagonalSnake.call(this, nT, false);
  10496. aTransform = SVGIdentityMatrix.scale(1, -1);
  10497. aTransform.translate(-0.5, 0.5);
  10498. aTransform.rotate(Math.PI/2);
  10499. aTransform.translate(0.5, 0.5);
  10500. half.matrixTransform(aTransform);
  10501. half.changeOrientation();
  10502. res.appendPath(half);
  10503. aTransform = SVGIdentityMatrix.translate(-0.5, -0.5);
  10504. aTransform.rotate(Math.PI);
  10505. aTransform.translate(0.5, 0.5);
  10506. half.matrixTransform(aTransform);
  10507. res.appendPath(half);
  10508. }
  10509. else {
  10510. half = SnakeWipePath.prototype.calcSnake.call(this, nT / 2.0 );
  10511. aTransform = SVGIdentityMatrix.translate(-0.5, -0.5);
  10512. aTransform = aTransform.rotate(Math.PI/2);
  10513. aTransform = aTransform.translate(0.5, 0.5);
  10514. half.matrixTransform(aTransform);
  10515. res.appendPath(flipOnYAxis(half));
  10516. res.appendPath(this.bOpposite ? flipOnXAxis(half) : half);
  10517. }
  10518. return this.flipOnYAxis ? flipOnYAxis(res) : res;
  10519. }
  10520. function SpiralWipePath(nElements, bFlipOnYAxis) {
  10521. this.nElements = nElements;
  10522. this.sqrtElements = Math.floor(Math.sqrt(nElements));
  10523. this.bFlipOnYAxis = bFlipOnYAxis;
  10524. }
  10525. SpiralWipePath.prototype.calcNegSpiral = function( nT ) {
  10526. var area = nT * this.nElements;
  10527. var e = (Math.sqrt(area) / 2.0);
  10528. var edge = Math.floor(e) * 2;
  10529. var aTransform = SVGIdentityMatrix.translate(-0.5, -0.5);
  10530. var edge_ = pruneScaleValue(edge / this.sqrtElements);
  10531. aTransform = aTransform.scale(edge_, edge_);
  10532. aTransform = aTransform.translate(0.5, 0.5);
  10533. var poly = createUnitSquarePath();
  10534. poly.matrixTransform(aTransform);
  10535. var res = poly.cloneNode(true);
  10536. if(1.0 - nT != 0) {
  10537. var edge1 = edge + 1;
  10538. var len = Math.floor( (e - edge/2) * edge1 * 4);
  10539. var w = Math.PI / 2;
  10540. while(len > 0) {
  10541. var alen = Math.min(len, edge1);
  10542. len -= alen;
  10543. poly = createUnitSquarePath();
  10544. aTransform = SVGIdentityMatrix.scale(
  10545. pruneScaleValue( alen / this.sqrtElements ),
  10546. pruneScaleValue( 1.0 / this.sqrtElements ));
  10547. aTransform = aTransform.translate(
  10548. - pruneScaleValue( (edge / 2) / this.sqrtElements ),
  10549. pruneScaleValue( (edge / 2) / this.sqrtElements ));
  10550. aTransform = aTransform.rotate( w );
  10551. w -= Math.PI / 2;
  10552. aTransform = aTransform.translate(0.5, 0.5);
  10553. poly.matrixTransform(aTransform);
  10554. res.appendPath(poly);
  10555. }
  10556. }
  10557. return res;
  10558. }
  10559. SpiralWipePath.prototype.perform = function( nT ) {
  10560. var res = createUnitSquarePath();
  10561. var innerSpiral = this.calcNegSpiral( 1.0 - nT );
  10562. innerSpiral.changeOrientation();
  10563. res.appendPath(innerSpiral);
  10564. return this.bFlipOnYAxis ? flipOnYAxis(res) : res;
  10565. }
  10566. function BoxSnakesWipePath(nElements, bFourBox) {
  10567. SpiralWipePath.call(this, nElements);
  10568. this.bFourBox = bFourBox;
  10569. }
  10570. BoxSnakesWipePath.prototype = Object.create(SpiralWipePath);
  10571. BoxSnakesWipePath.prototype.perform = function( nT ) {
  10572. var res = createUnitSquarePath(), aTransform;
  10573. var innerSpiral = SpiralWipePath.prototype.calcNegSpiral.call(this, 1.0 - nT);
  10574. innerSpiral.changeOrientation();
  10575. if(this.bFourBox) {
  10576. aTransform = SVGIdentityMatrix.scale(0.5, 0.5);
  10577. innerSpiral.matrixTransform(aTransform);
  10578. res.appendPath(innerSpiral);
  10579. res.appendPath(flipOnXAxis(innerSpiral));
  10580. innerSpiral = flipOnYAxis(innerSpiral);
  10581. res.appendPath(innerSpiral);
  10582. res.appendPath(flipOnXAxis(innerSpiral));
  10583. }
  10584. else {
  10585. aTransform = SVGIdentityMatrix.scale(1.0, 0.5);
  10586. innerSpiral.matrixTransform(aTransform);
  10587. res.appendPath(innerSpiral);
  10588. res.appendPath(flipOnXAxis(innerSpiral));
  10589. }
  10590. return this.bFlipOnYAxis ? flipOnYAxis(res) : res;
  10591. }
  10592. function VeeWipePath() { }
  10593. VeeWipePath.prototype.perform = function( nT ) {
  10594. const d = pruneScaleValue(2.0 * nT);
  10595. var polyPath = 'M ' + 0.0 + ' ' + -1.0 + ' ';
  10596. polyPath += 'L ' + 0.0 + ' ' + (d - 1.0) + ' ';
  10597. polyPath += 'L ' + 0.5 + ' ' + d + ' ';
  10598. polyPath += 'L ' + 1.0 + ' ' + (d - 1.0) + ' ';
  10599. polyPath += 'L ' + 1.0 + ' ' + -1.0 + ' ';
  10600. polyPath += 'L ' + 0.0 + ' ' + -1.0 + ' ';
  10601. var aPolyPolyPath = document.createElementNS( NSS['svg'], 'path');
  10602. aPolyPolyPath.setAttribute('d', polyPath);
  10603. return aPolyPolyPath;
  10604. }
  10605. function AnimatedSlide( aMetaSlide )
  10606. {
  10607. if( !aMetaSlide )
  10608. {
  10609. log( 'AnimatedSlide constructor: meta slide is not valid' );
  10610. }
  10611. this.aMetaSlide = aMetaSlide;
  10612. this.aSlideElement = this.aMetaSlide.slideElement;
  10613. this.sSlideId = this.aMetaSlide.slideId;
  10614. this.aUsedAttributeSet = [];
  10615. this.aClipPathElement = null;
  10616. this.aClipPathContent = null;
  10617. this.bIsClipped = false;
  10618. }
  10619. AnimatedSlide.prototype.show = function()
  10620. {
  10621. this.aMetaSlide.show();
  10622. };
  10623. AnimatedSlide.prototype.hide = function()
  10624. {
  10625. this.aMetaSlide.hide();
  10626. };
  10627. AnimatedSlide.prototype.notifyUsedAttribute = function( sName )
  10628. {
  10629. if( sName == 'clip-path' )
  10630. {
  10631. this.initClipPath();
  10632. this.bIsClipped = true;
  10633. }
  10634. else
  10635. {
  10636. this.aUsedAttributeSet.push( sName );
  10637. }
  10638. };
  10639. AnimatedSlide.prototype.reset = function()
  10640. {
  10641. if( this.bIsClipped )
  10642. {
  10643. this.cleanClipPath();
  10644. this.bIsClipped = false;
  10645. }
  10646. var i;
  10647. for( i = 0; i < this.aUsedAttributeSet.length; ++i )
  10648. {
  10649. var sAttrName = this.aUsedAttributeSet[i];
  10650. this.aSlideElement.removeAttribute( sAttrName );
  10651. }
  10652. this.aUsedAttributeSet = [];
  10653. };
  10654. AnimatedSlide.prototype.initClipPath = function()
  10655. {
  10656. this.aClipPathElement = document.createElementNS( NSS['svg'], 'clipPath' );
  10657. var sId = 'clip-path-' + this.sSlideId;
  10658. this.aClipPathElement.setAttribute( 'id', sId );
  10659. this.aClipPathElement.setAttribute( 'clipPathUnits', 'userSpaceOnUse' );
  10660. this.aClipPathContent = document.createElementNS( NSS['svg'], 'path' );
  10661. var sPathData = 'M 0 0 h ' + WIDTH + ' v ' + HEIGHT + ' h -' + WIDTH + ' z';
  10662. this.aClipPathContent.setAttribute( 'd', sPathData );
  10663. this.aClipPathElement.appendChild( this.aClipPathContent );
  10664. var aClipPathGroup = theMetaDoc.aClipPathGroup;
  10665. aClipPathGroup.appendChild( this.aClipPathElement );
  10666. var sRef = 'url(#' + sId + ')';
  10667. this.aSlideElement.parentNode.setAttribute( 'clip-path', sRef );
  10668. };
  10669. AnimatedSlide.prototype.cleanClipPath = function()
  10670. {
  10671. this.aSlideElement.parentNode.removeAttribute( 'clip-path' );
  10672. if( this.aClipPathElement )
  10673. {
  10674. var aClipPathGroup = theMetaDoc.aClipPathGroup;
  10675. aClipPathGroup.removeChild( this.aClipPathElement );
  10676. this.aClipPathElement = null;
  10677. this.aClipPathContent = null;
  10678. }
  10679. };
  10680. AnimatedSlide.prototype.insertBefore = function( aElement )
  10681. {
  10682. if( aElement )
  10683. {
  10684. this.aSlideElement.parentNode.insertBefore( aElement, this.aSlideElement );
  10685. }
  10686. };
  10687. AnimatedSlide.prototype.appendElement = function( aElement )
  10688. {
  10689. if( aElement )
  10690. {
  10691. this.aSlideElement.parentNode.appendChild( aElement );
  10692. }
  10693. };
  10694. AnimatedSlide.prototype.removeElement = function( aElement )
  10695. {
  10696. if( aElement )
  10697. {
  10698. this.aSlideElement.parentNode.removeChild( aElement );
  10699. }
  10700. };
  10701. AnimatedSlide.prototype.getWidth = function()
  10702. {
  10703. return WIDTH;
  10704. };
  10705. AnimatedSlide.prototype.getHeight = function()
  10706. {
  10707. return HEIGHT;
  10708. };
  10709. AnimatedSlide.prototype.setOpacity = function( nValue )
  10710. {
  10711. this.aSlideElement.setAttribute( 'opacity', nValue );
  10712. };
  10713. AnimatedSlide.prototype.translate = function( nDx, nDy )
  10714. {
  10715. var sTransformAttr = 'translate(' + nDx + ',' + nDy + ')';
  10716. this.aSlideElement.setAttribute( 'transform', sTransformAttr );
  10717. };
  10718. AnimatedSlide.prototype.setClipPath = function( aClipPathContent )
  10719. {
  10720. if( this.aClipPathContent )
  10721. {
  10722. var sPathData = aClipPathContent.getAttribute( 'd' );
  10723. this.aClipPathContent.setAttribute( 'd', sPathData );
  10724. }
  10725. };
  10726. function AnimatedElement( aElement )
  10727. {
  10728. if( !aElement )
  10729. {
  10730. log( 'AnimatedElement constructor: element is not valid' );
  10731. }
  10732. this.aSlideShowContext = null;
  10733. this.aBaseElement = aElement.cloneNode( true );
  10734. this.aActiveElement = aElement;
  10735. this.sElementId = this.aActiveElement.getAttribute( 'id' );
  10736. this.aBaseBBox = this.aActiveElement.getBBox();
  10737. this.nBaseCenterX = this.aBaseBBox.x + this.aBaseBBox.width / 2;
  10738. this.nBaseCenterY = this.aBaseBBox.y + this.aBaseBBox.height / 2;
  10739. this.aClipPathElement = null;
  10740. this.aClipPathContent = null;
  10741. this.aPreviousElement = null;
  10742. this.aStateSet = {};
  10743. this.eAdditiveMode = ADDITIVE_MODE_REPLACE;
  10744. this.bIsUpdated = true;
  10745. this.aTMatrix = document.documentElement.createSVGMatrix();
  10746. this.aCTM = document.documentElement.createSVGMatrix();
  10747. this.aICTM = document.documentElement.createSVGMatrix();
  10748. this.initElement();
  10749. }
  10750. AnimatedElement.prototype.initElement = function()
  10751. {
  10752. this.nCenterX = this.nBaseCenterX;
  10753. this.nCenterY = this.nBaseCenterY;
  10754. this.nScaleFactorX = 1.0;
  10755. this.nScaleFactorY = 1.0;
  10756. this.nRotationAngle = 0.0;
  10757. this.aActiveElement.setAttribute( 'transform', makeMatrixString( 1, 0, 0, 1, 0, 0 ) );
  10758. };
  10759. AnimatedElement.prototype.initClipPath = function()
  10760. {
  10761. this.aClipPathElement = document.createElementNS( NSS['svg'], 'clipPath' );
  10762. var sId = 'clip-path-' + this.sElementId;
  10763. this.aClipPathElement.setAttribute( 'id', sId );
  10764. this.aClipPathElement.setAttribute( 'clipPathUnits', 'userSpaceOnUse' );
  10765. this.aClipPathContent = document.createElementNS( NSS['svg'], 'path' );
  10766. this.aClippingBBox = this.getBBoxWithStroke();
  10767. var nWidth = this.aClippingBBox.width;
  10768. var nHeight = this.aClippingBBox.height;
  10769. var sPathData = 'M ' + this.aClippingBBox.x + ' ' + this.aClippingBBox.y +
  10770. ' h ' + nWidth + ' v ' + nHeight + ' h -' + nWidth + ' z';
  10771. this.aClipPathContent.setAttribute( 'd', sPathData );
  10772. this.aClipPathElement.appendChild( this.aClipPathContent );
  10773. var aClipPathGroup = theMetaDoc.aClipPathGroup;
  10774. aClipPathGroup.appendChild( this.aClipPathElement );
  10775. var sRef = 'url(#' + sId + ')';
  10776. this.aActiveElement.setAttribute( 'clip-path', sRef );
  10777. };
  10778. AnimatedElement.prototype.cleanClipPath = function()
  10779. {
  10780. this.aActiveElement.removeAttribute( 'clip-path' );
  10781. if( this.aClipPathElement )
  10782. {
  10783. var aClipPathGroup = theMetaDoc.aClipPathGroup;
  10784. aClipPathGroup.removeChild( this.aClipPathElement );
  10785. this.aClipPathElement = null;
  10786. this.aClipPathContent = null;
  10787. }
  10788. };
  10789. AnimatedElement.prototype.getId = function()
  10790. {
  10791. return this.aActiveElement.getAttribute( 'id' );
  10792. };
  10793. AnimatedElement.prototype.getAdditiveMode = function()
  10794. {
  10795. return this.eAdditiveMode;
  10796. };
  10797. AnimatedElement.prototype.setAdditiveMode = function( eAdditiveMode )
  10798. {
  10799. this.eAdditiveMode = eAdditiveMode;
  10800. };
  10801. AnimatedElement.prototype.setToElement = function( aElement )
  10802. {
  10803. if( !aElement )
  10804. {
  10805. log( 'AnimatedElement(' + this.getId() + ').setToElement: element is not valid' );
  10806. return false;
  10807. }
  10808. var aClone = aElement.cloneNode( true );
  10809. this.aPreviousElement = this.aActiveElement.parentNode.replaceChild( aClone, this.aActiveElement );
  10810. this.aActiveElement = aClone;
  10811. return true;
  10812. };
  10813. AnimatedElement.prototype.notifySlideStart = function( aSlideShowContext )
  10814. {
  10815. if( !aSlideShowContext )
  10816. {
  10817. log( 'AnimatedElement.notifySlideStart: slideshow context is not valid' );
  10818. }
  10819. this.aSlideShowContext = aSlideShowContext;
  10820. var aClone = this.aBaseElement.cloneNode( true );
  10821. this.aActiveElement.parentNode.replaceChild( aClone, this.aActiveElement );
  10822. this.aActiveElement = aClone;
  10823. this.initElement();
  10824. this.DBG( '.notifySlideStart invoked' );
  10825. };
  10826. AnimatedElement.prototype.notifySlideEnd = function()
  10827. {
  10828. };
  10829. AnimatedElement.prototype.notifyAnimationStart = function()
  10830. {
  10831. };
  10832. AnimatedElement.prototype.notifyAnimationEnd = function()
  10833. {
  10834. };
  10835. AnimatedElement.prototype.notifyNextEffectStart = function( /*nEffectIndex*/ )
  10836. {
  10837. };
  10838. AnimatedElement.prototype.saveState = function( nAnimationNodeId )
  10839. {
  10840. ANIMDBG.print( 'AnimatedElement(' + this.getId() + ').saveState(' + nAnimationNodeId +')' );
  10841. if( !this.aStateSet[ nAnimationNodeId ] )
  10842. {
  10843. this.aStateSet[ nAnimationNodeId ] = {};
  10844. }
  10845. var aState = this.aStateSet[ nAnimationNodeId ];
  10846. aState.aElement = this.aActiveElement.cloneNode( true );
  10847. aState.nCenterX = this.nCenterX;
  10848. aState.nCenterY = this.nCenterY;
  10849. aState.nScaleFactorX = this.nScaleFactorX;
  10850. aState.nScaleFactorY = this.nScaleFactorY;
  10851. aState.nRotationAngle = this.nRotationAngle;
  10852. };
  10853. AnimatedElement.prototype.restoreState = function( nAnimationNodeId )
  10854. {
  10855. if( !this.aStateSet[ nAnimationNodeId ] )
  10856. {
  10857. log( 'AnimatedElement(' + this.getId() + ').restoreState: state '
  10858. +nAnimationNodeId + ' is not valid' );
  10859. return false;
  10860. }
  10861. ANIMDBG.print( 'AnimatedElement(' + this.getId() + ').restoreState(' + nAnimationNodeId +')' );
  10862. var aState = this.aStateSet[ nAnimationNodeId ];
  10863. var bRet = this.setToElement( aState.aElement );
  10864. if( bRet )
  10865. {
  10866. this.nCenterX = aState.nCenterX;
  10867. this.nCenterY = aState.nCenterY;
  10868. this.nScaleFactorX = aState.nScaleFactorX;
  10869. this.nScaleFactorY = aState.nScaleFactorY;
  10870. this.nRotationAngle = aState.nRotationAngle;
  10871. }
  10872. return bRet;
  10873. };
  10874. AnimatedElement.prototype.getBaseBBox = function()
  10875. {
  10876. return this.aBaseBBox;
  10877. };
  10878. AnimatedElement.prototype.getBaseCenterX = function()
  10879. {
  10880. return this.nBaseCenterX;
  10881. };
  10882. AnimatedElement.prototype.getBaseCenterY = function()
  10883. {
  10884. return this.nBaseCenterY;
  10885. };
  10886. AnimatedElement.prototype.getBBox = function()
  10887. {
  10888. return this.aActiveElement.parentNode.getBBox();
  10889. };
  10890. AnimatedElement.prototype.getBBoxWithStroke = function()
  10891. {
  10892. var aBBox = this.aActiveElement.parentNode.getBBox();
  10893. var aChildrenSet = this.aActiveElement.childNodes;
  10894. var sStroke, sStrokeWidth;
  10895. var nStrokeWidth = 0;
  10896. var i;
  10897. for( i = 0; i < aChildrenSet.length; ++i )
  10898. {
  10899. if( ! aChildrenSet[i].getAttribute )
  10900. continue;
  10901. sStroke = aChildrenSet[i].getAttribute( 'stroke' );
  10902. if( sStroke && sStroke != 'none' )
  10903. {
  10904. sStrokeWidth = aChildrenSet[i].getAttribute( 'stroke-width' );
  10905. var nSW = parseFloat( sStrokeWidth );
  10906. if( nSW > nStrokeWidth )
  10907. nStrokeWidth = nSW;
  10908. }
  10909. }
  10910. if( nStrokeWidth == 0 )
  10911. {
  10912. sStrokeWidth = ROOT_NODE.getAttribute( 'stroke-width' );
  10913. nStrokeWidth = parseFloat( sStrokeWidth );
  10914. }
  10915. if( nStrokeWidth != 0 )
  10916. {
  10917. nStrokeWidth *= 1.1;
  10918. var nHalfStrokeWidth = nStrokeWidth / 2;
  10919. var nDoubleStrokeWidth = nStrokeWidth * 2;
  10920. var aEBBox = document.documentElement.createSVGRect();
  10921. aEBBox.x = aBBox.x - nHalfStrokeWidth;
  10922. aEBBox.y = aBBox.y - nHalfStrokeWidth;
  10923. aEBBox.width = aBBox.width + nDoubleStrokeWidth;
  10924. aEBBox.height = aBBox.height + nDoubleStrokeWidth;
  10925. aBBox = aEBBox;
  10926. }
  10927. return aBBox;
  10928. };
  10929. AnimatedElement.prototype.setClipPath = function( aClipPathContent )
  10930. {
  10931. if( this.aClipPathContent )
  10932. {
  10933. var aTranslation = SVGIdentityMatrix.translate( this.aClippingBBox.x,
  10934. this.aClippingBBox.y);
  10935. aClipPathContent.matrixTransform( aTranslation );
  10936. var sPathData = aClipPathContent.getAttribute( 'd' );
  10937. this.aClipPathContent.setAttribute( 'd', sPathData );
  10938. }
  10939. };
  10940. AnimatedElement.prototype.getX = function()
  10941. {
  10942. return this.nCenterX;
  10943. };
  10944. AnimatedElement.prototype.getY = function()
  10945. {
  10946. return this.nCenterY;
  10947. };
  10948. AnimatedElement.prototype.getPos = function()
  10949. {
  10950. return [this.getX(), this.getY()];
  10951. };
  10952. AnimatedElement.prototype.getWidth = function()
  10953. {
  10954. return this.nScaleFactorX * this.getBaseBBox().width;
  10955. };
  10956. AnimatedElement.prototype.getHeight = function()
  10957. {
  10958. return this.nScaleFactorY * this.getBaseBBox().height;
  10959. };
  10960. AnimatedElement.prototype.getSize = function()
  10961. {
  10962. return [this.getWidth(), this.getHeight()];
  10963. };
  10964. AnimatedElement.prototype.updateTransformAttribute = function()
  10965. {
  10966. this.aTransformAttrList = this.aActiveElement.transform.baseVal;
  10967. this.aTransformAttr = this.aTransformAttrList.getItem( 0 );
  10968. this.aTransformAttr.setMatrix( this.aTMatrix );
  10969. };
  10970. AnimatedElement.prototype.setX = function( nNewCenterX )
  10971. {
  10972. if( nNewCenterX === this.nCenterX ) return;
  10973. this.aTransformAttrList = this.aActiveElement.transform.baseVal;
  10974. this.aTransformAttr = this.aTransformAttrList.getItem( 0 );
  10975. this.aTMatrix = this.aTransformAttr.matrix.translate( nNewCenterX - this.nCenterX, 0 );
  10976. this.aTransformAttr.setMatrix( this.aTMatrix );
  10977. this.nCenterX = nNewCenterX;
  10978. };
  10979. AnimatedElement.prototype.setY = function( nNewCenterY )
  10980. {
  10981. if( nNewCenterY === this.nCenterY ) return;
  10982. this.aTransformAttrList = this.aActiveElement.transform.baseVal;
  10983. this.aTransformAttr = this.aTransformAttrList.getItem( 0 );
  10984. this.aTMatrix = this.aTransformAttr.matrix.translate( 0, nNewCenterY - this.nCenterY );
  10985. this.aTransformAttr.setMatrix( this.aTMatrix );
  10986. this.nCenterY = nNewCenterY;
  10987. };
  10988. AnimatedElement.prototype.setPos = function( aNewPos )
  10989. {
  10990. var nNewCenterX = aNewPos[0];
  10991. var nNewCenterY = aNewPos[1];
  10992. if( nNewCenterX === this.nCenterX && nNewCenterY === this.nCenterY ) return;
  10993. this.aTransformAttrList = this.aActiveElement.transform.baseVal;
  10994. this.aTransformAttr = this.aTransformAttrList.getItem( 0 );
  10995. this.aTMatrix = this.aTransformAttr.matrix.translate( nNewCenterX - this.nCenterX, nNewCenterY - this.nCenterY );
  10996. this.aTransformAttr.setMatrix( this.aTMatrix );
  10997. this.nCenterX = nNewCenterX;
  10998. this.nCenterY = nNewCenterY;
  10999. };
  11000. AnimatedElement.prototype.setWidth = function( nNewWidth )
  11001. {
  11002. ANIMDBG.print( 'AnimatedElement.setWidth: nNewWidth = ' + nNewWidth );
  11003. if( nNewWidth < 0 )
  11004. {
  11005. log('AnimatedElement(' + this.getId() + ').setWidth: negative width!');
  11006. nNewWidth = 0;
  11007. }
  11008. var nBaseWidth = this.getBaseBBox().width;
  11009. var nScaleFactorX = nNewWidth / nBaseWidth;
  11010. if( nScaleFactorX < 1e-5 ) nScaleFactorX = 1e-5;
  11011. if( nScaleFactorX == this.nScaleFactorX ) return;
  11012. this.aTMatrix = document.documentElement.createSVGMatrix()
  11013. .translate( this.nCenterX, this.nCenterY )
  11014. .rotate(this.nRotationAngle)
  11015. .scaleNonUniform( nScaleFactorX, this.nScaleFactorY )
  11016. .translate( -this.nBaseCenterX, -this.nBaseCenterY );
  11017. this.updateTransformAttribute();
  11018. this.nScaleFactorX = nScaleFactorX;
  11019. };
  11020. AnimatedElement.prototype.setHeight = function( nNewHeight )
  11021. {
  11022. ANIMDBG.print( 'AnimatedElement.setWidth: nNewHeight = ' + nNewHeight );
  11023. if( nNewHeight < 0 )
  11024. {
  11025. log('AnimatedElement(' + this.getId() + ').setWidth: negative height!');
  11026. nNewHeight = 0;
  11027. }
  11028. var nBaseHeight = this.getBaseBBox().height;
  11029. var nScaleFactorY = nNewHeight / nBaseHeight;
  11030. if( nScaleFactorY < 1e-5 ) nScaleFactorY = 1e-5;
  11031. if( nScaleFactorY == this.nScaleFactorY ) return;
  11032. this.aTMatrix = document.documentElement.createSVGMatrix()
  11033. .translate( this.nCenterX, this.nCenterY )
  11034. .rotate(this.nRotationAngle)
  11035. .scaleNonUniform( this.nScaleFactorX, nScaleFactorY )
  11036. .translate( -this.nBaseCenterX, -this.nBaseCenterY );
  11037. this.updateTransformAttribute();
  11038. this.nScaleFactorY = nScaleFactorY;
  11039. };
  11040. AnimatedElement.prototype.setSize= function( aNewSize )
  11041. {
  11042. var nNewWidth = aNewSize[0];
  11043. var nNewHeight = aNewSize[1];
  11044. ANIMDBG.print( 'AnimatedElement.setSize: = [' + nNewWidth + ',' + nNewHeight + ']');
  11045. if( nNewWidth < 0 )
  11046. {
  11047. log('AnimatedElement(' + this.getId() + ').setSize: negative width!');
  11048. nNewWidth = 0;
  11049. }
  11050. if( nNewHeight < 0 )
  11051. {
  11052. log('AnimatedElement(' + this.getId() + ').setSize: negative height!');
  11053. nNewHeight = 0;
  11054. }
  11055. var nBaseWidth = this.getBaseBBox().width;
  11056. var nScaleFactorX = nNewWidth / nBaseWidth;
  11057. if( nScaleFactorX < 1e-5 ) nScaleFactorX = 1e-5;
  11058. var nBaseHeight = this.getBaseBBox().height;
  11059. var nScaleFactorY = nNewHeight / nBaseHeight;
  11060. if( nScaleFactorY < 1e-5 ) nScaleFactorY = 1e-5;
  11061. if( nScaleFactorX == this.nScaleFactorX && nScaleFactorY == this.nScaleFactorY ) return;
  11062. this.aTMatrix = document.documentElement.createSVGMatrix()
  11063. .translate( this.nCenterX, this.nCenterY )
  11064. .rotate(this.nRotationAngle)
  11065. .scaleNonUniform( nScaleFactorX, nScaleFactorY )
  11066. .translate( -this.nBaseCenterX, -this.nBaseCenterY );
  11067. this.updateTransformAttribute();
  11068. this.nScaleFactorX = nScaleFactorX;
  11069. this.nScaleFactorY = nScaleFactorY;
  11070. };
  11071. AnimatedElement.prototype.getOpacity = function()
  11072. {
  11073. return this.aActiveElement.getAttribute( 'opacity' );
  11074. };
  11075. AnimatedElement.prototype.setOpacity = function( nValue )
  11076. {
  11077. this.aActiveElement.setAttribute( 'opacity', nValue );
  11078. };
  11079. AnimatedElement.prototype.getRotationAngle = function()
  11080. {
  11081. return this.nRotationAngle;
  11082. };
  11083. AnimatedElement.prototype.setRotationAngle = function( nNewRotAngle )
  11084. {
  11085. this.aTMatrix = document.documentElement.createSVGMatrix()
  11086. .translate( this.nCenterX, this.nCenterY )
  11087. .rotate(nNewRotAngle)
  11088. .scaleNonUniform( this.nScaleFactorX, this.nScaleFactorY )
  11089. .translate( -this.nBaseCenterX, -this.nBaseCenterY );
  11090. this.updateTransformAttribute();
  11091. this.nRotationAngle = nNewRotAngle;
  11092. };
  11093. AnimatedElement.prototype.getVisibility = function()
  11094. {
  11095. var sVisibilityValue = this.aActiveElement.getAttribute( 'visibility' );
  11096. if( !sVisibilityValue || ( sVisibilityValue === 'inherit' ) )
  11097. return 'visible'; // TODO: look for parent visibility!
  11098. else
  11099. return sVisibilityValue;
  11100. };
  11101. AnimatedElement.prototype.setVisibility = function( sValue )
  11102. {
  11103. if( sValue == 'visible' )
  11104. sValue = 'inherit';
  11105. this.aActiveElement.setAttribute( 'visibility', sValue );
  11106. };
  11107. AnimatedElement.prototype.getStrokeStyle = function()
  11108. {
  11109. return 'solid';
  11110. };
  11111. AnimatedElement.prototype.setStrokeStyle = function( sValue )
  11112. {
  11113. ANIMDBG.print( 'AnimatedElement.setStrokeStyle(' + sValue + ')' );
  11114. };
  11115. AnimatedElement.prototype.getFillStyle = function()
  11116. {
  11117. return 'solid';
  11118. };
  11119. AnimatedElement.prototype.setFillStyle = function( sValue )
  11120. {
  11121. ANIMDBG.print( 'AnimatedElement.setFillStyle(' + sValue + ')' );
  11122. };
  11123. AnimatedElement.prototype.getFillColor = function()
  11124. {
  11125. var aChildSet = getElementChildren( this.aActiveElement );
  11126. var sFillColorValue = '';
  11127. for( var i = 0; i < aChildSet.length; ++i )
  11128. {
  11129. sFillColorValue = aChildSet[i].getAttribute( 'fill' );
  11130. if( sFillColorValue && ( sFillColorValue !== 'none' ) )
  11131. break;
  11132. }
  11133. return colorParser( sFillColorValue );
  11134. };
  11135. AnimatedElement.prototype.setFillColor = function( aRGBValue )
  11136. {
  11137. assert( aRGBValue instanceof RGBColor,
  11138. 'AnimatedElement.setFillColor: value argument is not an instance of RGBColor' );
  11139. var sValue = aRGBValue.toString( true /* clamped values */ );
  11140. var aChildSet = getElementChildren( this.aActiveElement );
  11141. var sFillColorValue = '';
  11142. for( var i = 0; i < aChildSet.length; ++i )
  11143. {
  11144. sFillColorValue = aChildSet[i].getAttribute( 'fill' );
  11145. if( sFillColorValue && ( sFillColorValue !== 'none' ) )
  11146. {
  11147. aChildSet[i].setAttribute( 'fill', sValue );
  11148. }
  11149. }
  11150. };
  11151. AnimatedElement.prototype.getStrokeColor = function()
  11152. {
  11153. var aChildSet = getElementChildren( this.aActiveElement );
  11154. var sStrokeColorValue = '';
  11155. for( var i = 0; i < aChildSet.length; ++i )
  11156. {
  11157. sStrokeColorValue = aChildSet[i].getAttribute( 'stroke' );
  11158. if( sStrokeColorValue && ( sStrokeColorValue !== 'none' ) )
  11159. break;
  11160. }
  11161. return colorParser( sStrokeColorValue );
  11162. };
  11163. AnimatedElement.prototype.setStrokeColor = function( aRGBValue )
  11164. {
  11165. assert( aRGBValue instanceof RGBColor,
  11166. 'AnimatedElement.setFillColor: value argument is not an instance of RGBColor' );
  11167. var sValue = aRGBValue.toString( true /* clamped values */ );
  11168. var aChildSet = getElementChildren( this.aActiveElement );
  11169. var sStrokeColorValue = '';
  11170. for( var i = 0; i < aChildSet.length; ++i )
  11171. {
  11172. sStrokeColorValue = aChildSet[i].getAttribute( 'stroke' );
  11173. if( sStrokeColorValue && ( sStrokeColorValue !== 'none' ) )
  11174. {
  11175. aChildSet[i].setAttribute( 'stroke', sValue );
  11176. }
  11177. }
  11178. };
  11179. AnimatedElement.prototype.getFontColor = function()
  11180. {
  11181. return new RGBColor( 0, 0, 0 );
  11182. };
  11183. AnimatedElement.prototype.setFontColor = function( sValue )
  11184. {
  11185. ANIMDBG.print( 'AnimatedElement.setFontColor(' + sValue + ')' );
  11186. };
  11187. AnimatedElement.prototype.DBG = function( sMessage, nTime )
  11188. {
  11189. aAnimatedElementDebugPrinter.print( 'AnimatedElement(' + this.getId() + ')' + sMessage, nTime );
  11190. };
  11191. function AnimatedTextElement( aElement, aEventMultiplexer )
  11192. {
  11193. var theDocument = document;
  11194. var sTextType = aElement.getAttribute( 'class' );
  11195. var bIsListItem = ( sTextType === 'ListItem' );
  11196. if( ( sTextType !== 'TextParagraph' ) && !bIsListItem )
  11197. {
  11198. log( 'AnimatedTextElement: passed element is not a paragraph.' );
  11199. return;
  11200. }
  11201. var aTextShapeElement = aElement.parentNode;
  11202. sTextType = aTextShapeElement.getAttribute( 'class' );
  11203. if( sTextType !== 'SVGTextShape' )
  11204. {
  11205. log( 'AnimatedTextElement: element parent is not a text shape.' );
  11206. return;
  11207. }
  11208. var aTextShapeGroup = aTextShapeElement.parentNode;
  11209. var aAnimatedElementGroup = getElementByClassName( aTextShapeGroup, 'AnimatedElements' );
  11210. if( !aAnimatedElementGroup )
  11211. {
  11212. aAnimatedElementGroup = theDocument.createElementNS( NSS['svg'], 'g' );
  11213. aAnimatedElementGroup.setAttribute( 'class', 'AnimatedElements' );
  11214. aTextShapeGroup.appendChild( aAnimatedElementGroup );
  11215. }
  11216. var aAnimatableElement = theDocument.createElementNS( NSS['svg'], 'g' );
  11217. var aTextElement = theDocument.createElementNS( NSS['svg'], 'text' );
  11218. var aParagraphElement = aElement.cloneNode( true );
  11219. this.aGraphicGroupElement = theDocument.createElementNS( NSS['svg'], 'g' );
  11220. this.aGraphicGroupElement.setAttribute( 'class', 'GraphicGroup' );
  11221. var aBulletCharClone = null;
  11222. var aBulletCharElem = null;
  11223. var bIsBulletCharStyle =
  11224. ( aElement.getAttributeNS( NSS['ooo'], aOOOAttrListItemNumberingType ) === 'bullet-style' );
  11225. if( bIsBulletCharStyle )
  11226. {
  11227. var aBulletCharGroupElem = getElementByClassName( aTextShapeGroup, 'BulletChars' );
  11228. if( aBulletCharGroupElem )
  11229. {
  11230. var aBulletPlaceholderElem = getElementByClassName( aElement, 'BulletPlaceholder' );
  11231. if( aBulletPlaceholderElem )
  11232. {
  11233. var sId = aBulletPlaceholderElem.getAttribute( 'id' );
  11234. sId = 'bullet-char(' + sId + ')';
  11235. aBulletCharElem = theDocument.getElementById( sId );
  11236. if( aBulletCharElem )
  11237. {
  11238. aBulletCharClone = aBulletCharElem.cloneNode( true );
  11239. }
  11240. else
  11241. {
  11242. log( 'AnimatedTextElement: ' + sId + ' not found.' );
  11243. }
  11244. }
  11245. else
  11246. {
  11247. log( 'AnimatedTextElement: no bullet placeholder found' );
  11248. }
  11249. }
  11250. else
  11251. {
  11252. log( 'AnimatedTextElement: no bullet char group found' );
  11253. }
  11254. }
  11255. var aBitmapElemSet = [];
  11256. var aBitmapCloneSet = [];
  11257. var aBitmapPlaceholderSet = getElementsByClassName( aElement, 'BitmapPlaceholder' );
  11258. var i;
  11259. if( aBitmapPlaceholderSet )
  11260. {
  11261. for( i = 0; i < aBitmapPlaceholderSet.length; ++i )
  11262. {
  11263. sId = aBitmapPlaceholderSet[i].getAttribute( 'id' );
  11264. var sBitmapChecksum = sId.substring( 'bitmap-placeholder'.length + 1, sId.length - 1 );
  11265. sId = 'embedded-bitmap(' + sBitmapChecksum + ')';
  11266. aBitmapElemSet[i] = theDocument.getElementById( sId );
  11267. if( aBitmapElemSet[i] )
  11268. {
  11269. aBitmapCloneSet[i] = aBitmapElemSet[i].cloneNode( true );
  11270. }
  11271. else
  11272. {
  11273. log( 'AnimatedTextElement: ' + sId + ' not found.' );
  11274. }
  11275. }
  11276. }
  11277. this.sParagraphId = sId = aParagraphElement.getAttribute( 'id' );
  11278. aParagraphElement.removeAttribute( 'id' );
  11279. aAnimatableElement.setAttribute( 'id', sId +'.a' );
  11280. if( aBulletCharClone )
  11281. aBulletCharClone.removeAttribute( 'id' );
  11282. for( i = 0; i < aBitmapCloneSet.length; ++i )
  11283. {
  11284. if( aBitmapCloneSet[i] )
  11285. aBitmapCloneSet[i].removeAttribute( 'id' );
  11286. }
  11287. var sVisibilityAttr = aElement.getAttribute( 'visibility' );
  11288. if( !sVisibilityAttr )
  11289. sVisibilityAttr = 'inherit';
  11290. aAnimatableElement.setAttribute( 'visibility', sVisibilityAttr );
  11291. aParagraphElement.setAttribute( 'visibility', 'inherit' );
  11292. this.aGraphicGroupElement.setAttribute( 'visibility', 'inherit' );
  11293. if( aBulletCharElem )
  11294. aBulletCharElem.setAttribute( 'visibility', 'hidden' );
  11295. for( i = 0; i < aBitmapCloneSet.length; ++i )
  11296. {
  11297. if( aBitmapElemSet[i] )
  11298. aBitmapElemSet[i].setAttribute( 'visibility', 'hidden' );
  11299. }
  11300. aTextElement.appendChild( aParagraphElement );
  11301. aAnimatableElement.appendChild( aTextElement );
  11302. if( aBulletCharClone )
  11303. this.aGraphicGroupElement.appendChild( aBulletCharClone );
  11304. for( i = 0; i < aBitmapCloneSet.length; ++i )
  11305. {
  11306. if( aBitmapCloneSet[i] )
  11307. this.aGraphicGroupElement.appendChild( aBitmapCloneSet[i] );
  11308. }
  11309. aAnimatableElement.appendChild( this.aGraphicGroupElement );
  11310. aAnimatedElementGroup.appendChild( aAnimatableElement );
  11311. this.aParentTextElement = aElement.parentNode;
  11312. this.aParagraphElement = aElement;
  11313. this.aAnimatedElementGroup = aAnimatedElementGroup;
  11314. this.nRunningAnimations = 0;
  11315. this.aHyperlinkIdSet = [];
  11316. var aHyperlinkElementSet = getElementsByClassName( this.aParagraphElement, 'UrlField' );
  11317. var sHyperlinkId;
  11318. for( i = 0; i < aHyperlinkElementSet.length; ++i )
  11319. {
  11320. sHyperlinkId = aHyperlinkElementSet[i].getAttribute( 'id' );
  11321. if( sHyperlinkId )
  11322. this.aHyperlinkIdSet.push( sHyperlinkId );
  11323. else
  11324. log( 'error: AnimatedTextElement constructor: hyperlink element has no id' );
  11325. }
  11326. AnimatedTextElement.superclass.constructor.call( this, aAnimatableElement, aEventMultiplexer );
  11327. }
  11328. extend( AnimatedTextElement, AnimatedElement );
  11329. AnimatedTextElement.prototype.setToElement = function( aElement )
  11330. {
  11331. var bRet = AnimatedTextElement.superclass.setToElement.call( this, aElement );
  11332. if( bRet )
  11333. {
  11334. this.aGraphicGroupElement = getElementByClassName( this.aActiveElement, 'GraphicGroup' );
  11335. }
  11336. return ( bRet && this.aGraphicGroupElement );
  11337. };
  11338. AnimatedTextElement.prototype.notifySlideStart = function( aSlideShowContext )
  11339. {
  11340. DBGLOG( 'AnimatedTextElement.notifySlideStart' );
  11341. AnimatedTextElement.superclass.notifySlideStart.call( this, aSlideShowContext );
  11342. this.aGraphicGroupElement = getElementByClassName( this.aActiveElement, 'GraphicGroup' );
  11343. this.restoreBaseTextParagraph();
  11344. };
  11345. AnimatedTextElement.prototype.notifySlideEnd = function()
  11346. {
  11347. DBGLOG( 'AnimatedTextElement.notifySlideEnd' );
  11348. this.aGraphicGroupElement.setAttribute( 'visibility', 'inherit' );
  11349. };
  11350. AnimatedTextElement.prototype.restoreBaseTextParagraph = function()
  11351. {
  11352. var aActiveParagraphElement = this.aActiveElement.firstElementChild.firstElementChild;
  11353. if( aActiveParagraphElement )
  11354. {
  11355. var sVisibilityAttr = this.aActiveElement.getAttribute( 'visibility' );
  11356. if( !sVisibilityAttr || ( sVisibilityAttr === 'visible' ) )
  11357. sVisibilityAttr = 'inherit';
  11358. if( sVisibilityAttr === 'inherit' )
  11359. this.aGraphicGroupElement.setAttribute( 'visibility', 'visible' );
  11360. else
  11361. this.aGraphicGroupElement.setAttribute( 'visibility', 'hidden' );
  11362. var aParagraphClone = aActiveParagraphElement.cloneNode( true );
  11363. aParagraphClone.setAttribute( 'id', this.sParagraphId );
  11364. aParagraphClone.setAttribute( 'visibility', sVisibilityAttr );
  11365. this.aParentTextElement.replaceChild( aParagraphClone, this.aParagraphElement );
  11366. this.aParagraphElement = aParagraphClone;
  11367. var aEventMultiplexer = this.aSlideShowContext.aEventMultiplexer;
  11368. var aHyperlinkIdSet = this.aHyperlinkIdSet;
  11369. var aHyperlinkElementSet = getElementsByClassName( this.aParagraphElement, 'UrlField' );
  11370. var i = 0;
  11371. for( ; i < aHyperlinkIdSet.length; ++i )
  11372. {
  11373. aEventMultiplexer.notifyElementChangedEvent( aHyperlinkIdSet[i], aHyperlinkElementSet[i] );
  11374. }
  11375. }
  11376. this.aActiveElement.setAttribute( 'visibility', 'hidden' );
  11377. };
  11378. AnimatedTextElement.prototype.notifyAnimationStart = function()
  11379. {
  11380. DBGLOG( 'AnimatedTextElement.notifyAnimationStart' );
  11381. if( this.nRunningAnimations === 0 )
  11382. {
  11383. var sVisibilityAttr = this.aParagraphElement.getAttribute( 'visibility' );
  11384. if( !sVisibilityAttr )
  11385. sVisibilityAttr = 'inherit';
  11386. this.aActiveElement.setAttribute( 'visibility', sVisibilityAttr );
  11387. this.aGraphicGroupElement.setAttribute( 'visibility', 'inherit' );
  11388. this.aParagraphElement.setAttribute( 'visibility', 'hidden' );
  11389. }
  11390. ++this.nRunningAnimations;
  11391. };
  11392. AnimatedTextElement.prototype.notifyAnimationEnd = function()
  11393. {
  11394. DBGLOG( 'AnimatedTextElement.notifyAnimationEnd' );
  11395. --this.nRunningAnimations;
  11396. if( this.nRunningAnimations === 0 )
  11397. {
  11398. this.restoreBaseTextParagraph();
  11399. }
  11400. };
  11401. AnimatedTextElement.prototype.saveState = function( nAnimationNodeId )
  11402. {
  11403. if( this.nRunningAnimations === 0 )
  11404. {
  11405. var sVisibilityAttr = this.aParagraphElement.getAttribute( 'visibility' );
  11406. this.aActiveElement.setAttribute( 'visibility', sVisibilityAttr );
  11407. this.aGraphicGroupElement.setAttribute( 'visibility', 'inherit' );
  11408. }
  11409. AnimatedTextElement.superclass.saveState.call( this, nAnimationNodeId );
  11410. };
  11411. AnimatedTextElement.prototype.restoreState = function( nAnimationNodeId )
  11412. {
  11413. var bRet = AnimatedTextElement.superclass.restoreState.call( this, nAnimationNodeId );
  11414. if( bRet )
  11415. this.restoreBaseTextParagraph();
  11416. return bRet;
  11417. };
  11418. function SlideTransition( aAnimationsRootElement, aSlideId )
  11419. {
  11420. this.sSlideId = aSlideId;
  11421. this.bIsValid = false;
  11422. this.eTransitionType = undefined;
  11423. this.eTransitionSubType = undefined;
  11424. this.bReverseDirection = false;
  11425. this.eTransitionMode = TRANSITION_MODE_IN;
  11426. this.sFadeColor = null;
  11427. this.aDuration = null;
  11428. this.nMinFrameCount = undefined;
  11429. if( aAnimationsRootElement )
  11430. {
  11431. if( aAnimationsRootElement.firstElementChild &&
  11432. ( aAnimationsRootElement.firstElementChild.getAttributeNS( NSS['smil'], 'begin' ) === (this.sSlideId + '.begin') ) )
  11433. {
  11434. var aTransitionFilterElement = aAnimationsRootElement.firstElementChild.firstElementChild;
  11435. if( aTransitionFilterElement && ( aTransitionFilterElement.localName === 'transitionFilter' ) )
  11436. {
  11437. this.aElement = aTransitionFilterElement;
  11438. this.parseElement();
  11439. }
  11440. aAnimationsRootElement.removeChild( aAnimationsRootElement.firstElementChild );
  11441. }
  11442. }
  11443. }
  11444. SlideTransition.prototype.createSlideTransition = function( aLeavingSlide, aEnteringSlide )
  11445. {
  11446. if( !this.isValid() )
  11447. return null;
  11448. if( this.eTransitionType == 0 )
  11449. return null;
  11450. if( !aEnteringSlide )
  11451. {
  11452. log( 'SlideTransition.createSlideTransition: invalid entering slide.' );
  11453. return null;
  11454. }
  11455. var aTransitionInfo = aTransitionInfoTable[this.eTransitionType][this.eTransitionSubType];
  11456. var eTransitionClass = aTransitionInfo['class'];
  11457. switch( eTransitionClass )
  11458. {
  11459. default:
  11460. case TRANSITION_INVALID:
  11461. log( 'SlideTransition.createSlideTransition: transition class: TRANSITION_INVALID' );
  11462. return null;
  11463. case TRANSITION_CLIP_POLYPOLYGON:
  11464. var aParametricPolyPolygon
  11465. = createClipPolyPolygon( this.eTransitionType, this.eTransitionSubType );
  11466. return new ClippedSlideChange( aLeavingSlide, aEnteringSlide, aParametricPolyPolygon,
  11467. aTransitionInfo, this.isDirectionForward() );
  11468. case TRANSITION_SPECIAL:
  11469. switch( this.eTransitionType )
  11470. {
  11471. default:
  11472. log( 'SlideTransition.createSlideTransition: ' +
  11473. 'transition class: TRANSITION_SPECIAL, ' +
  11474. 'unknown transition type: ' + this.eTransitionType );
  11475. return null;
  11476. case PUSHWIPE_TRANSITION:
  11477. {
  11478. var aDirection = null;
  11479. switch( this.eTransitionSubType )
  11480. {
  11481. default:
  11482. log( 'SlideTransition.createSlideTransition: ' +
  11483. 'transition type: PUSHWIPE_TRANSITION, ' +
  11484. 'unknown transition subtype: ' + this.eTransitionSubType );
  11485. return null;
  11486. case FROMTOP_TRANS_SUBTYPE:
  11487. aDirection = { x: 0.0, y: 1.0 };
  11488. break;
  11489. case FROMBOTTOM_TRANS_SUBTYPE:
  11490. aDirection = { x: 0.0, y: -1.0 };
  11491. break;
  11492. case FROMLEFT_TRANS_SUBTYPE:
  11493. aDirection = { x: 1.0, y: 0.0 };
  11494. break;
  11495. case FROMRIGHT_TRANS_SUBTYPE:
  11496. aDirection = { x: -1.0, y: 0.0 };
  11497. break;
  11498. }
  11499. return new MovingSlideChange( aLeavingSlide, aEnteringSlide, aDirection, aDirection );
  11500. }
  11501. case SLIDEWIPE_TRANSITION:
  11502. {
  11503. var aInDirection = null;
  11504. switch( this.eTransitionSubType )
  11505. {
  11506. default:
  11507. log( 'SlideTransition.createSlideTransition: ' +
  11508. 'transition type: SLIDEWIPE_TRANSITION, ' +
  11509. 'unknown transition subtype: ' + this.eTransitionSubType );
  11510. return null;
  11511. case FROMTOP_TRANS_SUBTYPE:
  11512. aInDirection = { x: 0.0, y: 1.0 };
  11513. break;
  11514. case FROMBOTTOM_TRANS_SUBTYPE:
  11515. aInDirection = { x: 0.0, y: -1.0 };
  11516. break;
  11517. case FROMLEFT_TRANS_SUBTYPE:
  11518. aInDirection = { x: 1.0, y: 0.0 };
  11519. break;
  11520. case FROMRIGHT_TRANS_SUBTYPE:
  11521. aInDirection = { x: -1.0, y: 0.0 };
  11522. break;
  11523. }
  11524. var aNoDirection = { x: 0.0, y: 0.0 };
  11525. if( !this.bReverseDirection )
  11526. {
  11527. return new MovingSlideChange( aLeavingSlide, aEnteringSlide, aNoDirection, aInDirection );
  11528. }
  11529. else
  11530. {
  11531. return new MovingSlideChange( aLeavingSlide, aEnteringSlide, aInDirection, aNoDirection );
  11532. }
  11533. }
  11534. case FADE_TRANSITION:
  11535. switch( this.eTransitionSubType )
  11536. {
  11537. default:
  11538. log( 'SlideTransition.createSlideTransition: ' +
  11539. 'transition type: FADE_TRANSITION, ' +
  11540. 'unknown transition subtype: ' + this.eTransitionSubType );
  11541. return null;
  11542. case CROSSFADE_TRANS_SUBTYPE:
  11543. return new FadingSlideChange( aLeavingSlide, aEnteringSlide );
  11544. case FADEOVERCOLOR_TRANS_SUBTYPE:
  11545. return new FadingOverColorSlideChange( aLeavingSlide, aEnteringSlide, this.getFadeColor() );
  11546. }
  11547. }
  11548. }
  11549. };
  11550. SlideTransition.prototype.parseElement = function()
  11551. {
  11552. this.bIsValid = true;
  11553. var aAnimElem = this.aElement;
  11554. this.eTransitionType = undefined;
  11555. var sTypeAttr = aAnimElem.getAttributeNS( NSS['smil'], 'type' );
  11556. if( sTypeAttr && aTransitionTypeInMap[ sTypeAttr ] )
  11557. {
  11558. this.eTransitionType = aTransitionTypeInMap[ sTypeAttr ];
  11559. }
  11560. else
  11561. {
  11562. this.bIsValid = false;
  11563. log( 'SlideTransition.parseElement: transition type not valid: ' + sTypeAttr );
  11564. }
  11565. this.eTransitionSubType = undefined;
  11566. var sSubTypeAttr = aAnimElem.getAttributeNS( NSS['smil'], 'subtype' );
  11567. if( sSubTypeAttr === null )
  11568. sSubTypeAttr = 'default';
  11569. if( sSubTypeAttr && ( aTransitionSubtypeInMap[ sSubTypeAttr ] !== undefined ) )
  11570. {
  11571. this.eTransitionSubType = aTransitionSubtypeInMap[ sSubTypeAttr ];
  11572. }
  11573. else
  11574. {
  11575. this.bIsValid = false;
  11576. log( 'SlideTransition.parseElement: transition subtype not valid: ' + sSubTypeAttr );
  11577. }
  11578. if( this.bIsValid && aTransitionInfoTable[this.eTransitionType][this.eTransitionSubType] === undefined )
  11579. {
  11580. this.bIsValid = false;
  11581. log( 'SlideTransition.parseElement: transition not valid: type: ' + sTypeAttr + ' subtype: ' + sSubTypeAttr );
  11582. }
  11583. this.bReverseDirection = false;
  11584. var sDirectionAttr = aAnimElem.getAttributeNS( NSS['smil'], 'direction' );
  11585. if( sDirectionAttr == 'reverse' )
  11586. this.bReverseDirection = true;
  11587. this.sFadeColor = null;
  11588. if( this.eTransitionType == FADE_TRANSITION &&
  11589. ( this.eTransitionSubType == FADEFROMCOLOR_TRANS_SUBTYPE ||
  11590. this.eTransitionSubType == FADEOVERCOLOR_TRANS_SUBTYPE ||
  11591. this.eTransitionSubType == FADETOCOLOR_TRANS_SUBTYPE ) )
  11592. {
  11593. var sColorAttr = aAnimElem.getAttributeNS( NSS['smil'], 'fadeColor' );
  11594. if( sColorAttr )
  11595. this.sFadeColor = sColorAttr;
  11596. else
  11597. this.sFadeColor='#000000';
  11598. }
  11599. this.aDuration = null;
  11600. var sDurAttr = aAnimElem.getAttributeNS( NSS['smil'], 'dur' );
  11601. this.aDuration = new Duration( sDurAttr );
  11602. if( !this.aDuration.isSet() )
  11603. {
  11604. this.aDuration = new Duration( null ); // duration == 0.0
  11605. }
  11606. this.nMinFrameCount = ( this.getDuration().isValue() )
  11607. ? ( this.getDuration().getValue() * MINIMUM_FRAMES_PER_SECONDS )
  11608. : MINIMUM_FRAMES_PER_SECONDS;
  11609. if( this.nMinFrameCount < 1.0 )
  11610. this.nMinFrameCount = 1;
  11611. else if( this.nMinFrameCount > MINIMUM_FRAMES_PER_SECONDS )
  11612. this.nMinFrameCount = MINIMUM_FRAMES_PER_SECONDS;
  11613. };
  11614. SlideTransition.prototype.isValid = function()
  11615. {
  11616. return this.bIsValid;
  11617. };
  11618. SlideTransition.prototype.getTransitionType = function()
  11619. {
  11620. return this.eTransitionType;
  11621. };
  11622. SlideTransition.prototype.getTransitionSubType = function()
  11623. {
  11624. return this.eTransitionSubType;
  11625. };
  11626. SlideTransition.prototype.getTransitionMode = function()
  11627. {
  11628. return this.eTransitionMode;
  11629. };
  11630. SlideTransition.prototype.getFadeColor = function()
  11631. {
  11632. return this.sFadeColor;
  11633. };
  11634. SlideTransition.prototype.isDirectionForward = function()
  11635. {
  11636. return !this.bReverseDirection;
  11637. };
  11638. SlideTransition.prototype.getDuration = function()
  11639. {
  11640. return this.aDuration;
  11641. };
  11642. SlideTransition.prototype.getMinFrameCount = function()
  11643. {
  11644. return this.nMinFrameCount;
  11645. };
  11646. SlideTransition.prototype.info = function()
  11647. {
  11648. var sInfo ='slide transition <' + this.sSlideId + '>: ';
  11649. sInfo += '; type: ' + getKeyByValue(aTransitionTypeInMap, this.getTransitionType());
  11650. sInfo += '; subtype: ' + getKeyByValue(aTransitionSubtypeInMap, this.getTransitionSubType());
  11651. if( !this.isDirectionForward() )
  11652. sInfo += '; direction: reverse';
  11653. sInfo += '; mode: ' + aTransitionModeOutMap[ this.getTransitionMode() ];
  11654. if( this.getDuration() )
  11655. sInfo += '; duration: ' + this.getDuration().info();
  11656. return sInfo;
  11657. };
  11658. function SlideAnimations( aSlideShowContext )
  11659. {
  11660. this.aContext = new NodeContext( aSlideShowContext );
  11661. this.aAnimationNodeMap = {};
  11662. this.aAnimatedElementMap = {};
  11663. this.aSourceEventElementMap = {};
  11664. this.aNextEffectEventArray = new NextEffectEventArray();
  11665. this.aInteractiveAnimationSequenceMap = {};
  11666. this.aEventMultiplexer = new EventMultiplexer( aSlideShowContext.aTimerEventQueue );
  11667. this.aRootNode = null;
  11668. this.bElementsParsed = false;
  11669. this.aContext.aAnimationNodeMap = this.aAnimationNodeMap;
  11670. this.aContext.aAnimatedElementMap = this.aAnimatedElementMap;
  11671. this.aContext.aSourceEventElementMap = this.aSourceEventElementMap;
  11672. this.aEventMultiplexer.registerMouseClickHandler( document, 100 );
  11673. }
  11674. SlideAnimations.prototype.importAnimations = function( aAnimationRootElement )
  11675. {
  11676. if( !aAnimationRootElement )
  11677. return false;
  11678. this.aRootNode = createAnimationTree( aAnimationRootElement, this.aContext );
  11679. return ( this.aRootNode ? true : false );
  11680. };
  11681. SlideAnimations.prototype.parseElements = function()
  11682. {
  11683. if( !this.aRootNode )
  11684. return false;
  11685. if( !this.aRootNode.parseElement() )
  11686. return false;
  11687. else
  11688. this.bElementsParsed = true;
  11689. };
  11690. SlideAnimations.prototype.elementsParsed = function()
  11691. {
  11692. return this.bElementsParsed;
  11693. };
  11694. SlideAnimations.prototype.isFirstRun = function()
  11695. {
  11696. return this.aContext.bFirstRun;
  11697. };
  11698. SlideAnimations.prototype.isAnimated = function()
  11699. {
  11700. if( !this.bElementsParsed )
  11701. return false;
  11702. return this.aRootNode.hasPendingAnimation();
  11703. };
  11704. SlideAnimations.prototype.start = function()
  11705. {
  11706. if( !this.bElementsParsed )
  11707. return false;
  11708. this.chargeSourceEvents();
  11709. this.chargeInterAnimEvents();
  11710. aSlideShow.setSlideEvents( this.aNextEffectEventArray,
  11711. this.aInteractiveAnimationSequenceMap,
  11712. this.aEventMultiplexer );
  11713. if( this.aContext.bFirstRun == undefined )
  11714. this.aContext.bFirstRun = true;
  11715. else if( this.aContext.bFirstRun )
  11716. this.aContext.bFirstRun = false;
  11717. this.aContext.bIsInvalid = !this.aRootNode.init();
  11718. if( this.aContext.bIsInvalid )
  11719. return false;
  11720. return this.aRootNode.resolve();
  11721. };
  11722. SlideAnimations.prototype.end = function( bLeftEffectsSkipped )
  11723. {
  11724. if( !this.bElementsParsed )
  11725. return; // no animations there
  11726. this.aRootNode.deactivate();
  11727. this.aRootNode.end();
  11728. if( bLeftEffectsSkipped && this.isFirstRun() )
  11729. {
  11730. this.aContext.bFirstRun = undefined;
  11731. }
  11732. else if( this.isFirstRun() )
  11733. {
  11734. this.aContext.bFirstRun = false;
  11735. }
  11736. this.aContext.bIsInvalid = false;
  11737. };
  11738. SlideAnimations.prototype.dispose = function()
  11739. {
  11740. if( this.aRootNode )
  11741. {
  11742. this.aRootNode.dispose();
  11743. }
  11744. };
  11745. SlideAnimations.prototype.clearNextEffectEvents = function()
  11746. {
  11747. ANIMDBG.print( 'SlideAnimations.clearNextEffectEvents: current slide: ' + nCurSlide );
  11748. this.aNextEffectEventArray.clear();
  11749. this.aContext.bFirstRun = undefined;
  11750. };
  11751. SlideAnimations.prototype.chargeSourceEvents = function()
  11752. {
  11753. for( var id in this.aSourceEventElementMap )
  11754. {
  11755. this.aSourceEventElementMap[id].charge();
  11756. }
  11757. };
  11758. SlideAnimations.prototype.chargeInterAnimEvents = function()
  11759. {
  11760. for( var id in this.aInteractiveAnimationSequenceMap )
  11761. {
  11762. this.aInteractiveAnimationSequenceMap[id].chargeEvents();
  11763. }
  11764. };
  11765. function Event()
  11766. {
  11767. this.nId = Event.getUniqueId();
  11768. }
  11769. Event.CURR_UNIQUE_ID = 0;
  11770. Event.getUniqueId = function()
  11771. {
  11772. ++Event.CURR_UNIQUE_ID;
  11773. return Event.CURR_UNIQUE_ID;
  11774. };
  11775. Event.prototype.getId = function()
  11776. {
  11777. return this.nId;
  11778. };
  11779. function DelayEvent( aFunctor, nTimeout )
  11780. {
  11781. DelayEvent.superclass.constructor.call( this );
  11782. this.aFunctor = aFunctor;
  11783. this.nTimeout = nTimeout;
  11784. this.bWasFired = false;
  11785. }
  11786. extend( DelayEvent, Event );
  11787. DelayEvent.prototype.fire = function()
  11788. {
  11789. assert( this.isCharged(), 'DelayEvent.fire: assertion isCharged failed' );
  11790. this.bWasFired = true;
  11791. this.aFunctor();
  11792. return true;
  11793. };
  11794. DelayEvent.prototype.isCharged = function()
  11795. {
  11796. return !this.bWasFired;
  11797. };
  11798. DelayEvent.prototype.getActivationTime = function( nCurrentTime )
  11799. {
  11800. return ( this.nTimeout + nCurrentTime );
  11801. };
  11802. DelayEvent.prototype.dispose = function()
  11803. {
  11804. if( this.isCharged() )
  11805. this.bWasFired = true;
  11806. };
  11807. DelayEvent.prototype.charge = function()
  11808. {
  11809. if( !this.isCharged() )
  11810. this.bWasFired = false;
  11811. };
  11812. function WakeupEvent( aTimer, aActivityQueue )
  11813. {
  11814. WakeupEvent.superclass.constructor.call( this );
  11815. this.aTimer = new ElapsedTime( aTimer );
  11816. this.nNextTime = 0.0;
  11817. this.aActivity = null;
  11818. this.aActivityQueue = aActivityQueue;
  11819. }
  11820. extend( WakeupEvent, Event );
  11821. WakeupEvent.prototype.clone = function()
  11822. {
  11823. var aWakeupEvent = new WakeupEvent( this.aTimer.getTimeBase(), this.aActivityQueue );
  11824. aWakeupEvent.nNextTime = this.nNextTime;
  11825. aWakeupEvent.aActivity = this.aActivity;
  11826. return aWakeupEvent;
  11827. };
  11828. WakeupEvent.prototype.dispose = function()
  11829. {
  11830. this.aActivity = null;
  11831. };
  11832. WakeupEvent.prototype.fire = function()
  11833. {
  11834. if( !this.aActivity )
  11835. return false;
  11836. return this.aActivityQueue.addActivity( this.aActivity );
  11837. };
  11838. WakeupEvent.prototype.isCharged = function()
  11839. {
  11840. return true;
  11841. };
  11842. WakeupEvent.prototype.getActivationTime = function( nCurrentTime )
  11843. {
  11844. var nElapsedTime = this.aTimer.getElapsedTime();
  11845. return Math.max( nCurrentTime, nCurrentTime - nElapsedTime + this.nNextTime );
  11846. };
  11847. WakeupEvent.prototype.start = function()
  11848. {
  11849. this.aTimer.reset();
  11850. };
  11851. WakeupEvent.prototype.setNextTimeout = function( nNextTime )
  11852. {
  11853. this.nNextTime = nNextTime;
  11854. };
  11855. WakeupEvent.prototype.setActivity = function( aActivity )
  11856. {
  11857. this.aActivity = aActivity;
  11858. };
  11859. function makeEvent( aFunctor )
  11860. {
  11861. return new DelayEvent( aFunctor, 0.0 );
  11862. }
  11863. function makeDelay( aFunctor, nTimeout )
  11864. {
  11865. return new DelayEvent( aFunctor, nTimeout );
  11866. }
  11867. function registerEvent( nNodeId, aTiming, aEvent, aNodeContext )
  11868. {
  11869. var aSlideShowContext = aNodeContext.aContext;
  11870. var eTimingType = aTiming.getType();
  11871. registerEvent.DBG( aTiming );
  11872. if( eTimingType == OFFSET_TIMING )
  11873. {
  11874. aSlideShowContext.aTimerEventQueue.addEvent( aEvent );
  11875. }
  11876. else if ( aNodeContext.bFirstRun )
  11877. {
  11878. var aEventMultiplexer = aSlideShowContext.aEventMultiplexer;
  11879. if( !aEventMultiplexer )
  11880. {
  11881. log( 'registerEvent: event multiplexer not initialized' );
  11882. return;
  11883. }
  11884. var aNextEffectEventArray = aSlideShowContext.aNextEffectEventArray;
  11885. if( !aNextEffectEventArray )
  11886. {
  11887. log( 'registerEvent: next effect event array not initialized' );
  11888. return;
  11889. }
  11890. var aInteractiveAnimationSequenceMap =
  11891. aSlideShowContext.aInteractiveAnimationSequenceMap;
  11892. if( !aInteractiveAnimationSequenceMap )
  11893. {
  11894. log( 'registerEvent: interactive animation sequence map not initialized' );
  11895. return;
  11896. }
  11897. switch( eTimingType )
  11898. {
  11899. case EVENT_TIMING:
  11900. var eEventType = aTiming.getEventType();
  11901. var sEventBaseElemId = aTiming.getEventBaseElementId();
  11902. if( sEventBaseElemId )
  11903. {
  11904. var aEventBaseElem = document.getElementById( sEventBaseElemId );
  11905. if( !aEventBaseElem )
  11906. {
  11907. log( 'generateEvent: EVENT_TIMING: event base element not found: ' + sEventBaseElemId );
  11908. return;
  11909. }
  11910. var aSourceEventElement = aNodeContext.makeSourceEventElement( sEventBaseElemId, aEventBaseElem );
  11911. if( !aInteractiveAnimationSequenceMap[ nNodeId ] )
  11912. {
  11913. aInteractiveAnimationSequenceMap[ nNodeId ] = new InteractiveAnimationSequence(nNodeId);
  11914. }
  11915. var bEventRegistered = false;
  11916. switch( eEventType )
  11917. {
  11918. case EVENT_TRIGGER_ON_CLICK:
  11919. aEventMultiplexer.registerEvent( eEventType, aSourceEventElement.getId(), aEvent );
  11920. aEventMultiplexer.registerRewindedEffectHandler( aSourceEventElement.getId(),
  11921. bind2( aSourceEventElement.charge, aSourceEventElement ) );
  11922. bEventRegistered = true;
  11923. break;
  11924. default:
  11925. log( 'generateEvent: not handled event type: ' + eEventType );
  11926. }
  11927. if( bEventRegistered )
  11928. {
  11929. var aStartEvent = aInteractiveAnimationSequenceMap[ nNodeId ].getStartEvent();
  11930. var aEndEvent = aInteractiveAnimationSequenceMap[ nNodeId ].getEndEvent();
  11931. aEventMultiplexer.registerEvent( eEventType, aSourceEventElement.getId(), aStartEvent );
  11932. aEventMultiplexer.registerEvent( EVENT_TRIGGER_END_EVENT, nNodeId, aEndEvent );
  11933. aEventMultiplexer.registerRewindedEffectHandler(
  11934. nNodeId,
  11935. bind2( InteractiveAnimationSequence.prototype.chargeEvents,
  11936. aInteractiveAnimationSequenceMap[ nNodeId ] )
  11937. );
  11938. }
  11939. }
  11940. else // no base event element present
  11941. {
  11942. switch( eEventType )
  11943. {
  11944. case EVENT_TRIGGER_ON_NEXT_EFFECT:
  11945. aNextEffectEventArray.appendEvent( aEvent );
  11946. break;
  11947. default:
  11948. log( 'generateEvent: not handled event type: ' + eEventType );
  11949. }
  11950. }
  11951. break;
  11952. case SYNCBASE_TIMING:
  11953. eEventType = aTiming.getEventType();
  11954. sEventBaseElemId = aTiming.getEventBaseElementId();
  11955. if( sEventBaseElemId )
  11956. {
  11957. var aAnimationNode = aNodeContext.aAnimationNodeMap[ sEventBaseElemId ];
  11958. if( !aAnimationNode )
  11959. {
  11960. log( 'generateEvent: SYNCBASE_TIMING: event base element not found: ' + sEventBaseElemId );
  11961. return;
  11962. }
  11963. aEventMultiplexer.registerEvent( eEventType, aAnimationNode.getId(), aEvent );
  11964. }
  11965. else
  11966. {
  11967. log( 'generateEvent: SYNCBASE_TIMING: event base element not specified' );
  11968. }
  11969. break;
  11970. default:
  11971. log( 'generateEvent: not handled timing type: ' + eTimingType );
  11972. }
  11973. }
  11974. }
  11975. registerEvent.DEBUG = aRegisterEventDebugPrinter.isEnabled();
  11976. registerEvent.DBG = function( aTiming, nTime )
  11977. {
  11978. if( registerEvent.DEBUG )
  11979. {
  11980. aRegisterEventDebugPrinter.print( 'registerEvent( timing: ' + aTiming.info() + ' )', nTime );
  11981. }
  11982. };
  11983. function SourceEventElement( sId, aElement, aEventMultiplexer )
  11984. {
  11985. this.sId = sId;
  11986. this.aElement = aElement;
  11987. this.aEventMultiplexer = aEventMultiplexer;
  11988. this.aEventMultiplexer.registerMouseClickHandler( this, 1000 );
  11989. this.bClickHandled = false;
  11990. this.bIsPointerOver = false;
  11991. this.aElement.addEventListener( 'mouseover', bind2( SourceEventElement.prototype.onMouseEnter, this), false );
  11992. this.aElement.addEventListener( 'mouseout', bind2( SourceEventElement.prototype.onMouseLeave, this), false );
  11993. }
  11994. SourceEventElement.prototype.getId = function()
  11995. {
  11996. return this.sId;
  11997. };
  11998. SourceEventElement.prototype.onMouseEnter = function()
  11999. {
  12000. this.bIsPointerOver = true;
  12001. this.setPointerCursor();
  12002. };
  12003. SourceEventElement.prototype.onMouseLeave = function()
  12004. {
  12005. this.bIsPointerOver = false;
  12006. this.setDefaultCursor();
  12007. };
  12008. SourceEventElement.prototype.charge = function()
  12009. {
  12010. this.bClickHandled = false;
  12011. this.setPointerCursor();
  12012. };
  12013. SourceEventElement.prototype.handleClick = function( /*aMouseEvent*/ )
  12014. {
  12015. if( !this.bIsPointerOver ) return false;
  12016. if( this.bClickHandled )
  12017. return false;
  12018. this.aEventMultiplexer.notifyEvent( EVENT_TRIGGER_ON_CLICK, this.getId() );
  12019. aSlideShow.update();
  12020. this.bClickHandled = true;
  12021. this.setDefaultCursor();
  12022. return true;
  12023. };
  12024. SourceEventElement.prototype.setPointerCursor = function()
  12025. {
  12026. if( this.bClickHandled )
  12027. return;
  12028. this.aElement.setAttribute( 'style', 'cursor: pointer' );
  12029. };
  12030. SourceEventElement.prototype.setDefaultCursor = function()
  12031. {
  12032. this.aElement.setAttribute( 'style', 'cursor: default' );
  12033. };
  12034. function HyperlinkElement( sId, aEventMultiplexer )
  12035. {
  12036. var aElement = document.getElementById( sId );
  12037. if( !aElement )
  12038. {
  12039. log( 'error: HyperlinkElement: no element with id: <' + sId + '> found' );
  12040. return;
  12041. }
  12042. if( !aEventMultiplexer )
  12043. {
  12044. log( 'AnimatedElement constructor: event multiplexer is not valid' );
  12045. }
  12046. this.sId = sId;
  12047. this.aElement = aElement;
  12048. this.aEventMultiplexer = aEventMultiplexer;
  12049. this.nTargetSlideIndex = undefined;
  12050. this.sURL = getNSAttribute( 'xlink', this.aElement, 'href' );
  12051. if( this.sURL )
  12052. {
  12053. if( this.sURL[0] === '#' )
  12054. {
  12055. if( this.sURL.substr(1, 5) === 'Slide' )
  12056. {
  12057. var sSlideIndex = this.sURL.split( ' ' )[1];
  12058. this.nTargetSlideIndex = parseInt( sSlideIndex ) - 1;
  12059. }
  12060. }
  12061. this.aEventMultiplexer.registerElementChangedHandler( this.sId, bind2( HyperlinkElement.prototype.onElementChanged, this) );
  12062. this.aEventMultiplexer.registerMouseClickHandler( this, 1100 );
  12063. this.bIsPointerOver = false;
  12064. this.mouseEnterHandler = bind2( HyperlinkElement.prototype.onMouseEnter, this);
  12065. this.mouseLeaveHandler = bind2( HyperlinkElement.prototype.onMouseLeave, this);
  12066. this.aElement.addEventListener( 'mouseover', this.mouseEnterHandler, false );
  12067. this.aElement.addEventListener( 'mouseout', this.mouseLeaveHandler, false );
  12068. }
  12069. else
  12070. {
  12071. log( 'warning: HyperlinkElement(' + this.sId + '): url is empty' );
  12072. }
  12073. }
  12074. HyperlinkElement.prototype.onElementChanged = function( aElement )
  12075. {
  12076. if( !aElement )
  12077. {
  12078. log( 'error: HyperlinkElement: passed element is not valid' );
  12079. return;
  12080. }
  12081. if( this.sURL )
  12082. {
  12083. this.aElement.removeEventListener( 'mouseover', this.mouseEnterHandler, false );
  12084. this.aElement.removeEventListener( 'mouseout', this.mouseLeaveHandler, false );
  12085. this.aElement = aElement;
  12086. this.aElement.addEventListener( 'mouseover', this.mouseEnterHandler, false );
  12087. this.aElement.addEventListener( 'mouseout', this.mouseLeaveHandler, false );
  12088. }
  12089. };
  12090. HyperlinkElement.prototype.onMouseEnter = function()
  12091. {
  12092. this.bIsPointerOver = true;
  12093. this.setPointerCursor();
  12094. };
  12095. HyperlinkElement.prototype.onMouseLeave = function()
  12096. {
  12097. this.bIsPointerOver = false;
  12098. this.setDefaultCursor();
  12099. };
  12100. HyperlinkElement.prototype.handleClick = function( )
  12101. {
  12102. if( !this.bIsPointerOver ) return false;
  12103. if( this.nTargetSlideIndex !== undefined )
  12104. {
  12105. aSlideShow.displaySlide( this.nTargetSlideIndex, true );
  12106. }
  12107. else
  12108. {
  12109. var aWindowObject = document.defaultView;
  12110. if( aWindowObject )
  12111. {
  12112. aWindowObject.open( this.sURL, this.sId );
  12113. }
  12114. else
  12115. {
  12116. log( 'error: HyperlinkElement.handleClick: invalid window object.' );
  12117. }
  12118. }
  12119. return true;
  12120. };
  12121. HyperlinkElement.prototype.setPointerCursor = function()
  12122. {
  12123. if( this.bClickHandled )
  12124. return;
  12125. this.aElement.setAttribute( 'style', 'cursor: pointer' );
  12126. };
  12127. HyperlinkElement.prototype.setDefaultCursor = function()
  12128. {
  12129. this.aElement.setAttribute( 'style', 'cursor: default' );
  12130. };
  12131. function InteractiveAnimationSequence( nId )
  12132. {
  12133. this.nId = nId;
  12134. this.bIsRunning = false;
  12135. this.aStartEvent = null;
  12136. this.aEndEvent = null;
  12137. }
  12138. InteractiveAnimationSequence.prototype.getId = function()
  12139. {
  12140. return this.nId;
  12141. };
  12142. InteractiveAnimationSequence.prototype.getStartEvent = function()
  12143. {
  12144. if( !this.aStartEvent )
  12145. {
  12146. this.aStartEvent =
  12147. makeEvent( bind2( InteractiveAnimationSequence.prototype.start, this ) );
  12148. }
  12149. return this.aStartEvent;
  12150. };
  12151. InteractiveAnimationSequence.prototype.getEndEvent = function()
  12152. {
  12153. if( !this.aEndEvent )
  12154. {
  12155. this.aEndEvent =
  12156. makeEvent( bind2( InteractiveAnimationSequence.prototype.end, this ) );
  12157. }
  12158. return this.aEndEvent;
  12159. };
  12160. InteractiveAnimationSequence.prototype.chargeEvents = function()
  12161. {
  12162. if( this.aStartEvent ) this.aStartEvent.charge();
  12163. if( this.aEndEvent ) this.aEndEvent.charge();
  12164. };
  12165. InteractiveAnimationSequence.prototype.isRunning = function()
  12166. {
  12167. return this.bIsRunning;
  12168. };
  12169. InteractiveAnimationSequence.prototype.start = function()
  12170. {
  12171. aSlideShow.notifyInteractiveAnimationSequenceStart( this.getId() );
  12172. this.bIsRunning = true;
  12173. };
  12174. InteractiveAnimationSequence.prototype.end = function()
  12175. {
  12176. aSlideShow.notifyInteractiveAnimationSequenceEnd( this.getId() );
  12177. this.bIsRunning = false;
  12178. };
  12179. function PriorityEntry( aValue, nPriority )
  12180. {
  12181. this.aValue = aValue;
  12182. this.nPriority = nPriority;
  12183. }
  12184. PriorityEntry.compare = function( aLhsEntry, aRhsEntry )
  12185. {
  12186. if ( aLhsEntry.nPriority < aRhsEntry.nPriority )
  12187. {
  12188. return -1;
  12189. }
  12190. else if (aLhsEntry.nPriority > aRhsEntry.nPriority)
  12191. {
  12192. return 1;
  12193. }
  12194. else
  12195. {
  12196. return 0;
  12197. }
  12198. };
  12199. function EventMultiplexer( aTimerEventQueue )
  12200. {
  12201. this.nId = EventMultiplexer.getUniqueId();
  12202. this.aTimerEventQueue = aTimerEventQueue;
  12203. this.aEventMap = {};
  12204. this.aAnimationsEndHandler = null;
  12205. this.aSkipEffectEndHandlerSet = [];
  12206. this.aMouseClickHandlerSet = new PriorityQueue( PriorityEntry.compare );
  12207. this.aSkipEffectEvent = null;
  12208. this.aRewindCurrentEffectEvent = null;
  12209. this.aRewindLastEffectEvent = null;
  12210. this.aSkipInteractiveEffectEventSet = {};
  12211. this.aRewindRunningInteractiveEffectEventSet = {};
  12212. this.aRewindEndedInteractiveEffectEventSet = {};
  12213. this.aRewindedEffectHandlerSet = {};
  12214. this.aElementChangedHandlerSet = {};
  12215. }
  12216. EventMultiplexer.CURR_UNIQUE_ID = 0;
  12217. EventMultiplexer.getUniqueId = function()
  12218. {
  12219. ++EventMultiplexer.CURR_UNIQUE_ID;
  12220. return EventMultiplexer.CURR_UNIQUE_ID;
  12221. };
  12222. EventMultiplexer.prototype.getId = function()
  12223. {
  12224. return this.nId;
  12225. };
  12226. EventMultiplexer.prototype.hasRegisteredMouseClickHandlers = function()
  12227. {
  12228. return !this.aMouseClickHandlerSet.isEmpty();
  12229. };
  12230. EventMultiplexer.prototype.registerMouseClickHandler = function( aHandler, nPriority )
  12231. {
  12232. var aHandlerEntry = new PriorityEntry( aHandler, nPriority );
  12233. this.aMouseClickHandlerSet.push( aHandlerEntry );
  12234. };
  12235. EventMultiplexer.prototype.notifyMouseClick = function( aMouseEvent )
  12236. {
  12237. var aMouseClickHandlerSet = this.aMouseClickHandlerSet.clone();
  12238. while( !aMouseClickHandlerSet.isEmpty() )
  12239. {
  12240. var aHandlerEntry = aMouseClickHandlerSet.top();
  12241. aMouseClickHandlerSet.pop();
  12242. if( aHandlerEntry.aValue.handleClick( aMouseEvent ) )
  12243. break;
  12244. }
  12245. };
  12246. EventMultiplexer.prototype.registerEvent = function( eEventType, aNotifierId, aEvent )
  12247. {
  12248. this.DBG( 'registerEvent', eEventType, aNotifierId );
  12249. if( !this.aEventMap[ eEventType ] )
  12250. {
  12251. this.aEventMap[ eEventType ] = {};
  12252. }
  12253. if( !this.aEventMap[ eEventType ][ aNotifierId ] )
  12254. {
  12255. this.aEventMap[ eEventType ][ aNotifierId ] = [];
  12256. }
  12257. this.aEventMap[ eEventType ][ aNotifierId ].push( aEvent );
  12258. };
  12259. EventMultiplexer.prototype.notifyEvent = function( eEventType, aNotifierId )
  12260. {
  12261. this.DBG( 'notifyEvent', eEventType, aNotifierId );
  12262. if( this.aEventMap[ eEventType ] )
  12263. {
  12264. if( this.aEventMap[ eEventType ][ aNotifierId ] )
  12265. {
  12266. var aEventArray = this.aEventMap[ eEventType ][ aNotifierId ];
  12267. var nSize = aEventArray.length;
  12268. for( var i = 0; i < nSize; ++i )
  12269. {
  12270. this.aTimerEventQueue.addEvent( aEventArray[i] );
  12271. }
  12272. }
  12273. }
  12274. };
  12275. EventMultiplexer.prototype.registerAnimationsEndHandler = function( aHandler )
  12276. {
  12277. this.aAnimationsEndHandler = aHandler;
  12278. };
  12279. EventMultiplexer.prototype.notifyAnimationsEndEvent = function()
  12280. {
  12281. if( this.aAnimationsEndHandler )
  12282. this.aAnimationsEndHandler();
  12283. };
  12284. EventMultiplexer.prototype.registerNextEffectEndHandler = function( aHandler )
  12285. {
  12286. this.aSkipEffectEndHandlerSet.push( aHandler );
  12287. };
  12288. EventMultiplexer.prototype.notifyNextEffectEndEvent = function()
  12289. {
  12290. var nSize = this.aSkipEffectEndHandlerSet.length;
  12291. for( var i = 0; i < nSize; ++i )
  12292. {
  12293. (this.aSkipEffectEndHandlerSet[i])();
  12294. }
  12295. this.aSkipEffectEndHandlerSet = [];
  12296. };
  12297. EventMultiplexer.prototype.registerSkipEffectEvent = function( aEvent )
  12298. {
  12299. this.aSkipEffectEvent = aEvent;
  12300. };
  12301. EventMultiplexer.prototype.notifySkipEffectEvent = function()
  12302. {
  12303. if( this.aSkipEffectEvent )
  12304. {
  12305. this.aTimerEventQueue.addEvent( this.aSkipEffectEvent );
  12306. this.aSkipEffectEvent = null;
  12307. }
  12308. };
  12309. EventMultiplexer.prototype.registerRewindCurrentEffectEvent = function( aEvent )
  12310. {
  12311. this.aRewindCurrentEffectEvent = aEvent;
  12312. };
  12313. EventMultiplexer.prototype.notifyRewindCurrentEffectEvent = function()
  12314. {
  12315. if( this.aRewindCurrentEffectEvent )
  12316. {
  12317. this.aTimerEventQueue.addEvent( this.aRewindCurrentEffectEvent );
  12318. this.aRewindCurrentEffectEvent = null;
  12319. }
  12320. };
  12321. EventMultiplexer.prototype.registerRewindLastEffectEvent = function( aEvent )
  12322. {
  12323. this.aRewindLastEffectEvent = aEvent;
  12324. };
  12325. EventMultiplexer.prototype.notifyRewindLastEffectEvent = function()
  12326. {
  12327. if( this.aRewindLastEffectEvent )
  12328. {
  12329. this.aTimerEventQueue.addEvent( this.aRewindLastEffectEvent );
  12330. this.aRewindLastEffectEvent = null;
  12331. }
  12332. };
  12333. EventMultiplexer.prototype.registerSkipInteractiveEffectEvent = function( nNotifierId, aEvent )
  12334. {
  12335. this.aSkipInteractiveEffectEventSet[ nNotifierId ] = aEvent;
  12336. };
  12337. EventMultiplexer.prototype.notifySkipInteractiveEffectEvent = function( nNotifierId )
  12338. {
  12339. if( this.aSkipInteractiveEffectEventSet[ nNotifierId ] )
  12340. {
  12341. this.aTimerEventQueue.addEvent( this.aSkipInteractiveEffectEventSet[ nNotifierId ] );
  12342. }
  12343. };
  12344. EventMultiplexer.prototype.registerRewindRunningInteractiveEffectEvent = function( nNotifierId, aEvent )
  12345. {
  12346. this.aRewindRunningInteractiveEffectEventSet[ nNotifierId ] = aEvent;
  12347. };
  12348. EventMultiplexer.prototype.notifyRewindRunningInteractiveEffectEvent = function( nNotifierId )
  12349. {
  12350. if( this.aRewindRunningInteractiveEffectEventSet[ nNotifierId ] )
  12351. {
  12352. this.aTimerEventQueue.addEvent( this.aRewindRunningInteractiveEffectEventSet[ nNotifierId ] );
  12353. }
  12354. };
  12355. EventMultiplexer.prototype.registerRewindEndedInteractiveEffectEvent = function( nNotifierId, aEvent )
  12356. {
  12357. this.aRewindEndedInteractiveEffectEventSet[ nNotifierId ] = aEvent;
  12358. };
  12359. EventMultiplexer.prototype.notifyRewindEndedInteractiveEffectEvent = function( nNotifierId )
  12360. {
  12361. if( this.aRewindEndedInteractiveEffectEventSet[ nNotifierId ] )
  12362. {
  12363. this.aTimerEventQueue.addEvent( this.aRewindEndedInteractiveEffectEventSet[ nNotifierId ] );
  12364. }
  12365. };
  12366. EventMultiplexer.prototype.registerRewindedEffectHandler = function( aNotifierId, aHandler )
  12367. {
  12368. this.aRewindedEffectHandlerSet[ aNotifierId ] = aHandler;
  12369. };
  12370. EventMultiplexer.prototype.notifyRewindedEffectEvent = function( aNotifierId )
  12371. {
  12372. if( this.aRewindedEffectHandlerSet[ aNotifierId ] )
  12373. {
  12374. (this.aRewindedEffectHandlerSet[ aNotifierId ])();
  12375. }
  12376. };
  12377. EventMultiplexer.prototype.registerElementChangedHandler = function( aNotifierId, aHandler )
  12378. {
  12379. this.aElementChangedHandlerSet[ aNotifierId ] = aHandler;
  12380. };
  12381. EventMultiplexer.prototype.notifyElementChangedEvent = function( aNotifierId, aElement )
  12382. {
  12383. if( this.aElementChangedHandlerSet[ aNotifierId ] )
  12384. {
  12385. (this.aElementChangedHandlerSet[ aNotifierId ])( aElement );
  12386. }
  12387. };
  12388. EventMultiplexer.DEBUG = aEventMultiplexerDebugPrinter.isEnabled();
  12389. EventMultiplexer.prototype.DBG = function( sMethodName, eEventType, aNotifierId, nTime )
  12390. {
  12391. if( EventMultiplexer.DEBUG )
  12392. {
  12393. var sInfo = 'EventMultiplexer.' + sMethodName;
  12394. sInfo += '( type: ' + aEventTriggerOutMap[ eEventType ];
  12395. sInfo += ', notifier: ' + aNotifierId + ' )';
  12396. aEventMultiplexerDebugPrinter.print( sInfo, nTime );
  12397. }
  12398. };
  12399. var aInterpolatorHandler = {};
  12400. aInterpolatorHandler.getInterpolator = function( eCalcMode, eValueType, eValueSubtype )
  12401. {
  12402. var bHasSubtype = ( typeof( eValueSubtype ) === typeof( 0 ) );
  12403. if( !bHasSubtype && aInterpolatorHandler.aLerpFunctorMap[ eCalcMode ][ eValueType ] )
  12404. {
  12405. return aInterpolatorHandler.aLerpFunctorMap[ eCalcMode ][ eValueType ];
  12406. }
  12407. else if( bHasSubtype && aInterpolatorHandler.aLerpFunctorMap[ eCalcMode ][ eValueType ][ eValueSubtype ] )
  12408. {
  12409. return aInterpolatorHandler.aLerpFunctorMap[ eCalcMode ][ eValueType ][ eValueSubtype ];
  12410. }
  12411. else
  12412. {
  12413. log( 'aInterpolatorHandler.getInterpolator: not found any valid interpolator for calc mode '
  12414. + aCalcModeOutMap[eCalcMode] + ' and value type ' + aValueTypeOutMap[eValueType] );
  12415. return null;
  12416. }
  12417. };
  12418. aInterpolatorHandler.aLerpFunctorMap = [];
  12419. aInterpolatorHandler.aLerpFunctorMap[ CALC_MODE_DISCRETE ] = [];
  12420. aInterpolatorHandler.aLerpFunctorMap[ CALC_MODE_LINEAR ] = [];
  12421. aInterpolatorHandler.aLerpFunctorMap[ CALC_MODE_LINEAR ][ NUMBER_PROPERTY ] =
  12422. function ( nFrom, nTo, nT )
  12423. {
  12424. return ( ( 1.0 - nT )* nFrom + nT * nTo );
  12425. };
  12426. aInterpolatorHandler.aLerpFunctorMap[ CALC_MODE_LINEAR ][ COLOR_PROPERTY ] = [];
  12427. aInterpolatorHandler.aLerpFunctorMap[ CALC_MODE_LINEAR ][ COLOR_PROPERTY ][ COLOR_SPACE_RGB ] =
  12428. function ( nFrom, nTo, nT )
  12429. {
  12430. return RGBColor.interpolate( nFrom, nTo, nT );
  12431. };
  12432. aInterpolatorHandler.aLerpFunctorMap[ CALC_MODE_LINEAR ][ COLOR_PROPERTY ][ COLOR_SPACE_HSL ] =
  12433. function ( bCCW )
  12434. {
  12435. return function ( nFrom, nTo, nT )
  12436. {
  12437. return HSLColor.interpolate( nFrom, nTo, nT, bCCW );
  12438. };
  12439. };
  12440. aInterpolatorHandler.aLerpFunctorMap[ CALC_MODE_LINEAR ][ TUPLE_NUMBER_PROPERTY ] =
  12441. function ( aFrom, aTo, nT )
  12442. {
  12443. var aRes = [];
  12444. for( var i = 0; i < aFrom.length; ++i )
  12445. {
  12446. aRes.push( ( 1.0 - nT )* aFrom[i] + nT * aTo[i] );
  12447. }
  12448. return aRes;
  12449. };
  12450. function KeyStopLerp( aValueList )
  12451. {
  12452. KeyStopLerp.validateInput( aValueList );
  12453. this.aKeyStopList = [];
  12454. this.nLastIndex = 0;
  12455. this.nKeyStopDistance = aValueList[1] - aValueList[0];
  12456. if( this.nKeyStopDistance <= 0 )
  12457. this.nKeyStopDistance = 0.001;
  12458. for( var i = 0; i < aValueList.length; ++i )
  12459. this.aKeyStopList.push( aValueList[i] );
  12460. this.nUpperBoundIndex = this.aKeyStopList.length - 2;
  12461. }
  12462. KeyStopLerp.validateInput = function( aValueList )
  12463. {
  12464. var nSize = aValueList.length;
  12465. assert( nSize > 1, 'KeyStopLerp.validateInput: key stop vector must have two entries or more' );
  12466. for( var i = 1; i < nSize; ++i )
  12467. {
  12468. if( aValueList[i-1] > aValueList[i] )
  12469. log( 'KeyStopLerp.validateInput: time vector is not sorted in ascending order!' );
  12470. }
  12471. };
  12472. KeyStopLerp.prototype.reset = function()
  12473. {
  12474. KeyStopLerp.validateInput( this.aKeyStopList );
  12475. this.nLastIndex = 0;
  12476. this.nKeyStopDistance = this.aKeyStopList[1] - this.aKeyStopList[0];
  12477. if( this.nKeyStopDistance <= 0 )
  12478. this.nKeyStopDistance = 0.001;
  12479. };
  12480. KeyStopLerp.prototype.lerp = function( nAlpha )
  12481. {
  12482. if( nAlpha > this.aKeyStopList[ this.nLastIndex + 1 ] )
  12483. {
  12484. do
  12485. {
  12486. var nIndex = this.nLastIndex + 1;
  12487. this.nLastIndex = clamp( nIndex, 0, this.nUpperBoundIndex );
  12488. this.nKeyStopDistance = this.aKeyStopList[ this.nLastIndex + 1 ] - this.aKeyStopList[ this.nLastIndex ];
  12489. }
  12490. while( ( this.nKeyStopDistance <= 0 ) && ( this.nLastIndex < this.nUpperBoundIndex ) );
  12491. }
  12492. var nRawLerp = ( nAlpha - this.aKeyStopList[ this.nLastIndex ] ) / this.nKeyStopDistance;
  12493. nRawLerp = clamp( nRawLerp, 0.0, 1.0 );
  12494. var aResult = {};
  12495. aResult.nIndex = this.nLastIndex;
  12496. aResult.nLerp = nRawLerp;
  12497. return aResult;
  12498. };
  12499. KeyStopLerp.prototype.lerp_ported = function( nAlpha )
  12500. {
  12501. if( ( this.aKeyStopList[ this.nLastIndex ] < nAlpha ) ||
  12502. ( this.aKeyStopList[ this.nLastIndex + 1 ] >= nAlpha ) )
  12503. {
  12504. var i = 0;
  12505. for( ; i < this.aKeyStopList.length; ++i )
  12506. {
  12507. if( this.aKeyStopList[i] >= nAlpha )
  12508. break;
  12509. }
  12510. if( this.aKeyStopList[i] > nAlpha )
  12511. --i;
  12512. var nIndex = i - 1;
  12513. this.nLastIndex = clamp( nIndex, 0, this.aKeyStopList.length - 2 );
  12514. }
  12515. var nRawLerp = ( nAlpha - this.aKeyStopList[ this.nLastIndex ] ) /
  12516. ( this.aKeyStopList[ this.nLastIndex+1 ] - this.aKeyStopList[ this.nLastIndex ] );
  12517. nRawLerp = clamp( nRawLerp, 0.0, 1.0 );
  12518. var aResult = {};
  12519. aResult.nIndex = this.nLastIndex;
  12520. aResult.nLerp = nRawLerp;
  12521. return aResult;
  12522. };
  12523. var aOperatorSetMap = [];
  12524. aOperatorSetMap[ NUMBER_PROPERTY ] = {};
  12525. aOperatorSetMap[ NUMBER_PROPERTY ].equal = function( a, b )
  12526. {
  12527. return ( a === b );
  12528. };
  12529. aOperatorSetMap[ NUMBER_PROPERTY ].add = function( a, b )
  12530. {
  12531. return ( a + b );
  12532. };
  12533. aOperatorSetMap[ NUMBER_PROPERTY ].scale = function( k, v )
  12534. {
  12535. return ( k * v );
  12536. };
  12537. aOperatorSetMap[ COLOR_PROPERTY ] = {};
  12538. aOperatorSetMap[ COLOR_PROPERTY ].equal = function( a, b )
  12539. {
  12540. return a.equal( b );
  12541. };
  12542. aOperatorSetMap[ COLOR_PROPERTY ].add = function( a, b )
  12543. {
  12544. var c = a.clone();
  12545. c.add( b );
  12546. return c;
  12547. };
  12548. aOperatorSetMap[ COLOR_PROPERTY ].scale = function( k, v )
  12549. {
  12550. var r = v.clone();
  12551. r.scale( k );
  12552. return r;
  12553. };
  12554. aOperatorSetMap[ ENUM_PROPERTY ] = {};
  12555. aOperatorSetMap[ ENUM_PROPERTY ].equal = function( a, b )
  12556. {
  12557. return ( a === b );
  12558. };
  12559. aOperatorSetMap[ ENUM_PROPERTY ].add = function( a )
  12560. {
  12561. return a;
  12562. };
  12563. aOperatorSetMap[ ENUM_PROPERTY ].scale = function( k, v )
  12564. {
  12565. return v;
  12566. };
  12567. aOperatorSetMap[ STRING_PROPERTY ] = aOperatorSetMap[ ENUM_PROPERTY ];
  12568. aOperatorSetMap[ BOOL_PROPERTY ] = aOperatorSetMap[ ENUM_PROPERTY ];
  12569. aOperatorSetMap[ TUPLE_NUMBER_PROPERTY ] = {};
  12570. aOperatorSetMap[ TUPLE_NUMBER_PROPERTY ].equal = function( a, b )
  12571. {
  12572. assert( a.length === b.length, 'Tuples length mismatch.' );
  12573. return ( a.toString() === b.toString() );
  12574. };
  12575. aOperatorSetMap[ TUPLE_NUMBER_PROPERTY ].add = function( a, b )
  12576. {
  12577. assert( a.length === b.length, 'Tuples length mismatch.' );
  12578. var r = [];
  12579. for( var i = 0; i < a.length; ++i )
  12580. {
  12581. r.push(a[i] + b[i]);
  12582. }
  12583. return r;
  12584. };
  12585. aOperatorSetMap[ TUPLE_NUMBER_PROPERTY ].scale = function( k, v )
  12586. {
  12587. var r = [];
  12588. for( var i = 0; i < v.length; ++i )
  12589. {
  12590. r.push(k * v[i]);
  12591. }
  12592. return r;
  12593. };
  12594. function ActivityParamSet()
  12595. {
  12596. this.aEndEvent = null;
  12597. this.aWakeupEvent = null;
  12598. this.aTimerEventQueue = null;
  12599. this.aActivityQueue = null;
  12600. this.nMinDuration = undefined;
  12601. this.nMinNumberOfFrames = MINIMUM_FRAMES_PER_SECONDS;
  12602. this.bAutoReverse = false;
  12603. this.nRepeatCount = 1.0;
  12604. this.nAccelerationFraction = 0.0;
  12605. this.nDecelerationFraction = 0.0;
  12606. this.nSlideWidth = undefined;
  12607. this.nSlideHeight = undefined;
  12608. this.aFormula = null;
  12609. this.aDiscreteTimes = [];
  12610. }
  12611. function AnimationActivity()
  12612. {
  12613. this.nId = AnimationActivity.getUniqueId();
  12614. }
  12615. AnimationActivity.CURR_UNIQUE_ID = 0;
  12616. AnimationActivity.getUniqueId = function()
  12617. {
  12618. ++AnimationActivity.CURR_UNIQUE_ID;
  12619. return AnimationActivity.CURR_UNIQUE_ID;
  12620. };
  12621. AnimationActivity.prototype.getId = function()
  12622. {
  12623. return this.nId;
  12624. };
  12625. function SetActivity( aCommonParamSet, aAnimation, aToAttr )
  12626. {
  12627. SetActivity.superclass.constructor.call( this );
  12628. this.aAnimation = aAnimation;
  12629. this.aTargetElement = null;
  12630. this.aEndEvent = aCommonParamSet.aEndEvent;
  12631. this.aTimerEventQueue = aCommonParamSet.aTimerEventQueue;
  12632. this.aToAttr = aToAttr;
  12633. this.bIsActive = true;
  12634. }
  12635. extend( SetActivity, AnimationActivity );
  12636. SetActivity.prototype.activate = function( aEndEvent )
  12637. {
  12638. this.aEndEvent = aEndEvent;
  12639. this.bIsActive = true;
  12640. };
  12641. SetActivity.prototype.dispose = function()
  12642. {
  12643. this.bIsActive = false;
  12644. if( this.aEndEvent && this.aEndEvent.isCharged() )
  12645. this.aEndEvent.dispose();
  12646. };
  12647. SetActivity.prototype.calcTimeLag = function()
  12648. {
  12649. return 0.0;
  12650. };
  12651. SetActivity.prototype.perform = function()
  12652. {
  12653. if( !this.isActive() )
  12654. return false;
  12655. this.bIsActive = false;
  12656. if( this.aAnimation && this.aTargetElement )
  12657. {
  12658. this.aAnimation.start( this.aTargetElement );
  12659. this.aAnimation.perform( this.aToAttr );
  12660. this.aAnimation.end();
  12661. }
  12662. if( this.aEndEvent )
  12663. this.aTimerEventQueue.addEvent( this.aEndEvent );
  12664. };
  12665. SetActivity.prototype.isActive = function()
  12666. {
  12667. return this.bIsActive;
  12668. };
  12669. SetActivity.prototype.dequeued = function()
  12670. {
  12671. };
  12672. SetActivity.prototype.end = function()
  12673. {
  12674. this.perform();
  12675. };
  12676. SetActivity.prototype.setTargets = function( aTargetElement )
  12677. {
  12678. assert( aTargetElement, 'SetActivity.setTargets: target element is not valid' );
  12679. this.aTargetElement = aTargetElement;
  12680. };
  12681. function ActivityBase( aCommonParamSet )
  12682. {
  12683. ActivityBase.superclass.constructor.call( this );
  12684. this.aTargetElement = null;
  12685. this.aEndEvent = aCommonParamSet.aEndEvent;
  12686. this.aTimerEventQueue = aCommonParamSet.aTimerEventQueue;
  12687. this.nRepeats = aCommonParamSet.nRepeatCount;
  12688. this.nAccelerationFraction = aCommonParamSet.nAccelerationFraction;
  12689. this.nDecelerationFraction = aCommonParamSet.nDecelerationFraction;
  12690. this.bAutoReverse = aCommonParamSet.bAutoReverse;
  12691. this.bFirstPerformCall = true;
  12692. this.bIsActive = true;
  12693. }
  12694. extend( ActivityBase, AnimationActivity );
  12695. ActivityBase.prototype.activate = function( aEndEvent )
  12696. {
  12697. this.aEndEvent = aEndEvent;
  12698. this.bFirstPerformCall = true;
  12699. this.bIsActive = true;
  12700. };
  12701. ActivityBase.prototype.dispose = function()
  12702. {
  12703. this.bIsActive = false;
  12704. if( this.aEndEvent )
  12705. this.aEndEvent.dispose();
  12706. this.aEndEvent = null;
  12707. };
  12708. ActivityBase.prototype.perform = function()
  12709. {
  12710. if( !this.isActive() )
  12711. return false; // no, early exit.
  12712. assert( !this.bFirstPerformCall, 'ActivityBase.perform: assertion (!this.FirstPerformCall) failed' );
  12713. return true;
  12714. };
  12715. ActivityBase.prototype.calcTimeLag = function()
  12716. {
  12717. if( this.isActive() && this.bFirstPerformCall )
  12718. {
  12719. this.bFirstPerformCall = false;
  12720. this.startAnimation();
  12721. }
  12722. return 0.0;
  12723. };
  12724. ActivityBase.prototype.isActive = function()
  12725. {
  12726. return this.bIsActive;
  12727. };
  12728. ActivityBase.prototype.isDisposed = function()
  12729. {
  12730. return ( !this.bIsActive && !this.aEndEvent );
  12731. };
  12732. ActivityBase.prototype.dequeued = function()
  12733. {
  12734. if( !this.isActive() )
  12735. this.endAnimation();
  12736. };
  12737. ActivityBase.prototype.setTargets = function( aTargetElement )
  12738. {
  12739. assert( aTargetElement, 'ActivityBase.setTargets: target element is not valid' );
  12740. this.aTargetElement = aTargetElement;
  12741. };
  12742. ActivityBase.prototype.startAnimation = function()
  12743. {
  12744. throw ( 'ActivityBase.startAnimation: abstract method invoked' );
  12745. };
  12746. ActivityBase.prototype.endAnimation = function()
  12747. {
  12748. throw ( 'ActivityBase.endAnimation: abstract method invoked' );
  12749. };
  12750. ActivityBase.prototype.endActivity = function()
  12751. {
  12752. this.bIsActive = false;
  12753. if( this.aEndEvent )
  12754. this.aTimerEventQueue.addEvent( this.aEndEvent );
  12755. this.aEndEvent = null;
  12756. };
  12757. ActivityBase.prototype.calcAcceleratedTime = function( nT )
  12758. {
  12759. nT = clamp( nT, 0.0, 1.0 );
  12760. if( ( this.nAccelerationFraction > 0.0 || this.nDecelerationFraction > 0.0 ) &&
  12761. ( this.nAccelerationFraction + this.nDecelerationFraction <= 1.0 ) )
  12762. {
  12763. var nC = 1.0 - 0.5*this.nAccelerationFraction - 0.5*this.nDecelerationFraction;
  12764. var nTPrime = 0.0;
  12765. if( nT < this.nAccelerationFraction )
  12766. {
  12767. nTPrime += 0.5 * nT * nT / this.nAccelerationFraction; // partial first interval
  12768. }
  12769. else
  12770. {
  12771. nTPrime += 0.5 * this.nAccelerationFraction; // full first interval
  12772. if( nT <= ( 1.0 - this.nDecelerationFraction ) )
  12773. {
  12774. nTPrime += nT - this.nAccelerationFraction; // partial second interval
  12775. }
  12776. else
  12777. {
  12778. nTPrime += 1.0 - this.nAccelerationFraction - this.nDecelerationFraction; // full second interval
  12779. var nTRelative = nT - 1.0 + this.nDecelerationFraction;
  12780. nTPrime += nTRelative - 0.5*nTRelative*nTRelative / this.nDecelerationFraction;
  12781. }
  12782. }
  12783. nT = nTPrime / nC;
  12784. }
  12785. return nT;
  12786. };
  12787. ActivityBase.prototype.getEventQueue = function()
  12788. {
  12789. return this.aTimerEventQueue;
  12790. };
  12791. ActivityBase.prototype.getTargetElement = function()
  12792. {
  12793. return this.aTargetElement;
  12794. };
  12795. ActivityBase.prototype.isRepeatCountValid = function()
  12796. {
  12797. return !!this.nRepeats; // first ! convert to bool
  12798. };
  12799. ActivityBase.prototype.getRepeatCount = function()
  12800. {
  12801. return this.nRepeats;
  12802. };
  12803. ActivityBase.prototype.isAutoReverse = function()
  12804. {
  12805. return this.bAutoReverse;
  12806. };
  12807. ActivityBase.prototype.end = function()
  12808. {
  12809. if( !this.isActive() || this.isDisposed() )
  12810. return;
  12811. if( this.bFirstPerformCall )
  12812. {
  12813. this.bFirstPerformCall = false;
  12814. this.startAnimation();
  12815. }
  12816. this.performEnd();
  12817. this.endAnimation();
  12818. this.endActivity();
  12819. };
  12820. ActivityBase.prototype.performEnd = function()
  12821. {
  12822. throw ( 'ActivityBase.performEnd: abstract method invoked' );
  12823. };
  12824. function DiscreteActivityBase( aCommonParamSet )
  12825. {
  12826. DiscreteActivityBase.superclass.constructor.call( this, aCommonParamSet );
  12827. this.aOriginalWakeupEvent = aCommonParamSet.aWakeupEvent;
  12828. this.aOriginalWakeupEvent.setActivity( this );
  12829. this.aWakeupEvent = this.aOriginalWakeupEvent;
  12830. this.aWakeupEvent = aCommonParamSet.aWakeupEvent;
  12831. this.aDiscreteTimes = aCommonParamSet.aDiscreteTimes;
  12832. this.nMinSimpleDuration = aCommonParamSet.nMinDuration;
  12833. this.nCurrPerformCalls = 0;
  12834. }
  12835. extend( DiscreteActivityBase, ActivityBase );
  12836. DiscreteActivityBase.prototype.activate = function( aEndElement )
  12837. {
  12838. DiscreteActivityBase.superclass.activate.call( this, aEndElement );
  12839. this.aWakeupEvent = this.aOriginalWakeupEvent;
  12840. this.aWakeupEvent.setNextTimeout( 0 );
  12841. this.nCurrPerformCalls = 0;
  12842. };
  12843. DiscreteActivityBase.prototype.startAnimation = function()
  12844. {
  12845. this.aWakeupEvent.start();
  12846. };
  12847. DiscreteActivityBase.prototype.calcFrameIndex = function( nCurrCalls, nVectorSize )
  12848. {
  12849. if( this.isAutoReverse() )
  12850. {
  12851. var nFrameIndex = nCurrCalls % (2 * nVectorSize);
  12852. if( nFrameIndex >= nVectorSize )
  12853. nFrameIndex = 2*nVectorSize - nFrameIndex; // invert sweep
  12854. return nFrameIndex;
  12855. }
  12856. else
  12857. {
  12858. return nCurrCalls % nVectorSize;
  12859. }
  12860. };
  12861. DiscreteActivityBase.prototype.calcRepeatCount = function( nCurrCalls, nVectorSize )
  12862. {
  12863. if( this.isAutoReverse() )
  12864. {
  12865. return Math.floor( nCurrCalls / (2*nVectorSize) ); // we've got 2 cycles per repeat
  12866. }
  12867. else
  12868. {
  12869. return Math.floor( nCurrCalls / nVectorSize );
  12870. }
  12871. };
  12872. DiscreteActivityBase.prototype.performDiscreteHook = function( /*nFrame, nRepeatCount*/ )
  12873. {
  12874. throw ( 'DiscreteActivityBase.performDiscreteHook: abstract method invoked' );
  12875. };
  12876. DiscreteActivityBase.prototype.perform = function()
  12877. {
  12878. if( !SimpleContinuousActivityBase.superclass.perform.call( this ) )
  12879. return false; // done, we're ended
  12880. var nVectorSize = this.aDiscreteTimes.length;
  12881. var nFrameIndex = this.calcFrameIndex(this.nCurrPerformCalls, nVectorSize);
  12882. var nRepeatCount = this.calcRepeatCount( this.nCurrPerformCalls, nVectorSize );
  12883. this.performDiscreteHook( nFrameIndex, nRepeatCount );
  12884. ++this.nCurrPerformCalls;
  12885. var nCurrRepeat = this.nCurrPerformCalls / nVectorSize;
  12886. if( this.isAutoReverse() )
  12887. nCurrRepeat /= 2;
  12888. if( !this.isRepeatCountValid() || nCurrRepeat < this.getRepeatCount() )
  12889. {
  12890. nFrameIndex = this.calcFrameIndex(this.nCurrPerformCalls, nVectorSize);
  12891. var nCurrentRepeatTime = this.aDiscreteTimes[nFrameIndex];
  12892. nRepeatCount = this.calcRepeatCount( this.nCurrPerformCalls, nVectorSize );
  12893. var nNextTimeout = this.nMinSimpleDuration * ( nRepeatCount + this.calcAcceleratedTime( nCurrentRepeatTime ) );
  12894. this.aWakeupEvent.setNextTimeout( nNextTimeout );
  12895. this.getEventQueue().addEvent( this.aWakeupEvent );
  12896. }
  12897. else
  12898. {
  12899. this.aWakeupEvent = null;
  12900. this.endActivity();
  12901. }
  12902. return false; // remove from queue, will be added back by the wakeup event.
  12903. };
  12904. DiscreteActivityBase.prototype.dispose = function()
  12905. {
  12906. if( this.aWakeupEvent )
  12907. this.aWakeupEvent.dispose();
  12908. this.aWakeupEvent = null;
  12909. DiscreteActivityBase.superclass.dispose.call(this);
  12910. };
  12911. function SimpleContinuousActivityBase( aCommonParamSet )
  12912. {
  12913. SimpleContinuousActivityBase.superclass.constructor.call( this, aCommonParamSet );
  12914. this.aTimer = new ElapsedTime( aCommonParamSet.aActivityQueue.getTimer() );
  12915. this.nMinSimpleDuration = aCommonParamSet.nMinDuration;
  12916. this.nMinNumberOfFrames = aCommonParamSet.nMinNumberOfFrames;
  12917. this.nCurrPerformCalls = 0;
  12918. }
  12919. extend( SimpleContinuousActivityBase, ActivityBase );
  12920. SimpleContinuousActivityBase.prototype.startAnimation = function()
  12921. {
  12922. this.aTimer.reset();
  12923. };
  12924. SimpleContinuousActivityBase.prototype.calcTimeLag = function()
  12925. {
  12926. SimpleContinuousActivityBase.superclass.calcTimeLag.call( this );
  12927. if( !this.isActive() )
  12928. return 0.0;
  12929. var nCurrElapsedTime = this.aTimer.getElapsedTime();
  12930. var nFractionElapsedTime = nCurrElapsedTime / this.nMinSimpleDuration;
  12931. var nFractionRequiredCalls = this.nCurrPerformCalls / this.nMinNumberOfFrames;
  12932. if( nFractionElapsedTime < nFractionRequiredCalls )
  12933. {
  12934. return 0.0;
  12935. }
  12936. else
  12937. {
  12938. return ( ( nFractionElapsedTime - nFractionRequiredCalls ) * this.nMinSimpleDuration );
  12939. }
  12940. };
  12941. SimpleContinuousActivityBase.prototype.perform = function()
  12942. {
  12943. if( !SimpleContinuousActivityBase.superclass.perform.call( this ) )
  12944. return false; // done, we're ended
  12945. var nCurrElapsedTime = this.aTimer.getElapsedTime();
  12946. var nT = nCurrElapsedTime / this.nMinSimpleDuration;
  12947. var bActivityEnding = false;
  12948. if( this.isRepeatCountValid() )
  12949. {
  12950. var nRepeatCount = this.getRepeatCount();
  12951. var nEffectiveRepeat = this.isAutoReverse() ? 2.0 * nRepeatCount : nRepeatCount;
  12952. if( nEffectiveRepeat <= nT )
  12953. {
  12954. bActivityEnding = true;
  12955. nT = nEffectiveRepeat;
  12956. }
  12957. }
  12958. var nRepeats;
  12959. var nRelativeSimpleTime;
  12960. if( this.isAutoReverse() )
  12961. {
  12962. nRepeats = Math.floor( nT );
  12963. var nFractionalActiveDuration = nT - nRepeats;
  12964. if( nRepeats % 2 )
  12965. {
  12966. nRelativeSimpleTime = 1.0 - nFractionalActiveDuration;
  12967. }
  12968. else
  12969. {
  12970. nRelativeSimpleTime = nFractionalActiveDuration;
  12971. }
  12972. nRepeats /= 2;
  12973. }
  12974. else
  12975. {
  12976. nRepeats = Math.floor( nT );
  12977. nRelativeSimpleTime = nT - nRepeats;
  12978. if( this.isRepeatCountValid() && ( nRepeats >= this.getRepeatCount() ) )
  12979. {
  12980. nRelativeSimpleTime = 1.0;
  12981. nRepeats -= 1.0;
  12982. }
  12983. }
  12984. this.simplePerform( nRelativeSimpleTime, nRepeats );
  12985. if( bActivityEnding )
  12986. this.endActivity();
  12987. ++this.nCurrPerformCalls;
  12988. return this.isActive();
  12989. };
  12990. SimpleContinuousActivityBase.prototype.simplePerform = function( /*nSimpleTime, nRepeatCount*/ )
  12991. {
  12992. throw ( 'SimpleContinuousActivityBase.simplePerform: abstract method invoked' );
  12993. };
  12994. function ContinuousKeyTimeActivityBase( aCommonParamSet )
  12995. {
  12996. var nSize = aCommonParamSet.aDiscreteTimes.length;
  12997. assert( nSize > 1,
  12998. 'ContinuousKeyTimeActivityBase constructor: assertion (aDiscreteTimes.length > 1) failed' );
  12999. assert( aCommonParamSet.aDiscreteTimes[0] == 0.0,
  13000. 'ContinuousKeyTimeActivityBase constructor: assertion (aDiscreteTimes.front() == 0.0) failed' );
  13001. assert( aCommonParamSet.aDiscreteTimes[ nSize - 1 ] <= 1.0,
  13002. 'ContinuousKeyTimeActivityBase constructor: assertion (aDiscreteTimes.back() <= 1.0) failed' );
  13003. ContinuousKeyTimeActivityBase.superclass.constructor.call( this, aCommonParamSet );
  13004. this.aLerper = new KeyStopLerp( aCommonParamSet.aDiscreteTimes );
  13005. }
  13006. extend( ContinuousKeyTimeActivityBase, SimpleContinuousActivityBase );
  13007. ContinuousKeyTimeActivityBase.prototype.activate = function( aEndElement )
  13008. {
  13009. ContinuousKeyTimeActivityBase.superclass.activate.call( this, aEndElement );
  13010. this.aLerper.reset();
  13011. };
  13012. ContinuousKeyTimeActivityBase.prototype.performContinuousHook = function( /*nIndex, nFractionalIndex, nRepeatCount*/ )
  13013. {
  13014. throw ( 'ContinuousKeyTimeActivityBase.performContinuousHook: abstract method invoked' );
  13015. };
  13016. ContinuousKeyTimeActivityBase.prototype.simplePerform = function( nSimpleTime, nRepeatCount )
  13017. {
  13018. var nAlpha = this.calcAcceleratedTime( nSimpleTime );
  13019. var aLerpResult = this.aLerper.lerp( nAlpha );
  13020. this.performContinuousHook( aLerpResult.nIndex, aLerpResult.nLerp, nRepeatCount );
  13021. };
  13022. function ContinuousActivityBase( aCommonParamSet )
  13023. {
  13024. ContinuousActivityBase.superclass.constructor.call( this, aCommonParamSet );
  13025. }
  13026. extend( ContinuousActivityBase, SimpleContinuousActivityBase );
  13027. ContinuousActivityBase.prototype.performContinuousHook = function( /*nModifiedTime, nRepeatCount*/ )
  13028. {
  13029. throw ( 'ContinuousActivityBase.performContinuousHook: abstract method invoked' );
  13030. };
  13031. ContinuousActivityBase.prototype.simplePerform = function( nSimpleTime, nRepeatCount )
  13032. {
  13033. this.performContinuousHook( this.calcAcceleratedTime( nSimpleTime ), nRepeatCount );
  13034. };
  13035. function SimpleActivity( aCommonParamSet, aNumberAnimation, eDirection )
  13036. {
  13037. assert( ( eDirection == BACKWARD ) || ( eDirection == FORWARD ),
  13038. 'SimpleActivity constructor: animation direction is not valid' );
  13039. assert( aNumberAnimation, 'SimpleActivity constructor: animation object is not valid' );
  13040. SimpleActivity.superclass.constructor.call( this, aCommonParamSet );
  13041. this.aAnimation = aNumberAnimation;
  13042. this.nDirection = ( eDirection == FORWARD ) ? 1.0 : 0.0;
  13043. }
  13044. extend( SimpleActivity, ContinuousActivityBase );
  13045. SimpleActivity.prototype.startAnimation = function()
  13046. {
  13047. if( this.isDisposed() || !this.aAnimation )
  13048. return;
  13049. ANIMDBG.print( 'SimpleActivity.startAnimation invoked' );
  13050. SimpleActivity.superclass.startAnimation.call( this );
  13051. this.aAnimation.start( this.getTargetElement() );
  13052. };
  13053. SimpleActivity.prototype.endAnimation = function()
  13054. {
  13055. if( this.aAnimation )
  13056. this.aAnimation.end();
  13057. };
  13058. SimpleActivity.prototype.performContinuousHook = function( nModifiedTime /*, nRepeatCount*/ )
  13059. {
  13060. if( this.isDisposed() || !this.aAnimation )
  13061. return;
  13062. var nT = 1.0 - this.nDirection + nModifiedTime * ( 2.0*this.nDirection - 1.0 );
  13063. this.aAnimation.perform( nT );
  13064. };
  13065. SimpleActivity.prototype.performEnd = function()
  13066. {
  13067. if( this.aAnimation )
  13068. this.aAnimation.perform( this.nDirection );
  13069. };
  13070. function FromToByActivityTemplate( BaseType ) // template parameter
  13071. {
  13072. function FromToByActivity( aFromValue, aToValue, aByValue,
  13073. aActivityParamSet, aAnimation,
  13074. aInterpolator, aOperatorSet, bAccumulate )
  13075. {
  13076. assert( aAnimation, 'FromToByActivity constructor: invalid animation object' );
  13077. assert( ( aToValue != undefined ) || ( aByValue != undefined ),
  13078. 'FromToByActivity constructor: one of aToValue or aByValue must be valid' );
  13079. FromToByActivity.superclass.constructor.call( this, aActivityParamSet );
  13080. this.aFrom = aFromValue;
  13081. this.aTo = aToValue;
  13082. this.aBy = aByValue;
  13083. this.aStartValue = null;
  13084. this.aEndValue = null;
  13085. this.aPreviousValue = null;
  13086. this.aStartInterpolationValue = null;
  13087. this.aAnimation = aAnimation;
  13088. this.aInterpolator = aInterpolator;
  13089. this.equal = aOperatorSet.equal;
  13090. this.add = aOperatorSet.add;
  13091. this.scale = aOperatorSet.scale;
  13092. this.bDynamicStartValue = false;
  13093. this.nIteration = 0;
  13094. this.bCumulative = bAccumulate;
  13095. this.aFormula = aActivityParamSet.aFormula;
  13096. }
  13097. extend( FromToByActivity, BaseType );
  13098. FromToByActivity.prototype.initAnimatedElement = function()
  13099. {
  13100. if( this.aAnimation && this.aFrom )
  13101. {
  13102. var aValue = this.aFormula ? this.aFormula( this.aFrom ) : this.aFrom;
  13103. this.aAnimation.perform(aValue);
  13104. }
  13105. };
  13106. FromToByActivity.prototype.startAnimation = function()
  13107. {
  13108. if( this.isDisposed() || !this.aAnimation )
  13109. {
  13110. log( 'FromToByActivity.startAnimation: activity disposed or not valid animation' );
  13111. return;
  13112. }
  13113. FromToByActivity.superclass.startAnimation.call( this );
  13114. this.aAnimation.start( this.getTargetElement() );
  13115. var aAnimationStartValue = this.aAnimation.getUnderlyingValue();
  13116. if( this.aFrom )
  13117. {
  13118. if( this.aTo )
  13119. {
  13120. this.aStartValue = this.aFrom;
  13121. this.aEndValue = this.aTo;
  13122. }
  13123. else if( this.aBy )
  13124. {
  13125. this.aStartValue = this.aFrom;
  13126. this.aEndValue = this.add( this.aStartValue, this.aBy );
  13127. }
  13128. }
  13129. else
  13130. {
  13131. this.aStartValue = aAnimationStartValue;
  13132. this.aStartInterpolationValue = this.aStartValue;
  13133. if( this.aTo )
  13134. {
  13135. this.bDynamicStartValue = true;
  13136. this.aPreviousValue = this.aStartValue;
  13137. this.aEndValue = this.aTo;
  13138. }
  13139. else if( this.aBy )
  13140. {
  13141. this.aStartValue = aAnimationStartValue;
  13142. this.aEndValue = this.add( this.aStartValue, this.aBy );
  13143. }
  13144. }
  13145. ANIMDBG.print( 'FromToByActivity.startAnimation: aStartValue = ' + this.aStartValue + ', aEndValue = ' + this.aEndValue );
  13146. };
  13147. FromToByActivity.prototype.endAnimation = function()
  13148. {
  13149. if( this.aAnimation )
  13150. this.aAnimation.end();
  13151. };
  13152. FromToByActivity.prototype.performContinuousHook = function( nModifiedTime, nRepeatCount )
  13153. {
  13154. if( this.isDisposed() || !this.aAnimation )
  13155. {
  13156. log( 'FromToByActivity.performContinuousHook: activity disposed or not valid animation' );
  13157. return;
  13158. }
  13159. if( this.bDynamicStartValue )
  13160. {
  13161. if( this.nIteration != nRepeatCount )
  13162. {
  13163. this.nIteration = nRepeatCount;
  13164. this.aStartInterpolationValue = this.aStartValue;
  13165. }
  13166. else
  13167. {
  13168. var aActualValue = this.aAnimation.getUnderlyingValue();
  13169. if( !this.equal( aActualValue, this.aPreviousValue ) )
  13170. this.aStartInterpolationValue = aActualValue;
  13171. }
  13172. }
  13173. var aValue = this.aInterpolator( this.aStartInterpolationValue,
  13174. this.aEndValue, nModifiedTime );
  13175. if( this.bCumulative && !this.bDynamicStartValue )
  13176. {
  13177. aValue = this.add( this.scale( nRepeatCount, this.aEndValue ), aValue );
  13178. }
  13179. aValue = this.aFormula ? this.aFormula( aValue ) : aValue;
  13180. this.aAnimation.perform( aValue );
  13181. if( this.bDynamicStartValue )
  13182. {
  13183. this.aPreviousValue = this.aAnimation.getUnderlyingValue();
  13184. }
  13185. };
  13186. FromToByActivity.prototype.performDiscreteHook = function( /*nFrame, nRepeatCount*/ )
  13187. {
  13188. if (this.isDisposed() || !this.aAnimation) {
  13189. log('FromToByActivity.performDiscreteHook: activity disposed or not valid animation');
  13190. return;
  13191. }
  13192. };
  13193. FromToByActivity.prototype.performEnd = function()
  13194. {
  13195. if( this.aAnimation )
  13196. {
  13197. var aValue = this.isAutoReverse() ? this.aStartValue : this.aEndValue;
  13198. aValue = this.aFormula ? this.aFormula( aValue ) : aValue;
  13199. this.aAnimation.perform( aValue );
  13200. }
  13201. };
  13202. FromToByActivity.prototype.dispose = function()
  13203. {
  13204. FromToByActivity.superclass.dispose.call( this );
  13205. };
  13206. return FromToByActivity;
  13207. }
  13208. var LinearFromToByActivity = instantiate( FromToByActivityTemplate, ContinuousActivityBase );
  13209. var DiscreteFromToByActivity = instantiate( FromToByActivityTemplate, DiscreteActivityBase );
  13210. function ValueListActivityTemplate( BaseType ) // template parameter
  13211. {
  13212. function ValueListActivity( aValueList, aActivityParamSet,
  13213. aAnimation, aInterpolator,
  13214. aOperatorSet, bAccumulate )
  13215. {
  13216. assert( aAnimation, 'ValueListActivity constructor: invalid animation object' );
  13217. assert( aValueList.length != 0, 'ValueListActivity: value list is empty' );
  13218. ValueListActivity.superclass.constructor.call( this, aActivityParamSet );
  13219. this.aValueList = aValueList;
  13220. this.aAnimation = aAnimation;
  13221. this.aInterpolator = aInterpolator;
  13222. this.add = aOperatorSet.add;
  13223. this.scale = aOperatorSet.scale;
  13224. this.bCumulative = bAccumulate;
  13225. this.aLastValue = this.aValueList[ this.aValueList.length - 1 ];
  13226. this.aFormula = aActivityParamSet.aFormula;
  13227. }
  13228. extend( ValueListActivity, BaseType );
  13229. ValueListActivity.prototype.activate = function( aEndEvent )
  13230. {
  13231. ValueListActivity.superclass.activate.call( this, aEndEvent );
  13232. for( var i = 0; i < this.aValueList.length; ++i )
  13233. {
  13234. ANIMDBG.print( 'createValueListActivity: value[' + i + '] = ' + this.aValueList[i] );
  13235. }
  13236. };
  13237. ValueListActivity.prototype.initAnimatedElement = function()
  13238. {
  13239. if( this.aAnimation )
  13240. {
  13241. var aValue = this.aValueList[0];
  13242. aValue = this.aFormula ? this.aFormula( aValue ) : aValue;
  13243. this.aAnimation.perform(aValue);
  13244. }
  13245. };
  13246. ValueListActivity.prototype.startAnimation = function()
  13247. {
  13248. if( this.isDisposed() || !this.aAnimation )
  13249. {
  13250. log( 'ValueListActivity.startAnimation: activity disposed or not valid animation' );
  13251. return;
  13252. }
  13253. ValueListActivity.superclass.startAnimation.call( this );
  13254. this.aAnimation.start( this.getTargetElement() );
  13255. };
  13256. ValueListActivity.prototype.endAnimation = function()
  13257. {
  13258. if( this.aAnimation )
  13259. this.aAnimation.end();
  13260. };
  13261. ValueListActivity.prototype.performContinuousHook = function( nIndex, nFractionalIndex, nRepeatCount )
  13262. {
  13263. if( this.isDisposed() || !this.aAnimation )
  13264. {
  13265. log( 'ValueListActivity.performContinuousHook: activity disposed or not valid animation' );
  13266. return;
  13267. }
  13268. assert( ( nIndex + 1 ) < this.aValueList.length,
  13269. 'ValueListActivity.performContinuousHook: assertion (nIndex + 1 < this.aValueList.length) failed' );
  13270. var aValue = this.aInterpolator( this.aValueList[ nIndex ],
  13271. this.aValueList[ nIndex+1 ],
  13272. nFractionalIndex );
  13273. if( this.bCumulative )
  13274. {
  13275. aValue = this.add( aValue, this.scale( nRepeatCount, this.aLastValue ) );
  13276. }
  13277. aValue = this.aFormula ? this.aFormula( aValue ) : aValue;
  13278. this.aAnimation.perform( aValue );
  13279. };
  13280. ValueListActivity.prototype.performDiscreteHook = function( nFrame, nRepeatCount )
  13281. {
  13282. if( this.isDisposed() || !this.aAnimation )
  13283. {
  13284. log( 'ValueListActivity.performDiscreteHook: activity disposed or not valid animation' );
  13285. return;
  13286. }
  13287. assert( nFrame < this.aValueList.length,
  13288. 'ValueListActivity.performDiscreteHook: assertion ( nFrame < this.aValueList.length) failed' );
  13289. var aValue = this.aValueList[nFrame];
  13290. if( this.bCumulative )
  13291. {
  13292. aValue = this.add( aValue, this.scale( nRepeatCount, this.aLastValue ) );
  13293. }
  13294. aValue = this.aFormula ? this.aFormula( aValue ) : aValue;
  13295. this.aAnimation.perform( aValue );
  13296. };
  13297. ValueListActivity.prototype.performEnd = function()
  13298. {
  13299. if( this.aAnimation )
  13300. {
  13301. var aValue = this.aFormula ? this.aFormula( this.aLastValue ) : this.aLastValue;
  13302. this.aAnimation.perform( aValue );
  13303. }
  13304. };
  13305. ValueListActivity.prototype.dispose = function()
  13306. {
  13307. ValueListActivity.superclass.dispose.call( this );
  13308. };
  13309. return ValueListActivity;
  13310. }
  13311. var LinearValueListActivity = instantiate( ValueListActivityTemplate, ContinuousKeyTimeActivityBase );
  13312. var DiscreteValueListActivity = instantiate( ValueListActivityTemplate, DiscreteActivityBase );
  13313. function createActivity( aActivityParamSet, aAnimationNode, aAnimation, aInterpolator )
  13314. {
  13315. var eCalcMode = aAnimationNode.getCalcMode();
  13316. var sAttributeName = aAnimationNode.getAttributeName();
  13317. var aAttributeProp = aAttributeMap[ sAttributeName ];
  13318. var eValueType = aAttributeProp[ 'type' ];
  13319. var eValueSubtype = aAttributeProp[ 'subtype' ];
  13320. if( ! aInterpolator )
  13321. {
  13322. aInterpolator = aInterpolatorHandler.getInterpolator( eCalcMode,
  13323. eValueType,
  13324. eValueSubtype );
  13325. }
  13326. var bAccumulate = ( aAnimationNode.getAccumulate() === ACCUMULATE_MODE_SUM )
  13327. && !( eValueType === BOOL_PROPERTY ||
  13328. eValueType === STRING_PROPERTY ||
  13329. eValueType === ENUM_PROPERTY );
  13330. if( aAnimationNode.getFormula() )
  13331. {
  13332. var sFormula = aAnimationNode.getFormula();
  13333. var reMath = /abs|sqrt|asin|acos|atan|sin|cos|tan|exp|log|min|max/g;
  13334. sFormula = sFormula.replace(reMath, 'Math.$&');
  13335. sFormula = sFormula.replace(/pi(?!\w)/g, 'Math.PI');
  13336. sFormula = sFormula.replace(/e(?!\w)/g, 'Math.E');
  13337. sFormula = sFormula.replace(/\$/g, '__PARAM0__');
  13338. var aAnimatedElement = aAnimationNode.getAnimatedElement();
  13339. var aBBox = aAnimatedElement.getBaseBBox();
  13340. var width = aBBox.width / aActivityParamSet.nSlideWidth;
  13341. var height = aBBox.height / aActivityParamSet.nSlideHeight;
  13342. var x = ( aBBox.x + aBBox.width / 2 ) / aActivityParamSet.nSlideWidth;
  13343. var y = ( aBBox.y + aBBox.height / 2 ) / aActivityParamSet.nSlideHeight;
  13344. aActivityParamSet.aFormula = function( __PARAM0__ ) {
  13345. return eval(sFormula);
  13346. };
  13347. }
  13348. aActivityParamSet.aDiscreteTimes = aAnimationNode.getKeyTimes();
  13349. var aValueSet = aAnimationNode.getValues();
  13350. var nValueSetSize = aValueSet.length;
  13351. if( nValueSetSize != 0 )
  13352. {
  13353. if( aActivityParamSet.aDiscreteTimes.length == 0 )
  13354. {
  13355. for( var i = 0; i < nValueSetSize; ++i )
  13356. aActivityParamSet.aDiscreteTimes[i].push( i / nValueSetSize );
  13357. }
  13358. switch( eCalcMode )
  13359. {
  13360. case CALC_MODE_DISCRETE:
  13361. aActivityParamSet.aWakeupEvent =
  13362. new WakeupEvent( aActivityParamSet.aTimerEventQueue.getTimer(),
  13363. aActivityParamSet.aActivityQueue );
  13364. return createValueListActivity( aActivityParamSet,
  13365. aAnimationNode,
  13366. aAnimation,
  13367. aInterpolator,
  13368. DiscreteValueListActivity,
  13369. bAccumulate,
  13370. eValueType );
  13371. default:
  13372. log( 'createActivity: unexpected calculation mode: ' + eCalcMode );
  13373. case CALC_MODE_PACED :
  13374. case CALC_MODE_SPLINE :
  13375. case CALC_MODE_LINEAR:
  13376. return createValueListActivity( aActivityParamSet,
  13377. aAnimationNode,
  13378. aAnimation,
  13379. aInterpolator,
  13380. LinearValueListActivity,
  13381. bAccumulate,
  13382. eValueType );
  13383. }
  13384. }
  13385. else
  13386. {
  13387. switch( eCalcMode )
  13388. {
  13389. case CALC_MODE_DISCRETE:
  13390. log( 'createActivity: discrete calculation case not yet implemented' );
  13391. aActivityParamSet.aWakeupEvent =
  13392. new WakeupEvent( aActivityParamSet.aTimerEventQueue.getTimer(),
  13393. aActivityParamSet.aActivityQueue );
  13394. return createFromToByActivity( aActivityParamSet,
  13395. aAnimationNode,
  13396. aAnimation,
  13397. aInterpolator,
  13398. DiscreteFromToByActivity,
  13399. bAccumulate,
  13400. eValueType );
  13401. default:
  13402. log( 'createActivity: unexpected calculation mode: ' + eCalcMode );
  13403. case CALC_MODE_PACED :
  13404. case CALC_MODE_SPLINE :
  13405. case CALC_MODE_LINEAR:
  13406. return createFromToByActivity( aActivityParamSet,
  13407. aAnimationNode,
  13408. aAnimation,
  13409. aInterpolator,
  13410. LinearFromToByActivity,
  13411. bAccumulate,
  13412. eValueType );
  13413. }
  13414. }
  13415. }
  13416. function createValueListActivity( aActivityParamSet, aAnimationNode, aAnimation,
  13417. aInterpolator, ClassTemplateInstance, bAccumulate, eValueType )
  13418. {
  13419. var aAnimatedElement = aAnimationNode.getAnimatedElement();
  13420. var aOperatorSet = aOperatorSetMap[ eValueType ];
  13421. assert( aOperatorSet, 'createValueListActivity: no operator set found' );
  13422. var aValueSet = aAnimationNode.getValues();
  13423. var aValueList = [];
  13424. extractAttributeValues( eValueType,
  13425. aValueList,
  13426. aValueSet,
  13427. aAnimatedElement.getBaseBBox(),
  13428. aActivityParamSet.nSlideWidth,
  13429. aActivityParamSet.nSlideHeight );
  13430. for( var i = 0; i < aValueList.length; ++i )
  13431. {
  13432. ANIMDBG.print( 'createValueListActivity: value[' + i + '] = ' + aValueList[i] );
  13433. }
  13434. return new ClassTemplateInstance( aValueList, aActivityParamSet, aAnimation,
  13435. aInterpolator, aOperatorSet, bAccumulate );
  13436. }
  13437. function createFromToByActivity( aActivityParamSet, aAnimationNode, aAnimation,
  13438. aInterpolator, ClassTemplateInstance, bAccumulate, eValueType )
  13439. {
  13440. var aAnimatedElement = aAnimationNode.getAnimatedElement();
  13441. var aOperatorSet = aOperatorSetMap[ eValueType ];
  13442. assert( aOperatorSet, 'createFromToByActivity: no operator set found' );
  13443. var aValueSet = [];
  13444. aValueSet[0] = aAnimationNode.getFromValue();
  13445. aValueSet[1] = aAnimationNode.getToValue();
  13446. aValueSet[2] = aAnimationNode.getByValue();
  13447. ANIMDBG.print( 'createFromToByActivity: value type: ' + aValueTypeOutMap[eValueType] +
  13448. ', aFrom = ' + aValueSet[0] +
  13449. ', aTo = ' + aValueSet[1] +
  13450. ', aBy = ' + aValueSet[2] );
  13451. var aValueList = [];
  13452. extractAttributeValues( eValueType,
  13453. aValueList,
  13454. aValueSet,
  13455. aAnimatedElement.getBaseBBox(),
  13456. aActivityParamSet.nSlideWidth,
  13457. aActivityParamSet.nSlideHeight );
  13458. ANIMDBG.print( 'createFromToByActivity: ' +
  13459. ', aFrom = ' + aValueList[0] +
  13460. ', aTo = ' + aValueList[1] +
  13461. ', aBy = ' + aValueList[2] );
  13462. return new ClassTemplateInstance( aValueList[0], aValueList[1], aValueList[2],
  13463. aActivityParamSet, aAnimation,
  13464. aInterpolator, aOperatorSet, bAccumulate );
  13465. }
  13466. function extractAttributeValues( eValueType, aValueList, aValueSet, aBBox, nSlideWidth, nSlideHeight )
  13467. {
  13468. var i;
  13469. switch( eValueType )
  13470. {
  13471. case NUMBER_PROPERTY :
  13472. evalValuesAttribute( aValueList, aValueSet, aBBox, nSlideWidth, nSlideHeight );
  13473. break;
  13474. case BOOL_PROPERTY :
  13475. for( i = 0; i < aValueSet.length; ++i )
  13476. {
  13477. var aValue = booleanParser( aValueSet[i] );
  13478. aValueList.push( aValue );
  13479. }
  13480. break;
  13481. case STRING_PROPERTY :
  13482. for( i = 0; i < aValueSet.length; ++i )
  13483. {
  13484. aValueList.push( aValueSet[i] );
  13485. }
  13486. break;
  13487. case ENUM_PROPERTY :
  13488. for( i = 0; i < aValueSet.length; ++i )
  13489. {
  13490. aValueList.push( aValueSet[i] );
  13491. }
  13492. break;
  13493. case COLOR_PROPERTY :
  13494. for( i = 0; i < aValueSet.length; ++i )
  13495. {
  13496. aValue = colorParser( aValueSet[i] );
  13497. aValueList.push( aValue );
  13498. }
  13499. break;
  13500. case TUPLE_NUMBER_PROPERTY :
  13501. for( i = 0; i < aValueSet.length; ++i )
  13502. {
  13503. if( typeof aValueSet[i] === 'string' )
  13504. {
  13505. var aTuple = aValueSet[i].split(',');
  13506. aValue = [];
  13507. evalValuesAttribute(aValue, aTuple, aBBox, nSlideWidth, nSlideHeight);
  13508. aValueList.push(aValue);
  13509. }
  13510. else
  13511. {
  13512. aValueList.push( undefined );
  13513. }
  13514. }
  13515. break;
  13516. default:
  13517. log( 'createValueListActivity: unexpected value type: ' + eValueType );
  13518. }
  13519. }
  13520. function evalValuesAttribute( aValueList, aValueSet, aBBox, nSlideWidth, nSlideHeight )
  13521. {
  13522. var width = aBBox.width / nSlideWidth;
  13523. var height = aBBox.height / nSlideHeight;
  13524. var x = ( aBBox.x + aBBox.width / 2 ) / nSlideWidth;
  13525. var y = ( aBBox.y + aBBox.height / 2 ) / nSlideHeight;
  13526. var reMath = /abs|sqrt|asin|acos|atan|sin|cos|tan|exp|log|min|max/g;
  13527. for( var i = 0; i < aValueSet.length; ++i )
  13528. {
  13529. var sValue = aValueSet[i];
  13530. if(sValue)
  13531. {
  13532. sValue = sValue.replace(reMath, 'Math.$&');
  13533. sValue = sValue.replace(/pi(?!\w)/g, 'Math.PI');
  13534. sValue = sValue.replace(/e(?!\w)/g, 'Math.E');
  13535. }
  13536. var aValue = eval( sValue );
  13537. aValueList.push( aValue );
  13538. }
  13539. }
  13540. var BACKWARD = 0;
  13541. var FORWARD = 1;
  13542. var MAXIMUM_FRAME_COUNT = 60;
  13543. var MINIMUM_TIMEOUT = 1.0 / MAXIMUM_FRAME_COUNT;
  13544. var MAXIMUM_TIMEOUT = 4.0;
  13545. var MINIMUM_FRAMES_PER_SECONDS = 10;
  13546. var PREFERRED_FRAMES_PER_SECONDS = 50;
  13547. var PREFERRED_FRAME_RATE = 1.0 / PREFERRED_FRAMES_PER_SECONDS;
  13548. function Effect( nId )
  13549. {
  13550. this.nId = ( typeof( nId ) === typeof( 1 ) ) ? nId : -1;
  13551. this.eState = Effect.NOT_STARTED;
  13552. }
  13553. Effect.NOT_STARTED = 0;
  13554. Effect.PLAYING = 1;
  13555. Effect.ENDED = 2;
  13556. Effect.prototype.getId = function()
  13557. {
  13558. return this.nId;
  13559. };
  13560. Effect.prototype.isMainEffect = function()
  13561. {
  13562. return ( this.nId === -1 );
  13563. };
  13564. Effect.prototype.isPlaying = function()
  13565. {
  13566. return ( this.eState === Effect.PLAYING );
  13567. };
  13568. Effect.prototype.isEnded = function()
  13569. {
  13570. return ( this.eState === Effect.ENDED );
  13571. };
  13572. Effect.prototype.start = function()
  13573. {
  13574. assert( this.eState === Effect.NOT_STARTED, 'Effect.start: wrong state.' );
  13575. this.eState = Effect.PLAYING;
  13576. };
  13577. Effect.prototype.end = function()
  13578. {
  13579. assert( this.eState === Effect.PLAYING, 'Effect.end: wrong state.' );
  13580. this.eState = Effect.ENDED;
  13581. };
  13582. function SlideShow()
  13583. {
  13584. this.aTimer = new ElapsedTime();
  13585. this.aFrameSynchronization = new FrameSynchronization( PREFERRED_FRAME_RATE );
  13586. this.aTimerEventQueue = new TimerEventQueue( this.aTimer );
  13587. this.aActivityQueue = new ActivityQueue( this.aTimer );
  13588. this.aNextEffectEventArray = null;
  13589. this.aInteractiveAnimationSequenceMap = null;
  13590. this.aEventMultiplexer = null;
  13591. this.aContext = new SlideShowContext( this.aTimerEventQueue,
  13592. this.aEventMultiplexer,
  13593. this.aNextEffectEventArray,
  13594. this.aInteractiveAnimationSequenceMap,
  13595. this.aActivityQueue );
  13596. this.bIsIdle = true;
  13597. this.bIsEnabled = true;
  13598. this.bNoSlideTransition = false;
  13599. this.bIsTransitionRunning = false;
  13600. this.nCurrentEffect = 0;
  13601. this.bIsNextEffectRunning = false;
  13602. this.bIsRewinding = false;
  13603. this.bIsSkipping = false;
  13604. this.bIsSkippingAll = false;
  13605. this.nTotalInteractivePlayingEffects = 0;
  13606. this.aStartedEffectList = [];
  13607. this.aStartedEffectIndexMap = {};
  13608. this.aStartedEffectIndexMap[ -1 ] = undefined;
  13609. this.automaticAdvanceTimeout = null;
  13610. }
  13611. SlideShow.prototype.setSlideEvents = function( aNextEffectEventArray,
  13612. aInteractiveAnimationSequenceMap,
  13613. aEventMultiplexer )
  13614. {
  13615. if( !aNextEffectEventArray )
  13616. log( 'SlideShow.setSlideEvents: aNextEffectEventArray is not valid' );
  13617. if( !aInteractiveAnimationSequenceMap )
  13618. log( 'SlideShow.setSlideEvents:aInteractiveAnimationSequenceMap is not valid' );
  13619. if( !aEventMultiplexer )
  13620. log( 'SlideShow.setSlideEvents: aEventMultiplexer is not valid' );
  13621. this.aContext.aNextEffectEventArray = aNextEffectEventArray;
  13622. this.aNextEffectEventArray = aNextEffectEventArray;
  13623. this.aContext.aInteractiveAnimationSequenceMap = aInteractiveAnimationSequenceMap;
  13624. this.aInteractiveAnimationSequenceMap = aInteractiveAnimationSequenceMap;
  13625. this.aContext.aEventMultiplexer = aEventMultiplexer;
  13626. this.aEventMultiplexer = aEventMultiplexer;
  13627. this.nCurrentEffect = 0;
  13628. };
  13629. SlideShow.prototype.createSlideTransition = function( aSlideTransitionHandler, aLeavingSlide, aEnteringSlide, aTransitionEndEvent )
  13630. {
  13631. if( !aEnteringSlide )
  13632. {
  13633. log( 'SlideShow.createSlideTransition: entering slide element is not valid.' );
  13634. return null;
  13635. }
  13636. if( this.bNoSlideTransition ) return null;
  13637. var aAnimatedLeavingSlide = null;
  13638. if( aLeavingSlide )
  13639. aAnimatedLeavingSlide = new AnimatedSlide( aLeavingSlide );
  13640. var aAnimatedEnteringSlide = new AnimatedSlide( aEnteringSlide );
  13641. var aSlideTransition = aSlideTransitionHandler.createSlideTransition( aAnimatedLeavingSlide, aAnimatedEnteringSlide );
  13642. if( !aSlideTransition ) return null;
  13643. var nDuration = 0.001;
  13644. if( aSlideTransitionHandler.getDuration().isValue() )
  13645. {
  13646. nDuration = aSlideTransitionHandler.getDuration().getValue();
  13647. }
  13648. else
  13649. {
  13650. log( 'SlideShow.createSlideTransition: duration is not a number' );
  13651. }
  13652. var aCommonParameterSet = new ActivityParamSet();
  13653. aCommonParameterSet.aEndEvent = aTransitionEndEvent;
  13654. aCommonParameterSet.aTimerEventQueue = this.aTimerEventQueue;
  13655. aCommonParameterSet.aActivityQueue = this.aActivityQueue;
  13656. aCommonParameterSet.nMinDuration = nDuration;
  13657. aCommonParameterSet.nMinNumberOfFrames = aSlideTransitionHandler.getMinFrameCount();
  13658. aCommonParameterSet.nSlideWidth = WIDTH;
  13659. aCommonParameterSet.nSlideHeight = HEIGHT;
  13660. return new SimpleActivity( aCommonParameterSet, aSlideTransition, FORWARD );
  13661. };
  13662. SlideShow.prototype.isEnabled = function()
  13663. {
  13664. return this.bIsEnabled;
  13665. };
  13666. SlideShow.prototype.isRunning = function()
  13667. {
  13668. return !this.bIsIdle;
  13669. };
  13670. SlideShow.prototype.isTransitionPlaying = function()
  13671. {
  13672. return this.bIsTransitionRunning;
  13673. };
  13674. SlideShow.prototype.isMainEffectPlaying = function()
  13675. {
  13676. return this.bIsNextEffectRunning;
  13677. };
  13678. SlideShow.prototype.isInteractiveEffectPlaying = function()
  13679. {
  13680. return ( this.nTotalInteractivePlayingEffects > 0 );
  13681. };
  13682. SlideShow.prototype.isAnyEffectPlaying = function()
  13683. {
  13684. return ( this.isMainEffectPlaying() || this.isInteractiveEffectPlaying() );
  13685. };
  13686. SlideShow.prototype.hasAnyEffectStarted = function()
  13687. {
  13688. return ( this.aStartedEffectList.length > 0 );
  13689. };
  13690. SlideShow.prototype.notifyNextEffectStart = function()
  13691. {
  13692. assert( !this.bIsNextEffectRunning,
  13693. 'SlideShow.notifyNextEffectStart: an effect is already started.' );
  13694. this.bIsNextEffectRunning = true;
  13695. this.aEventMultiplexer.registerNextEffectEndHandler( bind2( SlideShow.prototype.notifyNextEffectEnd, this ) );
  13696. var aEffect = new Effect();
  13697. aEffect.start();
  13698. this.aStartedEffectIndexMap[ -1 ] = this.aStartedEffectList.length;
  13699. this.aStartedEffectList.push( aEffect );
  13700. var aAnimatedElementMap = theMetaDoc.aMetaSlideSet[nCurSlide].aSlideAnimationsHandler.aAnimatedElementMap;
  13701. for( var sId in aAnimatedElementMap )
  13702. aAnimatedElementMap[ sId ].notifyNextEffectStart( this.nCurrentEffect );
  13703. };
  13704. SlideShow.prototype.notifyNextEffectEnd = function()
  13705. {
  13706. assert( this.bIsNextEffectRunning,
  13707. 'SlideShow.notifyNextEffectEnd: effect already ended.' );
  13708. this.bIsNextEffectRunning = false;
  13709. this.aStartedEffectList[ this.aStartedEffectIndexMap[ -1 ] ].end();
  13710. if( this.automaticAdvanceTimeout !== null )
  13711. {
  13712. if( this.automaticAdvanceTimeout['rewindedEffect'] === this.nCurrentEffect )
  13713. {
  13714. this.automaticAdvanceTimeout = null;
  13715. this.notifyAnimationsEnd();
  13716. }
  13717. }
  13718. };
  13719. SlideShow.prototype.notifyAnimationsEnd = function()
  13720. {
  13721. if( nCurSlide + 1 === theMetaDoc.nNumberOfSlides )
  13722. return;
  13723. assert (this.automaticAdvanceTimeout === null,
  13724. 'SlideShow.notifyAnimationsEnd: Timeout already set.')
  13725. var nTimeout = Math.ceil(theMetaDoc.aMetaSlideSet[nCurSlide].fDuration * 1000);
  13726. if( nTimeout < 0 )
  13727. return;
  13728. this.automaticAdvanceTimeout = window.setTimeout('switchSlide(1, false)', nTimeout);
  13729. };
  13730. SlideShow.prototype.notifySlideStart = function( nNewSlideIndex, nOldSlideIndex )
  13731. {
  13732. this.nCurrentEffect = 0;
  13733. this.bIsRewinding = false;
  13734. this.bIsSkipping = false;
  13735. this.bIsSkippingAll = false;
  13736. this.nTotalInteractivePlayingEffects = 0;
  13737. this.aStartedEffectList = [];
  13738. this.aStartedEffectIndexMap = {};
  13739. this.aStartedEffectIndexMap[ -1 ] = undefined;
  13740. var aAnimatedElementMap;
  13741. var sId;
  13742. if( nOldSlideIndex !== undefined )
  13743. {
  13744. aAnimatedElementMap = theMetaDoc.aMetaSlideSet[nOldSlideIndex].aSlideAnimationsHandler.aAnimatedElementMap;
  13745. for( sId in aAnimatedElementMap )
  13746. aAnimatedElementMap[ sId ].notifySlideEnd();
  13747. }
  13748. aAnimatedElementMap = theMetaDoc.aMetaSlideSet[nNewSlideIndex].aSlideAnimationsHandler.aAnimatedElementMap;
  13749. for( sId in aAnimatedElementMap )
  13750. aAnimatedElementMap[ sId ].notifySlideStart( this.aContext );
  13751. };
  13752. SlideShow.prototype.notifyTransitionEnd = function( nSlideIndex )
  13753. {
  13754. if( theMetaDoc.getCurrentSlide() )
  13755. {
  13756. var sRef = 'url(#' + aPresentationClipPathId + ')';
  13757. theMetaDoc.getCurrentSlide().slideElement.setAttribute('clip-path', sRef);
  13758. }
  13759. this.bIsTransitionRunning = false;
  13760. if( this.bIsRewinding )
  13761. {
  13762. theMetaDoc.aMetaSlideSet[nSlideIndex].hide();
  13763. var nIndex = nCurSlide !== undefined ? nCurSlide : -1;
  13764. this.displaySlide( nIndex, true );
  13765. this.skipAllEffects();
  13766. this.bIsRewinding = false;
  13767. return;
  13768. }
  13769. theMetaDoc.setCurrentSlide(nSlideIndex);
  13770. if( this.aSlideViewElement )
  13771. {
  13772. theMetaDoc.getCurrentSlide().aVisibilityStatusElement.parentNode.removeChild( this.aSlideViewElement );
  13773. this.aSlideViewElement = null;
  13774. }
  13775. if( this.isEnabled() )
  13776. {
  13777. this.dispose();
  13778. var aCurrentSlide = theMetaDoc.getCurrentSlide();
  13779. if( aCurrentSlide.aSlideAnimationsHandler.elementsParsed() )
  13780. {
  13781. aCurrentSlide.aSlideAnimationsHandler.start();
  13782. this.aEventMultiplexer.registerAnimationsEndHandler( bind2( SlideShow.prototype.notifyAnimationsEnd, this ) );
  13783. }
  13784. else
  13785. this.notifyAnimationsEnd();
  13786. this.update();
  13787. }
  13788. else
  13789. this.notifyAnimationsEnd();
  13790. };
  13791. SlideShow.prototype.notifyInteractiveAnimationSequenceStart = function( nNodeId )
  13792. {
  13793. ++this.nTotalInteractivePlayingEffects;
  13794. var aEffect = new Effect( nNodeId );
  13795. aEffect.start();
  13796. this.aStartedEffectIndexMap[ nNodeId ] = this.aStartedEffectList.length;
  13797. this.aStartedEffectList.push( aEffect );
  13798. };
  13799. SlideShow.prototype.notifyInteractiveAnimationSequenceEnd = function( nNodeId )
  13800. {
  13801. assert( this.isInteractiveEffectPlaying(),
  13802. 'SlideShow.notifyInteractiveAnimationSequenceEnd: no interactive effect playing.' );
  13803. this.aStartedEffectList[ this.aStartedEffectIndexMap[ nNodeId ] ].end();
  13804. --this.nTotalInteractivePlayingEffects;
  13805. };
  13806. SlideShow.prototype.nextEffect = function()
  13807. {
  13808. if( !this.isEnabled() )
  13809. return false;
  13810. if( this.isTransitionPlaying() )
  13811. {
  13812. this.skipTransition();
  13813. return true;
  13814. }
  13815. if( this.isAnyEffectPlaying() )
  13816. {
  13817. this.skipAllPlayingEffects();
  13818. return true;
  13819. }
  13820. if( !this.aNextEffectEventArray )
  13821. return false;
  13822. if( this.nCurrentEffect >= this.aNextEffectEventArray.size() )
  13823. return false;
  13824. this.notifyNextEffectStart();
  13825. this.aNextEffectEventArray.at( this.nCurrentEffect ).fire();
  13826. ++this.nCurrentEffect;
  13827. this.update();
  13828. return true;
  13829. };
  13830. SlideShow.prototype.skipTransition = function()
  13831. {
  13832. if( this.bIsSkipping || this.bIsRewinding )
  13833. return;
  13834. this.bIsSkipping = true;
  13835. this.aActivityQueue.endAll();
  13836. this.aTimerEventQueue.forceEmpty();
  13837. this.aActivityQueue.endAll();
  13838. this.update();
  13839. this.bIsSkipping = false;
  13840. };
  13841. SlideShow.prototype.skipAllPlayingEffects = function()
  13842. {
  13843. if( this.bIsSkipping || this.bIsRewinding )
  13844. return true;
  13845. this.bIsSkipping = true;
  13846. for( var i = 0; i < this.aStartedEffectList.length; ++i )
  13847. {
  13848. var aEffect = this.aStartedEffectList[i];
  13849. if( aEffect.isPlaying() )
  13850. {
  13851. if( aEffect.isMainEffect() )
  13852. this.aEventMultiplexer.notifySkipEffectEvent();
  13853. else
  13854. this.aEventMultiplexer.notifySkipInteractiveEffectEvent( aEffect.getId() );
  13855. }
  13856. }
  13857. this.update();
  13858. this.bIsSkipping = false;
  13859. return true;
  13860. };
  13861. SlideShow.prototype.skipNextEffect = function()
  13862. {
  13863. if( this.bIsSkipping || this.bIsRewinding )
  13864. return true;
  13865. assert( !this.isAnyEffectPlaying(),
  13866. 'SlideShow.skipNextEffect' );
  13867. if( !this.aNextEffectEventArray )
  13868. return false;
  13869. if( this.nCurrentEffect >= this.aNextEffectEventArray.size() )
  13870. return false;
  13871. this.notifyNextEffectStart();
  13872. this.bIsSkipping = true;
  13873. this.aNextEffectEventArray.at( this.nCurrentEffect ).fire();
  13874. this.aEventMultiplexer.notifySkipEffectEvent();
  13875. ++this.nCurrentEffect;
  13876. this.update();
  13877. this.bIsSkipping = false;
  13878. return true;
  13879. };
  13880. SlideShow.prototype.skipPlayingOrNextEffect = function()
  13881. {
  13882. if( this.isTransitionPlaying() )
  13883. {
  13884. this.skipTransition();
  13885. return true;
  13886. }
  13887. if( this.isAnyEffectPlaying() )
  13888. return this.skipAllPlayingEffects();
  13889. else
  13890. return this.skipNextEffect();
  13891. };
  13892. SlideShow.prototype.skipAllEffects = function()
  13893. {
  13894. if( this.bIsSkippingAll )
  13895. return true;
  13896. this.bIsSkippingAll = true;
  13897. if( this.isTransitionPlaying() )
  13898. {
  13899. this.skipTransition();
  13900. }
  13901. if( this.isAnyEffectPlaying() )
  13902. {
  13903. this.skipAllPlayingEffects();
  13904. }
  13905. else if( !this.aNextEffectEventArray
  13906. || ( this.nCurrentEffect >= this.aNextEffectEventArray.size() ) )
  13907. {
  13908. this.bIsSkippingAll = false;
  13909. return false;
  13910. }
  13911. while( this.nCurrentEffect < this.aNextEffectEventArray.size() )
  13912. {
  13913. this.skipNextEffect();
  13914. }
  13915. this.bIsSkippingAll = false;
  13916. return true;
  13917. };
  13918. SlideShow.prototype.rewindTransition = function()
  13919. {
  13920. if( this.bIsSkipping || this.bIsRewinding )
  13921. return;
  13922. this.bIsRewinding = true;
  13923. this.aActivityQueue.endAll();
  13924. this.update();
  13925. this.bIsRewinding = false;
  13926. };
  13927. SlideShow.prototype.rewindEffect = function()
  13928. {
  13929. if( this.bIsSkipping || this.bIsRewinding )
  13930. return;
  13931. if( this.automaticAdvanceTimeout !== null && !this.automaticAdvanceTimeout['rewindedEffect'] )
  13932. {
  13933. window.clearTimeout( this.automaticAdvanceTimeout );
  13934. this.automaticAdvanceTimeout = { 'rewindedEffect': this.nCurrentEffect };
  13935. }
  13936. if( !this.hasAnyEffectStarted() )
  13937. {
  13938. this.rewindToPreviousSlide();
  13939. return;
  13940. }
  13941. this.bIsRewinding = true;
  13942. var nFirstPlayingEffectIndex = undefined;
  13943. var i = 0;
  13944. for( ; i < this.aStartedEffectList.length; ++i )
  13945. {
  13946. var aEffect = this.aStartedEffectList[i];
  13947. if( aEffect.isPlaying() )
  13948. {
  13949. nFirstPlayingEffectIndex = i;
  13950. break;
  13951. }
  13952. }
  13953. if( nFirstPlayingEffectIndex !== undefined )
  13954. {
  13955. i = this.aStartedEffectList.length - 1;
  13956. for( ; i >= nFirstPlayingEffectIndex; --i )
  13957. {
  13958. aEffect = this.aStartedEffectList[i];
  13959. if( aEffect.isPlaying() )
  13960. {
  13961. if( aEffect.isMainEffect() )
  13962. {
  13963. this.aEventMultiplexer.notifyRewindCurrentEffectEvent();
  13964. if( this.nCurrentEffect > 0 )
  13965. --this.nCurrentEffect;
  13966. }
  13967. else
  13968. {
  13969. this.aEventMultiplexer.notifyRewindRunningInteractiveEffectEvent( aEffect.getId() );
  13970. }
  13971. }
  13972. else if( aEffect.isEnded() )
  13973. {
  13974. if( aEffect.isMainEffect() )
  13975. {
  13976. this.aEventMultiplexer.notifyRewindLastEffectEvent();
  13977. if( this.nCurrentEffect > 0 )
  13978. --this.nCurrentEffect;
  13979. }
  13980. else
  13981. {
  13982. this.aEventMultiplexer.notifyRewindEndedInteractiveEffectEvent( aEffect.getId() );
  13983. }
  13984. }
  13985. }
  13986. this.update();
  13987. i = this.aStartedEffectList.length - 1;
  13988. for( ; i >= nFirstPlayingEffectIndex; --i )
  13989. {
  13990. aEffect = this.aStartedEffectList.pop();
  13991. if( !aEffect.isMainEffect() )
  13992. delete this.aStartedEffectIndexMap[ aEffect.getId() ];
  13993. }
  13994. }
  13995. else // there is no playing effect
  13996. {
  13997. aEffect = this.aStartedEffectList.pop();
  13998. if( !aEffect.isMainEffect() )
  13999. delete this.aStartedEffectIndexMap[ aEffect.getId() ];
  14000. if( aEffect.isEnded() ) // Well that is almost an assertion.
  14001. {
  14002. if( aEffect.isMainEffect() )
  14003. {
  14004. this.aEventMultiplexer.notifyRewindLastEffectEvent();
  14005. if( this.nCurrentEffect > 0 )
  14006. --this.nCurrentEffect;
  14007. }
  14008. else
  14009. {
  14010. this.aEventMultiplexer.notifyRewindEndedInteractiveEffectEvent( aEffect.getId() );
  14011. }
  14012. }
  14013. this.update();
  14014. }
  14015. this.bIsRewinding = false;
  14016. };
  14017. SlideShow.prototype.rewindToPreviousSlide = function()
  14018. {
  14019. if( this.isTransitionPlaying() )
  14020. {
  14021. this.rewindTransition();
  14022. return;
  14023. }
  14024. if( this.isAnyEffectPlaying() )
  14025. return;
  14026. var nNewSlide = nCurSlide - 1;
  14027. this.displaySlide( nNewSlide, true );
  14028. this.skipAllEffects();
  14029. };
  14030. SlideShow.prototype.rewindAllEffects = function()
  14031. {
  14032. if( !this.hasAnyEffectStarted() )
  14033. {
  14034. this.rewindToPreviousSlide();
  14035. return;
  14036. }
  14037. while( this.hasAnyEffectStarted() )
  14038. {
  14039. this.rewindEffect();
  14040. }
  14041. };
  14042. SlideShow.prototype.exitSlideShowInApp = function()
  14043. {
  14044. if (window.webkit !== undefined &&
  14045. window.webkit.messageHandlers !== undefined &&
  14046. window.webkit.messageHandlers.lok !== undefined)
  14047. window.webkit.messageHandlers.lok.postMessage('EXITSLIDESHOW', '*');
  14048. }
  14049. SlideShow.prototype.displaySlide = function( nNewSlide, bSkipSlideTransition )
  14050. {
  14051. var aMetaDoc = theMetaDoc;
  14052. var nSlides = aMetaDoc.nNumberOfSlides;
  14053. if( nNewSlide < 0 && nSlides > 0 )
  14054. nNewSlide = nSlides - 1;
  14055. else if( nNewSlide >= nSlides ) {
  14056. nNewSlide = 0;
  14057. this.exitSlideShowInApp();
  14058. }
  14059. if( ( currentMode === INDEX_MODE ) && ( nNewSlide === nCurSlide ) )
  14060. {
  14061. aMetaDoc.getCurrentSlide().show();
  14062. return;
  14063. }
  14064. if( this.isTransitionPlaying() )
  14065. {
  14066. this.skipTransition();
  14067. }
  14068. var nOldSlide = nCurSlide;
  14069. if( nOldSlide !== undefined )
  14070. {
  14071. var oldMetaSlide = aMetaDoc.aMetaSlideSet[nOldSlide];
  14072. if( this.isEnabled() )
  14073. {
  14074. if( oldMetaSlide.aSlideAnimationsHandler.isAnimated() )
  14075. {
  14076. oldMetaSlide.aSlideAnimationsHandler.end( bSkipSlideTransition );
  14077. this.dispose();
  14078. }
  14079. }
  14080. if( this.automaticAdvanceTimeout !== null )
  14081. {
  14082. window.clearTimeout( this.automaticAdvanceTimeout );
  14083. this.automaticAdvanceTimeout = null;
  14084. }
  14085. }
  14086. this.notifySlideStart( nNewSlide, nOldSlide );
  14087. if( this.isEnabled() && !bSkipSlideTransition )
  14088. {
  14089. if ( ( ( nOldSlide !== undefined ) &&
  14090. ( ( nNewSlide > nOldSlide ) ||
  14091. ( ( nNewSlide == 0) && ( nOldSlide == (aMetaDoc.nNumberOfSlides - 1) ) ) ) ) ||
  14092. ( ( nOldSlide === undefined ) && ( nNewSlide == 0) ) // for transition on first slide
  14093. )
  14094. {
  14095. var aOldMetaSlide = null;
  14096. if( nOldSlide === undefined ) // for transition on first slide
  14097. {
  14098. aOldMetaSlide = aMetaDoc.theMetaDummySlide;
  14099. }
  14100. else
  14101. {
  14102. aOldMetaSlide = aMetaDoc.aMetaSlideSet[nOldSlide];
  14103. }
  14104. var aNewMetaSlide = aMetaDoc.aMetaSlideSet[nNewSlide];
  14105. var aSlideTransitionHandler = aNewMetaSlide.aTransitionHandler;
  14106. if( aSlideTransitionHandler && aSlideTransitionHandler.isValid() )
  14107. {
  14108. var sRef = 'url(#' + aPresentationClipPathShrinkId + ')';
  14109. aOldMetaSlide.slideElement.setAttribute( 'clip-path', sRef );
  14110. if( nOldSlide > nNewSlide )
  14111. {
  14112. this.aSlideViewElement = document.createElementNS( NSS['svg'], 'use' );
  14113. setNSAttribute( 'xlink', this.aSlideViewElement, 'href', '#' + aOldMetaSlide.slideContainerId );
  14114. aNewMetaSlide.aVisibilityStatusElement.parentNode.insertBefore( this.aSlideViewElement, aNewMetaSlide.aVisibilityStatusElement );
  14115. aOldMetaSlide.hide();
  14116. }
  14117. var aLeavingSlide = aOldMetaSlide;
  14118. var aEnteringSlide = aNewMetaSlide;
  14119. var aTransitionEndEvent = makeEvent( bind2( this.notifyTransitionEnd, this, nNewSlide ) );
  14120. var aTransitionActivity =
  14121. this.createSlideTransition( aSlideTransitionHandler, aLeavingSlide,
  14122. aEnteringSlide, aTransitionEndEvent );
  14123. if( aTransitionActivity )
  14124. {
  14125. this.bIsTransitionRunning = true;
  14126. this.aActivityQueue.addActivity( aTransitionActivity );
  14127. this.update();
  14128. }
  14129. else
  14130. {
  14131. this.notifyTransitionEnd( nNewSlide );
  14132. }
  14133. }
  14134. else
  14135. {
  14136. this.notifyTransitionEnd( nNewSlide );
  14137. }
  14138. }
  14139. else
  14140. {
  14141. this.notifyTransitionEnd( nNewSlide );
  14142. }
  14143. }
  14144. else
  14145. {
  14146. this.notifyTransitionEnd( nNewSlide );
  14147. }
  14148. };
  14149. SlideShow.prototype.update = function()
  14150. {
  14151. this.aTimer.holdTimer();
  14152. this.aTimerEventQueue.process();
  14153. this.aActivityQueue.process();
  14154. this.aFrameSynchronization.synchronize();
  14155. this.aActivityQueue.processDequeued();
  14156. this.aTimer.releaseTimer();
  14157. var bActivitiesLeft = ( ! this.aActivityQueue.isEmpty() );
  14158. var bTimerEventsLeft = ( ! this.aTimerEventQueue.isEmpty() );
  14159. var bEventsLeft = ( bActivitiesLeft || bTimerEventsLeft );
  14160. if( bEventsLeft )
  14161. {
  14162. var nNextTimeout;
  14163. if( bActivitiesLeft )
  14164. {
  14165. nNextTimeout = MINIMUM_TIMEOUT;
  14166. this.aFrameSynchronization.activate();
  14167. }
  14168. else
  14169. {
  14170. nNextTimeout = this.aTimerEventQueue.nextTimeout();
  14171. if( nNextTimeout < MINIMUM_TIMEOUT )
  14172. nNextTimeout = MINIMUM_TIMEOUT;
  14173. else if( nNextTimeout > MAXIMUM_TIMEOUT )
  14174. nNextTimeout = MAXIMUM_TIMEOUT;
  14175. this.aFrameSynchronization.deactivate();
  14176. }
  14177. this.bIsIdle = false;
  14178. window.setTimeout( 'aSlideShow.update()', nNextTimeout * 1000 );
  14179. }
  14180. else
  14181. {
  14182. this.bIsIdle = true;
  14183. }
  14184. };
  14185. SlideShow.prototype.dispose = function()
  14186. {
  14187. this.aTimerEventQueue.clear();
  14188. this.aActivityQueue.clear();
  14189. this.aNextEffectEventArray = null;
  14190. this.aEventMultiplexer = null;
  14191. };
  14192. SlideShow.prototype.getContext = function()
  14193. {
  14194. return this.aContext;
  14195. };
  14196. var aSlideShow = null;
  14197. function SlideShowContext( aTimerEventQueue, aEventMultiplexer, aNextEffectEventArray, aInteractiveAnimationSequenceMap, aActivityQueue)
  14198. {
  14199. this.aTimerEventQueue = aTimerEventQueue;
  14200. this.aEventMultiplexer = aEventMultiplexer;
  14201. this.aNextEffectEventArray = aNextEffectEventArray;
  14202. this.aInteractiveAnimationSequenceMap = aInteractiveAnimationSequenceMap;
  14203. this.aActivityQueue = aActivityQueue;
  14204. this.bIsSkipping = false;
  14205. }
  14206. function FrameSynchronization( nFrameDuration )
  14207. {
  14208. this.nFrameDuration = nFrameDuration;
  14209. this.aTimer = new ElapsedTime();
  14210. this.nNextFrameTargetTime = 0.0;
  14211. this.bIsActive = false;
  14212. this.markCurrentFrame();
  14213. }
  14214. FrameSynchronization.prototype.markCurrentFrame = function()
  14215. {
  14216. this.nNextFrameTargetTime = this.aTimer.getElapsedTime() + this.nFrameDuration;
  14217. };
  14218. FrameSynchronization.prototype.synchronize = function()
  14219. {
  14220. if( this.bIsActive )
  14221. {
  14222. while( this.aTimer.getElapsedTime() < this.nNextFrameTargetTime )
  14223. ;
  14224. }
  14225. this.markCurrentFrame();
  14226. };
  14227. FrameSynchronization.prototype.activate = function()
  14228. {
  14229. this.bIsActive = true;
  14230. };
  14231. FrameSynchronization.prototype.deactivate = function()
  14232. {
  14233. this.bIsActive = false;
  14234. };
  14235. function NextEffectEventArray()
  14236. {
  14237. this.aEventArray = [];
  14238. }
  14239. NextEffectEventArray.prototype.size = function()
  14240. {
  14241. return this.aEventArray.length;
  14242. };
  14243. NextEffectEventArray.prototype.at = function( nIndex )
  14244. {
  14245. return this.aEventArray[ nIndex ];
  14246. };
  14247. NextEffectEventArray.prototype.appendEvent = function( aEvent )
  14248. {
  14249. var nSize = this.size();
  14250. for( var i = 0; i < nSize; ++i )
  14251. {
  14252. if( this.aEventArray[i].getId() == aEvent.getId() )
  14253. {
  14254. aNextEffectEventArrayDebugPrinter.print( 'NextEffectEventArray.appendEvent: event(' + aEvent.getId() + ') already present' );
  14255. return false;
  14256. }
  14257. }
  14258. this.aEventArray.push( aEvent );
  14259. aNextEffectEventArrayDebugPrinter.print( 'NextEffectEventArray.appendEvent: event(' + aEvent.getId() + ') appended' );
  14260. return true;
  14261. };
  14262. NextEffectEventArray.prototype.clear = function( )
  14263. {
  14264. this.aEventArray = [];
  14265. };
  14266. function TimerEventQueue( aTimer )
  14267. {
  14268. this.aTimer = aTimer;
  14269. this.aEventSet = new PriorityQueue( EventEntry.compare );
  14270. }
  14271. TimerEventQueue.prototype.addEvent = function( aEvent )
  14272. {
  14273. this.DBG( 'TimerEventQueue.addEvent event(' + aEvent.getId() + ') appended.' );
  14274. if( !aEvent )
  14275. {
  14276. log( 'TimerEventQueue.addEvent: null event' );
  14277. return false;
  14278. }
  14279. var nTime = aEvent.getActivationTime( this.aTimer.getElapsedTime() );
  14280. var aEventEntry = new EventEntry( aEvent, nTime );
  14281. this.aEventSet.push( aEventEntry );
  14282. return true;
  14283. };
  14284. TimerEventQueue.prototype.forceEmpty = function()
  14285. {
  14286. this.process_(true);
  14287. };
  14288. TimerEventQueue.prototype.process = function()
  14289. {
  14290. this.process_(false);
  14291. };
  14292. TimerEventQueue.prototype.process_ = function( bFireAllEvents )
  14293. {
  14294. var nCurrentTime = this.aTimer.getElapsedTime();
  14295. while( !this.isEmpty() && ( bFireAllEvents || ( this.aEventSet.top().nActivationTime <= nCurrentTime ) ) )
  14296. {
  14297. var aEventEntry = this.aEventSet.top();
  14298. this.aEventSet.pop();
  14299. var aEvent = aEventEntry.aEvent;
  14300. if( aEvent.isCharged() )
  14301. aEvent.fire();
  14302. }
  14303. };
  14304. TimerEventQueue.prototype.isEmpty = function()
  14305. {
  14306. return this.aEventSet.isEmpty();
  14307. };
  14308. TimerEventQueue.prototype.nextTimeout = function()
  14309. {
  14310. var nTimeout = Number.MAX_VALUE;
  14311. var nCurrentTime = this.aTimer.getElapsedTime();
  14312. if( !this.isEmpty() )
  14313. nTimeout = this.aEventSet.top().nActivationTime - nCurrentTime;
  14314. return nTimeout;
  14315. };
  14316. TimerEventQueue.prototype.clear = function()
  14317. {
  14318. this.DBG( 'TimerEventQueue.clear invoked' );
  14319. this.aEventSet.clear();
  14320. };
  14321. TimerEventQueue.prototype.getTimer = function()
  14322. {
  14323. return this.aTimer;
  14324. };
  14325. TimerEventQueue.prototype.DBG = function( sMessage, nTime )
  14326. {
  14327. aTimerEventQueueDebugPrinter.print( sMessage, nTime );
  14328. };
  14329. TimerEventQueue.prototype.insert = function( aEventEntry )
  14330. {
  14331. var nHoleIndex = this.aEventSet.length;
  14332. var nParent = Math.floor( ( nHoleIndex - 1 ) / 2 );
  14333. while( ( nHoleIndex > 0 ) && this.aEventSet[ nParent ].compare( aEventEntry ) )
  14334. {
  14335. this.aEventSet[ nHoleIndex ] = this.aEventSet[ nParent ];
  14336. nHoleIndex = nParent;
  14337. nParent = Math.floor( ( nHoleIndex - 1 ) / 2 );
  14338. }
  14339. this.aEventSet[ nHoleIndex ] = aEventEntry;
  14340. };
  14341. function EventEntry( aEvent, nTime )
  14342. {
  14343. this.aEvent = aEvent;
  14344. this.nActivationTime = nTime;
  14345. }
  14346. EventEntry.compare = function( aLhsEventEntry, aRhsEventEntry )
  14347. {
  14348. if ( aLhsEventEntry.nActivationTime > aRhsEventEntry.nActivationTime )
  14349. {
  14350. return -1;
  14351. }
  14352. else if ( aLhsEventEntry.nActivationTime < aRhsEventEntry.nActivationTime )
  14353. {
  14354. return 1;
  14355. }
  14356. else
  14357. {
  14358. return 0;
  14359. }
  14360. };
  14361. function ActivityQueue( aTimer )
  14362. {
  14363. this.aTimer = aTimer;
  14364. this.aCurrentActivityWaitingSet = [];
  14365. this.aCurrentActivityReinsertSet = [];
  14366. this.aDequeuedActivitySet = [];
  14367. }
  14368. ActivityQueue.prototype.dispose = function()
  14369. {
  14370. var nSize = this.aCurrentActivityWaitingSet.length;
  14371. var i;
  14372. for( i = 0; i < nSize; ++i )
  14373. this.aCurrentActivityWaitingSet[i].dispose();
  14374. nSize = this.aCurrentActivityReinsertSet.length;
  14375. for( i = 0; i < nSize; ++i )
  14376. this.aCurrentActivityReinsertSet[i].dispose();
  14377. };
  14378. ActivityQueue.prototype.addActivity = function( aActivity )
  14379. {
  14380. if( !aActivity )
  14381. {
  14382. log( 'ActivityQueue.addActivity: activity is not valid' );
  14383. return false;
  14384. }
  14385. this.aCurrentActivityWaitingSet.push( aActivity );
  14386. aActivityQueueDebugPrinter.print( 'ActivityQueue.addActivity: activity appended' );
  14387. return true;
  14388. };
  14389. ActivityQueue.prototype.process = function()
  14390. {
  14391. var nSize = this.aCurrentActivityWaitingSet.length;
  14392. var nLag = 0.0;
  14393. for( var i = 0; i < nSize; ++i )
  14394. {
  14395. nLag = Math.max( nLag,this.aCurrentActivityWaitingSet[i].calcTimeLag() );
  14396. }
  14397. if( nLag > 0.0 )
  14398. this.aTimer.adjustTimer( -nLag, true );
  14399. while( this.aCurrentActivityWaitingSet.length != 0 )
  14400. {
  14401. var aActivity = this.aCurrentActivityWaitingSet.shift();
  14402. var bReinsert = false;
  14403. bReinsert = aActivity.perform();
  14404. if( bReinsert )
  14405. {
  14406. this.aCurrentActivityReinsertSet.push( aActivity );
  14407. }
  14408. else
  14409. {
  14410. this.aDequeuedActivitySet.push( aActivity );
  14411. }
  14412. }
  14413. if( this.aCurrentActivityReinsertSet.length != 0 )
  14414. {
  14415. this.aCurrentActivityWaitingSet = this.aCurrentActivityReinsertSet;
  14416. this.aCurrentActivityReinsertSet = [];
  14417. }
  14418. };
  14419. ActivityQueue.prototype.processDequeued = function()
  14420. {
  14421. var nSize = this.aDequeuedActivitySet.length;
  14422. for( var i = 0; i < nSize; ++i )
  14423. this.aDequeuedActivitySet[i].dequeued();
  14424. this.aDequeuedActivitySet = [];
  14425. };
  14426. ActivityQueue.prototype.isEmpty = function()
  14427. {
  14428. return ( ( this.aCurrentActivityWaitingSet.length == 0 ) &&
  14429. ( this.aCurrentActivityReinsertSet.length == 0 ) );
  14430. };
  14431. ActivityQueue.prototype.clear = function()
  14432. {
  14433. aActivityQueueDebugPrinter.print( 'ActivityQueue.clear invoked' );
  14434. var nSize = this.aCurrentActivityWaitingSet.length;
  14435. var i;
  14436. for( i = 0; i < nSize; ++i )
  14437. this.aCurrentActivityWaitingSet[i].dequeued();
  14438. this.aCurrentActivityWaitingSet = [];
  14439. nSize = this.aCurrentActivityReinsertSet.length;
  14440. for( i = 0; i < nSize; ++i )
  14441. this.aCurrentActivityReinsertSet[i].dequeued();
  14442. this.aCurrentActivityReinsertSet = [];
  14443. };
  14444. ActivityQueue.prototype.endAll = function()
  14445. {
  14446. aActivityQueueDebugPrinter.print( 'ActivityQueue.endAll invoked' );
  14447. var nSize = this.aCurrentActivityWaitingSet.length;
  14448. var i;
  14449. for( i = 0; i < nSize; ++i )
  14450. this.aCurrentActivityWaitingSet[i].end();
  14451. this.aCurrentActivityWaitingSet = [];
  14452. nSize = this.aCurrentActivityReinsertSet.length;
  14453. for( i = 0; i < nSize; ++i )
  14454. this.aCurrentActivityReinsertSet[i].end();
  14455. this.aCurrentActivityReinsertSet = [];
  14456. };
  14457. ActivityQueue.prototype.getTimer = function()
  14458. {
  14459. return this.aTimer;
  14460. };
  14461. ActivityQueue.prototype.size = function()
  14462. {
  14463. return ( this.aCurrentActivityWaitingSet.length +
  14464. this.aCurrentActivityReinsertSet.length +
  14465. this.aDequeuedActivitySet.length );
  14466. };
  14467. function ElapsedTime( aTimeBase )
  14468. {
  14469. this.aTimeBase = aTimeBase;
  14470. this.nLastQueriedTime = 0.0;
  14471. this.nStartTime = this.getCurrentTime();
  14472. this.nFrozenTime = 0.0;
  14473. this.bInPauseMode = false;
  14474. this.bInHoldMode = false;
  14475. }
  14476. ElapsedTime.prototype.getTimeBase = function()
  14477. {
  14478. return this.aTimeBase;
  14479. };
  14480. ElapsedTime.prototype.reset = function()
  14481. {
  14482. this.nLastQueriedTime = 0.0;
  14483. this.nStartTime = this.getCurrentTime();
  14484. this.nFrozenTime = 0.0;
  14485. this.bInPauseMode = false;
  14486. this.bInHoldMode = false;
  14487. };
  14488. ElapsedTime.prototype.getElapsedTime = function()
  14489. {
  14490. this.nLastQueriedTime = this.getElapsedTimeImpl();
  14491. return this.nLastQueriedTime;
  14492. };
  14493. ElapsedTime.prototype.pauseTimer = function()
  14494. {
  14495. this.nFrozenTime = this.getElapsedTimeImpl();
  14496. this.bInPauseMode = true;
  14497. };
  14498. ElapsedTime.prototype.continueTimer = function()
  14499. {
  14500. this.bInPauseMode = false;
  14501. var nPauseDuration = this.getElapsedTimeImpl() - this.nFrozenTime;
  14502. this.nStartTime += nPauseDuration;
  14503. };
  14504. ElapsedTime.prototype.adjustTimer = function( nOffset, bLimitToLastQueriedTime )
  14505. {
  14506. if( bLimitToLastQueriedTime == undefined )
  14507. bLimitToLastQueriedTime = true;
  14508. this.nStartTime -= nOffset;
  14509. if( this.bInHoldMode || this.bInPauseMode )
  14510. this.nFrozenTime += nOffset;
  14511. };
  14512. ElapsedTime.prototype.holdTimer = function()
  14513. {
  14514. this.nFrozenTime = this.getElapsedTimeImpl();
  14515. this.bInHoldMode = true;
  14516. };
  14517. ElapsedTime.prototype.releaseTimer = function()
  14518. {
  14519. this.bInHoldMode = false;
  14520. };
  14521. ElapsedTime.prototype.getSystemTime = function()
  14522. {
  14523. return ( getCurrentSystemTime() / 1000.0 );
  14524. };
  14525. ElapsedTime.prototype.getCurrentTime = function()
  14526. {
  14527. var nCurrentTime;
  14528. if ( !this.aTimeBase )
  14529. {
  14530. nCurrentTime = this.getSystemTime();
  14531. }
  14532. else
  14533. {
  14534. nCurrentTime = this.aTimeBase.getElapsedTimeImpl();
  14535. }
  14536. assert( ( typeof( nCurrentTime ) === typeof( 0 ) ) && isFinite( nCurrentTime ),
  14537. 'ElapsedTime.getCurrentTime: assertion failed: nCurrentTime == ' + nCurrentTime );
  14538. return nCurrentTime;
  14539. };
  14540. ElapsedTime.prototype.getElapsedTimeImpl = function()
  14541. {
  14542. if( this.bInHoldMode || this.bInPauseMode )
  14543. {
  14544. return this.nFrozenTime;
  14545. }
  14546. var nCurTime = this.getCurrentTime();
  14547. return ( nCurTime - this.nStartTime );
  14548. };
  14549. /*****
  14550. * @libreofficeend
  14551. *
  14552. * Several parts of the above code are the result of the porting,
  14553. * started on August 2011, of the C++ code included in the source files
  14554. * placed under the folder '/slideshow/source' and subfolders.
  14555. * @source https://cgit.freedesktop.org/libreoffice/core/tree/slideshow/source
  14556. *
  14557. */
  14558. ]]>
  14559. </script>
  14560. </svg>