Permalink
Browse files

Text Layout Framework Donation From Adobe

git-svn-id: https://svn.apache.org/repos/asf/incubator/flex/tlf/trunk@1374090 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
aharui committed Aug 16, 2012
1 parent fdc55a9 commit 6accdb13536bf4dad9807ccb42d952dd91e3026e
Showing 791 changed files with 204,198 additions and 0 deletions.
View
@@ -0,0 +1,8 @@
+Apache Flex is an effort undergoing incubation at The Apache
+Software Foundation (ASF), sponsored by the Apache Incubator.
+Incubation is required of all newly accepted projects until a further
+review indicates that the infrastructure, communications, and decision
+making process have stabilized in a manner consistent with other
+successful ASF projects. While incubation status is not necessarily a
+reflection of the completeness or stability of the code, it does indicate
+that the project has yet to be fully endorsed by the ASF.
View
@@ -0,0 +1,5 @@
+1. When you build TLF, firstly replace value of FLEX_HOME with the path of flex sdk on your PC
+2. If you want to build unittest application of TLF, get flexunit.swc yourself and put it in libs folder of automation_core
+3. If "Error:PermGen space" occurs, change value of "compc.jvm.args" or run the left target by yourself. For example, if that error occurs when building automation_core, you can run "ant automation_core", "ant automation_tests" and "ant automation_apps" one by one to finish the build process. For the sequence of the targets, refer to the target "all".
+4. When the unit tests are done, you can see that there are two failures because of IO error that two SWF are not found. It's OK. We did not upload those two SWF. So remove the two cases or add your own SWF
+5. We did not upload the unit tests for TLF 1.0, and TLF 1.1
View
717 LICENSE

Large diffs are not rendered by default.

Oops, something went wrong.
View
9 NOTICE
@@ -0,0 +1,9 @@
+Apache Flex Text Layout Framework
+Copyright 2012 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+The Initial Developer of the Original Code, known as Adobe Text Layout Framework, is Adobe Systems Incorporated (http://www.adobe.com/).
+ Copyright 2003 - 2012 Adobe Systems Incorporated. All Rights Reserved.
+
@@ -0,0 +1,72 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<actionScriptProperties mainApplicationPath="TwoTextContainerManagerTest.as" projectUUID="9a645603-d7b0-43a9-a1b7-6cdc30516200" version="6">
+ <compiler additionalCompilerArguments="-default-size 1100 550 -load-config+=../../config.xml -static-link-runtime-shared-libraries" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin" sourceFolderPath="src" strict="true" targetPlayerVersion="10.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
+ <compilerSourcePath/>
+ <libraryPath defaultLinkType="0">
+ <libraryPathEntry kind="3" linkType="1" path="/textLayout/bin/textLayout.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="4" path="">
+ <excludedEntries>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_charts.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="1" linkType="1" path="${PROJECT_FRAMEWORKS}/locale/{locale}"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/charts.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_air.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/netmon.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/sparkskins.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/rpc.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/videoPlayer.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp_air.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/datavisualization.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_flashflexkit.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/>
+ </excludedEntries>
+ </libraryPathEntry>
+ </libraryPath>
+ <sourceAttachmentPath/>
+ </compiler>
+ <applications>
+ <application path="InputManagerTest.as"/>
+ <application path="ExplicitFormField.as"/>
+ <application path="TCMTester.as"/>
+ <application path="OpHammer.as"/>
+ <application path="ShowAtomBounds.as"/>
+ <application path="PaddingAndIndentTest.as"/>
+ <application path="KeyLogger.as"/>
+ <application path="TextFlow4000.as"/>
+ <application path="AliceScroll.as"/>
+ <application path="TwoContainers.as"/>
+ <application path="FTEGridTestAS.as"/>
+ <application path="ContainerResizer.as"/>
+ <application path="AliceScrollEmbed.as"/>
+ <application path="StructureWalk.as"/>
+ <application path="InputTest.as"/>
+ <application path="TextLayoutFormatAS.as"/>
+ <application path="Prototype.as"/>
+ <application path="TabStopFormatAS.as"/>
+ <application path="TCMTestFocus.as"/>
+ <application path="TanachScroll.as"/>
+ <application path="TCMTestFocus2.as"/>
+ <application path="Alice.as"/>
+ <application path="TwoTextContainerManagerTest.as"/>
+ <application path="MeasurementGrid.as"/>
+ </applications>
+ <modules/>
+ <buildCSSFiles/>
+</actionScriptProperties>
View
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<projectDescription>
+ <name>asTestApps</name>
+ <comment></comment>
+ <projects>
+ <project>textLayout</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.adobe.flexbuilder.project.flexbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,66 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package
+{
+
+ import flash.display.Sprite;
+ import flash.system.Capabilities;
+
+ import flashx.textLayout.container.TextContainerManager;
+ import flashx.textLayout.elements.Configuration;
+
+ public class AccessibleTCM extends Sprite
+ {
+ public function AccessibleTCM()
+ {
+ super();
+
+ // TLF only attaches the accesibility object if its available in the Capabilities
+ if (Capabilities.hasAccessibility)
+ trace("System accessibility available");
+ else
+ trace("System accessibility NOT available");
+
+ var sprite:Sprite = new Sprite();
+ sprite.x = 50; sprite.y = 50;
+ addChild(sprite);
+
+ var lorem:String = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.";
+
+ // create a config that enables accessibility
+ var config:Configuration = Configuration(TextContainerManager.defaultConfiguration).clone();
+ config.enableAccessibility = true;
+
+ var tcm:TextContainerManager = new TextContainerManager(sprite,config);
+ tcm.updateContainer();
+ tcm.setText(lorem);
+ tcm.updateContainer();
+
+ // no accessibility attached to TCM until its converted to a textflow with a containercontroller.
+ // flex team: is this a problem?
+ tcm.beginInteraction();
+ tcm.endInteraction();
+
+ // only non-null if Capabilities.hasAccessibility is true
+ trace(sprite.accessibilityImplementation);
+
+ }
+ }
+
+}
View
@@ -0,0 +1,125 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package
+{
+ import flash.display.Graphics;
+ import flash.display.Sprite;
+ import flash.display.StageAlign;
+ import flash.display.StageScaleMode;
+ import flash.events.Event;
+ import flash.geom.Rectangle;
+ import flash.ui.ContextMenu;
+ import flash.utils.ByteArray;
+
+ import flashx.textLayout.container.ContainerController;
+ import flashx.textLayout.container.TextContainerManager;
+ import flashx.textLayout.conversion.TextConverter;
+ import flashx.textLayout.edit.EditManager;
+ import flashx.undo.IUndoManager;
+ import flashx.textLayout.edit.SelectionFormat;
+ import flashx.textLayout.elements.TextFlow;
+
+ public class Alice extends Sprite
+ {
+ // embed alice - this simplifies things - don't need to trust the swf and pass the xml around with it
+ [Embed(source="../../test/testFiles/markup/tlf/alice.xml",mimeType="application/octet-stream")]
+ private var AliceClass : Class;
+
+ public function Alice()
+ {
+ if (stage)
+ {
+ stage.align = StageAlign.TOP_LEFT;
+ stage.scaleMode = StageScaleMode.NO_SCALE;
+ }
+
+ var s:Sprite = new Sprite();
+ s.x = 100;
+ s.y = 100;
+ addChild(s);
+
+ var alice:ByteArray = new AliceClass();
+ var aliceData:String = alice.readMultiByte(alice.length,"utf-8");
+ //var textFlow:TextFlow = TextConverter.importToFlow(aliceData, TextConverter.TEXT_LAYOUT_FORMAT);
+
+ // Version using the inputManager
+ /*var inputManager:AliceTextContainerManager = new AliceTextContainerManager(s);
+ inputManager.compositionWidth = 500;
+ inputManager.compositionHeight = 400;
+ inputManager.setTextFlow(textFlow);
+ inputManager.updateContainer();*/
+
+ // version doing a direct flowComopser
+ var textFlow:TextFlow = TextConverter.importToFlow(aliceData, TextConverter.TEXT_LAYOUT_FORMAT);
+
+ // Version using the inputManager
+ /*var inputManager:AliceTextContainerManager = new AliceTextContainerManager(s);
+ inputManager.compositionWidth = 500;
+ inputManager.compositionHeight = 400;
+ inputManager.setTextFlow(textFlow);
+ inputManager.updateContainer();*/
+
+ // version doing a direct flowComopser
+ var inputManager:AliceTextContainerManager = new AliceTextContainerManager(s);
+ inputManager.compositionWidth = 500;
+ inputManager.compositionHeight = 400;
+ inputManager.setTextFlow(textFlow);
+ inputManager.updateContainer();
+ }
+
+ }
+}
+
+import flash.display.Sprite;
+import flash.geom.Rectangle;
+import flashx.undo.IUndoManager;
+import flashx.textLayout.container.TextContainerManager;
+import flashx.textLayout.elements.IConfiguration;
+import flashx.textLayout.edit.SelectionFormat;
+
+class AliceTextContainerManager extends TextContainerManager
+{
+ private var _hasScrollRect:Boolean = false;
+
+ public function AliceTextContainerManager(container:Sprite,configuration:IConfiguration = null)
+ {
+ super(container, configuration);
+ }
+ override protected function getFocusedSelectionFormat():SelectionFormat
+ {
+ return null;
+ }
+
+ override protected function getInactiveSelectionFormat():SelectionFormat
+ {
+ return null;
+ }
+
+ override protected function getUnfocusedSelectionFormat():SelectionFormat
+ {
+ return null;
+ }
+
+ override protected function getUndoManager():IUndoManager
+ {
+ return null;
+ }
+
+
+}
Oops, something went wrong.

0 comments on commit 6accdb1

Please sign in to comment.