From 749c609a32aace5376853af643b7d8ebbe012921 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Tue, 9 Jul 2019 04:59:12 +0000 Subject: [PATCH] Update JSDoc --- .../Engines_Wine_Engine_Object_script.js.html | 585 +++++++++--------- docs/jsdoc/Wine.html | 71 ++- 2 files changed, 354 insertions(+), 302 deletions(-) diff --git a/docs/jsdoc/Engines_Wine_Engine_Object_script.js.html b/docs/jsdoc/Engines_Wine_Engine_Object_script.js.html index 6e6b907020..83f74ec745 100644 --- a/docs/jsdoc/Engines_Wine_Engine_Object_script.js.html +++ b/docs/jsdoc/Engines_Wine_Engine_Object_script.js.html @@ -33,336 +33,361 @@

Source: Engines/Wine/Engine/Object/script.js

include("utils.functions.net.resource"); /* exported LATEST_STABLE_VERSION */ -var LATEST_STABLE_VERSION = "4.0.1"; +const LATEST_STABLE_VERSION = "4.0.1"; /* exported LATEST_DEVELOPMENT_VERSION */ -var LATEST_DEVELOPMENT_VERSION = "4.11"; +const LATEST_DEVELOPMENT_VERSION = "4.11"; /* exported LATEST_STAGING_VERSION */ -var LATEST_STAGING_VERSION = "4.11"; +const LATEST_STAGING_VERSION = "4.11"; /* exported LATEST_DOS_SUPPORT_VERSION */ -var LATEST_DOS_SUPPORT_VERSION = "4.0"; +const LATEST_DOS_SUPPORT_VERSION = "4.0"; + +const FilenameUtils = Java.type("org.apache.commons.io.FilenameUtils"); /** * Wine main prototype - * @constructor */ -function Wine() { - this._implementation = new WineEngine(); - this._OperatingSystemFetcher = Bean("operatingSystemFetcher"); -} +// eslint-disable-next-line no-unused-vars +class Wine { + constructor() { + this._implementation = new WineEngine(); -/** -* -* @returns {string} architecture ("x86" or "amd64") -*/ -Wine.prototype.architecture = function () { - // get - if (arguments.length == 0) { + this.configFactory = Bean("compatibleConfigFileFormatFactory"); + this.operatingSystemFetcher = Bean("operatingSystemFetcher"); + } + + /** + * + * @returns {string} architecture ("x86" or "amd64") + */ + architecture() { if (fileExists(this.prefixDirectory())) { - var configFactory = Bean("compatibleConfigFileFormatFactory"); - var containerConfiguration = configFactory.open(this.prefixDirectory() + "/phoenicis.cfg"); - var architecture = containerConfiguration.readValue("wineArchitecture", "x86"); + const containerConfiguration = this.configFactory.open(this.prefixDirectory() + "/phoenicis.cfg"); + const architecture = containerConfiguration.readValue("wineArchitecture", "x86"); + return architecture; + } else { + throw new Error(`Wine prefix "${this.prefixDirectory()}" does not exist!`); } - else { - print("Wine prefix \"" + this.prefixDirectory() + "\" does not exist!"); - return ""; + } + + /** + * + * @param {SetupWizard} [wizard] + * @returns {SetupWizard|Wine} + */ + wizard(wizard) { + // get + if (arguments.length == 0) { + return this._implementation.getWizard(); } + + // set + this._implementation.setWizard(wizard); + return this; } -}; -/** -* -* @param {SetupWizard} [wizard] -* @returns {SetupWizard|Wine} -*/ -Wine.prototype.wizard = function (wizard) { - // get - if (arguments.length == 0) { - return this._implementation.getWizard(); + /** + * @param {String} [path] + * @returns {String} + */ + winepath(path) { + return this.run("winepath", ["-w", path], this.prefixDirectory(), true, true); } - // set - this._implementation.setWizard(wizard); - return this; -}; + /** + * + * @param {string} [prefix] + * @param {string} [distribution] + * @param {string} [architecture] + * @param {string} [version] + * @returns {string|Wine} + */ + prefix(prefix, distribution, architecture, version) { + // get + if (arguments.length == 0) { + return this._implementation.getWorkingContainer(); + } -/** - * @param {String} [path] - * @returns {String} - */ -Wine.prototype.winepath = function (path) { - return this.run("winepath", ["-w", path], this.prefixDirectory(), true, true); -} + // set + else if (arguments.length == 1) { + this._implementation.setWorkingContainer(prefix); + } else { + const operatingSystem = this.operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage(); + const subCategory = distribution + "-" + operatingSystem + "-" + architecture; + + this._implementation.createContainer(subCategory, version, prefix); + this._implementation.setWorkingContainer(prefix); + } -/** -* -* @param {string} [prefix] -* @param {string} [distribution] -* @param {string} [architecture] -* @param {string} [version] -* @returns {string|Wine} -*/ -Wine.prototype.prefix = function (prefix, distribution, architecture, version) { - // get - if (arguments.length == 0) { - return this._implementation.getWorkingContainer(); - } - // set - else if (arguments.length == 1) { - this._implementation.setWorkingContainer(prefix); return this; } - else { - var operatingSystem = this._OperatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage(); - var subCategory = distribution + "-" + operatingSystem + "-" + architecture; - this._implementation.createContainer(subCategory, version, prefix); - this._implementation.setWorkingContainer(prefix); - return this; + + /** + * returns prefix directory + * @returns {string} + */ + prefixDirectory() { + return this._implementation.getContainerDirectory(this._implementation.getWorkingContainer()); } -}; -/** -* returns prefix directory -* @returns {string} -*/ -Wine.prototype.prefixDirectory = function () { - return this._implementation.getContainerDirectory(this._implementation.getWorkingContainer()); -}; + /** + * returns the path to the engine binary directory + * if no parameters are given, the Wine version of the current prefix is used + * @param {string} [subCategory] Wine sub-category + * @param {string} [version] Wine version + * @returns {string} path to "wine" binary + */ + binPath(subCategory, version) { + if (0 == arguments.length) { + if (fileExists(this.prefixDirectory())) { + const containerConfiguration = this.configFactory.open(this.prefixDirectory() + "/phoenicis.cfg"); + + const distribution = containerConfiguration.readValue("wineDistribution", "upstream"); + const architecture = containerConfiguration.readValue("wineArchitecture", "x86"); + + const operatingSystem = this.operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage(); + + subCategory = distribution + "-" + operatingSystem + "-" + architecture; + version = containerConfiguration.readValue("wineVersion"); + } else { + throw new Error(`Wine prefix "${this.prefixDirectory()}" does not exist!`); + } + } -/** -* returns the path to the engine binary directory -* if no parameters are given, the Wine version of the current prefix is used -* @param {string} [subCategory] Wine sub-category -* @param {string} [version] Wine version -* @returns {string} path to "wine" binary -*/ -Wine.prototype.binPath = function (subCategory, version) { - if (0 == arguments.length) { - if (fileExists(this.prefixDirectory())) { - var configFactory = Bean("compatibleConfigFileFormatFactory"); - var containerConfiguration = configFactory.open(this.prefixDirectory() + "/phoenicis.cfg"); - var distribution = containerConfiguration.readValue("wineDistribution", "upstream"); - var architecture = containerConfiguration.readValue("wineArchitecture", "x86"); - var operatingSystem = this._OperatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage(); - subCategory = distribution + "-" + operatingSystem + "-" + architecture; - version = containerConfiguration.readValue("wineVersion"); + return this._implementation.getLocalDirectory(subCategory, version) + "/bin/"; + } + + /** + * + * @param {string} executable + * @param {array} [args = []] + * @param {boolean} [wait=false] + */ + runInsidePrefix(executable, args, wait) { + if (!args) { + args = []; + } else if (typeof args === "string" || args instanceof String) { + args = [args]; } - else { - print("Wine prefix \"" + this.prefixDirectory() + "\" does not exist!"); - return ""; + + if (!wait) { + wait = false; } - } - return this._implementation.getLocalDirectory(subCategory, version) + "/bin/"; -}; -/** -* -* @param {string} executable -* @param {array} [args = []] -* @param {boolean} [wait=false] -*/ -Wine.prototype.runInsidePrefix = function (executable, args, wait) { - if (!args) { - args = []; - } else if (typeof args === 'string' || args instanceof String) { - args = [args]; + return this.run(this.prefixDirectory() + "/drive_c/" + executable, args, this.prefixDirectory(), false, wait); } - if (!wait) { - wait = false; - } - return this.run(this.prefixDirectory() + "/drive_c/" + executable, args, this.prefixDirectory(), false, wait); -}; -/** -* -* @param executable -* @param {array} [args = []] -* @param {string} [workingDirectory = working container] -* @param {boolean} [captureOutput=false] -* @param {boolean} [wait=false] -* @param {map} [userData=empty] -* @returns {String} output -*/ -Wine.prototype.run = function (executable, args, workingDirectory, captureOutput, wait, userData) { - if (!args) { - args = []; - } else if (typeof args === 'string' || args instanceof String) { - args = [args]; - } - if (!workingDirectory) { - workingDirectory = this._implementation.getContainerDirectory(this._implementation.getWorkingContainer()) + "/drive_c"; + /** + * + * @param {string} executable + * @param {array} [args = []] + * @param {string} [workingDirectory = working container] + * @param {boolean} [captureOutput=false] + * @param {boolean} [wait=false] + * @param {map} [userData=empty] + * @returns {String} output + */ + run(executable, args, workingDirectory, captureOutput, wait, userData) { + if (!args) { + args = []; + } else if (typeof args === "string" || args instanceof String) { + args = [args]; + } + if (!workingDirectory) { + workingDirectory = + this._implementation.getContainerDirectory(this._implementation.getWorkingContainer()) + "/drive_c"; + } + if (!captureOutput) { + captureOutput = false; + } + if (!wait) { + wait = false; + } + if (!userData) { + userData = []; + } + + return this._implementation.run(executable, args, workingDirectory, captureOutput, wait, userData); } - if (!captureOutput) { - captureOutput = false; + + /** + * uninstall application + * @param {string} name of the application which shall be uninstalled + * @returns {bool} true if an application has been uninstalled, false otherwise + */ + uninstall(application) { + const list = this.run("uninstaller", ["--list"], this.prefixDirectory(), true, true); + const appEscaped = application.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + const re = new RegExp("(.*)\\|\\|\\|.*" + appEscaped); + const uuid = list.match(re); + if (uuid) { + this._implementation.getWizard().wait(tr("Please wait while {0} is uninstalled...", application)); + this.run("uninstaller", ["--remove", uuid[1]], this.prefixDirectory(), false, true); + + return true; + } else { + print(tr("Could not uninstall {0}!", application)); + + return false; + } } - if (!wait) { - wait = false; + + /** + * runs "wineboot" + * + * @returns {Wine} The Wine object + */ + create() { + this.run("wineboot", [], this.prefixDirectory(), false, true); + + return this; } - if (!userData) { - userData = []; + + /** + * + * @returns {string} name of "Program Files" + */ + programFiles() { + const programFilesName = this.run( + "cmd", + ["/c", "echo", "%ProgramFiles%"], + this.prefixDirectory(), + true, + true + ).trim(); + + if (programFilesName == "%ProgramFiles%") { + return "Program Files"; + } else { + return FilenameUtils.getBaseName(programFilesName); + } } - return this._implementation.run(executable, args, workingDirectory, captureOutput, wait, userData); -} + /** + * executes wineserver in current prefix + * @param {string} wineserver parameter + */ + wineServer(parameter) { + const workingContainerDirectory = this.prefixDirectory(); -/** -* uninstall application -* @param {string} name of the application which shall be uninstalled -* @returns {bool} true if an application has been uninstalled, false otherwise -*/ -Wine.prototype.uninstall = function (application) { - var list = this.run("uninstaller", ["--list"], this.prefixDirectory(), true, true); - var appEscaped = application.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); - var re = new RegExp("(.*)\\|\\|\\|.*" + appEscaped); - var uuid = list.match(re); - if (uuid) { - this._implementation.getWizard().wait(tr("Please wait while {0} is uninstalled...", application)); - this.run("uninstaller", ["--remove", uuid[1]], this.prefixDirectory(), false, true); - return true; - } else { - print(tr("Could not uninstall {0}!", application)); - return false; - } -}; + if (fileExists(workingContainerDirectory)) { + const containerConfiguration = this.configFactory.open(workingContainerDirectory + "/phoenicis.cfg"); -/** -* runs "wineboot" -*/ -Wine.prototype.create = function () { - this.run("wineboot", [], this.prefixDirectory(), false, true); - return this; -}; + const distribution = containerConfiguration.readValue("wineDistribution", "upstream"); + const architecture = containerConfiguration.readValue("wineArchitecture", "x86"); + const version = containerConfiguration.readValue("wineVersion"); -/** -* -* @returns {string} name of "Program Files" -*/ -Wine.prototype.programFiles = function () { - var programFilesName = this.run("cmd", ["/c", "echo", "%ProgramFiles%"], this.prefixDirectory(), true, true).trim(); - if (programFilesName == "%ProgramFiles%") { - return "Program Files" - } else { - return org.apache.commons.io.FilenameUtils.getBaseName(programFilesName); + const operatingSystem = this.operatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage(); + + const subCategory = distribution + "-" + operatingSystem + "-" + architecture; + + const binary = this._implementation.getLocalDirectory(subCategory, version) + "/bin/wineserver"; + + const ProcessBuilderClass = Java.type("java.lang.ProcessBuilder"); + const processBuilder = new ProcessBuilderClass() + .command(Java.to([binary, parameter], "java.lang.String[]")) + .inheritIO(); + + const environment = processBuilder.environment(); + environment.put( + "WINEPREFIX", + this._implementation.getContainerDirectory(this._implementation.getWorkingContainer()) + ); + + const wineServerProcess = processBuilder.start(); + wineServerProcess.waitFor(); + } else { + throw new Error('Wine prefix "' + this.getWorkingContainer() + '" does not exist!'); + } } -}; -/** -* executes wineserver in current prefix -* @param {string} wineserver parameter -*/ -Wine.prototype.wineServer = function (parameter) { - var workingContainerDirectory = this._implementation.getContainerDirectory(this._implementation.getWorkingContainer()); - if (fileExists(workingContainerDirectory)) { - var configFactory = Bean("compatibleConfigFileFormatFactory"); - var containerConfiguration = configFactory.open(workingContainerDirectory + "/phoenicis.cfg"); - var distribution = containerConfiguration.readValue("wineDistribution", "upstream"); - var architecture = containerConfiguration.readValue("wineArchitecture", "x86"); - var operatingSystem = this._OperatingSystemFetcher.fetchCurrentOperationSystem().getWinePackage(); - var subCategory = distribution + "-" + operatingSystem + "-" + architecture; - var version = containerConfiguration.readValue("wineVersion"); - var binary = this._implementation.getLocalDirectory(subCategory, version) + "/bin/wineserver"; - var ProcessBuilderClass = Java.type('java.lang.ProcessBuilder'); - var processBuilder = new ProcessBuilderClass(Java.to([binary, parameter], "java.lang.String[]")); - var environment = processBuilder.environment(); - environment.put("WINEPREFIX", this._implementation.getContainerDirectory(this._implementation.getWorkingContainer())); - processBuilder.inheritIO(); - var wineServerProcess = processBuilder.start(); - wineServerProcess.waitFor(); + /** + * wait until wineserver finishes + * @returns {Wine} + */ + wait() { + this.wineServer("-w"); + + return this; } - else { - print("Wine prefix \"" + this.getWorkingContainer() + "\" does not exist!"); + + /** + * kill wine server + * @returns {Wine} + */ + kill() { + this.wineServer("-k"); + + return this; } -}; -/** -* wait until wineserver finishes -* @returns {Wine} -*/ -Wine.prototype.wait = function () { - this.wineServer("-w"); - return this; -}; + /** + * + * @param {string} [architecture = current architecture] + * @returns {string[]} + */ + availableDistributions(architectureName) { + const architecture = architectureName || this._architecture; + const architectureRegExp = new RegExp(architecture); + + const wineJson = JSON.parse(this._implementation.getAvailableVersions()); + // find all distributions with the right architecture + return wineJson + .filter(distribution => architectureRegExp.test(distribution.name)) + .map(distribution => distribution.name.match(/([a-z]+)-/)[1]) + .sort(); + } -/** -* kill wine server -* @returns {Wine} -*/ -Wine.prototype.kill = function () { - this.wineServer("-k"); - return this; -}; + /** + * + * @param {string} [distribution name = current distribution] + * @returns {string[]} + */ + availableVersions(distributionName) { + const fullDistributionName = distributionName || this._fetchFullDistributionName(); + + const wineJson = JSON.parse(this._implementation.getAvailableVersions()); + + return wineJson + .filter(distribution => distribution.name == fullDistributionName) + .flatMap(distribution => distribution.packages) + .map(winePackage => winePackage.version) + .sort() + .reverse(); + } -/** -* -* @param {string} [architecture = current architecture] -* @returns {string[]} -*/ -Wine.prototype.availableDistributions = function (architectureName) { - var distributions = []; - var wineJson = JSON.parse(this._implementation.getAvailableVersions()); - var architecture = architectureName || this._architecture; - var architectureRegExp = new RegExp(architecture); - wineJson.forEach(function (distribution) { - // only with the right architecture - if (architectureRegExp.test(distribution.name)) { - distributions.push(distribution.name.match(/([a-z]+)-/)[1]); + /** + * + * @returns {string} system32 directory + */ + system32directory() { + if (fileExists(this.prefixDirectory() + "/drive_c/windows/syswow64")) { + return this.prefixDirectory() + "/drive_c/windows/syswow64"; + } else { + return this.prefixDirectory() + "/drive_c/windows/system32"; } - }); - distributions.sort(); - return distributions; -} + } -/** -* -* @param {string} [distribution name = current distribution] -* @returns {string[]} -*/ -Wine.prototype.availableVersions = function (distributionName) { - var versions = []; - var fullDistributionName = distributionName || this._fetchFullDistributionName(); - var wineJson = JSON.parse(this._implementation.getAvailableVersions()); - wineJson.forEach(function (distribution) { - if (distribution.name == fullDistributionName) { - distribution.packages.forEach(function (winePackage) { - versions.push(winePackage.version); - }); + /** + * + * @returns {string} system64 directory + */ + system64directory() { + if (fileExists(this.prefixDirectory() + "/drive_c/windows/syswow64")) { + return this.prefixDirectory() + "/drive_c/windows/system32"; } - }); - versions.sort(); - versions.reverse(); - return versions; -} -/** -* -* @returns {string} system32 directory -*/ -Wine.prototype.system32directory = function () { - if (fileExists(this.prefixDirectory() + "/drive_c/windows/syswow64")) { - return this.prefixDirectory() + "/drive_c/windows/syswow64"; - } else { - return this.prefixDirectory() + "/drive_c/windows/system32"; + throw new Error(tr("Prefix seems to be 32bits")); } -}; -/** -* -* @returns {string} system64 directory -*/ -Wine.prototype.system64directory = function () { - if (fileExists(this.prefixDirectory() + "/drive_c/windows/syswow64")) { - return this.prefixDirectory() + "/drive_c/windows/system32"; + /** + * + * @returns {string} font directory + */ + fontDirectory() { + return this.prefixDirectory() + "/drive_c/windows/Fonts"; } - throw tr("Prefix seems to be 32bits"); -}; - -/** -* -* @returns {string} font directory -*/ -Wine.prototype.fontDirectory = function () { - return this.prefixDirectory() + "/drive_c/windows/Fonts"; -}; +} diff --git a/docs/jsdoc/Wine.html b/docs/jsdoc/Wine.html index 4787c7779b..bc934b3d97 100644 --- a/docs/jsdoc/Wine.html +++ b/docs/jsdoc/Wine.html @@ -30,6 +30,8 @@

Class: Wine

Wine()

+
Wine main prototype
+ @@ -39,6 +41,8 @@

WineConstructor

+

new Wine()

@@ -48,10 +52,6 @@

new Wine - Wine main prototype - - @@ -93,7 +93,7 @@

new WineSource:
@@ -417,7 +417,7 @@

architect
Source:
@@ -702,7 +702,7 @@

Parameters:
Source:
@@ -873,7 +873,7 @@
Parameters:
Source:
@@ -1074,7 +1074,7 @@
Parameters:
Source:
@@ -1402,7 +1402,7 @@
Returns:
-

create()

+

create() → {Wine}

@@ -1454,7 +1454,7 @@

createSource:
@@ -1479,6 +1479,28 @@

createReturns:

+ + +
+ The Wine object +
+ + + +
+
+ Type +
+
+ +Wine + + +
+
+ + @@ -4157,7 +4179,7 @@

fontDire
Source:
@@ -5139,7 +5161,7 @@

killSource:
@@ -6788,7 +6810,7 @@

prefix
Source:
@@ -6890,7 +6912,7 @@

programFi
Source:
@@ -7867,6 +7889,11 @@

Parameters:
+ +string + + + @@ -8121,7 +8148,7 @@
Parameters:
Source:
@@ -8370,7 +8397,7 @@
Parameters:
Source:
@@ -9716,7 +9743,7 @@

syst
Source:
@@ -9822,7 +9849,7 @@

syst
Source:
@@ -10091,7 +10118,7 @@

Parameters:
Source:
@@ -11890,7 +11917,7 @@

waitSource:
@@ -12413,7 +12440,7 @@
Parameters:
Source: