├── .gitignore ├── LICENSE ├── README.md ├── TODO ├── docs ├── _script.csharp.md ├── _script.javascript.md ├── _script.jspp.md ├── _script.lua.md ├── _script.options.md ├── _script.pascalscript.md ├── _script.perl.md ├── _script.php.md ├── _script.python.md ├── _script.ruby.md ├── _script.tcl.md ├── _script.vbscript.md └── _scriptq.md └── src ├── JSKit.dpr ├── JSKit.local ├── JSKit.res ├── LuaProject.inc ├── SpiderMonkey.dpr ├── SpiderMonkey.local ├── SpiderMonkey.res ├── UndConsole.pas ├── UndConst.pas ├── UndHelper_AS.pas ├── UndHelper_Obj.pas ├── UndHelper_QJS.pas ├── UndHelper_REM.pas ├── UndImporter.pas ├── UndImporterExt.pas ├── UndScriptExt.pas ├── Underscript.dpr ├── Underscript.inc ├── Underscript.otares ├── Underscript.res ├── luaonlua ├── LuaProject.inc ├── lua51host.dpr ├── lua51host.res ├── luaonlua.dpr ├── luaonlua.local ├── luaonlua.res ├── uLoL64.pas └── uLuaHost.pas ├── multipreter ├── LuaProject.inc ├── Multipreter.dpr ├── Multipreter.res ├── Multipreter_Icon.ico ├── UndHelper_Multi.pas ├── uJavaScript_JSC.pas ├── uJavaScript_Quick.pas └── uJavaScript_SM.pas ├── thirdparty ├── js_javascriptcore │ ├── JSK.API.pas │ ├── JSK.Base.pas │ ├── JSK.Components.pas │ ├── JSK.Config.inc │ └── LICENSE ├── js_quickjs │ ├── QUICKJS_LICENSE │ └── quickjs.pas ├── js_spidermonkey │ ├── License.txt │ ├── NamedPipesImpl.pas │ ├── js15decl.pas │ ├── jsDbgServer.pas │ └── jsintf.pas ├── js_v8 │ └── v8wrapper.pas ├── pascal │ ├── dws2.dcr │ ├── dws2.inc │ ├── dws2CLXGUIFunctions.pas │ ├── dws2CLXIDEUtils.pas │ ├── dws2CLXSymbolsToTree.pas │ ├── dws2ComConnector.pas │ ├── dws2Comp.pas │ ├── dws2CompStrings.pas │ ├── dws2Compiler.pas │ ├── dws2CompilerConfiguration.pas │ ├── dws2Connectors.pas │ ├── dws2ConsoleAdapter.pas │ ├── dws2Debugger.pas │ ├── dws2Errors.pas │ ├── dws2Experts.pas │ ├── dws2Exprs.pas │ ├── dws2FileFunctions.pas │ ├── dws2Functions.pas │ ├── dws2GlobalVarsFunctions.pas │ ├── dws2HtmlFilter.pas │ ├── dws2IDEUtils.pas │ ├── dws2MathFunctions.pas │ ├── dws2Stack.pas │ ├── dws2StringFunctions.pas │ ├── dws2StringResult.pas │ ├── dws2Strings.pas │ ├── dws2Symbols.pas │ ├── dws2SynEditUtils.pas │ ├── dws2TimeFunctions.pas │ ├── dws2Tokenizer.pas │ ├── dws2UnitUtils.pas │ ├── dws2VCLGUIFunctions.pas │ ├── dws2VCLIDEUtils.pas │ ├── dws2VCLSymbolsToTree.pas │ ├── dws2VariantFunctions.pas │ ├── dws2VclClxIdeUtils.inc │ ├── dws2VclClxSymbolsToTree.inc │ ├── dws_CLXmwPasToRtf.pas │ ├── dws_VCLmwPasToRtf.pas │ └── dws_VclClxmwPasToRtf.inc ├── pascal_rem │ ├── InvokeCall.inc │ ├── PascalScript.inc │ ├── eDefines.inc │ ├── uPSC_DB.pas │ ├── uPSC_buttons.pas │ ├── uPSC_classes.pas │ ├── uPSC_comobj.pas │ ├── uPSC_controls.pas │ ├── uPSC_dateutils.pas │ ├── uPSC_dll.pas │ ├── uPSC_extctrls.pas │ ├── uPSC_forms.pas │ ├── uPSC_graphics.pas │ ├── uPSC_menus.pas │ ├── uPSC_std.pas │ ├── uPSC_stdctrls.pas │ ├── uPSCompiler.pas │ ├── uPSComponent.dcr │ ├── uPSComponent.pas │ ├── uPSComponentExt.pas │ ├── uPSComponent_COM.pas │ ├── uPSComponent_Controls.pas │ ├── uPSComponent_DB.pas │ ├── uPSComponent_Default.pas │ ├── uPSComponent_Forms.pas │ ├── uPSComponent_StdCtrls.pas │ ├── uPSDebugger.pas │ ├── uPSDisassembly.pas │ ├── uPSPreProcessor.pas │ ├── uPSR_DB.pas │ ├── uPSR_buttons.pas │ ├── uPSR_classes.pas │ ├── uPSR_comobj.pas │ ├── uPSR_controls.pas │ ├── uPSR_dateutils.pas │ ├── uPSR_dll.pas │ ├── uPSR_extctrls.pas │ ├── uPSR_forms.pas │ ├── uPSR_graphics.pas │ ├── uPSR_menus.pas │ ├── uPSR_std.pas │ ├── uPSR_stdctrls.pas │ ├── uPSRuntime.pas │ └── uPSUtils.pas ├── php │ ├── DelphiFunctions.pas │ ├── PHP.INC │ ├── PHP4DelphiD2006.bdsproj │ ├── PHP4DelphiD2006.dpk │ ├── PHP4DelphiD2006.res │ ├── PHPAPI.pas │ ├── PHPCommon.pas │ ├── PHPCustomLibrary.pas │ ├── PHPFunctions.pas │ ├── PHPLibrary.pas │ ├── PHPProjectWizard.pas │ ├── PHPProjectWizard.res │ ├── PHPTypes.pas │ ├── ZENDAPI.pas │ ├── license.txt │ ├── logos.pas │ ├── php4App.dpr │ ├── php4App.res │ ├── php4AppIntf.pas │ ├── php4AppUnit.pas │ ├── php4DelphiD2005.dpk │ ├── php4DelphiD2005.res │ ├── php4DelphiD2007.dpk │ ├── php4DelphiD2007.res │ ├── php4DelphiD2009.dpk │ ├── php4DelphiD2009.res │ ├── php4DelphiD2010.dpk │ ├── php4DelphiD2010.res │ ├── php4DelphiD5.dpk │ ├── php4DelphiD5.res │ ├── php4DelphiD6.dpk │ ├── php4DelphiD6.res │ ├── php4DelphiD7.dpk │ ├── php4DelphiD7.res │ ├── php4DelphiR2005.dpk │ ├── php4DelphiR2005.res │ ├── php4DelphiR2006.bdsproj │ ├── php4DelphiR2006.dpk │ ├── php4DelphiR2006.res │ ├── php4DelphiR2007.dpk │ ├── php4DelphiR2007.res │ ├── php4DelphiR2009.dpk │ ├── php4DelphiR2009.res │ ├── php4DelphiR2010.dpk │ ├── php4DelphiR2010.res │ ├── php4DelphiR5.dpk │ ├── php4DelphiR5.res │ ├── php4DelphiR6.dpk │ ├── php4DelphiR6.res │ ├── php4DelphiR7.dpk │ ├── php4DelphiR7.res │ ├── php4DelphiReg.pas │ ├── php4DelphiSplash.res │ ├── php4DelphiWeb.pas │ ├── php4delphi.dcr │ ├── php4delphi.pas │ ├── phpAbout.dfm │ ├── phpAbout.pas │ ├── phpApp.pas │ ├── phpClass.pas │ ├── phpModules.pas │ ├── phpWeb.pas │ ├── readme.txt │ ├── zendTypes.pas │ └── zend_dynamic_array.pas └── python │ ├── Definition.Inc │ ├── MethodCallBack.pas │ ├── PythonEngine.pas │ └── VarPyth.pas ├── uActiveScript.pas ├── uJavaScript_JSC.pas ├── uJavaScript_QJS.pas ├── uJavaScript_SM.pas ├── uJavaScript_V8.pas ├── uPascal.pas ├── uPascal_DWS.pas ├── uPython.pas ├── unused_old └── uRuby.pas ├── v8.dpr ├── v8.local └── v8.res /.gitignore: -------------------------------------------------------------------------------- 1 | __history/ 2 | __recovery/ 3 | *.~* 4 | *.cfg 5 | *.dof 6 | *.dcu 7 | *.dll 8 | *.dproj 9 | *.dproj.local 10 | *.identcache 11 | *.stat 12 | Thumbs.db -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2003-2018, Syhunt Informatica 4 | Portions copyright (c) 2003-2020, Felipe Daragon 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | * jsintf.pas must support variants for RTTI 2 | * It would be nice to have a 64-bit compatible version of php4Delphi. While we 3 | don't have one, Underscript 2.0 is calling the PHP 64-bit binary directly. -------------------------------------------------------------------------------- /docs/_script.csharp.md: -------------------------------------------------------------------------------- 1 | ## CSharp Support 2 | 3 | ### Hello World 4 | 5 | ```lua 6 | require "Underscript" 7 | 8 | function writeln(s) _script.csharp 9 | [[ 10 | Console.WriteLine(s.ToUpper()); 11 | ]] 12 | end 13 | 14 | writeln("Hello World!") 15 | ``` -------------------------------------------------------------------------------- /docs/_script.javascript.md: -------------------------------------------------------------------------------- 1 | ## JavaScript Support 2 | 3 | You can run JS code through the following methods: 4 | 5 | * _script.**javascript** - default JS engine (QuickJS engine) 6 | * _script.**jscript** - MS JavaScript engine 7 | * _script.js.**core** - Apple's JavaScriptCore engine 8 | * _script.js.**node** or **nodestrict** - Node.JS 9 | * _script.js.**quick** - QuickJS engine 10 | * _script.js.**spider** - SpiderMonkey engine 11 | * _script.js.**v8** - Pure V8 engine 12 | 13 | ### Hello World (Using NodeJS) 14 | 15 | ```lua 16 | require "Underscript" 17 | 18 | -- Prints "Hello World!" in uppercase 19 | function say(s) _script.js.node 20 | [[ 21 | console.log(s.toUpperCase()+'!'); 22 | ]] 23 | end 24 | 25 | say('Hello World') 26 | ``` 27 | 28 | ### Hello World (Using pure V8 engine) 29 | 30 | ```lua 31 | require "Underscript" 32 | 33 | -- Prints "Hello World!" in uppercase 34 | function say(s) _script.js.v8 35 | [[ 36 | print(s.toUpperCase()+'!'); 37 | ]] 38 | end 39 | 40 | say('Hello World') 41 | ``` 42 | 43 | ### Hello World (Using MS JScript) 44 | 45 | ```lua 46 | require "Underscript" 47 | 48 | -- Prints "Hello World!" in uppercase 49 | function say(s) _script.jscript 50 | [[ 51 | UConsole.WriteLn(s.toUpperCase()+'!'); 52 | ]] 53 | end 54 | 55 | say('Hello World') 56 | ``` 57 | 58 | ### Function Example (Using MS JScript) 59 | 60 | ```lua 61 | require "Underscript" 62 | 63 | function encode64(s) _script.jscript 64 | [[ 65 | var keyStr = "ABCDEFGHIJKLMNOP" + 66 | "QRSTUVWXYZabcdef" + 67 | "ghijklmnopqrstuv" + 68 | "wxyz0123456789+/" + 69 | "="; 70 | var input = escape(s); 71 | var output = ""; 72 | var chr1, chr2, chr3 = ""; 73 | var enc1, enc2, enc3, enc4 = ""; 74 | var i = 0; 75 | 76 | do { 77 | chr1 = input.charCodeAt(i++); 78 | chr2 = input.charCodeAt(i++); 79 | chr3 = input.charCodeAt(i++); 80 | 81 | enc1 = chr1 >> 2; 82 | enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); 83 | enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); 84 | enc4 = chr3 & 63; 85 | 86 | if (isNaN(chr2)) { 87 | enc3 = enc4 = 64; 88 | } else if (isNaN(chr3)) { 89 | enc4 = 64; 90 | } 91 | 92 | output = output + 93 | keyStr.charAt(enc1) + 94 | keyStr.charAt(enc2) + 95 | keyStr.charAt(enc3) + 96 | keyStr.charAt(enc4); 97 | chr1 = chr2 = chr3 = ""; 98 | enc1 = enc2 = enc3 = enc4 = ""; 99 | } while (i < input.length); 100 | 101 | s = output; 102 | ]] 103 | return s 104 | end 105 | ``` 106 | 107 | -------------------------------------------------------------------------------- /docs/_script.jspp.md: -------------------------------------------------------------------------------- 1 | ## JavaScript Supersets Support 2 | 3 | You can also run JS code through the following methods: 4 | 5 | * _script.**typescript** - TypeScript (Deno), same as _script.jspp.tsdeno 6 | * _script.jspp.**script** - JS++ (by Onux) 7 | * _script.jspp.**tsdeno** - TypeScript (Deno) 8 | * _script.jspp.**tiscript** - TScript (by Terra Informatica) 9 | 10 | ### Hello World (Using TypeScript) 11 | 12 | ```lua 13 | require "Underscript" 14 | 15 | function say(s) _script.typescript 16 | [[ 17 | console.log(s.toUpperCase()+'!'); 18 | ]] 19 | end 20 | 21 | say('Hello World') 22 | ``` 23 | 24 | ### Hello World (Using JS++) 25 | 26 | ```lua 27 | require "Underscript" 28 | 29 | -- Prints "Hello World!" in uppercase 30 | function say(s) _script.jspp.script 31 | [[ 32 | Console.log(s.toUpperCase()+'!'); 33 | ]] 34 | end 35 | 36 | say('Hello World') 37 | ``` 38 | 39 | ### Hello World (Using TIScript) 40 | 41 | ```lua 42 | require "Underscript" 43 | 44 | -- Prints "Hello World!" in uppercase 45 | function say(s) _script.jscript 46 | [[ 47 | stdout.println(s.toUpperCase()+"!"); 48 | ]] 49 | end 50 | 51 | say('Hello World') 52 | ``` 53 | 54 | -------------------------------------------------------------------------------- /docs/_script.lua.md: -------------------------------------------------------------------------------- 1 | ## Lua Support 2 | 3 | You can also run Lua code through the _script method: 4 | 5 | * _script.lua.**script** (or lua.v51) - runs the code using Lua 5.1 64-bit version as external Lua process 6 | * _script.lua.**script32** - runs the code using Lua 5.1 32-bit version as external Lua process 7 | 8 | * _script.lua.**v51**, **v52**, **v53** or **v54** - runs the code using specific Lua version as external Lua processes 9 | * _script.lua.**in** - runs the code within the same Lua thread and process 10 | * _script.lua.**jit** - runs the code using LuaJIT 5.1 as an external Lua process 11 | 12 | 13 | 14 | ### Example - Hello World 15 | 16 | ```lua 17 | require "Underscript" 18 | 19 | -- Prints "Hello World!" in uppercase 20 | function say(s) _script.lua.script 21 | [[ 22 | print(string.upper(s)); 23 | ]] 24 | end 25 | 26 | say(" Hello World! ") 27 | ``` -------------------------------------------------------------------------------- /docs/_script.options.md: -------------------------------------------------------------------------------- 1 | ## Options 2 | 3 | The options table can be used to enable or disable library features. The following options are available: 4 | 5 | name | return type | description 6 | --- | --- | --- 7 | **modulename** | string | Gets or sets the module name. Default: UConsole 8 | **redirectio** | boolean | Enables or disables the IO redirection. Enabled by default in non-console app. When enabled, IO module and functions may be called during a script execution. 9 | **handleerrors** | boolean | Enables or disables the use of Lua error handling. Enabled by default. If disabled, luaL_error() will not be called if a script error occurs. 10 | **usevars** | boolean | Enables or disables the use of Lua variables (local or global). Enabled by default. 11 | **useglobals** | boolean | Enables or disables the use of global Lua variables. Disabled by default. Requires usevars enabled. 12 | **uselocals** | boolean | Enables or disables the use of local Lua variables. Enabled by default. Requires usevars enabled. 13 | 14 | ### IO Redirection Example 15 | 16 | ```lua 17 | require "Underscript" 18 | _script.redirectio = true 19 | ``` 20 | 21 | After this, the following functions from your Lua script will be called by Underscript when required and if these have been declared: 22 | 23 | ```lua 24 | function uconsole.debug(text) 25 | -- (...) 26 | end 27 | 28 | function uconsole.writeln(text) 29 | -- (...) 30 | end 31 | 32 | function uconsole.write(text) 33 | -- (...) 34 | end 35 | 36 | function uconsole.errorln(line,msg) 37 | -- (...) 38 | end 39 | ``` -------------------------------------------------------------------------------- /docs/_script.pascalscript.md: -------------------------------------------------------------------------------- 1 | ## Pascal Support 2 | 3 | ### Example 1 - Hello World 4 | 5 | ```lua 6 | require "Underscript" 7 | 8 | -- Prints "Hello World!" in uppercase 9 | function say(s) _script.pascal 10 | [[ 11 | UConsole.WriteLn(Uppercase(Trim(s))); 12 | ]] 13 | end 14 | 15 | say(" Hello World! ") 16 | ``` 17 | 18 | ### Example 2 - Pascal Program 19 | 20 | ```lua 21 | require "Underscript" 22 | 23 | function printcrc16() _script.pas.prog 24 | [[ 25 | const DivPol = $1021; 26 | const Amount = 20000; 27 | 28 | function CRC16(s:string):Word; 29 | var 30 | CRC:Word; 31 | n,Bit:Byte; 32 | begin 33 | CRC:=0; 34 | for n:=1 to Length(s) do 35 | begin 36 | CRC:=CRC xor (ord(s[n]) shl 8); 37 | for bit:=0 to 7 do 38 | begin 39 | if CRC and $8000 <> 0 then 40 | CRC:=(CRC shl 1) xor DivPol 41 | else 42 | CRC:=CRC shl 1; 43 | end; 44 | end; 45 | result:=CRC; 46 | end; 47 | 48 | begin 49 | UConsole.WriteLn(IntToStr(CRC16('astring'))); 50 | end. 51 | ]] 52 | end 53 | ``` 54 | 55 | **Note**: Pascal is case-insensitive - be careful to not use Lua variables with the same name and different case. 56 | 57 | ### Credits 58 | 59 | Pascal support made possible by the [RemObjects Pascal Script](http://www.remobjects.com/) and DWS projects. -------------------------------------------------------------------------------- /docs/_script.perl.md: -------------------------------------------------------------------------------- 1 | ## Perl Support 2 | 3 | ### Hello World Example (using embedded Strawberry Perl) 4 | 5 | ```lua 6 | require "Underscript" 7 | 8 | -- Prints "Hello World!" 9 | function say(s) _script.perl 10 | [[ 11 | print($s.'!'); 12 | ]] 13 | end 14 | 15 | say('Hello World') 16 | ``` 17 | 18 | ### Hello World Example (using ActivePerl) 19 | 20 | **Note**: The ActivePerl installer must be downloaded separately from the [official site](http://www.activestate.com/activeperl). 21 | 22 | ```lua 23 | require "Underscript" 24 | 25 | -- Prints "Hello World!" 26 | function say(s) _script.alpha.perlactive 27 | [[ 28 | $UConsole->WriteLn($s.'!'); 29 | ]] 30 | end 31 | 32 | say('Hello World') 33 | ``` 34 | 35 | -------------------------------------------------------------------------------- /docs/_script.php.md: -------------------------------------------------------------------------------- 1 | ## PHP Support 2 | 3 | ### Hello World Example 4 | 5 | ```lua 6 | require "Underscript" 7 | 8 | function echo(s) _script.php 9 | [[ 10 | echo($s); 11 | ]] 12 | end 13 | 14 | echo("Hello World!") 15 | ``` 16 | 17 | ### Function Example 18 | 19 | ```lua 20 | require "Underscript" 21 | 22 | function crc16(s) _script.php 23 | [[ 24 | $crc = 0xFFFF; 25 | for ($x = 0; $x < strlen ($s); $x++) { 26 | $crc = $crc ^ ord($s[$x]); 27 | for ($y = 0; $y < 8; $y++) { 28 | if (($crc & 0x0001) == 0x0001) { 29 | $crc = (($crc >> 1) ^ 0xA001); 30 | } else { $crc = $crc >> 1; } 31 | } 32 | } 33 | $s = $crc; 34 | ]] 35 | return s 36 | end 37 | ``` 38 | 39 | ### Include Example 40 | 41 | myecho.php: 42 | ```php 43 | 48 | ``` 49 | 50 | demo.lua: 51 | ```lua 52 | require "Underscript" 53 | 54 | function echo(s) _script.php 55 | [[ 56 | include('myecho.php'); 57 | myecho($s); 58 | ]] 59 | end 60 | 61 | echo("Hello World!") 62 | ``` 63 | 64 | ### Custom PHP Functions 65 | * **uconsole_write**(v) 66 | Writes a variable to the console without creating a new line 67 | * **uconsole_writeln**(v) 68 | Writes a new line to the console -------------------------------------------------------------------------------- /docs/_script.python.md: -------------------------------------------------------------------------------- 1 | ## Python Support 2 | 3 | ### Hello World Example (using embedded Python) 4 | 5 | ```lua 6 | require "Underscript" 7 | 8 | -- Prints "Hello World!" in uppercase 9 | function say(s) _script.python 10 | [[ 11 | print s.upper() 12 | ]] 13 | end 14 | 15 | say('Hello World!') 16 | ``` 17 | 18 | ### Hello World Example (using environment's Python) 19 | 20 | Note: The Python installer must be downloaded separately from the [official site](http://python.org/). 21 | 22 | ```lua 23 | -- See above example 24 | function say(s) _script.alpha.pythonenv 25 | -- .. 26 | ``` -------------------------------------------------------------------------------- /docs/_script.ruby.md: -------------------------------------------------------------------------------- 1 | ## Ruby Support 2 | 3 | ### Hello World 4 | 5 | ```lua 6 | require "Underscript" 7 | 8 | function puts(s) _script.ruby 9 | [[ 10 | puts(s) 11 | ]] 12 | end 13 | 14 | puts("Hello World!") 15 | ``` 16 | 17 | ### Function Example 18 | 19 | ```lua 20 | require "Underscript" 21 | 22 | function crc32(s) _script.ruby 23 | [[ 24 | def rb_crc32(c) 25 | r = 0xFFFFFFFF 26 | c.each_byte do |b| 27 | r ^= b 28 | 8.times do 29 | r = (r>>1) ^ (0xEDB88320 * (r & 1)) 30 | end 31 | end 32 | r ^ 0xFFFFFFFF 33 | end 34 | s = rb_crc32(s) 35 | ]] 36 | return s 37 | end 38 | ``` -------------------------------------------------------------------------------- /docs/_script.tcl.md: -------------------------------------------------------------------------------- 1 | ## TCL Support 2 | 3 | ### Hello World 4 | 5 | ```lua 6 | require "Underscript" 7 | 8 | function test(s) _script.tcl 9 | [[ 10 | set s "Hello World!"; 11 | puts s; 12 | ]] 13 | return s 14 | end 15 | 16 | test("Change me!") 17 | ``` -------------------------------------------------------------------------------- /docs/_script.vbscript.md: -------------------------------------------------------------------------------- 1 | ## VBScript Support 2 | 3 | ### Hello World Example 4 | 5 | ```lua 6 | require "Underscript" 7 | 8 | -- Prints "Hello World!" 9 | function say(s) _script.vbscript 10 | [[ 11 | UConsole.WriteLn(s & "!") 12 | ]] 13 | end 14 | 15 | say("Hello World") 16 | ``` 17 | 18 | **Note**: VBScript is case-insensitive - be careful to not use Lua variables with the same name and different case. 19 | -------------------------------------------------------------------------------- /docs/_scriptq.md: -------------------------------------------------------------------------------- 1 | ## Quiet Script 2 | By using _scriptq instead of _script, the script runs in quiet mode, which prevents any output from reaching the screen. 3 | 4 | This feature is still beta and may not work for certain languages yet. -------------------------------------------------------------------------------- /src/JSKit.dpr: -------------------------------------------------------------------------------- 1 | library JSKit; 2 | 3 | { 4 | UnderScript JavaScriptCore Lua library 5 | Copyright (c) 2013-2020 Felipe Daragon 6 | License: MIT (http://opensource.org/licenses/mit-license.php) 7 | 8 | This library extends Underscript to run JavaScript using the JavaScriptCore 9 | engine 10 | } 11 | 12 | {$I Underscript.inc} 13 | {$I CatCompactLib.inc} 14 | 15 | uses 16 | Lua, pLua, pLuaTable, UndConst, 17 | uJavaScript_JSC, 18 | JSK.Base in 'thirdparty\js_javascriptcore\JSK.Base.pas', 19 | JSK.API in 'thirdparty\js_javascriptcore\JSK.API.pas', 20 | CatStrings; 21 | 22 | 23 | {$R *.res} 24 | 25 | function lua_javascriptcore_run(L: Plua_State): integer; cdecl; 26 | begin 27 | if plua_validateargs(L, Result, [LUA_TSTRING]).OK then begin 28 | ReadScriptSettings(L); 29 | result := JavaScriptJSC_Run(L); 30 | end; 31 | end; 32 | 33 | function luaopen_Underscript_JSKit(L: plua_State): integer; cdecl; 34 | begin 35 | result := RegisterScriptEngine(L, 'js', 'core', lua_javascriptcore_run); 36 | end; 37 | 38 | Exports 39 | luaopen_Underscript_JSKit; 40 | 41 | begin 42 | 43 | end. 44 | -------------------------------------------------------------------------------- /src/JSKit.local: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /src/JSKit.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/JSKit.res -------------------------------------------------------------------------------- /src/LuaProject.inc: -------------------------------------------------------------------------------- 1 | {$DEFINE LUA51} 2 | //{$DEFINE LUAJIT} 3 | -------------------------------------------------------------------------------- /src/SpiderMonkey.dpr: -------------------------------------------------------------------------------- 1 | library SpiderMonkey; 2 | 3 | { 4 | UnderScript SpiderMonkey Lua library 5 | Copyright (c) 2013-2020 Felipe Daragon 6 | License: MIT (http://opensource.org/licenses/mit-license.php) 7 | 8 | This library extends Underscript to run JavaScript using the SpiderMonkey 9 | engine 10 | } 11 | 12 | {$I Underscript.inc} 13 | {$I CatCompactLib.inc} 14 | 15 | uses 16 | Lua, pLua, pLuaTable, UndConst, 17 | uJavaScript_SM, 18 | js15decl in 'thirdparty\js_spidermonkey\js15decl.pas', 19 | jsDbgServer in 'thirdparty\js_spidermonkey\jsDbgServer.pas', 20 | jsintf in 'thirdparty\js_spidermonkey\jsintf.pas', 21 | NamedPipesImpl in 'thirdparty\js_spidermonkey\NamedPipesImpl.pas', 22 | CatStrings; 23 | 24 | 25 | {$R *.res} 26 | 27 | function lua_javascriptmonkey_run(L: Plua_State): integer; cdecl; 28 | begin 29 | if plua_validateargs(L, Result, [LUA_TSTRING]).OK then begin 30 | ReadScriptSettings(L); 31 | result := JavaScriptSM_Run(L); 32 | end; 33 | end; 34 | 35 | function luaopen_Underscript_SpiderMonkey(L: plua_State): integer; cdecl; 36 | begin 37 | result := RegisterScriptEngine(L, 'js', 'spider', lua_javascriptmonkey_run); 38 | end; 39 | 40 | Exports 41 | luaopen_Underscript_SpiderMonkey; 42 | 43 | begin 44 | 45 | end. 46 | -------------------------------------------------------------------------------- /src/SpiderMonkey.local: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /src/SpiderMonkey.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/SpiderMonkey.res -------------------------------------------------------------------------------- /src/UndConsole.pas: -------------------------------------------------------------------------------- 1 | unit UndConsole; 2 | 3 | { 4 | UnderScript Console 5 | Copyright (c) 2013-2020 Felipe Daragon 6 | License: MIT (http://opensource.org/licenses/mit-license.php) 7 | } 8 | 9 | interface 10 | 11 | uses 12 | SysUtils, Lua, pLua, pLuaTable, CatStrings, CatUtils, UndConst, CatFiles, 13 | CatLogger; 14 | 15 | type 16 | TCrossModuleCheckResult = record 17 | Exists:boolean; 18 | Script:string; 19 | end; 20 | 21 | function uConsoleCrossModuleExists(L: plua_State; const module, ext:string):TCrossModuleCheckResult; 22 | procedure uConsoleDebug(L: plua_State; s: String); 23 | procedure uConsoleErrorLn(L: plua_State; line: integer; msg: String); 24 | procedure uConsoleWrite(L: plua_State; s: String); 25 | procedure uConsoleWriteLn(L: plua_State; s: String); 26 | procedure Und_PushScriptResult(L: plua_State; res:TUndScriptResult; sw:TCatStopWatch); 27 | 28 | 29 | implementation 30 | 31 | procedure Und_PushScriptResult(L: plua_State; res:TUndScriptResult; sw:TCatStopWatch); 32 | begin 33 | res.elapsedtime := GetStopWatchElapsedTime(sw).MsAsString; 34 | lua_newtable(L); 35 | plua_SetFieldValue(L, 'success', res.success); 36 | plua_SetFieldValue(L, 'errormsg', res.ErrorMessage); 37 | plua_SetFieldValue(L, 'expresult', res.expressionresult); 38 | plua_SetFieldValue(L, 'elapsedtime', res.elapsedtime); 39 | end; 40 | 41 | procedure uConsoleDebug(L: plua_State; s: String); 42 | const cFuncName = 'debug'; 43 | begin 44 | if rudRedirectIO = true then begin 45 | if plua_tablefunctionexists(L, cUndConsoleLibName, cFuncName) then 46 | plua_tablecallfunction(L, cUndConsoleLibName, cFuncName, [s]); 47 | end else begin 48 | OutDebug(s); 49 | end; 50 | end; 51 | 52 | procedure uConsoleErrorLn(L: plua_State; line: integer; msg: String); 53 | const cFuncName = 'errorln'; 54 | begin 55 | if rudRedirectIO = true then begin 56 | if plua_tablefunctionexists(L, cUndConsoleLibName, cFuncName) then 57 | plua_tablecallfunction(L, cUndConsoleLibName, cFuncName, [line, msg]); 58 | end; 59 | // else begin 60 | // uConsoleWriteError(line, msg); 61 | // end; 62 | if rudHandleErrors = true then 63 | luaL_error(L, '_script:('+inttostr(line)+'): '+msg); 64 | end; 65 | 66 | function uConsoleCrossModuleExists(L: plua_State; const module, ext:string): 67 | TCrossModuleCheckResult; 68 | var fn:string; 69 | begin 70 | result.Script := emptystr; 71 | fn := extractfilepath(paramstr(0))+'\Lib\crosslang\'+module+'.'+ext; 72 | result.Exists := fileexists(fn); 73 | if (result.Exists = true) then begin 74 | result.Script := GetFileToStr(fn); 75 | end else begin 76 | if rudHandleErrors = true then 77 | luaL_error(L, 'cross-language module '''+module+''' not found.'); 78 | end; 79 | end; 80 | 81 | procedure uConsoleWriteError(line: integer; msg: String); 82 | begin 83 | system.WriteLn('--('+inttostr(line)+'): '+msg); 84 | end; 85 | 86 | procedure uConsoleWrite(L: plua_State; s: String); 87 | const cFuncName = 'write'; 88 | begin 89 | if rudRedirectIO = true then begin 90 | if plua_tablefunctionexists(L, cUndConsoleLibName, cFuncName) then 91 | plua_tablecallfunction(L, cUndConsoleLibName, cFuncName, [s]); 92 | end else begin 93 | system.Write(s); 94 | end; 95 | end; 96 | 97 | procedure uConsoleWriteLn(L: plua_State; s: String); 98 | const cFuncName = 'writeln'; 99 | begin 100 | if rudRedirectIO = true then begin 101 | if plua_tablefunctionexists(L, cUndConsoleLibName, cFuncName) then 102 | plua_tablecallfunction(L, cUndConsoleLibName, cFuncName, [s]); 103 | end else begin 104 | system.WriteLn(s); 105 | end; 106 | end; 107 | 108 | // ------------------------------------------------------------------------// 109 | end. 110 | -------------------------------------------------------------------------------- /src/UndHelper_AS.pas: -------------------------------------------------------------------------------- 1 | unit UndHelper_AS; 2 | 3 | { 4 | UnderScript Helper for ActiveScript Component 5 | Copyright (c) 2013-2020 Felipe Daragon 6 | License: MIT (http://opensource.org/licenses/mit-license.php) 7 | } 8 | 9 | interface 10 | 11 | uses 12 | ObjComAuto, Lua, pLua, Variants, CatJSON, CatUtils, SysUtils, UndConst, 13 | UndConsole; 14 | 15 | type 16 | {$METHODINFO ON} 17 | TUndHelper = class(TObjectDispatch, IDispatch) 18 | protected 19 | public 20 | LuaState: PLua_State; 21 | constructor Create; 22 | procedure Debug(s: string); 23 | procedure Run(Script: String); 24 | function GetG(valName: String): Variant; 25 | procedure SetG(valName: String; const AValue: Variant); 26 | function GetL(valName: String): Variant; 27 | procedure SetL(valName: String; const AValue: Variant); 28 | procedure Write(s: String); 29 | procedure WriteLn(s: String); 30 | published 31 | end; 32 | {$METHODINFO OFF} 33 | 34 | var 35 | UndHelper: TUndHelper; 36 | 37 | implementation 38 | 39 | constructor TUndHelper.Create; 40 | begin 41 | inherited Create(Self, false); 42 | end; 43 | 44 | procedure TUndHelper.Debug(s: string); 45 | begin 46 | uConsoleDebug(LuaState, s); 47 | end; 48 | 49 | procedure TUndHelper.Run(Script: String); 50 | begin 51 | plua_dostring(LuaState, Script); 52 | end; 53 | 54 | function TUndHelper.GetL(valName: String): Variant; 55 | var 56 | v: Variant; 57 | begin 58 | // this is necessary because if you write to the result directy it will not work for locals 59 | try 60 | v := pLua_GetLocal(LuaState, valName); 61 | except 62 | end; 63 | //writeln('debug: returning GetL:'+valname+' result:'+v); 64 | result := v; 65 | end; 66 | 67 | function TUndHelper.GetG(valName: String): Variant; 68 | var 69 | v: Variant; 70 | begin 71 | try 72 | v := pLua_GetGlobal(LuaState, valName); 73 | except 74 | end; 75 | // writeln('debug: returning GetG:'+valname+' result:'+v); 76 | result := v; 77 | end; 78 | 79 | procedure TUndHelper.SetG(valName: String; const AValue: Variant); 80 | var v:variant; 81 | begin 82 | v := AValue; 83 | try 84 | pLua_SetGlobal(LuaState, valName, v); 85 | except 86 | end; 87 | end; 88 | 89 | procedure TUndHelper.SetL(valName: String; const AValue: Variant); 90 | var v:Variant; 91 | begin 92 | v := AValue; 93 | //writeln('debug: setting SetL:'+valname+' value:'+avalue); 94 | try 95 | pLua_SetLocal(LuaState, valName, v); 96 | except 97 | end; 98 | end; 99 | 100 | procedure TUndHelper.Write(s: String); 101 | begin 102 | uConsoleWrite(LuaState, s); 103 | end; 104 | 105 | procedure TUndHelper.WriteLn(s: String); 106 | begin 107 | //OutDebug('printwriteln:'+s+';expecting: '+rudCustomFunc_WriteLn); 108 | uConsoleWriteLn(LuaState, s); 109 | end; 110 | 111 | initialization 112 | 113 | UndHelper := TUndHelper.Create; 114 | 115 | finalization 116 | 117 | UndHelper.free; 118 | 119 | end. 120 | -------------------------------------------------------------------------------- /src/UndHelper_Obj.pas: -------------------------------------------------------------------------------- 1 | unit UndHelper_Obj; 2 | 3 | { 4 | UnderScript Helper object 5 | Copyright (c) 2013-2020 Felipe Daragon 6 | License: MIT (http://opensource.org/licenses/mit-license.php) 7 | } 8 | 9 | interface 10 | 11 | uses 12 | Lua, pLua, Variants, UndConst, UndConsole; 13 | 14 | type 15 | {$METHODINFO ON} 16 | TUndHelper = class 17 | public 18 | LuaState: PLua_State; 19 | constructor Create; 20 | procedure Debug(s: String); 21 | procedure Write(s: String); 22 | procedure WriteLn(s: String); 23 | procedure Run(Script: String); 24 | function GetG(valName: String): Variant; 25 | procedure SetG(valName: String; const AValue: Variant); 26 | // getters local 27 | function GetL(valName: String): Variant; 28 | function GetLBoolean(valName: String): boolean; 29 | function GetLString(valName: String): String; 30 | function GetLInteger(valName: String): integer; 31 | // setters local 32 | procedure SetL(valName: String; const AValue: Variant); 33 | procedure SetLBoolean(valName: String; AValue: Boolean); 34 | procedure SetLString(valName: String; AValue: String); 35 | procedure SetLInteger(valName: String; AValue: Integer); 36 | end; 37 | {$METHODINFO OFF} 38 | 39 | var 40 | UndHelper: TUndHelper; 41 | 42 | implementation 43 | 44 | constructor TUndHelper.Create; 45 | begin 46 | inherited Create; 47 | end; 48 | 49 | procedure TUndHelper.Run(Script: String); 50 | begin 51 | luaL_loadbuffer(LuaState, PAnsiChar(AnsiString(Script)), Length(Script), nil); 52 | lua_pcall(LuaState, 0, 0, 0); 53 | end; 54 | 55 | procedure TUndHelper.SetL(valName: String; const AValue: Variant); 56 | begin 57 | pLua_SetLocal(LuaState, valName, AValue); 58 | end; 59 | 60 | procedure TUndHelper.SetLString(valName: String; AValue: String); 61 | begin 62 | pLua_SetLocal(LuaState, valName, AValue); 63 | end; 64 | 65 | procedure TUndHelper.SetLInteger(valName: String; AValue: Integer); 66 | begin 67 | pLua_SetLocal(LuaState, valName, AValue); 68 | end; 69 | 70 | procedure TUndHelper.SetLBoolean(valName: String; AValue: Boolean); 71 | begin 72 | pLua_SetLocal(LuaState, valName, AValue); 73 | end; 74 | 75 | function TUndHelper.GetL(valName: String): Variant; 76 | var 77 | v: Variant; 78 | begin 79 | try 80 | v := pLua_GetLocal(LuaState, valName); 81 | except 82 | end; 83 | //writeln('v is:'+v); 84 | result := v; 85 | end; 86 | 87 | function TUndHelper.GetLString(valName: String): string; 88 | begin 89 | result := pLua_GetLocal(LuaState, valName); 90 | end; 91 | 92 | function TUndHelper.GetLBoolean(valName: String): boolean; 93 | begin 94 | result := pLua_GetLocal(LuaState, valName); 95 | end; 96 | 97 | function TUndHelper.GetLInteger(valName: String): integer; 98 | begin 99 | result := pLua_GetLocal(LuaState, valName); 100 | end; 101 | 102 | procedure TUndHelper.SetG(valName: String; const AValue: Variant); 103 | var 104 | v: Variant; 105 | begin 106 | v := AValue; 107 | try 108 | pLua_SetGlobal(LuaState, valName, v); 109 | except 110 | end; 111 | end; 112 | 113 | function TUndHelper.GetG(valName: String): Variant; 114 | var 115 | v: Variant; 116 | begin 117 | try 118 | v := pLua_GetGlobal(LuaState, valName); 119 | except 120 | end; 121 | result := v; 122 | end; 123 | 124 | procedure TUndHelper.Debug(s: String); 125 | begin 126 | uConsoleDebug(LuaState, s); 127 | end; 128 | 129 | procedure TUndHelper.Write(s: String); 130 | begin 131 | uConsoleWrite(LuaState, s); 132 | end; 133 | 134 | procedure TUndHelper.writeln(s: String); 135 | begin 136 | uConsoleWriteLn(LuaState, s); 137 | end; 138 | 139 | initialization 140 | 141 | UndHelper := TUndHelper.Create; 142 | 143 | finalization 144 | 145 | UndHelper.free; 146 | 147 | end. 148 | -------------------------------------------------------------------------------- /src/UndHelper_REM.pas: -------------------------------------------------------------------------------- 1 | unit UndHelper_REM; 2 | { 3 | This file has been generated by UnitParser v0.7, written by M. Knight 4 | and updated by NP. v/d Spek and George Birbilis. 5 | Source Code from Carlo Kok has been used to implement various sections of 6 | UnitParser. Components of ROPS are used in the construction of UnitParser, 7 | code implementing the class wrapper is taken from Carlo Kok's conv utility 8 | 9 | } 10 | interface 11 | 12 | uses 13 | SysUtils 14 | ,Classes 15 | ,uPSComponent 16 | ,uPSRuntime 17 | ,uPSCompiler 18 | ; 19 | 20 | type 21 | (*----------------------------------------------------------------------------*) 22 | TPSImport_UndHelper_Obj = class(TPSPlugin) 23 | protected 24 | procedure CompileImport1(CompExec: TPSScript); override; 25 | procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override; 26 | end; 27 | 28 | 29 | { compile-time registration functions } 30 | procedure SIRegister_TUndHelper(CL: TPSPascalCompiler); 31 | procedure SIRegister_UndHelper_Obj(CL: TPSPascalCompiler); 32 | 33 | { run-time registration functions } 34 | procedure RIRegister_TUndHelper(CL: TPSRuntimeClassImporter); 35 | procedure RIRegister_UndHelper_Obj(CL: TPSRuntimeClassImporter); 36 | 37 | procedure Register; 38 | 39 | implementation 40 | 41 | 42 | uses 43 | Lua 44 | ,pLua 45 | ,Variants 46 | ,UndHelper_Obj 47 | ; 48 | 49 | 50 | procedure Register; 51 | begin 52 | RegisterComponents('Pascal Script', [TPSImport_UndHelper_Obj]); 53 | end; 54 | 55 | (* === compile-time registration functions === *) 56 | (*----------------------------------------------------------------------------*) 57 | procedure SIRegister_TUndHelper(CL: TPSPascalCompiler); 58 | begin 59 | with CL.AddClassN(CL.FindClass('TOBJECT'),'TUndHelper') do 60 | begin 61 | RegisterProperty('LuaState', 'PLua_State', iptrw); 62 | RegisterMethod('Constructor Create'); 63 | RegisterMethod('Procedure Debug( s : String)'); 64 | RegisterMethod('Procedure Write( s : String)'); 65 | RegisterMethod('Procedure WriteLn( s : String)'); 66 | RegisterMethod('Procedure Run( s : String)'); 67 | RegisterMethod('Function GetG( valName : String) : Variant'); 68 | RegisterMethod('Procedure SetG( valName : String; const AValue : Variant)'); 69 | RegisterMethod('Function GetL( valName : String) : Variant'); 70 | RegisterMethod('Function GetLString( valName : String) : String'); 71 | RegisterMethod('Function GetLInteger( valName : String) : Integer'); 72 | RegisterMethod('Function GetLBoolean( valName : String) : Boolean'); 73 | RegisterMethod('Procedure SetL( valName : String; const AValue : Variant)'); 74 | RegisterMethod('Procedure SetLString( valName : String; const AValue : String)'); 75 | RegisterMethod('Procedure SetLInteger( valName : String; const AValue : Integer)'); 76 | RegisterMethod('Procedure SetLBoolean( valName : String; const AValue : Boolean)'); 77 | end; 78 | end; 79 | 80 | (*----------------------------------------------------------------------------*) 81 | procedure SIRegister_UndHelper_Obj(CL: TPSPascalCompiler); 82 | begin 83 | SIRegister_TUndHelper(CL); 84 | end; 85 | 86 | (* === run-time registration functions === *) 87 | (*----------------------------------------------------------------------------*) 88 | procedure TUndHelperLuaState_W(Self: TUndHelper; const T: PLua_State); 89 | Begin Self.LuaState := T; end; 90 | 91 | (*----------------------------------------------------------------------------*) 92 | procedure TUndHelperLuaState_R(Self: TUndHelper; var T: PLua_State); 93 | Begin T := Self.LuaState; end; 94 | 95 | (*----------------------------------------------------------------------------*) 96 | procedure RIRegister_TUndHelper(CL: TPSRuntimeClassImporter); 97 | begin 98 | with CL.Add(TUndHelper) do 99 | begin 100 | RegisterPropertyHelper(@TUndHelperLuaState_R,@TUndHelperLuaState_W,'LuaState'); 101 | RegisterConstructor(@TUndHelper.Create, 'Create'); 102 | RegisterMethod(@TUndHelper.Debug, 'Debug'); 103 | RegisterMethod(@TUndHelper.Write, 'Write'); 104 | RegisterMethod(@TUndHelper.WriteLn, 'WriteLn'); 105 | RegisterMethod(@TUndHelper.Run, 'Run'); 106 | RegisterMethod(@TUndHelper.GetL, 'GetL'); 107 | RegisterMethod(@TUndHelper.GetLString, 'GetLString'); 108 | RegisterMethod(@TUndHelper.GetLInteger, 'GetLInteger'); 109 | RegisterMethod(@TUndHelper.GetLBoolean, 'GetLBoolean'); 110 | RegisterMethod(@TUndHelper.SetL, 'SetL'); 111 | RegisterMethod(@TUndHelper.SetLString, 'SetLString'); 112 | RegisterMethod(@TUndHelper.SetLInteger, 'SetLInteger'); 113 | RegisterMethod(@TUndHelper.SetLBoolean, 'SetLBoolean'); 114 | RegisterMethod(@TUndHelper.GetG, 'GetG'); 115 | RegisterMethod(@TUndHelper.SetG, 'SetG'); 116 | end; 117 | end; 118 | 119 | (*----------------------------------------------------------------------------*) 120 | procedure RIRegister_UndHelper_Obj(CL: TPSRuntimeClassImporter); 121 | begin 122 | RIRegister_TUndHelper(CL); 123 | end; 124 | 125 | 126 | 127 | { TPSImport_UndHelper_Obj } 128 | (*----------------------------------------------------------------------------*) 129 | procedure TPSImport_UndHelper_Obj.CompileImport1(CompExec: TPSScript); 130 | begin 131 | SIRegister_UndHelper_Obj(CompExec.Comp); 132 | end; 133 | (*----------------------------------------------------------------------------*) 134 | procedure TPSImport_UndHelper_Obj.ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); 135 | begin 136 | RIRegister_UndHelper_Obj(ri); 137 | end; 138 | (*----------------------------------------------------------------------------*) 139 | 140 | 141 | end. 142 | -------------------------------------------------------------------------------- /src/Underscript.inc: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/Underscript.otares: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/Underscript.otares -------------------------------------------------------------------------------- /src/Underscript.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/Underscript.res -------------------------------------------------------------------------------- /src/luaonlua/LuaProject.inc: -------------------------------------------------------------------------------- 1 | {$DEFINE LUA51} 2 | //{$DEFINE LUAJIT} 3 | -------------------------------------------------------------------------------- /src/luaonlua/lua51host.dpr: -------------------------------------------------------------------------------- 1 | program lua51host; 2 | 3 | { 4 | Lua Clib 32-bit Host Application 5 | Copyright (c) 2020 Felipe Daragon 6 | License: 3-clause BSD 7 | See https://github.com/felipedaragon/catarinka/ for details 8 | } 9 | 10 | {$I CatCompactBin.inc} 11 | 12 | uses 13 | uLuaHost; 14 | 15 | {$R *.res} 16 | 17 | begin 18 | StartLuaHost; 19 | end. 20 | -------------------------------------------------------------------------------- /src/luaonlua/lua51host.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/luaonlua/lua51host.res -------------------------------------------------------------------------------- /src/luaonlua/luaonlua.local: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /src/luaonlua/luaonlua.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/luaonlua/luaonlua.res -------------------------------------------------------------------------------- /src/luaonlua/uLoL64.pas: -------------------------------------------------------------------------------- 1 | unit uLoL64; 2 | 3 | { 4 | LoL64 constants and functions 5 | Copyright (c) 2020 Felipe Daragon 6 | License: 3-clause BSD 7 | See https://github.com/felipedaragon/catarinka/ for details 8 | } 9 | 10 | interface 11 | 12 | uses 13 | SysUtils, Lua, pLua, 14 | Cromis.Comm.Custom, Cromis.Comm.IPC, Cromis.Threading, Cromis.AnyValue, 15 | CatUtils, CatStrings, CatTasks; 16 | 17 | const 18 | cLOL_REQUIRE = 1; 19 | cLOL_CALLFUNCTION = 2; 20 | cLOL_ACCESSPROP = 3; 21 | cLOL_SHUTDOWN = 4; 22 | cLOL_SETSID = 5; 23 | 24 | var 25 | vPID_Host32: Cardinal = 0; 26 | vSID_Host: string = ''; 27 | vservername: string = ''; 28 | 29 | type 30 | TLOLHostSettings = record 31 | Exefilename: string; 32 | SearchPath: string; 33 | end; 34 | 35 | const 36 | cLOLHost32: TLOLHostSettings = ( 37 | Exefilename: 'lua51host.exe'; 38 | Searchpath: 'Extensions\underscript32\lua51\'; 39 | ); 40 | 41 | const 42 | cLOLHost64: TLOLHostSettings = ( 43 | Exefilename: 'lua51host.exe'; 44 | Searchpath: ''; 45 | ); 46 | 47 | function SendMessageToHost(id: integer; l: string):string; 48 | 49 | implementation 50 | 51 | function SendMessageToHost(id: integer; l: string):string; 52 | var 53 | IPCResult: IIPCData; 54 | Request: IIPCData; 55 | IPCClient: TIPCClient; 56 | ret:string; 57 | begin 58 | result := emptystr; 59 | IPCClient := TIPCClient.Create; 60 | try 61 | IPCClient.ComputerName := EmptyStr; 62 | IPCClient.ServerName := vservername; 63 | IPCClient.ConnectClient(cDefaultTimeout); 64 | try 65 | if IPCClient.IsConnected then 66 | begin 67 | Request := AcquireIPCData; 68 | Request.ID := DateTimeToStr(Now); 69 | Request.Data.WriteInteger('CmdID', id); 70 | Request.Data.WriteString('Command', l); 71 | Request.Data.WriteString('SID', vSID_Host); 72 | IPCResult := IPCClient.ExecuteConnectedRequest(Request); 73 | 74 | 75 | if IPCClient.AnswerValid then 76 | begin 77 | if ipcresult.ID = 'ret' then begin 78 | ret := IPCResult.Data.ReadString('json'); 79 | result :=ret; 80 | end; 81 | end; 82 | 83 | 84 | end; 85 | finally 86 | IPCClient.DisconnectClient; 87 | end; 88 | finally 89 | IPCClient.Free; 90 | end; 91 | end; 92 | 93 | initialization 94 | 95 | finalization 96 | if vPID_Host32 <> 0 then begin 97 | KillTaskbyPID(vPID_Host32); 98 | SendMessageToHost(cLOL_SHUTDOWN,emptystr); 99 | end; 100 | 101 | end. 102 | -------------------------------------------------------------------------------- /src/multipreter/LuaProject.inc: -------------------------------------------------------------------------------- 1 | {$DEFINE LUA51} 2 | //{$DEFINE LUAJIT} 3 | -------------------------------------------------------------------------------- /src/multipreter/Multipreter.dpr: -------------------------------------------------------------------------------- 1 | program Multipreter; 2 | 3 | { 4 | UnderScript Multipreter 5 | Copyright (c) 2020 Felipe Daragon 6 | License: MIT (http://opensource.org/licenses/mit-license.php) 7 | } 8 | 9 | {$APPTYPE CONSOLE} 10 | {$DEFINE UNDER_JAVASCRIPTCORE} 11 | 12 | uses 13 | Classes, SysUtils, 14 | UndConst in '..\UndConst.pas', 15 | {$IFDEF WIN64} 16 | js15decl in '..\thirdparty\js_spidermonkey\js15decl.pas', 17 | jsDbgServer in '..\thirdparty\js_spidermonkey\jsDbgServer.pas', 18 | jsintf in '..\thirdparty\js_spidermonkey\jsintf.pas', 19 | NamedPipesImpl in '..\thirdparty\js_spidermonkey\NamedPipesImpl.pas', 20 | quickjs in '..\thirdparty\js_quickjs\quickjs.pas', 21 | uJavaScript_SM, 22 | uJavaScript_Quick, 23 | {$IFDEF UNDER_JAVASCRIPTCORE} 24 | uJavaScript_JSC, 25 | JSK.Base in '..\thirdparty\js_javascriptcore\JSK.Base.pas', 26 | JSK.API in '..\thirdparty\js_javascriptcore\JSK.API.pas', 27 | {$ENDIF} 28 | {$ELSE} 29 | {$ENDIF} 30 | CatCLUtils; 31 | 32 | {$I CatCompactBin.inc} 33 | {$R *.res} 34 | 35 | var 36 | scriptfilename, script:string; 37 | sl:TStringList; 38 | 39 | begin 40 | scriptfilename := emptystr; 41 | if paramstr(2) <> emptystr then 42 | scriptfilename := trim(GetCmdLine(2)); 43 | 44 | if fileexists(scriptfilename) then begin 45 | sl := TStringList.Create; 46 | sl.LoadFromFile(scriptfilename); 47 | script := sl.Text; 48 | sl.Free; 49 | if paramstr(1) = 'javascriptcore' then 50 | JavaScriptJSC_Run(script) else 51 | if paramstr(1) = 'spidermonkey' then 52 | JavaScriptSM_Run(script) else 53 | if paramstr(1) = 'quickjs' then 54 | JavaScriptQuick_Run(script); 55 | end; 56 | end. 57 | -------------------------------------------------------------------------------- /src/multipreter/Multipreter.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/multipreter/Multipreter.res -------------------------------------------------------------------------------- /src/multipreter/Multipreter_Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/multipreter/Multipreter_Icon.ico -------------------------------------------------------------------------------- /src/multipreter/UndHelper_Multi.pas: -------------------------------------------------------------------------------- 1 | unit UndHelper_Multi; 2 | 3 | { 4 | UnderScript Helper object 5 | Copyright (c) 2013-2020 Felipe Daragon 6 | License: MIT (http://opensource.org/licenses/mit-license.php) 7 | } 8 | 9 | interface 10 | 11 | uses 12 | Variants, UndConst, CatUtils; 13 | 14 | type 15 | {$METHODINFO ON} 16 | TUndHelper = class 17 | public 18 | constructor Create; 19 | procedure Debug(s: String); 20 | procedure Write(s: String); 21 | procedure WriteLn(s: String); 22 | end; 23 | {$METHODINFO OFF} 24 | 25 | var 26 | UndHelper: TUndHelper; 27 | 28 | implementation 29 | 30 | constructor TUndHelper.Create; 31 | begin 32 | inherited Create; 33 | end; 34 | 35 | procedure TUndHelper.Debug(s: String); 36 | begin 37 | OutDebug(s); 38 | end; 39 | 40 | procedure TUndHelper.Write(s: String); 41 | begin 42 | System.Write(s); 43 | end; 44 | 45 | procedure TUndHelper.WriteLn(s: String); 46 | begin 47 | System.WriteLn(s); 48 | end; 49 | 50 | initialization 51 | 52 | UndHelper := TUndHelper.Create; 53 | 54 | finalization 55 | 56 | UndHelper.free; 57 | 58 | end. 59 | -------------------------------------------------------------------------------- /src/multipreter/uJavaScript_JSC.pas: -------------------------------------------------------------------------------- 1 | unit uJavaScript_JSC; 2 | { 3 | UnderScript JavaScriptCore Wrapper 4 | Copyright (c) 2013-2020 Felipe Daragon 5 | License: MIT (http://opensource.org/licenses/mit-license.php) 6 | } 7 | 8 | interface 9 | 10 | uses 11 | Classes, SysUtils, lua, plua, LuaObject, UndConst, 12 | CatStrings, JSK.Base, UndHelper_Multi, vcl.dialogs, CatLogger; 13 | 14 | procedure JavaScriptJSC_Run(const script:string); 15 | 16 | implementation 17 | 18 | function RunJS(const script: string):string; 19 | var 20 | ctx: TJSContext; 21 | res: TJSValue; 22 | begin 23 | ctx := TJSContext.Create; 24 | try 25 | ctx.SetObject(rudLibName, UndHelper); 26 | res := ctx.Evaluate(script); 27 | if res.IsString then 28 | result := Res.AsString; 29 | finally 30 | ctx.Free; 31 | end; 32 | end; 33 | 34 | procedure JavaScriptJSC_Run(const script:string); 35 | var 36 | r: TUndScriptResult; 37 | sw : TCatStopWatch; 38 | begin 39 | sw := CatStopWatchNew; 40 | r.success := true; 41 | try 42 | r.expressionresult := runjs(script); 43 | except 44 | on E: Exception do 45 | begin 46 | r.success := false; 47 | r.errormessage := E.Message; 48 | uConsoleWriteError(-1, 'JS: ' + E.Message); 49 | end; 50 | end; 51 | end; 52 | 53 | end. 54 | -------------------------------------------------------------------------------- /src/multipreter/uJavaScript_Quick.pas: -------------------------------------------------------------------------------- 1 | unit uJavaScript_Quick; 2 | { 3 | UnderScript QuickJS Wrapper 4 | Copyright (c) 2013-2020 Felipe Daragon 5 | License: MIT (http://opensource.org/licenses/mit-license.php) 6 | } 7 | 8 | interface 9 | 10 | uses 11 | Classes, SysUtils, Windows, UndConst, CatStrings, quickjs; 12 | 13 | procedure JavaScriptQuick_Run(const script:string); 14 | 15 | implementation 16 | 17 | function eval_buf(ctx : JSContext; Buf : PAnsiChar; buf_len : Integer; filename : PAnsiChar; eval_flags : Integer): Integer; 18 | var 19 | val : JSValue; 20 | begin 21 | val := JS_Eval(ctx, buf, buf_len, filename, eval_flags); 22 | if JS_IsException(val) then 23 | begin 24 | js_std_dump_error(ctx); 25 | Result := -1; 26 | end 27 | else 28 | Result := 0; 29 | JS_FreeValue(ctx, val); 30 | end; 31 | 32 | function eval_file(ctx : JSContext; filename : PAnsiChar; eval_flags : Integer): Integer; 33 | var 34 | buf_len : size_t; 35 | Buf : Pointer; 36 | begin 37 | buf := js_load_file(ctx, @buf_len, filename); 38 | if not Assigned(buf) then 39 | begin 40 | Writeln('Error While Loading : ',filename); 41 | exit(1); 42 | end; 43 | Result := eval_buf(ctx, buf, buf_len, filename, eval_flags); 44 | js_free(ctx, buf); 45 | end; 46 | 47 | function eval_string(ctx : JSContext; script : PAnsiChar; eval_flags : Integer): Integer; 48 | begin 49 | Result := eval_buf(ctx, script, length(script), '_script.js', eval_flags); 50 | end; 51 | 52 | 53 | function logme(ctx : JSContext; {%H-}this_val : JSValueConst; argc : Integer; argv : PJSValueConstArr): JSValue; cdecl; 54 | var 55 | i : Integer; 56 | str : PAnsiChar; 57 | begin 58 | for i := 0 to Pred(argc) do 59 | begin 60 | if i <> 0 then 61 | Write(' '); 62 | str := JS_ToCString(ctx, argv[i]); 63 | if not Assigned(str) then 64 | exit(JS_EXCEPTION); 65 | writeln(str); 66 | JS_FreeCString(ctx, str); 67 | end; 68 | Writeln; 69 | Result := JS_UNDEFINED; 70 | end; 71 | 72 | procedure RunCode(script:string); 73 | var 74 | rt : JSRuntime; 75 | ctx : JSContext; 76 | //m : JSModuleDef; 77 | global : JSValue; 78 | //filename : PAnsiChar; 79 | const 80 | std_hepler : PAnsiChar = 81 | 'import * as std from ''std'';'#10+ 82 | 'import * as os from ''os'';'#10+ 83 | //'import * as Cmu from ''Cmu'';'#10+ // Our Custom Module. 84 | 'globalThis.std = std;'#10+ 85 | 'globalThis.os = os;'#10; 86 | //'globalThis.Cmu = Cmu;'#10; 87 | begin 88 | rt := JS_NewRuntime; 89 | if Assigned(rt) then 90 | begin 91 | ctx := JS_NewContext(rt); 92 | if Assigned(rt) then 93 | begin 94 | // ES6 Module loader. 95 | JS_SetModuleLoaderFunc(rt, nil, @js_module_loader, nil); 96 | 97 | js_std_add_helpers(ctx,0,nil); 98 | js_init_module_std(ctx, 'std'); 99 | js_init_module_os(ctx, 'os'); 100 | 101 | { 102 | Functions init order is important \ 103 | cuz i init the class and it's obj's and constructor in \ 104 | RegisterNativeClass then i just point the Module constructor to the same one. 105 | } 106 | 107 | // Register with global object directly . 108 | //RegisterNativeClass(ctx); 109 | //m := JS_NewCModule(ctx, PAnsiChar('Cmu'), @Emu_init); 110 | //JS_AddModuleExport(ctx,m, PAnsiChar('ApiHook')); 111 | 112 | eval_buf(ctx, std_hepler, {$IFDEF FPC}strlen{$ELSE}lstrlenA{$ENDIF}(std_hepler), '', JS_EVAL_TYPE_MODULE); 113 | 114 | 115 | global := JS_GetGlobalObject(ctx); 116 | 117 | // Define a function in the global context. 118 | JS_SetPropertyStr(ctx,global,'log',JS_NewCFunction(ctx, @logme, 'log', 1)); 119 | 120 | JS_FreeValue(ctx, global); 121 | 122 | 123 | //filename :=PAnsiChar(AnsiString(ParamStr(1))); 124 | //eval_file(ctx,filename,JS_EVAL_TYPE_GLOBAL or JS_EVAL_TYPE_MODULE); 125 | eval_string(ctx,PAnsiChar(AnsiString(script)),JS_EVAL_TYPE_GLOBAL or JS_EVAL_TYPE_MODULE); 126 | 127 | js_std_loop(ctx); 128 | 129 | js_std_free_handlers(rt); 130 | JS_FreeContext(ctx); 131 | end; 132 | JS_FreeRuntime(rt); 133 | end; 134 | end; 135 | 136 | procedure JavaScriptQuick_Run(const script:string); 137 | var 138 | r: TUndScriptResult; 139 | begin 140 | r.success := true; 141 | 142 | try 143 | RunCode(script); 144 | except 145 | on E: Exception do begin 146 | r.success := false; 147 | r.errormessage := E.Message; 148 | uConsoleWriteError(-1, 'JS: ' + E.Message); 149 | end; 150 | end; 151 | end; 152 | 153 | end. 154 | -------------------------------------------------------------------------------- /src/multipreter/uJavaScript_SM.pas: -------------------------------------------------------------------------------- 1 | unit uJavaScript_SM; 2 | { 3 | UnderScript JavaScript SpiderMonkey Wrapper 4 | Copyright (c) 2013-2020 Felipe Daragon 5 | License: MIT (http://opensource.org/licenses/mit-license.php) 6 | 7 | Note: jsintf must handle variant type so it can be useful 8 | } 9 | 10 | interface 11 | 12 | uses 13 | Classes, SysUtils, UndConst, CatStrings, js15decl, jsintf, UndHelper_Multi, 14 | vcl.dialogs; 15 | 16 | type 17 | [JSClassName('UConsole')] 18 | {$METHODINFO ON} 19 | TUndJavaScriptSM = class(TJSClass) 20 | public 21 | procedure WriteLn(s: String); 22 | end; 23 | 24 | TJSGlobalFunctions = class 25 | class procedure print(s: string); 26 | end; 27 | {$METHODINFO OFF} 28 | 29 | procedure JavaScriptSM_Run(const script:string); 30 | 31 | implementation 32 | 33 | procedure JavaScriptSM_Run(const script:string); 34 | var 35 | eng: TJSEngine; 36 | r: TUndScriptResult; 37 | begin 38 | r.success := true; 39 | eng := TJSEngine.Create; 40 | eng.registerGlobalFunctions(TJSGlobalFunctions); 41 | eng.registerClasses([TUndHelper]); 42 | //TJSClass.CreateJSObject(UndHelper, eng, cUnd, [cfaInheritedMethods, cfaInheritedProperties]); 43 | try 44 | eng.Evaluate(script); 45 | except 46 | on E: Exception do begin 47 | r.success := false; 48 | r.errormessage := E.Message; 49 | uConsoleWriteError(-1, 'JS: ' + E.Message); 50 | end; 51 | end; 52 | 53 | eng.Free; 54 | end; 55 | 56 | procedure TUndJavaScriptSM.WriteLn(s: String); 57 | begin 58 | WriteLn(s); 59 | end; 60 | 61 | class procedure TJSGlobalFunctions.print(s: string); 62 | begin 63 | WriteLn(s); 64 | end; 65 | 66 | end. 67 | -------------------------------------------------------------------------------- /src/thirdparty/js_javascriptcore/JSK.Components.pas: -------------------------------------------------------------------------------- 1 | { 2 | This file is part of JSKit framework. 3 | Copyright (c) 2017 Eugene Kryukov 4 | 5 | The contents of this file are subject to the Mozilla Public License Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. You may obtain a copy of the 7 | License at http://www.mozilla.org/MPL/ 8 | 9 | Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 10 | KIND, either express or implied. See the License for the specific language governing rights and 11 | limitations under the License. 12 | } 13 | 14 | unit JSK.Components; 15 | 16 | {$I JSK.Config.inc} 17 | 18 | interface 19 | 20 | uses 21 | Classes, SysUtils, TypInfo, Generics.Collections, Rtti, JSK.API, JSK.Base; 22 | 23 | type 24 | 25 | TJSScriptObject = ( 26 | Application, 27 | Form, 28 | Children 29 | ); 30 | TJSScriptObjects = set of TJSScriptObject; 31 | 32 | TJSScriptClass = ( 33 | Vcl 34 | ); 35 | TJSScriptClasses = set of TJSScriptClass; 36 | 37 | TJSScript = class(TComponent) 38 | private 39 | FContext: TJSContext; 40 | FOnHandleException: TJSHandleException; 41 | FObjects: TJSScriptObjects; 42 | FClasses: TJSScriptClasses; 43 | procedure SetObjects(const Value: TJSScriptObjects); 44 | procedure SetClasses(const Value: TJSScriptClasses); 45 | procedure RegisterVcl; 46 | procedure RegisterChildren; 47 | protected 48 | procedure Loaded; override; 49 | procedure HandleException(const Msg: string); 50 | procedure RegisterClasses; 51 | procedure RegisterObjects; 52 | public 53 | constructor Create(AOwner: TComponent); override; 54 | destructor Destroy; override; 55 | property Context: TJSContext read FContext; 56 | published 57 | property Classes: TJSScriptClasses read FClasses write SetClasses; 58 | property Objects: TJSScriptObjects read FObjects write SetObjects; 59 | property OnHandleException: TJSHandleException read FOnHandleException write FOnHandleException; 60 | end; 61 | 62 | procedure Register; 63 | 64 | implementation 65 | 66 | uses 67 | Vcl.Dialogs, Vcl.Forms, Vcl.Controls, Vcl.StdCtrls, Vcl.Graphics; 68 | 69 | procedure Register; 70 | begin 71 | RegisterComponents('JSPack', [TJSScript]); 72 | end; 73 | 74 | { TJSScript } 75 | 76 | constructor TJSScript.Create; 77 | begin 78 | inherited Create(AOwner); 79 | if not (csDesigning in ComponentState) then 80 | begin 81 | FContext := TJSContext.Create; 82 | FContext.OnHandleException := HandleException; 83 | end; 84 | FClasses := [TJSScriptClass.Vcl]; 85 | FObjects := [TJSScriptObject.Application]; 86 | end; 87 | 88 | destructor TJSScript.Destroy; 89 | begin 90 | FreeAndNil(FContext); 91 | inherited; 92 | end; 93 | 94 | procedure TJSScript.HandleException(const Msg: string); 95 | begin 96 | if Assigned(FOnHandleException) then 97 | FOnHandleException(Msg) 98 | else 99 | ShowMessage(Msg); 100 | end; 101 | 102 | procedure TJSScript.Loaded; 103 | begin 104 | inherited; 105 | if not (csDesigning in ComponentState) then 106 | begin 107 | RegisterClasses; 108 | RegisterObjects; 109 | end; 110 | end; 111 | 112 | procedure TJSScript.RegisterVcl; 113 | begin 114 | FContext.RegisterClasses([TLabel, TButton, TEdit, TMemo]); 115 | FContext.RegisterEnums([TypeInfo(TFormBorderStyle), TypeInfo(TBrushStyle), TypeInfo(TPenStyle)]); 116 | end; 117 | 118 | procedure TJSScript.RegisterClasses; 119 | begin 120 | if TJSScriptClass.Vcl in FClasses then 121 | RegisterVcl; 122 | end; 123 | 124 | procedure TJSScript.RegisterChildren; 125 | var 126 | I: Integer; 127 | Child: TComponent; 128 | begin 129 | if Owner <> nil then 130 | for I := 0 to Owner.ComponentCount - 1 do 131 | begin 132 | Child := Owner.Components[I]; 133 | if Child.Name <> '' then 134 | Context.SetObject(Child.Name, Child); 135 | end; 136 | end; 137 | 138 | procedure TJSScript.RegisterObjects; 139 | begin 140 | if TJSScriptObject.Application in FObjects then 141 | Context.SetObject('Application', Application); 142 | if TJSScriptObject.Form in FObjects then 143 | Context.SetObject('Form', Owner); 144 | if TJSScriptObject.Children in FObjects then 145 | RegisterChildren; 146 | end; 147 | 148 | procedure TJSScript.SetClasses(const Value: TJSScriptClasses); 149 | begin 150 | FClasses := Value; 151 | end; 152 | 153 | procedure TJSScript.SetObjects(const Value: TJSScriptObjects); 154 | begin 155 | FObjects := Value; 156 | end; 157 | 158 | end. 159 | 160 | -------------------------------------------------------------------------------- /src/thirdparty/js_javascriptcore/JSK.Config.inc: -------------------------------------------------------------------------------- 1 | {.$DEFINE BENCH} 2 | 3 | {.$DEFINE DXDEBUG} 4 | 5 | {$MINENUMSIZE 4} 6 | {$ALIGN ON} 7 | {$BOOLEVAL OFF} 8 | {$LONGSTRINGS ON} 9 | {$WRITEABLECONST ON} 10 | {$SCOPEDENUMS ON} 11 | 12 | {$B-} {- Complete Boolean Evaluation } 13 | {$X+} {- Extended syntax } 14 | 15 | {$IFDEF MSWINDOWS} 16 | {$DEFINE WINDOWS} 17 | {$DEFINE VCL} 18 | {$ENDIF} 19 | 20 | {$IFDEF OSX} 21 | {$ENDIF} 22 | 23 | {$IF DEFINED(IOSSIMULATOR) or DEFINED(IOS) or DEFINED(ANDROID)} 24 | Unsupported platform 25 | {$IFEND} 26 | -------------------------------------------------------------------------------- /src/thirdparty/js_quickjs/QUICKJS_LICENSE: -------------------------------------------------------------------------------- 1 | /* 2 | * QuickJS Javascript Engine 3 | * 4 | * Copyright (c) 2017-2020 Fabrice Bellard 5 | * Copyright (c) 2017-2020 Charlie Gordon 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy 8 | * of this software and associated documentation files (the "Software"), to deal 9 | * in the Software without restriction, including without limitation the rights 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | * copies of the Software, and to permit persons to whom the Software is 12 | * furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in 15 | * all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | * THE SOFTWARE. 24 | */ -------------------------------------------------------------------------------- /src/thirdparty/js_spidermonkey/License.txt: -------------------------------------------------------------------------------- 1 | Javascript engine for delphi based on spidermonkey 2 | 3 | Delphi 2010 or later is required. 4 | For accessing Indexed properties you will need Delphi XE2 or later. This is because Delphi XE2 add RTTI support for indexed properties 5 | 6 | Project owner: visagesoft http://www.visagesoft.com 7 | 8 | License: Apache License 2.0 http://www.apache.org/licenses/LICENSE-2.0 -------------------------------------------------------------------------------- /src/thirdparty/pascal/dws2.dcr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/pascal/dws2.dcr -------------------------------------------------------------------------------- /src/thirdparty/pascal/dws2.inc: -------------------------------------------------------------------------------- 1 | {**********************************************************************} 2 | { } 3 | { "The contents of this file are subject to the Mozilla Public } 4 | { License Version 1.1 (the "License"); you may not use this } 5 | { file except in compliance with the License. You may obtain } 6 | { a copy of the License at } 7 | { } 8 | { http://www.mozilla.org/MPL/ } 9 | { } 10 | { Software distributed under the License is distributed on an } 11 | { "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express } 12 | { or implied. See the License for the specific language } 13 | { governing rights and limitations under the License. } 14 | { } 15 | { The Original Code is DelphiWebScriptII source code, released } 16 | { January 1, 2001 } 17 | { } 18 | { The Initial Developer of the Original Code is Matthias } 19 | { Ackermann. Portions created by Matthias Ackermann are } 20 | { Copyright (C) 2000 Matthias Ackermann, Switzerland. All } 21 | { Rights Reserved. } 22 | { } 23 | { Contributor(s): Willibald Krenn } 24 | { } 25 | {**********************************************************************} 26 | 27 | // DWSII include file 28 | 29 | {global compiler options} 30 | 31 | {$A+} // align on 32 | {$B-} // BoolEval off 33 | {$X+} // extended syntax 34 | {$H+} // long strings 35 | 36 | {$IFNDEF DWS_DEFAULT_OPTIMIZATION} 37 | 38 | {if you want to debug DWSII, then turn the next compilerswitch OFF} 39 | {$O+} // optimization default: O+ 40 | 41 | {$IFOPT O+} // <<< build for release if optimization is turned on 42 | {$C-} // Assertions off 43 | {$Q-} // no overflow checking 44 | {$R-} // no range checking 45 | {$W-} // no frames 46 | {$WARNINGS OFF} // no warnings. 47 | {$ELSE} // <<< build for debug if optimization is turned off 48 | {$C+} // Assertions on 49 | {$Q+} // overflow checking 50 | {$R+} // range checking 51 | {$W+} // frames 52 | {$WARNINGS ON} // warnings for debugging 53 | {$ENDIF} 54 | 55 | {$ENDIF} 56 | 57 | {$T-} // typed addr off - otherwise you'll get problems with ComSupport 58 | // <<.CreateResFmt(@SNoMethod, [Names]);>> 59 | 60 | 61 | {$IFDEF LINUX} // Kylix 1 = VER140! 62 | {$DEFINE NEWVARIANTS} // new Delphi variant code 63 | {$DEFINE NEWDESIGN} // new in K1/D6 64 | {$DEFINE VER140UP} 65 | {$ELSE} 66 | {$IFDEF MSWINDOWS} 67 | {$DEFINE NEWVARIANTS} 68 | {$DEFINE NEWDESIGN} 69 | {$DEFINE DELPHI6up} 70 | {$DEFINE VER140UP} 71 | {$ENDIF} 72 | {$ENDIF} 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/thirdparty/pascal/dws2CLXGUIFunctions.pas: -------------------------------------------------------------------------------- 1 | {**********************************************************************} 2 | { } 3 | { "The contents of this file are subject to the Mozilla Public } 4 | { License Version 1.1 (the "License"); you may not use this } 5 | { file except in compliance with the License. You may obtain } 6 | { a copy of the License at } 7 | { } 8 | { http://www.mozilla.org/MPL/ } 9 | { } 10 | { Software distributed under the License is distributed on an } 11 | { "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express } 12 | { or implied. See the License for the specific language } 13 | { governing rights and limitations under the License. } 14 | { } 15 | { The Original Code is DelphiWebScriptII source code, released } 16 | { January 1, 2001 } 17 | { } 18 | { The Initial Developer of the Original Code is Matthias } 19 | { Ackermann. } 20 | { } 21 | { Portions created by Matthias Ackermann are Copyright } 22 | { (C) 2000 Matthias Ackermann, Switzerland. } 23 | { Portions created by Eric Grange are Copyright } 24 | { (C) 2001 Eric Grange, France. } 25 | { Portions created by Danilo Luiz Rheinheimer are Copyright } 26 | { (C) 2001 Danilo Luiz Rheinheimer, Brazil. } 27 | { } 28 | { } 29 | { All Rights Reserved. } 30 | { } 31 | { } 32 | { Contributor(s): Eric Grange, Danilo Luiz Rheinheimer } 33 | { } 34 | { Compatibility: } 35 | { [x] D5 (WK) [x] D6 (WK) [x] K1 (WK) } 36 | {**********************************************************************} 37 | 38 | // dws2CLXGUIFunctions - Generated : 27.02.01 12:43:46 39 | unit dws2CLXGUIFunctions; 40 | 41 | interface 42 | 43 | uses Classes, dws2Functions, dws2Exprs, dws2Symbols, QControls; 44 | 45 | type 46 | 47 | TCLXShowMessageFunc = class(TInternalFunction) 48 | procedure Execute; override; 49 | function Optimize(FuncExpr: TExprBase): TExprBase; override; 50 | end; 51 | TCLXShowMessageFuncExpr = class(TUnaryOpExpr) 52 | function Eval: Variant; override; 53 | end; 54 | 55 | TCLXInputBoxFunc = class(TInternalFunction) 56 | procedure Execute; override; 57 | end; 58 | 59 | TCLXErrorDlgFunc = class(TInternalFunction) 60 | procedure Execute; override; 61 | end; 62 | 63 | TCLXInformationDlgFunc = class(TInternalFunction) 64 | procedure Execute; override; 65 | end; 66 | 67 | TCLXQuestionDlgFunc = class(TInternalFunction) 68 | procedure Execute; override; 69 | end; 70 | 71 | TCLXOkCancelDlgFunc = class(TInternalFunction) 72 | procedure Execute; override; 73 | end; 74 | 75 | Tdws2GUIFunctions = class(TComponent) 76 | end; 77 | 78 | implementation 79 | 80 | uses QForms, QDialogs; 81 | 82 | const // type constants to make sure strings get reused by the compiler 83 | cFloat = 'Float'; 84 | cInteger = 'Integer'; 85 | cString = 'String'; 86 | cBoolean = 'Boolean'; 87 | 88 | { TCLXShowMessageFunc } 89 | 90 | procedure TCLXShowMessageFunc.Execute; 91 | var 92 | Msg: string; 93 | begin 94 | Msg := Info['msg']; 95 | ShowMessage(Msg); 96 | end; 97 | 98 | function TCLXShowMessageFunc.Optimize(FuncExpr: TExprBase): TExprBase; 99 | begin 100 | with FuncExpr as TFuncExpr do 101 | begin 102 | Result := TCLXShowMessageFuncExpr.Create(Prog, Pos, Args[0]); 103 | Args.Clear; 104 | Free; 105 | end; 106 | end; 107 | 108 | function TCLXShowMessageFuncExpr.Eval: Variant; 109 | var 110 | Msg: string; 111 | begin 112 | Msg := Expr.Eval; 113 | ShowMessage(Msg); 114 | end; 115 | 116 | { TInputBoxFunc } 117 | 118 | procedure TCLXInputBoxFunc.Execute; 119 | var 120 | Param1, Param2, Param3: string; 121 | begin 122 | Param1 := Info['aCaption']; 123 | Param2 := Info['aPrompt']; 124 | Param3 := Info['aDefault']; 125 | Info['Result'] := InputBox(Param1, Param2, Param3); 126 | end; 127 | 128 | { TCLXErrorDlgFunc } 129 | 130 | procedure TCLXErrorDlgFunc.Execute; 131 | begin 132 | Application.MessageBox(PChar(string(Info['msg'])), 'Error', 133 | [smbOK]); 134 | end; 135 | 136 | { TCLXInformationDlgFunc } 137 | 138 | procedure TCLXInformationDlgFunc.Execute; 139 | begin 140 | Application.MessageBox(PChar(string(Info['msg'])), 'Information', 141 | [smbOK]); 142 | end; 143 | 144 | { TCLXQuestionDlgFunc } 145 | 146 | procedure TCLXQuestionDlgFunc.Execute; 147 | begin 148 | Info['Result'] := (Application.MessageBox(PChar(string(Info['msg'])), 'Question', 149 | [smbYES, smbNO]) = smbYES) 150 | end; 151 | 152 | { TCLXOkCancelDlgFunc } 153 | 154 | procedure TCLXOkCancelDlgFunc.Execute; 155 | begin 156 | Info['Result'] := (Application.MessageBox(PChar(string(Info['msg'])), 157 | 'Confirmation', 158 | [smbOK, smbCANCEL]) = smbOK) 159 | end; 160 | 161 | initialization 162 | 163 | RegisterInternalFunction(TCLXShowMessageFunc, 'ShowMessage', ['msg', cString], 164 | ''); 165 | RegisterInternalFunction(TCLXInputBoxFunc, 'InputBox', ['aCaption', cString, 166 | 'aPrompt', cString, 'aDefault', cString], cString); 167 | RegisterInternalFunction(TCLXErrorDlgFunc, 'ErrorDlg', ['msg', cString], ''); 168 | RegisterInternalFunction(TCLXInformationDlgFunc, 'InformationDlg', ['msg', 169 | cString], ''); 170 | RegisterInternalFunction(TCLXQuestionDlgFunc, 'QuestionDlg', ['msg', cString], 171 | cBoolean); 172 | RegisterInternalFunction(TCLXOkCancelDlgFunc, 'OkCancelDlg', ['msg', cString], 173 | cBoolean); 174 | 175 | end. 176 | -------------------------------------------------------------------------------- /src/thirdparty/pascal/dws2CLXIDEUtils.pas: -------------------------------------------------------------------------------- 1 | {**********************************************************************} 2 | { } 3 | { "The contents of this file are subject to the Mozilla Public } 4 | { License Version 1.1 (the "License"); you may not use this } 5 | { file except in compliance with the License. You may obtain } 6 | { a copy of the License at } 7 | { } 8 | { http://www.mozilla.org/MPL/ } 9 | { } 10 | { Software distributed under the License is distributed on an } 11 | { "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express } 12 | { or implied. See the License for the specific language } 13 | { governing rights and limitations under the License. } 14 | { } 15 | { The Original Code is dws2IDEUtils source code, released } 16 | { October 26, 2002 } 17 | { } 18 | { The Initial Developer of the Original Code is Mark Ericksen } 19 | { Portions created by Mark Ericksen are } 20 | { Copyright (C) 2002 Mark Ericksen, United States of America. } 21 | { All Rights Reserved. } 22 | { } 23 | { Contributors: Andreas Luleich, Willibald Krenn } 24 | { } 25 | {**********************************************************************} 26 | 27 | {$I dws2.inc} 28 | 29 | unit dws2CLXIDEUtils; 30 | 31 | { Utilities that would be common in an 'advanced' IDE. NOTE: These require 32 | that the program was compiled with coSymbolDictionary and/or coContextMap } 33 | 34 | interface 35 | 36 | uses SysUtils, Classes, QGraphics, 37 | {$IFDEF NEWVARIANTS} 38 | Variants, 39 | {$ENDIF} 40 | dws2Comp, dws2Exprs, dws2Symbols, dws2Stack, dws2Errors, dws2IDEUtils; 41 | 42 | {$I dws2VclClxIdeUtils.inc} 43 | end. 44 | -------------------------------------------------------------------------------- /src/thirdparty/pascal/dws2CLXSymbolsToTree.pas: -------------------------------------------------------------------------------- 1 | {**********************************************************************} 2 | { } 3 | { "The contents of this file are subject to the Mozilla Public } 4 | { License Version 1.1 (the "License"); you may not use this } 5 | { file except in compliance with the License. You may obtain } 6 | { a copy of the License at } 7 | { } 8 | { http://www.mozilla.org/MPL/ } 9 | { } 10 | { Software distributed under the License is distributed on an } 11 | { "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express } 12 | { or implied. See the License for the specific language } 13 | { governing rights and limitations under the License. } 14 | { } 15 | { The Original Code is dws2SymbolsToTree source code, released } 16 | { October 26, 2002 } 17 | { } 18 | { The Initial Developer of the Original Code is Mark Ericksen } 19 | { Portions created by Mark Ericksen are } 20 | { Copyright (C) 2002 Mark Ericksen, United States of America. } 21 | { All Rights Reserved. } 22 | { } 23 | {**********************************************************************} 24 | unit dws2CLXSymbolsToTree; 25 | 26 | interface 27 | 28 | uses SysUtils, Classes, QGraphics, dws2Comp, dws2Exprs, dws2Symbols, dws2Errors, 29 | QComCtrls, dws2CLXIDEUtils; 30 | 31 | {$I dws2VclClxSymbolsToTree.inc} 32 | end. 33 | -------------------------------------------------------------------------------- /src/thirdparty/pascal/dws2CompStrings.pas: -------------------------------------------------------------------------------- 1 | {**********************************************************************} 2 | { } 3 | { "The contents of this file are subject to the Mozilla Public } 4 | { License Version 1.1 (the "License"); you may not use this } 5 | { file except in compliance with the License. You may obtain } 6 | { a copy of the License at } 7 | { } 8 | { http://www.mozilla.org/MPL/ } 9 | { } 10 | { Software distributed under the License is distributed on an } 11 | { "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express } 12 | { or implied. See the License for the specific language } 13 | { governing rights and limitations under the License. } 14 | { } 15 | { The Original Code is DelphiWebScriptII source code, released } 16 | { January 1, 2001 } 17 | { } 18 | { The Initial Developer of the Original Code is Matthias } 19 | { Ackermann. Portions created by Matthias Ackermann are } 20 | { Copyright (C) 2000 Matthias Ackermann, Switzerland. All } 21 | { Rights Reserved. } 22 | { } 23 | { Contributor(s): ______________________________________. } 24 | { } 25 | {**********************************************************************} 26 | 27 | unit dws2CompStrings; 28 | 29 | interface 30 | 31 | resourcestring 32 | UNT_CircularReference = 'Circular reference to symbol "%s"'; 33 | UNT_NameIsEmpty = 'Name property mustn''t be empty!'; 34 | UNT_NameAlreadyExists = 'Name "%s" already exists!'; 35 | UNT_UnitNameNotDefined = 'Property %s.UnitName is undefined!'; 36 | UNT_ParameterNameAlreadyExists = 'Parameter name "%s" already exists'; 37 | UNT_DependencyError = 'Dependency check from unit "%s" to unit "%s" failed: %s'; 38 | 39 | UNT_UnitGenerationError = 'Tdws2Unit: "%s" -- %s'; 40 | UNT_SymbolGenerationError = '%s: "%s" -- %s'; 41 | 42 | UNT_DatatypeUnknown = 'DataType "%s" not found'; 43 | UNT_AutoInstantiateWithoutClass = 44 | 'AutoInstantiate is true but DataType "%s" isn''t a class'; 45 | 46 | UNT_ClassAlreadyDefined = 'Class already defined'; 47 | UNT_ClassNameAlreadyDefined = 48 | 'The class "%s" is already used for another symbol %s'; 49 | UNT_SuperClassUnknwon = 'Superclass "%s" not found'; 50 | UNT_ReadAccessNotFound = 'ReadAccess "%s" not found'; 51 | UNT_WriteAccessNotFound = 'WriteAccess "%s" not found'; 52 | 53 | UNT_InvalidArrayBounds = 'LowBound is higher than HighBound'; 54 | 55 | UNT_CantChangeUnitname = 56 | 'Can''t change UnitName while property "Script" is assigned!'; 57 | 58 | ADP_ChainIsFormingLoop = 'Adpater chain is forming a loop!'; 59 | ADP_IncompatibleAdapters = 'Incompatible Adapters: %s -> %s'; 60 | 61 | implementation 62 | 63 | end. 64 | -------------------------------------------------------------------------------- /src/thirdparty/pascal/dws2Connectors.pas: -------------------------------------------------------------------------------- 1 | package dws2Connectors; 2 | 3 | {$R *.res} 4 | {$ALIGN 8} 5 | {$ASSERTIONS ON} 6 | {$BOOLEVAL OFF} 7 | {$DEBUGINFO ON} 8 | {$EXTENDEDSYNTAX ON} 9 | {$IMPORTEDDATA ON} 10 | {$IOCHECKS ON} 11 | {$LOCALSYMBOLS ON} 12 | {$LONGSTRINGS ON} 13 | {$OPENSTRINGS ON} 14 | {$OPTIMIZATION ON} 15 | {$OVERFLOWCHECKS OFF} 16 | {$RANGECHECKS OFF} 17 | {$REFERENCEINFO ON} 18 | {$SAFEDIVIDE OFF} 19 | {$STACKFRAMES OFF} 20 | {$TYPEDADDRESS OFF} 21 | {$VARSTRINGCHECKS ON} 22 | {$WRITEABLECONST OFF} 23 | {$MINENUMSIZE 1} 24 | {$IMAGEBASE $400000} 25 | {$LIBSUFFIX '60'} 26 | {$RUNONLY} 27 | {$IMPLICITBUILD OFF} 28 | 29 | requires 30 | rtl, 31 | dws2Runtime; 32 | 33 | contains 34 | dws2ComConnector in 'dws2ComConnector.pas'; 35 | 36 | end. 37 | -------------------------------------------------------------------------------- /src/thirdparty/pascal/dws2ConsoleAdapter.pas: -------------------------------------------------------------------------------- 1 | unit dws2ConsoleAdapter; 2 | 3 | interface 4 | 5 | uses 6 | Variants, Classes, 7 | {$IFDEF LINUX} 8 | Libc, 9 | {$ELSE} 10 | Windows, 11 | {$ENDIF} 12 | dws2Comp, dws2Exprs, dws2Errors, dws2Symbols, dws2Functions, dws2compiler; 13 | 14 | type 15 | TConsoleReadLnFunction = class(TInternalFunction) 16 | public 17 | procedure Execute; override; 18 | end; 19 | 20 | TConsoleWriteFunction = class(TInternalFunction) 21 | public 22 | procedure Execute; override; 23 | end; 24 | 25 | TConsoleWriteLnFunction = class(TInternalFunction) 26 | public 27 | procedure Execute; override; 28 | end; 29 | 30 | Tdws2ConsoleUnit = class(Tdws2UnitComponent) 31 | protected 32 | procedure AddUnitSymbols(SymbolTable: TSymbolTable); override; 33 | public 34 | constructor Create(AOwner: TComponent); override; 35 | destructor Destroy; 36 | end; 37 | 38 | 39 | implementation 40 | 41 | uses SysUtils, dws2Strings; 42 | 43 | { TConsoleReadLnFunction } 44 | 45 | procedure TConsoleReadLnFunction.Execute; 46 | var 47 | s: string; 48 | c: array [0..255] of Char; 49 | numRead, dummy: Cardinal; 50 | begin 51 | {$IFDEF LINUX} 52 | 53 | {$ELSE} 54 | s := VarToStr(Info['s']); 55 | WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), PChar(s), Length(s), dummy, nil); 56 | 57 | ReadConsole(GetStdHandle(STD_INPUT_HANDLE), @c, 255, numRead, nil); 58 | s := #10; 59 | WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), PChar(s), 1, dummy, nil); 60 | 61 | SetString(s, PChar(@c[0]), numRead); 62 | Info.Result := s; 63 | {$ENDIF} 64 | end; 65 | 66 | { TWriteFunction } 67 | 68 | procedure TConsoleWriteFunction.Execute; 69 | var 70 | s: string; 71 | dummy: Cardinal; 72 | begin 73 | {$IFDEF LINUX} 74 | 75 | {$ELSE} 76 | s := VarToStr(Info['s']); 77 | WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), PChar(s), Length(s), dummy, nil); 78 | {$ENDIF} 79 | end; 80 | 81 | { TWriteLnFunction } 82 | 83 | procedure TConsoleWriteLnFunction.Execute; 84 | var 85 | s: string; 86 | Dummy: Cardinal; 87 | begin 88 | {$IFDEF LINUX} 89 | 90 | {$ELSE} 91 | s := VarToStr(Info['s']) + #13#10; 92 | WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), PChar(s), Length(s), dummy, nil); 93 | {$ENDIF} 94 | end; 95 | 96 | { Tdws2ConsoleType } 97 | 98 | constructor Tdws2ConsoleUnit.Create(AOwner: TComponent); 99 | begin 100 | inherited; 101 | if not(csDesigning in ComponentState) then 102 | begin 103 | {$IFNDEF CONSOLE } 104 | Win32Check(AllocConsole); 105 | {$ENDIF} 106 | 107 | SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), ENABLE_LINE_INPUT or ENABLE_ECHO_INPUT); 108 | end; 109 | end; 110 | 111 | destructor Tdws2ConsoleUnit.Destroy; 112 | begin 113 | inherited; 114 | if not(csDesigning in ComponentState) then 115 | FreeConsole; 116 | end; 117 | 118 | procedure Tdws2ConsoleUnit.AddUnitSymbols(SymbolTable: TSymbolTable); 119 | begin 120 | TConsoleReadLnFunction.Create(SymbolTable, 'ReadLn', ['s', SYS_VARIANT], SYS_STRING); 121 | TConsoleWriteFunction.Create(SymbolTable, 'Write', ['s', SYS_VARIANT], ''); 122 | TConsoleWriteLnFunction.Create(SymbolTable, 'WriteLn', ['s', SYS_VARIANT], ''); 123 | end; 124 | 125 | end. 126 | -------------------------------------------------------------------------------- /src/thirdparty/pascal/dws2Debugger.pas: -------------------------------------------------------------------------------- 1 | {**********************************************************************} 2 | { } 3 | { "The contents of this file are subject to the Mozilla Public } 4 | { License Version 1.1 (the "License"); you may not use this } 5 | { file except in compliance with the License. You may obtain } 6 | { a copy of the License at } 7 | { } 8 | { http://www.mozilla.org/MPL/ } 9 | { } 10 | { Software distributed under the License is distributed on an } 11 | { "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express } 12 | { or implied. See the License for the specific language } 13 | { governing rights and limitations under the License. } 14 | { } 15 | { The Original Code is DelphiWebScriptII source code, released } 16 | { January 1, 2001 } 17 | { } 18 | { The Initial Developer of the Original Code is Matthias } 19 | { Ackermann. Portions created by Matthias Ackermann are } 20 | { Copyright (C) 2000 Matthias Ackermann, Switzerland. All } 21 | { Rights Reserved. } 22 | { } 23 | { Contributor(s): Danilo Luiz Rheinheimer } 24 | { } 25 | {**********************************************************************} 26 | 27 | {$I dws2.inc} 28 | 29 | unit dws2Debugger; 30 | 31 | interface 32 | 33 | uses 34 | Classes, dws2Exprs; 35 | 36 | type 37 | TOnDebugStartStopEvent = procedure(MainProg: TProgram) of object; 38 | TOnDebugEvent = procedure(Prog: TProgram; Expr: TExpr) of object; 39 | 40 | Tdws2SimpleDebugger = class(TComponent, IUnknown, IDebugger) 41 | private 42 | FOnDebug: TOnDebugEvent; 43 | FOnStartDebug: TOnDebugStartStopEvent; 44 | FOnStopDebug: TOnDebugStartStopEvent; 45 | FOnEnterFunc: TOnDebugEvent; 46 | FOnLeaveFunc: TOnDebugEvent; 47 | procedure StartDebug(MainProg: TProgram); 48 | procedure DoDebug(Prog: TProgram; Expr: TExpr); 49 | procedure StopDebug(MainProg: TProgram); 50 | procedure EnterFunc(Prog: TProgram; Expr: TExpr); 51 | procedure LeaveFunc(Prog: TProgram; Expr: TExpr); 52 | published 53 | property OnDebug: TOnDebugEvent read FOnDebug write FOnDebug; 54 | property OnDebugStart: TOnDebugStartStopEvent read FOnStartDebug write 55 | FOnStartDebug; 56 | property OnDebugStop: TOnDebugStartStopEvent read FOnStopDebug write 57 | FOnStopDebug; 58 | property OnEnterFunc: TOnDebugEvent read FOnEnterFunc write FOnEnterFunc; 59 | property OnLeaveFunc: TOnDebugEvent read FOnLeaveFunc write FOnLeaveFunc; 60 | end; 61 | 62 | implementation 63 | 64 | { TdwsSimpleDebugger } 65 | 66 | procedure Tdws2SimpleDebugger.DoDebug(Prog: TProgram; Expr: TExpr); 67 | begin 68 | if Assigned(FOnDebug) then 69 | FOnDebug(Prog, Expr); 70 | end; 71 | 72 | procedure Tdws2SimpleDebugger.EnterFunc(Prog: TProgram; Expr: TExpr); 73 | begin 74 | if Assigned(FOnEnterFunc) then 75 | FOnEnterFunc(Prog, Expr); 76 | end; 77 | 78 | procedure Tdws2SimpleDebugger.LeaveFunc(Prog: TProgram; Expr: TExpr); 79 | begin 80 | if Assigned(FOnLeaveFunc) then 81 | FOnLeaveFunc(Prog, Expr); 82 | end; 83 | 84 | procedure Tdws2SimpleDebugger.StartDebug(MainProg: TProgram); 85 | begin 86 | if Assigned(FOnStartDebug) then 87 | FOnStartDebug(MainProg); 88 | end; 89 | 90 | procedure Tdws2SimpleDebugger.StopDebug(MainProg: TProgram); 91 | begin 92 | if Assigned(FOnStopDebug) then 93 | FOnStopDebug(MainProg); 94 | end; 95 | 96 | end. 97 | -------------------------------------------------------------------------------- /src/thirdparty/pascal/dws2Experts.pas: -------------------------------------------------------------------------------- 1 | {**********************************************************************} 2 | { } 3 | { "The contents of this file are subject to the Mozilla Public } 4 | { License Version 1.1 (the "License"); you may not use this } 5 | { file except in compliance with the License. You may obtain } 6 | { a copy of the License at } 7 | { } 8 | { http://www.mozilla.org/MPL/ } 9 | { } 10 | { Software distributed under the License is distributed on an } 11 | { "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express } 12 | { or implied. See the License for the specific language } 13 | { governing rights and limitations under the License. } 14 | { } 15 | { The Original Code is DelphiWebScriptII source code, released } 16 | { January 1, 2001 } 17 | { } 18 | { The Initial Developer of the Original Code is Matthias } 19 | { Ackermann. Portions created by Matthias Ackermann are } 20 | { Copyright (C) 2000 Matthias Ackermann, Switzerland. All } 21 | { Rights Reserved. } 22 | { } 23 | { Contributor(s): Eric Grange. } 24 | { } 25 | {**********************************************************************} 26 | 27 | {$I dws2.inc} 28 | 29 | // Design-Time only, do NOT include this unit in runtime packages. 30 | // 31 | unit dws2Experts; 32 | 33 | interface 34 | 35 | procedure Register; 36 | 37 | implementation 38 | 39 | uses Classes, Forms, SysUtils, 40 | {$IFDEF NEWDESIGN} 41 | DesignIntf, 42 | DesignEditors, 43 | {$ELSE} 44 | DsgnIntf, 45 | {$ENDIF} 46 | dws2Strings, dws2Comp, dws2Symbols; 47 | 48 | type 49 | Tdws2DataTypeProperty = class(TStringProperty) 50 | protected 51 | { Protected Declarations } 52 | function GetAttributes: TPropertyAttributes; override; 53 | procedure GetValues(Proc: TGetStrProc); override; 54 | end; 55 | 56 | Tdws2AncestorProperty = class(TStringProperty) 57 | protected 58 | { Protected Declarations } 59 | function GetAttributes: TPropertyAttributes; override; 60 | procedure GetValues(Proc: TGetStrProc); override; 61 | end; 62 | 63 | { Tdws2DataTypeProperty } 64 | 65 | function Tdws2DataTypeProperty.GetAttributes: TPropertyAttributes; 66 | begin 67 | Result := [paValueList]; 68 | end; 69 | 70 | procedure Tdws2DataTypeProperty.GetValues(Proc: TGetStrProc); 71 | var 72 | i: Integer; 73 | dws2Unit: Tdws2Unit; 74 | sl: TStringList; 75 | begin 76 | if not (GetComponent(0) is Tdws2Symbol) then 77 | exit; 78 | 79 | dws2Unit := Tdws2Symbol(GetComponent(0)).GetUnit; 80 | 81 | sl := TStringList.Create; 82 | try 83 | dws2Unit.GetDataTypes(sl); 84 | sl.Sorted := True; 85 | sl.Duplicates := dupIgnore; 86 | 87 | // feed the dropdown list 88 | for i := 0 to sl.Count - 1 do 89 | if Length(sl[i]) > 0 then 90 | Proc(sl[i]); 91 | finally 92 | sl.Free; 93 | end; 94 | end; 95 | 96 | { Tdws2AncestorProperty } 97 | 98 | function Tdws2AncestorProperty.GetAttributes: TPropertyAttributes; 99 | begin 100 | Result := [paValueList]; 101 | end; 102 | 103 | procedure Tdws2AncestorProperty.GetValues(Proc: TGetStrProc); 104 | var 105 | i: Integer; 106 | sl: TStringList; 107 | dws2Unit: Tdws2Unit; 108 | begin 109 | if GetComponent(0) is Tdws2Symbol then 110 | begin 111 | dws2Unit := Tdws2Symbol(GetComponent(0)).GetUnit; 112 | 113 | sl := TStringList.Create; 114 | try 115 | dws2Unit.GetClassTypes(sl); 116 | sl.Sorted := True; 117 | sl.Duplicates := dupIgnore; 118 | 119 | // feed the dropdown list 120 | for i := 0 to sl.Count - 1 do 121 | if Length(sl[i]) > 0 then 122 | Proc(sl[i]); 123 | finally 124 | sl.Free; 125 | end; 126 | end; 127 | end; 128 | 129 | procedure Register; 130 | begin 131 | RegisterPropertyEditor(TypeInfo(TDataType), Tdws2Function, 'ResultType', 132 | Tdws2DataTypeProperty); 133 | RegisterPropertyEditor(TypeInfo(TDataType), Tdws2Variable, 'DataType', 134 | Tdws2DataTypeProperty); 135 | RegisterPropertyEditor(TypeInfo(TDataType), Tdws2Property, 'DataType', 136 | Tdws2DataTypeProperty); 137 | RegisterPropertyEditor(TypeInfo(TDataType), Tdws2Property, 'IndexType', 138 | Tdws2DataTypeProperty); 139 | RegisterPropertyEditor(TypeInfo(TDataType), Tdws2Global, 'DataType', 140 | Tdws2DataTypeProperty); 141 | RegisterPropertyEditor(TypeInfo(TDataType), Tdws2Parameter, 'DataType', 142 | Tdws2DataTypeProperty); 143 | RegisterPropertyEditor(TypeInfo(TDataType), Tdws2Field, 'DataType', 144 | Tdws2DataTypeProperty); 145 | RegisterPropertyEditor(TypeInfo(TDataType), Tdws2Member, 'DataType', 146 | Tdws2DataTypeProperty); 147 | RegisterPropertyEditor(TypeInfo(TDataType), Tdws2Array, 'DataType', 148 | Tdws2DataTypeProperty); 149 | RegisterPropertyEditor(TypeInfo(TDataType), Tdws2Class, 'Ancestor', 150 | Tdws2AncestorProperty); 151 | end; 152 | 153 | end. 154 | 155 | -------------------------------------------------------------------------------- /src/thirdparty/pascal/dws2VCLGUIFunctions.pas: -------------------------------------------------------------------------------- 1 | {**********************************************************************} 2 | { } 3 | { "The contents of this file are subject to the Mozilla Public } 4 | { License Version 1.1 (the "License"); you may not use this } 5 | { file except in compliance with the License. You may obtain } 6 | { a copy of the License at } 7 | { } 8 | { http://www.mozilla.org/MPL/ } 9 | { } 10 | { Software distributed under the License is distributed on an } 11 | { "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express } 12 | { or implied. See the License for the specific language } 13 | { governing rights and limitations under the License. } 14 | { } 15 | { The Original Code is DelphiWebScriptII source code, released } 16 | { January 1, 2001 } 17 | { } 18 | { The Initial Developer of the Original Code is Matthias } 19 | { Ackermann. } 20 | { } 21 | { Portions created by Matthias Ackermann are Copyright } 22 | { (C) 2000 Matthias Ackermann, Switzerland. } 23 | { Portions created by Eric Grange are Copyright } 24 | { (C) 2001 Eric Grange, France. } 25 | { } 26 | { } 27 | { All Rights Reserved. } 28 | { } 29 | { } 30 | { Contributor(s): Eric Grange } 31 | { } 32 | { Compatibility: } 33 | { [x] D5 (WK) [x] D6 (WK) [ ] K1 (WK) } 34 | {**********************************************************************} 35 | 36 | // dws2VCLGUIFunctions - Generated : 27.02.01 12:43:46 37 | unit dws2VCLGUIFunctions; 38 | 39 | interface 40 | 41 | uses Classes, dws2Functions, dws2Exprs, dws2Symbols; 42 | 43 | type 44 | 45 | TShowMessageFunc = class(TInternalFunction) 46 | procedure Execute; override; 47 | function Optimize(FuncExpr: TExprBase): TExprBase; override; 48 | end; 49 | TShowMessageFuncExpr = class(TUnaryOpExpr) 50 | function Eval: Variant; override; 51 | end; 52 | 53 | TInputBoxFunc = class(TInternalFunction) 54 | procedure Execute; override; 55 | end; 56 | 57 | TErrorDlgFunc = class(TInternalFunction) 58 | procedure Execute; override; 59 | end; 60 | 61 | TInformationDlgFunc = class(TInternalFunction) 62 | procedure Execute; override; 63 | end; 64 | 65 | TQuestionDlgFunc = class(TInternalFunction) 66 | procedure Execute; override; 67 | end; 68 | 69 | TOkCancelDlgFunc = class(TInternalFunction) 70 | procedure Execute; override; 71 | end; 72 | 73 | Tdws2GUIFunctions = class(TComponent) 74 | end; 75 | 76 | implementation 77 | 78 | uses Windows, Forms, Dialogs; 79 | 80 | const // type constants to make sure strings get reused by the compiler 81 | cFloat = 'Float'; 82 | cInteger = 'Integer'; 83 | cString = 'String'; 84 | cBoolean = 'Boolean'; 85 | 86 | { TShowMessageFunc } 87 | 88 | procedure TShowMessageFunc.Execute; 89 | var 90 | Msg: string; 91 | begin 92 | Msg := Info['msg']; 93 | ShowMessage(Msg); 94 | end; 95 | 96 | function TShowMessageFunc.Optimize(FuncExpr: TExprBase): TExprBase; 97 | begin 98 | with FuncExpr as TFuncExpr do 99 | begin 100 | Result := TShowMessageFuncExpr.Create(Prog, Pos, Args[0]); 101 | Args.Clear; 102 | Free; 103 | end; 104 | end; 105 | 106 | function TShowMessageFuncExpr.Eval: Variant; 107 | var 108 | Msg: string; 109 | begin 110 | Msg := Expr.Eval; 111 | ShowMessage(Msg); 112 | end; 113 | 114 | { TInputBoxFunc } 115 | 116 | procedure TInputBoxFunc.Execute; 117 | var 118 | Param1, Param2, Param3: string; 119 | begin 120 | Param1 := Info['aCaption']; 121 | Param2 := Info['aPrompt']; 122 | Param3 := Info['aDefault']; 123 | Info['Result'] := InputBox(Param1, Param2, Param3); 124 | end; 125 | 126 | { TErrorDlgFunc } 127 | 128 | procedure TErrorDlgFunc.Execute; 129 | begin 130 | Application.MessageBox(PChar(string(Info['msg'])), 'Error', 131 | MB_ICONERROR + MB_OK + MB_APPLMODAL + MB_TOPMOST); 132 | end; 133 | 134 | { TInformationDlgFunc } 135 | 136 | procedure TInformationDlgFunc.Execute; 137 | begin 138 | Application.MessageBox(PChar(string(Info['msg'])), 'Information', 139 | MB_ICONINFORMATION + MB_OK + MB_APPLMODAL + MB_TOPMOST); 140 | end; 141 | 142 | { TQuestionDlgFunc } 143 | 144 | procedure TQuestionDlgFunc.Execute; 145 | begin 146 | Info['Result'] := (Application.MessageBox(PChar(string(Info['msg'])), 'Question', 147 | MB_ICONQUESTION + MB_YESNO + MB_APPLMODAL + MB_TOPMOST) = IDYES) 148 | end; 149 | 150 | { TOkCancelDlgFunc } 151 | 152 | procedure TOkCancelDlgFunc.Execute; 153 | begin 154 | Info['Result'] := (Application.MessageBox(PChar(string(Info['msg'])), 155 | 'Confirmation', 156 | MB_ICONQUESTION + MB_OKCANCEL + MB_APPLMODAL + MB_TOPMOST) = IDOK) 157 | end; 158 | 159 | initialization 160 | RegisterInternalFunction(TShowMessageFunc, 'ShowMessage', ['msg', cString], ''); 161 | RegisterInternalFunction(TInputBoxFunc, 'InputBox', ['aCaption', cString, 162 | 'aPrompt', cString, 'aDefault', cString], cString); 163 | RegisterInternalFunction(TErrorDlgFunc, 'ErrorDlg', ['msg', cString], ''); 164 | RegisterInternalFunction(TInformationDlgFunc, 'InformationDlg', ['msg', cString], 165 | ''); 166 | RegisterInternalFunction(TQuestionDlgFunc, 'QuestionDlg', ['msg', cString], 167 | cBoolean); 168 | RegisterInternalFunction(TOkCancelDlgFunc, 'OkCancelDlg', ['msg', cString], 169 | cBoolean); 170 | end. 171 | -------------------------------------------------------------------------------- /src/thirdparty/pascal/dws2VCLIDEUtils.pas: -------------------------------------------------------------------------------- 1 | {**********************************************************************} 2 | { } 3 | { "The contents of this file are subject to the Mozilla Public } 4 | { License Version 1.1 (the "License"); you may not use this } 5 | { file except in compliance with the License. You may obtain } 6 | { a copy of the License at } 7 | { } 8 | { http://www.mozilla.org/MPL/ } 9 | { } 10 | { Software distributed under the License is distributed on an } 11 | { "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express } 12 | { or implied. See the License for the specific language } 13 | { governing rights and limitations under the License. } 14 | { } 15 | { The Original Code is dws2IDEUtils source code, released } 16 | { October 26, 2002 } 17 | { } 18 | { The Initial Developer of the Original Code is Mark Ericksen } 19 | { Portions created by Mark Ericksen are } 20 | { Copyright (C) 2002 Mark Ericksen, United States of America. } 21 | { All Rights Reserved. } 22 | { } 23 | { Contributors: Andreas Luleich, Willibald Krenn } 24 | { } 25 | {**********************************************************************} 26 | 27 | {$I dws2.inc} 28 | 29 | unit dws2VCLIDEUtils; 30 | 31 | { Utilities that would be common in an 'advanced' IDE. NOTE: These require 32 | that the program was compiled with coSymbolDictionary and/or coContextMap } 33 | 34 | interface 35 | 36 | uses SysUtils, Classes, Graphics, 37 | {$IFDEF NEWVARIANTS} 38 | Variants, 39 | {$ENDIF} 40 | dws2Comp, dws2Exprs, dws2Symbols, dws2Stack, dws2Errors, dws2IDEUtils; 41 | 42 | {$I dws2VclClxIdeUtils.inc} 43 | 44 | end. 45 | -------------------------------------------------------------------------------- /src/thirdparty/pascal/dws2VCLSymbolsToTree.pas: -------------------------------------------------------------------------------- 1 | {**********************************************************************} 2 | { } 3 | { "The contents of this file are subject to the Mozilla Public } 4 | { License Version 1.1 (the "License"); you may not use this } 5 | { file except in compliance with the License. You may obtain } 6 | { a copy of the License at } 7 | { } 8 | { http://www.mozilla.org/MPL/ } 9 | { } 10 | { Software distributed under the License is distributed on an } 11 | { "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express } 12 | { or implied. See the License for the specific language } 13 | { governing rights and limitations under the License. } 14 | { } 15 | { The Original Code is dws2SymbolsToTree source code, released } 16 | { October 26, 2002 } 17 | { } 18 | { The Initial Developer of the Original Code is Mark Ericksen } 19 | { Portions created by Mark Ericksen are } 20 | { Copyright (C) 2002 Mark Ericksen, United States of America. } 21 | { All Rights Reserved. } 22 | { } 23 | {**********************************************************************} 24 | unit dws2VCLSymbolsToTree; 25 | 26 | interface 27 | 28 | uses SysUtils, Classes, Graphics, dws2Comp, dws2Exprs, dws2Symbols, dws2Errors, 29 | ComCtrls, dws2VCLIDEUtils; 30 | 31 | {$I dws2VclClxSymbolsToTree.inc} 32 | end. 33 | -------------------------------------------------------------------------------- /src/thirdparty/pascal/dws_CLXmwPasToRtf.pas: -------------------------------------------------------------------------------- 1 | {+--------------------------------------------------------------------------+ 2 | | Unit: mwPasToRtf 3 | | Created: 09.97 4 | | Author: Martin Waldenburg 5 | | Copyright 1997, all rights reserved. 6 | | Description: Pas to Rtf converter for syntax highlighting etc. 7 | | Version: 0.7 beta 8 | | Status: FreeWare 9 | | DISCLAIMER: This is provided as is, expressly without a warranty of any kind. 10 | | You use it at your own risc. 11 | | Changes: Matthias Ackermann 12 | +--------------------------------------------------------------------------+} 13 | 14 | {$I dws2.inc} 15 | unit dws_CLXmwPasToRtf; 16 | 17 | 18 | interface 19 | 20 | uses 21 | SysUtils, 22 | Messages, 23 | Classes, 24 | QGraphics, 25 | Inifiles; 26 | {$I dws_VclClxmwPasToRtf.inc} 27 | end. 28 | -------------------------------------------------------------------------------- /src/thirdparty/pascal/dws_VCLmwPasToRtf.pas: -------------------------------------------------------------------------------- 1 | {+--------------------------------------------------------------------------+ 2 | | Unit: mwPasToRtf 3 | | Created: 09.97 4 | | Author: Martin Waldenburg 5 | | Copyright 1997, all rights reserved. 6 | | Description: Pas to Rtf converter for syntax highlighting etc. 7 | | Version: 0.7 beta 8 | | Status: FreeWare 9 | | DISCLAIMER: This is provided as is, expressly without a warranty of any kind. 10 | | You use it at your own risc. 11 | | Changes: Matthias Ackermann 12 | +--------------------------------------------------------------------------+} 13 | {$I dws2.inc} 14 | unit dws_VCLmwPasToRtf; 15 | 16 | 17 | interface 18 | 19 | uses 20 | SysUtils, 21 | Messages, 22 | Classes, 23 | Graphics, 24 | Inifiles; 25 | {$I dws_VclClxmwPasToRtf.inc} 26 | end. 27 | -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/PascalScript.inc: -------------------------------------------------------------------------------- 1 | {----------------------------------------------------------------------------} 2 | { RemObjects Pascal Script } 3 | { } 4 | { compiler: Delphi 2 and up, Kylix 3 and up } 5 | { platform: Win32, Linux } 6 | { } 7 | { (c)opyright RemObjects Software. all rights reserved. } 8 | { } 9 | {----------------------------------------------------------------------------} 10 | 11 | 12 | {$INCLUDE eDefines.inc} 13 | 14 | {$IFDEF FPC}{$MODE DELPHI}{$H+}{$ENDIF} 15 | 16 | {$IFDEF VER125}{C4}{$B-}{$X+}{$T-}{$H+}{$ENDIF} 17 | {$IFDEF VER110}{C3}{$B-}{$X+}{$T-}{$H+}{$ENDIF} 18 | {$IFDEF VER93}{C1}{$B-}{$X+}{$T-}{$H+}{$ENDIF} 19 | 20 | {$IFDEF DELPHI4UP} 21 | {$DEFINE PS_HAVEVARIANT} 22 | {$DEFINE PS_DYNARRAY} 23 | {$ENDIF} 24 | 25 | {$IFNDEF FPC} 26 | {$B-}{$X+}{$T-}{$H+} 27 | {$ELSE} 28 | {$R-}{$Q-} 29 | {$ENDIF} 30 | 31 | {$IFNDEF FPC} 32 | {$IFNDEF DELPHI4UP} 33 | {$IFNDEF LINUX} 34 | {$DEFINE PS_NOINT64} 35 | {$ENDIF} 36 | {$ENDIF} 37 | 38 | {$IFDEF DELPHI2} 39 | {$DEFINE PS_NOINT64} 40 | {$DEFINE PS_NOWIDESTRING} 41 | {$B-}{$X+}{$T-}{$H+} 42 | {$ENDIF} 43 | 44 | {$IFDEF LINUX}{KYLIX}{$DEFINE CLX}{$DEFINE DELPHI3UP}{$DEFINE DELPHI6UP}{$ENDIF} 45 | {$ENDIF} 46 | {$R-}{$Q-} 47 | 48 | 49 | { 50 | Defines: 51 | PS_NOSMARTLIST - Don't use the smart list option 52 | PS_NOIDISPATCH 53 | PS_NOWIDESTRING 54 | PS_NOINT64 55 | PS_DELPHIDIV 56 | } 57 | 58 | {$UNDEF DEBUG} 59 | 60 | {$IFDEF CLX} 61 | {$DEFINE PS_NOIDISPATCH} // not implemented 62 | {$ENDIF} 63 | 64 | {$IFDEF FPC} 65 | {$I PascalScriptFPC.inc} 66 | {$ENDIF} 67 | -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/uPSC_buttons.pas: -------------------------------------------------------------------------------- 1 | { Compiletime Buttons support } 2 | unit uPSC_buttons; 3 | {$I PascalScript.inc} 4 | interface 5 | uses 6 | uPSCompiler, uPSUtils; 7 | 8 | { 9 | Will register files from: 10 | Buttons 11 | 12 | Requires 13 | STD, classes, controls and graphics and StdCtrls 14 | } 15 | procedure SIRegister_Buttons_TypesAndConsts(Cl: TPSPascalCompiler); 16 | 17 | procedure SIRegisterTSPEEDBUTTON(Cl: TPSPascalCompiler); 18 | procedure SIRegisterTBITBTN(Cl: TPSPascalCompiler); 19 | 20 | procedure SIRegister_Buttons(Cl: TPSPascalCompiler); 21 | 22 | implementation 23 | 24 | procedure SIRegisterTSPEEDBUTTON(Cl: TPSPascalCompiler); 25 | begin 26 | with Cl.AddClassN(cl.FindClass('TGraphicControl'), 'TSpeedButton') do 27 | begin 28 | RegisterProperty('AllowAllUp', 'Boolean', iptrw); 29 | {$IFDEF DELPHI4UP} 30 | RegisterProperty('Anchors', 'TAnchors', iptrw); 31 | {$ENDIF} 32 | RegisterProperty('GroupIndex', 'Integer', iptrw); 33 | RegisterProperty('Down', 'Boolean', iptrw); 34 | RegisterProperty('Caption', 'string', iptrw); 35 | RegisterProperty('Font', 'TFont', iptrw); 36 | RegisterProperty('Glyph', 'TBitmap', iptrw); 37 | RegisterProperty('Layout', 'TButtonLayout', iptrw); 38 | RegisterProperty('Margin', 'Integer', iptrw); 39 | RegisterProperty('NumGlyphs', 'Byte', iptrw); 40 | RegisterProperty('ParentFont', 'Boolean', iptrw); 41 | RegisterProperty('ParentShowHint', 'Boolean', iptrw); 42 | RegisterProperty('Spacing', 'Integer', iptrw); 43 | RegisterProperty('OnClick', 'TNotifyEvent', iptrw); 44 | RegisterProperty('OnDblClick', 'TNotifyEvent', iptrw); 45 | RegisterProperty('OnMouseDown', 'TMouseEvent', iptrw); 46 | RegisterProperty('OnMouseMove', 'TMouseMoveEvent', iptrw); 47 | RegisterProperty('OnMouseUp', 'TMouseEvent', iptrw); 48 | end; 49 | end; 50 | 51 | procedure SIRegisterTBITBTN(Cl: TPSPascalCompiler); 52 | begin 53 | with Cl.AddClassN(cl.FindClass('TButton'), 'TBitBtn') do 54 | begin 55 | {$IFDEF DELPHI4UP} 56 | RegisterProperty('Anchors', 'TAnchors', iptrw); 57 | {$ENDIF} 58 | RegisterProperty('Glyph', 'TBitmap', iptrw); 59 | RegisterProperty('Kind', 'TBitBtnKind', iptrw); 60 | RegisterProperty('Layout', 'TButtonLayout', iptrw); 61 | RegisterProperty('Margin', 'Integer', iptrw); 62 | RegisterProperty('NumGlyphs', 'Byte', iptrw); 63 | RegisterProperty('Style', 'TButtonStyle', iptrw); 64 | RegisterProperty('Spacing', 'Integer', iptrw); 65 | end; 66 | end; 67 | 68 | 69 | 70 | procedure SIRegister_Buttons_TypesAndConsts(Cl: TPSPascalCompiler); 71 | begin 72 | Cl.AddTypeS('TButtonLayout', '(blGlyphLeft, blGlyphRight, blGlyphTop, blGlyphBottom)'); 73 | Cl.AddTypeS('TButtonState', '(bsUp, bsDisabled, bsDown, bsExclusive)'); 74 | Cl.AddTypeS('TButtonStyle', '(bsAutoDetect, bsWin31, bsNew)'); 75 | Cl.AddTypeS('TBitBtnKind', '(bkCustom, bkOK, bkCancel, bkHelp, bkYes, bkNo, bkClose, bkAbort, bkRetry, bkIgnore, bkAll)'); 76 | 77 | end; 78 | 79 | procedure SIRegister_Buttons(Cl: TPSPascalCompiler); 80 | begin 81 | SIRegister_Buttons_TypesAndConsts(cl); 82 | SIRegisterTSPEEDBUTTON(cl); 83 | SIRegisterTBITBTN(cl); 84 | end; 85 | 86 | // PS_MINIVCL changes by Martijn Laan (mlaan at wintax _dot_ nl) 87 | 88 | 89 | end. 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/uPSC_comobj.pas: -------------------------------------------------------------------------------- 1 | { compiletime ComObj support } 2 | unit uPSC_comobj; 3 | 4 | {$I PascalScript.inc} 5 | interface 6 | uses 7 | uPSCompiler, uPSUtils; 8 | 9 | { 10 | 11 | Will register: 12 | 13 | function CreateOleObject(const ClassName: String): IDispatch; 14 | function GetActiveOleObject(const ClassName: String): IDispatch; 15 | 16 | } 17 | 18 | procedure SIRegister_ComObj(cl: TPSPascalCompiler); 19 | 20 | implementation 21 | 22 | procedure SIRegister_ComObj(cl: TPSPascalCompiler); 23 | begin 24 | {$IFDEF FPC} 25 | {$IFDEF PS_FPC_HAS_COM} 26 | cl.AddTypeS('HResult', 'LongInt'); 27 | cl.AddTypeS('TGUID', 'record D1: LongWord; D2: Word; D3: Word; D4: array[0..7] of Byte; end;'); 28 | cl.AddTypeS('TCLSID', 'TGUID'); 29 | cl.AddTypeS('TIID', 'TGUID'); 30 | cl.AddDelphiFunction('procedure OleCheck(Result: HResult);'); 31 | cl.AddDelphiFunction('function StringToGUID(const S: string): TGUID;'); 32 | cl.AddDelphiFunction('function CreateComObject(const ClassID: TGUID): IUnknown;'); 33 | cl.AddDelphiFunction('function CreateOleObject(const ClassName: string): IDispatch;'); 34 | cl.AddDelphiFunction('function GetActiveOleObject(const ClassName: string): IDispatch;'); 35 | {$ENDIF} 36 | {$ELSE} 37 | cl.AddTypeS('HResult', 'LongInt'); 38 | cl.AddTypeS('TGUID', 'record D1: LongWord; D2: Word; D3: Word; D4: array[0..7] of Byte; end;'); 39 | cl.AddTypeS('TCLSID', 'TGUID'); 40 | cl.AddTypeS('TIID', 'TGUID'); 41 | cl.AddDelphiFunction('procedure OleCheck(Result: HResult);'); 42 | {$IFNDEF PS_NOINTERFACES} 43 | {$IFDEF DELPHI3UP} 44 | cl.AddDelphiFunction('function StringToGUID(const S: string): TGUID;'); 45 | cl.AddDelphiFunction('function CreateComObject(const ClassID: TGUID): IUnknown;'); 46 | {$ENDIF} 47 | {$ENDIF} 48 | cl.AddDelphiFunction('function CreateOleObject(const ClassName: string): IDispatch;'); 49 | cl.AddDelphiFunction('function GetActiveOleObject(const ClassName: string): IDispatch;'); 50 | {$ENDIF} 51 | end; 52 | 53 | end. 54 | -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/uPSC_dateutils.pas: -------------------------------------------------------------------------------- 1 | { Compile time Date Time library } 2 | unit uPSC_dateutils; 3 | 4 | interface 5 | uses 6 | SysUtils, uPSCompiler, uPSUtils; 7 | 8 | 9 | procedure RegisterDateTimeLibrary_C(S: TPSPascalCompiler); 10 | 11 | implementation 12 | 13 | procedure RegisterDatetimeLibrary_C(S: TPSPascalCompiler); 14 | begin 15 | s.AddType('TDateTime', btDouble).ExportName := True; 16 | s.AddDelphiFunction('function EncodeDate(Year, Month, Day: Word): TDateTime;'); 17 | s.AddDelphiFunction('function EncodeTime(Hour, Min, Sec, MSec: Word): TDateTime;'); 18 | s.AddDelphiFunction('function TryEncodeDate(Year, Month, Day: Word; var Date: TDateTime): Boolean;'); 19 | s.AddDelphiFunction('function TryEncodeTime(Hour, Min, Sec, MSec: Word; var Time: TDateTime): Boolean;'); 20 | s.AddDelphiFunction('procedure DecodeDate(const DateTime: TDateTime; var Year, Month, Day: Word);'); 21 | s.AddDelphiFunction('procedure DecodeTime(const DateTime: TDateTime; var Hour, Min, Sec, MSec: Word);'); 22 | s.AddDelphiFunction('function DayOfWeek(const DateTime: TDateTime): Word;'); 23 | s.AddDelphiFunction('function Date: TDateTime;'); 24 | s.AddDelphiFunction('function Time: TDateTime;'); 25 | s.AddDelphiFunction('function Now: TDateTime;'); 26 | s.AddDelphiFunction('function DateTimeToUnix(D: TDateTime): Int64;'); 27 | s.AddDelphiFunction('function UnixToDateTime(U: Int64): TDateTime;'); 28 | 29 | s.AddDelphiFunction('function DateToStr(D: TDateTime): string;'); 30 | s.AddDelphiFunction('function StrToDate(const S: string): TDateTime;'); 31 | s.AddDelphiFunction('function FormatDateTime(const fmt: string; D: TDateTime): string;'); 32 | end; 33 | 34 | end. 35 | -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/uPSC_dll.pas: -------------------------------------------------------------------------------- 1 | { Compiletime DLL importing support } 2 | unit uPSC_dll; 3 | 4 | {$I PascalScript.inc} 5 | interface 6 | { 7 | 8 | Function FindWindow(c1, c2: PChar): Cardinal; external 'FindWindow@user32.dll stdcall'; 9 | 10 | } 11 | uses 12 | uPSCompiler, uPSUtils; 13 | 14 | 15 | {$IFDEF DELPHI3UP } 16 | resourceString 17 | {$ELSE } 18 | const 19 | {$ENDIF } 20 | 21 | RPS_Invalid_External = 'Invalid External'; 22 | RPS_InvalidCallingConvention = 'Invalid Calling Convention'; 23 | 24 | 25 | 26 | function DllExternalProc(Sender: TPSPascalCompiler; Decl: TPSParametersDecl; const OriginalName, FExternal: tbtstring): TPSRegProc; 27 | type 28 | 29 | TDllCallingConvention = (clRegister 30 | , clPascal 31 | , ClCdecl 32 | , ClStdCall 33 | ); 34 | 35 | var 36 | DefaultCC: TDllCallingConvention; 37 | 38 | procedure RegisterDll_Compiletime(cs: TPSPascalCompiler); 39 | 40 | implementation 41 | 42 | function rpos(ch: tbtchar; const s: tbtstring): Longint; 43 | var 44 | i: Longint; 45 | begin 46 | for i := length(s) downto 1 do 47 | if s[i] = ch then begin Result := i; exit; end; 48 | result := 0; 49 | end; 50 | 51 | function RemoveQuotes(s: tbtstring): tbtstring; 52 | begin 53 | result := s; 54 | if result = '' then exit; 55 | if Result[1] = '"' then delete(result ,1,1); 56 | if (Result <> '') and (Result[Length(result)] = '"') then delete(result, length(result), 1); 57 | end; 58 | 59 | function DllExternalProc(Sender: TPSPascalCompiler; Decl: TPSParametersDecl; const OriginalName, FExternal: tbtstring): TPSRegProc; 60 | var 61 | FuncName, 62 | Name, 63 | FuncCC, s, s2: AnsiString; 64 | CC: TDllCallingConvention; 65 | DelayLoad, LoadWithAlteredSearchPath: Boolean; 66 | 67 | begin 68 | Name := FastUpperCase(OriginalName); 69 | DelayLoad := False; 70 | LoadWithAlteredSearchPath := false; 71 | FuncCC := FExternal; 72 | 73 | if (pos(tbtChar('@'), FuncCC) = 0) then 74 | begin 75 | Sender.MakeError('', ecCustomError, tbtString(RPS_Invalid_External)); 76 | Result := nil; 77 | exit; 78 | end; 79 | FuncName := copy(FuncCC, 1, rpos('@', FuncCC)-1)+#0; 80 | delete(FuncCc, 1, length(FuncName)); 81 | if pos(tbtchar(' '), Funccc) <> 0 then 82 | begin 83 | if FuncCC[1] = '"' then 84 | begin 85 | Delete(FuncCC, 1, 1); 86 | FuncName := RemoveQuotes(copy(FuncCC, 1, pos(tbtchar('"'), FuncCC)-1))+#0+FuncName; 87 | Delete(FuncCC,1, pos(tbtchar('"'), FuncCC)); 88 | if (FuncCC <> '') and( FuncCC[1] = ' ') then delete(FuncCC,1,1); 89 | end else 90 | begin 91 | FuncName := copy(FuncCc, 1, pos(tbtchar(' '),FuncCC)-1)+#0+FuncName; 92 | Delete(FuncCC, 1, pos(tbtchar(' '), FuncCC)); 93 | end; 94 | if pos(tbtchar(' '), FuncCC) > 0 then 95 | begin 96 | s := Copy(FuncCC, pos(tbtchar(' '), Funccc)+1, MaxInt); 97 | FuncCC := FastUpperCase(Copy(FuncCC, 1, pos(tbtchar(' '), FuncCC)-1)); 98 | Delete(FuncCC, pos(tbtchar(' '), Funccc), MaxInt); 99 | repeat 100 | if pos(tbtchar(' '), s) > 0 then begin 101 | s2 := Copy(s, 1, pos(tbtchar(' '), s)-1); 102 | delete(s, 1, pos(tbtchar(' '), s)); 103 | end else begin 104 | s2 := s; 105 | s := ''; 106 | end; 107 | if FastUppercase(s2) = 'DELAYLOAD' then 108 | DelayLoad := True 109 | {$IFNDEF LINUX} 110 | else 111 | if FastUppercase(s2) = 'LOADWITHALTEREDSEARCHPATH' then 112 | LoadWithAlteredSearchPath := True 113 | {$ENDIF} 114 | else 115 | begin 116 | Sender.MakeError('', ecCustomError, 'Invalid External'); 117 | Result := nil; 118 | exit; 119 | end; 120 | until s = ''; 121 | 122 | end else 123 | FuncCC := FastUpperCase(FuncCC); 124 | if FuncCC = 'STDCALL' then cc := ClStdCall else 125 | if FuncCC = 'CDECL' then cc := ClCdecl else 126 | if FuncCC = 'REGISTER' then cc := clRegister else 127 | if FuncCC = 'PASCAL' then cc := clPascal else 128 | begin 129 | Sender.MakeError('', ecCustomError, tbtstring(RPS_InvalidCallingConvention)); 130 | Result := nil; 131 | exit; 132 | end; 133 | end else 134 | begin 135 | FuncName := RemoveQuotes(FuncCC)+#0+FuncName; 136 | FuncCC := ''; 137 | cc := DefaultCC; 138 | end; 139 | FuncName := 'dll:'+FuncName+tbtchar(cc)+tbtchar(bytebool(DelayLoad)) +tbtchar(bytebool(LoadWithAlteredSearchPath))+ declToBits(Decl); 140 | Result := TPSRegProc.Create; 141 | Result.ImportDecl := FuncName; 142 | Result.Decl.Assign(Decl); 143 | Result.Name := Name; 144 | Result.OrgName := OriginalName; 145 | Result.ExportName := False; 146 | end; 147 | 148 | procedure RegisterDll_Compiletime(cs: TPSPascalCompiler); 149 | begin 150 | cs.OnExternalProc := DllExternalProc; 151 | cs.AddFunction('procedure UnloadDll(S: string)'); 152 | cs.AddFunction('function DllGetLastError: LongInt'); 153 | end; 154 | 155 | begin 156 | DefaultCc := clRegister; 157 | end. 158 | 159 | -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/uPSC_std.pas: -------------------------------------------------------------------------------- 1 | { Compiletime TObject, TPersistent and TComponent definitions } 2 | unit uPSC_std; 3 | {$I PascalScript.inc} 4 | interface 5 | uses 6 | uPSCompiler, uPSUtils; 7 | 8 | { 9 | Will register files from: 10 | System 11 | Classes (Only TComponent and TPersistent) 12 | 13 | } 14 | 15 | procedure SIRegister_Std_TypesAndConsts(Cl: TPSPascalCompiler); 16 | procedure SIRegisterTObject(CL: TPSPascalCompiler); 17 | procedure SIRegisterTPersistent(Cl: TPSPascalCompiler); 18 | procedure SIRegisterTComponent(Cl: TPSPascalCompiler); 19 | 20 | procedure SIRegister_Std(Cl: TPSPascalCompiler); 21 | 22 | implementation 23 | 24 | procedure SIRegisterTObject(CL: TPSPascalCompiler); 25 | begin 26 | with Cl.AddClassN(nil, 'TObject') do 27 | begin 28 | RegisterMethod('constructor Create'); 29 | RegisterMethod('procedure Free'); 30 | end; 31 | end; 32 | 33 | procedure SIRegisterTPersistent(Cl: TPSPascalCompiler); 34 | begin 35 | with Cl.AddClassN(cl.FindClass('TObject'), 'TPersistent') do 36 | begin 37 | RegisterMethod('procedure Assign(Source: TPersistent)'); 38 | end; 39 | end; 40 | 41 | procedure SIRegisterTComponent(Cl: TPSPascalCompiler); 42 | begin 43 | with Cl.AddClassN(cl.FindClass('TPersistent'), 'TComponent') do 44 | begin 45 | RegisterMethod('function FindComponent(AName: string): TComponent;'); 46 | RegisterMethod('constructor Create(AOwner: TComponent); virtual;'); 47 | 48 | RegisterProperty('Owner', 'TComponent', iptRW); 49 | RegisterMethod('procedure DestroyComponents'); 50 | RegisterMethod('procedure Destroying'); 51 | RegisterMethod('procedure FreeNotification(AComponent: TComponent)'); 52 | RegisterMethod('procedure InsertComponent(AComponent: TComponent)'); 53 | RegisterMethod('procedure RemoveComponent(AComponent: TComponent)'); 54 | RegisterProperty('Components', 'TComponent Integer', iptr); 55 | RegisterProperty('ComponentCount', 'Integer', iptr); 56 | RegisterProperty('ComponentIndex', 'Integer', iptrw); 57 | RegisterProperty('ComponentState', 'Byte', iptr); 58 | RegisterProperty('DesignInfo', 'LongInt', iptrw); 59 | RegisterProperty('Name', 'string', iptrw); 60 | RegisterProperty('Tag', 'LongInt', iptrw); 61 | end; 62 | end; 63 | 64 | 65 | 66 | 67 | procedure SIRegister_Std_TypesAndConsts(Cl: TPSPascalCompiler); 68 | begin 69 | Cl.AddTypeS('TComponentStateE', '(csLoading, csReading, csWriting, csDestroying, csDesigning, csAncestor, csUpdating, csFixups, csFreeNotification, csInline, csDesignInstance)'); 70 | cl.AddTypeS('TComponentState', 'set of TComponentStateE'); 71 | Cl.AddTypeS('TRect', 'record Left, Top, Right, Bottom: Integer; end;'); 72 | end; 73 | 74 | procedure SIRegister_Std(Cl: TPSPascalCompiler); 75 | begin 76 | SIRegister_Std_TypesAndConsts(Cl); 77 | SIRegisterTObject(CL); 78 | SIRegisterTPersistent(Cl); 79 | SIRegisterTComponent(Cl); 80 | end; 81 | 82 | // PS_MINIVCL changes by Martijn Laan (mlaan at wintax _dot_ nl) 83 | 84 | 85 | End. 86 | 87 |  88 | -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/uPSComponent.dcr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/pascal_rem/uPSComponent.dcr -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/uPSComponent_COM.pas: -------------------------------------------------------------------------------- 1 | 2 | unit uPSComponent_COM; 3 | 4 | interface 5 | uses 6 | SysUtils, Classes, uPSComponent, uPSCompiler, uPSRuntime; 7 | type 8 | 9 | TPSImport_ComObj = class(TPSPlugin) 10 | private 11 | public 12 | procedure CompileImport1(CompExec: TPSScript); override; 13 | procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override; 14 | end; 15 | 16 | TIFPS3CE_ComObj = class(TPSImport_ComObj); 17 | 18 | implementation 19 | uses 20 | uPSC_comobj, 21 | uPSR_comobj; 22 | 23 | 24 | { TPSImport_ComObj } 25 | 26 | procedure TPSImport_ComObj.CompileImport1(CompExec: TPSScript); 27 | begin 28 | SIRegister_ComObj(CompExec.Comp); 29 | end; 30 | 31 | 32 | procedure TPSImport_ComObj.ExecImport1(CompExec: TPSScript; 33 | const ri: TPSRuntimeClassImporter); 34 | begin 35 | RIRegister_ComObj(CompExec.Exec); 36 | end; 37 | 38 | end. 39 | -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/uPSComponent_Controls.pas: -------------------------------------------------------------------------------- 1 | unit uPSComponent_Controls; 2 | 3 | interface 4 | uses 5 | SysUtils, Classes, uPSComponent, uPSCompiler, uPSRuntime; 6 | type 7 | 8 | TPSImport_Controls = class(TPSPlugin) 9 | private 10 | FEnableStreams: Boolean; 11 | FEnableGraphics: Boolean; 12 | FEnableControls: Boolean; 13 | public 14 | procedure CompileImport1(CompExec: TPSScript); override; 15 | procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override; 16 | public 17 | constructor Create(AOwner: TComponent); override; 18 | published 19 | 20 | property EnableStreams: Boolean read FEnableStreams write FEnableStreams; 21 | 22 | property EnableGraphics: Boolean read FEnableGraphics write FEnableGraphics; 23 | 24 | property EnableControls: Boolean read FEnableControls write FEnableControls; 25 | end; 26 | 27 | TIFPS3CE_Controls = class(TPSImport_Controls); 28 | 29 | implementation 30 | uses 31 | uPSC_graphics, 32 | uPSC_controls, 33 | uPSR_graphics, 34 | uPSR_controls; 35 | 36 | 37 | { TPSImport_Controls } 38 | 39 | procedure TPSImport_Controls.CompileImport1(CompExec: TPSScript); 40 | begin 41 | if FEnableGraphics then 42 | SIRegister_Graphics(CompExec.Comp, FEnableStreams); 43 | if FEnableControls then 44 | SIRegister_Controls(CompExec.Comp); 45 | end; 46 | 47 | constructor TPSImport_Controls.Create(AOwner: TComponent); 48 | begin 49 | inherited Create(AOwner); 50 | FEnableStreams := True; 51 | FEnableGraphics := True; 52 | FEnableControls := True; 53 | end; 54 | 55 | procedure TPSImport_Controls.ExecImport1(CompExec: TPSScript; 56 | const ri: TPSRuntimeClassImporter); 57 | begin 58 | if FEnableGraphics then 59 | RIRegister_Graphics(ri, FEnableStreams); 60 | if FEnableControls then 61 | RIRegister_Controls(ri); 62 | end; 63 | 64 | 65 | end. 66 | -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/uPSComponent_DB.pas: -------------------------------------------------------------------------------- 1 | unit uPSComponent_DB; 2 | 3 | interface 4 | {$I PascalScript.inc} 5 | uses 6 | SysUtils, Classes, uPSComponent, uPSRuntime, uPSCompiler; 7 | type 8 | 9 | TPSImport_DB = class(TPSPlugin) 10 | public 11 | procedure CompileImport1(CompExec: TPSScript); override; 12 | procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override; 13 | public 14 | end; 15 | 16 | TIFPS3CE_DB = class(TPSImport_DB); 17 | 18 | implementation 19 | uses 20 | uPSC_DB, 21 | uPSR_DB; 22 | 23 | { TPSImport_DB } 24 | 25 | procedure TPSImport_DB.CompileImport1(CompExec: TPSScript); 26 | begin 27 | SIRegister_DB(CompExec.Comp); 28 | end; 29 | 30 | procedure TPSImport_DB.ExecImport1(CompExec: TPSScript; 31 | const ri: TPSRuntimeClassImporter); 32 | begin 33 | RIRegister_DB(RI); 34 | end; 35 | 36 | end. 37 | -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/uPSComponent_Default.pas: -------------------------------------------------------------------------------- 1 | unit uPSComponent_Default; 2 | {$I PascalScript.inc} 3 | interface 4 | uses 5 | SysUtils, Classes, uPSComponent, uPSCompiler, uPSRuntime; 6 | 7 | type 8 | 9 | TPSImport_DateUtils = class(TPSPlugin) 10 | public 11 | procedure CompOnUses(CompExec: TPSScript); override; 12 | procedure ExecOnUses(CompExec: TPSScript); override; 13 | end; 14 | 15 | TPSImport_Classes = class(TPSPlugin) 16 | private 17 | FEnableStreams: Boolean; 18 | FEnableClasses: Boolean; 19 | public 20 | procedure CompileImport1(CompExec: TPSScript); override; 21 | procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override; 22 | public 23 | 24 | constructor Create(AOwner: TComponent); override; 25 | published 26 | 27 | property EnableStreams: Boolean read FEnableStreams write FEnableStreams; 28 | 29 | property EnableClasses: Boolean read FEnableClasses write FEnableClasses; 30 | end; 31 | 32 | TIFPS3CE_Std = class(TPSImport_Classes); 33 | 34 | TIFPS3CE_DateUtils = class(TPSImport_DateUtils); 35 | 36 | implementation 37 | uses 38 | uPSC_std, 39 | uPSR_std, 40 | uPSC_classes, 41 | uPSR_classes, 42 | uPSC_dateutils, 43 | uPSR_dateutils; 44 | 45 | { TPSImport_Classes } 46 | 47 | procedure TPSImport_Classes.CompileImport1(CompExec: TPSScript); 48 | begin 49 | SIRegister_Std(CompExec.Comp); 50 | if FEnableClasses then 51 | SIRegister_Classes(CompExec.Comp, FEnableStreams); 52 | end; 53 | 54 | procedure TPSImport_Classes.ExecImport1(CompExec: TPSScript; 55 | const ri: TPSRuntimeClassImporter); 56 | begin 57 | RIRegister_Std(Ri); 58 | if FEnableClasses then 59 | RIRegister_Classes(ri, FEnableStreams); 60 | end; 61 | 62 | constructor TPSImport_Classes.Create(AOwner: TComponent); 63 | begin 64 | inherited Create(AOwner); 65 | FEnableStreams := True; 66 | FEnableClasses := True; 67 | end; 68 | 69 | { TPSImport_DateUtils } 70 | 71 | procedure TPSImport_DateUtils.CompOnUses(CompExec: TPSScript); 72 | begin 73 | RegisterDateTimeLibrary_C(CompExec.Comp); 74 | end; 75 | 76 | procedure TPSImport_DateUtils.ExecOnUses(CompExec: TPSScript); 77 | begin 78 | RegisterDateTimeLibrary_R(CompExec.Exec); 79 | end; 80 | 81 | end. 82 | -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/uPSComponent_Forms.pas: -------------------------------------------------------------------------------- 1 | 2 | unit uPSComponent_Forms; 3 | 4 | interface 5 | uses 6 | SysUtils, Classes, uPSRuntime, uPSCompiler, uPSComponent; 7 | type 8 | 9 | TPSImport_Forms = class(TPSPlugin) 10 | private 11 | FEnableForms: Boolean; 12 | FEnableMenus: Boolean; 13 | public 14 | procedure CompileImport1(CompExec: TPSScript); override; 15 | procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override; 16 | public 17 | constructor Create(AOwner: TComponent); override; 18 | published 19 | 20 | property EnableForms: Boolean read FEnableForms write FEnableForms; 21 | 22 | property EnableMenus: Boolean read FEnableMenus write FEnableMenus; 23 | end; 24 | 25 | TIFPS3CE_Forms = class(TPSImport_Forms); 26 | 27 | implementation 28 | uses 29 | uPSC_forms, 30 | uPSC_menus, 31 | uPSR_forms, 32 | uPSR_menus; 33 | 34 | { TPSImport_Forms } 35 | 36 | procedure TPSImport_Forms.CompileImport1(CompExec: TPSScript); 37 | begin 38 | if FEnableForms then 39 | SIRegister_Forms(CompExec.comp); 40 | if FEnableMenus then 41 | SIRegister_Menus(CompExec.comp); 42 | end; 43 | 44 | constructor TPSImport_Forms.Create(AOwner: TComponent); 45 | begin 46 | inherited Create(Aowner); 47 | FEnableForms := True; 48 | FEnableMenus := True; 49 | end; 50 | 51 | procedure TPSImport_Forms.ExecImport1(CompExec: TPSScript; 52 | const ri: TPSRuntimeClassImporter); 53 | begin 54 | if FEnableForms then 55 | RIRegister_Forms(ri); 56 | 57 | if FEnableMenus then 58 | begin 59 | RIRegister_Menus(ri); 60 | RIRegister_Menus_Routines(compexec.Exec); 61 | end; 62 | 63 | end; 64 | 65 | end. 66 | -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/uPSComponent_StdCtrls.pas: -------------------------------------------------------------------------------- 1 | 2 | unit uPSComponent_StdCtrls; 3 | 4 | interface 5 | uses 6 | SysUtils, Classes, uPSComponent, uPSCompiler, uPSRuntime; 7 | type 8 | 9 | TPSImport_StdCtrls = class(TPSPlugin) 10 | private 11 | FEnableButtons: Boolean; 12 | FEnableExtCtrls: Boolean; 13 | public 14 | procedure CompileImport1(CompExec: TPSScript); override; 15 | procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override; 16 | public 17 | constructor Create(AOwner: TComponent); override; 18 | published 19 | 20 | property EnableExtCtrls: Boolean read FEnableExtCtrls write FEnableExtCtrls; 21 | 22 | property EnableButtons: Boolean read FEnableButtons write FEnableButtons; 23 | end; 24 | 25 | TIFPS3CE_StdCtrls = class(TPSImport_StdCtrls); 26 | 27 | 28 | implementation 29 | uses 30 | uPSC_buttons, 31 | uPSC_stdctrls, 32 | uPSC_extctrls, 33 | uPSR_buttons, 34 | uPSR_stdctrls, 35 | uPSR_extctrls; 36 | 37 | { TPSImport_StdCtrls } 38 | 39 | procedure TPSImport_StdCtrls.CompileImport1(CompExec: TPSScript); 40 | begin 41 | SIRegister_stdctrls(CompExec.Comp); 42 | if FEnableExtCtrls then 43 | SIRegister_ExtCtrls(CompExec.Comp); 44 | if FEnableButtons then 45 | SIRegister_Buttons(CompExec.Comp); 46 | end; 47 | 48 | constructor TPSImport_StdCtrls.Create(AOwner: TComponent); 49 | begin 50 | inherited Create(Aowner); 51 | FEnableButtons := True; 52 | FEnableExtCtrls := True; 53 | end; 54 | 55 | procedure TPSImport_StdCtrls.ExecImport1(CompExec: TPSScript; 56 | const ri: TPSRuntimeClassImporter); 57 | begin 58 | RIRegister_stdctrls(RI); 59 | if FEnableExtCtrls then 60 | RIRegister_ExtCtrls(RI); 61 | if FEnableButtons then 62 | RIRegister_Buttons(RI); 63 | end; 64 | 65 | end. 66 | -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/uPSR_buttons.pas: -------------------------------------------------------------------------------- 1 | 2 | unit uPSR_buttons; 3 | {$I PascalScript.inc} 4 | interface 5 | uses 6 | uPSRuntime, uPSUtils; 7 | 8 | 9 | procedure RIRegisterTSPEEDBUTTON(Cl: TPSRuntimeClassImporter); 10 | procedure RIRegisterTBITBTN(Cl: TPSRuntimeClassImporter); 11 | 12 | procedure RIRegister_Buttons(Cl: TPSRuntimeClassImporter); 13 | 14 | implementation 15 | uses 16 | Classes{$IFDEF CLX}, QControls, QButtons{$ELSE}, Controls, Buttons{$ENDIF}; 17 | 18 | procedure RIRegisterTSPEEDBUTTON(Cl: TPSRuntimeClassImporter); 19 | begin 20 | Cl.Add(TSPEEDBUTTON); 21 | end; 22 | 23 | 24 | procedure RIRegisterTBITBTN(Cl: TPSRuntimeClassImporter); 25 | begin 26 | Cl.Add(TBITBTN); 27 | end; 28 | 29 | procedure RIRegister_Buttons(Cl: TPSRuntimeClassImporter); 30 | begin 31 | RIRegisterTSPEEDBUTTON(cl); 32 | RIRegisterTBITBTN(cl); 33 | end; 34 | 35 | // PS_MINIVCL changes by Martijn Laan (mlaan at wintax _dot_ nl) 36 | 37 | 38 | end. 39 | -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/uPSR_comobj.pas: -------------------------------------------------------------------------------- 1 | 2 | 3 | unit uPSR_comobj; 4 | 5 | {$I PascalScript.inc} 6 | interface 7 | uses 8 | uPSRuntime, uPSUtils; 9 | 10 | 11 | procedure RIRegister_ComObj(cl: TPSExec); 12 | 13 | implementation 14 | {$IFDEF FPC} 15 | {$IFDEF PS_FPC_HAS_COM} 16 | uses SysUtils, ComObj; 17 | {$ENDIF} 18 | {$ELSE} 19 | {$IFDEF DELPHI3UP} 20 | uses ComObj; 21 | {$ELSE} 22 | uses SysUtils, Ole2; 23 | {$ENDIF} 24 | {$ENDIF} 25 | {$IFNDEF DELPHI3UP} 26 | 27 | {$IFDEF DELPHI3UP } 28 | resourceString 29 | {$ELSE } 30 | const 31 | {$ENDIF } 32 | 33 | RPS_OLEError = 'OLE error %.8x'; 34 | function OleErrorMessage(ErrorCode: HResult): String; 35 | begin 36 | Result := SysErrorMessage(ErrorCode); 37 | if Result = '' then 38 | Result := Format(RPS_OLEError, [ErrorCode]); 39 | end; 40 | 41 | procedure OleError(ErrorCode: HResult); 42 | begin 43 | raise Exception.Create(OleErrorMessage(ErrorCode)); 44 | end; 45 | 46 | procedure OleCheck(Result: HResult); 47 | begin 48 | if Result < 0 then OleError(Result); 49 | end; 50 | 51 | procedure CreateOleObject(const ClassName: string; var Disp: IDispatch); 52 | var 53 | OldDisp: IDispatch; 54 | ClassID: TCLSID; 55 | WideCharBuf: array[0..127] of WideChar; 56 | begin 57 | StringToWideChar(ClassName, WideCharBuf, SizeOf(WideCharBuf) div SizeOf(WideCharBuf[0])); 58 | OleCheck(CLSIDFromProgID(WideCharBuf, ClassID)); 59 | if Disp <> nil then 60 | begin 61 | OldDisp := Disp; 62 | Disp := nil; 63 | OldDisp.Release; 64 | end; 65 | OleCheck(CoCreateInstance(ClassID, nil, CLSCTX_INPROC_SERVER or 66 | CLSCTX_LOCAL_SERVER, IID_IDispatch, Disp)); 67 | end; 68 | 69 | procedure GetActiveOleObject(const ClassName: string; var Disp: IDispatch); 70 | var 71 | Unknown: IUnknown; 72 | OldDisp: IDispatch; 73 | ClassID: TCLSID; 74 | WideCharBuf: array[0..127] of WideChar; 75 | begin 76 | StringToWideChar(ClassName, WideCharBuf, SizeOf(WideCharBuf) div SizeOf(WideCharBuf[0])); 77 | OleCheck(CLSIDFromProgID(WideCharBuf, ClassID)); 78 | OleCheck(GetActiveObject(ClassID, nil, Unknown)); 79 | try 80 | if Disp <> nil then 81 | begin 82 | OldDisp := Disp; 83 | Disp := nil; 84 | OldDisp.Release; 85 | end; 86 | OleCheck(Unknown.QueryInterface(IID_IDispatch, Disp)); 87 | finally 88 | Unknown.Release; 89 | end; 90 | end; 91 | 92 | {$ENDIF} 93 | 94 | 95 | procedure RIRegister_ComObj(cl: TPSExec); 96 | begin 97 | {$IFDEF FPC} 98 | {$IFDEF PS_FPC_HAS_COM} 99 | cl.RegisterDelphiFunction(@OleCheck, 'OleCheck', cdRegister); 100 | cl.RegisterDelphiFunction(@StringToGUID, 'StringToGUID', cdRegister); 101 | cl.RegisterDelphiFunction(@CreateComObject, 'CreateComObject', cdRegister); 102 | cl.RegisterDelphiFunction(@CreateOleObject, 'CreateOleObject', cdRegister); 103 | cl.RegisterDelphiFunction(@GetActiveOleObject, 'GetActiveOleObject', cdRegister); 104 | {$ENDIF} 105 | {$ELSE} 106 | cl.RegisterDelphiFunction(@OleCheck, 'OleCheck', cdRegister); 107 | {$IFNDEF PS_NOINTERFACES} 108 | {$IFDEF DELPHI3UP} 109 | cl.RegisterDelphiFunction(@StringToGUID, 'StringToGUID', cdRegister); 110 | cl.RegisterDelphiFunction(@CreateComObject, 'CreateComObject', cdRegister); 111 | {$ENDIF} 112 | {$ENDIF} 113 | cl.RegisterDelphiFunction(@CreateOleObject, 'CreateOleObject', cdRegister); 114 | cl.RegisterDelphiFunction(@GetActiveOleObject, 'GetActiveOleObject', cdRegister); 115 | {$ENDIF} 116 | end; 117 | 118 | end. 119 | -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/uPSR_dateutils.pas: -------------------------------------------------------------------------------- 1 | 2 | unit uPSR_dateutils; 3 | {$I PascalScript.inc} 4 | interface 5 | uses 6 | SysUtils, uPSRuntime; 7 | 8 | 9 | 10 | procedure RegisterDateTimeLibrary_R(S: TPSExec); 11 | 12 | implementation 13 | 14 | function TryEncodeDate(Year, Month, Day: Word; var Date: TDateTime): Boolean; 15 | begin 16 | try 17 | Date := EncodeDate(Year, Month, Day); 18 | Result := true; 19 | except 20 | Result := false; 21 | end; 22 | end; 23 | 24 | function TryEncodeTime(Hour, Min, Sec, MSec: Word; var Time: TDateTime): Boolean; 25 | begin 26 | try 27 | Time := EncodeTime(hour, Min, Sec, MSec); 28 | Result := true; 29 | except 30 | Result := false; 31 | end; 32 | end; 33 | 34 | function DateTimeToUnix(D: TDateTime): Int64; 35 | begin 36 | Result := Round((D - 25569) * 86400); 37 | end; 38 | 39 | function UnixToDateTime(U: Int64): TDateTime; 40 | begin 41 | Result := U / 86400 + 25569; 42 | end; 43 | 44 | procedure RegisterDateTimeLibrary_R(S: TPSExec); 45 | begin 46 | S.RegisterDelphiFunction(@EncodeDate, 'EncodeDate', cdRegister); 47 | S.RegisterDelphiFunction(@EncodeTime, 'EncodeTime', cdRegister); 48 | S.RegisterDelphiFunction(@TryEncodeDate, 'TryEncodeDate', cdRegister); 49 | S.RegisterDelphiFunction(@TryEncodeTime, 'TryEncodeTime', cdRegister); 50 | S.RegisterDelphiFunction(@DecodeDate, 'DecodeDate', cdRegister); 51 | S.RegisterDelphiFunction(@DecodeTime, 'DecodeTime', cdRegister); 52 | S.RegisterDelphiFunction(@DayOfWeek, 'DayOfWeek', cdRegister); 53 | S.RegisterDelphiFunction(@Date, 'Date', cdRegister); 54 | S.RegisterDelphiFunction(@Time, 'Time', cdRegister); 55 | S.RegisterDelphiFunction(@Now, 'Now', cdRegister); 56 | S.RegisterDelphiFunction(@DateTimeToUnix, 'DateTimeToUnix', cdRegister); 57 | S.RegisterDelphiFunction(@UnixToDateTime, 'UnixToDateTime', cdRegister); 58 | S.RegisterDelphiFunction(@DateToStr, 'DateToStr', cdRegister); 59 | S.RegisterDelphiFunction(@FormatDateTime, 'FormatDateTime', cdRegister); 60 | S.RegisterDelphiFunction(@StrToDate, 'StrToDate', cdRegister); 61 | end; 62 | 63 | end. 64 | -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/uPSR_extctrls.pas: -------------------------------------------------------------------------------- 1 | 2 | unit uPSR_extctrls; 3 | 4 | {$I PascalScript.inc} 5 | interface 6 | uses 7 | uPSRuntime, uPSUtils; 8 | 9 | 10 | procedure RIRegister_ExtCtrls(cl: TPSRuntimeClassImporter); 11 | 12 | procedure RIRegisterTSHAPE(Cl: TPSRuntimeClassImporter); 13 | procedure RIRegisterTIMAGE(Cl: TPSRuntimeClassImporter); 14 | procedure RIRegisterTPAINTBOX(Cl: TPSRuntimeClassImporter); 15 | procedure RIRegisterTBEVEL(Cl: TPSRuntimeClassImporter); 16 | procedure RIRegisterTTIMER(Cl: TPSRuntimeClassImporter); 17 | procedure RIRegisterTCUSTOMPANEL(Cl: TPSRuntimeClassImporter); 18 | procedure RIRegisterTPANEL(Cl: TPSRuntimeClassImporter); 19 | {$IFNDEF CLX} 20 | procedure RIRegisterTPAGE(Cl: TPSRuntimeClassImporter); 21 | procedure RIRegisterTNOTEBOOK(Cl: TPSRuntimeClassImporter); 22 | {$IFNDEF FPC}procedure RIRegisterTHEADER(Cl: TPSRuntimeClassImporter);{$ENDIF} 23 | {$ENDIF} 24 | procedure RIRegisterTCUSTOMRADIOGROUP(Cl: TPSRuntimeClassImporter); 25 | procedure RIRegisterTRADIOGROUP(Cl: TPSRuntimeClassImporter); 26 | 27 | implementation 28 | 29 | uses 30 | {$IFDEF CLX} 31 | QExtCtrls, QGraphics; 32 | {$ELSE} 33 | Vcl.ExtCtrls, Vcl.Graphics; 34 | {$ENDIF} 35 | 36 | procedure RIRegisterTSHAPE(Cl: TPSRuntimeClassImporter); 37 | begin 38 | with Cl.Add(TSHAPE) do 39 | begin 40 | {$IFNDEF PS_MINIVCL} 41 | RegisterMethod(@TSHAPE.STYLECHANGED, 'StyleChanged'); 42 | {$ENDIF} 43 | end; 44 | end; 45 | 46 | procedure TIMAGECANVAS_R(Self: TIMAGE; var T: TCANVAS); begin T := Self.CANVAS; end; 47 | 48 | procedure RIRegisterTIMAGE(Cl: TPSRuntimeClassImporter); 49 | begin 50 | with Cl.Add(TIMAGE) do 51 | begin 52 | RegisterPropertyHelper(@TIMAGECANVAS_R, nil, 'Canvas'); 53 | end; 54 | end; 55 | 56 | procedure TPAINTBOXCANVAS_R(Self: TPAINTBOX; var T: TCanvas); begin T := Self.CANVAS; end; 57 | 58 | procedure RIRegisterTPAINTBOX(Cl: TPSRuntimeClassImporter); 59 | begin 60 | with Cl.Add(TPAINTBOX) do 61 | begin 62 | RegisterPropertyHelper(@TPAINTBOXCANVAS_R, nil, 'Canvas'); 63 | end; 64 | end; 65 | 66 | procedure RIRegisterTBEVEL(Cl: TPSRuntimeClassImporter); 67 | begin 68 | Cl.Add(TBEVEL); 69 | end; 70 | 71 | procedure RIRegisterTTIMER(Cl: TPSRuntimeClassImporter); 72 | begin 73 | Cl.Add(TTIMER); 74 | end; 75 | 76 | procedure RIRegisterTCUSTOMPANEL(Cl: TPSRuntimeClassImporter); 77 | begin 78 | Cl.Add(TCUSTOMPANEL); 79 | end; 80 | 81 | procedure RIRegisterTPANEL(Cl: TPSRuntimeClassImporter); 82 | begin 83 | Cl.Add(TPANEL); 84 | end; 85 | {$IFNDEF CLX} 86 | procedure RIRegisterTPAGE(Cl: TPSRuntimeClassImporter); 87 | begin 88 | Cl.Add(TPAGE); 89 | end; 90 | 91 | procedure RIRegisterTNOTEBOOK(Cl: TPSRuntimeClassImporter); 92 | begin 93 | Cl.Add(TNOTEBOOK); 94 | end; 95 | 96 | {$IFNDEF FPC} 97 | procedure THEADERSECTIONWIDTH_R(Self: THEADER; var T: INTEGER; t1: INTEGER); begin T := Self.SECTIONWIDTH[t1]; end; 98 | procedure THEADERSECTIONWIDTH_W(Self: THEADER; T: INTEGER; t1: INTEGER); begin Self.SECTIONWIDTH[t1] := T; end; 99 | 100 | procedure RIRegisterTHEADER(Cl: TPSRuntimeClassImporter); 101 | begin 102 | with Cl.Add(THEADER) do 103 | begin 104 | RegisterPropertyHelper(@THEADERSECTIONWIDTH_R, @THEADERSECTIONWIDTH_W, 'SectionWidth'); 105 | end; 106 | end; 107 | {$ENDIF} 108 | {$ENDIF} 109 | 110 | procedure RIRegisterTCUSTOMRADIOGROUP(Cl: TPSRuntimeClassImporter); 111 | begin 112 | Cl.Add(TCUSTOMRADIOGROUP); 113 | end; 114 | 115 | procedure RIRegisterTRADIOGROUP(Cl: TPSRuntimeClassImporter); 116 | begin 117 | Cl.Add(TRADIOGROUP); 118 | end; 119 | 120 | procedure RIRegister_ExtCtrls(cl: TPSRuntimeClassImporter); 121 | begin 122 | {$IFNDEF PS_MINIVCL} 123 | RIRegisterTSHAPE(Cl); 124 | RIRegisterTIMAGE(Cl); 125 | RIRegisterTPAINTBOX(Cl); 126 | {$ENDIF} 127 | RIRegisterTBEVEL(Cl); 128 | {$IFNDEF PS_MINIVCL} 129 | RIRegisterTTIMER(Cl); 130 | {$ENDIF} 131 | RIRegisterTCUSTOMPANEL(Cl); 132 | {$IFNDEF CLX} 133 | RIRegisterTPANEL(Cl); 134 | {$ENDIF} 135 | {$IFNDEF PS_MINIVCL} 136 | {$IFNDEF CLX} 137 | RIRegisterTPAGE(Cl); 138 | RIRegisterTNOTEBOOK(Cl); 139 | {$IFNDEF FPC} 140 | RIRegisterTHEADER(Cl); 141 | {$ENDIF}{FPC} 142 | {$ENDIF} 143 | RIRegisterTCUSTOMRADIOGROUP(Cl); 144 | RIRegisterTRADIOGROUP(Cl); 145 | {$ENDIF} 146 | end; 147 | 148 | end. 149 | 150 | 151 | -------------------------------------------------------------------------------- /src/thirdparty/pascal_rem/uPSR_std.pas: -------------------------------------------------------------------------------- 1 | 2 | unit uPSR_std; 3 | {$I PascalScript.inc} 4 | interface 5 | uses 6 | uPSRuntime, uPSUtils; 7 | 8 | 9 | procedure RIRegisterTObject(CL: TPSRuntimeClassImporter); 10 | procedure RIRegisterTPersistent(Cl: TPSRuntimeClassImporter); 11 | procedure RIRegisterTComponent(Cl: TPSRuntimeClassImporter); 12 | procedure RIRegister_Std(Cl: TPSRuntimeClassImporter); 13 | 14 | implementation 15 | uses 16 | Classes; 17 | 18 | 19 | 20 | procedure RIRegisterTObject(CL: TPSRuntimeClassImporter); 21 | begin 22 | with cl.Add(TObject) do 23 | begin 24 | RegisterConstructor(@TObject.Create, 'Create'); 25 | RegisterMethod(@TObject.Free, 'Free'); 26 | end; 27 | end; 28 | 29 | procedure RIRegisterTPersistent(Cl: TPSRuntimeClassImporter); 30 | begin 31 | with Cl.Add(TPersistent) do 32 | begin 33 | RegisterVirtualMethod(@TPersistent.Assign, 'Assign'); 34 | end; 35 | end; 36 | 37 | procedure TComponentOwnerR(Self: TComponent; var T: TComponent); begin T := Self.Owner; end; 38 | 39 | 40 | procedure TCOMPONENTCOMPONENTS_R(Self: TCOMPONENT; var T: TCOMPONENT; t1: INTEGER); begin T := Self.COMPONENTS[t1]; end; 41 | procedure TCOMPONENTCOMPONENTCOUNT_R(Self: TCOMPONENT; var T: INTEGER); begin t := Self.COMPONENTCOUNT; end; 42 | procedure TCOMPONENTCOMPONENTINDEX_R(Self: TCOMPONENT; var T: INTEGER); begin t := Self.COMPONENTINDEX; end; 43 | procedure TCOMPONENTCOMPONENTINDEX_W(Self: TCOMPONENT; T: INTEGER); begin Self.COMPONENTINDEX := t; end; 44 | procedure TCOMPONENTCOMPONENTSTATE_R(Self: TCOMPONENT; var T: TCOMPONENTSTATE); begin t := Self.COMPONENTSTATE; end; 45 | procedure TCOMPONENTDESIGNINFO_R(Self: TCOMPONENT; var T: LONGINT); begin t := Self.DESIGNINFO; end; 46 | procedure TCOMPONENTDESIGNINFO_W(Self: TCOMPONENT; T: LONGINT); begin Self.DESIGNINFO := t; end; 47 | 48 | 49 | procedure RIRegisterTComponent(Cl: TPSRuntimeClassImporter); 50 | begin 51 | with Cl.Add(TComponent) do 52 | begin 53 | RegisterMethod(@TComponent.FindComponent, 'FindComponent'); 54 | RegisterVirtualConstructor(@TComponent.Create, 'Create'); 55 | RegisterPropertyHelper(@TComponentOwnerR, nil, 'Owner'); 56 | 57 | RegisterMethod(@TCOMPONENT.DESTROYCOMPONENTS, 'DestroyComponents'); 58 | RegisterPropertyHelper(@TCOMPONENTCOMPONENTS_R, nil, 'Components'); 59 | RegisterPropertyHelper(@TCOMPONENTCOMPONENTCOUNT_R, nil, 'ComponentCount'); 60 | RegisterPropertyHelper(@TCOMPONENTCOMPONENTINDEX_R, @TCOMPONENTCOMPONENTINDEX_W, 'ComponentIndex'); 61 | RegisterPropertyHelper(@TCOMPONENTCOMPONENTSTATE_R, nil, 'ComponentState'); 62 | RegisterPropertyHelper(@TCOMPONENTDESIGNINFO_R, @TCOMPONENTDESIGNINFO_W, 'DesignInfo'); 63 | end; 64 | end; 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | procedure RIRegister_Std(Cl: TPSRuntimeClassImporter); 73 | begin 74 | RIRegisterTObject(CL); 75 | RIRegisterTPersistent(Cl); 76 | RIRegisterTComponent(Cl); 77 | end; 78 | // PS_MINIVCL changes by Martijn Laan (mlaan at wintax _dot_ nl) 79 | 80 | end. 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /src/thirdparty/php/PHP4DelphiD2006.dpk: -------------------------------------------------------------------------------- 1 | package php4DelphiD2006; 2 | 3 | {$R *.res} 4 | {$R 'php4delphi.dcr'} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO ON} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION ON} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES OFF} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DESCRIPTION 'php4Delphi (design-time)'} 27 | {$DESIGNONLY} 28 | {$IMPLICITBUILD OFF} 29 | 30 | requires 31 | rtl, 32 | vcl, 33 | designide, 34 | vclactnband, 35 | vclx, 36 | php4DelphiR2006; 37 | 38 | contains 39 | PHPProjectWizard in 'PHPProjectWizard.pas', 40 | php4DelphiReg in 'php4DelphiReg.pas', 41 | php4DelphiWeb in 'php4DelphiWeb.pas', 42 | phpWeb in 'phpWeb.pas', 43 | phpAbout in 'phpAbout.pas' {dlgAbout}; 44 | 45 | end. 46 | -------------------------------------------------------------------------------- /src/thirdparty/php/PHP4DelphiD2006.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/PHP4DelphiD2006.res -------------------------------------------------------------------------------- /src/thirdparty/php/PHPCustomLibrary.pas: -------------------------------------------------------------------------------- 1 | {*******************************************************} 2 | { PHP4Delphi } 3 | { PHP - Delphi interface } 4 | { } 5 | { Author: } 6 | { Serhiy Perevoznyk } 7 | { serge_perevoznyk@hotmail.com } 8 | { http://users.chello.be/ws36637 } 9 | {*******************************************************} 10 | {$I PHP.INC} 11 | 12 | { $Id: phpCustomLibrary.pas,v 7.2 10/2009 delphi32 Exp $ } 13 | 14 | unit PHPCustomLibrary; 15 | 16 | interface 17 | 18 | uses 19 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 20 | PHPCommon, 21 | ZendTypes, PHPTypes, PHPAPI, ZENDAPI, 22 | phpFunctions; 23 | 24 | type 25 | 26 | IPHPEngine = interface (IUnknown) 27 | ['{484AE2CA-755A-437C-9B60-E3735973D0A9}'] 28 | procedure HandleRequest(ht : integer; return_value : pzval; return_value_ptr : ppzval; this_ptr : pzval; 29 | return_value_used : integer; TSRMLS_DC : pointer); 30 | function GetEngineActive : boolean; 31 | end; 32 | 33 | 34 | TCustomPHPLibrary = class(TPHPComponent) 35 | private 36 | FLibraryName : AnsiString; 37 | FFunctions : TPHPFunctions; 38 | FLocked: boolean; 39 | procedure SetFunctions(const Value : TPHPFunctions); 40 | procedure SetLibraryName(AValue : AnsiString); 41 | protected 42 | procedure RegisterLibrary; virtual; 43 | procedure UnregisterLibrary; virtual; 44 | public 45 | constructor Create(AOwner : TComponent); override; 46 | destructor Destroy; override; 47 | procedure Refresh; virtual; 48 | property LibraryName : AnsiString read FLibraryName write SetLibraryName; 49 | property Functions : TPHPFunctions read FFunctions write SetFunctions; 50 | property Locked : boolean read FLocked write FLocked; 51 | end; 52 | 53 | TPHPLibrarian = class 54 | private 55 | FLibraries : TList; 56 | public 57 | constructor Create; virtual; 58 | destructor Destroy; override; 59 | procedure AddLibrary(ALibrary : TCustomPHPLibrary); 60 | procedure RemoveLibrary(ALibrary : TCustomPHPLibrary); 61 | function Count : integer; 62 | function GetLibrary(Index : integer) : TCustomPHPLibrary; 63 | property Libraries : TList read FLibraries write FLibraries; 64 | end; 65 | 66 | var 67 | Librarian : TPHPLibrarian = nil; 68 | 69 | implementation 70 | 71 | { TCustomPHPLibrary } 72 | 73 | constructor TCustomPHPLibrary.Create(AOwner: TComponent); 74 | begin 75 | inherited; 76 | FFunctions := TPHPFunctions.Create(Self, TPHPFunction); 77 | RegisterLibrary; 78 | end; 79 | 80 | destructor TCustomPHPLibrary.Destroy; 81 | begin 82 | UnregisterLibrary; 83 | FFunctions.Free; 84 | FFunctions := nil; 85 | inherited; 86 | end; 87 | 88 | procedure TCustomPHPLibrary.Refresh; 89 | begin 90 | end; 91 | 92 | 93 | procedure TCustomPHPLibrary.RegisterLibrary; 94 | begin 95 | if Assigned(Librarian) then 96 | Librarian.AddLibrary(Self); 97 | end; 98 | 99 | 100 | 101 | procedure TCustomPHPLibrary.SetFunctions(const Value: TPHPFunctions); 102 | begin 103 | FFunctions.Assign(Value); 104 | end; 105 | 106 | procedure TCustomPHPLibrary.SetLibraryName(AValue: AnsiString); 107 | begin 108 | if FLibraryName <> AValue then 109 | begin 110 | FLibraryName := AValue; 111 | end; 112 | end; 113 | 114 | procedure TCustomPHPLibrary.UnregisterLibrary; 115 | begin 116 | if Assigned(Librarian) then 117 | Librarian.RemoveLibrary(Self); 118 | end; 119 | 120 | 121 | procedure InitLibrarian; 122 | begin 123 | Librarian := TPHPLibrarian.Create; 124 | end; 125 | 126 | procedure UninitLibrarian; 127 | begin 128 | if Assigned(Librarian) then 129 | try 130 | Librarian.Free; 131 | finally 132 | Librarian := nil; 133 | end; 134 | end; 135 | 136 | { TPHPLibrarian } 137 | 138 | procedure TPHPLibrarian.AddLibrary(ALibrary: TCustomPHPLibrary); 139 | begin 140 | if FLibraries.IndexOf(ALibrary) = -1 then 141 | FLibraries.Add(ALibrary); 142 | end; 143 | 144 | function TPHPLibrarian.Count: integer; 145 | begin 146 | Result := FLibraries.Count; 147 | end; 148 | 149 | constructor TPHPLibrarian.Create; 150 | begin 151 | inherited; 152 | FLibraries := TList.Create; 153 | end; 154 | 155 | destructor TPHPLibrarian.Destroy; 156 | begin 157 | FLibraries.Free; 158 | inherited; 159 | end; 160 | 161 | function TPHPLibrarian.GetLibrary(Index: integer): TCustomPHPLibrary; 162 | begin 163 | Result := TCustomPHPLibrary(FLibraries[Index]); 164 | end; 165 | 166 | procedure TPHPLibrarian.RemoveLibrary(ALibrary: TCustomPHPLibrary); 167 | begin 168 | FLibraries.Remove(ALibrary); 169 | end; 170 | 171 | initialization 172 | InitLibrarian; 173 | 174 | finalization 175 | UnInitLibrarian; 176 | 177 | end. 178 | -------------------------------------------------------------------------------- /src/thirdparty/php/PHPProjectWizard.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/PHPProjectWizard.res -------------------------------------------------------------------------------- /src/thirdparty/php/license.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------- 2 | The PHP License, version 3.0 3 | Copyright (c) 1999 - 2002 The PHP Group. All rights reserved. 4 | -------------------------------------------------------------------- 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, is permitted provided that the following conditions 8 | are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in 15 | the documentation and/or other materials provided with the 16 | distribution. 17 | 18 | 3. The name "PHP" must not be used to endorse or promote products 19 | derived from this software without prior written permission. For 20 | written permission, please contact group@php.net. 21 | 22 | 4. Products derived from this software may not be called "PHP", nor 23 | may "PHP" appear in their name, without prior written permission 24 | from group@php.net. You may indicate that your software works in 25 | conjunction with PHP by saying "Foo for PHP" instead of calling 26 | it "PHP Foo" or "phpfoo" 27 | 28 | 5. The PHP Group may publish revised and/or new versions of the 29 | license from time to time. Each version will be given a 30 | distinguishing version number. 31 | Once covered code has been published under a particular version 32 | of the license, you may always continue to use it under the terms 33 | of that version. You may also choose to use such covered code 34 | under the terms of any subsequent version of the license 35 | published by the PHP Group. No one other than the PHP Group has 36 | the right to modify the terms applicable to covered code created 37 | under this License. 38 | 39 | 6. Redistributions of any form whatsoever must retain the following 40 | acknowledgment: 41 | "This product includes PHP, freely available from 42 | ". 43 | 44 | THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND 45 | ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 46 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 47 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP 48 | DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 49 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 50 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 51 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 52 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 53 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 54 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 55 | OF THE POSSIBILITY OF SUCH DAMAGE. 56 | 57 | -------------------------------------------------------------------- 58 | 59 | This software consists of voluntary contributions made by many 60 | individuals on behalf of the PHP Group. 61 | 62 | The PHP Group can be contacted via Email at group@php.net. 63 | 64 | For more information on the PHP Group and the PHP project, 65 | please see . 66 | 67 | This product includes the Zend Engine, freely available at 68 | . 69 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4App.dpr: -------------------------------------------------------------------------------- 1 | {*******************************************************} 2 | { PHP4Applications } 3 | { } 4 | { Author: } 5 | { Serhiy Perevoznyk } 6 | { serge_perevoznyk@hotmail.com } 7 | { http://users.telenet.be/ws36637 } 8 | { http://delphi32.blogspot.com } 9 | {*******************************************************} 10 | 11 | { $Id: php4App.dpr,v 7.2 10/2009 delphi32 Exp $ } 12 | 13 | {$I PHP.INC} 14 | 15 | library php4App; 16 | uses 17 | Windows, 18 | SysUtils, 19 | ZendTypes, 20 | PHPTypes, 21 | ZendAPI, 22 | PHPAPI, 23 | php4AppUnit; 24 | 25 | {$R *.RES} 26 | 27 | 28 | 29 | exports 30 | InitRequest, 31 | DoneRequest, 32 | ExecutePHP, 33 | ExecuteCode, 34 | RegisterVariable, 35 | GetResultText, 36 | GetVariable, 37 | SaveToFile, 38 | GetVariableSize, 39 | GetResultBufferSize; 40 | 41 | begin 42 | InitEngine; 43 | end. 44 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4App.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4App.res -------------------------------------------------------------------------------- /src/thirdparty/php/php4AppIntf.pas: -------------------------------------------------------------------------------- 1 | {*******************************************************} 2 | { PHP4Applications } 3 | { } 4 | { Delphi interface for PHP4Applications } 5 | { } 6 | { Author: } 7 | { Serhiy Perevoznyk } 8 | { serge_perevoznyk@hotmail.com } 9 | { http://users.telenet.be/ws36637 } 10 | {*******************************************************} 11 | 12 | unit php4AppIntf; 13 | 14 | interface 15 | 16 | function InitRequest : integer; stdcall; 17 | procedure DoneRequest(RequestID : integer); stdcall; 18 | procedure RegisterVariable(RequestID : integer; AName : PAnsiChar; AValue : PAnsiChar); stdcall; 19 | function ExecutePHP(RequestID : integer; FileName : PAnsiChar) : integer; stdcall; 20 | function ExecuteCode(RequestID : integer; ACode : PAnsiChar) : integer; stdcall; 21 | function GetResultText(RequestID : integer; Buffer : PAnsiChar; BufLen : integer) : integer; stdcall; 22 | function GetVariable(RequestID : integer; AName : PAnsiChar; Buffer : PAnsiChar; BufLen : integer) : integer; stdcall; 23 | procedure SaveToFile(RequestID : integer; AFileName : PAnsiChar); stdcall; 24 | function GetVariableSize(RequestID : integer; AName : PAnsiChar) : integer; stdcall; 25 | function GetResultBufferSize(RequestID : integer) : integer; stdcall; 26 | 27 | implementation 28 | 29 | function InitRequest; external 'php4app.dll'; 30 | procedure DoneRequest; external 'php4app.dll'; 31 | procedure RegisterVariable; external 'php4app.dll'; 32 | function ExecutePHP; external 'php4app.dll'; 33 | function ExecuteCode; external 'php4app.dll'; 34 | function GetResultText; external 'php4app.dll'; 35 | function GetVariable; external 'php4app.dll'; 36 | procedure SaveToFile; external 'php4app.dll'; 37 | function GetVariableSize; external 'php4app.dll'; 38 | function GetResultBufferSize; external 'php4app.dll'; 39 | 40 | end. -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiD2005.dpk: -------------------------------------------------------------------------------- 1 | package php4DelphiD2005; 2 | 3 | {$R *.res} 4 | {$R 'php4delphi.dcr'} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO ON} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION ON} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES OFF} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DESCRIPTION 'php4Delphi (design-time)'} 27 | {$DESIGNONLY} 28 | {$IMPLICITBUILD OFF} 29 | 30 | requires 31 | rtl, 32 | vcl, 33 | designide, 34 | vclactnband, 35 | vclx, 36 | php4DelphiR2005; 37 | 38 | contains 39 | PHPProjectWizard in 'PHPProjectWizard.pas', 40 | php4DelphiReg in 'php4DelphiReg.pas', 41 | php4DelphiWeb in 'php4DelphiWeb.pas', 42 | phpWeb in 'phpWeb.pas', 43 | phpAbout in 'phpAbout.pas' {dlgAbout}; 44 | 45 | end. 46 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiD2005.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4DelphiD2005.res -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiD2007.dpk: -------------------------------------------------------------------------------- 1 | package php4DelphiD2007; 2 | 3 | {$R *.res} 4 | {$ALIGN 8} 5 | {$ASSERTIONS ON} 6 | {$BOOLEVAL OFF} 7 | {$DEBUGINFO ON} 8 | {$EXTENDEDSYNTAX ON} 9 | {$IMPORTEDDATA ON} 10 | {$IOCHECKS ON} 11 | {$LOCALSYMBOLS ON} 12 | {$LONGSTRINGS ON} 13 | {$OPENSTRINGS ON} 14 | {$OPTIMIZATION ON} 15 | {$OVERFLOWCHECKS OFF} 16 | {$RANGECHECKS OFF} 17 | {$REFERENCEINFO ON} 18 | {$SAFEDIVIDE OFF} 19 | {$STACKFRAMES OFF} 20 | {$TYPEDADDRESS OFF} 21 | {$VARSTRINGCHECKS ON} 22 | {$WRITEABLECONST OFF} 23 | {$MINENUMSIZE 1} 24 | {$IMAGEBASE $400000} 25 | {$DESCRIPTION 'php4Delphi (design-time)'} 26 | {$DESIGNONLY} 27 | {$IMPLICITBUILD OFF} 28 | 29 | requires 30 | rtl, 31 | vcl, 32 | designide, 33 | vclactnband, 34 | vclx, 35 | php4DelphiR2007; 36 | 37 | contains 38 | PHPProjectWizard in 'PHPProjectWizard.pas', 39 | php4DelphiReg in 'php4DelphiReg.pas', 40 | php4DelphiWeb in 'php4DelphiWeb.pas', 41 | phpWeb in 'phpWeb.pas', 42 | phpAbout in 'phpAbout.pas' {dlgAbout}; 43 | 44 | end. 45 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiD2007.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4DelphiD2007.res -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiD2009.dpk: -------------------------------------------------------------------------------- 1 | package php4DelphiD2009; 2 | 3 | {$R *.res} 4 | {$ALIGN 8} 5 | {$ASSERTIONS ON} 6 | {$BOOLEVAL OFF} 7 | {$DEBUGINFO ON} 8 | {$EXTENDEDSYNTAX ON} 9 | {$IMPORTEDDATA ON} 10 | {$IOCHECKS ON} 11 | {$LOCALSYMBOLS ON} 12 | {$LONGSTRINGS ON} 13 | {$OPENSTRINGS ON} 14 | {$OPTIMIZATION ON} 15 | {$OVERFLOWCHECKS OFF} 16 | {$RANGECHECKS OFF} 17 | {$REFERENCEINFO ON} 18 | {$SAFEDIVIDE OFF} 19 | {$STACKFRAMES OFF} 20 | {$TYPEDADDRESS OFF} 21 | {$VARSTRINGCHECKS ON} 22 | {$WRITEABLECONST OFF} 23 | {$MINENUMSIZE 1} 24 | {$IMAGEBASE $400000} 25 | {$DESCRIPTION 'php4Delphi (design-time)'} 26 | {$DESIGNONLY} 27 | {$IMPLICITBUILD OFF} 28 | 29 | requires 30 | rtl, 31 | vcl, 32 | designide, 33 | vclactnband, 34 | vclx, 35 | php4DelphiR2009; 36 | 37 | contains 38 | PHPProjectWizard in 'PHPProjectWizard.pas', 39 | php4DelphiReg in 'php4DelphiReg.pas', 40 | php4DelphiWeb in 'php4DelphiWeb.pas', 41 | phpWeb in 'phpWeb.pas', 42 | phpAbout in 'phpAbout.pas' {dlgAbout}; 43 | 44 | end. 45 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiD2009.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4DelphiD2009.res -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiD2010.dpk: -------------------------------------------------------------------------------- 1 | package php4DelphiD2010; 2 | 3 | {$R *.res} 4 | {$ALIGN 8} 5 | {$ASSERTIONS ON} 6 | {$BOOLEVAL OFF} 7 | {$DEBUGINFO ON} 8 | {$EXTENDEDSYNTAX ON} 9 | {$IMPORTEDDATA ON} 10 | {$IOCHECKS ON} 11 | {$LOCALSYMBOLS ON} 12 | {$LONGSTRINGS ON} 13 | {$OPENSTRINGS ON} 14 | {$OPTIMIZATION ON} 15 | {$OVERFLOWCHECKS OFF} 16 | {$RANGECHECKS OFF} 17 | {$REFERENCEINFO ON} 18 | {$SAFEDIVIDE OFF} 19 | {$STACKFRAMES OFF} 20 | {$TYPEDADDRESS OFF} 21 | {$VARSTRINGCHECKS ON} 22 | {$WRITEABLECONST OFF} 23 | {$MINENUMSIZE 1} 24 | {$IMAGEBASE $400000} 25 | {$DESCRIPTION 'php4Delphi (design-time)'} 26 | {$DESIGNONLY} 27 | {$IMPLICITBUILD OFF} 28 | 29 | requires 30 | rtl, 31 | vcl, 32 | designide, 33 | vclactnband, 34 | vclx, 35 | php4DelphiR2010; 36 | 37 | contains 38 | PHPProjectWizard in 'PHPProjectWizard.pas', 39 | php4DelphiReg in 'php4DelphiReg.pas', 40 | php4DelphiWeb in 'php4DelphiWeb.pas', 41 | phpWeb in 'phpWeb.pas', 42 | phpAbout in 'phpAbout.pas' {dlgAbout}; 43 | 44 | end. 45 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiD2010.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4DelphiD2010.res -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiD5.dpk: -------------------------------------------------------------------------------- 1 | package php4DelphiD5; 2 | 3 | {$R *.RES} 4 | {$R 'php4delphi.dcr'} 5 | {$ALIGN ON} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO ON} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION ON} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES OFF} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST ON} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DESCRIPTION 'php4Delphi (Design)'} 27 | {$DESIGNONLY} 28 | {$IMPLICITBUILD OFF} 29 | 30 | requires 31 | vcl50, 32 | php4DelphiR5, 33 | dsnide50; 34 | 35 | contains 36 | PHPProjectWizard in 'PHPProjectWizard.pas', 37 | php4DelphiReg in 'php4DelphiReg.pas', 38 | phpAbout in 'phpAbout.pas' {dlgAbout}, 39 | phpWeb in 'phpWeb.pas', 40 | php4DelphiWeb in 'php4DelphiWeb.pas'; 41 | 42 | end. 43 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiD5.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4DelphiD5.res -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiD6.dpk: -------------------------------------------------------------------------------- 1 | package php4DelphiD6; 2 | 3 | {$R *.res} 4 | {$R 'php4delphi.dcr'} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO ON} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION ON} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES OFF} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DESCRIPTION 'php4Delphi'} 27 | {$DESIGNONLY} 28 | {$IMPLICITBUILD OFF} 29 | 30 | requires 31 | rtl, 32 | designide, 33 | php4DelphiR6; 34 | 35 | contains 36 | PHPProjectWizard in 'PHPProjectWizard.pas', 37 | php4DelphiReg in 'php4DelphiReg.pas', 38 | phpWeb in 'phpWeb.pas', 39 | php4DelphiWeb in 'php4DelphiWeb.pas', 40 | phpAbout in 'phpAbout.pas' {dlgAbout}; 41 | 42 | end. 43 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiD6.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4DelphiD6.res -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiD7.dpk: -------------------------------------------------------------------------------- 1 | package php4DelphiD7; 2 | 3 | {$R *.res} 4 | {$R 'php4delphi.dcr'} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO ON} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION ON} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES OFF} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DESCRIPTION 'php4Delphi (design-time)'} 27 | {$DESIGNONLY} 28 | {$IMPLICITBUILD OFF} 29 | 30 | requires 31 | rtl, 32 | vcl, 33 | designide, 34 | vclactnband, 35 | vclx, 36 | php4DelphiR7; 37 | 38 | contains 39 | PHPProjectWizard in 'PHPProjectWizard.pas', 40 | php4DelphiReg in 'php4DelphiReg.pas', 41 | php4DelphiWeb in 'php4DelphiWeb.pas', 42 | phpWeb in 'phpWeb.pas', 43 | phpAbout in 'phpAbout.pas' {dlgAbout}; 44 | 45 | end. 46 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiD7.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4DelphiD7.res -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiR2005.dpk: -------------------------------------------------------------------------------- 1 | package php4DelphiR2005; 2 | 3 | {$R *.res} 4 | {$R 'php4delphi.dcr'} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO ON} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION ON} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES OFF} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DESCRIPTION 'php4Delphi (run-rime)'} 27 | {$RUNONLY} 28 | {$IMPLICITBUILD OFF} 29 | 30 | requires 31 | rtl, 32 | vcl; 33 | 34 | contains 35 | zendAPI in 'ZENDAPI.pas', 36 | DelphiFunctions in 'DelphiFunctions.pas', 37 | php4delphi in 'php4delphi.pas', 38 | phpAPI in 'PHPAPI.pas', 39 | phpModules in 'phpModules.pas', 40 | phpLibrary in 'PHPLibrary.pas', 41 | PHPCustomLibrary in 'phpCustomLibrary.pas', 42 | phpFunctions in 'PHPFunctions.pas', 43 | PHPTypes in 'PHPTypes.pas', 44 | ZENDTypes in 'ZENDTypes.pas', 45 | phpClass in 'phpClass.pas', 46 | PHPCommon in 'PHPCommon.pas'; 47 | 48 | end. 49 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiR2005.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4DelphiR2005.res -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiR2006.dpk: -------------------------------------------------------------------------------- 1 | package php4DelphiR2006; 2 | 3 | {$R *.res} 4 | {$R 'php4delphi.dcr'} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO ON} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION ON} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES OFF} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DESCRIPTION 'php4Delphi (run-rime)'} 27 | {$RUNONLY} 28 | {$IMPLICITBUILD OFF} 29 | 30 | requires 31 | rtl, 32 | vcl; 33 | 34 | contains 35 | ZENDAPI in 'ZENDAPI.pas', 36 | DelphiFunctions in 'DelphiFunctions.pas', 37 | php4delphi in 'php4delphi.pas', 38 | PHPAPI in 'PHPAPI.pas', 39 | phpModules in 'phpModules.pas', 40 | PHPLibrary in 'PHPLibrary.pas', 41 | phpCustomLibrary in 'phpCustomLibrary.pas', 42 | PHPFunctions in 'PHPFunctions.pas', 43 | PHPTypes in 'PHPTypes.pas', 44 | ZENDTypes in 'ZENDTypes.pas', 45 | phpClass in 'phpClass.pas', 46 | PHPCommon in 'PHPCommon.pas'; 47 | 48 | end. 49 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiR2006.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4DelphiR2006.res -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiR2007.dpk: -------------------------------------------------------------------------------- 1 | package php4DelphiR2007; 2 | 3 | {$R *.res} 4 | {$R 'php4delphi.dcr'} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO ON} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION ON} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES OFF} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DESCRIPTION 'php4Delphi (run-rime)'} 27 | {$RUNONLY} 28 | {$IMPLICITBUILD OFF} 29 | 30 | requires 31 | rtl, 32 | vcl; 33 | 34 | contains 35 | ZENDAPI in 'ZENDAPI.pas', 36 | DelphiFunctions in 'DelphiFunctions.pas', 37 | php4delphi in 'php4delphi.pas', 38 | PHPAPI in 'PHPAPI.pas', 39 | phpModules in 'phpModules.pas', 40 | PHPLibrary in 'PHPLibrary.pas', 41 | phpCustomLibrary in 'phpCustomLibrary.pas', 42 | PHPFunctions in 'PHPFunctions.pas', 43 | PHPTypes in 'PHPTypes.pas', 44 | ZENDTypes in 'ZENDTypes.pas', 45 | phpClass in 'phpClass.pas', 46 | PHPCommon in 'PHPCommon.pas'; 47 | 48 | end. 49 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiR2007.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4DelphiR2007.res -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiR2009.dpk: -------------------------------------------------------------------------------- 1 | package php4DelphiR2009; 2 | 3 | {$R *.res} 4 | {$R 'php4delphi.dcr'} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO ON} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION ON} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES OFF} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DESCRIPTION 'php4Delphi (run-rime)'} 27 | {$RUNONLY} 28 | {$IMPLICITBUILD OFF} 29 | 30 | requires 31 | rtl, 32 | vcl; 33 | 34 | contains 35 | ZENDAPI in 'ZENDAPI.pas', 36 | DelphiFunctions in 'DelphiFunctions.pas', 37 | php4delphi in 'php4delphi.pas', 38 | PHPAPI in 'PHPAPI.pas', 39 | phpModules in 'phpModules.pas', 40 | PHPLibrary in 'PHPLibrary.pas', 41 | phpCustomLibrary in 'phpCustomLibrary.pas', 42 | PHPFunctions in 'PHPFunctions.pas', 43 | PHPTypes in 'PHPTypes.pas', 44 | ZENDTypes in 'ZENDTypes.pas', 45 | phpClass in 'phpClass.pas', 46 | PHPCommon in 'PHPCommon.pas'; 47 | 48 | end. 49 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiR2009.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4DelphiR2009.res -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiR2010.dpk: -------------------------------------------------------------------------------- 1 | package php4DelphiR2010; 2 | 3 | {$R *.res} 4 | {$R 'php4delphi.dcr'} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO ON} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION ON} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES OFF} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DESCRIPTION 'php4Delphi (run-rime)'} 27 | {$RUNONLY} 28 | {$IMPLICITBUILD OFF} 29 | 30 | requires 31 | rtl, 32 | vcl; 33 | 34 | contains 35 | ZENDAPI in 'ZENDAPI.pas', 36 | DelphiFunctions in 'DelphiFunctions.pas', 37 | php4delphi in 'php4delphi.pas', 38 | PHPAPI in 'PHPAPI.pas', 39 | phpModules in 'phpModules.pas', 40 | PHPLibrary in 'PHPLibrary.pas', 41 | phpCustomLibrary in 'phpCustomLibrary.pas', 42 | PHPFunctions in 'PHPFunctions.pas', 43 | PHPTypes in 'PHPTypes.pas', 44 | ZENDTypes in 'ZENDTypes.pas', 45 | phpClass in 'phpClass.pas', 46 | PHPCommon in 'PHPCommon.pas'; 47 | 48 | end. 49 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiR2010.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4DelphiR2010.res -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiR5.dpk: -------------------------------------------------------------------------------- 1 | package php4DelphiR5; 2 | 3 | {$R *.RES} 4 | {$R 'php4delphi.dcr'} 5 | {$ALIGN ON} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO ON} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION ON} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES OFF} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST ON} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DESCRIPTION 'PHP4Delphi (run-time)'} 27 | {$RUNONLY} 28 | {$IMPLICITBUILD OFF} 29 | 30 | requires 31 | vcl50; 32 | 33 | contains 34 | zendAPI in 'ZENDAPI.pas', 35 | DelphiFunctions in 'DelphiFunctions.pas', 36 | php4delphi in 'php4delphi.pas', 37 | phpAPI in 'PHPAPI.pas', 38 | phpLibrary in 'PHPLibrary.pas', 39 | PHPCustomLibrary in 'phpCustomLibrary.pas', 40 | phpFunctions in 'phpFunctions.pas', 41 | PHPTypes in 'PHPTypes.pas', 42 | ZENDTypes in 'ZENDTypes.pas', 43 | phpClass in 'phpClass.pas', 44 | phpModules in 'phpModules.pas', 45 | PHPCommon in 'PHPCommon.pas'; 46 | 47 | end. 48 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiR5.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4DelphiR5.res -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiR6.dpk: -------------------------------------------------------------------------------- 1 | package php4DelphiR6; 2 | 3 | {$R *.res} 4 | {$R 'php4delphi.dcr'} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO ON} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION ON} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES OFF} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DESCRIPTION 'php4Delphi (run-time)'} 27 | {$RUNONLY} 28 | {$IMPLICITBUILD OFF} 29 | 30 | requires 31 | rtl, 32 | vcl; 33 | 34 | contains 35 | zendAPI in 'ZENDAPI.pas', 36 | DelphiFunctions in 'DelphiFunctions.pas', 37 | php4delphi in 'php4delphi.pas', 38 | phpAPI in 'PHPAPI.pas', 39 | phpModules in 'phpModules.pas', 40 | phpLibrary in 'PHPLibrary.pas', 41 | PHPCustomLibrary in 'phpCustomLibrary.pas', 42 | phpFunctions in 'PHPFunctions.pas', 43 | ZENDTypes in 'ZendTypes.pas', 44 | PHPTypes in 'phpTypes.pas', 45 | phpClass in 'phpClass.pas', 46 | PHPCommon in 'PHPCommon.pas'; 47 | 48 | end. 49 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiR6.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4DelphiR6.res -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiR7.dpk: -------------------------------------------------------------------------------- 1 | package php4DelphiR7; 2 | 3 | {$R *.res} 4 | {$R 'php4delphi.dcr'} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO ON} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS ON} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION ON} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO ON} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES OFF} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DESCRIPTION 'php4Delphi (run-rime)'} 27 | {$RUNONLY} 28 | {$IMPLICITBUILD OFF} 29 | 30 | requires 31 | rtl, 32 | vcl; 33 | 34 | contains 35 | zendAPI in 'ZENDAPI.pas', 36 | DelphiFunctions in 'DelphiFunctions.pas', 37 | php4delphi in 'php4delphi.pas', 38 | phpAPI in 'PHPAPI.pas', 39 | phpModules in 'phpModules.pas', 40 | phpLibrary in 'PHPLibrary.pas', 41 | PHPCustomLibrary in 'phpCustomLibrary.pas', 42 | phpFunctions in 'PHPFunctions.pas', 43 | PHPTypes in 'PHPTypes.pas', 44 | ZENDTypes in 'ZENDTypes.pas', 45 | phpClass in 'phpClass.pas', 46 | PHPCommon in 'PHPCommon.pas'; 47 | 48 | end. 49 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiR7.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4DelphiR7.res -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiReg.pas: -------------------------------------------------------------------------------- 1 | {*******************************************************} 2 | { PHP4Delphi } 3 | { PHP4Delphi components registration } 4 | { } 5 | { Author: } 6 | { Serhiy Perevoznyk } 7 | { serge_perevoznyk@hotmail.com } 8 | { http://users.telenet.be/ws36637 } 9 | {*******************************************************} 10 | {$I PHP.INC} 11 | 12 | { $Id: php4DelphiReg.pas,v 7.2 10/2009 delphi32 Exp $ } 13 | 14 | unit php4DelphiReg; 15 | 16 | interface 17 | uses 18 | Windows, SysUtils, Classes, Dialogs, Forms, 19 | PHPCommon, 20 | {$IFDEF VERSION6} 21 | DesignIntf, 22 | DesignEditors, 23 | ToolsAPI, 24 | {$ELSE} 25 | dsgnintf, 26 | {$ENDIF} 27 | Graphics, 28 | ShlObj, 29 | ZendAPI, PHPAPI, 30 | PHP4Delphi, phpAbout, phpModules, phpLibrary, ShellAPI, 31 | phpClass, 32 | phpCustomLibrary; 33 | 34 | type 35 | TScriptFileProperty = class(TStringProperty) 36 | public 37 | procedure Edit; override; 38 | function GetAttributes: TPropertyAttributes; override; 39 | end; 40 | 41 | TINIFolderProperty = class(TStringProperty) 42 | public 43 | procedure Edit; override; 44 | function GetAttributes: TPropertyAttributes; override; 45 | end; 46 | 47 | TpsvPHPEditor = class(TDefaultEditor) 48 | public 49 | {$IFDEF VERSION6} 50 | procedure EditProperty(const Prop: IProperty; var Continue: Boolean); override; 51 | {$ELSE} 52 | procedure EditProperty(PropertyEditor: TPropertyEditor; 53 | var Continue, FreeEditor: boolean); override; 54 | {$ENDIF} 55 | procedure ExecuteVerb(Index: integer); override; 56 | function GetVerb(Index: integer): string; override; 57 | function GetVerbCount: integer; override; 58 | procedure Edit; override; 59 | end; 60 | 61 | {$IFDEF VERSION10} 62 | procedure RegisterSplashScreen; 63 | {$ENDIF} 64 | 65 | procedure Register; 66 | 67 | implementation 68 | 69 | {$R php4DelphiSplash.res} 70 | 71 | {$IFDEF VERSION11} 72 | {$R php4delphi.dcr} 73 | {$ENDIF} 74 | 75 | {$IFDEF VERSION10} 76 | procedure RegisterSplashScreen; 77 | var 78 | Bmp: TBitmap; 79 | begin 80 | Bmp := TBitmap.Create; 81 | Bmp.LoadFromResourceName( HInstance, 'PHPDELPHIL' ); 82 | try 83 | SplashScreenServices.AddPluginBitmap('php4Delphi version 7.2', 84 | Bmp.Handle, False, 'Registered', '' ); 85 | finally 86 | Bmp.Free; 87 | end; 88 | 89 | end; 90 | 91 | {$ENDIF} 92 | 93 | procedure Register; 94 | begin 95 | {$IFDEF VERSION10} 96 | RegisterSplashScreen; 97 | {$ENDIF} 98 | RegisterComponents('PHP', [TPHPEngine]); 99 | RegisterComponents('PHP', [TpsvPHP]); 100 | RegisterComponents('PHP', [TPHPLibrary]); 101 | RegisterComponents('PHP', [TPHPClass]); 102 | RegisterComponents('PHP', [TPHPSystemLibrary]); 103 | RegisterPropertyEditor(TypeInfo(String), TpsvPHP, 'FileName', TScriptFileProperty); 104 | RegisterPropertyEditor(TypeInfo(TPHPAboutInfo), TPHPComponent, 'About', TPHPVersionEditor); 105 | RegisterPropertyEditor(TypeInfo(TPHPAboutInfo), TCustomPHPExtension, 'About', TphpVersionEditor); 106 | RegisterComponentEditor(TPHPExtension, TpsvPHPEditor); 107 | RegisterComponentEditor(TPHPLibrary, TpsvPHPEditor); 108 | end; 109 | 110 | 111 | procedure TScriptFileProperty.Edit; 112 | var 113 | MPFileOpen: TOpenDialog; 114 | begin 115 | MPFileOpen := TOpenDialog.Create(Application); 116 | MPFileOpen.Filename := GetValue; 117 | MPFileOpen.Filter := 'PHP Script (*.php)|*.php'; 118 | MPFileOpen.Options := MPFileOpen.Options + [ofPathMustExist, 119 | ofFileMustExist]; 120 | try 121 | if MPFileOpen.Execute then SetValue(MPFileOpen.Filename); 122 | finally 123 | MPFileOpen.Free; 124 | end; 125 | end; 126 | 127 | function TScriptFileProperty.GetAttributes: TPropertyAttributes; 128 | begin 129 | Result := [paDialog]; 130 | end; 131 | 132 | {$IFDEF VERSION6} 133 | procedure TpsvPHPEditor.EditProperty(const Prop: IProperty; var Continue: Boolean); 134 | var 135 | PropName: string; 136 | begin 137 | PropName := Prop.GetName; 138 | if (CompareText(PropName, 'FUNCTIONS') = 0) then 139 | begin 140 | Prop.Edit; 141 | Continue := False; 142 | end; 143 | end; 144 | 145 | {$ELSE} 146 | procedure TpsvPHPEditor.EditProperty(PropertyEditor: TPropertyEditor; 147 | var Continue, 148 | FreeEditor: boolean); 149 | var 150 | PropName: string; 151 | begin 152 | PropName := PropertyEditor.GetName; 153 | if (CompareText(PropName, 'FUNCTIONS') = 0) then 154 | begin 155 | PropertyEditor.Edit; 156 | Continue := False; 157 | end; 158 | end; 159 | {$ENDIF} 160 | 161 | procedure TpsvPHPEditor.Edit; 162 | begin 163 | inherited; 164 | end; 165 | 166 | procedure TpsvPHPEditor.ExecuteVerb(Index: integer); 167 | begin 168 | case Index of 169 | 0: 170 | begin 171 | Edit; 172 | Designer.Modified; 173 | end; 174 | 1: ShellExecute(0, 'open', 'http://www.php.net', nil, nil, SW_SHOW); 175 | 2: ShellExecute(0, 'open', 'http://users.telenet.be/ws36637', nil, nil, SW_SHOW); 176 | end; 177 | end; 178 | 179 | function TpsvPHPEditor.GetVerb(Index: integer): string; 180 | begin 181 | case Index of 182 | 0: Result := 'Edit PHP Functions...'; 183 | 1: Result := 'PHP Home Page'; 184 | 2: Result := 'PHP4Delphi Home Page'; 185 | end; 186 | end; 187 | 188 | function TpsvPHPEditor.GetVerbCount: integer; 189 | begin 190 | Result := 3; 191 | end; 192 | 193 | { TINIFolderProperty } 194 | 195 | procedure TINIFolderProperty.Edit; 196 | var 197 | BrowseInfo: TBrowseInfo; 198 | ItemIDList: PItemIDList; 199 | ItemSelected : PItemIDList; 200 | NameBuffer: array[0..MAX_PATH] of Char; 201 | WindowList: Pointer; 202 | begin 203 | itemIDList := nil; 204 | FillChar(BrowseInfo, SizeOf(BrowseInfo), 0); 205 | BrowseInfo.hwndOwner := Forms.Application.Handle; 206 | BrowseInfo.pidlRoot := ItemIDList; 207 | BrowseInfo.pszDisplayName := NameBuffer; 208 | BrowseInfo.lpszTitle := 'Select folder'; 209 | BrowseInfo.ulFlags := BIF_RETURNONLYFSDIRS; 210 | WindowList := DisableTaskWindows(0); 211 | try 212 | ItemSelected := SHBrowseForFolder(BrowseInfo); 213 | finally 214 | EnableTaskWindows(WindowList); 215 | end; 216 | if (ItemSelected <> nil) then 217 | begin 218 | SHGetPathFromIDList(ItemSelected,NameBuffer); 219 | SetValue(NameBuffer); 220 | end; 221 | end; 222 | 223 | function TINIFolderProperty.GetAttributes: TPropertyAttributes; 224 | begin 225 | Result := [paDialog]; 226 | end; 227 | 228 | end. -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiSplash.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4DelphiSplash.res -------------------------------------------------------------------------------- /src/thirdparty/php/php4DelphiWeb.pas: -------------------------------------------------------------------------------- 1 | {*******************************************************} 2 | { PHP4Delphi } 3 | { PHP - Delphi interface } 4 | { } 5 | { Author: } 6 | { Serhiy Perevoznyk } 7 | { serge_perevoznyk@hotmail.com } 8 | { http://users.telenet.be/ws36637 } 9 | { http://delphi32.blogspot.com } 10 | {*******************************************************} 11 | {$I PHP.INC} 12 | 13 | { $Id: php4DelphiWeb.pas,v 7.2 10/2009 delphi32 Exp $ } 14 | 15 | unit php4DelphiWeb; 16 | 17 | interface 18 | 19 | uses 20 | Windows, ToolsAPI, Forms, Dialogs, SysUtils, Graphics, Classes, ShellAPI; 21 | 22 | type 23 | Tphp4DelphiWeb = class(TNotifierObject, IOTAWIzard, IOTAMenuWizard) 24 | public 25 | function GetMenuText: string; 26 | function GetIDString: string; 27 | function GetName: string; 28 | function GetState: TWizardState; 29 | procedure Execute; 30 | end; 31 | 32 | procedure Register; 33 | 34 | implementation 35 | 36 | procedure Register; 37 | begin 38 | RegisterPackageWizard(Tphp4DelphiWeb.Create as IOTAWizard); 39 | end; 40 | 41 | procedure InitExpert; 42 | begin 43 | { stubbed out } 44 | end; 45 | 46 | procedure DoneExpert; 47 | begin 48 | { stubbed out } 49 | end; 50 | 51 | { Tphp4DelphiWeb } 52 | 53 | procedure Tphp4DelphiWeb.Execute; 54 | begin 55 | ShellExecute(0, 'open', 'http://users.chello.be/ws36637', nil, nil, SW_SHOW); 56 | end; 57 | 58 | function Tphp4DelphiWeb.GetIDString: string; 59 | begin 60 | Result := 'Perevoznyk.Tphp4DelphiWeb'; 61 | end; 62 | 63 | function Tphp4DelphiWeb.GetMenuText: string; 64 | begin 65 | Result := 'PHP4Delphi Home Page'; 66 | end; 67 | 68 | function Tphp4DelphiWeb.GetName: string; 69 | begin 70 | Result := 'Tphp4DelphiWeb'; 71 | end; 72 | 73 | function Tphp4DelphiWeb.GetState: TWizardState; 74 | begin 75 | Result := [wsEnabled]; 76 | end; 77 | 78 | initialization 79 | InitExpert; 80 | 81 | finalization 82 | DoneExpert; 83 | 84 | end. 85 | -------------------------------------------------------------------------------- /src/thirdparty/php/php4delphi.dcr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/thirdparty/php/php4delphi.dcr -------------------------------------------------------------------------------- /src/thirdparty/php/phpAbout.pas: -------------------------------------------------------------------------------- 1 | {*******************************************************} 2 | { PHP4Delphi } 3 | { PHP - Delphi interface } 4 | { } 5 | { Author: } 6 | { Serhiy Perevoznyk } 7 | { serge_perevoznyk@hotmail.com } 8 | { http://users.telenet.be/ws36637 } 9 | { http://delphi32.blogspot.com } 10 | {*******************************************************} 11 | {$I PHP.INC} 12 | 13 | { $Id: phpAbout.pas,v 7.2 10/2009 delphi32 Exp $ } 14 | 15 | unit phpAbout; 16 | 17 | interface 18 | 19 | uses 20 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 21 | StdCtrls, ExtCtrls, 22 | {$IFDEF VERSION6} 23 | DesignIntf, 24 | DesignEditors, 25 | {$ELSE} 26 | dsgnintf, 27 | {$ENDIF} 28 | math; 29 | 30 | type 31 | TdlgAbout = class(TForm) 32 | pnlLeft: TPanel; 33 | pnlImage: TPanel; 34 | imgAbout: TImage; 35 | pnlBody: TPanel; 36 | bvlSpit: TBevel; 37 | labTitleShadow: TLabel; 38 | labTitle: TLabel; 39 | labDelphiShadow: TLabel; 40 | lblAuthor: TLabel; 41 | labDelphi: TLabel; 42 | labVersion: TLabel; 43 | btnOK: TButton; 44 | procedure FormCreate(Sender: TObject); 45 | protected 46 | end; 47 | 48 | TPHPVersionEditor = class(TPropertyEditor) 49 | function AllEqual: boolean; override; 50 | procedure Edit; override; 51 | function GetAttributes: TPropertyAttributes; override; 52 | function GetValue: string; override; 53 | procedure SetValue(const Value: string); override; 54 | end; 55 | 56 | 57 | const php4DelphiVersion = '7.2'; 58 | 59 | implementation 60 | 61 | {$R *.DFM} 62 | 63 | function TPHPVersionEditor.AllEqual: boolean; 64 | var 65 | componentIndex: integer; 66 | currentValue: string; 67 | begin 68 | Result := False; 69 | if (PropCount > 1) then 70 | begin 71 | currentValue := GetStrValue; 72 | for componentIndex := 1 to PropCount - 1 do 73 | begin 74 | if (GetStrValueAt(componentIndex) <> currentValue) then 75 | exit; 76 | end; 77 | end; 78 | Result := True; 79 | end; 80 | 81 | procedure TPHPVersionEditor.Edit; 82 | begin 83 | with TdlgAbout.Create(NIL) do 84 | begin 85 | try 86 | ShowModal; 87 | finally 88 | Free; { Free dialog. } 89 | end; 90 | end; 91 | end; 92 | 93 | function TPHPVersionEditor.GetAttributes: TPropertyAttributes; 94 | begin 95 | Result := [paDialog, paReadOnly]; 96 | end; 97 | 98 | function TPHPVersionEditor.GetValue: string; 99 | begin 100 | Result := 'PHP4Delphi ' + php4DelphiVersion; 101 | end; 102 | 103 | procedure TPHPVersionEditor.SetValue(const Value: string); 104 | begin 105 | end; 106 | 107 | procedure TdlgAbout.FormCreate(Sender: TObject); 108 | begin 109 | labVersion.Caption := 'Version ' + php4DelphiVersion; 110 | end; 111 | 112 | end. 113 | -------------------------------------------------------------------------------- /src/thirdparty/php/phpApp.pas: -------------------------------------------------------------------------------- 1 | {*******************************************************} 2 | { PHP4Delphi } 3 | { Custom PHP extension application } 4 | { } 5 | { Author: } 6 | { Serhiy Perevoznyk } 7 | { serge_perevoznyk@hotmail.com } 8 | { http://users.chello.be/ws36637 } 9 | {*******************************************************} 10 | {$I PHP.INC} 11 | 12 | { $Id: phpApp.pas,v 7.2 10/2009 delphi32 Exp $ } 13 | 14 | 15 | {$DENYPACKAGEUNIT} 16 | 17 | unit phpAPP; 18 | 19 | interface 20 | 21 | uses 22 | Windows, SysUtils, PHPAPI, phpModules; 23 | 24 | implementation 25 | 26 | { InitApplication } 27 | procedure InitApplication; 28 | begin 29 | Application := TPHPApplication.Create(nil); 30 | end; 31 | 32 | { DoneApplication } 33 | procedure DoneApplication; 34 | begin 35 | try 36 | if Assigned(Application) then 37 | begin 38 | Application.CacheConnections := false; 39 | Application.Free; 40 | Application := nil; 41 | end; 42 | except 43 | end; 44 | end; 45 | 46 | initialization 47 | if not PHPLoaded then 48 | LoadPHP; 49 | 50 | InitApplication; 51 | 52 | finalization 53 | DoneApplication; 54 | 55 | end. 56 | 57 | -------------------------------------------------------------------------------- /src/thirdparty/php/phpWeb.pas: -------------------------------------------------------------------------------- 1 | {*******************************************************} 2 | { PHP4Delphi } 3 | { PHP - Delphi interface } 4 | { } 5 | { Author: } 6 | { Serhiy Perevoznyk } 7 | { serge_perevoznyk@hotmail.com } 8 | { http://users.telenet.be/ws36637 } 9 | {*******************************************************} 10 | {$I PHP.INC} 11 | 12 | { $Id: phpWeb.pas,v 7.2 10/2009 delphi32 Exp $ } 13 | 14 | unit phpWeb; 15 | 16 | interface 17 | 18 | uses 19 | Windows, ToolsAPI, Forms, Dialogs, SysUtils, Graphics, Classes, ShellAPI; 20 | 21 | type 22 | TphpWebWizard = class(TNotifierObject, IOTAWIzard, IOTAMenuWizard) 23 | public 24 | function GetMenuText: string; 25 | function GetIDString: string; 26 | function GetName: string; 27 | function GetState: TWizardState; 28 | procedure Execute; 29 | end; 30 | 31 | 32 | TphpForumWizard = class(TNotifierObject, IOTAWIzard, IOTAMenuWizard) 33 | public 34 | function GetMenuText: string; 35 | function GetIDString: string; 36 | function GetName: string; 37 | function GetState: TWizardState; 38 | procedure Execute; 39 | end; 40 | 41 | procedure Register; 42 | 43 | implementation 44 | 45 | procedure Register; 46 | begin 47 | RegisterPackageWizard(TphpWebWizard.Create as IOTAWizard); 48 | RegisterPackageWizard(TphpForumWizard.Create as IOTAWizard); 49 | end; 50 | 51 | procedure InitExpert; 52 | begin 53 | { stubbed out } 54 | end; 55 | 56 | procedure DoneExpert; 57 | begin 58 | { stubbed out } 59 | end; 60 | 61 | { TphpWebWizard } 62 | 63 | procedure TphpWebWizard.Execute; 64 | begin 65 | ShellExecute(0, 'open', 'http://www.php.net', nil, nil, SW_SHOW); 66 | end; 67 | 68 | function TphpWebWizard.GetIDString: string; 69 | begin 70 | Result := 'Perevoznyk.TphpWebWizard'; 71 | end; 72 | 73 | function TphpWebWizard.GetMenuText: string; 74 | begin 75 | Result := 'PHP Home Page'; 76 | end; 77 | 78 | function TphpWebWizard.GetName: string; 79 | begin 80 | Result := 'TphpWebWizard'; 81 | end; 82 | 83 | function TphpWebWizard.GetState: TWizardState; 84 | begin 85 | Result := [wsEnabled]; 86 | end; 87 | 88 | 89 | 90 | { TphpForumWizard } 91 | 92 | procedure TphpForumWizard.Execute; 93 | begin 94 | ShellExecute(0, 'open', 'http://sourceforge.net/forum/forum.php?forum_id=324242', nil, nil, SW_SHOW); 95 | end; 96 | 97 | function TphpForumWizard.GetIDString: string; 98 | begin 99 | Result := 'Perevoznyk.TphpForumWizard'; 100 | end; 101 | 102 | function TphpForumWizard.GetMenuText: string; 103 | begin 104 | Result := 'PHP4Delphi Forum'; 105 | end; 106 | 107 | function TphpForumWizard.GetName: string; 108 | begin 109 | Result := 'TphpForumWizard'; 110 | end; 111 | 112 | function TphpForumWizard.GetState: TWizardState; 113 | begin 114 | Result := [wsEnabled]; 115 | end; 116 | 117 | initialization 118 | InitExpert; 119 | 120 | finalization 121 | DoneExpert; 122 | 123 | end. 124 | -------------------------------------------------------------------------------- /src/thirdparty/php/zend_dynamic_array.pas: -------------------------------------------------------------------------------- 1 | {*******************************************************} 2 | { PHP4Delphi } 3 | { PHP - Delphi interface } 4 | { } 5 | { Author: } 6 | { Serhiy Perevoznyk } 7 | { serge_perevoznyk@hotmail.com } 8 | { http://users.chello.be/ws36637 } 9 | {*******************************************************} 10 | {$I PHP.INC} 11 | 12 | { $Id: zend_dynamic_array.pas,v 7.2 10/2009 delphi32 Exp $ } 13 | 14 | unit zend_dynamic_array; 15 | 16 | interface 17 | uses 18 | Windows, SysUtils; 19 | 20 | type 21 | 22 | 23 | dynamic_array = record 24 | _array : PAnsiChar; 25 | element_size : UINT; 26 | current : UINT; 27 | allocated : UINT; 28 | end; 29 | 30 | TDynamicArray = dynamic_array; 31 | PDynamicArray = ^TDynamicArray; 32 | 33 | function zend_dynamic_array_init(da : PDynamicArray; element_size : UINT; size: UINT) : integer; cdecl; 34 | function zend_dynamic_array_push(da : PDynamicArray) : pointer; cdecl; 35 | function zend_dynamic_array_pop(da : PDynamicArray) : pointer; cdecl; 36 | function zend_dynamic_array_get_element(da : PDynamicArray; index: UINT) : pointer; cdecl; 37 | 38 | implementation 39 | 40 | function zend_dynamic_array_init(da : PDynamicArray; element_size : UINT; size: UINT) : integer; cdecl; 41 | begin 42 | da^.element_size := element_size; 43 | da^.allocated := size; 44 | da^.current := 0; 45 | da^._array := AllocMem(size*element_size); 46 | if (da^._array = nil) then 47 | Result := 1 48 | else 49 | Result := 0; 50 | end; 51 | 52 | 53 | function zend_dynamic_array_push(da : PDynamicArray) : pointer; cdecl; 54 | begin 55 | if (da^.current = da^.allocated) then 56 | begin 57 | da^.allocated := da^.Allocated * 2; 58 | da^._array := ReallocMemory (da^._array, da^.allocated*da^.element_size); 59 | end; 60 | Result := da^._array + (da^.current)*da^.element_size; 61 | inc(da^.current); 62 | end; 63 | 64 | function zend_dynamic_array_pop(da : PDynamicArray) : pointer; cdecl; 65 | begin 66 | dec(da^.current); 67 | Result := da^._array + (da^.current)*da^.element_size; 68 | end; 69 | 70 | function zend_dynamic_array_get_element(da : PDynamicArray; index: UINT) : pointer; cdecl; 71 | begin 72 | if (index >= da^.current) then 73 | result := nil 74 | else 75 | Result := da^._array+index*da^.element_size; 76 | end; 77 | 78 | end. 79 | -------------------------------------------------------------------------------- /src/uActiveScript.pas: -------------------------------------------------------------------------------- 1 | unit uActiveScript; 2 | { 3 | UnderScript JavaScript, VBScript & other ActiveScript Wrappers 4 | Copyright (c) 2013-2014 Felipe Daragon 5 | License: MIT (http://opensource.org/licenses/mit-license.php) 6 | } 7 | 8 | interface 9 | 10 | uses 11 | Classes, SysUtils, lua, plua, LuaObject, ActiveX, CatJSRunnerAS, UndHelper_AS, 12 | CatStrings, UndImporter, UndConst, UndConsole, TypInfo, CatLogger; 13 | 14 | const 15 | cDefaultLanguage: string = 'JavaScript'; 16 | 17 | var 18 | USEOLDASPARSER: boolean = false; 19 | 20 | type 21 | TActiveLanguage = (LuaScript, PerlScript, JavaScript, VBScript); 22 | 23 | function JavaScript_Run(L: plua_State): integer; cdecl; 24 | function PerlScript_Run(L: plua_State): integer; cdecl; 25 | function VBScript_Run(L: plua_State): integer; cdecl; 26 | function ActiveScript_Run(L: plua_State): integer; cdecl; 27 | 28 | implementation 29 | 30 | var 31 | ASLOADED: boolean = false; 32 | 33 | procedure LoadActiveScriptSupport; 34 | begin 35 | if ASLOADED = true then 36 | exit; 37 | ASLOADED := true; 38 | if fileexists(extractfilepath(paramstr(0))+'\Carbon.conf') = true then 39 | USEOLDASPARSER := true; 40 | end; 41 | 42 | function PrepareLanguage(const Lang: string):TUndLanguageInternal; 43 | begin 44 | result.FuncReadFormat := emptystr; 45 | result.FuncWriteFormat := emptystr; 46 | result.FuncConstFormat := emptystr; 47 | 48 | case TActiveLanguage(GetEnumValue(TypeInfo(TActiveLanguage), Lang)) of 49 | JavaScript: result := langint_JScript; 50 | LuaScript: result := langint_LuaScript; 51 | PerlScript: result := langint_PerlScript; 52 | VBScript: result := langint_VBScript; 53 | end; 54 | end; 55 | 56 | type 57 | TScriptErrorHandler = class 58 | public 59 | scriptlanguage: string; 60 | procedure ScriptError(Line, Pos: integer; ASrc, ADescription: String); 61 | end; 62 | 63 | procedure TScriptErrorHandler.ScriptError(Line, Pos: integer; 64 | ASrc, ADescription: String); 65 | begin 66 | uConsoleErrorLn(UndHelper.LuaState, Line, scriptlanguage + ': ' + ADescription + 67 | ' [' + ASrc + ']'); 68 | // errors.add(inttostr(line)+': '+Adescription+' ['+Asrc+']'); 69 | // UndHelper.writeln(scriptlanguage + ': ' + inttostr(Line) + ': ' + 70 | // ADescription + ' [' + ASrc + ']'); 71 | end; 72 | 73 | // Runs script and returns the result and error info (if any) 74 | function Script_Run(L: plua_State; Script, Lang: string; 75 | iseval: boolean = false): integer; 76 | var 77 | r: TUndScriptResult; 78 | obj: TScarlettActiveScript; 79 | uconsole: TUndHelper; 80 | Importer: TUndImporter; 81 | eh: TScriptErrorHandler; 82 | langdef: TUndLanguageInternal; 83 | sw: TCatStopWatch; 84 | begin 85 | if plua_validateargs(L, result, [LUA_TSTRING]).OK = false then 86 | Exit; 87 | LoadActiveScriptSupport; 88 | sw := CatStopWatchNew; 89 | r.success := true; 90 | CoInitialize(nil); 91 | eh := TScriptErrorHandler.create; 92 | Importer := TUndImporter.create(L); 93 | Importer.EnableDebug := false; 94 | Importer.EnableImport := true; 95 | langdef := PrepareLanguage(Lang); 96 | // if language is not found, disables import of variables 97 | if langdef.FuncReadFormat = emptystr then 98 | Importer.EnableImport := false; 99 | uconsole := TUndHelper.create; 100 | uconsole.LuaState := L; // IMPORTANT! 101 | UndHelper.LuaState := L; // IMPORTANT! 102 | obj := TScarlettActiveScript.create(UndHelper); 103 | obj.scriptlanguage := cDefaultLanguage; // javascript 104 | obj.OnScriptError := eh.ScriptError; 105 | obj.UseOldEngine := USEOLDASPARSER; 106 | if Lang <> emptystr then 107 | obj.scriptlanguage := Lang; 108 | eh.scriptlanguage := obj.scriptlanguage; 109 | obj.UseSafeSubset := false; 110 | obj.AddNamedItem(rudLibName, uconsole); 111 | Script := lua_tostring(L, 1); 112 | Script := Importer.GetScript(L, Script, langdef).completescript; 113 | Importer.Free; 114 | try 115 | if iseval then 116 | begin 117 | r.expressionresult := obj.runexpression(Script); 118 | end 119 | else 120 | begin 121 | obj.runscript(Script); 122 | end; 123 | except 124 | end; 125 | 126 | if obj.scriptsuccess = false then 127 | begin 128 | r.success := false; 129 | r.errormessage := obj.errors.Text; 130 | // UndHelper.writeln(obj.asw.scriptlanguage+': '+obj.errors.Text); 131 | end; 132 | obj.Free; 133 | eh.Free; 134 | Und_PushScriptResult(L, r, sw); 135 | result := 1; 136 | end; 137 | 138 | // JavaScript Functions 139 | function JavaScript_Run(L: plua_State): integer; cdecl; 140 | begin 141 | if plua_validateargs(L, result, [LUA_TSTRING]).OK then 142 | Script_Run(L, lua_tostring(L, 1), cDefaultLanguage); 143 | end; 144 | 145 | function JavaScript_Eval(L: plua_State): integer; cdecl; 146 | begin 147 | if plua_validateargs(L, result, [LUA_TSTRING]).OK then 148 | Script_Run(L, lua_tostring(L, 1), cDefaultLanguage, true); 149 | end; 150 | 151 | // VBScript Functions 152 | function VBScript_Run(L: plua_State): integer; cdecl; 153 | begin 154 | if plua_validateargs(L, result, [LUA_TSTRING]).OK then 155 | Script_Run(L, lua_tostring(L, 1), 'VBScript'); 156 | end; 157 | 158 | function VBScript_Eval(L: plua_State): integer; cdecl; 159 | begin 160 | if plua_validateargs(L, result, [LUA_TSTRING]).OK then 161 | Script_Run(L, lua_tostring(L, 1), 'VBScript', true); 162 | end; 163 | 164 | // PerlScript Functions 165 | function PerlScript_Run(L: plua_State): integer; cdecl; 166 | begin 167 | if plua_validateargs(L, result, [LUA_TSTRING]).OK then 168 | Script_Run(L, lua_tostring(L, 1), 'PerlScript'); 169 | end; 170 | 171 | function PerlScript_Eval(L: plua_State): integer; cdecl; 172 | begin 173 | if plua_validateargs(L, result, [LUA_TSTRING]).OK then 174 | Script_Run(L, lua_tostring(L, 1), 'PerlScript', true); 175 | end; 176 | 177 | // LuaScript Functions 178 | function LuaScript_Run(L: plua_State): integer; cdecl; 179 | begin 180 | if plua_validateargs(L, result, [LUA_TSTRING]).OK then 181 | Script_Run(L, lua_tostring(L, 1), 'LuaScript'); 182 | end; 183 | 184 | function LuaScript_Eval(L: plua_State): integer; cdecl; 185 | begin 186 | if plua_validateargs(L, result, [LUA_TSTRING]).OK then 187 | Script_Run(L, lua_tostring(L, 1), 'LuaScript', true); 188 | end; 189 | 190 | function ActiveScript_Run(L: plua_State): integer; cdecl; 191 | begin 192 | if plua_validateargs(L, result, [LUA_TSTRING, LUA_TSTRING]).OK then 193 | Script_Run(L, lua_tostring(L, 2), lua_tostring(L, 1)); 194 | end; 195 | 196 | function ActiveScript_Eval(L: plua_State): integer; cdecl; 197 | begin 198 | if plua_validateargs(L, result, [LUA_TSTRING, LUA_TSTRING]).OK then 199 | result := Script_Run(L, lua_tostring(L, 2), lua_tostring(L, 1), true); 200 | end; 201 | 202 | end. 203 | -------------------------------------------------------------------------------- /src/uJavaScript_JSC.pas: -------------------------------------------------------------------------------- 1 | unit uJavaScript_JSC; 2 | { 3 | UnderScript JavaScriptCore Wrapper 4 | Copyright (c) 2013-2020 Felipe Daragon 5 | License: MIT (http://opensource.org/licenses/mit-license.php) 6 | } 7 | 8 | interface 9 | 10 | uses 11 | Classes, SysUtils, lua, plua, LuaObject, UndImporter, UndConst, UndConsole, 12 | CatStrings, JSK.Base, UndHelper_Obj, vcl.dialogs, CatLogger; 13 | 14 | function JavaScriptJSC_Run(L: Plua_State): integer; cdecl; 15 | 16 | implementation 17 | 18 | function RunJS(L: Plua_State; const script: string):string; 19 | var 20 | ctx: TJSContext; 21 | res: TJSValue; 22 | begin 23 | ctx := TJSContext.Create; 24 | try 25 | ctx.SetObject(rudLibName, UndHelper); 26 | res := ctx.Evaluate(script); 27 | if res.IsString then 28 | result := Res.AsString; 29 | finally 30 | ctx.Free; 31 | end; 32 | end; 33 | 34 | function JavaScriptJSC_Run(L: Plua_State): integer; cdecl; 35 | var 36 | r: TUndScriptResult; 37 | script: string; 38 | importer: TUndImporter; 39 | sw : TCatStopWatch; 40 | begin 41 | sw := CatStopWatchNew; 42 | r.success := true; 43 | UndHelper.LuaState := L; 44 | importer := TUndImporter.Create(L); 45 | importer.EnableDebug := false; 46 | script := lua_tostring(L, 1); 47 | script := importer.GetScript(L, script, langint_JavaScriptCore).completescript; 48 | try 49 | r.expressionresult := runjs(L, script); 50 | except 51 | on E: Exception do 52 | begin 53 | r.success := false; 54 | r.errormessage := E.Message; 55 | uConsoleErrorLn(L, -1, 'JS: ' + E.Message); 56 | end; 57 | end; 58 | 59 | importer.Free; 60 | Und_PushScriptResult(L, r, sw); 61 | Result := 1; 62 | end; 63 | 64 | end. 65 | -------------------------------------------------------------------------------- /src/uJavaScript_QJS.pas: -------------------------------------------------------------------------------- 1 | unit uJavaScript_QJS; 2 | { 3 | UnderScript QuickJS Wrapper 4 | Copyright (c) 2013-2020 Felipe Daragon 5 | License: MIT (http://opensource.org/licenses/mit-license.php) 6 | } 7 | 8 | interface 9 | 10 | uses 11 | Classes, SysUtils, Windows, lua, plua, LuaObject, UndImporter, UndConst, CatStrings, 12 | quickjs, UndHelper_QJS, UndHelper_Obj, UndConsole, CatLogger; 13 | 14 | function JavaScriptQuick_Run(L: Plua_State): integer; cdecl; 15 | 16 | implementation 17 | 18 | function eval_buf(ctx : JSContext; Buf : PAnsiChar; buf_len : Integer; filename : PAnsiChar; eval_flags : Integer): Integer; 19 | var 20 | val : JSValue; 21 | exp: JSValue; 22 | begin 23 | val := JS_Eval(ctx, buf, buf_len, filename, eval_flags); 24 | if JS_IsException(val) then 25 | begin 26 | if rudRedirectIO = false then begin 27 | js_std_dump_error(ctx); 28 | end else begin 29 | exp := JS_GetException(ctx); 30 | if JS_IsError(ctx,exp) then 31 | uConsoleErrorLn(Undhelper.LuaState, -1,JS_ToCString(ctx, exp)); 32 | JS_FreeValue(ctx, exp); 33 | end; 34 | Result := -1; 35 | end 36 | else 37 | Result := 0; 38 | JS_FreeValue(ctx, val); 39 | end; 40 | 41 | function eval_file(ctx : JSContext; filename : PAnsiChar; eval_flags : Integer): Integer; 42 | var 43 | buf_len : size_t; 44 | Buf : Pointer; 45 | begin 46 | buf := js_load_file(ctx, @buf_len, filename); 47 | if not Assigned(buf) then 48 | begin 49 | Writeln('Error While Loading : ',filename); 50 | exit(1); 51 | end; 52 | Result := eval_buf(ctx, buf, buf_len, filename, eval_flags); 53 | js_free(ctx, buf); 54 | end; 55 | 56 | function eval_string(ctx : JSContext; script : PAnsiChar; eval_flags : Integer): Integer; 57 | begin 58 | Result := eval_buf(ctx, script, length(script), '_script.js', eval_flags); 59 | end; 60 | 61 | function printme(ctx : JSContext; {%H-}this_val : JSValueConst; argc : Integer; argv : PJSValueConstArr): JSValue; cdecl; 62 | var 63 | i , argcount: Integer; 64 | str : PAnsiChar; 65 | begin 66 | for i := 0 to Pred(argc) do 67 | begin 68 | if i <> 0 then 69 | uConsoleWrite(undhelper.LuaState, ' '); 70 | str := JS_ToCString(ctx, argv[i]); 71 | if not Assigned(str) then 72 | exit(JS_EXCEPTION); 73 | uConsoleWrite(undhelper.LuaState, str); 74 | JS_FreeCString(ctx, str); 75 | end; 76 | uConsoleWriteln(undhelper.LuaState, ''); 77 | Result := JS_UNDEFINED; 78 | end; 79 | 80 | procedure RunCode(script:string); 81 | var 82 | rt : JSRuntime; 83 | ctx : JSContext; 84 | m : JSModuleDef; 85 | global : JSValue; 86 | filename : PAnsiChar; 87 | const 88 | std_hepler : PAnsiChar = 89 | 'import * as std from ''std'';'#10+ 90 | 'import * as os from ''os'';'#10+ 91 | 'import * as Cmu from ''Cmu'';'#10+ // Underscript's Custom Module 92 | 'globalThis.std = std;'#10+ 93 | 'globalThis.os = os;'#10+ 94 | 'globalThis.Cmu = Cmu;'#10+ 95 | 'globalThis.UConsole = new Cmu.GetConsole();'; 96 | begin 97 | rt := JS_NewRuntime; 98 | if Assigned(rt) then 99 | begin 100 | ctx := JS_NewContext(rt); 101 | if Assigned(rt) then 102 | begin 103 | // ES6 Module loader. 104 | JS_SetModuleLoaderFunc(rt, nil, @js_module_loader, nil); 105 | 106 | js_std_add_helpers(ctx,0,nil); 107 | js_init_module_std(ctx, 'std'); 108 | js_init_module_os(ctx, 'os'); 109 | 110 | { 111 | Functions init order is important 112 | cuz i init the class and it's obj's and constructor in 113 | RegisterNativeClass then i just point the Module constructor to the same one. 114 | } 115 | 116 | // Register with global object directly . 117 | RegisterNativeClass(ctx); 118 | 119 | // Register with module 120 | m := JS_NewCModule(ctx, PAnsiChar('Cmu'), @Emu_init); 121 | JS_AddModuleExport(ctx,m, PAnsiChar('GetConsole')); 122 | 123 | eval_buf(ctx, std_hepler, {$IFDEF FPC}strlen{$ELSE}lstrlenA{$ENDIF}(std_hepler), '', JS_EVAL_TYPE_MODULE); 124 | 125 | global := JS_GetGlobalObject(ctx); 126 | // Define a function in the global context. 127 | JS_SetPropertyStr(ctx,global,'print',JS_NewCFunction(ctx, @printme, 'print', 1)); 128 | JS_FreeValue(ctx, global); 129 | 130 | //filename :=PAnsiChar(AnsiString(ParamStr(1))); 131 | //eval_file(ctx,filename,JS_EVAL_TYPE_GLOBAL or JS_EVAL_TYPE_MODULE); 132 | eval_string(ctx,PAnsiChar(AnsiString(script)),JS_EVAL_TYPE_GLOBAL or JS_EVAL_TYPE_MODULE); 133 | 134 | js_std_loop(ctx); 135 | 136 | js_std_free_handlers(rt); 137 | JS_FreeContext(ctx); 138 | end; 139 | JS_FreeRuntime(rt); 140 | end; 141 | end; 142 | 143 | function JavaScriptQuick_Run(L: Plua_State): integer; cdecl; 144 | var 145 | r: TUndScriptResult; 146 | script: string; 147 | importer: TUndImporter; 148 | sw: TCatStopWatch; 149 | begin 150 | if plua_validateargs(L, result, [LUA_TSTRING]).OK = false then 151 | Exit; 152 | r.success := true; 153 | undhelper.LuaState := L; 154 | sw := CatStopWatchNew; 155 | 156 | importer := TUndImporter.Create(L); 157 | importer.EnableDebug:=false; 158 | script := lua_tostring(L, 1); 159 | script := importer.GetScript(L, script, langint_JSQuick).completescript; 160 | try 161 | RunCode(script); 162 | except 163 | on E: Exception do begin 164 | r.success := false; 165 | r.errormessage := E.Message; 166 | uConsoleErrorLn(L, -1, 'JS: ' + E.Message); 167 | end; 168 | end; 169 | 170 | importer.free; 171 | Und_PushScriptResult(L, r, sw); 172 | result := 1; 173 | end; 174 | 175 | end. 176 | -------------------------------------------------------------------------------- /src/uJavaScript_SM.pas: -------------------------------------------------------------------------------- 1 | unit uJavaScript_SM; 2 | { 3 | UnderScript JavaScript SpiderMonkey Wrapper 4 | Copyright (c) 2013-2020 Felipe Daragon 5 | License: MIT (http://opensource.org/licenses/mit-license.php) 6 | } 7 | 8 | interface 9 | 10 | uses 11 | Classes, SysUtils, lua, plua, LuaObject, UndImporter, UndConsole, UndConst, 12 | CatStrings, js15decl,jsintf, UndHelper_Obj, vcl.dialogs, CatLogger; 13 | 14 | type 15 | [JSClassName('UConsole')] 16 | {$METHODINFO ON} 17 | { TUndJavaScriptSM = class(TJSClass) 18 | public 19 | //State: Plua_State; 20 | procedure WriteLn(s: String); 21 | end; } 22 | 23 | TJSGlobalFunctions = class 24 | class procedure print(s: string); 25 | end; 26 | {$METHODINFO OFF} 27 | 28 | function JavaScriptSM_Run(L: Plua_State): integer; cdecl; 29 | 30 | implementation 31 | 32 | function JavaScriptSM_Run(L: Plua_State): integer; cdecl; 33 | var 34 | eng: TJSEngine; 35 | r: TUndScriptResult; 36 | script: string; 37 | importer: TUndImporter; 38 | sw: TCatStopWatch; 39 | begin 40 | sw := CatStopWatchNew; 41 | r.success := true; 42 | eng := TJSEngine.Create; 43 | eng.registerGlobalFunctions(TJSGlobalFunctions); 44 | eng.registerClasses([TUndHelper]); 45 | TJSClass.CreateJSObject(UndHelper, eng, 'UConsole', [cfaInheritedMethods, cfaInheritedProperties]); 46 | UndHelper.LuaState := L; 47 | importer := TUndImporter.Create(L); 48 | importer.EnableDebug:=false; 49 | script := lua_tostring(L, 1); 50 | script := importer.GetScript(L, script, langint_JSSpiderMonkey).completescript; 51 | try 52 | eng.Evaluate(script); 53 | except 54 | on E: Exception do begin 55 | r.success := false; 56 | r.errormessage := E.Message; 57 | uConsoleErrorLn(L, -1, 'JS: ' + E.Message); 58 | end; 59 | end; 60 | importer.free; 61 | eng.Free; 62 | r.elapsedtime := GetStopWatchElapsedTime(sw).MsAsString; 63 | Und_PushScriptResult(L, r, sw); 64 | result := 1; 65 | end; 66 | 67 | {procedure TUndJavaScriptSM.WriteLn(s: String); 68 | begin 69 | UndHelper.WriteLn(s); 70 | end; } 71 | 72 | class procedure TJSGlobalFunctions.print(s: string); 73 | begin 74 | UndHelper.WriteLn(s); 75 | end; 76 | 77 | end. 78 | -------------------------------------------------------------------------------- /src/uJavaScript_V8.pas: -------------------------------------------------------------------------------- 1 | unit uJavaScript_V8; 2 | { 3 | UnderScript V8 Wrapper 4 | Copyright (c) 2013-2020 Felipe Daragon 5 | License: MIT (http://opensource.org/licenses/mit-license.php) 6 | } 7 | 8 | interface 9 | 10 | uses 11 | Classes, SysUtils, lua, plua, LuaObject, UndImporter, UndConst, 12 | UndConsole, CatCSUtils, 13 | CatStrings, UndHelper_Obj, CatLogger, v8wrapper; 14 | 15 | function JavaScriptV8_Run(L: Plua_State): integer; cdecl; 16 | function RunJSPersistent(L: Plua_State; const script: string):string; 17 | 18 | implementation 19 | 20 | var 21 | feng : Tv8Engine; 22 | fglobal: Iv8Object; 23 | ftemplate: Tv8ObjectTemplate; 24 | fobj: Iv8Object; 25 | 26 | procedure v8_cleanpersistent; 27 | begin 28 | if feng = nil then 29 | Exit; 30 | // leaving 31 | ftemplate.Free; 32 | fglobal := nil; 33 | fobj := nil; 34 | feng.leave; 35 | feng.Free; 36 | end; 37 | 38 | function RunJSPersistent(L: Plua_State; const script: string):string; 39 | begin 40 | if feng = nil then begin 41 | feng := Tv8Engine.Create; // create engine 42 | feng.enter; 43 | fglobal := feng.GlobalObject; 44 | 45 | ftemplate := feng.RegisterRttiClass(TUndHelper); 46 | fobj := ftemplate.CreateInstance(UndHelper); 47 | fglobal.SetObject(rudLibName, fobj); 48 | end; 49 | UndHelper.LuaState := L; 50 | result := feng.eval(script); 51 | end; 52 | 53 | function RunJS(L: Plua_State; const script: string):string; 54 | var 55 | eng : Tv8Engine; 56 | global: Iv8Object; 57 | template: Tv8ObjectTemplate; 58 | obj: Iv8Object; 59 | begin 60 | eng := Tv8Engine.Create; // create engine 61 | eng.enter; 62 | global := eng.GlobalObject; 63 | 64 | template := eng.RegisterRttiClass(TUndHelper); 65 | obj := template.CreateInstance(UndHelper); 66 | global.SetObject(rudLibName, obj); 67 | 68 | result := eng.eval(script); 69 | 70 | // leaving 71 | template.Free; 72 | global := nil; 73 | obj := nil; 74 | eng.leave; 75 | eng.Free; 76 | end; 77 | 78 | function JavaScriptV8_Run(L: Plua_State): integer; cdecl; 79 | var 80 | r: TUndScriptResult; 81 | script: string; 82 | importer: TUndImporter; 83 | sw : TCatStopWatch; 84 | begin 85 | sw := CatStopWatchNew; 86 | r.success := true; 87 | UndHelper.LuaState := L; 88 | importer := TUndImporter.Create(L); 89 | importer.EnableDebug := false; 90 | script := lua_tostring(L, 1); 91 | script := importer.GetScript(L, script, langint_V8).completescript; 92 | try 93 | r.expressionresult := runjs(L, script); 94 | except 95 | on E: Exception do 96 | begin 97 | r.success := false; 98 | r.errormessage := E.Message; 99 | uConsoleErrorLn(L, -1, 'JS: ' + E.Message); 100 | end; 101 | end; 102 | if beginswith(trim(r.expressionresult), ['Error:', 'RangeError:', 'ReferenceError:', 103 | 'SyntaxError:', 'TypeError:']) 104 | then begin 105 | r.success := false; 106 | r.errormessage := r.expressionresult; 107 | uConsoleErrorLn(L, -1, 'JS: ' + r.expressionresult); 108 | end; 109 | 110 | 111 | importer.Free; 112 | Und_PushScriptResult(L, r, sw); 113 | Result := 1; 114 | end; 115 | 116 | initialization 117 | v8_init; // initialize v8 library 118 | 119 | finalization 120 | v8_cleanpersistent; 121 | // v8_cleanup; leave clean-up for the engine itself 122 | 123 | end. 124 | -------------------------------------------------------------------------------- /src/v8.dpr: -------------------------------------------------------------------------------- 1 | library v8; 2 | 3 | { 4 | UnderScript V8 Lua library 5 | Copyright (c) 2013-2020 Felipe Daragon 6 | License: MIT (http://opensource.org/licenses/mit-license.php) 7 | 8 | This library extends Underscript to run JavaScript using the V8 engine 9 | } 10 | 11 | {$I Underscript.inc} 12 | {$I CatCompactLib.inc} 13 | 14 | uses 15 | SysUtils, Lua, pLua, pLuaTable, UndConst, UndConsole, 16 | uJavaScript_V8, CatHTTP, 17 | v8wrapper in 'thirdparty\js_v8\v8wrapper.pas', 18 | CatStrings, CatFiles; 19 | 20 | 21 | {$R *.res} 22 | 23 | function lua_javascriptv8_run(L: Plua_State): integer; cdecl; 24 | begin 25 | if plua_validateargs(L, Result, [LUA_TSTRING]).OK then begin 26 | ReadScriptSettings(L); 27 | result := JavaScriptV8_Run(L); 28 | end; 29 | end; 30 | 31 | function lua_module_funccall(L: plua_State): integer; cdecl; 32 | var 33 | vlibname, vfieldname, res, params, js: string; 34 | i, argcount, luatype: integer; 35 | begin 36 | vlibname := lua_tostring(L, lua_upvalueindex(1)); 37 | vfieldname := lua_tostring(L, lua_upvalueindex(2)); 38 | vlibname := getvalidcompname(vlibname); 39 | vfieldname := getvalidcompname(vfieldname); 40 | argcount := lua_gettop(L); 41 | params := emptystr; 42 | for i := 1 to argcount do 43 | begin 44 | luatype := lua_type(L, i); 45 | case luatype of 46 | LUA_TSTRING: 47 | CatAppendStr(params,'"'+JSONStringEscape(lua_tostring(L, i))+'"'); 48 | LUA_TNUMBER: 49 | CatAppendStr(params,lua_tostring(L, i)); 50 | LUA_TBOOLEAN: 51 | CatAppendStr(params,lua_tostring(L, i)); 52 | end; 53 | end; 54 | js := vlibname+'.'+vfieldname+'('+params+');'; 55 | res := RunJSPersistent(L, js); 56 | lua_pushstring(L, res); 57 | {argcount := j.GetValue('resc', 0); 58 | for i := 1 to argcount do 59 | begin 60 | plua_pushvariant(L, j.Values['res' + inttostr(i - 1) + 'value']); 61 | end; } 62 | result := 1; 63 | end; 64 | 65 | function lua_module_reader(L: plua_State): integer; cdecl; 66 | var 67 | vlibname, vfieldname, json: string; 68 | begin 69 | vlibname := lua_tostring(L, lua_upvalueindex(1)); 70 | json := lua_tostring(L, lua_upvalueindex(2)); 71 | vfieldname := lua_tostring(L, 2); 72 | 73 | lua_pushstring(L, vlibname); 74 | lua_pushstring(L, vfieldname); 75 | lua_pushcclosure(L, lua_module_funccall, 2); 76 | result := 1; 77 | end; 78 | 79 | function lua_module_writer(L: plua_State): integer; cdecl; 80 | begin 81 | result := 0; 82 | end; 83 | 84 | function lua_require_js(L: plua_State): integer; cdecl; 85 | var 86 | tidx: integer; 87 | json, jsmodulename: string; 88 | module: TCrossModuleCheckResult; 89 | begin 90 | result := 0; 91 | ReadScriptSettings(L); 92 | json := emptystr; 93 | jsmodulename := CleanFilename(lua_tostring(L, 1)); 94 | module := uConsoleCrossModuleExists(L, jsmodulename, 'js'); 95 | if module.Exists = false then 96 | exit; 97 | 98 | RunJSPersistent(L, module.Script); 99 | lua_newtable(L); 100 | tidx := lua_gettop(L); 101 | lua_pushstring(L, '__index'); 102 | lua_pushstring(L, jsmodulename); 103 | lua_pushstring(L, json); 104 | lua_pushcclosure(L, lua_module_reader, 2); 105 | lua_rawset(L, tidx); 106 | 107 | lua_pushstring(L, '__newindex'); 108 | lua_pushstring(L, jsmodulename); 109 | lua_pushstring(L, json); 110 | lua_pushcclosure(L, lua_module_writer, 2); 111 | lua_rawset(L, tidx); 112 | 113 | lua_pushvalue(L, -1); 114 | lua_setmetatable(L, -2); 115 | result := 1; 116 | end; 117 | 118 | function luaopen_Underscript_v8(L: plua_State): integer; cdecl; 119 | begin 120 | RegisterCrossRequire(L, 'js', lua_require_js); 121 | result := RegisterScriptEngine(L, 'js', 'v8', lua_javascriptv8_run); 122 | end; 123 | 124 | Exports 125 | luaopen_Underscript_v8; 126 | 127 | begin 128 | 129 | end. 130 | -------------------------------------------------------------------------------- /src/v8.local: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /src/v8.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exlunaproject/underscript/4027d1750f105d1345fbee0323c504b3c92c3eb2/src/v8.res --------------------------------------------------------------------------------