Skip to content

Commit

Permalink
avm2: Add proper API versioning for FTE classes
Browse files Browse the repository at this point in the history
  • Loading branch information
kjarosh committed Jan 19, 2025
1 parent 3c71ed2 commit 1d861bb
Show file tree
Hide file tree
Showing 31 changed files with 90 additions and 128 deletions.
11 changes: 4 additions & 7 deletions core/src/avm2/globals/flash/text/engine/BreakOpportunity.as
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,19 @@

package flash.text.engine
{


[API("662")]
public final class BreakOpportunity
{
// Treats all characters in the ContentElement object as line break opportunities, meaning that a line break will occur after each character.
public static const ALL:String = "all";

// Treats any character in the ContentElement object as a line break opportunity.
public static const ANY:String = "any";

// Bases line break opportunities on Unicode character properties.
public static const AUTO:String = "auto";

// Treats no characters in the ContentElement object as line break opportunities.
public static const NONE:String = "none";


}
}
7 changes: 2 additions & 5 deletions core/src/avm2/globals/flash/text/engine/CFFHinting.as
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@

package flash.text.engine
{


[API("662")]
public final class CFFHinting
{
// Fits strong horizontal stems to the pixel grid for improved readability.
public static const HORIZONTAL_STEM:String = "horizontalStem";

// No hinting is applied.
public static const NONE:String = "none";


}
}
2 changes: 2 additions & 0 deletions core/src/avm2/globals/flash/text/engine/ContentElement.as
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package flash.text.engine {
import flash.events.EventDispatcher;

[API("662")]
public class ContentElement {
public static const GRAPHIC_ELEMENT:uint = 65007;
public var userData;
Expand Down
9 changes: 3 additions & 6 deletions core/src/avm2/globals/flash/text/engine/DigitCase.as
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@

package flash.text.engine
{


[API("662")]
public final class DigitCase
{
// Used to specify default digit case.
public static const DEFAULT:String = "default";

// Used to specify lining digit case.
public static const LINING:String = "lining";

// Used to specify old style digit case.
public static const OLD_STYLE:String = "oldStyle";


}
}
9 changes: 3 additions & 6 deletions core/src/avm2/globals/flash/text/engine/DigitWidth.as
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@

package flash.text.engine
{


[API("662")]
public final class DigitWidth
{
// Used to specify default digit width.
public static const DEFAULT:String = "default";

// Used to specify proportional digit width.
public static const PROPORTIONAL:String = "proportional";

// Used to specify tabular digit width.
public static const TABULAR:String = "tabular";


}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package flash.text.engine {
[API("662")]
public final class EastAsianJustifier extends TextJustifier {
public function EastAsianJustifier(locale:String = "ja", lineJustification:String = "allButLast", justificationStyle:String = "pushInKinsoku") {
super(locale, lineJustification);
Expand Down
1 change: 1 addition & 0 deletions core/src/avm2/globals/flash/text/engine/ElementFormat.as
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package flash.text.engine {
[API("662")]
public final class ElementFormat {
private var _alignmentBaseline:String;

Expand Down
1 change: 1 addition & 0 deletions core/src/avm2/globals/flash/text/engine/FontDescription.as
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package flash.text.engine {
import __ruffle__.stub_method;

[API("662")]
public final class FontDescription {
[Ruffle(InternalSlot)]
private var _fontName:String;
Expand Down
7 changes: 2 additions & 5 deletions core/src/avm2/globals/flash/text/engine/FontLookup.as
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@

package flash.text.engine
{


[API("662")]
public final class FontLookup
{
// Used to indicate device font lookup.
public static const DEVICE:String = "device";

// Used to indicate embedded CFF (Compact Font Format) font lookup.
public static const EMBEDDED_CFF:String = "embeddedCFF";


}
}
4 changes: 2 additions & 2 deletions core/src/avm2/globals/flash/text/engine/FontMetrics.as
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package flash.text.engine {
import flash.geom.Rectangle;

[API("662")]
public final class FontMetrics {
public var emBox:Rectangle;

Expand All @@ -22,7 +23,7 @@ package flash.text.engine {

[API("674")]
public var lineGap:Number;

public function FontMetrics(emBox:Rectangle, strikethroughOffset:Number, strikethroughThickness:Number, underlineOffset:Number, underlineThickness:Number, subscriptOffset:Number, subscriptScale:Number, superscriptOffset:Number, superscriptScale:Number, lineGap:Number = 0) {
this.emBox = emBox;
this.strikethroughOffset = strikethroughOffset;
Expand All @@ -37,4 +38,3 @@ package flash.text.engine {
}
}
}

7 changes: 2 additions & 5 deletions core/src/avm2/globals/flash/text/engine/FontPosture.as
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@

package flash.text.engine
{


[API("662")]
public final class FontPosture
{
// Used to indicate italic font posture.
public static const ITALIC:String = "italic";

// Used to indicate normal font posture.
public static const NORMAL:String = "normal";


}
}
7 changes: 2 additions & 5 deletions core/src/avm2/globals/flash/text/engine/FontWeight.as
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@

package flash.text.engine
{


[API("662")]
public final class FontWeight
{
// Used to indicate bold font weight.
public static const BOLD:String = "bold";

// Used to indicate normal font weight.
public static const NORMAL:String = "normal";


}
}
3 changes: 2 additions & 1 deletion core/src/avm2/globals/flash/text/engine/GraphicElement.as
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package flash.text.engine {
import __ruffle__.stub_getter;
import __ruffle__.stub_setter;

[API("662")]
public final class GraphicElement extends ContentElement {
public function GraphicElement(graphic:DisplayObject = null, elementWidth:Number = 15.0, elementHeight:Number = 15.0, elementFormat:ElementFormat = null, eventMirror:EventDispatcher = null, textRotation:String = "rotate0") {
stub_constructor("flash.text.engine.GraphicElement");
Expand Down Expand Up @@ -37,4 +38,4 @@ package flash.text.engine {
stub_setter("flash.text.engine.GraphicElement", "graphic");
}
}
}
}
2 changes: 1 addition & 1 deletion core/src/avm2/globals/flash/text/engine/GroupElement.as
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package flash.text.engine {

import flash.events.EventDispatcher;

[API("662")]
public final class GroupElement extends ContentElement {
internal var _elements = null;

Expand Down Expand Up @@ -82,4 +83,3 @@ package flash.text.engine {
}
}
}

9 changes: 3 additions & 6 deletions core/src/avm2/globals/flash/text/engine/JustificationStyle.as
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@

package flash.text.engine
{


[API("662")]
public final class JustificationStyle
{
// Bases justification on either expanding or compressing the line, whichever gives a result closest to the desired width.
public static const PRIORITIZE_LEAST_ADJUSTMENT:String = "prioritizeLeastAdjustment";

// Bases justification on compressing kinsoku at the end of the line, or expanding it if no kinsoku occurs or if that space is insufficient.
public static const PUSH_IN_KINSOKU:String = "pushInKinsoku";

// Bases justification on expanding the line.
public static const PUSH_OUT_ONLY:String = "pushOutOnly";


}
}
9 changes: 3 additions & 6 deletions core/src/avm2/globals/flash/text/engine/Kerning.as
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@

package flash.text.engine
{


[API("662")]
public final class Kerning
{
// Used to indicate that kerning is enabled except where inappropriate in Asian typography.
public static const AUTO:String = "auto";

// Used to indicate kerning is disabled.
public static const OFF:String = "off";

// Used to indicate kerning is enabled.
public static const ON:String = "on";


}
}
13 changes: 5 additions & 8 deletions core/src/avm2/globals/flash/text/engine/LigatureLevel.as
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,22 @@

package flash.text.engine
{


[API("662")]
public final class LigatureLevel
{
// Used to specify common ligatures.
public static const COMMON:String = "common";

// Used to specify exotic ligatures.
public static const EXOTIC:String = "exotic";

// Used to specify minimum ligatures.
public static const MINIMUM:String = "minimum";

// Used to specify no ligatures.
public static const NONE:String = "none";

// Used to specify uncommon ligatures.
public static const UNCOMMON:String = "uncommon";


}
}
11 changes: 4 additions & 7 deletions core/src/avm2/globals/flash/text/engine/LineJustification.as
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,20 @@

package flash.text.engine
{


[API("662")]
public final class LineJustification
{
// Justify all but the last line.
public static const ALL_BUT_LAST:String = "allButLast";

// Justify all but the last line and lines ending in mandatory breaks.
[API("674")]
public static const ALL_BUT_MANDATORY_BREAK:String = "allButMandatoryBreak";

// Justify all lines.
public static const ALL_INCLUDING_LAST:String = "allIncludingLast";

// Do not justify lines.
public static const UNJUSTIFIED:String = "unjustified";


}
}
7 changes: 2 additions & 5 deletions core/src/avm2/globals/flash/text/engine/RenderingMode.as
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@

package flash.text.engine
{


[API("662")]
public final class RenderingMode
{
// Sets rendering mode to CFF (Compact Font Format).
public static const CFF:String = "cff";

// Sets rendering mode to the rendering mode that is used in Flash Player 7 and earlier.
public static const NORMAL:String = "normal";


}
}
1 change: 1 addition & 0 deletions core/src/avm2/globals/flash/text/engine/SpaceJustifier.as
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package flash.text.engine {
[API("662")]
public final class SpaceJustifier extends TextJustifier {
private var _letterSpacing:Boolean;
private var _minimumSpacing:Number = 0.5;
Expand Down
11 changes: 4 additions & 7 deletions core/src/avm2/globals/flash/text/engine/TabAlignment.as
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,19 @@

package flash.text.engine
{


[API("662")]
public final class TabAlignment
{
// Positions the center of the tabbed text at the tab stop.
public static const CENTER:String = "center";

// Positions the alignment token of the tabbed text at the tab stop.
public static const DECIMAL:String = "decimal";

// Positions the end of the tabbed text at the tab stop.
public static const END:String = "end";

// Positions the start of the tabbed text at the tab stop.
public static const START:String = "start";


}
}
3 changes: 2 additions & 1 deletion core/src/avm2/globals/flash/text/engine/TabStop.as
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package flash.text.engine {
[API("662")]
public final class TabStop {
// FIXME: These should be getters/setters to match Flash
public var alignment:String;
public var position:Number;
public var decimalAlignmentToken:String;

public function TabStop(alignment:String = "start", position:Number = 0, decimalAlignmentToken:String = "") {
this.alignment = alignment;
this.position = position;
Expand Down
Loading

0 comments on commit 1d861bb

Please sign in to comment.