From 488541f26e88b30ca704cf7585a6c4ef793ece39 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Sun, 18 Mar 2018 21:45:25 +0100 Subject: [PATCH 01/69] fixed: click to key window in the background did not bring it forward --- AppKit/CPWindow/CPWindow.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index 1b0171c38..c2dd4e19e 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -1983,7 +1983,7 @@ CPTexturedBackgroundWindowMask var theWindow = [anEvent window], selector = type == CPRightMouseDown ? @selector(rightMouseDown:) : @selector(mouseDown:); - if ([theWindow isKeyWindow] || ([theWindow becomesKeyOnlyIfNeeded] && ![_leftMouseDownView needsPanelToBecomeKey])) + if (([[CPApp orderedWindows] objectAtIndex:0] === self && [theWindow isKeyWindow]) || ([theWindow becomesKeyOnlyIfNeeded] && ![_leftMouseDownView needsPanelToBecomeKey])) return [_leftMouseDownView performSelector:selector withObject:anEvent]; else { From f55fa789c44dd7cd477fb66542defe9a53dabba9 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Sun, 18 Mar 2018 22:33:49 +0100 Subject: [PATCH 02/69] new: manual test for issue 2545 --- .../AppController.j | 42 +++ .../Info.plist | 14 + .../Jakefile | 172 +++++++++ .../Resources/MainMenu.cib | 1 + .../Resources/MainMenu.xib | 345 ++++++++++++++++++ .../index-debug.html | 204 +++++++++++ .../index.html | 166 +++++++++ .../KeyWindowInTheBackgroundActivation/main.j | 18 + 8 files changed, 962 insertions(+) create mode 100644 Tests/Manual/KeyWindowInTheBackgroundActivation/AppController.j create mode 100644 Tests/Manual/KeyWindowInTheBackgroundActivation/Info.plist create mode 100644 Tests/Manual/KeyWindowInTheBackgroundActivation/Jakefile create mode 100644 Tests/Manual/KeyWindowInTheBackgroundActivation/Resources/MainMenu.cib create mode 100644 Tests/Manual/KeyWindowInTheBackgroundActivation/Resources/MainMenu.xib create mode 100644 Tests/Manual/KeyWindowInTheBackgroundActivation/index-debug.html create mode 100644 Tests/Manual/KeyWindowInTheBackgroundActivation/index.html create mode 100644 Tests/Manual/KeyWindowInTheBackgroundActivation/main.j diff --git a/Tests/Manual/KeyWindowInTheBackgroundActivation/AppController.j b/Tests/Manual/KeyWindowInTheBackgroundActivation/AppController.j new file mode 100644 index 000000000..959fc5541 --- /dev/null +++ b/Tests/Manual/KeyWindowInTheBackgroundActivation/AppController.j @@ -0,0 +1,42 @@ +/* + * AppController.j + * WindowFrontTest + * + * Created by You on January 15, 2018. + * Copyright 2018, Your Company All rights reserved. + */ + +@import +@import + + +@implementation AppController : CPObject +{ + @outlet CPWindow theWindow; + @outlet CPWindow window1; + @outlet CPWindow window2; +} + +- (void)applicationDidFinishLaunching:(CPNotification)aNotification +{ + // This is called when the application is done loading. +} + +- (void)awakeFromCib +{ + // This is called when the cib is done loading. + // You can implement this method on any object instantiated from a Cib. + // It's a useful hook for setting up current UI values, and other things. + + // In this case, we want the window from Cib to become our full browser window + [theWindow setFullPlatformWindow:YES]; + + [window1 performSelector:@selector(makeKeyAndOrderFront:) withObject:self afterDelay:0.1]; +} + +- (IBAction)bringWindow2Front:(id)sender +{ + [window2 orderFront:self]; +} + +@end diff --git a/Tests/Manual/KeyWindowInTheBackgroundActivation/Info.plist b/Tests/Manual/KeyWindowInTheBackgroundActivation/Info.plist new file mode 100644 index 000000000..8016aeaa5 --- /dev/null +++ b/Tests/Manual/KeyWindowInTheBackgroundActivation/Info.plist @@ -0,0 +1,14 @@ + + + + + Main cib file base name + MainMenu.cib + CPBundleName + WindowFrontTest + CPBundleVersion + 1.0 + CPHumanReadableCopyright + Copyright © 2018, Your Company All rights reserved. + + diff --git a/Tests/Manual/KeyWindowInTheBackgroundActivation/Jakefile b/Tests/Manual/KeyWindowInTheBackgroundActivation/Jakefile new file mode 100644 index 000000000..f158726dc --- /dev/null +++ b/Tests/Manual/KeyWindowInTheBackgroundActivation/Jakefile @@ -0,0 +1,172 @@ +/* + * Jakefile + * WindowFrontTest + * + * Created by You on January 15, 2018. + * Copyright 2018, Your Company All rights reserved. + */ + +var ENV = require("system").env, + FILE = require("file"), + JAKE = require("jake"), + task = JAKE.task, + FileList = JAKE.FileList, + app = require("cappuccino/jake").app, + configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug", + OS = require("os"), + projectName = "WindowFrontTest"; + +app (projectName, function(task) +{ + ENV["OBJJ_INCLUDE_PATHS"] = "Frameworks"; + + if (configuration === "Debug") + ENV["OBJJ_INCLUDE_PATHS"] = FILE.join(ENV["OBJJ_INCLUDE_PATHS"], configuration); + + task.setBuildIntermediatesPath(FILE.join("Build", "WindowFrontTest.build", configuration)); + task.setBuildPath(FILE.join("Build", configuration)); + + task.setProductName("WindowFrontTest"); + task.setIdentifier("com.yourcompany.WindowFrontTest"); + task.setVersion("1.0"); + task.setAuthor("Your Company"); + task.setEmail("feedback @nospam@ yourcompany.com"); + task.setSummary("WindowFrontTest"); + task.setSources(new FileList("**/*.j").exclude(FILE.join("Build", "**")).exclude(FILE.join("Frameworks", "Source", "**"))); + task.setResources(new FileList("Resources/**")); + task.setIndexFilePath("index.html"); + task.setInfoPlistPath("Info.plist"); + + if (configuration === "Debug") + task.setCompilerFlags("-DDEBUG -g"); + else + task.setCompilerFlags("-O2"); +}); + +task ("default", [projectName], function() +{ + printResults(configuration); +}); + +task ("build", ["default"], function() +{ + updateApplicationSize(); +}); + +task ("debug", function() +{ + configuration = ENV["CONFIGURATION"] = "Debug"; + JAKE.subjake(["."], "build", ENV); +}); + +task ("release", function() +{ + configuration = ENV["CONFIGURATION"] = "Release"; + JAKE.subjake(["."], "build", ENV); +}); + +task ("run", ["debug"], function() +{ + OS.system(["open", FILE.join("Build", "Debug", projectName, "index.html")]); +}); + +task ("run-release", ["release"], function() +{ + OS.system(["open", FILE.join("Build", "Release", projectName, "index.html")]); +}); + +task ("deploy", ["release"], function() +{ + FILE.mkdirs(FILE.join("Build", "Deployment", projectName)); + OS.system(["press", "-f", FILE.join("Build", "Release", projectName), FILE.join("Build", "Deployment", projectName)]); + printResults("Deployment") +}); + +function printResults(configuration) +{ + print("----------------------------"); + print(configuration+" app built at path: "+FILE.join("Build", configuration, projectName)); + print("----------------------------"); +} + +function updateApplicationSize() +{ + print("Calculating application file sizes..."); + + var contents = FILE.read(FILE.join("Build", configuration, projectName, "Info.plist"), { charset:"UTF-8" }), + format = CFPropertyList.sniffedFormatOfString(contents), + plist = CFPropertyList.propertyListFromString(contents), + totalBytes = {executable:0, data:0, mhtml:0}; + + // Get the size of all framework executables and sprite data + var frameworksDir = "Frameworks"; + + if (configuration === "Debug") + frameworksDir = FILE.join(frameworksDir, "Debug"); + + var frameworks = FILE.list(frameworksDir); + + frameworks.forEach(function(framework) + { + if (framework !== "Source") + addBundleFileSizes(FILE.join(frameworksDir, framework), totalBytes); + }); + + // Read in the default theme name, and attempt to get its size + var themeName = plist.valueForKey("CPDefaultTheme") || "Aristo2", + themePath = nil; + + if (themeName === "Aristo" || themeName === "Aristo2") + themePath = FILE.join(frameworksDir, "AppKit", "Resources", themeName + ".blend"); + else + themePath = FILE.join("Frameworks", "Resources", themeName + ".blend"); + + if (FILE.isDirectory(themePath)) + addBundleFileSizes(themePath, totalBytes); + + // Add sizes for the app + addBundleFileSizes(FILE.join("Build", configuration, projectName), totalBytes); + + print("Executables: " + totalBytes.executable + ", sprite data: " + totalBytes.data + ", total: " + (totalBytes.executable + totalBytes.data)); + + var dict = new CFMutableDictionary(); + + dict.setValueForKey("executable", totalBytes.executable); + dict.setValueForKey("data", totalBytes.data); + dict.setValueForKey("mhtml", totalBytes.mhtml); + + plist.setValueForKey("CPApplicationSize", dict); + + FILE.write(FILE.join("Build", configuration, projectName, "Info.plist"), CFPropertyList.stringFromPropertyList(plist, format), { charset:"UTF-8" }); +} + +function addBundleFileSizes(bundlePath, totalBytes) +{ + var bundleName = FILE.basename(bundlePath), + environment = bundleName === "Foundation" ? "Objj" : "Browser", + bundlePath = FILE.join(bundlePath, environment + ".environment"); + + if (FILE.isDirectory(bundlePath)) + { + var filename = bundleName + ".sj", + filePath = new FILE.Path(FILE.join(bundlePath, filename)); + + if (filePath.exists()) + totalBytes.executable += filePath.size(); + + filePath = new FILE.Path(FILE.join(bundlePath, "dataURLs.txt")); + + if (filePath.exists()) + totalBytes.data += filePath.size(); + + filePath = new FILE.Path(FILE.join(bundlePath, "MHTMLData.txt")); + + if (filePath.exists()) + totalBytes.mhtml += filePath.size(); + + filePath = new FILE.Path(FILE.join(bundlePath, "MHTMLPaths.txt")); + + if (filePath.exists()) + totalBytes.mhtml += filePath.size(); + } +} diff --git a/Tests/Manual/KeyWindowInTheBackgroundActivation/Resources/MainMenu.cib b/Tests/Manual/KeyWindowInTheBackgroundActivation/Resources/MainMenu.cib new file mode 100644 index 000000000..20d490fd8 --- /dev/null +++ b/Tests/Manual/KeyWindowInTheBackgroundActivation/Resources/MainMenu.cib @@ -0,0 +1 @@ +280NPLIST;1.0;D;K;4;$topD;K;18;CPCibObjectDataKeyD;K;6;CP$UIDd;1;2E;E;K;8;$objectsA;S;5;$nullD;K;10;$classnameS;16;_CPCibObjectDataK;8;$classesA;S;16;_CPCibObjectDataS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;1E;K;28;_CPCibObjectDataNamesKeysKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataNamesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataClassesKeysKeyD;K;6;CP$UIDd;1;0E;K;32;_CPCibObjectDataClassesValuesKeyD;K;6;CP$UIDd;1;0E;K;30;_CPCibObjectDataConnectionsKeyD;K;6;CP$UIDd;1;4E;K;28;_CPCibObjectDataFrameworkKeyD;K;6;CP$UIDd;1;0E;K;26;_CPCibObjectDataNextOidKeyD;K;6;CP$UIDd;1;5E;K;30;_CPCibObjectDataObjectsKeysKeyD;K;6;CP$UIDd;1;6E;K;32;_CPCibObjectDataObjectsValuesKeyD;K;6;CP$UIDd;1;7E;K;26;_CPCibObjectDataOidKeysKeyD;K;6;CP$UIDd;1;8E;K;28;_CPCibObjectDataOidValuesKeyD;K;6;CP$UIDd;1;9E;K;28;_CPCibObjectDataFileOwnerKeyD;K;6;CP$UIDd;2;11E;K;33;_CPCibObjectDataVisibleWindowsKeyD;K;6;CP$UIDd;2;13E;E;D;K;10;$classnameS;7;CPArrayK;8;$classesA;S;7;CPArrayS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;15E;D;K;6;CP$UIDd;2;16E;D;K;6;CP$UIDd;2;17E;D;K;6;CP$UIDd;2;18E;D;K;6;CP$UIDd;2;20E;D;K;6;CP$UIDd;2;21E;D;K;6;CP$UIDd;2;22E;D;K;6;CP$UIDd;2;23E;D;K;6;CP$UIDd;2;24E;D;K;6;CP$UIDd;2;25E;D;K;6;CP$UIDd;2;26E;D;K;6;CP$UIDd;2;27E;D;K;6;CP$UIDd;2;28E;D;K;6;CP$UIDd;2;29E;D;K;6;CP$UIDd;2;30E;D;K;6;CP$UIDd;2;31E;D;K;6;CP$UIDd;2;32E;D;K;6;CP$UIDd;2;33E;D;K;6;CP$UIDd;2;34E;D;K;6;CP$UIDd;2;35E;D;K;6;CP$UIDd;2;36E;D;K;6;CP$UIDd;2;37E;D;K;6;CP$UIDd;2;38E;D;K;6;CP$UIDd;2;39E;D;K;6;CP$UIDd;2;40E;D;K;6;CP$UIDd;2;41E;D;K;6;CP$UIDd;2;42E;D;K;6;CP$UIDd;2;43E;D;K;6;CP$UIDd;2;44E;D;K;6;CP$UIDd;2;45E;D;K;6;CP$UIDd;2;46E;D;K;6;CP$UIDd;2;47E;D;K;6;CP$UIDd;2;48E;D;K;6;CP$UIDd;2;49E;D;K;6;CP$UIDd;2;50E;D;K;6;CP$UIDd;2;51E;D;K;6;CP$UIDd;2;52E;D;K;6;CP$UIDd;2;53E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;54E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;60E;D;K;6;CP$UIDd;2;61E;D;K;6;CP$UIDd;2;62E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;2;64E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;68E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;71E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;76E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;2;80E;D;K;6;CP$UIDd;2;81E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;2;83E;D;K;6;CP$UIDd;2;84E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;87E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;2;90E;D;K;6;CP$UIDd;2;91E;D;K;6;CP$UIDd;2;92E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;94E;D;K;6;CP$UIDd;2;95E;D;K;6;CP$UIDd;2;96E;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;2;98E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;3;100E;D;K;6;CP$UIDd;3;101E;D;K;6;CP$UIDd;3;102E;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;3;104E;D;K;6;CP$UIDd;3;105E;D;K;6;CP$UIDd;3;106E;D;K;6;CP$UIDd;3;107E;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;109E;D;K;6;CP$UIDd;3;110E;D;K;6;CP$UIDd;3;111E;D;K;6;CP$UIDd;3;112E;D;K;6;CP$UIDd;3;113E;D;K;6;CP$UIDd;3;114E;D;K;6;CP$UIDd;3;115E;D;K;6;CP$UIDd;3;116E;D;K;6;CP$UIDd;3;117E;D;K;6;CP$UIDd;3;118E;D;K;6;CP$UIDd;3;119E;D;K;6;CP$UIDd;3;120E;D;K;6;CP$UIDd;3;121E;D;K;6;CP$UIDd;3;122E;D;K;6;CP$UIDd;3;124E;D;K;6;CP$UIDd;3;126E;D;K;6;CP$UIDd;3;127E;D;K;6;CP$UIDd;3;128E;D;K;6;CP$UIDd;3;129E;D;K;6;CP$UIDd;3;131E;D;K;6;CP$UIDd;1;0E;D;K;6;CP$UIDd;3;132E;D;K;6;CP$UIDd;3;133E;D;K;6;CP$UIDd;3;135E;D;K;6;CP$UIDd;1;0E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;59E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;70E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;66E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;2;89E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;2;95E;D;K;6;CP$UIDd;2;96E;D;K;6;CP$UIDd;2;96E;D;K;6;CP$UIDd;2;96E;D;K;6;CP$UIDd;2;96E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;3;101E;D;K;6;CP$UIDd;3;102E;D;K;6;CP$UIDd;3;102E;D;K;6;CP$UIDd;3;102E;D;K;6;CP$UIDd;2;78E;D;K;6;CP$UIDd;3;106E;D;K;6;CP$UIDd;3;107E;D;K;6;CP$UIDd;3;107E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;3;110E;D;K;6;CP$UIDd;3;111E;D;K;6;CP$UIDd;3;111E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;3;114E;D;K;6;CP$UIDd;3;115E;D;K;6;CP$UIDd;3;115E;D;K;6;CP$UIDd;3;115E;D;K;6;CP$UIDd;3;115E;D;K;6;CP$UIDd;2;56E;D;K;6;CP$UIDd;3;120E;D;K;6;CP$UIDd;3;121E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;3;124E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;3;128E;D;K;6;CP$UIDd;3;129E;D;K;6;CP$UIDd;3;131E;D;K;6;CP$UIDd;2;11E;D;K;6;CP$UIDd;3;132E;D;K;6;CP$UIDd;3;133E;D;K;6;CP$UIDd;3;135E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;D;K;10;$classnameS;18;_CPCibCustomObjectK;8;$classesA;S;18;_CPCibCustomObjectS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;3;136E;E;D;K;10;$classnameS;5;CPSetK;8;$classesA;S;5;CPSetS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;12E;K;15;CPSetObjectsKeyD;K;6;CP$UIDd;3;137E;E;D;K;10;$classnameS;20;CPCibOutletConnectorK;8;$classesA;S;20;CPCibOutletConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;11E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;3;127E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;138E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;3;127E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;3;124E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;139E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;3;127E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;3;128E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;140E;E;D;K;6;$classD;K;6;CP$UIDd;2;14E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;3;127E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;3;132E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;141E;E;D;K;10;$classnameS;21;CPCibControlConnectorK;8;$classesA;S;21;CPCibControlConnectorS;14;CPCibConnectorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;3;119E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;142E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;3;116E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;143E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;60E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;11E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;144E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;68E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;145E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;73E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;146E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;74E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;147E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;75E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;148E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;67E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;149E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;3;122E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;150E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;76E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;151E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;71E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;152E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;64E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;2;54E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;153E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;3;109E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;154E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;3;108E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;155E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;83E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;156E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;86E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;157E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;82E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;158E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;98E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;159E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;85E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;160E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;84E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;161E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;97E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;162E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;79E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;163E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;90E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;164E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;94E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;165E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;80E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;166E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;2;99E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;167E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;3;117E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;168E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;3;112E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;169E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;3;113E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;170E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;3;100E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;171E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;3;103E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;172E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;3;104E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;173E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;3;105E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;1;0E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;174E;E;D;K;6;$classD;K;6;CP$UIDd;2;19E;K;24;_CPCibConnectorSourceKeyD;K;6;CP$UIDd;3;131E;K;29;_CPCibConnectorDestinationKeyD;K;6;CP$UIDd;3;127E;K;23;_CPCibConnectorLabelKeyD;K;6;CP$UIDd;3;175E;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;3;136E;E;D;K;10;$classnameS;6;CPMenuK;8;$classesA;S;6;CPMenuS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;55E;K;14;CPMenuTitleKeyD;K;6;CP$UIDd;3;176E;K;13;CPMenuNameKeyD;K;6;CP$UIDd;3;177E;K;14;CPMenuItemsKeyD;K;6;CP$UIDd;3;178E;E;D;K;10;$classnameS;10;CPMenuItemK;8;$classesA;S;10;CPMenuItemS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;179E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;2;59E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;3;180E;K;20;CPMenuItemSubmenuKeyD;K;6;CP$UIDd;2;59E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;56E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;55E;K;14;CPMenuTitleKeyD;K;6;CP$UIDd;3;179E;K;13;CPMenuNameKeyD;K;6;CP$UIDd;3;182E;K;14;CPMenuItemsKeyD;K;6;CP$UIDd;3;183E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;184E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;59E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;24;CPMenuItemIsSeparatorKeyD;K;6;CP$UIDd;3;185E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;186E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;22;CPMenuItemIsEnabledKeyD;K;6;CP$UIDd;3;187E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;59E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;188E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;59E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;189E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;24;CPMenuItemIsSeparatorKeyD;K;6;CP$UIDd;3;185E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;186E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;22;CPMenuItemIsEnabledKeyD;K;6;CP$UIDd;3;187E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;59E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;190E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;59E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;191E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;192E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;2;66E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;3;180E;K;20;CPMenuItemSubmenuKeyD;K;6;CP$UIDd;2;66E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;56E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;55E;K;14;CPMenuTitleKeyD;K;6;CP$UIDd;3;192E;K;14;CPMenuItemsKeyD;K;6;CP$UIDd;3;193E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;194E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;66E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;195E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;196E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;66E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;197E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;198E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;2;70E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;3;180E;K;20;CPMenuItemSubmenuKeyD;K;6;CP$UIDd;2;70E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;66E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;55E;K;14;CPMenuTitleKeyD;K;6;CP$UIDd;3;198E;K;13;CPMenuNameKeyD;K;6;CP$UIDd;3;199E;K;14;CPMenuItemsKeyD;K;6;CP$UIDd;3;200E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;201E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;70E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;24;CPMenuItemIsSeparatorKeyD;K;6;CP$UIDd;3;185E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;186E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;22;CPMenuItemIsEnabledKeyD;K;6;CP$UIDd;3;187E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;66E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;202E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;66E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;203E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;204E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;66E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;205E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;206E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;66E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;207E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;208E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;209E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;66E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;210E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;2;78E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;3;180E;K;20;CPMenuItemSubmenuKeyD;K;6;CP$UIDd;2;78E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;56E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;55E;K;14;CPMenuTitleKeyD;K;6;CP$UIDd;3;210E;K;14;CPMenuItemsKeyD;K;6;CP$UIDd;3;211E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;212E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;78E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;213E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;214E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;78E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;215E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;208E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;24;CPMenuItemIsSeparatorKeyD;K;6;CP$UIDd;3;185E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;186E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;22;CPMenuItemIsEnabledKeyD;K;6;CP$UIDd;3;187E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;78E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;216E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;78E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;217E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;218E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;78E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;219E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;220E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;78E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;221E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;222E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;78E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;223E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;78E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;224E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;24;CPMenuItemIsSeparatorKeyD;K;6;CP$UIDd;3;185E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;186E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;22;CPMenuItemIsEnabledKeyD;K;6;CP$UIDd;3;187E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;78E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;225E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;2;89E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;3;180E;K;20;CPMenuItemSubmenuKeyD;K;6;CP$UIDd;2;89E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;78E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;55E;K;14;CPMenuTitleKeyD;K;6;CP$UIDd;3;225E;K;14;CPMenuItemsKeyD;K;6;CP$UIDd;3;226E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;227E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;16;CPMenuItemTagKeyD;K;6;CP$UIDd;3;228E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;89E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;229E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;230E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;16;CPMenuItemTagKeyD;K;6;CP$UIDd;3;231E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;89E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;232E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;233E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;16;CPMenuItemTagKeyD;K;6;CP$UIDd;3;234E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;89E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;235E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;208E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;236E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;16;CPMenuItemTagKeyD;K;6;CP$UIDd;3;237E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;89E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;238E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;239E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;89E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;240E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;241E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;2;96E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;3;180E;K;20;CPMenuItemSubmenuKeyD;K;6;CP$UIDd;2;96E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;78E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;55E;K;14;CPMenuTitleKeyD;K;6;CP$UIDd;3;241E;K;14;CPMenuItemsKeyD;K;6;CP$UIDd;3;242E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;243E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;96E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;244E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;245E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;96E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;246E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;247E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;96E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;248E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;96E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;249E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;3;102E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;3;180E;K;20;CPMenuItemSubmenuKeyD;K;6;CP$UIDd;3;102E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;78E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;55E;K;14;CPMenuTitleKeyD;K;6;CP$UIDd;3;249E;K;14;CPMenuItemsKeyD;K;6;CP$UIDd;3;250E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;251E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;16;CPMenuItemTagKeyD;K;6;CP$UIDd;3;228E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;3;102E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;229E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;252E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;16;CPMenuItemTagKeyD;K;6;CP$UIDd;3;231E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;3;102E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;232E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;253E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;16;CPMenuItemTagKeyD;K;6;CP$UIDd;3;234E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;3;102E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;235E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;208E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;254E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;3;107E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;3;180E;K;20;CPMenuItemSubmenuKeyD;K;6;CP$UIDd;3;107E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;78E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;55E;K;14;CPMenuTitleKeyD;K;6;CP$UIDd;3;254E;K;14;CPMenuItemsKeyD;K;6;CP$UIDd;3;255E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;256E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;3;107E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;257E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;3;107E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;258E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;3;111E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;3;180E;K;20;CPMenuItemSubmenuKeyD;K;6;CP$UIDd;3;111E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;56E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;55E;K;14;CPMenuTitleKeyD;K;6;CP$UIDd;3;258E;K;14;CPMenuItemsKeyD;K;6;CP$UIDd;3;259E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;260E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;3;111E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;261E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;262E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;263E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;3;111E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;264E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;3;115E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;3;180E;K;20;CPMenuItemSubmenuKeyD;K;6;CP$UIDd;3;115E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;56E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;55E;K;14;CPMenuTitleKeyD;K;6;CP$UIDd;3;264E;K;13;CPMenuNameKeyD;K;6;CP$UIDd;3;265E;K;14;CPMenuItemsKeyD;K;6;CP$UIDd;3;266E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;267E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;3;115E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;268E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;269E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;3;115E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;24;CPMenuItemIsSeparatorKeyD;K;6;CP$UIDd;3;185E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;186E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;22;CPMenuItemIsEnabledKeyD;K;6;CP$UIDd;3;187E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;3;115E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;270E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;3;115E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;271E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;3;121E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;3;180E;K;20;CPMenuItemSubmenuKeyD;K;6;CP$UIDd;3;121E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;2;56E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;6;$classD;K;6;CP$UIDd;2;55E;K;14;CPMenuTitleKeyD;K;6;CP$UIDd;3;271E;K;14;CPMenuItemsKeyD;K;6;CP$UIDd;3;272E;E;D;K;6;$classD;K;6;CP$UIDd;2;57E;K;18;CPMenuItemTitleKeyD;K;6;CP$UIDd;3;273E;K;19;CPMenuItemTargetKeyD;K;6;CP$UIDd;1;0E;K;19;CPMenuItemActionKeyD;K;6;CP$UIDd;1;0E;K;17;CPMenuItemMenuKeyD;K;6;CP$UIDd;3;121E;K;26;CPMenuItemKeyEquivalentKeyD;K;6;CP$UIDd;3;274E;K;38;CPMenuItemKeyEquivalentModifierMaskKeyD;K;6;CP$UIDd;3;181E;E;D;K;10;$classnameS;20;_CPCibWindowTemplateK;8;$classesA;S;20;_CPCibWindowTemplateS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;3;123E;K;30;_CPCibWindowTemplateMaxSizeKeyD;K;6;CP$UIDd;3;275E;K;32;_CPCibWindowTemplateViewClassKeyD;K;6;CP$UIDd;1;0E;K;34;_CPCibWindowTemplateWindowClassKeyD;K;6;CP$UIDd;3;276E;K;30;_CPCibWindowTemplateWTFlagsKeyD;K;6;CP$UIDd;3;277E;K;33;_CPCibWindowTemplateWindowRectKeyD;K;6;CP$UIDd;3;278E;K;33;_CPCibWindowTemplateScreenRectKeyD;K;6;CP$UIDd;3;279E;K;30;_CPCibWindowTempatStyleMaskKeyD;K;6;CP$UIDd;3;237E;K;34;_CPCibWindowTemplateWindowTitleKeyD;K;6;CP$UIDd;3;264E;K;33;_CPCibWindowTemplateWindowViewKeyD;K;6;CP$UIDd;3;126E;E;D;K;10;$classnameS;6;CPViewK;8;$classesA;S;6;CPViewS;11;CPResponderS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;3;125E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;3;280E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;3;281E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;3;281E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;1;0E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;3;282E;K;14;CPViewScaleKeyD;K;6;CP$UIDd;3;283E;K;18;CPViewSizeScaleKeyD;K;6;CP$UIDd;3;283E;K;17;CPViewIsScaledKeyD;K;6;CP$UIDd;3;187E;K;19;CPViewAppearanceKeyD;K;6;CP$UIDd;1;0E;K;22;CPViewTrackingAreasKeyD;K;6;CP$UIDd;3;284E;E;D;K;6;$classD;K;6;CP$UIDd;2;10E;K;27;_CPCibCustomObjectClassNameD;K;6;CP$UIDd;3;285E;E;D;K;6;$classD;K;6;CP$UIDd;3;123E;K;30;_CPCibWindowTemplateMaxSizeKeyD;K;6;CP$UIDd;3;275E;K;32;_CPCibWindowTemplateViewClassKeyD;K;6;CP$UIDd;1;0E;K;34;_CPCibWindowTemplateWindowClassKeyD;K;6;CP$UIDd;3;276E;K;30;_CPCibWindowTemplateWTFlagsKeyD;K;6;CP$UIDd;3;286E;K;33;_CPCibWindowTemplateWindowRectKeyD;K;6;CP$UIDd;3;287E;K;33;_CPCibWindowTemplateScreenRectKeyD;K;6;CP$UIDd;3;288E;K;30;_CPCibWindowTempatStyleMaskKeyD;K;6;CP$UIDd;3;289E;K;34;_CPCibWindowTemplateWindowTitleKeyD;K;6;CP$UIDd;3;290E;K;33;_CPCibWindowTemplateWindowViewKeyD;K;6;CP$UIDd;3;129E;E;D;K;6;$classD;K;6;CP$UIDd;3;125E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;3;280E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;3;291E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;3;291E;K;17;CPViewSubviewsKeyD;K;6;CP$UIDd;3;292E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;1;0E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;3;282E;K;14;CPViewScaleKeyD;K;6;CP$UIDd;3;283E;K;18;CPViewSizeScaleKeyD;K;6;CP$UIDd;3;283E;K;17;CPViewIsScaledKeyD;K;6;CP$UIDd;3;187E;K;19;CPViewAppearanceKeyD;K;6;CP$UIDd;1;0E;K;22;CPViewTrackingAreasKeyD;K;6;CP$UIDd;3;293E;E;D;K;10;$classnameS;8;CPButtonK;8;$classesA;S;8;CPButtonS;9;CPControlS;6;CPViewS;11;CPResponderS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;3;130E;K;27;CPResponderNextResponderKeyD;K;6;CP$UIDd;3;129E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;3;280E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;3;294E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;3;295E;K;18;CPViewSuperviewKeyD;K;6;CP$UIDd;3;129E;K;22;CPViewAutoresizingMaskD;K;6;CP$UIDd;3;296E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;3;297E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;3;298E;K;15;$aimage-scalingD;K;6;CP$UIDd;3;280E;K;6;$afontD;K;6;CP$UIDd;3;300E;K;17;$aline-break-modeD;K;6;CP$UIDd;3;280E;K;11;$aalignmentD;K;6;CP$UIDd;3;231E;K;7;$aimageD;K;6;CP$UIDd;3;302E;K;14;CPViewScaleKeyD;K;6;CP$UIDd;3;283E;K;18;CPViewSizeScaleKeyD;K;6;CP$UIDd;3;283E;K;17;CPViewIsScaledKeyD;K;6;CP$UIDd;3;187E;K;19;CPViewAppearanceKeyD;K;6;CP$UIDd;1;0E;K;22;CPViewTrackingAreasKeyD;K;6;CP$UIDd;3;303E;K;17;CPControlValueKeyD;K;6;CP$UIDd;3;280E;K;24;CPControlSendActionOnKeyD;K;6;CP$UIDd;3;304E;K;23;CPControlControlSizeKeyD;K;6;CP$UIDd;3;280E;K;33;CPControlBaseWrittingDirectionKeyD;K;6;CP$UIDd;3;305E;K;16;CPButtonTitleKeyD;K;6;CP$UIDd;3;306E;K;25;CPButtonAlternateTitleKeyD;K;6;CP$UIDd;3;186E;K;27;CPButtonAllowsMixedStateKeyD;K;6;CP$UIDd;3;187E;K;23;CPButtonHighlightsByKeyD;K;6;CP$UIDd;3;307E;K;23;CPButtonShowsStateByKeyD;K;6;CP$UIDd;3;280E;K;32;CPButtonImageDimsWhenDisabledKeyD;K;6;CP$UIDd;3;185E;K;24;CPButtonImagePositionKeyD;K;6;CP$UIDd;3;231E;K;28;CPButtonKeyEquivalentMaskKeyD;K;6;CP$UIDd;3;280E;K;24;CPButtonPeriodicDelayKeyD;K;6;CP$UIDd;1;0E;K;27;CPButtonPeriodicIntervalKeyD;K;6;CP$UIDd;1;0E;E;D;K;6;$classD;K;6;CP$UIDd;3;123E;K;30;_CPCibWindowTemplateMaxSizeKeyD;K;6;CP$UIDd;3;275E;K;32;_CPCibWindowTemplateViewClassKeyD;K;6;CP$UIDd;1;0E;K;34;_CPCibWindowTemplateWindowClassKeyD;K;6;CP$UIDd;3;276E;K;30;_CPCibWindowTemplateWTFlagsKeyD;K;6;CP$UIDd;3;286E;K;33;_CPCibWindowTemplateWindowRectKeyD;K;6;CP$UIDd;3;308E;K;33;_CPCibWindowTemplateScreenRectKeyD;K;6;CP$UIDd;3;288E;K;30;_CPCibWindowTempatStyleMaskKeyD;K;6;CP$UIDd;3;289E;K;34;_CPCibWindowTemplateWindowTitleKeyD;K;6;CP$UIDd;3;309E;K;33;_CPCibWindowTemplateWindowViewKeyD;K;6;CP$UIDd;3;133E;E;D;K;6;$classD;K;6;CP$UIDd;3;125E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;3;280E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;3;291E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;3;291E;K;17;CPViewSubviewsKeyD;K;6;CP$UIDd;3;310E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;1;0E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;3;282E;K;14;CPViewScaleKeyD;K;6;CP$UIDd;3;283E;K;18;CPViewSizeScaleKeyD;K;6;CP$UIDd;3;283E;K;17;CPViewIsScaledKeyD;K;6;CP$UIDd;3;187E;K;19;CPViewAppearanceKeyD;K;6;CP$UIDd;1;0E;K;22;CPViewTrackingAreasKeyD;K;6;CP$UIDd;3;311E;E;D;K;10;$classnameS;11;CPTextFieldK;8;$classesA;S;11;CPTextFieldS;9;CPControlS;6;CPViewS;11;CPResponderS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;3;134E;K;27;CPResponderNextResponderKeyD;K;6;CP$UIDd;3;133E;K;18;CPResponderMenuKeyD;K;6;CP$UIDd;1;0E;K;12;CPViewTagKeyD;K;6;CP$UIDd;3;280E;K;14;CPViewFrameKeyD;K;6;CP$UIDd;3;312E;K;15;CPViewBoundsKeyD;K;6;CP$UIDd;3;313E;K;18;CPViewSuperviewKeyD;K;6;CP$UIDd;3;133E;K;22;CPViewAutoresizingMaskD;K;6;CP$UIDd;3;296E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;3;314E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;3;315E;K;6;$afontD;K;6;CP$UIDd;3;316E;K;17;$aline-break-modeD;K;6;CP$UIDd;3;280E;K;11;$aalignmentD;K;6;CP$UIDd;3;231E;K;14;CPViewScaleKeyD;K;6;CP$UIDd;3;283E;K;18;CPViewSizeScaleKeyD;K;6;CP$UIDd;3;283E;K;17;CPViewIsScaledKeyD;K;6;CP$UIDd;3;187E;K;19;CPViewAppearanceKeyD;K;6;CP$UIDd;1;0E;K;22;CPViewTrackingAreasKeyD;K;6;CP$UIDd;3;317E;K;35;CPControlSendsActionOnEndEditingKeyD;K;6;CP$UIDd;3;185E;K;17;CPControlValueKeyD;K;6;CP$UIDd;3;318E;K;24;CPControlSendActionOnKeyD;K;6;CP$UIDd;3;304E;K;23;CPControlControlSizeKeyD;K;6;CP$UIDd;3;280E;K;33;CPControlBaseWrittingDirectionKeyD;K;6;CP$UIDd;3;305E;K;24;CPTextFieldIsEditableKeyD;K;6;CP$UIDd;3;187E;K;26;CPTextFieldIsSelectableKeyD;K;6;CP$UIDd;3;187E;K;29;CPTextFieldDrawsBackgroundKeyD;K;6;CP$UIDd;3;187E;K;29;CPTextFieldBackgroundColorKeyD;K;6;CP$UIDd;3;320E;K;27;CPTextFieldLineBreakModeKeyD;K;6;CP$UIDd;3;280E;K;23;CPTextFieldAlignmentKeyD;K;6;CP$UIDd;3;231E;K;31;CPTextFieldPlaceholderStringKeyD;K;6;CP$UIDd;1;0E;K;29;CPTextFieldUsesSingleLineModeD;K;6;CP$UIDd;3;187E;K;16;CPTextFieldWrapsD;K;6;CP$UIDd;3;185E;K;18;CPTextFieldScrollsD;K;6;CP$UIDd;3;187E;E;S;13;CPApplicationD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;124E;E;E;S;8;delegateS;9;theWindowS;7;window1S;7;window2S;15;arrangeInFront:S;19;performMiniaturize:S;29;orderFrontStandardAboutPanel:S;13;openDocument:S;13;performClose:S;13;saveDocument:S;15;saveDocumentAs:S;12;newDocument:S;9;showHelp:S;22;revertDocumentToSaved:S;21;clearRecentDocuments:S;10;terminate:S;13;stopSpeaking:S;14;startSpeaking:S;5;copy:S;10;selectAll:S;4;cut:S;14;checkSpelling:S;7;delete:S;6;paste:S;15;showGuessPanel:S;5;undo:S;23;performFindPanelAction:S;29;centerSelectionInVisibleArea:S;5;redo:S;30;toggleContinuousSpellChecking:S;12;performZoom:S;19;toggleToolbarShown:S;31;runToolbarCustomizationPalette:S;22;toggleGrammarChecking:S;24;toggleSmartInsertDelete:S;33;toggleAutomaticQuoteSubstitution:S;29;toggleAutomaticLinkDetection:S;18;bringWindow2Front:S;9;AMainMenuS;11;_CPMainMenuD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;58E;D;K;6;CP$UIDd;2;65E;D;K;6;CP$UIDd;2;77E;D;K;6;CP$UIDd;3;110E;D;K;6;CP$UIDd;3;114E;D;K;6;CP$UIDd;3;120E;E;E;S;14;NewApplicationS;14;submenuAction:d;7;1048576S;18;_CPApplicationMenuD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;60E;D;K;6;CP$UIDd;2;61E;D;K;6;CP$UIDd;2;62E;D;K;6;CP$UIDd;2;63E;D;K;6;CP$UIDd;2;64E;E;E;S;20;About NewApplicationT;S;0;F;S;12;Preferences…S;1;,S;19;Quit NewApplicationS;1;qS;4;FileD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;67E;D;K;6;CP$UIDd;2;68E;D;K;6;CP$UIDd;2;69E;D;K;6;CP$UIDd;2;72E;D;K;6;CP$UIDd;2;73E;D;K;6;CP$UIDd;2;74E;D;K;6;CP$UIDd;2;75E;D;K;6;CP$UIDd;2;76E;E;E;S;3;NewS;1;nS;5;Open…S;1;oS;11;Open RecentS;22;_CPRecentDocumentsMenuD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;71E;E;E;S;10;Clear MenuS;5;CloseS;1;wS;4;SaveS;1;sS;8;Save As…S;1;Sd;7;1179648S;15;Revert to SavedS;4;EditD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;79E;D;K;6;CP$UIDd;2;80E;D;K;6;CP$UIDd;2;81E;D;K;6;CP$UIDd;2;82E;D;K;6;CP$UIDd;2;83E;D;K;6;CP$UIDd;2;84E;D;K;6;CP$UIDd;2;85E;D;K;6;CP$UIDd;2;86E;D;K;6;CP$UIDd;2;87E;D;K;6;CP$UIDd;2;88E;D;K;6;CP$UIDd;2;95E;D;K;6;CP$UIDd;3;101E;D;K;6;CP$UIDd;3;106E;E;E;S;4;UndoS;1;zS;4;RedoS;1;ZS;3;CutS;1;xS;4;CopyS;1;cS;5;PasteS;1;vS;6;DeleteS;10;Select AllS;1;aS;4;FindD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;90E;D;K;6;CP$UIDd;2;91E;D;K;6;CP$UIDd;2;92E;D;K;6;CP$UIDd;2;93E;D;K;6;CP$UIDd;2;94E;E;E;S;5;Find…d;1;1S;1;fS;9;Find Nextd;1;2S;1;gS;13;Find Previousd;1;3S;1;GS;22;Use Selection for Findd;1;7S;1;eS;17;Jump to SelectionS;1;jS;20;Spelling and GrammarD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;2;97E;D;K;6;CP$UIDd;2;98E;D;K;6;CP$UIDd;2;99E;D;K;6;CP$UIDd;3;100E;E;E;S;14;Show Spelling…S;1;:S;14;Check SpellingS;1;;S;27;Check Spelling While TypingS;27;Check Grammar With SpellingS;13;SubstitutionsD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;103E;D;K;6;CP$UIDd;3;104E;D;K;6;CP$UIDd;3;105E;E;E;S;16;Smart Copy/PasteS;12;Smart QuotesS;11;Smart LinksS;6;SpeechD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;108E;D;K;6;CP$UIDd;3;109E;E;E;S;14;Start SpeakingS;13;Stop SpeakingS;4;ViewD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;112E;D;K;6;CP$UIDd;3;113E;E;E;S;12;Show ToolbarS;1;td;7;1572864S;18;Customize Toolbar…S;6;WindowS;14;_CPWindowsMenuD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;116E;D;K;6;CP$UIDd;3;117E;D;K;6;CP$UIDd;3;118E;D;K;6;CP$UIDd;3;119E;E;E;S;8;MinimizeS;1;mS;4;ZoomS;18;Bring All to FrontS;4;HelpD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;122E;E;E;S;19;NewApplication HelpS;1;?S;32;{10000000000000, 10000000000000}S;8;CPWindowd;10;1879048192S;24;{{335, 128}, {480, 360}}S;21;{{0, 0}, {1440, 878}}d;1;0S;20;{{0, 0}, {480, 360}}S;6;normalS;6;{1, 1}D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;S;13;AppControllerd;10;1618478080S;24;{{157, 107}, {480, 270}}S;22;{{0, 0}, {2560, 1417}}d;2;15S;8;Window 1S;20;{{0, 0}, {480, 270}}D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;131E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;S;23;{{151, 125}, {178, 25}}S;19;{{0, 0}, {178, 25}}d;2;36S;6;buttonS;27;bordered+controlSizeRegularD;K;10;$classnameS;6;CPFontK;8;$classesA;S;6;CPFontS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;3;299E;K;13;CPFontNameKeyD;K;6;CP$UIDd;3;321E;K;13;CPFontSizeKeyD;K;6;CP$UIDd;3;305E;K;15;CPFontIsBoldKeyD;K;6;CP$UIDd;3;185E;K;17;CPFontIsItalicKeyD;K;6;CP$UIDd;3;187E;K;17;CPFontIsSystemKeyD;K;6;CP$UIDd;3;185E;E;D;K;10;$classnameS;17;_CPThemeAttributeK;8;$classesA;S;17;_CPThemeAttributeS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;3;301E;K;4;nameD;K;6;CP$UIDd;3;322E;K;12;defaultValueD;K;6;CP$UIDd;3;324E;K;5;stateD;K;6;CP$UIDd;3;325E;K;5;valueD;K;6;CP$UIDd;3;326E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;d;1;4d;2;-1S;23;Bring Window 2 To Frontd;2;14S;24;{{246, 251}, {480, 270}}S;8;Window 2D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;135E;E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;S;22;{{50, 114}, {380, 42}}S;19;{{0, 0}, {380, 42}}S;9;textfieldS;18;controlSizeRegularD;K;6;$classD;K;6;CP$UIDd;3;299E;K;13;CPFontNameKeyD;K;6;CP$UIDd;3;327E;K;13;CPFontSizeKeyD;K;6;CP$UIDd;3;289E;K;15;CPFontIsBoldKeyD;K;6;CP$UIDd;3;185E;K;17;CPFontIsItalicKeyD;K;6;CP$UIDd;3;187E;K;17;CPFontIsSystemKeyD;K;6;CP$UIDd;3;187E;E;D;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;E;E;S;71;This is window 2--bet you can't click on window 1 to bring it to front!D;K;10;$classnameS;7;CPColorK;8;$classesA;S;7;CPColorS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;3;319E;K;20;CPColorComponentsKeyD;K;6;CP$UIDd;3;328E;K;19;CPViewThemeClassKeyD;K;6;CP$UIDd;3;329E;K;19;CPViewThemeStateKeyD;K;6;CP$UIDd;3;282E;E;S;28;_CPFontSystemFacePlaceholderS;5;imageD;K;10;$classnameS;6;CPNullK;8;$classesA;S;6;CPNullS;8;CPObjectE;E;D;K;6;$classD;K;6;CP$UIDd;3;323E;E;S;11;highlightedD;K;6;$classD;K;6;CP$UIDd;3;299E;K;13;CPFontNameKeyD;K;6;CP$UIDd;3;330E;K;13;CPFontSizeKeyD;K;6;CP$UIDd;3;331E;K;15;CPFontIsBoldKeyD;K;6;CP$UIDd;3;187E;K;17;CPFontIsItalicKeyD;K;6;CP$UIDd;3;187E;K;17;CPFontIsSystemKeyD;K;6;CP$UIDd;3;187E;E;S;5;ArialD;K;6;$classD;K;6;CP$UIDd;1;3E;K;10;CP.objectsA;D;K;6;CP$UIDd;3;332E;D;K;6;CP$UIDd;3;332E;D;K;6;CP$UIDd;3;332E;D;K;6;CP$UIDd;3;228E;E;E;S;5;colorS;18;.AppleSystemUIFontd;2;13f;18;0.6862745098039216E;K;9;$archiverS;15;CPKeyedArchiverK;8;$versionS;6;100000E; \ No newline at end of file diff --git a/Tests/Manual/KeyWindowInTheBackgroundActivation/Resources/MainMenu.xib b/Tests/Manual/KeyWindowInTheBackgroundActivation/Resources/MainMenu.xib new file mode 100644 index 000000000..e8b61fb36 --- /dev/null +++ b/Tests/Manual/KeyWindowInTheBackgroundActivation/Resources/MainMenu.xib @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/Manual/KeyWindowInTheBackgroundActivation/index-debug.html b/Tests/Manual/KeyWindowInTheBackgroundActivation/index-debug.html new file mode 100644 index 000000000..c4de7ac52 --- /dev/null +++ b/Tests/Manual/KeyWindowInTheBackgroundActivation/index-debug.html @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + WindowFrontTest + + + + + + + + + + + + + + +
+
+
+ +
+
+ +
+ + diff --git a/Tests/Manual/KeyWindowInTheBackgroundActivation/index.html b/Tests/Manual/KeyWindowInTheBackgroundActivation/index.html new file mode 100644 index 000000000..6fd788486 --- /dev/null +++ b/Tests/Manual/KeyWindowInTheBackgroundActivation/index.html @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + WindowFrontTest + + + + + + + + + + + + +
+
+
+ +
+
+ +
+ + diff --git a/Tests/Manual/KeyWindowInTheBackgroundActivation/main.j b/Tests/Manual/KeyWindowInTheBackgroundActivation/main.j new file mode 100644 index 000000000..cb26b4ad7 --- /dev/null +++ b/Tests/Manual/KeyWindowInTheBackgroundActivation/main.j @@ -0,0 +1,18 @@ +/* + * AppController.j + * WindowFrontTest + * + * Created by You on January 15, 2018. + * Copyright 2018, Your Company All rights reserved. + */ + +@import +@import + +@import "AppController.j" + + +function main(args, namedArgs) +{ + CPApplicationMain(args, namedArgs); +} From df462774aa1da79d37b6a0bd65e7907221c6c731 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Tue, 20 Mar 2018 14:25:42 +0100 Subject: [PATCH 03/69] refactured front detection logic to own method _isFrontmostWindow fixes travis error --- AppKit/CPWindow/CPWindow.j | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index c2dd4e19e..f20a5b858 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -1983,7 +1983,7 @@ CPTexturedBackgroundWindowMask var theWindow = [anEvent window], selector = type == CPRightMouseDown ? @selector(rightMouseDown:) : @selector(mouseDown:); - if (([[CPApp orderedWindows] objectAtIndex:0] === self && [theWindow isKeyWindow]) || ([theWindow becomesKeyOnlyIfNeeded] && ![_leftMouseDownView needsPanelToBecomeKey])) + if (([theWindow _isFrontmostWindow] && [theWindow isKeyWindow]) || ([theWindow becomesKeyOnlyIfNeeded] && ![_leftMouseDownView needsPanelToBecomeKey])) return [_leftMouseDownView performSelector:selector withObject:anEvent]; else { @@ -2114,6 +2114,20 @@ CPTexturedBackgroundWindowMask return [CPApp keyWindow] == self; } +/* @ignore */ +- (BOOL)_isFrontmostWindow +{ + var orderedWindows = [CPApp orderedWindows]; + + if ([orderedWindows count] == 0) + return YES; + + if ([orderedWindows objectAtIndex:0] === self) + return YES; + + return NO; +} + /*! Makes the window the key window and brings it to the front of the screen list. @param aSender the object requesting this From 7f2977f4af0d98daab241bece568a0fd8f589e68 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Mon, 2 Apr 2018 08:33:50 +0200 Subject: [PATCH 04/69] fixed: wording in manual test --- .../Resources/MainMenu.xib | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Tests/Manual/KeyWindowInTheBackgroundActivation/Resources/MainMenu.xib b/Tests/Manual/KeyWindowInTheBackgroundActivation/Resources/MainMenu.xib index e8b61fb36..b9721bd11 100644 --- a/Tests/Manual/KeyWindowInTheBackgroundActivation/Resources/MainMenu.xib +++ b/Tests/Manual/KeyWindowInTheBackgroundActivation/Resources/MainMenu.xib @@ -1,8 +1,8 @@ - - + + - + @@ -328,10 +328,10 @@ - - + + - + From b8420303ba7bc5298b4a07defdd97cacf8a2a132 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 3 Apr 2018 10:55:17 -0700 Subject: [PATCH 05/69] Formatting: add missing semi-colon to CPKeyValueBinding.j --- AppKit/CPKeyValueBinding.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPKeyValueBinding.j b/AppKit/CPKeyValueBinding.j index d524590d4..05a9fd585 100644 --- a/AppKit/CPKeyValueBinding.j +++ b/AppKit/CPKeyValueBinding.j @@ -857,7 +857,7 @@ var CPBindingOperationAnd = 0, - (id)initWithName:(CPString)aName { if (self = [super init]) - _name = aName + _name = aName; return self; } From 73c8e945e9b08b9bca946b18b85bba7bcc5142bd Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 3 Apr 2018 12:07:01 -0700 Subject: [PATCH 06/69] New: add .idea to .gitignore Prevent Intellij Idea metadata from being committed to git. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 11a5e1abf..59ca26473 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ Tests/Manual/**/*.xcodeproj *.sublime-project *.sublime-workspace *.tm_properties +*.idea \ No newline at end of file From 0fc3eb38f1db92562757bb34dc5a2cbd1fd1bbec Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 3 Apr 2018 12:11:57 -0700 Subject: [PATCH 07/69] Formatting: Add semi-colons to CGContextCanvas.j --- AppKit/CoreGraphics/CGContextCanvas.j | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AppKit/CoreGraphics/CGContextCanvas.j b/AppKit/CoreGraphics/CGContextCanvas.j index 628afd27e..3c2115dc4 100644 --- a/AppKit/CoreGraphics/CGContextCanvas.j +++ b/AppKit/CoreGraphics/CGContextCanvas.j @@ -557,14 +557,14 @@ CGContextConcatCTM = function(aContext, anAffineTransform) b = VT.b; c = VT.c; d = VT.d; - scale_rotate(a, b, c, d) + scale_rotate(a, b, c, d); S.a *= sx; S.d *= sy; a = U.a; b = U.b; c = U.c; d = U.d; - rotate_scale(a, b, c, d) + rotate_scale(a, b, c, d); sx = S.a * sx; sy = S.d * sy; } From 36702bc97119531d01da918de0f38f6ed66e85e1 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 3 Apr 2018 12:15:04 -0700 Subject: [PATCH 08/69] Formatting: add missing semi-colon to CGContextVML --- AppKit/CoreGraphics/CGContextVML.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CoreGraphics/CGContextVML.j b/AppKit/CoreGraphics/CGContextVML.j index d8431a857..8bb35f649 100644 --- a/AppKit/CoreGraphics/CGContextVML.j +++ b/AppKit/CoreGraphics/CGContextVML.j @@ -242,7 +242,7 @@ function CGContextDrawPath(aContext, aMode) vml.push("\">"); if (gState.gradient) - vml.push(gState.gradient) + vml.push(gState.gradient); else if (fill) { From fd581cd65c9a09a4952ddb7c3ddd1b4614e66489 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 3 Apr 2018 12:46:56 -0700 Subject: [PATCH 09/69] Formatting: removed variable redeclaration in CGPath.j Variables `arcStartX` and `arcStartY` are declared on 125 and 126, but are later redeclared in an `else` statement on lines 135 and 136 with the same equation and presumably the same value used in the initial declaration. Also added missing semi-colon --- AppKit/CoreGraphics/CGPath.j | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/AppKit/CoreGraphics/CGPath.j b/AppKit/CoreGraphics/CGPath.j index b7cea5164..b01d92dfc 100644 --- a/AppKit/CoreGraphics/CGPath.j +++ b/AppKit/CoreGraphics/CGPath.j @@ -132,9 +132,6 @@ function CGPathAddArc(aPath, aTransform, x, y, aRadius, aStartAngle, anEndAngle, } else { - var arcStartX = x + aRadius * COS(aStartAngle), - arcStartY = y + aRadius * SIN(aStartAngle); - aPath.start = CGPointMake(arcStartX, arcStartY); } @@ -274,7 +271,7 @@ function CGPathAddQuadCurveToPoint(aPath, aTransform, cpx, cpy, x, y) end = CGPointApplyAffineTransform(end, aTransform); } - aPath.elements[aPath.count++] = { type:kCGPathElementAddQuadCurveToPoint, cpx:cp.x, cpy:cp.y, x:end.x, y:end.y } + aPath.elements[aPath.count++] = { type:kCGPathElementAddQuadCurveToPoint, cpx:cp.x, cpy:cp.y, x:end.x, y:end.y }; aPath.current = end; } From 0a93f2d0b05d71a2c3ea47c4dfba1f64c601d809 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 3 Apr 2018 12:54:39 -0700 Subject: [PATCH 10/69] Formatting: add missing semi-colons to _CPDatePickerCalendar.j --- AppKit/CPDatePicker/_CPDatePickerCalendar.j | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/AppKit/CPDatePicker/_CPDatePickerCalendar.j b/AppKit/CPDatePicker/_CPDatePickerCalendar.j index b3140cab1..f7fe81f87 100644 --- a/AppKit/CPDatePicker/_CPDatePickerCalendar.j +++ b/AppKit/CPDatePicker/_CPDatePickerCalendar.j @@ -85,7 +85,7 @@ var CPShortWeekDayNameArrayEn = [@"Mo", @"Tu", @"We", @"Th", @"Fr", @"Sa", @"Su" { if (self = [super initWithFrame:aFrame]) { - _datePicker = aDatePicker + _datePicker = aDatePicker; [self _init]; } @@ -435,7 +435,7 @@ var CPShortWeekDayNameArrayEn = [@"Mo", @"Tu", @"We", @"Th", @"Fr", @"Sa", @"Su" break; default: - return CPShortWeekDayNameArrayEn + return CPShortWeekDayNameArrayEn; break; } } @@ -464,7 +464,7 @@ var CPShortWeekDayNameArrayEn = [@"Mo", @"Tu", @"We", @"Th", @"Fr", @"Sa", @"Su" break; default: - return CPShortMonthNameArrayEn + return CPShortMonthNameArrayEn; break; } @@ -526,11 +526,11 @@ var CPShortWeekDayNameArrayEn = [@"Mo", @"Tu", @"We", @"Th", @"Fr", @"Sa", @"Su" var dayLabel = _dayLabels[i]; [dayLabel setStringValue:dayNames[i]]; - [dayLabel sizeToFit] + [dayLabel sizeToFit]; [dayLabel setFrameOrigin:CGPointMake(sizeTileWidth * (i + 1) - sizeTileWidth / 2 - [dayLabel frameSize].width / 2, 23)]; if (i == 0) - firstDayTileX = sizeTileWidth * (i + 1) - sizeTileWidth / 2 - [dayLabel frameSize].width / 2 + firstDayTileX = sizeTileWidth * (i + 1) - sizeTileWidth / 2 - [dayLabel frameSize].width / 2; } // Title @@ -769,7 +769,7 @@ var CPShortWeekDayNameArrayEn = [@"Mo", @"Tu", @"We", @"Th", @"Fr", @"Sa", @"Su" tileDate = [[tile date] copy], selected = NO; - [tileDate _resetToMidnight] + [tileDate _resetToMidnight]; if (aStartDate) selected = tileDate >= aStartDate && tileDate <= endDate; @@ -845,7 +845,7 @@ var CPShortWeekDayNameArrayEn = [@"Mo", @"Tu", @"We", @"Th", @"Fr", @"Sa", @"Su" // Very usefull to avoid to have a line of two pixels instead one if (!isBorderPair) - y += 0.5 + y += 0.5; CGContextMoveToPoint(context, 0, y); CGContextAddLineToPoint(context, [self bounds].size.width, y); @@ -857,7 +857,7 @@ var CPShortWeekDayNameArrayEn = [@"Mo", @"Tu", @"We", @"Th", @"Fr", @"Sa", @"Su" // Very usefull to avoid to have a line of two pixels instead one if (!isBorderPair) - x += 0.5 + x += 0.5; CGContextMoveToPoint(context, x, 0); CGContextAddLineToPoint(context, x, [self bounds].size.height); @@ -869,7 +869,7 @@ var CPShortWeekDayNameArrayEn = [@"Mo", @"Tu", @"We", @"Th", @"Fr", @"Sa", @"Su" // Very usefull to avoid to have a line of two pixels instead one if (!isBorderPair) - y += 0.5 + y += 0.5; CGContextMoveToPoint(context, 0, y); CGContextAddLineToPoint(context, [self bounds].size.width, y); @@ -897,7 +897,7 @@ var CPShortWeekDayNameArrayEn = [@"Mo", @"Tu", @"We", @"Th", @"Fr", @"Sa", @"Su" _clickDate = [dateTile copy]; _dragDate = nil; _indexDayTile = -1; - _eventDragged = nil + _eventDragged = nil; _datePicker._invokedByUserEvent = YES; From ed0dc2d88767b476ab66c03f2c33967a4145f215 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 3 Apr 2018 12:59:51 -0700 Subject: [PATCH 11/69] Formatting: add semi-colon to _CPDatePickerClock.j --- AppKit/CPDatePicker/_CPDatePickerClock.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPDatePicker/_CPDatePickerClock.j b/AppKit/CPDatePicker/_CPDatePickerClock.j index 1dc603934..c18c5e66b 100644 --- a/AppKit/CPDatePicker/_CPDatePickerClock.j +++ b/AppKit/CPDatePicker/_CPDatePickerClock.j @@ -142,7 +142,7 @@ var RADIANS = Math.PI / 180; if ([_datePicker _isAmericanFormat]) { if (dateValue.getHours() > 11) - [_PMAMTextField setStringValue:@"PM"] + [_PMAMTextField setStringValue:@"PM"]; else [_PMAMTextField setStringValue:@"AM"]; From dbb2f03a43a0237b70a9648ce392f19d51ef5ab6 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 3 Apr 2018 14:18:36 -0700 Subject: [PATCH 12/69] Formatting: add semi-colon CPDatePickerTextField.j --- AppKit/CPDatePicker/_CPDatePickerTextField.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPDatePicker/_CPDatePickerTextField.j b/AppKit/CPDatePicker/_CPDatePickerTextField.j index 366660dad..987cafb6c 100644 --- a/AppKit/CPDatePicker/_CPDatePickerTextField.j +++ b/AppKit/CPDatePicker/_CPDatePickerTextField.j @@ -80,7 +80,7 @@ var CPZeroKeyCode = 48, { if (self = [super initWithFrame:aFrame]) { - _datePicker = aDatePicker + _datePicker = aDatePicker; [self _init]; } return self; From e9e2313159c7236a2caa65d6042b05ddcb6649f5 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 3 Apr 2018 14:27:07 -0700 Subject: [PATCH 13/69] Formatting: add missing semi-colons to CPDatePicker.j --- AppKit/CPDatePicker/CPDatePicker.j | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AppKit/CPDatePicker/CPDatePicker.j b/AppKit/CPDatePicker/CPDatePicker.j index 123ccd749..02170bf90 100644 --- a/AppKit/CPDatePicker/CPDatePicker.j +++ b/AppKit/CPDatePicker/CPDatePicker.j @@ -352,8 +352,8 @@ CPEraDatePickerElementFlag = 0x0100; if (_implementedCDatePickerDelegateMethods & CPDatePicker_validateProposedDateValue_timeInterval) { // constrain timeInterval also - var aStartDateRef = function(x){if (typeof x == 'undefined') return aDateValue; aDateValue = x;} - var aTimeIntervalRef = function(x){if (typeof x == 'undefined') return aTimeInterval; aTimeInterval = x;} + var aStartDateRef = function(x){if (typeof x == 'undefined') return aDateValue; aDateValue = x;}; + var aTimeIntervalRef = function(x){if (typeof x == 'undefined') return aTimeInterval; aTimeInterval = x;}; [_delegate datePicker:self validateProposedDateValue:aStartDateRef timeInterval:aTimeIntervalRef]; } @@ -694,7 +694,7 @@ var CPDatePickerModeKey = @"CPDatePickerModeKey", [aCoder encodeInt:_datePickerStyle forKey:CPDatePickerStyleKey]; [aCoder encodeInt:_datePickerElements forKey:CPDatePickerElementsKey]; [aCoder encodeObject:_minDate forKey:CPMinDateKey]; - [aCoder encodeObject:_maxDate forKey:CPMaxDateKey] + [aCoder encodeObject:_maxDate forKey:CPMaxDateKey]; [aCoder encodeObject:_dateValue forKey:CPDateValueKey];; [aCoder encodeObject:_textFont forKey:CPTextFontKey]; [aCoder encodeObject:_locale forKey:CPLocaleKey]; From 0556fc68b06181b045bd01fa3aa42759f34de1a2 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 3 Apr 2018 14:59:14 -0700 Subject: [PATCH 14/69] Formatting: add missing semi-colons to CPMenuItem.j --- AppKit/CPMenuItem/CPMenuItem.j | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AppKit/CPMenuItem/CPMenuItem.j b/AppKit/CPMenuItem/CPMenuItem.j index 480043bc1..9241938b0 100644 --- a/AppKit/CPMenuItem/CPMenuItem.j +++ b/AppKit/CPMenuItem/CPMenuItem.j @@ -505,7 +505,7 @@ CPOffState if (_submenu) { [_submenu setSupermenu:_menu]; - [_submenu setTitle:[self title]] + [_submenu setTitle:[self title]]; [self setTarget:_menu]; [self setAction:@selector(submenuAction:)]; @@ -843,7 +843,7 @@ CPControlKeyMask [item setTarget:_target]; [item setAction:_action]; [item setEnabled:_isEnabled]; - [item setHidden:_isHidden] + [item setHidden:_isHidden]; [item setTag:_tag]; [item setState:_state]; [item setImage:_image]; From 8e0d4a70f276a814d5f4b5991437d1ee78c43b92 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 3 Apr 2018 15:04:55 -0700 Subject: [PATCH 15/69] Formatting: remove redundant variable in _CPRuleEditorViewSlice.j --- AppKit/CPRuleEditor/_CPRuleEditorViewSliceRow.j | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/AppKit/CPRuleEditor/_CPRuleEditorViewSliceRow.j b/AppKit/CPRuleEditor/_CPRuleEditorViewSliceRow.j index c7d1524ff..8866095d4 100644 --- a/AppKit/CPRuleEditor/_CPRuleEditorViewSliceRow.j +++ b/AppKit/CPRuleEditor/_CPRuleEditorViewSliceRow.j @@ -209,8 +209,7 @@ - (void)_reconfigureSubviews { - var ruleItems, - criteria, + var criteria, repObject, menuItem, ruleView, From 125e813d25c27a56903f8c0e520c49193e1f100b Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 09:00:36 -0700 Subject: [PATCH 16/69] Formatting: add semi-colons to _CPRTFParser.j --- AppKit/CPTextView/_CPRTFParser.j | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AppKit/CPTextView/_CPRTFParser.j b/AppKit/CPTextView/_CPRTFParser.j index 6cd936508..2fdb03985 100644 --- a/AppKit/CPTextView/_CPRTFParser.j +++ b/AppKit/CPTextView/_CPRTFParser.j @@ -657,7 +657,7 @@ var kRgsymRtf = { } - (CPAttributedString)parseRTF:(CPString)rtf { - rtf = rtf.replace(/\\\n/g, "\\par\n") + rtf = rtf.replace(/\\\n/g, "\\par\n"); if (rtf.length == 0) return ''; @@ -718,7 +718,7 @@ var kRgsymRtf = { _freename = ""; } - [self _flushCurrentRun] + [self _flushCurrentRun]; break; case "\\": @@ -751,7 +751,7 @@ var kRgsymRtf = { if (hexTable && hexTable[hex.toUpperCase()] !== undefined) temp = parseInt(hexTable[hex.toUpperCase()], 16); - [self _appendPlainString: String.fromCharCode(temp)] + [self _appendPlainString: String.fromCharCode(temp)]; hex = ''; } } From b0306eac876e9ca64984795094311a83174a3ae6 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 09:07:06 -0700 Subject: [PATCH 17/69] Formatting: add semi-colon to CPFrontPanel.j --- AppKit/CPTextView/CPFontPanel.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPTextView/CPFontPanel.j b/AppKit/CPTextView/CPFontPanel.j index 81a2cf93f..9f19a47af 100644 --- a/AppKit/CPTextView/CPFontPanel.j +++ b/AppKit/CPTextView/CPFontPanel.j @@ -412,7 +412,7 @@ var _availableTraits= [@"Normal", @"Italic", @"Bold", @"Bold Italic"], return [_availableFonts count]; if (aBrowser === _traitBrowser) - return [_availableTraits count] + return [_availableTraits count]; return [_availableSizes count] } From 47594c9b073120085637df7e3de847b843e647df Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 09:10:52 -0700 Subject: [PATCH 18/69] Formatting: add missing coma and semi-colons to CPTextField --- AppKit/CPTextView/CPTextView.j | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/AppKit/CPTextView/CPTextView.j b/AppKit/CPTextView/CPTextView.j index fae2b59b2..030d094aa 100644 --- a/AppKit/CPTextView/CPTextView.j +++ b/AppKit/CPTextView/CPTextView.j @@ -95,7 +95,7 @@ CPSelectByWord = 1; CPSelectByParagraph = 2; var kDelegateRespondsTo_textShouldBeginEditing = 1 << 0, - kDelegateRespondsTo_textShouldEndEditing = 1 << 1 + kDelegateRespondsTo_textShouldEndEditing = 1 << 1, kDelegateRespondsTo_textView_doCommandBySelector = 1 << 2, kDelegateRespondsTo_textView_willChangeSelectionFromCharacterRange_toCharacterRange = 1 << 3, kDelegateRespondsTo_textView_shouldChangeTextInRange_replacementString = 1 << 4, @@ -241,7 +241,7 @@ var kDelegateRespondsTo_textShouldBeginEditing _selectedTextAttributes = [CPMutableDictionary new]; _caret = [[_CPCaret alloc] initWithTextView:self]; - [_caret setRect:CGRectMake(0, 0, 1, 11)] + [_caret setRect:CGRectMake(0, 0, 1, 11)]; var pboardTypes = [CPStringPboardType, CPColorDragType]; @@ -1586,7 +1586,7 @@ Sets the selection to a range of characters in response to user action. - (void)moveWordLeft:(id)sender { if ([self isSelectable]) - [self _moveSelectionIntoDirection:-1 granularity:CPSelectByWord] + [self _moveSelectionIntoDirection:-1 granularity:CPSelectByWord]; } - (void)moveRight:(id)sender @@ -2390,7 +2390,7 @@ var CPTextViewAllowsUndoKey = @"CPTextViewAllowsUndoKey", { DOMElement _selectionBoxDOM; CGRect _rect; - CPColor _color + CPColor _color; CPTextView _textView; } @@ -2540,7 +2540,7 @@ var CPTextViewAllowsUndoKey = @"CPTextViewAllowsUndoKey", var rect = [_textView._layoutManager boundingRectForGlyphRange:CPMakeRange(aLoc, 1) inTextContainer:_textView._textContainer]; if (aLoc >= [_textView._layoutManager numberOfCharacters]) - rect.origin.x = CGRectGetMaxX(rect) + rect.origin.x = CGRectGetMaxX(rect); [self setRect:rect]; } @@ -2749,7 +2749,7 @@ var _CPCopyPlaceholder = '-'; }, 20); return false; - } + }; if (CPBrowserIsEngine(CPGeckoBrowserEngine)) { @@ -2765,7 +2765,7 @@ var _CPCopyPlaceholder = '-'; e.clipboardData.setData('text/plain', stringForPasting); return false; - } + }; _CPNativeInputField.oncut = function(e) { From de116c95d411ec5df71a8c76377477d6f583b9c4 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 09:23:38 -0700 Subject: [PATCH 19/69] Formatting: add missing semi-colon to CPLayoutManager.j --- AppKit/CPTextView/CPLayoutManager.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPTextView/CPLayoutManager.j b/AppKit/CPTextView/CPLayoutManager.j index 54591368e..77e55fd98 100644 --- a/AppKit/CPTextView/CPLayoutManager.j +++ b/AppKit/CPTextView/CPLayoutManager.j @@ -1179,7 +1179,7 @@ var _objectsInRange = function(aList, aRange) for (var i = 0; i < count; i++) { _glyphsFrames[i] = CGRectMake(origin.x, origin.y, someAdvancements[i].width, height); - _glyphsFrames[i]._descent = someAdvancements[i].descent + _glyphsFrames[i]._descent = someAdvancements[i].descent; _glyphsOffsets[i] = height - someAdvancements[i].height; origin.x += someAdvancements[i].width; } From 2619a509767ed0a21f119f18c6b9b7751b10f1d5 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 09:27:12 -0700 Subject: [PATCH 20/69] Formatting: add missing semi-colons to CPTypesetter.j --- AppKit/CPTextView/CPTypesetter.j | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AppKit/CPTextView/CPTypesetter.j b/AppKit/CPTextView/CPTypesetter.j index 17319cd57..a52d15e97 100644 --- a/AppKit/CPTextView/CPTypesetter.j +++ b/AppKit/CPTextView/CPTypesetter.j @@ -173,7 +173,7 @@ var CPSystemTypesetterFactory, rect = CGRectMake(lineOrigin.x, lineOrigin.y, _lineWidth, _lineHeight), containerSize = aContainer._size; - [_layoutManager _appendNewLineFragmentInTextContainer:_currentTextContainer forGlyphRange:lineRange] + [_layoutManager _appendNewLineFragmentInTextContainer:_currentTextContainer forGlyphRange:lineRange]; var fragment = [_layoutManager._lineFragments lastObject]; fragment._isLast = !sameLine; @@ -293,8 +293,8 @@ var CPSystemTypesetterFactory, if (!currentFont) currentFont = [_textStorage font] || [CPFont systemFontOfSize:12.0]; - ascent = [currentFont ascender] - descent = [currentFont descender] + ascent = [currentFont ascender]; + descent = [currentFont descender]; leading = (ascent - descent) * 0.2; // FAKE leading currentFontLineHeight = ascent - descent + leading; From 4fcc90d53e51cc4d2054fa203f9f4fed10fe11fd Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 09:28:31 -0700 Subject: [PATCH 21/69] Formatting: add missing semi-colon to _CPHudWindowView.j --- AppKit/CPWindow/_CPHUDWindowView.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPWindow/_CPHUDWindowView.j b/AppKit/CPWindow/_CPHUDWindowView.j index 9103eb562..22bde8bb1 100644 --- a/AppKit/CPWindow/_CPHUDWindowView.j +++ b/AppKit/CPWindow/_CPHUDWindowView.j @@ -183,7 +183,7 @@ if (_styleMask & CPClosableWindowMask) { [_closeButton setFrameOrigin:[self valueForThemeAttribute:@"close-image-origin"]]; - [_closeButton setFrameSize:[self valueForThemeAttribute:@"close-image-size"]] + [_closeButton setFrameSize:[self valueForThemeAttribute:@"close-image-size"]]; [_closeButton setImage:[self valueForThemeAttribute:@"close-image"]]; [_closeButton setAlternateImage:[self valueForThemeAttribute:@"close-active-image"]]; } From 15c3a6eae44daaefa462335422b52c7f89818610 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 09:38:43 -0700 Subject: [PATCH 22/69] Formatting: add missing semi-colons to CPWindow.j --- AppKit/CPWindow/CPWindow.j | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index 1b0171c38..ad5fd30f5 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -1903,7 +1903,7 @@ CPTexturedBackgroundWindowMask // Make sure the browser doesn't try to do its own tab handling. // This is important or the browser might blur the shared text field or token field input field, // even that we just moved it to a new first responder. - [[[anEvent window] platformWindow] _propagateCurrentDOMEvent:NO] + [[[anEvent window] platformWindow] _propagateCurrentDOMEvent:NO]; #endif return; } @@ -1917,7 +1917,7 @@ CPTexturedBackgroundWindowMask // Make sure the browser doesn't try to do its own tab handling. // This is important or the browser might blur the shared text field or token field input field, // even that we just moved it to a new first responder. - [[[anEvent window] platformWindow] _propagateCurrentDOMEvent:NO] + [[[anEvent window] platformWindow] _propagateCurrentDOMEvent:NO]; #endif } @@ -2009,13 +2009,13 @@ CPTexturedBackgroundWindowMask if (type == CPRightMouseDragged) { - selector = @selector(rightMouseDragged:) + selector = @selector(rightMouseDragged:); if (![_leftMouseDownView respondsToSelector:selector]) selector = nil; } if (!selector) - selector = @selector(mouseDragged:) + selector = @selector(mouseDragged:); return [_leftMouseDownView performSelector:selector withObject:anEvent]; From d8b27d122e30451f90b4398361e90449552e1325 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 09:41:10 -0700 Subject: [PATCH 23/69] Formatting: add semi-colons to CPPlatformPasteboard.j --- AppKit/Platform/DOM/CPPlatformPasteboard.j | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AppKit/Platform/DOM/CPPlatformPasteboard.j b/AppKit/Platform/DOM/CPPlatformPasteboard.j index 9ca0b3141..8d32fbccb 100644 --- a/AppKit/Platform/DOM/CPPlatformPasteboard.j +++ b/AppKit/Platform/DOM/CPPlatformPasteboard.j @@ -469,7 +469,7 @@ Return true if the event may be a copy and paste event, but the target is not an // By default we'll stop the native handling of the event since we're handling it ourselves. However, we need to // stop it before we send the event so that the event can overrule our choice. CPTextField for instance wants the // default handling when focused (which is to insert into the field). - [platformWindow _propagateCurrentDOMEvent:NO] + [platformWindow _propagateCurrentDOMEvent:NO]; [CPApp sendEvent:anEvent]; @@ -492,7 +492,7 @@ Return true if the event may be a copy and paste event, but the target is not an SUPPRESS_CAPPUCCINO_CUT_FOR_EVENT(anEvent); - [platformWindow _propagateCurrentDOMEvent:NO] + [platformWindow _propagateCurrentDOMEvent:NO]; // Let the app react through copy: and cut: actions. [CPApp sendEvent:anEvent]; From 9ea1a2b1ded7aec8524f9e933cecc37c92d0854f Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 10:46:02 -0700 Subject: [PATCH 24/69] Formatting: minor formatting updates in CPPlatformWindow+DOM.j MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Missing semi-colon on line 1425. Removed redundant `var` modifier on already declared variable on line 947. Added variable declaration to variable used without declaration on line 970. Removed redundant `var` modifier on already declared variable `CPDOMEventGetClickCount` removed var on latter declaration as original declaration has note stating it is to be declared at top so “so compressor knows about them.” --- AppKit/Platform/DOM/CPPlatformWindow+DOM.j | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j index 360fbf9f1..31a63529b 100644 --- a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j +++ b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j @@ -666,7 +666,8 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio } else if (type === "dragend") { - var dropEffect = aDOMEvent.dataTransfer.dropEffect; + var dropEffect = aDOMEvent.dataTransfer.dropEffect, + dragOperation; if (dropEffect === "move") dragOperation = CPDragOperationMove; @@ -944,8 +945,7 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio if (!theWindow) return; - var windowNumber = [theWindow windowNumber]; - + windowNumber = [theWindow windowNumber]; location = [theWindow convertBridgeToBase:location]; var event = [CPEvent mouseEventWithType:CPScrollWheel location:location modifierFlags:modifierFlags @@ -1422,7 +1422,7 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio var insertionIndex = 0; if (middle !== undefined) - insertionIndex = _windowLevels[middle] > aLevel ? middle : middle + 1 + insertionIndex = _windowLevels[middle] > aLevel ? middle : middle + 1; [_windowLevels insertObject:aLevel atIndex:insertionIndex]; layer._DOMElement.style.zIndex = aLevel + 1; // adding one avoids negative zIndices. These have been causing issues in Chrome @@ -1821,7 +1821,7 @@ var _CPEventFromNativeMouseEvent = function(aNativeEvent, anEventType, aPoint, m var CLICK_SPACE_DELTA = 5.0, CLICK_TIME_DELTA = (typeof document != "undefined" && document.addEventListener) ? 0.55 : 1.0; -var CPDOMEventGetClickCount = function(aComparisonEvent, aTimestamp, aLocation) +CPDOMEventGetClickCount = function(aComparisonEvent, aTimestamp, aLocation) { if (!aComparisonEvent) return 1; From 3799dd92fd5e0c4494dbf34845e1f1de3aae3e95 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 10:50:04 -0700 Subject: [PATCH 25/69] Formatting: fix possible misuse of commas in _CPImageAndTextView.j --- AppKit/_CPImageAndTextView.j | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AppKit/_CPImageAndTextView.j b/AppKit/_CPImageAndTextView.j index b09e0ee27..655a1f0ad 100644 --- a/AppKit/_CPImageAndTextView.j +++ b/AppKit/_CPImageAndTextView.j @@ -331,9 +331,9 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0, { var textStyle = _DOMTextElement.style; - textFrame.origin.y = parseInt(textStyle.top.substr(0, textStyle.top.length - 2), 10), - textFrame.origin.x = parseInt(textStyle.left.substr(0, textStyle.left.length - 2), 10), - textFrame.size.width = parseInt(textStyle.width.substr(0, textStyle.width.length - 2), 10), + textFrame.origin.y = parseInt(textStyle.top.substr(0, textStyle.top.length - 2), 10); + textFrame.origin.x = parseInt(textStyle.left.substr(0, textStyle.left.length - 2), 10); + textFrame.size.width = parseInt(textStyle.width.substr(0, textStyle.width.length - 2), 10); textFrame.size.height = parseInt(textStyle.height.substr(0, textStyle.height.length - 2), 10); textFrame.size.width += _textShadowOffset.width; From 0f40721cff876bf6b76280538ce2c2bd011c2395 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 13:29:40 -0700 Subject: [PATCH 26/69] Formatting: add semi-colon to _CPPopoverWindow.j --- AppKit/_CPPopoverWindow.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/_CPPopoverWindow.j b/AppKit/_CPPopoverWindow.j index 055611e98..159b26a6c 100644 --- a/AppKit/_CPPopoverWindow.j +++ b/AppKit/_CPPopoverWindow.j @@ -574,7 +574,7 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4, _isOpening = NO; [_delegate _popoverWindowDidShow]; - } + }; #if PLATFORM(DOM) _DOMElement.addEventListener(CPBrowserStyleProperty('transitionend'), _transitionCompleteFunction, YES); From 186048676ab0ec5d783f96db0e8f6bc5d8426504 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 13:31:19 -0700 Subject: [PATCH 27/69] Formatting: add semi-colon to _CPTooltip.j --- AppKit/_CPToolTip.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/_CPToolTip.j b/AppKit/_CPToolTip.j index 296293d02..83457ad3e 100644 --- a/AppKit/_CPToolTip.j +++ b/AppKit/_CPToolTip.j @@ -181,7 +181,7 @@ var _CPToolTipHeight = 24.0, textFrameSize.height += 4; _content = [CPTextField labelWithTitle:aString]; - [_content setFont:[CPFont systemFontOfSize:_CPToolTipFontSize]] + [_content setFont:[CPFont systemFontOfSize:_CPToolTipFontSize]]; [_content setLineBreakMode:CPLineBreakByCharWrapping]; [_content setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable]; [_content setFrameOrigin:CGPointMake(0.0, 0.0)]; From aa7e49cfde36b630da9258fd4b56b00b17a8c524 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 13:32:37 -0700 Subject: [PATCH 28/69] Formatting: add semi-colon to CPApplication.j --- AppKit/CPApplication.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPApplication.j b/AppKit/CPApplication.j index f20664030..100912937 100644 --- a/AppKit/CPApplication.j +++ b/AppKit/CPApplication.j @@ -216,7 +216,7 @@ var CPApplicationDelegate_applicationShouldTerminate_ = 1 << 0, } if ([_delegate respondsToSelector:@selector(applicationShouldTerminate:)]) - _implementedDelegateMethods |= CPApplicationDelegate_applicationShouldTerminate_ + _implementedDelegateMethods |= CPApplicationDelegate_applicationShouldTerminate_; if ([_delegate respondsToSelector:@selector(applicationShouldTerminateMessage:)]) _implementedDelegateMethods |= CPApplicationDelegate_applicationShouldTerminateMessage_ From ef462973c7b9a807eefb29a3b9be83d47e9b70ad Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 13:33:53 -0700 Subject: [PATCH 29/69] Formatting: add semi-colon to CPArrayController.j --- AppKit/CPArrayController.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPArrayController.j b/AppKit/CPArrayController.j index 67e2f681e..b26c0ced8 100644 --- a/AppKit/CPArrayController.j +++ b/AppKit/CPArrayController.j @@ -563,7 +563,7 @@ */ - (BOOL)setSelectionIndexes:(CPIndexSet)indexes { - [self _selectionWillChange] + [self _selectionWillChange]; var r = [self __setSelectionIndexes:indexes avoidEmpty:NO]; [self _selectionDidChange]; return r; From eb6d8d0bb39b31ec30837527f2856ef1abb8f651 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 14:09:28 -0700 Subject: [PATCH 30/69] Formatting: formally declared variable before use in CPColor.j Variable `isVertical` is used throughout the function `patternColorsFromPattern` in CPColor.j despite never being declared. In this pull request, the variable is declared formally in the variable list before its use. --- AppKit/CPColor.j | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AppKit/CPColor.j b/AppKit/CPColor.j index 813a0995a..a2fddb202 100644 --- a/AppKit/CPColor.j +++ b/AppKit/CPColor.j @@ -1247,7 +1247,8 @@ var patternColorsFromPattern = function(pattern, attributes, imageFactory) bottomHeight, centerWidthHeight, centerIsNil, - numParts; + numParts, + isVertical; // positions are mandatory if (pattern.indexOf("{position}") < 0) From 6c7f61d90fc1b9537d3ed53071a70009ea85e9b7 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 14:11:59 -0700 Subject: [PATCH 31/69] Formatting: add missing semi-colon to CPColorPicker.j --- AppKit/CPColorPicker.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPColorPicker.j b/AppKit/CPColorPicker.j index 66af9b289..6ee6ed8cc 100644 --- a/AppKit/CPColorPicker.j +++ b/AppKit/CPColorPicker.j @@ -247,7 +247,7 @@ _blackWheelImage = new Image(); _blackWheelImage.src = path; _blackWheelImage.style.opacity = "0"; - _blackWheelImage.style.filter = "alpha(opacity=0)" + _blackWheelImage.style.filter = "alpha(opacity=0)"; _blackWheelImage.style.position = "absolute"; _DOMElement.appendChild(_wheelImage); From 12c29c83871ba696cd8eebf90b97d7054d9ed664 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 14:17:42 -0700 Subject: [PATCH 32/69] Formatting: add missing semi-colons to CPEvent.j --- AppKit/CPEvent.j | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AppKit/CPEvent.j b/AppKit/CPEvent.j index 42dbad35b..a6e99f265 100644 --- a/AppKit/CPEvent.j +++ b/AppKit/CPEvent.j @@ -66,7 +66,7 @@ var _CPEventPeriodicEventPeriod = 0, CPWindow _window; Number _windowNumber; CPString _characters; - CPString _charactersIgnoringModifiers + CPString _charactersIgnoringModifiers; BOOL _isARepeat; unsigned _keyCode; DOMEvent _DOMEvent; @@ -642,7 +642,7 @@ var _CPEventPeriodicEventPeriod = 0, - (CPTrackingArea)trackingArea { if ((_type !== CPMouseEntered) && (_type !== CPMouseExited) && (_type !== CPCursorUpdate)) - [CPException raise:CPInternalInconsistencyException format:@"You can't call trackingArea for events of type %#x", _type] + [CPException raise:CPInternalInconsistencyException format:@"You can't call trackingArea for events of type %#x", _type]; return _trackingArea; } From 530c664967b0c5a48389e9e4e4ddbbbc5ec36e61 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 14:19:26 -0700 Subject: [PATCH 33/69] Formatting: add semi-colon to CPFont.j --- AppKit/CPFont.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPFont.j b/AppKit/CPFont.j index 90bc28826..65c6786c4 100644 --- a/AppKit/CPFont.j +++ b/AppKit/CPFont.j @@ -163,7 +163,7 @@ following: if (normalizedFaces === _CPFontSystemFontFace) return; - [self _invalidateSystemFontCache] + [self _invalidateSystemFontCache]; _CPFontSystemFontFace = aFace; } From 573e0acafa03c3f14dd080e635e524d7381e902a Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 14:25:59 -0700 Subject: [PATCH 34/69] Formatting: add semi-colon to CPImage.j Variable value assignment terminated in comma, despite not being a variable list. Replaced comma with semi-colon. --- AppKit/CPImage.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPImage.j b/AppKit/CPImage.j index e735673a4..1f31fed0c 100644 --- a/AppKit/CPImage.j +++ b/AppKit/CPImage.j @@ -246,7 +246,7 @@ function CPAppKitImage(aFilename, aSize) var canvas = document.createElement("canvas"), ctx = canvas.getContext("2d"); - canvas.width = _image.width, + canvas.width = _image.width; canvas.height = _image.height; ctx.drawImage(_image, 0, 0); From 6c07f9a0486fa3ee4b08077a64e5f60fef05fd0d Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 14:33:24 -0700 Subject: [PATCH 35/69] Formatting: add missing semi-colon to CPKeyValueBinding --- AppKit/CPKeyValueBinding.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPKeyValueBinding.j b/AppKit/CPKeyValueBinding.j index d524590d4..05a9fd585 100644 --- a/AppKit/CPKeyValueBinding.j +++ b/AppKit/CPKeyValueBinding.j @@ -857,7 +857,7 @@ var CPBindingOperationAnd = 0, - (id)initWithName:(CPString)aName { if (self = [super init]) - _name = aName + _name = aName; return self; } From f9b867c3eb561d3b9376bbd815012f9e567ee316 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 14:36:07 -0700 Subject: [PATCH 36/69] Formatting: Remove semi-colon after method header in CPLevelIndicator On lines 295 and 304, the selector for two method declarations are followed by a semi-colon. Not sure if this causes problems or not, but removed anyways. --- AppKit/CPLevelIndicator.j | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AppKit/CPLevelIndicator.j b/AppKit/CPLevelIndicator.j index c4e6422ee..94319181f 100644 --- a/AppKit/CPLevelIndicator.j +++ b/AppKit/CPLevelIndicator.j @@ -292,7 +292,7 @@ CPRatingLevelIndicatorStyle = 3; [self setNeedsLayout]; } -- (void)setWarningValue:(double)warningValue; +- (void)setWarningValue:(double)warningValue { if (_warningValue === warningValue) return; @@ -301,7 +301,7 @@ CPRatingLevelIndicatorStyle = 3; [self setNeedsLayout]; } -- (void)setCriticalValue:(double)criticalValue; +- (void)setCriticalValue:(double)criticalValue { if (_criticalValue === criticalValue) return; From a8a74a02461b2452acd8e8ff9645b78d8b59df36 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 14:37:34 -0700 Subject: [PATCH 37/69] Formatting: add semi-colons to CPOutlineView.j --- AppKit/CPOutlineView.j | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AppKit/CPOutlineView.j b/AppKit/CPOutlineView.j index eeec78938..e3533799f 100644 --- a/AppKit/CPOutlineView.j +++ b/AppKit/CPOutlineView.j @@ -1923,7 +1923,7 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0, while (index !== CPNotFound) { - [items addObject:[_outlineView itemAtRow:index]] + [items addObject:[_outlineView itemAtRow:index]]; index = [theIndexes indexGreaterThanIndex:index]; } @@ -1957,7 +1957,7 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0, - (void)_parentItemForDropOperation:(CPTableViewDropOperation)theDropOperation row:(CPInteger)theRow offset:(CGPoint)theOffset { if (theDropOperation === CPTableViewDropAbove) - return [_outlineView _parentItemForUpperRow:theRow - 1 andLowerRow:theRow atMouseOffset:theOffset] + return [_outlineView _parentItemForUpperRow:theRow - 1 andLowerRow:theRow atMouseOffset:theOffset]; return [_outlineView itemAtRow:theRow]; } From c1c6f5682c833ac14eb3cc6e8506a6671b7750c5 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 14:40:46 -0700 Subject: [PATCH 38/69] Formatting: add semi-colons to CPProgressIndicator.j --- AppKit/CPProgressIndicator.j | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AppKit/CPProgressIndicator.j b/AppKit/CPProgressIndicator.j index 683cc0127..61fb358d2 100644 --- a/AppKit/CPProgressIndicator.j +++ b/AppKit/CPProgressIndicator.j @@ -463,13 +463,13 @@ var CPProgressIndicatorSpinningStyleColors = []; var midX = CGRectGetMidX(rect), midY = CGRectGetMidY(rect), endAngle = Math.PI * 2 * (([self doubleValue] - [self minValue]) / ([self maxValue] - [self minValue])) - Math.PI / 2, - radius = MIN(rect.size.width / 2, rect.size.height / 2) + radius = MIN(rect.size.width / 2, rect.size.height / 2); CGContextBeginPath(context); CGContextSetLineWidth(context, borderSize); - CGContextSetFillColor(context, [self currentValueForThemeAttribute:@"circular-color"]) + CGContextSetFillColor(context, [self currentValueForThemeAttribute:@"circular-color"]); CGContextMoveToPoint(context, midX, midY); - CGContextAddArc(context, midX, midY, radius, 3 * Math.PI / 2, endAngle, YES) + CGContextAddArc(context, midX, midY, radius, 3 * Math.PI / 2, endAngle, YES); CGContextAddLineToPoint(context, midX, midY); CGContextClosePath(context); CGContextFillPath(context); @@ -478,7 +478,7 @@ var CPProgressIndicatorSpinningStyleColors = []; else if ([self doubleValue] == [self maxValue]) { CGContextBeginPath(context); - CGContextSetFillColor(context, [self currentValueForThemeAttribute:@"circular-color"]) + CGContextSetFillColor(context, [self currentValueForThemeAttribute:@"circular-color"]); CGContextAddEllipseInRect(context, rect); CGContextClosePath(context); CGContextFillPath(context); From 29f66bdfeda9ca762916fce70ed28596a21d14d0 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 14:41:53 -0700 Subject: [PATCH 39/69] Formatting: add missing semi-colon to CPScrollView.j --- AppKit/CPScrollView.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPScrollView.j b/AppKit/CPScrollView.j index f6de3acd0..c59178b2f 100644 --- a/AppKit/CPScrollView.j +++ b/AppKit/CPScrollView.j @@ -1253,7 +1253,7 @@ Notifies the delegate when the scroll view has finished scrolling. } if (_timerScrollersHide) - [_timerScrollersHide invalidate] + [_timerScrollersHide invalidate]; _timerScrollersHide = [CPTimer scheduledTimerWithTimeInterval:CPScrollViewFadeOutTime target:self selector:@selector(_hideScrollers:) userInfo:nil repeats:NO]; } From 6f72edc2d9a1f2f5aa0ac0a4d38e0aff31810076 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 14:45:13 -0700 Subject: [PATCH 40/69] Formatting: removed redundant variable in CPSearchField.j Variable `searches` is defined in the method selector, and then redeclared with the `var` keyword two lines later. Removed the redundant declaration, moving the variable assignment to its own line. --- AppKit/CPSearchField.j | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AppKit/CPSearchField.j b/AppKit/CPSearchField.j index ebdc86496..b6f42ba75 100644 --- a/AppKit/CPSearchField.j +++ b/AppKit/CPSearchField.j @@ -386,9 +386,9 @@ var CPAutosavedRecentsChangedNotification = @"CPAutosavedRecentsChangedNotificat */ - (void)setRecentSearches:(CPArray)searches { - var max = MIN([self maximumRecents], [searches count]), - searches = [searches subarrayWithRange:CPMakeRange(0, max)]; + var max = MIN([self maximumRecents], [searches count]); + searches = [searches subarrayWithRange:CPMakeRange(0, max)]; _recentSearches = searches; [self _autosaveRecentSearchList]; } From bae5bafc625d5957129c9b5655cb5e4df0f56b13 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 14:55:01 -0700 Subject: [PATCH 41/69] Formatting: add semi-colon to CPTableColumn.j --- AppKit/CPTableColumn.j | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AppKit/CPTableColumn.j b/AppKit/CPTableColumn.j index d1bce3c4a..1662782ee 100644 --- a/AppKit/CPTableColumn.j +++ b/AppKit/CPTableColumn.j @@ -287,7 +287,7 @@ CPTableColumnUserResizingMask = 1 << 1; if (width < [self minWidth]) [self setMinWidth:width]; else if (width > [self maxWidth]) - [self setMaxWidth:width] + [self setMaxWidth:width]; if (_width !== width) [self setWidth:width]; @@ -499,7 +499,7 @@ CPTableColumnUserResizingMask = 1 << 1; */ - (void)setHidden:(BOOL)shouldBeHidden { - shouldBeHidden = !!shouldBeHidden + shouldBeHidden = !!shouldBeHidden; if (_isHidden === shouldBeHidden) return; From e61aebb55d73b9f947518e17943965f686a19d9d Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 15:06:00 -0700 Subject: [PATCH 42/69] Formatting: minor formatting changes for CPTableView.j Added missing semi-colon on line 3763. Removed the redundant `var` keyword on line 4910 Removed the second redundant variable `CPTableViewHeaderViewKey` which was declared with the same name and value twice in the same variable block. --- AppKit/CPTableView.j | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/AppKit/CPTableView.j b/AppKit/CPTableView.j index 38a54b04e..989339290 100644 --- a/AppKit/CPTableView.j +++ b/AppKit/CPTableView.j @@ -3760,7 +3760,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad { if (!dataViewsForRow) { - dataViewsForRow = {} + dataViewsForRow = {}; _dataViewsForRows[row] = dataViewsForRow; } @@ -4907,7 +4907,7 @@ Your delegate can implement this method to avoid subclassing the tableview to ad row = _retargetedDropRow; if (row === nil) - var row = [self _proposedRowAtPoint:location]; + row = [self _proposedRowAtPoint:location]; return [self _sendDataSourceAcceptDrop:sender row:row dropOperation:operation]; } @@ -6118,7 +6118,6 @@ var CPTableViewDataSourceKey = @"CPTableViewDataSourceKey", CPTableViewGridStyleMaskKey = @"CPTableViewGridStyleMaskKey", CPTableViewUsesAlternatingBackgroundKey = @"CPTableViewUsesAlternatingBackgroundKey", CPTableViewAlternatingRowColorsKey = @"CPTableViewAlternatingRowColorsKey", - CPTableViewHeaderViewKey = @"CPTableViewHeaderViewKey", CPTableViewCornerViewKey = @"CPTableViewCornerViewKey", CPTableViewAutosaveNameKey = @"CPTableViewAutosaveNameKey", CPTableViewArchivedReusableViewsKey = @"CPTableViewArchivedReusableViewsKey"; From 01a1e506e4cef54776a2ab35d527a67448d7d1dc Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 15:08:21 -0700 Subject: [PATCH 43/69] Formatting: add missing semi-colons to CPTextField.j --- AppKit/CPTextField.j | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j index e0000f2cb..6eefbc083 100644 --- a/AppKit/CPTextField.j +++ b/AppKit/CPTextField.j @@ -331,7 +331,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder"); [CPTextFieldInputOwner keyUp:cappEvent]; [[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode]; - } + }; CPTextFieldDOMPasswordInputElement.oninput = CPTextFieldInputFunction; CPTextFieldDOMPasswordInputElement.onblur = CPTextFieldBlurHandler; @@ -1040,7 +1040,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder"); [[self window] platformWindow]._DOMBodyElement.ondrag = CPTextFieldCachedDragFunction; [[self window] platformWindow]._DOMBodyElement.onselectstart = CPTextFieldCachedSelectStartFunction; - CPTextFieldCachedSelectStartFunction = nil + CPTextFieldCachedSelectStartFunction = nil; CPTextFieldCachedDragFunction = nil; } @@ -1243,7 +1243,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder"); return; if (_implementedDelegateMethods & CPTextFieldDelegate_controlTextDidBeginEditing_) - [_delegate controlTextDidBeginEditing:[[CPNotification alloc] initWithName:CPControlTextDidBeginEditingNotification object:self userInfo:@{"CPFieldEditor": [note object]}]] + [_delegate controlTextDidBeginEditing:[[CPNotification alloc] initWithName:CPControlTextDidBeginEditingNotification object:self userInfo:@{"CPFieldEditor": [note object]}]]; [super textDidBeginEditing:note]; } @@ -1790,7 +1790,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder"); _implementedDelegateMethods = 0; if ([_delegate respondsToSelector:@selector(control:didFailToFormatString:errorDescription:)]) - _implementedDelegateMethods |= CPTextFieldDelegate_control_didFailToFormatString_errorDescription_ + _implementedDelegateMethods |= CPTextFieldDelegate_control_didFailToFormatString_errorDescription_; if ([_delegate respondsToSelector:@selector(controlTextDidBeginEditing:)]) _implementedDelegateMethods |= CPTextFieldDelegate_controlTextDidBeginEditing_; From c1fe28124faf65353ec73ed5abd5f68c3772f631 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 15:10:17 -0700 Subject: [PATCH 44/69] Formatting: add semi-colons to CPTokenField --- AppKit/CPTokenField.j | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AppKit/CPTokenField.j b/AppKit/CPTokenField.j index 1d4471a8c..e43605dc4 100644 --- a/AppKit/CPTokenField.j +++ b/AppKit/CPTokenField.j @@ -549,7 +549,7 @@ CPTokenFieldDeleteButtonType = 1; CPTokenFieldCachedSelectStartFunction = nil; CPTokenFieldCachedDragFunction = nil; - document.body.ondrag = CPTokenFieldCachedDragFunction + document.body.ondrag = CPTokenFieldCachedDragFunction; document.body.onselectstart = CPTokenFieldCachedSelectStartFunction } @@ -1247,7 +1247,7 @@ CPTokenFieldDeleteButtonType = 1; var scrollToToken = _shouldScrollTo; if (scrollToToken === CPScrollDestinationLeft) - scrollToToken = tokens[_selectedRange.location] + scrollToToken = tokens[_selectedRange.location]; else if (scrollToToken === CPScrollDestinationRight) scrollToToken = tokens[MAX(0, CPMaxRange(_selectedRange) - 1)]; [self _scrollTokenViewToVisible:scrollToToken]; From f41e7be726ec78cf04c89f4005505d12de70124e Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 15:11:52 -0700 Subject: [PATCH 45/69] Formatting: add semi-colons to CPToolbar.j --- AppKit/CPToolbar.j | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AppKit/CPToolbar.j b/AppKit/CPToolbar.j index b62aa82d6..54bece326 100644 --- a/AppKit/CPToolbar.j +++ b/AppKit/CPToolbar.j @@ -153,7 +153,7 @@ var CPToolbarsByIdentifier = nil, if (!toolbarsSharingIdentifier) { - toolbarsSharingIdentifier = [] + toolbarsSharingIdentifier = []; [CPToolbarsByIdentifier setObject:toolbarsSharingIdentifier forKey:identifier]; } @@ -588,7 +588,7 @@ var CPToolbarIdentifierKey = @"CPToolbarIdentifierKey", [aCoder encodeBool:_showsBaselineSeparator forKey:CPToolbarShowsBaselineSeparatorKey]; [aCoder encodeBool:_allowsUserCustomization forKey:CPToolbarAllowsUserCustomizationKey]; [aCoder encodeBool:_isVisible forKey:CPToolbarIsVisibleKey]; - [aCoder encodeInt:_sizeMode forKey:CPToolbarSizeModeKey] + [aCoder encodeInt:_sizeMode forKey:CPToolbarSizeModeKey]; [aCoder encodeObject:_identifiedItems forKey:CPToolbarIdentifiedItemsKey]; [aCoder encodeObject:_defaultItems forKey:CPToolbarDefaultItemsKey]; From f479d415d892f8d33fb05110e8dfab8e970f653c Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 15:13:03 -0700 Subject: [PATCH 46/69] Formatting: add missing semi-colon in CPView.j --- AppKit/CPView.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPView.j b/AppKit/CPView.j index 76c7f48e4..b81d2362a 100644 --- a/AppKit/CPView.j +++ b/AppKit/CPView.j @@ -449,7 +449,7 @@ var CPViewHighDPIDrawingEnabled = YES; return; if (!_toolTipFunctionIn) - _toolTipFunctionIn = function(e) { [_CPToolTip scheduleToolTipForView:self]; } + _toolTipFunctionIn = function(e) { [_CPToolTip scheduleToolTipForView:self]; }; if (!_toolTipFunctionOut) _toolTipFunctionOut = function(e) { [_CPToolTip invalidateCurrentToolTipIfNeeded]; }; From 1ea9a6c57f6b0eb17be3181ff953e7383658c0f7 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 4 Apr 2018 15:14:06 -0700 Subject: [PATCH 47/69] Formatting: add missing semi-colon to CPWindowController.j --- AppKit/CPWindowController.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPWindowController.j b/AppKit/CPWindowController.j index 2cfa3669c..c23702feb 100644 --- a/AppKit/CPWindowController.j +++ b/AppKit/CPWindowController.j @@ -364,7 +364,7 @@ { [viewControllerView removeFromSuperview]; [viewControllerView setFrame:[contentView frame]]; - [viewControllerView setAutoresizingMask:[contentView autoresizingMask]] + [viewControllerView setAutoresizingMask:[contentView autoresizingMask]]; [[self window] setContentView:viewControllerView]; } else From 927d6d2fc681d4cc33d5cfa4bfd5429a57847613 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Thu, 5 Apr 2018 21:36:32 +0200 Subject: [PATCH 48/69] fixed: backspace did not trigger scrolling properly --- AppKit/CPTextView/CPTextView.j | 1 + 1 file changed, 1 insertion(+) diff --git a/AppKit/CPTextView/CPTextView.j b/AppKit/CPTextView/CPTextView.j index fae2b59b2..aef8e5679 100644 --- a/AppKit/CPTextView/CPTextView.j +++ b/AppKit/CPTextView/CPTextView.j @@ -1614,6 +1614,7 @@ Sets the selection to a range of characters in response to user action. [self didChangeText]; [_layoutManager _validateLayoutAndGlyphs]; [self sizeToFit]; + [self scrollRangeToVisible:CPMakeRange(changedRange.location, 0)] _stickyXLocation = _caret._rect.origin.x; } From c222c5127fde9136acb5f6ab6998b78e20a4701c Mon Sep 17 00:00:00 2001 From: daniel Date: Sat, 7 Apr 2018 14:07:43 -0700 Subject: [PATCH 49/69] Formatting: add semi-colon to _CPPredicate.j --- Foundation/CPPredicate/_CPPredicate.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Foundation/CPPredicate/_CPPredicate.j b/Foundation/CPPredicate/_CPPredicate.j index 34001c415..e4010d086 100644 --- a/Foundation/CPPredicate/_CPPredicate.j +++ b/Foundation/CPPredicate/_CPPredicate.j @@ -287,7 +287,7 @@ - (id)initWithString:(CPString)format args:(CPArray)args { - self = [super initWithString:format] + self = [super initWithString:format]; if (self) { From f4400876da5dff3fe3d1ed79c86156d9544cdd90 Mon Sep 17 00:00:00 2001 From: daniel Date: Sat, 7 Apr 2018 14:10:03 -0700 Subject: [PATCH 50/69] Formatting: add semi-colon to CPArray+KVO.j --- Foundation/CPArray+KVO.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Foundation/CPArray+KVO.j b/Foundation/CPArray+KVO.j index 33fc4791f..b4a87bc7f 100644 --- a/Foundation/CPArray+KVO.j +++ b/Foundation/CPArray+KVO.j @@ -393,7 +393,7 @@ while (index !== CPNotFound) { - _remove(_proxyObject, _removeSEL, index) + _remove(_proxyObject, _removeSEL, index); index = [theIndexes indexLessThanIndex:index]; } } From d75124066ef604ee7a57ab13f24aa1d902b115f0 Mon Sep 17 00:00:00 2001 From: daniel Date: Sat, 7 Apr 2018 15:20:08 -0700 Subject: [PATCH 51/69] Formatting: add semi-colons to CPDateFormatter.j --- Foundation/CPDateFormatter.j | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Foundation/CPDateFormatter.j b/Foundation/CPDateFormatter.j index 3624b7208..65526d738 100644 --- a/Foundation/CPDateFormatter.j +++ b/Foundation/CPDateFormatter.j @@ -638,7 +638,7 @@ var defaultDateFormatterBehavior = CPDateFormatterBehavior10_4, if ([self _isEnglishFormat]) format += @"h:mm:ss a"; else - format += @"H:mm:ss" + format += @"H:mm:ss"; break; @@ -1218,7 +1218,7 @@ var defaultDateFormatterBehavior = CPDateFormatterBehavior10_4, if ([self _isEnglishFormat]) format += @" h:mm:ss a"; else - format += @" H:mm:ss" + format += @" H:mm:ss"; break; case CPDateFormatterLongStyle: @@ -1534,7 +1534,7 @@ var defaultDateFormatterBehavior = CPDateFormatterBehavior10_4, var month; if (length <= 2) - month = parseInt(dateComponent) + month = parseInt(dateComponent); if (length == 3) { @@ -1847,7 +1847,7 @@ var defaultDateFormatterBehavior = CPDateFormatterBehavior10_4, tmpDate.setFullYear(dateArray[0]); tmpDate.setMonth(0); - tmpDate.setDate(dayOfYear) + tmpDate.setDate(dayOfYear); dateArray[1] = tmpDate.getMonth() + 1; dateArray[2] = tmpDate.getDate(); From d39e3e2f69baee25a26ee707b5e79bc4ab6c018d Mon Sep 17 00:00:00 2001 From: daniel Date: Sat, 7 Apr 2018 15:22:36 -0700 Subject: [PATCH 52/69] Formatting: add semi-colon to CPDictionary.j --- Foundation/CPDictionary.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Foundation/CPDictionary.j b/Foundation/CPDictionary.j index f8c4fa6ac..15f7b83a7 100755 --- a/Foundation/CPDictionary.j +++ b/Foundation/CPDictionary.j @@ -276,7 +276,7 @@ var CPDictionaryMaxDescriptionRecursion = 10; while (argCount-- > 2) { var key = arguments[argCount--], - value = arguments[argCount] + value = arguments[argCount]; if (value === nil) [CPException raise:CPInvalidArgumentException reason:@"Attempt to insert nil object from objects[" + ((argCount / 2) - 1) + @"]"]; From 765384ace1d1109c336351f7ae867bc0dc98e26e Mon Sep 17 00:00:00 2001 From: daniel Date: Sat, 7 Apr 2018 15:26:52 -0700 Subject: [PATCH 53/69] Formatting: add semi-colons to CPIndexSet.j Variable assignments terminated in commas instead of semi-colons --- Foundation/CPIndexSet.j | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Foundation/CPIndexSet.j b/Foundation/CPIndexSet.j index 1783caf27..98d8f0604 100644 --- a/Foundation/CPIndexSet.j +++ b/Foundation/CPIndexSet.j @@ -512,8 +512,8 @@ if (options & CPEnumerationReverse) { - index = _ranges.length - 1, - stop = -1, + index = _ranges.length - 1; + stop = -1; increment = -1; } else @@ -593,8 +593,8 @@ if (anOptions & CPEnumerationReverse) { - index = _ranges.length - 1, - stop = -1, + index = _ranges.length - 1; + stop = -1; increment = -1; } else @@ -652,8 +652,8 @@ if (anOptions & CPEnumerationReverse) { - index = _ranges.length - 1, - stop = -1, + index = _ranges.length - 1; + stop = -1; increment = -1; } else From 53cb6a5b3e81aa354ec72f92e95b36c728da86a8 Mon Sep 17 00:00:00 2001 From: daniel Date: Sat, 7 Apr 2018 15:29:27 -0700 Subject: [PATCH 54/69] Formatting: add missing semi-colons to CPNotificationQueue.j --- Foundation/CPNotificationQueue.j | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Foundation/CPNotificationQueue.j b/Foundation/CPNotificationQueue.j index 5c497cfa9..bd9eb594f 100644 --- a/Foundation/CPNotificationQueue.j +++ b/Foundation/CPNotificationQueue.j @@ -300,7 +300,7 @@ var runLoop = [CPRunLoop mainRunLoop]; if (coalesceMask & CPNotificationCoalescingOnName && coalesceMask & CPNotificationCoalescingOnSender) { if ([notification object] == sender && [notification name] == name) - [notificationsToRemove addObject:notification] + [notificationsToRemove addObject:notification]; continue; } @@ -308,7 +308,7 @@ var runLoop = [CPRunLoop mainRunLoop]; if (coalesceMask & CPNotificationCoalescingOnName) { if ([notification name] == name) - [notificationsToRemove addObject:notification] + [notificationsToRemove addObject:notification]; continue; } @@ -316,7 +316,7 @@ var runLoop = [CPRunLoop mainRunLoop]; if (coalesceMask & CPNotificationCoalescingOnSender) { if ([notification object] == sender) - [notificationsToRemove addObject:notification] + [notificationsToRemove addObject:notification]; continue; } From 23af4505dd940c4a8867a58021057ce1ddef838b Mon Sep 17 00:00:00 2001 From: daniel Date: Sat, 7 Apr 2018 15:37:19 -0700 Subject: [PATCH 55/69] Fix: CPProxy uses incorrect variable name in method call On line 51 of CPProxy, `class_getInstanceMethod` is called with the variable `aSelector`, but this variable does not exist in the context, but a variable named `selector` does. This fix changes the method parameter from `selector` to `aSelector` to match the parameter used within the method. --- Foundation/CPProxy.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Foundation/CPProxy.j b/Foundation/CPProxy.j index 2234a6f39..9a4c229bc 100644 --- a/Foundation/CPProxy.j +++ b/Foundation/CPProxy.j @@ -48,7 +48,7 @@ return class_createInstance(self); } -+ (BOOL)respondsToSelector:(SEL)selector ++ (BOOL)respondsToSelector:(SEL)aSelector { return !!class_getInstanceMethod(isa, aSelector); } From c8d01549ba853d98ef52211d830146bab7cd999f Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 7 Apr 2018 16:13:20 -0700 Subject: [PATCH 56/69] Formatting: add semi-colon to CPUserNotification.j --- Foundation/CPUserNotification.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Foundation/CPUserNotification.j b/Foundation/CPUserNotification.j index 91c41a53e..4b3588ac6 100644 --- a/Foundation/CPUserNotification.j +++ b/Foundation/CPUserNotification.j @@ -59,7 +59,7 @@ CPUserNotificationActivationTypeActionButtonClicked = 2; @group CPUserNotificationActivationType The user replied to the notification. */ -CPUserNotificationActivationTypeReplied = 3, +CPUserNotificationActivationTypeReplied = 3; /*! @global CPUserNotificationActivationType From a005a468a72e49ebb93f80248f936e8aa646fd82 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 7 Apr 2018 16:40:52 -0700 Subject: [PATCH 57/69] Formatting: add semi-colons to nib2cib/Converter.j --- Tools/nib2cib/Converter.j | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/nib2cib/Converter.j b/Tools/nib2cib/Converter.j index 19db97fee..330d3c526 100644 --- a/Tools/nib2cib/Converter.j +++ b/Tools/nib2cib/Converter.j @@ -39,8 +39,8 @@ var FILE = require("file"), SharedConverter = nil; -NibFormatUndetermined = 0, -NibFormatMac = 1, +NibFormatUndetermined = 0; +NibFormatMac = 1; NibFormatIPhone = 2; ConverterModeLegacy = 0; From fbaf87ec6c16304b63a71c8cfce9f648d0b2815d Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 7 Apr 2018 17:03:33 -0700 Subject: [PATCH 58/69] Formatting: add missing semi-colon in CPTheme.j --- AppKit/CPTheme.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPTheme.j b/AppKit/CPTheme.j index 0fa38f7d5..459615181 100644 --- a/AppKit/CPTheme.j +++ b/AppKit/CPTheme.j @@ -769,7 +769,7 @@ var ParentAttributeForCoder = nil; if ([aCoder containsValueForKey:@"state"]) state = [aCoder decodeObjectForKey:@"state"]; else - state = CPThemeStateNormalString + state = CPThemeStateNormalString; [_values setObject:[aCoder decodeObjectForKey:"value"] forKey:state]; } From f285efc277950f4c7834081b6f75985922a9d470 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 7 Apr 2018 17:15:36 -0700 Subject: [PATCH 59/69] Formatting: add semi-colon to Nib2Cib.j --- Tools/nib2cib/Nib2Cib.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/nib2cib/Nib2Cib.j b/Tools/nib2cib/Nib2Cib.j index 684756271..39ce3f7a7 100644 --- a/Tools/nib2cib/Nib2Cib.j +++ b/Tools/nib2cib/Nib2Cib.j @@ -842,7 +842,7 @@ var FILE = require("file"), // By default when we try to load the bundle it will use the CommonJS environment, // but we want the Browser environment. So we override mostEligibleEnvironment(). - themeBundle.mostEligibleEnvironment = function() { return "Browser"; } + themeBundle.mostEligibleEnvironment = function() { return "Browser"; }; themeBundle.load(); var keyedThemes = themeBundle.valueForInfoDictionaryKey("CPKeyedThemes"); From a3a2ee118e4b07dd3f14e3191f2bbfdfe751b768 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 7 Apr 2018 17:17:19 -0700 Subject: [PATCH 60/69] Formatting: add semi-colon to NSCustomResource.j --- Tools/nib2cib/NSCustomResource.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/nib2cib/NSCustomResource.j b/Tools/nib2cib/NSCustomResource.j index 7f4f6d1fc..2d78af3e0 100644 --- a/Tools/nib2cib/NSCustomResource.j +++ b/Tools/nib2cib/NSCustomResource.j @@ -88,7 +88,7 @@ var FILE = require("file"), if (resourceInfo && resourceInfo.path) { // Include subdirectories in the name - match = /^.+\/Resources\/(.+)$/.exec(resourceInfo.path) + match = /^.+\/Resources\/(.+)$/.exec(resourceInfo.path); _resourceName = match[1]; } } From 41d8ad2b869de27cfb9587b4a00ffdd662eb7fea Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 7 Apr 2018 17:20:00 -0700 Subject: [PATCH 61/69] Formatting: add semi-colons to capp/main.j --- Tools/capp/main.j | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tools/capp/main.j b/Tools/capp/main.j index eb17585d5..d563c98e0 100644 --- a/Tools/capp/main.j +++ b/Tools/capp/main.j @@ -46,14 +46,14 @@ function printUsage() print(" -l Same as --symlink --build, symlinks $CAPP_BUILD Frameworks into your project"); print(" -t, --template NAME Specify the template name to use (see `capp gen --list-templates`)"); print(" -f, --frameworks Copy/symlink *only* the Frameworks directory to a new or existing project"); - print(" -F, --framework NAME Additional framework to copy/symlink (default: Objective-J, Foundation, AppKit)") - print(" -T, --theme NAME Additional Theme to copy/symlink into Resource (default: nothing)") + print(" -F, --framework NAME Additional framework to copy/symlink (default: Objective-J, Foundation, AppKit)"); + print(" -T, --theme NAME Additional Theme to copy/symlink into Resource (default: nothing)"); print(" --force Overwrite Frameworks directory if it already exists"); print(" --symlink Symlink the source Frameworks directory to the project, don't copy"); print(" --build Copy/symlink the Frameworks directory files from your $CAPP_BUILD directory"); print(" --noconfig Use the default configuration when replacing template variables"); print(""); - print(" Without -l or --build, frameworks from your narwhal installation are copied/symlinked") + print(" Without -l or --build, frameworks from your narwhal installation are copied/symlinked"); print(""); print(" gen --list-templates List the template names available for use with `capp gen -t/--template`"); print(" gen --list-frameworks List the framework names available for use with `capp gen -F/--framework`"); From 314e64d7b16bc0b71c61bdd626a1a455faca59f8 Mon Sep 17 00:00:00 2001 From: bedalton Date: Mon, 9 Apr 2018 03:40:11 -0700 Subject: [PATCH 62/69] Formatting: add semi-colon to CPTextView.j (#2676) --- AppKit/CPTextView/CPTextView.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPTextView/CPTextView.j b/AppKit/CPTextView/CPTextView.j index 8877c4c3b..3c8083ff5 100644 --- a/AppKit/CPTextView/CPTextView.j +++ b/AppKit/CPTextView/CPTextView.j @@ -1614,7 +1614,7 @@ Sets the selection to a range of characters in response to user action. [self didChangeText]; [_layoutManager _validateLayoutAndGlyphs]; [self sizeToFit]; - [self scrollRangeToVisible:CPMakeRange(changedRange.location, 0)] + [self scrollRangeToVisible:CPMakeRange(changedRange.location, 0)]; _stickyXLocation = _caret._rect.origin.x; } From 7e6e117b17c79c35f97a04700c7e625a89b4e9e5 Mon Sep 17 00:00:00 2001 From: bedalton Date: Mon, 9 Apr 2018 03:40:41 -0700 Subject: [PATCH 63/69] Formatting: add semi-colon to CPTextContainer.j (#2675) --- AppKit/CPTextView/CPTextContainer.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPTextView/CPTextContainer.j b/AppKit/CPTextView/CPTextContainer.j index f9e988816..7797cd526 100644 --- a/AppKit/CPTextView/CPTextContainer.j +++ b/AppKit/CPTextView/CPTextContainer.j @@ -80,7 +80,7 @@ CPLineMovesUp = 4; @implementation CPTextContainer : CPObject { float _lineFragmentPadding @accessors(property=lineFragmentPadding); - CGSize _size @accessors(property=containerSize) + CGSize _size @accessors(property=containerSize); CPLayoutManager _layoutManager @accessors(property=layoutManager); CPTextView _textView @accessors(property=textView); BOOL _inResizing; From 7909bae0654a4c93d11f753dfca15df89653b2b3 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Mon, 9 Apr 2018 13:19:18 +0200 Subject: [PATCH 64/69] Fixed: touch-scrolling did not work (#2612) --- AppKit/Platform/DOM/CPPlatformWindow+DOM.j | 65 +++++++++++++++------- 1 file changed, 45 insertions(+), 20 deletions(-) diff --git a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j index 31a63529b..d3784af63 100644 --- a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j +++ b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j @@ -205,6 +205,9 @@ var resizeTimer = nil; var PreventScroll = true; var blurTimer = nil; +var touchStartingPointX, + touchStartingPointY; + _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotification"; @@ -1152,10 +1155,26 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio - (void)touchEvent:(DOMEvent)aDOMEvent { + var newEvent = {}, + touch = aDOMEvent.touches.length ? aDOMEvent.touches[0] : aDOMEvent.changedTouches[0]; + + newEvent.timestamp = [CPEvent currentTimestamp]; + newEvent.target = aDOMEvent.target; + newEvent.shiftKey = newEvent.ctrlKey = newEvent.altKey = newEvent.metaKey = false; + + newEvent.clientX = touch.clientX; + + /* + Normally the document can't scroll in Cappuccino: our body element has top:0 and bottom:0 with absolute positioning. So it should always be exactly the height of the viewport. The below handles a special case. iOS scrolls the document when the virtual keyboard is present and it needs to move a text input upwards visually to avoid covering the input with the keyboard. For most purposes we can ignore this, except here. In theory I think we could always apply this (scrollTop should always be 0 on every other device and situation) but let's be defensive and only apply it for touch events to minimise the risk of surprises. + */ + newEvent.clientY = _DOMWindow.document.body.scrollTop + touch.clientY; + + newEvent.preventDefault = function() { if (aDOMEvent.preventDefault) aDOMEvent.preventDefault() }; + newEvent.stopPropagation = function() { if (aDOMEvent.stopPropagation) aDOMEvent.stopPropagation() }; + + // single finger event-> simulate a simple mouse-click if (aDOMEvent.touches && (aDOMEvent.touches.length == 1 || (aDOMEvent.touches.length == 0 && aDOMEvent.changedTouches.length == 1))) { - var newEvent = {}; - switch (aDOMEvent.type) { case CPDOMEventTouchStart: newEvent.type = CPDOMEventMouseDown; @@ -1168,36 +1187,42 @@ _CPPlatformWindowWillCloseNotification = @"_CPPlatformWindowWillCloseNotificatio break; } - var touch = aDOMEvent.touches.length ? aDOMEvent.touches[0] : aDOMEvent.changedTouches[0]; - - newEvent.clientX = touch.clientX; - - /* - Normally the document can't scroll in Cappuccino: our body element has top:0 and bottom:0 with absolute positioning. So it should always be exactly the height of the viewport. The below handles a special case. iOS scrolls the document when the virtual keyboard is present and it needs to move a text input upwards visually to avoid covering the input with the keyboard. For most purposes we can ignore this, except here. In theory I think we could always apply this (scrollTop should always be 0 on every other device and situation) but let's be defensive and only apply it for touch events to minimise the risk of surprises. - */ - newEvent.clientY = _DOMWindow.document.body.scrollTop + touch.clientY; - - newEvent.timestamp = [CPEvent currentTimestamp]; - newEvent.target = aDOMEvent.target; - - newEvent.shiftKey = newEvent.ctrlKey = newEvent.altKey = newEvent.metaKey = false; - - newEvent.preventDefault = function() { if (aDOMEvent.preventDefault) aDOMEvent.preventDefault() }; - newEvent.stopPropagation = function() { if (aDOMEvent.stopPropagation) aDOMEvent.stopPropagation() }; - [self mouseEvent:newEvent]; return; } else { + // two fingers->simulate scrolling events + if (aDOMEvent.touches && aDOMEvent.touches.length == 2) + { + switch (aDOMEvent.type) + { + case CPDOMEventTouchStart: + touchStartingPointX = touch.pageX; + touchStartingPointY = touch.pageY; + break; + case CPDOMEventTouchMove: + newEvent._hasPreciseScrollingDeltas = YES; + newEvent.deltaX = touchStartingPointX - touch.pageX; + newEvent.deltaY = touchStartingPointY - touch.pageY; + newEvent.type = CPDOMEventScrollWheel; + + [self scrollEvent:newEvent]; + + touchStartingPointX = touch.pageX; + touchStartingPointY = touch.pageY; + return; + } + } + // handle other touch cases specifically + if (aDOMEvent.preventDefault) aDOMEvent.preventDefault(); if (aDOMEvent.stopPropagation) aDOMEvent.stopPropagation(); } - // handle touch cases specifically } - (void)mouseEvent:(DOMEvent)aDOMEvent From f961625f03c76190e8da5b294fc81ab5dd88814c Mon Sep 17 00:00:00 2001 From: daboe01 Date: Wed, 11 Apr 2018 18:30:47 +0200 Subject: [PATCH 65/69] fixed: some events were not propagated to the bridge window --- AppKit/CPWindow/CPWindow.j | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index f20a5b858..8a4dde260 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -2117,6 +2117,9 @@ CPTexturedBackgroundWindowMask /* @ignore */ - (BOOL)_isFrontmostWindow { + if ([self isFullBridge]) + return YES; + var orderedWindows = [CPApp orderedWindows]; if ([orderedWindows count] == 0) From 535f981739d65113308aed7d6da5995fe4993640 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Thu, 12 Apr 2018 09:25:12 +0200 Subject: [PATCH 66/69] Fixed: TextView bindings wrote data on blur even when not editable (#2582) --- AppKit/CPTextView/CPTextView.j | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AppKit/CPTextView/CPTextView.j b/AppKit/CPTextView/CPTextView.j index 3c8083ff5..91ea5ebf1 100644 --- a/AppKit/CPTextView/CPTextView.j +++ b/AppKit/CPTextView/CPTextView.j @@ -2250,7 +2250,8 @@ Sets the selection to a range of characters in response to user action. [[self class] _binderClassForBinding:CPValueBinding], theBinding = [binderClass getBinding:CPAttributedStringBinding forObject:self] || [binderClass getBinding:CPValueBinding forObject:self]; - [theBinding reverseSetValueFor:@"objectValue"]; + if (theBinding && [self isEditable]) + [theBinding reverseSetValueFor:@"objectValue"]; } @end From b8b48b533bcfc10a5a316ec81487626a084cdfdd Mon Sep 17 00:00:00 2001 From: cacaodev Date: Thu, 12 Apr 2018 11:25:43 +0200 Subject: [PATCH 67/69] Previously, animating frame origin was not working on recent versions of Gecko (Firefox). The format for the matrix value of the transform property was matrix(a,b,c,d,tx,ty) and tx and ty had the "px" suffix. According to this page, tx and ty were accept (#2677) ed (in my understanding not required) to have this suffix before FireFox 16. All parameters are now numbers without suffix and this code will work for all FireFox versions supporting css animations. --- AppKit/CoreAnimation/CPViewAnimator.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CoreAnimation/CPViewAnimator.j b/AppKit/CoreAnimation/CPViewAnimator.j index f448061ae..0e2db6c59 100644 --- a/AppKit/CoreAnimation/CPViewAnimator.j +++ b/AppKit/CoreAnimation/CPViewAnimator.j @@ -214,7 +214,7 @@ var transformSizeToHeight = function(start, current) var CSSStringFromCGAffineTransform = function(anAffineTransform) { - return "matrix(" + anAffineTransform.a + ", " + anAffineTransform.b + ", " + anAffineTransform.c + ", " + anAffineTransform.d + ", " + anAffineTransform.tx + (CPBrowserIsEngine(CPGeckoBrowserEngine) ? "px, " : ", ") + anAffineTransform.ty + (CPBrowserIsEngine(CPGeckoBrowserEngine) ? "px)" : ")"); + return [CPString stringWithFormat:@"matrix(%d,%d,%d,%d,%d,%d)", anAffineTransform.a, anAffineTransform.b, anAffineTransform.c, anAffineTransform.d, anAffineTransform.tx, anAffineTransform.ty]; }; var frameOriginToCSSTransformMatrix = function(start, current) From 7de91da87af9dd8286f704dd785cac0841560ae4 Mon Sep 17 00:00:00 2001 From: bedalton Date: Fri, 13 Apr 2018 03:09:46 -0700 Subject: [PATCH 68/69] Fix: rename _placeHolderView and add accessors in CPTabView.j (#2678) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In CPTabView.j on line 706 method is called `[_source _setPlaceholderView:aValue]; ` this method does not exist, and this call could possibly be expecting the property `_placeHolderView` to have an accessor method. To add the correct accessor method the case of either the method call selector or the variable must change — `_placeHolderView` vs `_placeholderView`. For this fix I selected the `_placeholderView` spelling, as opposed to the alternative with the capitalized “holder” in “placeholder.” Fixes #2674 --- AppKit/CPTabView.j | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/AppKit/CPTabView.j b/AppKit/CPTabView.j index ad26ad45f..80c15e12c 100644 --- a/AppKit/CPTabView.j +++ b/AppKit/CPTabView.j @@ -67,7 +67,7 @@ var CPTabViewDidSelectTabViewItemSelector = 1 << 1, CPSegmentedControl _tabs; _CPTabViewBox _box; - CPView _placeHolderView; + CPView _placeholderView @accessors; CPTabViewItem _selectedTabViewItem; @@ -106,7 +106,7 @@ var CPTabViewDidSelectTabViewItemSelector = 1 << 1, [self addSubview:_box]; [self addSubview:_tabs]; - _placeHolderView = nil; + _placeholderView = nil; } - (CPArray)items @@ -617,7 +617,7 @@ var CPTabViewDidSelectTabViewItemSelector = 1 << 1, - (CPBinder)binderForBinding:(CPString)aBinding { - var cls = [[self class] _binderClassForBinding:aBinding] + var cls = [[self class] _binderClassForBinding:aBinding]; return [cls getBinding:aBinding forObject:self]; } @@ -652,17 +652,17 @@ var CPTabViewDidSelectTabViewItemSelector = 1 << 1, - (void)_displayPlaceholder:(CPString)aPlaceholder { - if (_placeHolderView == nil) + if (_placeholderView == nil) { - _placeHolderView = [[CPView alloc] initWithFrame:CGRectMakeZero()]; + _placeholderView = [[CPView alloc] initWithFrame:CGRectMakeZero()]; var textField = [[CPTextField alloc] initWithFrame:CGRectMakeZero()]; [textField setTag:1000]; [textField setTextColor:[CPColor whiteColor]]; [textField setFont:[CPFont boldFontWithName:@"Geneva" size:18 italic:YES]]; - [_placeHolderView addSubview:textField]; + [_placeholderView addSubview:textField]; } - var textField = [_placeHolderView viewWithTag:1000]; + var textField = [_placeholderView viewWithTag:1000]; [textField setStringValue:aPlaceholder]; [textField sizeToFit]; @@ -672,7 +672,7 @@ var CPTabViewDidSelectTabViewItemSelector = 1 << 1, [textField setFrameOrigin:origin]; - [self _displayItemView:_placeHolderView]; + [self _displayItemView:_placeholderView]; } #pragma mark - From 20be4a40eae253b715abe8fdd073b708902090b7 Mon Sep 17 00:00:00 2001 From: Didier Korthoudt Date: Fri, 27 Apr 2018 09:27:01 +0200 Subject: [PATCH 69/69] NEW: Add CSS theming support (#2613) --- AppKit/CPColor.j | 229 ++++++++++++++++++++++++++++++++++- AppKit/CPImage.j | 219 ++++++++++++++++++++++++++++++++- AppKit/CPImageView.j | 39 +++++- AppKit/CPTheme.j | 68 +++++++++++ AppKit/CPThemeBlend.j | 11 ++ AppKit/CPView.j | 57 ++++++++- AppKit/_CPImageAndTextView.j | 168 +++++++++++++++---------- AppKit/_CPObject+Theme.j | 28 ++++- 8 files changed, 737 insertions(+), 82 deletions(-) diff --git a/AppKit/CPColor.j b/AppKit/CPColor.j index a2fddb202..2ba97a1cc 100644 --- a/AppKit/CPColor.j +++ b/AppKit/CPColor.j @@ -103,7 +103,8 @@ var cachedBlackColor, @"alternate-selected-control-color": [CPNull null], @"secondary-selected-control-color": [CPNull null], @"selected-text-background-color": [CPNull null], - @"selected-text-inactive-background-color": [CPNull null] + @"selected-text-inactive-background-color": [CPNull null], + @"css-based": NO }; } @@ -876,9 +877,221 @@ url("data:image/png;base64,BASE64ENCODEDDATA") // if there is a pattern image @end +#pragma mark - +#pragma mark CSS Theming + +// The code below adds support for CSS theming with 100% compatibility with current theming system. +// The idea is to extend CPColor (and CPImage) with CSS components and adapt low level UI components to +// support this new kind of CPColor/CPImage. See CPImageView, CPView and _CPImageAndTextView. +// +// To create a CPColor that uses CSS, simply use the new class method : +// + (CPColor)colorWithCSSDictionary:(CPDictionary)aDictionary beforeDictionary:(CPDictionary)beforeDictionary afterDictionary:(CPDictionary)afterDictionary +// where beforeDictionary & afterDictionary are related to ::before & ::after pseudo-elements. +// If you don't need them, just use the simplified class method : +// + (CPColor)colorWithCSSDictionary:(CPDictionary)aDictionary +// +// Example : +// buttonCssColor = [CPColor colorWithCSSDictionary:@{ +// @"background-color": A3ColorBackgroundWhite, +// @"border-color": A3ColorActiveBorder, +// @"border-style": @"solid", +// @"border-width": @"1px", +// @"border-radius": @"3px", +// @"box-sizing": @"border-box" +// } +// beforeDictionary:@{ +// @"background-color": @"rgb(225,225,225)", +// @"bottom": @"3px", +// @"content": @"''", +// @"position": @"absolute", +// @"right": @"21px", +// @"top": @"3px", +// @"width": @"1px" +// } +// afterDictionary:@{ +// @"content": @"''", +// @"bottom": @"3px", +// @"right": @"6px", +// @"top": @"1px", +// @"position": @"absolute", +// @"height": @"14px", +// @"width": @"9px", +// @"margin": @"2px 0px 2px 0px", +// @"background-image": @"url(%%packed.png)", +// @"background-position": @"0px -64px", +// @"background-repeat": @"no-repeat", +// @"background-size": @"100px 400px" +// }]; +// +// Remark : Please note the special URL of the background image used in this example : url(%%packed.png) +// During theme loading, "%%" will be replaced by the path to the theme blend resources folder. +// Typically, a CSS theme will use some (rare) images all packed together in a single image resource (see packed.png in Aristo3 theme) +// +// Also, please note that if you don't use one of the CSS components, you can either set it to nil (best solution) or to an empty dictionary, like : +// aCssColor = [CPColor colorWithCSSDictionary:@{} beforeDictionary:nil afterDictionary:@{ ... }]; +// +// You can use -(BOOL)isCSSBased to determine how to cope with it in your code. +// -(BOOL)hasCSSDictionary, -(BOOL)hasCSSBeforeDictionary and -(BOOL)hasCSSAfterDictionary are convience methods you can use. +// +// Remark : -(void)restorePreviousCSSState and -(DOMElement)applyCSSColorForView are meant to be used by low level UI widgets (like CPView) to implement +// CSS theme support. + +@implementation CPColor (CSSTheming) +{ + CPDictionary _cssDictionary @accessors(property=cssDictionary); + CPDictionary _cssBeforeDictionary @accessors(property=cssBeforeDictionary); + CPDictionary _cssAfterDictionary @accessors(property=cssAfterDictionary); +} + ++ (CPColor)colorWithCSSDictionary:(CPDictionary)aDictionary +{ + return [[CPColor alloc] _initWithCSSDictionary:aDictionary beforeDictionary:nil afterDictionary:nil]; +} + ++ (CPColor)colorWithCSSDictionary:(CPDictionary)aDictionary beforeDictionary:(CPDictionary)beforeDictionary afterDictionary:(CPDictionary)afterDictionary +{ + return [[CPColor alloc] _initWithCSSDictionary:aDictionary beforeDictionary:beforeDictionary afterDictionary:afterDictionary]; +} + +- (id)_initWithCSSDictionary:(CPDictionary)aDictionary beforeDictionary:(CPDictionary)beforeDictionary afterDictionary:(CPDictionary)afterDictionary +{ + self = [super init]; + + if (self) + { + _cssDictionary = aDictionary; + _cssBeforeDictionary = beforeDictionary; + _cssAfterDictionary = afterDictionary; + _components = [0.0, 0.0, 0.0, 1.0]; + + _theme = [CPTheme defaultTheme]; + _themeState = CPThemeStateNormal; + [self _loadThemeAttributes]; + } + + return self; +} + +- (BOOL)isCSSBased +{ + return !!(_cssDictionary || _cssBeforeDictionary || _cssAfterDictionary); +} + +- (BOOL)hasCSSDictionary +{ + return ([_cssDictionary count] > 0); +} + +- (BOOL)hasCSSBeforeDictionary +{ + return ([_cssBeforeDictionary count] > 0); +} + +- (BOOL)hasCSSAfterDictionary +{ + return ([_cssAfterDictionary count] > 0); +} + +- (void)restorePreviousCSSState:(CPArrayRef)aPreviousStateRef forDOMElement:(DOMElement)aDOMElement +{ +#if PLATFORM(DOM) + var aPreviousState = @deref(aPreviousStateRef); + + for (var i = 0, count = aPreviousState.length; i < count; i++) + aDOMElement.style[aPreviousState[i][0]] = aPreviousState[i][1]; + + @deref(aPreviousStateRef) = @[]; +#endif +} + +- (DOMElement)applyCSSColorForView:(CPView)aView onDOMElement:(DOMElement)aDOMElement styleNode:(DOMElement)aStyleNode previousState:(CPArrayRef)aPreviousStateRef +{ +#if PLATFORM(DOM) + var aPreviousState = @deref(aPreviousStateRef); + + [_cssDictionary enumerateKeysAndObjectsUsingBlock:function(aKey, anObject, stop) + { + [aPreviousState addObject:@[aKey, aDOMElement.style[aKey]]]; + aDOMElement.style[aKey] = anObject; + }]; + + if ([self hasCSSBeforeDictionary] || [self hasCSSAfterDictionary]) + { + // We need to create a unique class name + + var styleClassName = @".CP" + [aView UID], + styleContent = @""; + + if ([self hasCSSBeforeDictionary]) + { + styleContent += styleClassName + @"::before { "; + + [_cssBeforeDictionary enumerateKeysAndObjectsUsingBlock:function(aKey, anObject, stop) + { + styleContent += aKey + ": " + anObject + "; "; + }]; + + styleContent += "} "; + } + + if ([self hasCSSAfterDictionary]) + { + styleContent += styleClassName + @"::after { "; + + [_cssAfterDictionary enumerateKeysAndObjectsUsingBlock:function(aKey, anObject, stop) + { + styleContent += aKey + ": " + anObject + "; "; + }]; + + styleContent += "} "; + } + + var styleDescription = document.createTextNode(styleContent); + + if (!aStyleNode) + { + aStyleNode = document.createElement("style"); + + aView._DOMElement.insertBefore(aStyleNode, aView._DOMElement.firstChild); + + aStyleNode.appendChild(styleDescription); + } + else + { + aStyleNode.replaceChild(styleDescription, aStyleNode.firstChild); + } + + [aView setDOMClassName:@"CP"+[aView UID]]; + } + else + { + // no before/after so remove aStyleNode if existing + + if (aStyleNode) + { + aView._DOMElement.removeChild(aStyleNode); + aStyleNode = nil; + } + } + + // Return actualised values + + @deref(aPreviousStateRef) = aPreviousState; + + return aStyleNode; +#endif +} + +@end + +#pragma mark - + /// @cond IGNORE -var CPColorComponentsKey = @"CPColorComponentsKey", - CPColorPatternImageKey = @"CPColorPatternImageKey"; +var CPColorComponentsKey = @"CPColorComponentsKey", + CPColorPatternImageKey = @"CPColorPatternImageKey", + CPColorCssDictionaryKey = @"CPColorCssDictionaryKey", + CPColorCssBeforeDictionaryKey = @"CPColorCssBeforeDictionaryKey", + CPColorCssAfterDictionaryKey = @"CPColorCssAfterDictionaryKey"; /// @endcond @implementation CPColor (CPCoding) @@ -891,6 +1104,10 @@ var CPColorComponentsKey = @"CPColorComponentsKey", { if ([aCoder containsValueForKey:CPColorPatternImageKey]) self = [self _initWithPatternImage:[aCoder decodeObjectForKey:CPColorPatternImageKey]]; + else if ([aCoder containsValueForKey:CPColorCssDictionaryKey]) + self = [self _initWithCSSDictionary:[aCoder decodeObjectForKey:CPColorCssDictionaryKey] + beforeDictionary:[aCoder decodeObjectForKey:CPColorCssBeforeDictionaryKey] + afterDictionary:[aCoder decodeObjectForKey:CPColorCssAfterDictionaryKey]]; else self = [self _initWithRGBA:[aCoder decodeObjectForKey:CPColorComponentsKey]]; @@ -907,6 +1124,12 @@ var CPColorComponentsKey = @"CPColorComponentsKey", { if (_patternImage) [aCoder encodeObject:_patternImage forKey:CPColorPatternImageKey]; + else if (_cssDictionary) + { + [aCoder encodeObject:_cssDictionary forKey:CPColorCssDictionaryKey]; + [aCoder encodeObject:_cssBeforeDictionary forKey:CPColorCssBeforeDictionaryKey]; + [aCoder encodeObject:_cssAfterDictionary forKey:CPColorCssAfterDictionaryKey]; + } else [aCoder encodeObject:_components forKey:CPColorComponentsKey]; diff --git a/AppKit/CPImage.j b/AppKit/CPImage.j index 1f31fed0c..1df9d2fa7 100644 --- a/AppKit/CPImage.j +++ b/AppKit/CPImage.j @@ -509,6 +509,212 @@ function CPAppKitImage(aFilename, aSize) @end +#pragma mark - +#pragma mark CSS Theming + +// The code below adds support for CSS theming with 100% compatibility with current theming system. +// The idea is to extend CPImage (and CPColor) with CSS components and adapt low level UI components to +// support this new kind of CPColor/CPImage. See CPImageView, CPView and _CPImageAndTextView. +// +// To create a CPImage that uses CSS, simply use the new class method : +// + (CPImage)imageWithCSSDictionary:(CPDictionary)aDictionary beforeDictionary:(CPDictionary)beforeDictionary afterDictionary:(CPDictionary)afterDictionary size:(CGSize)aSize +// where beforeDictionary & afterDictionary are related to ::before & ::after pseudo-elements. +// If you don't need them, just use the simplified class method : +// + (CPImage)imageWithCSSDictionary:(CPDictionary)aDictionary size:(CGSize)aSize +// +// Examples : +// regularImageNormal = [CPImage imageWithCSSDictionary:@{ +// @"border-color": A3ColorActiveBorder, +// @"border-style": @"solid", +// @"border-width": @"1px", +// @"border-radius": @"50%", +// @"box-sizing": @"border-box", +// @"background-color": A3ColorBackgroundWhite, +// @"transition-duration": @"0.35s", +// @"transition-property": @"all", +// @"transition-timing-function": @"ease" +// } +// size:CGSizeMake(16,16)]; +// +// imageSearch = [CPImage imageWithCSSDictionary:@{ +// @"background-image": @"url(%%packed.png)", +// @"background-position": @"-16px -32px", +// @"background-repeat": @"no-repeat", +// @"background-size": @"100px 400px" +// } +// size:CGSizeMake(16,16)]; +// +// Remark : Please note the special URL of the background image used in this example : url(%%packed.png) +// During theme loading, "%%" will be replaced by the path to the theme blend resources folder. +// Typically, a CSS theme will use some (rare) images all packed together in a single image resource (see packed.png in Aristo3 theme) +// +// Also, please note that if you don't use one of the CSS components, you can either set it to nil (best solution) or to an empty dictionary, like : +// aCssImage = [CPImage imageWithCSSDictionary:@{} beforeDictionary:nil afterDictionary:@{ ... }]; +// +// You can use -(BOOL)isCSSBased to determine how to cope with it in your code. +// -(BOOL)hasCSSDictionary, -(BOOL)hasCSSBeforeDictionary and -(BOOL)hasCSSAfterDictionary are convience methods you can use. +// +// Remark : -(DOMElement)applyCSSImageForView is meant to be used by low level UI widgets (like CPImageView and _CPImageAndTextView) to implement CSS theme support. +// +// In some circumstances, you may have to clear a CSS image. You can do this easily by replacing your current image with the special dummy empty CSS image : +// [CPImage dummyCSSImageOfSize:CGSizeMake(someWidth, someHeight)] + +@implementation CPImage (CSSTheming) +{ + CPDictionary _cssDictionary @accessors(property=cssDictionary); + CPDictionary _cssBeforeDictionary @accessors(property=cssBeforeDictionary); + CPDictionary _cssAfterDictionary @accessors(property=cssAfterDictionary); +} + ++ (CPImage)imageWithCSSDictionary:(CPDictionary)aDictionary size:(CGSize)aSize +{ + return [[CPImage alloc] initWithCSSDictionary:aDictionary beforeDictionary:nil afterDictionary:nil size:aSize]; +} + ++ (CPImage)imageWithCSSDictionary:(CPDictionary)aDictionary beforeDictionary:(CPDictionary)beforeDictionary afterDictionary:(CPDictionary)afterDictionary size:(CGSize)aSize +{ + return [[CPImage alloc] initWithCSSDictionary:aDictionary beforeDictionary:beforeDictionary afterDictionary:afterDictionary size:aSize]; +} + ++ (CPImage)dummyCSSImageOfSize:(CGSize)aSize +{ + // This is used to clear a previous CSS image + return [[CPImage alloc] initWithCSSDictionary:@{} beforeDictionary:nil afterDictionary:nil size:aSize]; +} + +- (id)initWithCSSDictionary:(CPDictionary)aDictionary beforeDictionary:(CPDictionary)beforeDictionary afterDictionary:(CPDictionary)afterDictionary size:(CGSize)aSize +{ + self = [super init]; + + if (self) + { + _size = CGSizeMakeCopy(aSize); + _filename = @"CSS image"; + _loadStatus = CPImageLoadStatusCompleted; + _cssDictionary = aDictionary; + _cssBeforeDictionary = beforeDictionary; + _cssAfterDictionary = afterDictionary; + } + + return self; +} + +- (BOOL)isCSSBased +{ + return !!(_cssDictionary || _cssBeforeDictionary || _cssAfterDictionary); +} + +- (BOOL)hasCSSDictionary +{ + return ([_cssDictionary count] > 0); +} + +- (BOOL)hasCSSBeforeDictionary +{ + return ([_cssBeforeDictionary count] > 0); +} + +- (BOOL)hasCSSAfterDictionary +{ + return ([_cssAfterDictionary count] > 0); +} + +- (DOMElement)applyCSSImageForView:(CPView)aView onDOMElement:(DOMElement)aDOMElement styleNode:(DOMElement)aStyleNode previousState:(CPArrayRef)aPreviousStateRef +{ +#if PLATFORM(DOM) + // First, restore previous CSS styling before applying the new one + + var aPreviousState = @deref(aPreviousStateRef); + + for (var i = 0, count = aPreviousState.length; i < count; i++) + aDOMElement.style[aPreviousState[i][0]] = aPreviousState[i][1]; + + aPreviousState = @[]; + + // Then apply new CSS styling + + [_cssDictionary enumerateKeysAndObjectsUsingBlock:function(aKey, anObject, stop) + { + [aPreviousState addObject:@[aKey, aDOMElement.style[aKey]]]; + aDOMElement.style[aKey] = anObject; + }]; + + if (_cssBeforeDictionary || _cssAfterDictionary) + { + // We need to create a unique class name + + var styleClassName = @".CP" + [aView UID], + styleContent = @""; + + if (_cssBeforeDictionary) + { + styleContent += styleClassName + @"::before { "; + + [_cssBeforeDictionary enumerateKeysAndObjectsUsingBlock:function(aKey, anObject, stop) + { + styleContent += aKey + ": " + anObject + "; "; + }]; + + styleContent += "} "; + } + + if (_cssAfterDictionary) + { + styleContent += styleClassName + @"::after { "; + + [_cssAfterDictionary enumerateKeysAndObjectsUsingBlock:function(aKey, anObject, stop) + { + styleContent += aKey + ": " + anObject + "; "; + }]; + + styleContent += "} "; + } + + var styleDescription = document.createTextNode(styleContent); + + if (!aStyleNode) + { + aStyleNode = document.createElement("style"); + + aView._DOMElement.insertBefore(aStyleNode, aView._DOMElement.firstChild); + + aStyleNode.appendChild(styleDescription); + } + else + { + aStyleNode.replaceChild(styleDescription, aStyleNode.firstChild); + } + + [aView setDOMClassName:@"CP"+[aView UID]]; + } + else + { + // no before/after so remove aStyleNode if existing + + if (aStyleNode) + { + aView._DOMElement.removeChild(aStyleNode); + aStyleNode = nil; + } + } + + + // Return actualised values + + @deref(aPreviousStateRef) = aPreviousState; + + return aStyleNode; +#endif +} + +@end + +var CPImageCSSDictionaryKey = @"CPImageCSSDictionaryKey", + CPImageCSSBeforeDictionaryKey = @"CPImageCSSBeforeDictionaryKey", + CPImageCSSAfterDictionaryKey = @"CPImageCSSAfterDictionaryKey"; + +#pragma mark - + @implementation CPImage (CPCoding) /*! @@ -518,7 +724,10 @@ function CPAppKitImage(aFilename, aSize) */ - (id)initWithCoder:(CPCoder)aCoder { - return [self initWithContentsOfFile:[aCoder decodeObjectForKey:@"CPFilename"] size:[aCoder decodeSizeForKey:@"CPSize"]]; + if ([aCoder containsValueForKey:CPImageCSSDictionaryKey]) + return [self initWithCSSDictionary:[aCoder decodeObjectForKey:CPImageCSSDictionaryKey] beforeDictionary:[aCoder decodeObjectForKey:CPImageCSSBeforeDictionaryKey] afterDictionary:[aCoder decodeObjectForKey:CPImageCSSAfterDictionaryKey] size:[aCoder decodeSizeForKey:@"CPSize"]]; + else + return [self initWithContentsOfFile:[aCoder decodeObjectForKey:@"CPFilename"] size:[aCoder decodeSizeForKey:@"CPSize"]]; } /*! @@ -529,6 +738,14 @@ function CPAppKitImage(aFilename, aSize) { [aCoder encodeObject:_filename forKey:@"CPFilename"]; [aCoder encodeSize:_size forKey:@"CPSize"]; + + // CSS Styling + if ([self isCSSBased]) + { + [aCoder encodeObject:_cssDictionary forKey:CPImageCSSDictionaryKey]; + [aCoder encodeObject:_cssBeforeDictionary forKey:CPImageCSSBeforeDictionaryKey]; + [aCoder encodeObject:_cssAfterDictionary forKey:CPImageCSSAfterDictionaryKey]; + } } @end diff --git a/AppKit/CPImageView.j b/AppKit/CPImageView.j index 6c041fdea..e8afee844 100644 --- a/AppKit/CPImageView.j +++ b/AppKit/CPImageView.j @@ -98,10 +98,32 @@ var CPImageViewEmptyPlaceholderImage = nil; - (void)_createDOMImageElement { #if PLATFORM(DOM) - if (_DOMImageElement) - return; + var image = [self objectValue], + isCSSBasedImage = [image isCSSBased], + isIMGImageElement = _DOMImageElement && (_DOMImageElement.nodeName == "IMG"); - _DOMImageElement = document.createElement("img"); + // First, check if we need to destroy a current DOM image element. This is the case if : + // - we have one but not the right one (that is a DIV but needing an IMG, and vice versa) + + if (_DOMImageElement) + { + if ((isIMGImageElement && isCSSBasedImage) || (!isIMGImageElement && !isCSSBasedImage)) + { + // OK, destroy it + + _DOMElement.removeChild(_DOMImageElement); + + _DOMImageElement = nil; + + // CSS styling cleaning + _cssStylePreviousState = @[]; + _cssStyleNode = nil; + } + else + return; + } + + _DOMImageElement = document.createElement(isCSSBasedImage ? "div" : "img"); _DOMImageElement.style.position = "absolute"; _DOMImageElement.style.left = "0px"; _DOMImageElement.style.top = "0px"; @@ -150,10 +172,15 @@ var CPImageViewEmptyPlaceholderImage = nil; var newImage = [self objectValue]; #if PLATFORM(DOM) - if (!_DOMImageElement) - [self _createDOMImageElement]; + [self _createDOMImageElement]; - _DOMImageElement.src = newImage ? [newImage filename] : [CPImageViewEmptyPlaceholderImage filename]; + if ([newImage isCSSBased]) + _cssStyleNode = [newImage applyCSSImageForView:self + onDOMElement:_DOMImageElement + styleNode:_cssStyleNode + previousState:@ref(_cssStylePreviousState)]; + else + _DOMImageElement.src = newImage ? [newImage filename] : [CPImageViewEmptyPlaceholderImage filename]; #endif var size = [newImage size]; diff --git a/AppKit/CPTheme.j b/AppKit/CPTheme.j index 459615181..1c96ff168 100644 --- a/AppKit/CPTheme.j +++ b/AppKit/CPTheme.j @@ -24,9 +24,12 @@ @import @import @import +@import @class CPView @class _CPThemeAttribute +@class CPImage +@class CPColor var CPThemesByName = { }, CPThemeDefaultTheme = nil, @@ -313,6 +316,71 @@ var CPThemeNameKey = @"CPThemeNameKey", @end +#pragma mark - +#pragma mark CSS Theming + +// The code below adds support for CSS theming with 100% compatibility with current theming system. +// The idea is to extend CPColor and CPImage with CSS components and adapt low level UI components to +// support this new kind of CPColor/CPImage. See CPImageView, CPView and _CPImageAndTextView. +// +// To be considered and treated as CSS based, a theme must set to YES the attribute "css-based" for CPView +// in the theDescriptor (default value is NO), like in the example below : +// +// + (CPView)themedView +// { +// var view = [[CPView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)]; +// +// [self registerThemeValues:[[@"css-based", YES]] forView:view]; +// +// return view; +// } +// +// You can use the method -(BOOL)isCSSBased on a theme to determine how to cope with it in your own code. +// +// The method -(void)setCSSResourcesPath is meant to be used only by CPThemeBlend during theme loading in order to +// replace the special path "%%" in CSS components (like in url(%%packed.png) ) with the path to the theme blend resources folder. + +@implementation CPTheme (CSSTheming) + +- (void)setCSSResourcesPath:(CPString)pathToResources +{ + [_attributes enumerateKeysAndObjectsUsingBlock:function(aKey, anObject, stop) + { + [anObject enumerateKeysAndObjectsUsingBlock:function(aKey2, anObject2, stop2) + { + // anObject2 is now a _CPThemeAttribute + + [[anObject2 values] enumerateKeysAndObjectsUsingBlock:function(aKey3, anObject3, stop3) + { + if (anObject3.isa && ([anObject3 isKindOfClass:CPImage] || [anObject3 isKindOfClass:CPColor]) && [anObject3 cssDictionary]) + { + // We have a CSS defined image or color + [self _fixPathInCSSDictionary:[anObject3 cssDictionary] withPathToResources:pathToResources]; + [self _fixPathInCSSDictionary:[anObject3 cssBeforeDictionary] withPathToResources:pathToResources]; + [self _fixPathInCSSDictionary:[anObject3 cssAfterDictionary] withPathToResources:pathToResources]; + } + }]; + }]; + }]; +} + +- (void)_fixPathInCSSDictionary:(CPDictionary)aDictionary withPathToResources:(CPString)pathToResources +{ + [aDictionary enumerateKeysAndObjectsUsingBlock:function(aKey, anObject, stop) + { + [aDictionary setObject:[anObject stringByReplacingOccurrencesOfString:@"%%" withString:pathToResources] forKey:aKey]; + }]; +} + +- (BOOL)isCSSBased +{ + return !![self valueForAttributeWithName:@"css-based" forClass:[CPView class]]; +} + +@end + +#pragma mark - + /*! * ThemeStates are immutable objects representing a particular ThemeState. Applications should never be creating * ThemeStates directly but should instead use the CPThemeState function. diff --git a/AppKit/CPThemeBlend.j b/AppKit/CPThemeBlend.j index 78cceaac3..da3e33f1c 100644 --- a/AppKit/CPThemeBlend.j +++ b/AppKit/CPThemeBlend.j @@ -95,6 +95,17 @@ [unarchiver finishDecoding]; } + // CSS Theming + + for (var i = 0, nb = [_themes count], allThemes = [self themeNames], aThemeName, aTheme; i < nb; i++) + { + aThemeName = allThemes[i]; + aTheme = [CPTheme themeNamed:aThemeName]; + + if ([aTheme isCSSBased]) + [aTheme setCSSResourcesPath:[aBundle resourcePath]]; + } + [_loadDelegate blendDidFinishLoading:self]; } diff --git a/AppKit/CPView.j b/AppKit/CPView.j index b81d2362a..058865f69 100644 --- a/AppKit/CPView.j +++ b/AppKit/CPView.j @@ -129,7 +129,8 @@ var DOMElementPrototype = nil, BackgroundVerticalThreePartImage = 1, BackgroundHorizontalThreePartImage = 2, BackgroundNinePartImage = 3, - BackgroundTransparentColor = 4; + BackgroundTransparentColor = 4, + BackgroundCSSStyling = 5; #endif var CPViewFlags = { }, @@ -195,6 +196,10 @@ var CPViewHighDPIDrawingEnabled = YES; CPArray _DOMImageSizes; unsigned _backgroundType; + + // CSS styling + CPArray _cssStylePreviousState; + DOMElement _cssStyleNode; #endif CGRect _dirtyRect; @@ -320,6 +325,18 @@ var CPViewHighDPIDrawingEnabled = YES; return nil; } ++ (CPString)defaultThemeClass +{ + return @"view"; +} + ++ (CPDictionary)themeAttributes +{ + return @{ + @"css-based": NO + }; +} + - (void)_setupViewFlags { var theClass = [self class], @@ -399,6 +416,8 @@ var CPViewHighDPIDrawingEnabled = YES; _DOMImageParts = []; _DOMImageSizes = []; + + _cssStylePreviousState = @[]; #endif _animator = nil; @@ -1954,15 +1973,25 @@ var CPViewHighDPIDrawingEnabled = YES; _backgroundColor = aColor; #if PLATFORM(DOM) + if (_backgroundType === BackgroundCSSStyling) + [_backgroundColor restorePreviousCSSState:@ref(_cssStylePreviousState) forDOMElement:_DOMElement]; + var patternImage = [_backgroundColor patternImage], colorExists = _backgroundColor && ([_backgroundColor patternImage] || [_backgroundColor alphaComponent] > 0.0), colorHasAlpha = colorExists && [_backgroundColor alphaComponent] < 1.0, supportsRGBA = CPFeatureIsCompatible(CPCSSRGBAFeature), colorNeedsDOMElement = colorHasAlpha && !supportsRGBA, amount = 0, - slices; + slices, + // For CSS theming + isCSSBasedColor = [_backgroundColor isCSSBased]; - if ([patternImage isThreePartImage]) + if (isCSSBasedColor) + { + _backgroundType = BackgroundCSSStyling; + amount = -_DOMImageParts.length; + } + else if ([patternImage isThreePartImage]) { _backgroundType = [patternImage isVertical] ? BackgroundVerticalThreePartImage : BackgroundHorizontalThreePartImage; amount = 3; @@ -2025,7 +2054,14 @@ var CPViewHighDPIDrawingEnabled = YES; _DOMElement.removeChild(_DOMImageParts.pop()); } - if (_backgroundType === BackgroundTrivialColor || _backgroundType === BackgroundTransparentColor) + if (_backgroundType === BackgroundCSSStyling) + { + _cssStyleNode = [_backgroundColor applyCSSColorForView:self + onDOMElement:_DOMElement + styleNode:_cssStyleNode + previousState:@ref(_cssStylePreviousState)]; + } + else if (_backgroundType === BackgroundTrivialColor || _backgroundType === BackgroundTransparentColor) { var colorCSS = colorExists ? [_backgroundColor cssString] : ""; @@ -3434,6 +3470,17 @@ setBoundsOrigin: @end +@implementation CPView (CSSTheming) + +- (void)setDOMClassName:(CPString)aClassName +{ +#if PLATFORM(DOM) + _DOMElement.className = aClassName; +#endif +} + +@end + @implementation CPView (Appearance) @@ -3749,6 +3796,8 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask", // DOM SETUP #if PLATFORM(DOM) + _cssStylePreviousState = @[]; + _DOMImageParts = []; _DOMImageSizes = []; diff --git a/AppKit/_CPImageAndTextView.j b/AppKit/_CPImageAndTextView.j index 655a1f0ad..e5c1b84ee 100644 --- a/AppKit/_CPImageAndTextView.j +++ b/AppKit/_CPImageAndTextView.j @@ -437,55 +437,67 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0, var textStyle = hasDOMTextElement ? _DOMTextElement.style : nil; - // Create or destroy the DOM Text Shadow element as necessary. - // If _textShadowColor's alphaComponent is 0, don't bother drawing anything (issue #1412). - // This improves performance as we get rid of an invisible element, and makes IE <9.0 capable - // of correctly 'rendering' shadows with [CPColor clearColor]. - var needsDOMTextShadowElement = hasDOMTextElement && [_textShadowColor alphaComponent] > 0.0, - hasDOMTextShadowElement = !!_DOMTextShadowElement; - - if (needsDOMTextShadowElement !== hasDOMTextShadowElement) + // If theme is CSS based and if shadow color is a CSS dictionary, we don't need a separate DOM element, + // we simply put shadow styling on the regular text element + if (hasDOMTextElement && [[self actualTheme] isCSSBased] && [_textShadowColor cssDictionary]) { - if (hasDOMTextShadowElement) + [[_textShadowColor cssDictionary] enumerateKeysAndObjectsUsingBlock:function(aKey, anObject, stop) + { + _DOMTextElement.style[aKey] = anObject; + }]; + } + else + { + // Create or destroy the DOM Text Shadow element as necessary. + // If _textShadowColor's alphaComponent is 0, don't bother drawing anything (issue #1412). + // This improves performance as we get rid of an invisible element, and makes IE <9.0 capable + // of correctly 'rendering' shadows with [CPColor clearColor]. + var needsDOMTextShadowElement = hasDOMTextElement && [_textShadowColor alphaComponent] > 0.0, + hasDOMTextShadowElement = !!_DOMTextShadowElement; + + if (needsDOMTextShadowElement !== hasDOMTextShadowElement) { - _DOMElement.removeChild(_DOMTextShadowElement); - - _DOMTextShadowElement = nil; - - hasDOMTextShadowElement = NO; - } - else - { - _DOMTextShadowElement = document.createElement("div"); - - var shadowStyle = _DOMTextShadowElement.style, - font = (_font || [CPFont systemFontOfSize:CPFontCurrentSystemSize]); - - shadowStyle.font = [font cssString]; - shadowStyle.position = "absolute"; - shadowStyle.whiteSpace = textStyle.whiteSpace; - shadowStyle.wordWrap = textStyle.wordWrap; - shadowStyle.color = [_textShadowColor cssString]; - shadowStyle.lineHeight = [font defaultLineHeightForFont] + "px"; - - shadowStyle.zIndex = 150; - shadowStyle.textOverflow = textStyle.textOverflow; - - if (document.attachEvent) + if (hasDOMTextShadowElement) { - shadowStyle.overflow = textStyle.overflow; + _DOMElement.removeChild(_DOMTextShadowElement); + + _DOMTextShadowElement = nil; + + hasDOMTextShadowElement = NO; } else { - shadowStyle.overflowX = textStyle.overflowX; - shadowStyle.overflowY = textStyle.overflowY; + _DOMTextShadowElement = document.createElement("div"); + + var shadowStyle = _DOMTextShadowElement.style, + font = (_font || [CPFont systemFontOfSize:CPFontCurrentSystemSize]); + + shadowStyle.font = [font cssString]; + shadowStyle.position = "absolute"; + shadowStyle.whiteSpace = textStyle.whiteSpace; + shadowStyle.wordWrap = textStyle.wordWrap; + shadowStyle.color = [_textShadowColor cssString]; + shadowStyle.lineHeight = [font defaultLineHeightForFont] + "px"; + + shadowStyle.zIndex = 150; + shadowStyle.textOverflow = textStyle.textOverflow; + + if (document.attachEvent) + { + shadowStyle.overflow = textStyle.overflow; + } + else + { + shadowStyle.overflowX = textStyle.overflowX; + shadowStyle.overflowY = textStyle.overflowY; + } + + _DOMElement.appendChild(_DOMTextShadowElement); + + hasDOMTextShadowElement = YES; + + _flags |= _CPImageAndTextViewTextChangedFlag; //sigh... } - - _DOMElement.appendChild(_DOMTextShadowElement); - - hasDOMTextShadowElement = YES; - - _flags |= _CPImageAndTextViewTextChangedFlag; //sigh... } } @@ -591,41 +603,55 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0, } var needsDOMImageElement = _image !== nil && _imagePosition !== CPNoImage, - hasDOMImageElement = !!_DOMImageElement; + hasDOMImageElement = !!_DOMImageElement, + // For CSS theming + isCSSBasedImage = [_image isCSSBased], + isIMGImageElement = hasDOMImageElement && (_DOMImageElement.nodeName == "IMG"); - // Create or destroy DOM Image element - if (needsDOMImageElement !== hasDOMImageElement) + // First, check if we need to destroy a current DOM image element. This is the case if : + // - we have one but don't need it anymore + // - we have one but not the right one (that is a DIV but needing an IMG, and vice versa) + + if (hasDOMImageElement) { - if (hasDOMImageElement) + if (!needsDOMImageElement || (isIMGImageElement && isCSSBasedImage) || (!isIMGImageElement && !isCSSBasedImage)) { + // OK, destroy it + _DOMElement.removeChild(_DOMImageElement); _DOMImageElement = nil; hasDOMImageElement = NO; - } - else + // CSS styling cleaning + _cssStylePreviousState = @[]; + _cssStyleNode = nil; + } + } + + // Now, if we need a DOM image element and if we don't have one, create a new one + + if (needsDOMImageElement && !hasDOMImageElement) + { + _DOMImageElement = document.createElement(isCSSBasedImage ? "div" : "img"); + + if ([CPPlatform supportsDragAndDrop]) { - _DOMImageElement = document.createElement("img"); - - if ([CPPlatform supportsDragAndDrop]) - { - _DOMImageElement.setAttribute("draggable", "true"); - _DOMImageElement.style["-khtml-user-drag"] = "element"; - } - - var imageStyle = _DOMImageElement.style; - - imageStyle.top = "0px"; - imageStyle.left = "0px"; - imageStyle.position = "absolute"; - imageStyle.zIndex = 100; - - _DOMElement.appendChild(_DOMImageElement); - - hasDOMImageElement = YES; + _DOMImageElement.setAttribute("draggable", "true"); + _DOMImageElement.style["-khtml-user-drag"] = "element"; } + + var imageStyle = _DOMImageElement.style; + + imageStyle.top = "0px"; + imageStyle.left = "0px"; + imageStyle.position = "absolute"; + imageStyle.zIndex = 100; + + _DOMElement.appendChild(_DOMImageElement); + + hasDOMImageElement = YES; } var size = [self bounds].size, @@ -637,7 +663,15 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0, var imageStyle = _DOMImageElement.style; if (_flags & _CPImageAndTextViewImageChangedFlag) - _DOMImageElement.src = [_image filename]; + { + if (isCSSBasedImage) + _cssStyleNode = [_image applyCSSImageForView:self + onDOMElement:_DOMImageElement + styleNode:_cssStyleNode + previousState:@ref(_cssStylePreviousState)]; + else + _DOMImageElement.src = [_image filename]; + } var centerX = size.width / 2.0, centerY = size.height / 2.0, diff --git a/AppKit/_CPObject+Theme.j b/AppKit/_CPObject+Theme.j index 20f32da85..7c906a1ca 100644 --- a/AppKit/_CPObject+Theme.j +++ b/AppKit/_CPObject+Theme.j @@ -20,6 +20,7 @@ */ @import +@import "CPResponder.j" @import "CPTheme.j" @@ -477,4 +478,29 @@ var NULL_THEME = {}; } } -@end \ No newline at end of file +#pragma mark - +#pragma mark CSS styling additions + +- (CPTheme)actualTheme +{ + return _theme ? _theme : [CPTheme defaultTheme]; +} + +// These methods implement inherited theme attributes thru class hierarchy. +- (id)actualValueForThemeAttribute:(CPString)aName +{ + return [self actualValueForThemeAttribute:aName inState:CPThemeStateNormal]; +} + +- (id)actualValueForThemeAttribute:(CPString)aName inState:(ThemeState)aState +{ + for (var currentClass = [self class], foundAttribute = nil, currentTheme = [self actualTheme]; (currentClass && (currentClass !== CPResponder) && !foundAttribute); currentClass = [currentClass superclass]) + + foundAttribute = [currentTheme attributeWithName:aName forClass:currentClass]; + + return (foundAttribute ? [foundAttribute valueForState:aState] : nil); +} + + + +@end