Exemple #1
0
        public DefineFunction2(SwfReader r, ConstantPool cp)
        {
            this.cp      = cp;
            FunctionName = r.GetString();
            uint paramCount = r.GetUI16();

            RegisterCount = (uint)r.GetByte();

            Preloads = PreloadFlags.Empty;
            if (r.GetBit())
            {
                Preloads |= PreloadFlags.Parent;
            }
            if (r.GetBit())
            {
                Preloads |= PreloadFlags.Root;
            }

            SuppressSuperFlag = r.GetBit();

            if (r.GetBit())
            {
                Preloads |= PreloadFlags.Super;
            }

            SuppressArgumentsFlag = r.GetBit();

            if (r.GetBit())
            {
                Preloads |= PreloadFlags.Arguments;
            }

            SuppressThisFlag = r.GetBit();

            if (r.GetBit())
            {
                Preloads |= PreloadFlags.This;
            }

            r.GetBits(7);             // reserved

            if (r.GetBit())
            {
                Preloads |= PreloadFlags.Global;
            }

            for (int i = 0; i < paramCount; i++)
            {
                uint   reg  = r.GetByte();
                string name = r.GetString();
                Parameters.Add(reg, name);
            }
            CodeSize = r.GetUI16();
        }
Exemple #2
0
        public DefineFunction(SwfReader r, ConstantPool cp)
        {
            this.cp = cp;
            FunctionName = r.GetString();
            uint paramCount = r.GetUI16();
            Params = new string[paramCount];
            for (int i = 0; i < paramCount; i++)
            {
                Params[i] = r.GetString();
            }

            CodeSize = r.GetUI16();
        }
Exemple #3
0
        public DefineFunction(SwfReader r, ConstantPool cp)
        {
            this.cp      = cp;
            FunctionName = r.GetString();
            uint paramCount = r.GetUI16();

            Params = new string[paramCount];
            for (int i = 0; i < paramCount; i++)
            {
                Params[i] = r.GetString();
            }

            CodeSize = r.GetUI16();
        }
Exemple #4
0
        public DefineEditTextTag(SwfReader r)
        {
            CharacterID = r.GetUI16();
            Bounds      = new Rect(r);

            HasText      = r.GetBit();
            WordWrap     = r.GetBit();
            Multiline    = r.GetBit();
            Password     = r.GetBit();
            ReadOnly     = r.GetBit();
            HasTextColor = r.GetBit();
            HasMaxLength = r.GetBit();
            HasFont      = r.GetBit();
            r.GetBit();            // resreved
            AutoSize  = r.GetBit();
            HasLayout = r.GetBit();
            NoSelect  = r.GetBit();
            Border    = r.GetBit();
            r.GetBit();            // resreved
            HTML        = r.GetBit();
            UseOutlines = r.GetBit();

            if (HasFont)
            {
                FontID     = r.GetUI16();
                FontHeight = r.GetUI16();
            }
            if (HasTextColor)
            {
                TextColor = new RGBA(r.GetByte(), r.GetByte(), r.GetByte(), r.GetByte());
            }
            if (HasMaxLength)
            {
                MaxLength = r.GetUI16();
            }
            if (HasLayout)
            {
                Align       = (uint)r.GetByte();
                LeftMargin  = r.GetUI16();
                RightMargin = r.GetUI16();
                Indent      = r.GetUI16();
                Leading     = r.GetInt16();
            }
            VariableName = r.GetString();
            if (HasText)
            {
                InitialText = r.GetString();
            }
        }
Exemple #5
0
        public ConstantPool(SwfReader r)
        {
            uint len = r.GetUI16();

            Constants = new string[len];
            for (int i = 0; i < len; i++)
            {
                Constants[i] = r.GetString();
            }
        }
Exemple #6
0
 public ExportAssetsTag(SwfReader r)
 {
     uint count = r.GetUI16();
     for (int i = 0; i < count; i++)
     {
         uint index = r.GetUI16();
         string name = r.GetString();
         Exports.Add(index, name);
     }
 }
Exemple #7
0
        public ConstantPool(SwfReader r)
        {
            uint len = r.GetUI16();

            Constants = new string[len];
            for (int i = 0; i < len; i++)
            {
                Constants[i] = r.GetString();
            }
        }
Exemple #8
0
        public ExportAssetsTag(SwfReader r)
        {
            uint count = r.GetUI16();

            for (int i = 0; i < count; i++)
            {
                uint   index = r.GetUI16();
                string name  = r.GetString();
                Exports.Add(index, name);
            }
        }
Exemple #9
0
        public DefineFunction2(SwfReader r, ConstantPool cp)
        {
            this.cp = cp;
            FunctionName = r.GetString();
            uint paramCount = r.GetUI16();
            RegisterCount = (uint)r.GetByte();

            Preloads = PreloadFlags.Empty;
            if (r.GetBit())
            {
                Preloads |= PreloadFlags.Parent;
            }
            if (r.GetBit())
            {
                Preloads |= PreloadFlags.Root;
            }

            SuppressSuperFlag = r.GetBit();

            if (r.GetBit())
            {
                Preloads |= PreloadFlags.Super;
            }

            SuppressArgumentsFlag = r.GetBit();

            if (r.GetBit())
            {
                Preloads |= PreloadFlags.Arguments;
            }

            SuppressThisFlag = r.GetBit();

            if (r.GetBit())
            {
                Preloads |= PreloadFlags.This;
            }

            r.GetBits(7); // reserved

            if (r.GetBit())
            {
                Preloads |= PreloadFlags.Global;
            }

            for (int i = 0; i < paramCount; i++)
            {
                uint reg = r.GetByte();
                string name = r.GetString();
                Parameters.Add(reg, name);
            }
            CodeSize = r.GetUI16();
        }
Exemple #10
0
        public SymbolClassTag(SwfReader r, uint tagEnd)
        {
            int symbolCount = r.GetUI16();
            Ids = new uint[symbolCount];
            Names = new string[symbolCount];

            for (int i = 0; i < symbolCount; i++)
            {
                Ids[i] = r.GetUI16();
                Names[i] = r.GetString();
            }

            if (tagEnd != r.Position)
            {
            }
        }
Exemple #11
0
        public SymbolClassTag(SwfReader r, uint tagEnd)
        {
            int symbolCount = r.GetUI16();

            Ids   = new uint[symbolCount];
            Names = new string[symbolCount];

            for (int i = 0; i < symbolCount; i++)
            {
                Ids[i]   = r.GetUI16();
                Names[i] = r.GetString();
            }

            if (tagEnd != r.Position)
            {
            }
        }
Exemple #12
0
        public PlaceObject2Tag(SwfReader r, byte swfVersion)
        {
            tagType           = TagType.PlaceObject2;
            HasClipActions    = r.GetBit();
            HasClipDepth      = r.GetBit();
            HasName           = r.GetBit();
            HasRatio          = r.GetBit();
            HasColorTransform = r.GetBit();
            HasMatrix         = r.GetBit();
            HasCharacter      = r.GetBit();
            Move = r.GetBit();

            Depth = r.GetUI16();

            if (HasCharacter)
            {
                Character = r.GetUI16();
            }
            if (HasMatrix)
            {
                Matrix = new Matrix(r);
            }
            if (HasColorTransform)
            {
                ColorTransform = new ColorTransform(r, true);
            }
            if (HasRatio)
            {
                Ratio = r.GetUI16();
            }
            if (HasName)
            {
                Name = r.GetString();
            }
            if (HasClipDepth)
            {
                ClipDepth = r.GetUI16();
            }

            if (HasClipActions)
            {
                ClipActions = new ClipActions(r, (swfVersion > 5));
            }
        }
Exemple #13
0
 public GetURL(SwfReader r)
 {
     UrlString    = r.GetString();
     TargetString = r.GetString();
 }
Exemple #14
0
 public GetURL(SwfReader r)
 {
     UrlString = r.GetString();
     TargetString = r.GetString();
 }
Exemple #15
0
        public DefineFont2_3(SwfReader r, bool isHighRes)
        {
            this.IsHighRes = isHighRes; // true;
            if (isHighRes)
            {
                this.tagType = TagType.DefineFont3;
            }
            this.FontId               = r.GetUI16();
            this.FontFlagsHasLayout   = r.GetBit();
            this.FontFlagsShiftJIS    = r.GetBit();
            this.FontFlagsSmallText   = r.GetBit();
            this.FontFlagsANSI        = r.GetBit();
            this.FontFlagsWideOffsets = r.GetBit();
            this.FontFlagsWideCodes   = r.GetBit();
            this.FontFlagsItalic      = r.GetBit();
            this.FontFlagsBold        = r.GetBit();

            r.Align();

            this.LanguageCode = (uint)r.GetByte();
            uint fontNameLen = (uint)r.GetByte();

            this.FontName  = r.GetString(fontNameLen);
            this.NumGlyphs = r.GetUI16();

            this.OffsetTable = new uint[this.NumGlyphs];
            for (int i = 0; i < this.NumGlyphs; i++)
            {
                this.OffsetTable[i] = this.FontFlagsWideOffsets ? r.GetUI32() : r.GetUI16();
            }

            this.CodeTableOffset = this.FontFlagsWideOffsets ? r.GetUI32() : r.GetUI16();

            GlyphShapeTable = new List <Shape>();
            for (int i = 0; i < this.NumGlyphs; i++)
            {
                Shape s = new Shape(r);
                GlyphShapeTable.Add(s);
            }

            this.CodeTable = new uint[this.NumGlyphs];
            for (int i = 0; i < this.NumGlyphs; i++)
            {
                this.CodeTable[i] = r.GetUI16();
            }

            if (this.FontFlagsHasLayout)
            {
                this.FontAscent  = r.GetInt16();
                this.FontDescent = r.GetInt16();
                this.FontLeading = r.GetInt16();

                this.FontAdvanceTable = new int[this.NumGlyphs];
                for (int i = 0; i < this.NumGlyphs; i++)
                {
                    this.FontAdvanceTable[i] = r.GetInt16();
                }

                this.FontBoundsTable = new Rect[this.NumGlyphs];
                for (int i = 0; i < this.NumGlyphs; i++)
                {
                    this.FontBoundsTable[i] = new Rect(r);
                }

                this.KerningCount = r.GetUI16();

                this.FontKerningTable = new KerningRecord[this.KerningCount];
                if (this.FontFlagsWideCodes)
                {
                    for (int i = 0; i < this.KerningCount; i++)
                    {
                        this.FontKerningTable[i] = new KerningRecord(r.GetUI16(), r.GetUI16(), r.GetInt16());
                    }
                }
                else
                {
                    for (int i = 0; i < this.KerningCount; i++)
                    {
                        this.FontKerningTable[i] = new KerningRecord((uint)r.GetByte(), (uint)r.GetByte(), r.GetInt16());
                    }
                }
            }
        }
Exemple #16
0
 public SetTarget(SwfReader r)
 {
     TargetName = r.GetString();
 }
Exemple #17
0
 public SetTarget(SwfReader r)
 {
     TargetName = r.GetString();
 }
Exemple #18
0
        public DefineEditTextTag(SwfReader r)
        {
            CharacterID = r.GetUI16();
            Bounds = new Rect(r);

            HasText = r.GetBit();
            WordWrap = r.GetBit();
            Multiline = r.GetBit();
            Password = r.GetBit();
            ReadOnly = r.GetBit();
            HasTextColor = r.GetBit();
            HasMaxLength = r.GetBit();
            HasFont = r.GetBit();
            r.GetBit();// resreved
            AutoSize = r.GetBit();
            HasLayout = r.GetBit();
            NoSelect = r.GetBit();
            Border = r.GetBit();
            r.GetBit();// resreved
            HTML = r.GetBit();
            UseOutlines = r.GetBit();

            if (HasFont)
            {
                FontID = r.GetUI16();
                FontHeight = r.GetUI16();
            }
            if (HasTextColor)
            {
                TextColor = new RGBA(r.GetByte(), r.GetByte(), r.GetByte(), r.GetByte());
            }
            if (HasMaxLength)
            {
                MaxLength = r.GetUI16();
            }
            if (HasLayout)
            {
                Align = (uint)r.GetByte();
                LeftMargin = r.GetUI16();
                RightMargin = r.GetUI16();
                Indent = r.GetUI16();
                Leading = r.GetInt16();
            }
            VariableName = r.GetString();
            if (HasText)
            {
                InitialText = r.GetString();
            }
        }
Exemple #19
0
 public FrameLabelTag(SwfReader r)
 {
     this.TargetName = r.GetString();
 }
Exemple #20
0
 public FrameLabelTag(SwfReader r)
 {
     this.TargetName = r.GetString();
 }
Exemple #21
0
 public PrimitiveString(SwfReader r)
 {
     StringValue = r.GetString();
 }
Exemple #22
0
        private TagType tagType = TagType.DefineFont2; // may be 3

        #endregion Fields

        #region Constructors

        public DefineFont2_3(SwfReader r, bool isHighRes)
        {
            this.IsHighRes = isHighRes; // true;
            if (isHighRes)
            {
                this.tagType = TagType.DefineFont3;
            }
            this.FontId = r.GetUI16();
            this.FontFlagsHasLayout = r.GetBit();
            this.FontFlagsShiftJIS = r.GetBit();
            this.FontFlagsSmallText = r.GetBit();
            this.FontFlagsANSI = r.GetBit();
            this.FontFlagsWideOffsets = r.GetBit();
            this.FontFlagsWideCodes = r.GetBit();
            this.FontFlagsItalic = r.GetBit();
            this.FontFlagsBold = r.GetBit();

            r.Align();

            this.LanguageCode = (uint)r.GetByte();
            uint fontNameLen = (uint)r.GetByte();
            this.FontName = r.GetString(fontNameLen);
            this.NumGlyphs = r.GetUI16();

            this.OffsetTable = new uint[this.NumGlyphs];
            for (int i = 0; i < this.NumGlyphs; i++)
            {
                this.OffsetTable[i] = this.FontFlagsWideOffsets ? r.GetUI32() : r.GetUI16();
            }

            this.CodeTableOffset = this.FontFlagsWideOffsets ? r.GetUI32() : r.GetUI16();

            GlyphShapeTable = new List<Shape>();
            for (int i = 0; i < this.NumGlyphs; i++)
            {
                Shape s = new Shape(r);
                GlyphShapeTable.Add(s);
            }

            this.CodeTable = new uint[this.NumGlyphs];
            for (int i = 0; i < this.NumGlyphs; i++)
            {
                this.CodeTable[i] = r.GetUI16();
            }

            if (this.FontFlagsHasLayout)
            {
                this.FontAscent = r.GetInt16();
                this.FontDescent = r.GetInt16();
                this.FontLeading = r.GetInt16();

                this.FontAdvanceTable = new int[this.NumGlyphs];
                for (int i = 0; i < this.NumGlyphs; i++)
                {
                    this.FontAdvanceTable[i] = r.GetInt16();
                }

                this.FontBoundsTable = new Rect[this.NumGlyphs];
                for (int i = 0; i < this.NumGlyphs; i++)
                {
                    this.FontBoundsTable[i] = new Rect(r);
                }

                this.KerningCount = r.GetUI16();

                this.FontKerningTable = new KerningRecord[this.KerningCount];
                if(this.FontFlagsWideCodes)
                {
                    for (int i = 0; i < this.KerningCount; i++)
                    {
                        this.FontKerningTable[i] = new KerningRecord(r.GetUI16(), r.GetUI16(), r.GetInt16());
                    }
                }
                else
                {
                    for (int i = 0; i < this.KerningCount; i++)
                    {
                        this.FontKerningTable[i] = new KerningRecord((uint)r.GetByte(), (uint)r.GetByte(), r.GetInt16());
                    }
                }
            }
        }
Exemple #23
0
 public PrimitiveString(SwfReader r)
 {
     StringValue = r.GetString();
 }
Exemple #24
0
 public DefineFontName(SwfReader r)
 {
     FontID        = r.GetUI16();
     FontName      = r.GetString();
     FontCopyright = r.GetString();
 }
Exemple #25
0
 public GoToLabel(SwfReader r)
 {
     Label = r.GetString();
 }
Exemple #26
0
 public GoToLabel(SwfReader r)
 {
     Label = r.GetString();
 }
Exemple #27
0
        public PlaceObject2Tag(SwfReader r, byte swfVersion)
        {
            tagType = TagType.PlaceObject2;
            HasClipActions = r.GetBit();
            HasClipDepth = r.GetBit();
            HasName = r.GetBit();
            HasRatio = r.GetBit();
            HasColorTransform = r.GetBit();
            HasMatrix = r.GetBit();
            HasCharacter = r.GetBit();
            Move = r.GetBit();

            Depth = r.GetUI16();

            if (HasCharacter)
            {
                Character = r.GetUI16();
            }
            if (HasMatrix)
            {
                Matrix = new Matrix(r);
            }
            if (HasColorTransform)
            {
                ColorTransform = new ColorTransform(r, true);
            }
            if (HasRatio)
            {
                Ratio = r.GetUI16();
            }
            if (HasName)
            {
                Name = r.GetString();
            }
            if (HasClipDepth)
            {
                ClipDepth = r.GetUI16();
            }

            if (HasClipActions)
            {
                ClipActions = new ClipActions(r, (swfVersion > 5));
            }
        }
Exemple #28
0
        //public ClipActions ClipActions;

        public PlaceObject3Tag(SwfReader r)
        {
            tagType = TagType.PlaceObject3;

            HasClipActions    = r.GetBit();
            HasClipDepth      = r.GetBit();
            HasName           = r.GetBit();
            HasRatio          = r.GetBit();
            HasColorTransform = r.GetBit();
            HasMatrix         = r.GetBit();
            HasCharacter      = r.GetBit();
            Move = r.GetBit();

            r.GetBits(5);             // reserved
            PlaceFlagHasCacheAsBitmap = r.GetBit();
            PlaceFlagHasBlendMode     = r.GetBit();
            PlaceFlagHasFilterList    = r.GetBit();

            Depth = r.GetUI16();

            if (HasCharacter)
            {
                Character = r.GetUI16();
            }
            if (HasMatrix)
            {
                Matrix = new Matrix(r);
            }
            if (HasColorTransform)
            {
                ColorTransform = new ColorTransform(r, true);
            }
            if (HasRatio)
            {
                Ratio = r.GetUI16();
            }
            if (HasName)
            {
                Name = r.GetString();
            }
            if (HasClipDepth)
            {
                ClipDepth = r.GetUI16();
            }

            if (PlaceFlagHasFilterList)
            {
                uint filterCount = (uint)r.GetByte();
                FilterList = new List <IFilter>();
                for (int i = 0; i < filterCount; i++)
                {
                    FilterKind kind = (FilterKind)r.GetByte();
                    switch (kind)
                    {
                    case FilterKind.Bevel:
                        FilterList.Add(new FilterBevel(r));
                        break;

                    case FilterKind.Blur:
                        FilterList.Add(new FilterBlur(r));
                        break;

                    case FilterKind.ColorMatrix:
                        FilterList.Add(new FilterColorMatrix(r));
                        break;

                    case FilterKind.Convolution:
                        FilterList.Add(new FilterConvolution(r));
                        break;

                    case FilterKind.DropShadow:
                        FilterList.Add(new FilterDropShadow(r));
                        break;

                    case FilterKind.Glow:
                        FilterList.Add(new FilterGlow(r));
                        break;

                    case FilterKind.GradientBevel:
                        FilterList.Add(new FilterGradientBevel(r));
                        break;

                    case FilterKind.GradientGlow:
                        FilterList.Add(new FilterGradientGlow(r));
                        break;

                    default:
                        // unsupported filter
                        break;
                    }
                }
            }
            if (PlaceFlagHasBlendMode)
            {
                BlendMode = (BlendMode)r.GetByte();
            }


            if (HasClipActions)
            {
                //ClipActions = new ClipActions();
            }
        }
Exemple #29
0
        //public ClipActions ClipActions;
        public PlaceObject3Tag(SwfReader r)
        {
            tagType = TagType.PlaceObject3;

            HasClipActions = r.GetBit();
            HasClipDepth = r.GetBit();
            HasName = r.GetBit();
            HasRatio = r.GetBit();
            HasColorTransform = r.GetBit();
            HasMatrix = r.GetBit();
            HasCharacter = r.GetBit();
            Move = r.GetBit();

            r.GetBits(5); // reserved
            PlaceFlagHasCacheAsBitmap = r.GetBit();
            PlaceFlagHasBlendMode = r.GetBit();
            PlaceFlagHasFilterList = r.GetBit();

            Depth = r.GetUI16();

            if (HasCharacter)
            {
                Character = r.GetUI16();
            }
            if (HasMatrix)
            {
                Matrix = new Matrix(r);
            }
            if (HasColorTransform)
            {
                ColorTransform = new ColorTransform(r, true);
            }
            if (HasRatio)
            {
                Ratio = r.GetUI16();
            }
            if (HasName)
            {
                Name = r.GetString();
            }
            if (HasClipDepth)
            {
                ClipDepth = r.GetUI16();
            }

            if (PlaceFlagHasFilterList)
            {
                uint filterCount = (uint)r.GetByte();
                FilterList = new List<IFilter>();
                for (int i = 0; i < filterCount; i++)
                {
                    FilterKind kind = (FilterKind)r.GetByte();
                    switch (kind)
                    {
                        case FilterKind.Bevel:
                            FilterList.Add(new FilterBevel(r));
                            break;
                        case FilterKind.Blur:
                            FilterList.Add(new FilterBlur(r));
                            break;
                        case FilterKind.ColorMatrix:
                            FilterList.Add(new FilterColorMatrix(r));
                            break;
                        case FilterKind.Convolution:
                            FilterList.Add(new FilterConvolution(r));
                            break;
                        case FilterKind.DropShadow:
                            FilterList.Add(new FilterDropShadow(r));
                            break;
                        case FilterKind.Glow:
                            FilterList.Add(new FilterGlow(r));
                            break;
                        case FilterKind.GradientBevel:
                            FilterList.Add(new FilterGradientBevel(r));
                            break;
                        case FilterKind.GradientGlow:
                            FilterList.Add(new FilterGradientGlow(r));
                            break;

                        default:
                            // unsupported filter
                            break;
                    }
                }
            }
            if (PlaceFlagHasBlendMode)
            {
                BlendMode = (BlendMode)r.GetByte();
            }

            if (HasClipActions)
            {
                //ClipActions = new ClipActions();
            }
        }