Changeset 245
- Timestamp:
- 03/21/10 11:39:48 (2 years ago)
- Location:
- trunk/lingosource
- Files:
-
- 2 added
- 14 edited
-
castlib1/alexUtilities.ls (modified) (5 diffs)
-
castlib1/bbedit_Utilities.ls (modified) (3 diffs)
-
castlib1/helptext.html (modified) (1 diff)
-
castlib1/menu1_button.html (modified) (1 diff)
-
castlib1/menu2_button.html (modified) (1 diff)
-
castlib1/statusOutput.html (modified) (1 diff)
-
castlib1/subversion_version_field.txt (modified) (1 diff)
-
castlib1/svn_Utilities.ls (modified) (9 diffs)
-
castlib2/FileIOFunktionen.ls (modified) (4 diffs)
-
castlib2/GetSetPrefs.ls (modified) (8 diffs)
-
castlib2/PseudoXMLPS.ls (modified) (16 diffs)
-
castlib2/Script_Root_Object.ls (added)
-
castlib2/aleXtrasMovieScript.ls (modified) (4 diffs)
-
castlib2/commonMovieScript.ls (modified) (25 diffs)
-
castlib2/memberInfo.xml (modified) (1 diff)
-
castlib2/scriptTextParser.ls (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lingosource/castlib1/alexUtilities.ls
r244 r245 38 38 property pCaseLists 39 39 40 property pCachedFiles 41 40 42 41 43 on new me 44 pCachedFiles = [:] 42 45 ancestor = new(script "PseudoXMLPS") -- we need this script later 43 46 -- and as we may already be in the scope of the stage, we use it as ancestor … … 124 127 ----------------------------------- 125 128 129 theResult = pCachedFiles.getaprop(pfad) 130 if listP(theResult) then return theResult 131 126 132 theResult = [:] 127 133 dertext = mGetTextFromFile(me, pfad) 128 134 if length(dertext) > 0 then 129 135 statusSwitched = mSwitchToStatusMode(me, 1) 130 theResult = mGetListFromXMLString(me, dertext) 136 theResult = mGetListFromXMLStringX(me, dertext) 137 pCachedFiles.setaProp(pfad, theResult) 131 138 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 132 139 end if 133 140 return theResult 141 end 142 143 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 144 145 on mClearXML_Cache me, string_fullPath 146 ----------------------------------- 147 -- ACTION: We have a cache for xml files, sio that we do not need to parse the same 148 -- file over and over again, as itis time consuming esp. during repeat loops 149 -- so we store the result in pCachedFiles by filename. 150 -- In order to flush this cache for either one file (with parameter) or all files 151 -- (without parameter) use this handler 152 -- 153 -- INPUT: <string_fullPath> ; string ; full pathname ; optional => default "" => clear all cahced files 154 -- RETURNS: - 155 ----------------------------------- 156 157 string_fullPath = string(string_fullPath) 158 if length(string_fullPath) > 0 then 159 pCachedFiles.deleteProp(string_fullPath) 160 else 161 pCachedFiles = [:] 162 end if 134 163 end 135 164 … … 149 178 if not(list(theList)) then theList = [:] 150 179 end if 180 pCachedFiles.setaProp(thePath, theList) 151 181 theResult = mGetXMLStringFromList(me, theList) 152 182 return mSaveToTextFile(me, theResult, thePath) … … 2927 2957 end 2928 2958 2929 2930 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx2931 2932 on mGetWindowsHomeFolder me2933 2934 if mCheckForXtra(me, "Shell") = 0 then2935 home = mDoShellCmd(me, "echo %HOMEPATH%", void, void, 1)2936 home = home[1]2937 else if mCheckForXtra(me, "BudAPI") then2938 olddelim = the itemdelimiter2939 the itemdelimiter = "\"2940 home = baSysFolder("personal")2941 if the last char of home = "\" then delete the last char of home2942 if the last item of home = "Documents" then delete the last item of home2943 the itemdelimiter = olddelim2944 else2945 home = ""2946 end if2947 2948 return home2949 end2950 2951 2959 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2952 2960 on _______________GLOSSARY_ITEMS me … … 3532 3540 end if 3533 3541 3534 -- pUPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZZÁÀ"&vA& "ÄÃÅÇÉÈÊËÍÌÎÏÑÓÒÔÖÕÚÙÜÆØ" 3535 -- pLowercase = "abcdefghijklmnopqrstuvwxyzáà"&"â"&"äãåçéèêëíìîïñóòôöõúùûüæøÿ" 3536 pCaseLists.setaprop(#uppercase, ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "Á", "À", vA, "A", "Ä", "Ã", "Å", "Ç", "É", "È", "Ê", "Ë", "Í", "Ì", "Î", "Ï", "Ñ", "Ó", "Ò", "Ô", "Ö", "Õ", "Ú", "Ù", "U", "Ü", "Æ", "Ø", "", ""]) 3537 pCaseLists.setaprop(#lowercase, ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "á", "à", vA, "â", "ä", "ã", "å", "ç", "é", "è", "ê", "ë", "í", "ì", "î", "ï", "ñ", "ó", "ò", "ô", "ö", "õ", "ú", "ù", "û", "ü", "æ", "ø", "", "ÿ"]) 3542 -- pUPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZZçË"&vA& "Ìéæèêíëìîñï 3543 ÍòôÛ®¯ÎÙ" 3544 -- pLowercase = "abcdefghijklmnopqrstuvwxyz"&""&"Ÿ¿ÏØ" 3545 pCaseLists.setaprop(#uppercase, ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "ç", "Ë", vA, "A", "", "Ì", "", "", "", "é", "æ", "è", "ê", "í", "ë", "ì", "", "î", "ñ", "ï", " 3546 ", "Í", "ò", "ô", "U", "", "®", "¯", "Î", "Ù"]) 3547 pCaseLists.setaprop(#lowercase, ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "", "", vA, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Ÿ", "¿", "Ï", "Ø"]) 3538 3548 3539 3549 end -
trunk/lingosource/castlib1/bbedit_Utilities.ls
r244 r245 64 64 if memref.type = #script then 65 65 fname = memref.filename 66 if length(fname) < 1 then fname = mGetFilePathFromMemberComments(me, memref) 67 if length(fname) > 0 then 66 if fname.length then 68 67 69 68 ppath = mConvertHFS2Unix(me, fname) … … 1055 1054 offs = offset("/", comm) 1056 1055 end repeat 1057 home = mGetWindowsHomeFolder(me) 1058 put home into char 1 to 2 of comm 1056 put baSysFolder("personal") into char 1 to 2 of comm 1059 1057 aPath = comm 1060 1058 end if … … 1078 1076 1079 1077 if comm starts "/Users/alex/" then 1080 put mGetWindowsHomeFolder(me) & "\"into char 1 to 12 of comm1078 put baSysFolder("personal") into char 1 to 12 of comm 1081 1079 end if 1082 1080 aPath = comm -
trunk/lingosource/castlib1/helptext.html
r244 r245 5 5 <body bgcolor="#FFFFFF"> 6 6 <br> 7 <font face="Arial , Helvetica" size=4><b>Handler Menu</font></b><font size=3> by Alex da Franca -- </font><a href="mailto:alex@farbflash.de"><font color="#000096"><u>alex@farbflash.de<p>7 <font face="Arial" size=4><b>Handler Menu</font></b><font size=3> by Alex da Franca -- </font><a href="mailto:alex@farbflash.de"><font color="#000096"><u>alex@farbflash.de<p> 8 8 </a></font></u><font color="#000000">Quickly <b>execute handlers</b> which are found in the <b>currently open stage movie</b> from this menu.<br> 9 9 Holding the <b>Option/Alt</b> key pressed, while selecting a menu item <b>opens the script</b> and highlights the handler in the editor instead of executing the handler.<br> -
trunk/lingosource/castlib1/menu1_button.html
r244 r245 4 4 </head> 5 5 <body bgcolor="#FFFFFF"> 6 <font face="Arial , Helvetica" size=4 color="#141414">Utilities</font></body>6 <font face="Arial" size=4 color="#141414">Utilities</font></body> 7 7 </html> -
trunk/lingosource/castlib1/menu2_button.html
r244 r245 4 4 </head> 5 5 <body bgcolor="#FFFFFF"> 6 <font face="Arial , Helvetica" size=4 color="#141414">Handlers</font></body>6 <font face="Arial" size=4 color="#141414">Handlers</font></body> 7 7 </html> -
trunk/lingosource/castlib1/statusOutput.html
r244 r245 4 4 </head> 5 5 <body bgcolor="#FFFFFF"> 6 <font face="Arial , Helvetica">The following operation may take some time...</font></body>6 <font face="Arial">The following operation may take some time...</font></body> 7 7 </html> -
trunk/lingosource/castlib1/subversion_version_field.txt
r242 r245 1 r24 41 r247 -
trunk/lingosource/castlib1/svn_Utilities.ls
r244 r245 40 40 on mCompareCurrentScriptToWorkingCopy me, convertLineBreaksToUnix 41 41 42 43 42 if not(the platform contains "mac") then 44 43 … … 104 103 end case 105 104 106 107 105 thePath = mFindWorkingCopyCounterpart(me, memref, ext) 108 106 … … 113 111 114 112 else 115 116 117 113 118 114 tempSrcHFSPath = mGetTempFilePath(me, "temp_SVN_Diff_file1.ls") … … 123 119 tempSrcPath = tempSrcHFSPath 124 120 end if 125 126 121 127 122 ------------------------------------------ trac subversion support works better with unix linebreaks... … … 156 151 end if 157 152 ----------------------------------------- 158 159 153 160 154 theResult = mSaveTextToTempFile(me, st, tempSrcHFSPath) … … 208 202 209 203 if writeBack = 1 then 210 211 204 212 205 if convertLineBreaksToUnix = 1 then … … 434 427 435 428 infolistPath = theFolder & "memberInfo.xml" 429 436 430 infolist = mReadXML_2_List(me, infolistPath) 437 431 … … 450 444 repeat with l = 1 to cnt 451 445 li = infolist[l] 452 -- put "memberName:" && li.getaprop(#memberName)446 453 447 if li.getaprop(#memberName) = memref.name then 454 448 … … 457 451 fpath = theFolder & fname & file_extension 458 452 459 -- put "path:" && fpath460 453 if length(baShortFilename(fpath)) > 0 then return fpath 461 462 -- if baFileExists(fpath) then return fpath463 454 464 455 end if -
trunk/lingosource/castlib2/FileIOFunktionen.ls
r244 r245 1 -- FileIO Handlers -- c03 Alex da Franca -- alex@farbflash.de 2 --------------------------------------------------------------------- 1 -- FileIOFunktionen 2 ----------------------------------- 3 -- CREATED: 4 -- c03 Alex da Franca -- alex@farbflash.de 5 -- PROPERTIES: 6 --!memberProperties: [#name: "FileIOFunktionen", #scripttype: #parent, #scriptSyntax: #lingo, #comments: "~/Documents/Scripts/lingo/FileIOFunktionen.ls"] 7 -- 8 -- DESCRIPTION: FileIO Handlers 9 -- - 10 -- 11 -- REQUIRES: 12 -- (Prerequisites) 13 -- 14 -- USAGE: 15 -- - 16 -- 17 -- EXAMPLE: 18 -- - 19 ----------------------------------- 20 21 on _____________________PROPERTY_DECLARATION me 22 end 23 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 24 property ancestor 25 26 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 27 on ___________________STANDARD_EVENTS me 28 end 29 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 30 31 on new me 32 Script_Root_Object = member("Script_Root_Object") 33 if ilk(Script_Root_Object) = #member then 34 if Script_Root_Object.type = #script then 35 ancestor = new(script "Script_Root_Object") 36 mSetScriptName me, "FileIOFunktionen" 37 end if 38 end if 39 return me 40 end 41 42 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 43 on ___________________PUBLIC_EVENTS me 44 end 45 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 3 46 4 47 … … 98 141 else 99 142 paramList.setaprop(#theTextResult, mGetTextFromFile(me, paramList.getaprop(#theURL), paramList[#isByteArray], paramList[#charset])) 100 call(paramList.getaprop(#handler), [paramList.getaprop(#target)], paramList) 143 theResult = xscr().mDoDelayedCallback(paramList) 144 if theResult <> 1 then call(paramList.getaprop(#handler), [paramList.getaprop(#target)], paramList) 101 145 end if 102 146 end … … 321 365 322 366 on mGetFilePathFromUser me, startDir, defaultName, filetypes, prompt 367 ----------------------------------- 368 -- CREATED: - 369 -- ACTION: Asks the user for a path to a file and returns the filepath 370 -- INPUT: <startDir> ; string ; the directory to start the file selection dialog (only if buddyApi xtra is installed) 371 -- <defaultName> ; string ; pre-entered filename (only if buddyApi xtra is installed) 372 -- <filetypes> ; string ; filetype filter (only if buddyApi xtra is installed) 373 -- <prompt> ; string ; Caption of the dialog (only if buddyApi xtra is installed) 374 -- RETURNS: string ; absolute pathname delimited by the pathdelimiter of the current platform (widnows: "\", mac: ":") or "", if user canceled the process 375 -- EXAMPLE: relPath = xscr(#FileIOFunktionen).mGetFilePathFromUser(the moviepath, "soundRadius.xml", ".xml", "Please select soundradius scriptsettings") 376 ----------------------------------- 377 323 378 retval = "" 324 379 … … 361 416 362 417 return retval 418 end 419 420 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 421 422 on mGetMovieRelativePathFromUser me, startDir, defaultName, filetypes, prompt 423 ----------------------------------- 424 -- CREATED: 14.12.2009 425 -- ACTION: Asks the user for a path to a file 426 -- Takes care, that the file starts with the moviepath => is WITHIN the moviepath, 427 -- otherwise it calls itself until either the user selects a relative file or cancels the process. 428 -- Converts path delimiters to "/" => normalize the pathdelimiter for both platforms 429 -- INPUT: <startDir> ; string ; the directory to start the file selection dialog (only if buddyApi xtra is installed) 430 -- <defaultName> ; string ; pre-entered filename (only if buddyApi xtra is installed) 431 -- <filetypes> ; string ; filetype filter (only if buddyApi xtra is installed) 432 -- SPECIAL VALUE: can be "folder", which would not return a path to a folder, 433 -- but rather a path to a folder 434 -- <prompt> ; string ; Caption of the dialog (only if buddyApi xtra is installed) 435 -- RETURNS: string ; relative pathname delimited by "/" or "", if user canceled the process 436 -- EXAMPLE: relPath = xscr(#FileIOFunktionen).mGetMovieRelativePathFromUser(the moviepath, "soundRadius.xml", ".xml", "Please select soundradius scriptsettings") 437 ----------------------------------- 438 439 if filetypes = "folder" then 440 searchItem = "folder" 441 thePath = mGetFolderPathFromUser(me) 442 else 443 searchItem = "file" 444 thePath = mGetFilePathFromUser(me, startDir, defaultName, filetypes, prompt) 445 end if 446 if length(thePath) > 0 then 447 if offset(the moviepath, thePath) <> 1 then 448 alert "This " & searchItem & " is NOT within the moviepath. Please choose a " & searchItem & ", which is inside the current movie's path!" 449 return mGetMovieRelativePathFromUser(me, startDir, defaultName, filetypes, prompt) 450 end if 451 delete char 1 to length(the moviepath) of thePath 452 delim = the last char of the moviepath 453 if delim <> "/" then 454 offs = offset(delim, thePath) 455 repeat while offs > 0 456 put "/" into char offs of thePath 457 offs = offset(delim, thePath) 458 end repeat 459 end if 460 if filetypes = "folder" then 461 if the last char of thePath <> "/" then put "/" after thePath 462 end if 463 end if 464 return thePath 363 465 end 364 466 -
trunk/lingosource/castlib2/GetSetPrefs.ls
r244 r245 1 -- store, read and write preferences 2 1 -- GetSetPrefs 2 ----------------------------------- 3 -- CREATED: 4 -- 28.02.2010 5 -- PROPERTIES: 6 --!memberProperties: [#name: "GetSetPrefs", #scripttype: #parent, #scriptSyntax: #lingo, #comments: "~/Documents/Scripts/lingo/GetSetPrefs.ls"] 7 -- 8 -- DESCRIPTION: store, read and write preferences 9 -- - 10 -- 11 -- REQUIRES: 12 -- (Prerequisites) 13 -- 14 -- USAGE: 3 15 -- on startmovie: theResult = call(#mReadPrefs, mGetXscript(#GetSetPrefs), "prefsname") 4 16 -- on stopmovie: theResult = call(#mSavePrefs, mGetXscript(#GetSetPrefs), "prefsname", useAleXML) … … 7 19 -- theResult = call(#mGetPrefValue, mGetXscript(#GetSetPrefs), "prefname") 8 20 -- theResult = call(#mSetPrefValue, mGetXscript(#GetSetPrefs), "prefname", newValue) 9 10 11 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 21 -- 22 -- EXAMPLE: 23 -- - 24 ----------------------------------- 25 26 on _____________________PROPERTY_DECLARATION me 27 end 28 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 29 property ancestor 30 31 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 32 on ___________________STANDARD_EVENTS me 33 end 34 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 35 36 on new me 37 Script_Root_Object = member("Script_Root_Object") 38 if ilk(Script_Root_Object) = #member then 39 if Script_Root_Object.type = #script then 40 ancestor = new(script "Script_Root_Object") 41 mSetScriptName me, "GetSetPrefs" 42 end if 43 end if 44 return me 45 end 46 47 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 48 on ___________________PUBLIC_EVENTS me 49 end 50 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 51 12 52 13 53 on interface me … … 88 128 resetUNames = 0 89 129 if the platform contains "mac" then 90 if baSysFolder("prefs") starts "/" then91 baReturnUnixNames(0)92 resetUNames = 193 end if130 if baSysFolder("prefs") starts "/" then 131 baReturnUnixNames(0) 132 resetUNames = 1 133 end if 94 134 end if 95 135 … … 177 217 178 218 if offset("<?xml", prefsText.line[1]) > 0 then 179 -- delete line 1 of prefsText219 -- delete line 1 of prefsText 180 220 181 221 gPrefs = call(#mGetListFromXMLStringX, mGetXScript(#PseudoXMLPS), prefsText) … … 184 224 else 185 225 olddelim = the itemdelimiter 186 the itemdelimiter = " ¬ø"226 the itemdelimiter = "¿" 187 227 188 228 anz = prefsText.line.count … … 263 303 resetUNames = 0 264 304 if the platform contains "mac" then 265 if baSysFolder("prefs") starts "/" then266 baReturnUnixNames(0)267 resetUNames = 1268 end if305 if baSysFolder("prefs") starts "/" then 306 baReturnUnixNames(0) 307 resetUNames = 1 308 end if 269 309 end if 270 310 … … 335 375 repeat with n = 1 to anz 336 376 337 if objectP(prefliste) then prefStr = string(prefliste.getPropAt(n))&" ¬ø"377 if objectP(prefliste) then prefStr = string(prefliste.getPropAt(n))&"¿" 338 378 339 379 dieserWert = prefliste[n] … … 342 382 343 383 repeat with m = 1 to count(dieserWert) 344 put dieserWert[m]&" ¬ø" after prefStr384 put dieserWert[m]&"¿" after prefStr 345 385 end repeat 346 386 347 387 else 348 put prefliste[n]&" ¬ø" after prefStr388 put prefliste[n]&"¿" after prefStr 349 389 end if 350 390 -
trunk/lingosource/castlib2/PseudoXMLPS.ls
r244 r245 24 24 -- -- Convert a list to an xml string: 25 25 -- xmlString = PseudoXMLPS.mGetXMLStringFromList(["one", "two", [#prop: 3]]) 26 -- lingolist = PseudoXMLPS.mGetListFromXMLString X(xmlString)26 -- lingolist = PseudoXMLPS.mGetListFromXMLString(xmlString) 27 27 -- ---------- basically that's it 28 28 -- … … 40 40 -- xmlString = PseudoXMLPS.mGetXMLStringFromList(myList, "myList", 1, 1) 41 41 -- ... 42 -- myList = PseudoXMLPS.mGetListFromXMLString X(xmlString)42 -- myList = PseudoXMLPS.mGetListFromXMLString(xmlString) 43 43 -- repeat with n = countmyList) down to 1 44 44 -- thisValue = myList[n] … … 79 79 on _____________________PROPERTY_DECLARATION me 80 80 end 81 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 81 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 82 property ancestor 82 83 property pXMLParserXtra 83 84 property pXmlxtraversion, pVersionNumber 84 85 85 86 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 86 on ___________ PUBLIC_EVENTS me87 on ___________________STANDARD_EVENTS me 87 88 end 88 89 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 89 90 90 91 on new me 92 Script_Root_Object = member("Script_Root_Object") 93 if ilk(Script_Root_Object) = #member then 94 if Script_Root_Object.type = #script then 95 ancestor = new(script "Script_Root_Object") 96 mSetScriptName me, "PseudoXMLPS" 97 end if 98 end if 91 99 return me 92 100 end 93 101 102 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 103 on ___________________ENGINE_EVENTS me 104 end 94 105 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 95 106 … … 99 110 100 111 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 101 112 on ___________PUBLIC_EVENTS me 113 end 114 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 102 115 103 116 -- on handler me … … 117 130 118 131 put RETURN & "----- Parse XML-ish string to lingo list" after str 119 put RETURN & "on mGetListFromXMLString me, string_XMLstring, integer_convertValues" after str132 put RETURN & "on mGetListFromXMLStringlingo me, string_XMLstring, integer_convertValues" after str 120 133 put RETURN & "-- -- <convertValues> #integer" after str 121 134 put RETURN & "-- -- -- 0 => don't convert (fast, all values are strings)" after str … … 126 139 127 140 put RETURN & "----- Parse XML string to lingo list using XML xtra:" after str 128 put RETURN & "on mGetListFromXMLString Xme, string_XMLstring, integer_convertValues" after str141 put RETURN & "on mGetListFromXMLString me, string_XMLstring, integer_convertValues" after str 129 142 put RETURN & "-- -- <convertValues> #integer" after str 130 143 put RETURN & "-- -- -- 0 => don't convert (fast, all values are strings)" after str … … 205 218 206 219 207 on mGetListFromXMLString me, str, convertValues, withParams220 on mGetListFromXMLStringlingo me, str, convertValues, withParams 208 221 ----------------------------------- 209 222 -- CREATED: 06.03.2008 … … 214 227 -- <withParams> : #boolean : parse parameters too. new, not very well tested 215 228 -- RETURNS: property list 216 -- EXAMPLE: lingo_list = mGetListFromXMLString (me, saveString)229 -- EXAMPLE: lingo_list = mGetListFromXMLStringlingo(me, saveString) 217 230 -- CHANGES: implemented parameter parsing 218 231 ----------------------------------- … … 250 263 251 264 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 252 265 -- this is just backward compatibility with older scripts 253 266 254 267 on mGetListFromXMLStringX me, str, convertValues, withParams 268 return mGetListFromXMLString(me, str, convertValues, withParams) 269 end 270 271 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 272 273 on mGetListFromXMLString me, str, convertValues, withParams 255 274 ----------------------------------- 256 275 -- CREATED: 06.03.2008 … … 265 284 -- -- -- 2 => try to convert all data with value(), even parse for colors in hexstring format (slow) 266 285 -- RETURNS: property list 267 -- EXAMPLE: lingo_list = mGetListFromXMLString X(me, saveString)286 -- EXAMPLE: lingo_list = mGetListFromXMLString(me, saveString) 268 287 -- CHANGES: resorts to the slower lingo function on xml parser error. So this handler can always be used. 269 288 ----------------------------------- … … 310 329 end if 311 330 312 if pXmlxtraversion < 10 then return mGetListFromXMLString (me, str, convertValues, withParams)331 if pXmlxtraversion < 10 then return mGetListFromXMLStringlingo(me, str, convertValues, withParams) 313 332 ------------------ end XML Parser xtra version 10 check 314 333 … … 329 348 end if 330 349 350 331 351 if not(objectP(pXMLParserXtra)) then pXMLParserXtra = new(xtra "XmlParser") 332 352 pXMLParserXtra.parseString(str) 333 353 334 354 if not(voidP(pXMLParserXtra.getError())) then 335 put "Script: PseudoXMLPS; Handler: mGetListFromXMLString X; error:" && pXMLParserXtra.getError()336 return mGetListFromXMLString (me, str, convertValues, withParams)355 put "Script: PseudoXMLPS; Handler: mGetListFromXMLString; error:" && pXMLParserXtra.getError() 356 return mGetListFromXMLStringlingo(me, str, convertValues, withParams) 337 357 end if 338 358 … … 341 361 li = mConvertXMLPropList(me, [xx], convertValues, dontEscapeSpecialChars) 342 362 343 -- put "PseudoXMLPS: mGetListFromXMLString X:" && the milliseconds - ms363 -- put "PseudoXMLPS: mGetListFromXMLString:" && the milliseconds - ms 344 364 345 365 if not(listP(li)) then return [:] … … 363 383 364 384 dertext = xscr(#FileIOFunktionen).mGetTextFromFile(thePath, void, "windows-1252") 365 if length(dertext) > 0 then return mGetListFromXMLString X(me, dertext)385 if length(dertext) > 0 then return mGetListFromXMLString(me, dertext) 366 386 return [:] 367 387 end … … 1230 1250 1231 1251 on mGetListFromPListString me, str 1232 return mConvertKeyList(me, mGetListFromXMLString X(me, str, 0))1252 return mConvertKeyList(me, mGetListFromXMLString(me, str, 0)) 1233 1253 end 1234 1254 … … 1329 1349 end repeat 1330 1350 end repeat 1331 1332 1351 1333 1352 zehn = numToChar(10) -
trunk/lingosource/castlib2/aleXtrasMovieScript.ls
r244 r245 56 56 end if 57 57 58 alextras = rawnew(cms.script)58 alextras = new(cms.script) 59 59 if ilk(alextras) <> #instance then 60 60 alert "Script" & QUOTE & "commonMovieScript" & QUOTE && "is missing. This movie can't proceed!" … … 109 109 if scrName = "commonMovieScript" then return alextras 110 110 111 inst = alextras.mGetInstance(scrName, 1) 111 str_scrName = alextras.mSymb2String(scrName) 112 inst = alextras.mGetInstance(str_scrName, 1) 112 113 if ilk(inst) <> #instance then 113 114 if the runmode contains "aut" then 114 put "Script" && QUOTE & scrName & QUOTE && "is missing! This may cause unwanted behavior" 115 end if 116 inst = [] 117 end if 115 put "Script" && QUOTE & str_scrName & QUOTE && "is missing! This may cause unwanted behavior" 116 end if 117 inst = [] 118 end if 119 if ilk(inst) = #instance then 120 if inst.handler(#new) = 1 then inst.new() 121 end if 118 122 return inst 119 123 ---------------------- 120 124 121 125 122 scrName = symbol(scrName)126 scrName = alextras.mSymbolify(scrName) 123 127 if ilk(scrName) <> #symbol then scrName = #commonmoviescript 124 128 scri = (mGetAleXtras()).getaprop(#scripts) … … 233 237 end repeat 234 238 includes.deleteOne(#commonMovieScript) 235 globs[#gParentScriptInstances] = includes239 globs[#gParentScriptInstances] = includes 236 240 237 241 exit … … 280 284 if not(objectP(incl)) then 281 285 put "No scriptinstances stored" 282 exit286 exit 283 287 end if 284 288 -
trunk/lingosource/castlib2/commonMovieScript.ls
r244 r245 66 66 ----------------------------------- 67 67 68 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 69 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 70 71 72 68 on _____________________PROPERTY_DECLARATION me 69 end 70 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 71 property ancestor 73 72 property pGList 74 73 property pCaseLists 74 75 76 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 77 on ___________________STANDARD_EVENTS me 78 end 79 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 80 81 on new me 82 Script_Root_Object = member("Script_Root_Object") 83 if ilk(Script_Root_Object) = #member then 84 if Script_Root_Object.type = #script then 85 ancestor = new(script "Script_Root_Object") 86 mSetScriptName me, "commonMovieScript" 87 end if 88 end if 89 return me 90 end 91 92 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 93 94 on mFilterString me, string_Input, string_keyword 95 ----------------------------------- 96 -- CREATED: 26.02.2010 97 -- ACTION: Filter to constrain the results 98 -- use "%" or "^" as the first char if the filter shall be => 99 -- 'word STARTS with <string_keyword>' 100 -- use "$" as the last char if the filter shall be => 101 -- 'word ENDS with <string_keyword>' 102 -- (HINT: if searching for the exact phrase use ^keyword$ as filter) 103 -- otherwise the string <string_keyword> may appear anywhere in the word => 104 -- 'word CONTAINS <string_keyword>' 105 -- INPUT: <string_Input> ; string 106 -- <string_keyword> ; string 107 -- RETURNS: boolean (integer 1 or 0) ; true or false 108 -- EXAMPLE: put xscr().mFilterString("commonmoviescript", "%comm") -- STARTS 109 -- -- 1 110 -- put xscr().mFilterString("commonmoviescript", "ript$") 111 -- -- 1 112 -- put xscr().mFilterString("commonmoviescript", "%commonmoviescript$") 113 -- -- 1 114 -- put xscr().mFilterString("commonmoviescript", "movie") 115 -- -- 1 116 ----------------------------------- 117 118 string_Input = string(string_Input) 119 if length(string_Input) < 1 then return 0 120 121 string_keyword = string(string_keyword) 122 if length(string_keyword) < 1 then return 1 123 124 if string_keyword starts "^" then 125 delete char 1 of string_keyword 126 offs = offset(string_keyword, string_Input) 127 return (offs = 1) 128 else if string_keyword starts "%" then 129 delete char 1 of string_keyword 130 offs = offset(string_keyword, string_Input) 131 return (offs = 1) 132 else if the last char of string_keyword = "$" then 133 delete the last char of string_keyword 134 offs = offset(string_keyword, string_Input) 135 return (offs = (length(string_Input) - length(string_keyword) + 1)) 136 else 137 offs = offset(string_keyword, string_Input) 138 return (offs > 0) 139 end if 140 141 end 142 143 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 75 144 76 145 on mGetGlobalList me … … 163 232 ----------------------------------- 164 233 234 delayedCallBackList = mGetGlobalValue(me, #delayedCallBackList) 235 if ilk(delayedCallBackList) = #proplist then 236 jobs = delayedCallBackList[#jobs] 237 repeat with n = count(jobs) down to 1 238 toName = jobs.getPropAt(n) 239 dto = timeout(toName) 240 if ilk(dto) = #timeout then dto.forget() 241 end repeat 242 delayedCallBackList[#jobs] = [:] 243 end if 165 244 166 245 sendAllSprites(#mStopMovieWasCalled) … … 218 297 mSetGlobalValue(me, #playBackModeValueList, playBackModeValueList) 219 298 end if 220 returnplayBackModeValueList[symbol_Prop] = any_value299 playBackModeValueList[symbol_Prop] = any_value 221 300 end 222 301 … … 317 396 318 397 on mGetFloatVersionNumber me, prodVers 319 offs = offset(".", prodVers)320 if offs > 0 then321 intVers = char 1 to offs of prodVers322 delete char 1 to offs of prodVers323 else324 intVers = ""325 end if326 cnt = length(prodVers)327 repeat with n = 1 to cnt328 c = prodVers.char[n]329 if integerP(integer(c)) then330 put c after intVers331 else if c <> "." then332 exit repeat333 end if334 end repeat335 398 offs = offset(".", prodVers) 399 if offs > 0 then 400 intVers = char 1 to offs of prodVers 401 delete char 1 to offs of prodVers 402 else 403 intVers = "" 404 end if 405 cnt = length(prodVers) 406 repeat with n = 1 to cnt 407 c = prodVers.char[n] 408 if integerP(integer(c)) then 409 put c after intVers 410 else if c <> "." then 411 exit repeat 412 end if 413 end repeat 414 336 415 return value(intVers) 337 416 end … … 363 442 env = gLameAuthoringHack_forSlowEnvironment_onMac 364 443 else 365 env = the environment444 env = the environment 366 445 end if 367 446 … … 388 467 if voidP(gPlatform) then 389 468 390 isMac = the platform contains "Macintosh"391 if isMac then469 isMac = the platform contains "Macintosh" 470 if isMac then 392 471 393 472 onX = value(char 1 of (the last word of (mGetEnvironment(me)).osversion)) <= 5 … … 553 632 -- <p1 - p3> ; arbitrary parameters ; just in case additional parameters are required, 554 633 -- which can not, for some reason, be stored in the object <callbackObject> itself 555 -- RETURNS: either a string or an integer. In case of 1 the callback was successfully called, otherwise634 -- RETURNS: either a string or any value. In case of a parameter error 556 635 -- an errorstring is returned and the callback was NOT successfully called. 557 -- EXAMPLE: xscr().mDoCallBack(callBackObject)636 -- EXAMPLE: theResult = xscr().mDoCallBack(callBackObject) 558 637 ----------------------------------- 559 638 … … 578 657 case ilk(tgt) of 579 658 #script, #instance: 580 call(hnd, [tgt], callbackObject, p1, p2, p3)659 retval = call(hnd, [tgt], callbackObject, p1, p2, p3) 581 660 #list, #proplist: 582 661 if count(tgt) = 0 then … … 591 670 put "p3:" && p3 592 671 put "---------------------------" 672 retval = 1 593 673 else 594 call(hnd, tgt, callbackObject, p1, p2, p3)674 retval = call(hnd, tgt, callbackObject, p1, p2, p3) 595 675 end if 596 676 … … 598 678 spr = mGetKanal(me, tgt) 599 679 if spr < 1 then return "callbackObject[#target] is neither an object nor a spritenumber/name:" && callbackObject[#target] 600 sendSprite(spr, hnd, callbackObject, p1, p2, p3)680 retval = sendSprite(spr, hnd, callbackObject, p1, p2, p3) 601 681 end case 602 682 683 return retval 684 end 685 686 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 687 688 on mDoDelayedCallback me, proplist_callbackObject, integer_DelayTime, any_param1, any_param2, any_param3 689 ----------------------------------- 690 -- CREATED: 04.02.2010 691 -- ACTION: Break the event chain by deleying a call by at least one milliseconds 692 -- INPUT: <callbackObject> ; object (propertylist) ; required ; a callBack object of the format: 693 -- [#handler:symbol, #target:object], which can be any number of additional properties 694 -- since this object will be provided as parameter to the recipient 695 -- the recipient can access all these additional properties 696 -- <integer_DelayTime> ; integer ; timeoutlength in milliseconds, optional, default = 1 697 -- <any_param1 - any_param3> ; arbitrary parameters ; just in case additional parameters are required, 698 -- which can not, for some reason, be stored in the object <callbackObject> itself 699 -- RETURNS: true for success 700 -- EXAMPLE: cb = [#target:me, #handler:#foo] 701 -- xscr().mDoDelayedCallback(cb, 1, "abc", 3, []) 702 ----------------------------------- 703 704 delayedCallBackList = mGetGlobalValue(me, #delayedCallBackList) 705 if ilk(delayedCallBackList) <> #proplist then 706 delayedCallBackList = [:] 707 delayedCallBackList[#lastIndex] = 0 708 delayedCallBackList[#jobs] = [:] 709 mSetGlobalValue(me, #delayedCallBackList, delayedCallBackList) 710 end if 711 712 if ilk(integer_DelayTime) <> #integer then integer_DelayTime = 1 713 integer_DelayTime = max(1, integer_DelayTime) 714 715 delayedCallBackList[#lastIndex] = delayedCallBackList[#lastIndex] + 1 716 if delayedCallBackList[#lastIndex] = the maxinteger then delayedCallBackList[#lastIndex] = 1 717 718 toName = "delayedCallbackTimeout" & mGetMemoryAddress(me, me) & delayedCallBackList[#lastIndex] 719 720 delayedCallBackList[#jobs][toName] = [#cobj: proplist_callbackObject, #params:[any_param1, any_param2, any_param3]] 721 722 dto = mCreateTimeOut(me, toName, integer_DelayTime, #delayedCallCallback, me) 723 603 724 return 1 725 end 726 727 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 728 -- cal the callback after the delay timeout 729 730 on delayedCallCallback me, dto 731 if ilk(dto) <> #timeout then exit 732 toName = dto.name 733 dto.forget() 734 delayedCallBackList = mGetGlobalValue(me, #delayedCallBackList) 735 if ilk(delayedCallBackList) <> #proplist then exit 736 thisJob = delayedCallBackList[#jobs][toName] 737 if voidP(thisJob) then exit 738 delayedCallBackList[#jobs].deleteProp(toName) 739 mDoCallBack me, thisJob[#cobj], thisJob[#params][1], thisJob[#params][2], thisJob[#params][3] 604 740 end 605 741 … … 898 1034 899 1035 tempMembers = mGetTempMemberList(me, aType) 900 tempMembers.add(aMember)1036 if tempMembers.getPos(aMember) < 1 then tempMembers.add(aMember) 901 1037 902 1038 end … … 1475 1611 end 1476 1612 1613 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1614 1615 on mGetMemoryAddress me, theObject 1616 ----------------------------------- 1617 -- CREATED: 08.12.2009 1618 -- ACTION: Convert argument into a string and chop the last char 1619 -- Usually used to get a unique identifier for a scriptinstance (=> the last word of string(me)) 1620 -- but without the trailing ">". 1621 -- Not only this looks nicer, but also if used for a filename the ">" character is problematic in a filename 1622 -- INPUT: <theObject> ; any ilk which can be converted to a string 1623 -- RETURNS: string ; the stringified object without the trailing char 1624 -- EXAMPLE: uniqueInstanceIdentifier = xscr().mGetMemoryAddress(me) 1625 ----------------------------------- 1626 1627 theObject = the last word of string(theObject) 1628 delete the last char of theObject 1629 return theObject 1630 end 1631 1632 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1633 1634 on mGetPropertyRecursive me, proplist_source, list_propnames 1635 ----------------------------------- 1636 -- CREATED: 08.03.2010 1637 -- ACTION: Dereference a proplist recursively 1638 -- INPUT: <proplist_source> ; property list ; the source list 1639 -- <list_propnames> ; linear list ; linear list with property names, which lead to the last property 1640 -- RETURNS: any value 1641 -- EXAMPLE: sourceList = [#one:[#two:[#three:3]]] 1642 -- val = xscr().mGetPropertyRecursive(sourceList, [#one, #two, #three]) 1643 ----------------------------------- 1644 1645 if ilk(proplist_source) <> #proplist then return void 1646 if not(listP(list_propnames)) then return void 1647 cnt = count(list_propnames) 1648 if cnt < 1 then return void 1649 if cnt = 1 then return proplist_source[list_propnames[1]] 1650 propname = list_propnames[1] 1651 list_propnames.deleteAt(1) 1652 return mGetPropertyRecursive(me, proplist_source[propname], list_propnames) 1653 end 1477 1654 1478 1655 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx … … 1508 1685 1509 1686 on mGetNextPowerOfTwo me, breite 1687 powerList = mGetPowerOf2List(me) 1688 retval = powerList.findPosNear(integer(breite)) 1689 return powerList[min(retval, powerList.count)] 1690 end 1691 1692 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1693 1694 on mGetNextLowerPowerOfTwo me, breite 1695 powerList = mGetPowerOf2List(me) 1696 if powerList.getPos(breite) > 0 then return breite 1697 return powerList[max(1, powerList.findPosNear(integer(breite)) - 1)] 1698 end 1699 1700 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1701 1702 on mGetPowerOf2List me 1510 1703 theGlobs = mGetGlobalList(me) 1511 1704 gPowerList = theGlobs.getaprop(#gPowerList) 1512 1705 if ilk(gPowerList) <> #list then 1513 gPowerList = [ 2,4,8,16,32,64,128,256,512,1024]1706 gPowerList = [1,2,4,8,16,32,64,128,256,512,1024] 1514 1707 gPowerList.sort() 1515 1708 theGlobs[#gPowerList] = gPowerList 1516 1709 end if 1517 retval = gPowerList.findPosNear(integer(breite)) 1518 return gPowerList[min(retval, gPowerList.count)] 1519 end 1520 1521 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1522 1523 on mGetNextLowerPowerOfTwo me, breite 1524 theGlobs = mGetGlobalList(me) 1525 gPowerList = theGlobs.getaprop(#gPowerList) 1526 if ilk(gPowerList) <> #list then 1527 gPowerList = [1,2,4,8,16,32,64,128,256,512,1024] -- mac openGL only does 512 1528 gPowerList.sort() 1529 theGlobs[#gPowerList] = gPowerList 1530 end if 1531 if gPowerList.getPos(breite) > 0 then return breite 1532 return gPowerList[max(1, gPowerList.findPosNear(integer(breite)) - 1)] 1533 end 1534 1535 1710 return gPowerList 1711 end 1536 1712 1537 1713 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx … … 1632 1808 mp = "" 1633 1809 else 1634 mp = the applicationpath1810 mp = the applicationpath 1635 1811 end if 1636 1812 if length(mp) < 1 then … … 1739 1915 if delim = "\" then 1740 1916 if length(thePath) > 1 then 1741 if thePath.char[2] = ":" then 1742 num = charToNum(thePath.char[1]) 1743 if (num > 64 and num < 91) or (num > 96 and num < 123) then 1744 praef = thePath.char[1 .. 2] 1745 delete char 1 to 2 of thePath 1917 if thePath.char[2] = ":" then 1918 num = charToNum(thePath.char[1]) 1919 if (num > 64 and num < 91) or (num > 96 and num < 123) then 1920 praef = thePath.char[1 .. 2] 1921 delete char 1 to 2 of thePath 1922 else 1923 praef = "" 1924 end if 1746 1925 else 1747 1926 praef = "" 1748 1927 end if 1749 else1750 praef = ""1751 end if1752 1928 else 1753 1929 praef = "" … … 1768 1944 praef = "" 1769 1945 end if 1946 1947 ----------- now we want to strip the domain too, because there could be a : for the port 1948 ----------- but : is one of the chars we want to translate, therefore we exclude the doamin also 1949 if length(praef) > 0 then 1950 1951 repeat with xy = 1 to 2 1952 if char 1 of thePath = "/" then 1953 praef = praef & "/" 1954 delete char 1 of thePath 1955 end if 1956 end repeat 1957 1958 domain = offset("/", thePath) 1959 if domain = 0 then domain = length(thePath) 1960 praef = praef & thePath.char[1 .. domain] 1961 delete char 1 to domain of thePath 1962 end if 1963 ------------ 1770 1964 1771 1965 else … … 1898 2092 if voidP(uebersetzung) then return mReplacePlaceHoldersInString(me, aString, variablesList) 1899 2093 1900 currLang = call(#mGetPrefValue, [mGetXScript(#GetSetPrefs)], #gLanguage)1901 if voidP(currLang) then1902 currLang = theGlobs.getaprop(#gSprache)1903 if voidP(currLang) then currLang = 01904 call(#mSetPrefValue, [mGetXScript(#GetSetPrefs)], #gLanguage, currLang)1905 end if1906 ind = currLang + 11907 if ind > count(uebersetzung) then ind = 12094 currLang = call(#mGetPrefValue, [mGetXScript(#GetSetPrefs)], #gLanguage) 2095 if voidP(currLang) then 2096 currLang = theGlobs.getaprop(#gSprache) 2097 if voidP(currLang) then currLang = 0 2098 call(#mSetPrefValue, [mGetXScript(#GetSetPrefs)], #gLanguage, currLang) 2099 end if 2100 ind = currLang + 1 2101 if ind > count(uebersetzung) then ind = 1 1908 2102 1909 2103 return mReplacePlaceHoldersInString(me, uebersetzung[ind], variablesList) … … 2035 2229 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2036 2230 2231 on mSymbolify me, any_var 2232 any_var = string(any_var) 2233 repeat while char 1 of any_var = "#" 2234 delete char 1 of any_var 2235 end repeat 2236 any_var = mString2Symb(me, any_var) 2237 return symbol(any_var) 2238 end 2239 2240 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2241 2037 2242 on mString2Symb me, str 2038 2243 … … 2043 2248 end repeat 2044 2249 2250 offs = offset(".", str) 2251 repeat while offs > 0 2252 put "_d_" into char offs of str 2253 offs = offset(".", str) 2254 end repeat 2255 2256 offs = offset("-", str) 2257 repeat while offs > 0 2258 put "_b_" into char offs of str 2259 offs = offset("-", str) 2260 end repeat 2261 2045 2262 if integerP(integer(str.char[1])) then put "n__" before str 2046 2263 … … 2057 2274 put " " into char offs to offs+2 of str 2058 2275 offs = offset("_s_", str) 2276 end repeat 2277 2278 offs = offset("_d_", str) 2279 repeat while offs > 0 2280 put "." into char offs to offs+2 of str 2281 offs = offset("_d_", str) 2282 end repeat 2283 2284 offs = offset("_b_", str) 2285 repeat while offs > 0 2286 put "-" into char offs to offs+2 of str 2287 offs = offset("_b_", str) 2059 2288 end repeat 2060 2289 … … 2123 2352 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2124 2353 2125 2126 2127 2354 on mUpperCase me, aString 2128 2355 … … 2174 2401 end if 2175 2402 2176 -- pUPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZZ¯Å¯Ä"&vA& "¯Ñ¯É¯Ö¯á¯â¯à¯ä¯ã¯ç¯å¯é¯è¯ë¯ì¯í¯î¯ñ¯ï¯ö¯ôÇš¯ú¯Ü¯òŒíŒÞ" 2177 -- pLowercase = "abcdefghijklmnopqrstuvwxyz¯°¯"&"¯¢"&"¯§¯£¯¯ß¯©¯®¯¯Ž¯¯š¯Æ¯Ø¯±¯¯¯¥¯ð¯µ¯¯þ¯ª¯º¯¶¯ÞŒì¯ø" 2178 pCaseLists.setaprop(#uppercase, ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "¯Å", "¯Ä", vA, "A", "¯Ñ", "¯É", "¯Ö", "¯á", "¯â", "¯à", "¯ä", "¯ã", "¯ç", "¯å", "¯é", "¯è", "¯ë", "¯ì", "¯í", "¯î", "¯ñ", "¯ï", "¯ö", "¯ô", "U", "¯ú", "¯Ü", "¯ò", "Œí", "ŒÞ"]) 2179 pCaseLists.setaprop(#lowercase, ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "¯°", "¯", vA, "¯¢", "¯§", "¯£", "¯", "¯ß", "¯©", "¯®", "¯", "¯Ž", "¯", "¯š", "¯Æ", "¯Ø", "¯±", "¯", "¯", "¯¥", "¯ð", "¯µ", "¯", "¯þ", "¯ª", "¯º", "¯¶", "¯Þ", "Œì", "¯ø"]) 2403 -- pUPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZZÃÃ"&vA& "ÃÃà 2404 ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃâ¬ÃÃÃÅÅž" 2405 -- pLowercase = "abcdefghijklmnopqrstuvwxyzáà "&"â"&"ÀãåçéÚêëÃìîïñóòÎöõúùûÌÊÞÅÿ" 2406 pCaseLists.setaprop(#uppercase, ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "Ã", "Ã", vA, "A", "Ã", "Ã", "à 2407 ", "Ã", "Ã", "Ã", "Ã", "Ã", "Ã", "Ã", "Ã", "Ã", "Ã", "Ã", "Ã", "Ã", "Ã", "Ã", "Ã", "Ã", "U", "Ã", "Ã", "Ã", "Å", "Åž"]) 2408 pCaseLists.setaprop(#lowercase, ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "á", "à ", vA, "â", "À", "ã", "Ã¥", "ç", "é", "Ú", "ê", "ë", "Ã", "ì", "î", "ï", "ñ", "ó", "ò", "ÃŽ", "ö", "õ", "ú", "ù", "û", "ÃŒ", "Ê", "Þ", "Å", "ÿ"]) 2180 2409 2181 2410 end … … 2195 2424 li = ["Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"] 2196 2425 "pt": 2197 li = ["Segunda-feira","Ter ¯ßa-feira","Quarta-feira","Quinta-feira","Sexta-feira","S¯°bado","Domingo"]2426 li = ["Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado","Domingo"] 2198 2427 "fr": 2199 2428 li = ["Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"] 2200 2429 "es": 2201 li = ["Lunes","Martes","Mi ¯©rcoles","Jueves","Viernes","S¯°bado","Domingo"]2430 li = ["Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"] 2202 2431 "it": 2203 li = ["Luned ¯š","Marted¯š","Mercoled¯š","Gioved¯š","Venerd¯š","Sabato","Domenica"]2432 li = ["Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Domenica"] 2204 2433 "nl": 2205 2434 li = ["Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"] … … 2619 2848 put RETURN & "" after str 2620 2849 2621 put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str2850 put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str 2622 2851 put RETURN & "-- xxxxxxxxxxxxxxxxxx put <html>, <title> and <body> tags around chunk in order to use it as html of a text member" after str 2623 2852 put RETURN & "on mHTMLize me, str" after str … … 2656 2885 return str 2657 2886 end 2887 2888 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2889 2890 on getReferenceString me 2891 return "xscr()" 2892 end -
trunk/lingosource/castlib2/memberInfo.xml
r244 r245 49 49 <fName>subversionVersionChecker</fName> 50 50 </subversionVersionChecker> 51 <Script_Root_Object> 52 <scriptType>#parent</scriptType> 53 <comments>~/Documents/Scripts/lingo/Script_Root_Object.ls</comments> 54 <memberName>Script_Root_Object</memberName> 55 <fName>Script_Root_Object</fName> 56 </Script_Root_Object> 57 <scriptTextParser> 58 <scriptType>#parent</scriptType> 59 <comments>~/Documents/Scripts/lingo/scriptTextParser.ls</comments> 60 <memberName>scriptTextParser</memberName> 61 <fName>scriptTextParser</fName> 62 </scriptTextParser> 51 63 </Untitled>
Note: See TracChangeset
for help on using the changeset viewer.
