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 06dbc2bc2..000000000 Binary files a/Tests/Manual/CPFlashviewTest/Resources/spinner.gif and /dev/null differ 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); -}