From 1282f1ac0ed87f76c33b88e52485f261c8b299c9 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Mon, 21 Mar 2022 15:46:54 +0100 Subject: [PATCH] Removed: Flash support (#2903) --- AppKit/AppKit.j | 4 +- AppKit/CPFlashMovie.j | 85 ------- AppKit/CPFlashView.j | 215 ------------------ AppKit/CoreAnimation/CAFlashLayer.j | 50 ---- Tests/Manual/CPFlashviewTest/AppController.j | 42 ---- Tests/Manual/CPFlashviewTest/Info.plist | 12 - Tests/Manual/CPFlashviewTest/Jakefile | 93 -------- .../CPFlashviewTest/Resources/spinner.gif | Bin 1849 -> 0 bytes Tests/Manual/CPFlashviewTest/index-debug.html | 204 ----------------- Tests/Manual/CPFlashviewTest/index.html | 166 -------------- Tests/Manual/CPFlashviewTest/main.j | 18 -- 11 files changed, 1 insertion(+), 888 deletions(-) delete mode 100644 AppKit/CPFlashMovie.j delete mode 100644 AppKit/CPFlashView.j delete mode 100644 AppKit/CoreAnimation/CAFlashLayer.j delete mode 100644 Tests/Manual/CPFlashviewTest/AppController.j delete mode 100644 Tests/Manual/CPFlashviewTest/Info.plist delete mode 100644 Tests/Manual/CPFlashviewTest/Jakefile delete mode 100644 Tests/Manual/CPFlashviewTest/Resources/spinner.gif delete mode 100644 Tests/Manual/CPFlashviewTest/index-debug.html delete mode 100644 Tests/Manual/CPFlashviewTest/index.html delete mode 100644 Tests/Manual/CPFlashviewTest/main.j diff --git a/AppKit/AppKit.j b/AppKit/AppKit.j index b9de2065b..99f532131 100644 --- a/AppKit/AppKit.j +++ b/AppKit/AppKit.j @@ -62,8 +62,6 @@ @import "CPDocument.j" @import "CPDocumentController.j" @import "CPEvent.j" -@import "CPFlashMovie.j" -@import "CPFlashView.j" @import "CPFont.j" @import "CPFontManager.j" @import "CPGradient.j" @@ -116,4 +114,4 @@ @import "CPWebView.j" @import "CPWindow.j" @import "CPWindowController.j" -@import "CPWorkspace.j" \ No newline at end of file +@import "CPWorkspace.j" diff --git a/AppKit/CPFlashMovie.j b/AppKit/CPFlashMovie.j deleted file mode 100644 index d6256402a..000000000 --- a/AppKit/CPFlashMovie.j +++ /dev/null @@ -1,85 +0,0 @@ -/* - * CPFlashMovie.j - * AppKit - * - * Created by Francisco Tolmasky. - * Copyright 2008, 280 North, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -@import - - -/*! - @ingroup appkit - @class CPFlashMovie - - CPFlashMovie is used to represent a Flash movie in the Cappuccino framework. -*/ -@implementation CPFlashMovie : CPObject -{ - CPString _filename; -} - -/*! - Creates a new Flash movie with the swf at \c aFileName. - @param aFilename the swf to load - @return the initialized CPFlashMovie -*/ -+ (id)flashMovieWithFile:(CPString)aFilename -{ - return [[self alloc] initWithFile:aFilename]; -} - -/*! - Initializes the Flash movie. - @param aFilename the swf to load - @return the initialized CPFlashMovie -*/ -- (id)initWithFile:(CPString)aFilename -{ - self = [super init]; - - if (self) - _filename = aFilename; - - return self; -} - -- (CPString)filename -{ - return _filename; -} - -@end - -var CPFlashMovieFilenameKey = "CPFlashMovieFilenameKey"; - -@implementation CPFlashMovie (CPCoding) - -- (id)initWithCoder:(CPCoder)aCoder -{ - _filename = [aCoder decodeObjectForKey:CPFlashMovieFilenameKey]; - - return self; -} - -- (void)encodeWithCoder:(CPCoder)aCoder -{ - [aCoder encodeObject:_filename forKey:CPFlashMovieFilenameKey]; -} - -@end \ No newline at end of file diff --git a/AppKit/CPFlashView.j b/AppKit/CPFlashView.j deleted file mode 100644 index d69b06276..000000000 --- a/AppKit/CPFlashView.j +++ /dev/null @@ -1,215 +0,0 @@ -/* - * CPFlashView.j - * AppKit - * - * Created by Francisco Tolmasky. - * Copyright 2008, 280 North, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -@import "CPFlashMovie.j" -@import "CPView.j" - - -var IEFlashCLSID = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; - -/*! - @ingroup appkit -*/ -@implementation CPFlashView : CPView -{ - CPFlashMovie _flashMovie; - - CPDictionary _params; - CPDictionary _paramElements; -#if PLATFORM(DOM) - DOMElement _DOMParamElement; - DOMElement _DOMObjectElement; -#endif -} - -- (id)initWithFrame:(CGRect)aFrame -{ - - CPLog.warn("CPFlashView is deprecated and it will be removed in version 1.1."); - - self = [super initWithFrame:aFrame]; - - if (self) - { -#if PLATFORM(DOM) - if (!CPBrowserIsEngine(CPInternetExplorerBrowserEngine)) - { - _DOMObjectElement = document.createElement(@"object"); - _DOMObjectElement.id = [self elementID]; - _DOMObjectElement.width = @"100%"; - _DOMObjectElement.height = @"100%"; - _DOMObjectElement.style.top = @"0px"; - _DOMObjectElement.style.left = @"0px"; - _DOMObjectElement.type = @"application/x-shockwave-flash"; - _DOMParamElement = document.createElement(@"param"); - _DOMParamElement.name = @"movie"; - - _DOMObjectElement.appendChild(_DOMParamElement); - - _DOMElement.appendChild(_DOMObjectElement); - } - else - [self _rebuildIEObjects]; -#endif - } - - return self; -} - -- (void)setFlashMovie:(CPFlashMovie)aFlashMovie -{ - if (_flashMovie == aFlashMovie) - return; - - _flashMovie = aFlashMovie; -#if PLATFORM(DOM) - if (!CPBrowserIsEngine(CPInternetExplorerBrowserEngine)) - { - _DOMParamElement.value = [aFlashMovie filename]; - _DOMObjectElement.data = [aFlashMovie filename]; - } - else - [self _rebuildIEObjects]; -#endif -} - -- (CPFlashMovie)flashMovie -{ - return _flashMovie; -} - -- (void)setFlashVars:(CPDictionary)aDictionary -{ - var varString = @"", - enumerator = [aDictionary keyEnumerator], - key; - - if (key = [enumerator nextObject]) - varString = [varString stringByAppendingFormat:@"%@=%@", key, [aDictionary objectForKey:key]]; - - while (key = [enumerator nextObject]) - varString = [varString stringByAppendingFormat:@"&%@=%@", key, [aDictionary objectForKey:key]]; - - if (!_params) - _params = @{}; - - [_params setObject:varString forKey:@"flashvars"]; - [self setParameters:_params]; -} - -- (CPDictionary)flashVars -{ - return [_params objectForKey:@"flashvars"]; -} - -- (void)setParameters:(CPDictionary)aDictionary -{ -#if PLATFORM(DOM) - if (_paramElements && !CPBrowserIsEngine(CPInternetExplorerBrowserEngine)) - { - var elements = [_paramElements allValues], - count = [elements count]; - - for (var i = 0; i < count; i++) - _DOMObjectElement.removeChild([elements objectAtIndex:i]); - } -#endif - if (!_params) - _params = aDictionary; - else - [_params addEntriesFromDictionary:aDictionary]; -#if PLATFORM(DOM) - if (!CPBrowserIsEngine(CPInternetExplorerBrowserEngine)) - { - _paramElements = @{}; - - var enumerator = [_params keyEnumerator], - key; - - while (_DOMObjectElement && (key = [enumerator nextObject]) != nil) - { - var param = document.createElement(@"param"); - param.name = key; - param.value = [_params objectForKey:key]; - - _DOMObjectElement.appendChild(param); - - [_paramElements setObject:param forKey:key]; - } - } - else - [self _rebuildIEObjects]; -#endif -} - -- (CPDictionary)parameters -{ - return _params; -} - -#if PLATFORM(DOM) -- (void)_rebuildIEObjects -{ - _DOMElement.innerHTML = @""; - if (![_flashMovie filename]) - return; - - var paramString = [CPString stringWithFormat:@"", [_flashMovie filename]], - paramEnumerator = [_params keyEnumerator], - key; - - while ((key = [paramEnumerator nextObject]) != nil) - paramString = [paramString stringByAppendingFormat:@"", key, [_params objectForKey:key]]; - - _DOMObjectElement = document.createElement(@"object"); - _DOMElement.appendChild(_DOMObjectElement); - - _DOMObjectElement.outerHTML = [CPString stringWithFormat:@"%@", [self elementID], IEFlashCLSID, CGRectGetWidth([self bounds]), CGRectGetHeight([self bounds]), paramString]; -} -#endif - -- (CPString)elementID -{ - return @"CPFV_" + [self UID]; -} - -- (void)mouseMoved:(CPEvent)sommit -{ - [[[self window] platformWindow] _propagateCurrentDOMEvent:YES]; -} - -- (void)mouseDragged:(CPEvent)anEvent -{ - [[[self window] platformWindow] _propagateCurrentDOMEvent:YES]; -} - -- (void)mouseDown:(CPEvent)anEvent -{ - [[[self window] platformWindow] _propagateCurrentDOMEvent:YES]; -} - -- (void)mouseUp:(CPEvent)anEvent -{ - [[[self window] platformWindow] _propagateCurrentDOMEvent:YES]; -} - -@end diff --git a/AppKit/CoreAnimation/CAFlashLayer.j b/AppKit/CoreAnimation/CAFlashLayer.j deleted file mode 100644 index ddeef2075..000000000 --- a/AppKit/CoreAnimation/CAFlashLayer.j +++ /dev/null @@ -1,50 +0,0 @@ -/* - * CAFlashLayer.j - * AppKit - * - * Created by Francisco Tolmasky. - * Copyright 2008, 280 North, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -@import "CALayer.j" -@import "CPFlashMovie.j" - - -@implementation CAFlashLayer : CALayer -{ - CPFlashMovie _flashMovie; -} - -- (void)setFlashMovie:(CPFlashMovie)aFlashMovie -{ - if (_flashMovie == aFlashMovie) - return; - - _flashMovie = aFlashMovie; - - _DOMElement.innerHTML = ""; -} - -- (CPFlashMovie)flashMovie -{ - return _flashMovie; -} - -@end diff --git a/Tests/Manual/CPFlashviewTest/AppController.j b/Tests/Manual/CPFlashviewTest/AppController.j deleted file mode 100644 index 5a8745788..000000000 --- a/Tests/Manual/CPFlashviewTest/AppController.j +++ /dev/null @@ -1,42 +0,0 @@ -/* - * AppController.j - * CPFlashviewTest - * - * Created by Blair Duncan on April 23, 2012. - * Copyright 2012, SGL Studio, BBDO Toronto All rights reserved. - */ - -@import - - -@implementation AppController : CPObject -{ -} - -- (void)applicationDidFinishLaunching:(CPNotification)aNotification -{ - var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask], - contentView = [theWindow contentView], - flashView; - - flashView = [[CPFlashView alloc] initWithFrame:CGRectMake(0,0,320,240)], - [flashView setFlashMovie:[CPFlashMovie flashMovieWithFile:@"http://flashjournalism.com/examples/airplane.swf"]]; - - // note: - // if both flashParams and flashVars are used flashParams must be setup first - - var flashParameters = @{}; - [flashVars setObject:@"SampleParam" forKey:"SampleParamKey"]; - [flashView setParameters:flashParameters]; - - var flashVars = @{}; - [flashVars setObject:@"SampleVar" forKey:"SampleVarKey"]; - [flashView setFlashVars:flashVars]; - - - [flashView setCenter:[contentView center]]; - [contentView addSubview:flashView]; - [theWindow orderFront:self]; -} - -@end diff --git a/Tests/Manual/CPFlashviewTest/Info.plist b/Tests/Manual/CPFlashviewTest/Info.plist deleted file mode 100644 index 8dbe56ff0..000000000 --- a/Tests/Manual/CPFlashviewTest/Info.plist +++ /dev/null @@ -1,12 +0,0 @@ - - - - - CPApplicationDelegateClass - AppController - CPBundleName - CPFlashviewTest - CPPrincipalClass - CPApplication - - diff --git a/Tests/Manual/CPFlashviewTest/Jakefile b/Tests/Manual/CPFlashviewTest/Jakefile deleted file mode 100644 index 540a707ab..000000000 --- a/Tests/Manual/CPFlashviewTest/Jakefile +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Jakefile - * CPFlashviewTest - * - * Created by Blair Duncan on April 23, 2012. - * Copyright 2012, SGL Studio, BBDO Toronto 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"); - -app ("CPFlashviewTest", function(task) -{ - task.setBuildIntermediatesPath(FILE.join("Build", "CPFlashviewTest.build", configuration)); - task.setBuildPath(FILE.join("Build", configuration)); - - task.setProductName("CPFlashviewTest"); - task.setIdentifier("com.yourcompany.CPFlashviewTest"); - task.setVersion("1.0"); - task.setAuthor("SGL Studio, BBDO Toronto"); - task.setEmail("Blair.Duncan@BBDO.com"); - task.setSummary("CPFlashviewTest"); - task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**"))); - task.setResources(new FileList("Resources/**")); - task.setIndexFilePath("index.html"); - task.setInfoPlistPath("Info.plist"); - - if (configuration === "Debug") - task.setCompilerFlags("-DDEBUG -g"); - else - task.setCompilerFlags("-O"); -}); - -task ("default", ["CPFlashviewTest"], function() -{ - printResults(configuration); -}); - -task ("build", ["default"]); - -task ("debug", function() -{ - ENV["CONFIGURATION"] = "Debug"; - JAKE.subjake(["."], "build", ENV); -}); - -task ("release", function() -{ - ENV["CONFIGURATION"] = "Release"; - JAKE.subjake(["."], "build", ENV); -}); - -task ("run", ["debug"], function() -{ - OS.system(["open", FILE.join("Build", "Debug", "CPFlashviewTest", "index.html")]); -}); - -task ("run-release", ["release"], function() -{ - OS.system(["open", FILE.join("Build", "Release", "CPFlashviewTest", "index.html")]); -}); - -task ("deploy", ["release"], function() -{ - FILE.mkdirs(FILE.join("Build", "Deployment", "CPFlashviewTest")); - OS.system(["press", "-f", FILE.join("Build", "Release", "CPFlashviewTest"), FILE.join("Build", "Deployment", "CPFlashviewTest")]); - printResults("Deployment") -}); - -task ("desktop", ["release"], function() -{ - FILE.mkdirs(FILE.join("Build", "Desktop", "CPFlashviewTest")); - require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "CPFlashviewTest"), FILE.join("Build", "Desktop", "CPFlashviewTest", "CPFlashviewTest.app")); - printResults("Desktop") -}); - -task ("run-desktop", ["desktop"], function() -{ - OS.system([FILE.join("Build", "Desktop", "CPFlashviewTest", "CPFlashviewTest.app", "Contents", "MacOS", "NativeHost"), "-i"]); -}); - -function printResults(configuration) -{ - print("----------------------------"); - print(configuration+" app built at path: "+FILE.join("Build", configuration, "CPFlashviewTest")); - print("----------------------------"); -} diff --git a/Tests/Manual/CPFlashviewTest/Resources/spinner.gif b/Tests/Manual/CPFlashviewTest/Resources/spinner.gif deleted file mode 100644 index 06dbc2bc21dddcf0e09b566d5b211aee89570f52..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1849 zcma*odr(tX9tZHtz31lM+(&Y`A`Ou`NeG&R#DrIfV%?hng21vs6v>ooRQQFbk7E_K!V( z{?5!fpZWgIZ%*d6t%i*j24bL}AZUJm9)h6R*;%L4IWse3G#VWaN1#$zSSXcBhlYlH zJ|D}n{r&w2f+Qp)SS*&n?*G4}{}!h?td_mjU6Kad-rW*QwWYCUk7d^e+sjpZAn6kT z5rM;`{~_}-wm+L@%+E;JphLm}C3WzQAQD0wBoY|rOTQX{(@pp-WAA8Iw0HKl|15j) zhGh(SFWu#5zUCw^T!}C~eC}~?{xG-r7ugQC>taC+|L^xr&a%{#cgUOZXIM&v?)k^2 z1i5%0!U00wq)r4vlAwXBA_m5J5WNeuBm-XJQ5pG4GD%vc|K){+TJ{AkHqN@SJKczX zU}QRd9n*_bf^h94)6Ctv{CUfz_;qs#RDuQ$DR%y1&5G-a6rhf*4Y zl+UOD1*GE{GQ7vv;c-tTIMkz0ovO>9j%b5hpa@a*CBJ#W!0@ndSwF|%hMkdFtXiU) z`BEp+yhkt8ZY>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rM*JfqtHqUu6rQoU=g%1E9xk%;)TDm^2<8n-0IhTsQFaek)MY}>PK4;nBk=ow4pF>vzkO& gna%Org-kgQCf=+BeMi^RbuY;YE~rTjend;_cdi8t>i_@% diff --git a/Tests/Manual/CPFlashviewTest/index-debug.html b/Tests/Manual/CPFlashviewTest/index-debug.html deleted file mode 100644 index a36b1d3b9..000000000 --- a/Tests/Manual/CPFlashviewTest/index-debug.html +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - - - - - - - - - - - - - __project.name__ - - - - - - - - - - - - - - -
-
-
- -
-
- -
- - diff --git a/Tests/Manual/CPFlashviewTest/index.html b/Tests/Manual/CPFlashviewTest/index.html deleted file mode 100644 index ac42c98a7..000000000 --- a/Tests/Manual/CPFlashviewTest/index.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - - - - - - - - - - - __project.name__ - - - - - - - - - - - - -
-
-
- -
-
- -
- - diff --git a/Tests/Manual/CPFlashviewTest/main.j b/Tests/Manual/CPFlashviewTest/main.j deleted file mode 100644 index f7f567228..000000000 --- a/Tests/Manual/CPFlashviewTest/main.j +++ /dev/null @@ -1,18 +0,0 @@ -/* - * AppController.j - * CPFlashviewTest - * - * Created by Blair Duncan on April 23, 2012. - * Copyright 2012, SGL Studio, BBDO Toronto All rights reserved. - */ - -@import -@import - -@import "AppController.j" - - -function main(args, namedArgs) -{ - CPApplicationMain(args, namedArgs); -}