From 6d99c0b1ca3849f7703a01e26405a8270aeb706f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Thu, 18 Jul 2013 21:34:04 +0200 Subject: [PATCH] Issue #220 Characters adding source font selection, font names in tree --- trunk/src/com/jpexs/decompiler/flash/SWF.java | 4 +- .../decompiler/flash/SWFInputStream.java | 172 +++++++++--------- .../com/jpexs/decompiler/flash/TagNode.java | 11 +- .../jpexs/decompiler/flash/gui/MainFrame.java | 57 ++++-- .../flash/gui/locales/MainFrame.properties | 4 +- .../flash/gui/locales/MainFrame_cs.properties | 4 +- .../flash/tags/CSMTextSettingsTag.java | 9 +- .../decompiler/flash/tags/DebugIDTag.java | 7 +- .../flash/tags/DefineBinaryDataTag.java | 5 +- .../flash/tags/DefineBitsJPEG2Tag.java | 5 +- .../flash/tags/DefineBitsJPEG3Tag.java | 5 +- .../flash/tags/DefineBitsJPEG4Tag.java | 5 +- .../flash/tags/DefineBitsLossless2Tag.java | 5 +- .../flash/tags/DefineBitsLosslessTag.java | 5 +- .../decompiler/flash/tags/DefineBitsTag.java | 5 +- .../flash/tags/DefineButton2Tag.java | 5 +- .../flash/tags/DefineButtonCxformTag.java | 5 +- .../flash/tags/DefineButtonSoundTag.java | 5 +- .../flash/tags/DefineButtonTag.java | 5 +- .../flash/tags/DefineEditTextTag.java | 7 +- .../decompiler/flash/tags/DefineFont2Tag.java | 13 +- .../decompiler/flash/tags/DefineFont3Tag.java | 12 +- .../decompiler/flash/tags/DefineFont4Tag.java | 5 +- .../flash/tags/DefineFontAlignZonesTag.java | 5 +- .../flash/tags/DefineFontInfo2Tag.java | 5 +- .../flash/tags/DefineFontInfoTag.java | 5 +- .../flash/tags/DefineFontNameTag.java | 5 +- .../decompiler/flash/tags/DefineFontTag.java | 11 +- .../flash/tags/DefineMorphShape2Tag.java | 5 +- .../flash/tags/DefineMorphShapeTag.java | 5 +- .../flash/tags/DefineScalingGridTag.java | 5 +- .../tags/DefineSceneAndFrameLabelDataTag.java | 5 +- .../flash/tags/DefineShape2Tag.java | 5 +- .../flash/tags/DefineShape3Tag.java | 5 +- .../flash/tags/DefineShape4Tag.java | 5 +- .../decompiler/flash/tags/DefineShapeTag.java | 5 +- .../decompiler/flash/tags/DefineSoundTag.java | 5 +- .../flash/tags/DefineSpriteTag.java | 8 +- .../decompiler/flash/tags/DefineText2Tag.java | 9 +- .../decompiler/flash/tags/DefineTextTag.java | 14 +- .../flash/tags/DefineVideoStreamTag.java | 5 +- .../decompiler/flash/tags/DoABCDefineTag.java | 10 +- .../jpexs/decompiler/flash/tags/DoABCTag.java | 10 +- .../decompiler/flash/tags/DoActionTag.java | 5 +- .../flash/tags/DoInitActionTag.java | 8 +- .../flash/tags/EnableDebugger2Tag.java | 5 +- .../flash/tags/EnableDebuggerTag.java | 5 +- .../jpexs/decompiler/flash/tags/EndTag.java | 11 +- .../flash/tags/ExportAssetsTag.java | 5 +- .../flash/tags/FileAttributesTag.java | 5 +- .../decompiler/flash/tags/FrameLabelTag.java | 5 +- .../flash/tags/ImportAssets2Tag.java | 5 +- .../flash/tags/ImportAssetsTag.java | 5 +- .../decompiler/flash/tags/JPEGTablesTag.java | 5 +- .../decompiler/flash/tags/MetadataTag.java | 5 +- .../flash/tags/PlaceObject2Tag.java | 10 +- .../flash/tags/PlaceObject3Tag.java | 5 +- .../decompiler/flash/tags/PlaceObjectTag.java | 10 +- .../decompiler/flash/tags/ProductInfoTag.java | 5 +- .../decompiler/flash/tags/ProtectTag.java | 5 +- .../flash/tags/RemoveObject2Tag.java | 5 +- .../flash/tags/RemoveObjectTag.java | 5 +- .../flash/tags/ScriptLimitsTag.java | 5 +- .../flash/tags/SetBackgroundColorTag.java | 9 +- .../decompiler/flash/tags/SetTabIndexTag.java | 5 +- .../decompiler/flash/tags/ShowFrameTag.java | 11 +- .../flash/tags/SoundStreamBlockTag.java | 7 +- .../flash/tags/SoundStreamHead2Tag.java | 5 +- .../flash/tags/SoundStreamHeadTag.java | 5 +- .../decompiler/flash/tags/StartSound2Tag.java | 5 +- .../decompiler/flash/tags/StartSoundTag.java | 5 +- .../decompiler/flash/tags/SymbolClassTag.java | 5 +- .../com/jpexs/decompiler/flash/tags/Tag.java | 14 +- .../jpexs/decompiler/flash/tags/TagStub.java | 8 +- .../decompiler/flash/tags/VideoFrameTag.java | 5 +- .../flash/tags/base/CharacterIdTag.java | 17 +- .../flash/tags/base/CharacterTag.java | 6 +- .../flash/tags/base/Exportable.java | 5 +- .../decompiler/flash/tags/base/FontTag.java | 23 ++- .../decompiler/flash/tags/base/ImageTag.java | 4 +- .../decompiler/flash/tags/base/TextTag.java | 2 +- .../flash/types/BUTTONCONDACTION.java | 3 +- .../flash/types/CLIPACTIONRECORD.java | 3 +- 83 files changed, 455 insertions(+), 303 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/SWF.java b/trunk/src/com/jpexs/decompiler/flash/SWF.java index 71faaec3e..97ea8fed2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWF.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWF.java @@ -328,7 +328,7 @@ public class SWF { sis.readUI8(); //tmpFirstByetOfFrameRate frameRate = sis.readUI8(); frameCount = sis.readUI16(); - tags = sis.readTagList(0, paralelRead, true); + tags = sis.readTagList(this, 0, paralelRead, true); assignExportNamesToSymbols(); assignClassesToSymbols(); findFileAttributes(); @@ -589,7 +589,7 @@ public class SWF { outdir += File.separator; } outdir += "scripts" + File.separator; - ret.addAll(TagNode.exportNodeAS(handler, list, outdir, isPcode, evl)); + ret.addAll(TagNode.exportNodeAS(tags, handler, list, outdir, isPcode, evl)); return ret; } diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java index 14e85e9c6..b96bebc12 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -1155,19 +1155,21 @@ public class SWFInputStream extends InputStream { private final int level; private boolean paralel; private boolean skipUnusualTags; + private SWF swf; - public TagResolutionTask(Tag tag, int version, int level, boolean paralel, boolean skipUnusualTags) { + public TagResolutionTask(SWF swf, Tag tag, int version, int level, boolean paralel, boolean skipUnusualTags) { this.tag = tag; this.version = version; this.level = level; this.paralel = paralel; this.skipUnusualTags = skipUnusualTags; + this.swf = swf; } @Override public Tag call() throws Exception { try { - return SWFInputStream.resolveTag(tag, version, level, paralel, skipUnusualTags); + return SWFInputStream.resolveTag(swf, tag, version, level, paralel, skipUnusualTags); } catch (Exception ex) { return null; } @@ -1178,26 +1180,28 @@ public class SWFInputStream extends InputStream { * Reads list of tags from the stream. Reading ends with End tag(=0) or end * of the stream. * + * @param swf * @param level * @param paralel * @return List of tags * @throws IOException */ - public List readTagList(int level, boolean paralel) throws IOException { - return readTagList(level, paralel, false); + public List readTagList(SWF swf, int level, boolean paralel) throws IOException { + return readTagList(swf, level, paralel, false); } /** * Reads list of tags from the stream. Reading ends with End tag(=0) or end * of the stream. Optinally can skip AS1/2 tags when file is AS3 * + * @param swf * @param level * @param paralel * @param skipUnusualTags * @return List of tags * @throws IOException */ - public List readTagList(int level, boolean paralel, boolean skipUnusualTags) throws IOException { + public List readTagList(SWF swf, int level, boolean paralel, boolean skipUnusualTags) throws IOException { ExecutorService executor = null; if (paralel) { executor = Executors.newFixedThreadPool(20); @@ -1212,7 +1216,7 @@ public class SWFInputStream extends InputStream { while (true) { long pos = getPos(); try { - tag = readTag(level, pos, false, paralel, skipUnusualTags); + tag = readTag(swf, level, pos, false, paralel, skipUnusualTags); } catch (EndOfStreamException ex) { tag = null; } @@ -1230,7 +1234,7 @@ public class SWFInputStream extends InputStream { } else { switch (tag.getId()) { case FileAttributesTag.ID: //FileAttributes - FileAttributesTag fileAttributes = (FileAttributesTag) resolveTag(tag, version, level, paralel, skipUnusualTags); + FileAttributesTag fileAttributes = (FileAttributesTag) resolveTag(swf, tag, version, level, paralel, skipUnusualTags); if (fileAttributes.actionScript3) { isAS3 = true; } @@ -1269,7 +1273,7 @@ public class SWFInputStream extends InputStream { } if (doParse) { - Future future = executor.submit(new TagResolutionTask(tag, version, level, paralel, skipUnusualTags)); + Future future = executor.submit(new TagResolutionTask(swf, tag, version, level, paralel, skipUnusualTags)); futureResults.add(future); } } @@ -1285,7 +1289,7 @@ public class SWFInputStream extends InputStream { return tags; } - public static Tag resolveTag(Tag tag, int version, int level, boolean paralel, boolean skipUnusualTags) { + public static Tag resolveTag(SWF swf, Tag tag, int version, int level, boolean paralel, boolean skipUnusualTags) { Tag ret; byte data[] = tag.getData(version); @@ -1293,228 +1297,228 @@ public class SWFInputStream extends InputStream { try { switch (tag.getId()) { case 0: - ret = new EndTag(data, version, pos); + ret = new EndTag(swf, data, version, pos); break; case 1: - ret = new ShowFrameTag(pos); + ret = new ShowFrameTag(swf, pos); break; case 2: - ret = new DefineShapeTag(data, version, pos); + ret = new DefineShapeTag(swf, data, version, pos); break; //case 3 case 4: - ret = new PlaceObjectTag(data, version, pos); + ret = new PlaceObjectTag(swf, data, version, pos); break; case 5: - ret = new RemoveObjectTag(data, version, pos); + ret = new RemoveObjectTag(swf, data, version, pos); break; case 6: - ret = new DefineBitsTag(data, version, pos); + ret = new DefineBitsTag(swf, data, version, pos); break; case 7: - ret = new DefineButtonTag(data, version, pos); + ret = new DefineButtonTag(swf, data, version, pos); break; case 8: - ret = new JPEGTablesTag(data, pos); + ret = new JPEGTablesTag(swf, data, pos); break; case 9: - ret = new SetBackgroundColorTag(data, version, pos); + ret = new SetBackgroundColorTag(swf, data, version, pos); break; case 10: - ret = new DefineFontTag(data, version, pos); + ret = new DefineFontTag(swf, data, version, pos); break; case 11: - ret = new DefineTextTag(data, version, pos); + ret = new DefineTextTag(swf, data, version, pos); break; case 12: - ret = new DoActionTag(data, version, pos); + ret = new DoActionTag(swf, data, version, pos); break; case 13: - ret = new DefineFontInfoTag(data, version, pos); + ret = new DefineFontInfoTag(swf, data, version, pos); break; case 14: - ret = new DefineSoundTag(data, version, pos); + ret = new DefineSoundTag(swf, data, version, pos); break; case 15: - ret = new StartSoundTag(data, version, pos); + ret = new StartSoundTag(swf, data, version, pos); break; //case 16 case 17: - ret = new DefineButtonSoundTag(data, version, pos); + ret = new DefineButtonSoundTag(swf, data, version, pos); break; case 18: - ret = new SoundStreamHeadTag(data, version, pos); + ret = new SoundStreamHeadTag(swf, data, version, pos); break; case 19: - ret = new SoundStreamBlockTag(data, version, pos); + ret = new SoundStreamBlockTag(swf, data, version, pos); break; case 21: - ret = new DefineBitsJPEG2Tag(data, version, pos); + ret = new DefineBitsJPEG2Tag(swf, data, version, pos); break; case 20: - ret = new DefineBitsLosslessTag(data, version, pos); + ret = new DefineBitsLosslessTag(swf, data, version, pos); break; case 22: - ret = new DefineShape2Tag(data, version, pos); + ret = new DefineShape2Tag(swf, data, version, pos); break; case 23: - ret = new DefineButtonCxformTag(data, version, pos); + ret = new DefineButtonCxformTag(swf, data, version, pos); break; case 24: - ret = new ProtectTag(data, version, pos); + ret = new ProtectTag(swf, data, version, pos); break; //case 25: case 26: - ret = new PlaceObject2Tag(data, version, pos); + ret = new PlaceObject2Tag(swf, data, version, pos); break; //case 27: case 28: - ret = new RemoveObject2Tag(data, version, pos); + ret = new RemoveObject2Tag(swf, data, version, pos); break; //case 29: //case 30: //case 31: case 32: - ret = new DefineShape3Tag(data, version, pos); + ret = new DefineShape3Tag(swf, data, version, pos); break; case 33: - ret = new DefineText2Tag(data, version, pos); + ret = new DefineText2Tag(swf, data, version, pos); break; case 34: - ret = new DefineButton2Tag(data, version, pos); + ret = new DefineButton2Tag(swf, data, version, pos); break; case 35: - ret = new DefineBitsJPEG3Tag(data, version, pos); + ret = new DefineBitsJPEG3Tag(swf, data, version, pos); break; case 36: - ret = new DefineBitsLossless2Tag(data, version, pos); + ret = new DefineBitsLossless2Tag(swf, data, version, pos); break; case 37: - ret = new DefineEditTextTag(data, version, pos); + ret = new DefineEditTextTag(swf, data, version, pos); break; //case 38: case 39: - ret = new DefineSpriteTag(data, version, level, pos, paralel, skipUnusualTags); + ret = new DefineSpriteTag(swf, data, version, level, pos, paralel, skipUnusualTags); break; //case 40: case 41: - ret = new ProductInfoTag(data, version, pos); + ret = new ProductInfoTag(swf, data, version, pos); break; //case 42: case 43: - ret = new FrameLabelTag(data, version, pos); + ret = new FrameLabelTag(swf, data, version, pos); break; //case 44: case 45: - ret = new SoundStreamHead2Tag(data, version, pos); + ret = new SoundStreamHead2Tag(swf, data, version, pos); break; case 46: - ret = new DefineMorphShapeTag(data, version, pos); + ret = new DefineMorphShapeTag(swf, data, version, pos); break; //case 47: case 48: - ret = new DefineFont2Tag(data, version, pos); + ret = new DefineFont2Tag(swf, data, version, pos); break; //case 49-55: case 56: - ret = new ExportAssetsTag(data, version, pos); + ret = new ExportAssetsTag(swf, data, version, pos); break; case 57: - ret = new ImportAssetsTag(data, version, pos); + ret = new ImportAssetsTag(swf, data, version, pos); break; case 58: - ret = new EnableDebuggerTag(data, version, pos); + ret = new EnableDebuggerTag(swf, data, version, pos); break; case 59: - ret = new DoInitActionTag(data, version, pos); + ret = new DoInitActionTag(swf, data, version, pos); break; case 60: - ret = new DefineVideoStreamTag(data, version, pos); + ret = new DefineVideoStreamTag(swf, data, version, pos); break; case 61: - ret = new VideoFrameTag(data, version, pos); + ret = new VideoFrameTag(swf, data, version, pos); break; case 62: - ret = new DefineFontInfo2Tag(data, version, pos); + ret = new DefineFontInfo2Tag(swf, data, version, pos); break; case 63: - ret = new DebugIDTag(data, version, pos); + ret = new DebugIDTag(swf, data, version, pos); break; case 64: - ret = new EnableDebugger2Tag(data, version, pos); + ret = new EnableDebugger2Tag(swf, data, version, pos); break; case 65: - ret = new ScriptLimitsTag(data, version, pos); + ret = new ScriptLimitsTag(swf, data, version, pos); break; case 66: - ret = new SetTabIndexTag(data, version, pos); + ret = new SetTabIndexTag(swf, data, version, pos); break; //case 67-68: case 69: - ret = new FileAttributesTag(data, version, pos); + ret = new FileAttributesTag(swf, data, version, pos); break; case 70: - ret = new PlaceObject3Tag(data, version, pos); + ret = new PlaceObject3Tag(swf, data, version, pos); break; case 71: - ret = new ImportAssets2Tag(data, version, pos); + ret = new ImportAssets2Tag(swf, data, version, pos); break; case 72: - ret = new DoABCTag(data, version, pos); + ret = new DoABCTag(swf, data, version, pos); break; case 73: - ret = new DefineFontAlignZonesTag(data, version, pos); + ret = new DefineFontAlignZonesTag(swf, data, version, pos); break; case 74: - ret = new CSMTextSettingsTag(data, version, pos); + ret = new CSMTextSettingsTag(swf, data, version, pos); break; case 75: - ret = new DefineFont3Tag(data, version, pos); + ret = new DefineFont3Tag(swf, data, version, pos); break; case 76: - ret = new SymbolClassTag(data, version, pos); + ret = new SymbolClassTag(swf, data, version, pos); break; case 77: - ret = new MetadataTag(data, version, pos); + ret = new MetadataTag(swf, data, version, pos); break; case 78: - ret = new DefineScalingGridTag(data, version, pos); + ret = new DefineScalingGridTag(swf, data, version, pos); break; //case 79-81: case 82: - ret = new DoABCDefineTag(data, version, pos); + ret = new DoABCDefineTag(swf, data, version, pos); break; case 83: - ret = new DefineShape4Tag(data, version, pos); + ret = new DefineShape4Tag(swf, data, version, pos); break; case 84: - ret = new DefineMorphShape2Tag(data, version, pos); + ret = new DefineMorphShape2Tag(swf, data, version, pos); break; //case 85: case 86: - ret = new DefineSceneAndFrameLabelDataTag(data, version, pos); + ret = new DefineSceneAndFrameLabelDataTag(swf, data, version, pos); break; case 87: - ret = new DefineBinaryDataTag(data, version, pos); + ret = new DefineBinaryDataTag(swf, data, version, pos); break; case 88: - ret = new DefineFontNameTag(data, version, pos); + ret = new DefineFontNameTag(swf, data, version, pos); break; case 89: - ret = new StartSound2Tag(data, version, pos); + ret = new StartSound2Tag(swf, data, version, pos); break; case 90: - ret = new DefineBitsJPEG4Tag(data, version, pos); + ret = new DefineBitsJPEG4Tag(swf, data, version, pos); break; case 91: - ret = new DefineFont4Tag(data, version, pos); + ret = new DefineFont4Tag(swf, data, version, pos); break; default: - ret = new Tag(tag.getId(), "Unknown", data, pos); + ret = new Tag(swf, tag.getId(), "Unknown", data, pos); } } catch (Exception ex) { Logger.getLogger(SWFInputStream.class.getName()).log(Level.SEVERE, "Error during tag reading", ex); - ret = new Tag(tag.getId(), "ErrorTag", data, pos); + ret = new Tag(swf, tag.getId(), "ErrorTag", data, pos); } ret.previousTag = tag.previousTag; ret.forceWriteAsLong = tag.forceWriteAsLong; @@ -1524,6 +1528,7 @@ public class SWFInputStream extends InputStream { /** * Reads one Tag from the stream * + * @param swf * @param level * @param pos * @param paralel @@ -1531,14 +1536,15 @@ public class SWFInputStream extends InputStream { * @return Tag or null when End tag * @throws IOException */ - public Tag readTag(int level, long pos, boolean paralel, boolean skipUnusualTags) throws IOException { - return readTag(level, pos, true, paralel, skipUnusualTags); + public Tag readTag(SWF swf, int level, long pos, boolean paralel, boolean skipUnusualTags) throws IOException { + return readTag(swf, level, pos, true, paralel, skipUnusualTags); } /** * Reads one Tag from the stream with optional resolving (= reading tag * content) * + * @param swf * @param level * @param pos * @param resolve @@ -1547,7 +1553,7 @@ public class SWFInputStream extends InputStream { * @return Tag or null when End tag * @throws IOException */ - public Tag readTag(int level, long pos, boolean resolve, boolean paralel, boolean skipUnusualTags) throws IOException { + public Tag readTag(SWF swf, int level, long pos, boolean resolve, boolean paralel, boolean skipUnusualTags) throws IOException { int tagIDTagLength = readUI16(); int tagID = (tagIDTagLength) >> 6; if (tagID == 0) { @@ -1560,7 +1566,7 @@ public class SWFInputStream extends InputStream { readLong = true; } byte data[] = readBytes((int) tagLength); - Tag ret = new Tag(tagID, "Unknown", data, pos); + Tag ret = new Tag(swf, tagID, "Unknown", data, pos); ret.forceWriteAsLong = readLong; byte dataNew[] = ret.getData(version); @@ -1596,7 +1602,7 @@ public class SWFInputStream extends InputStream { } } if (resolve) { - return resolveTag(ret, version, level, paralel, skipUnusualTags); + return resolveTag(swf, ret, version, level, paralel, skipUnusualTags); } return ret; } diff --git a/trunk/src/com/jpexs/decompiler/flash/TagNode.java b/trunk/src/com/jpexs/decompiler/flash/TagNode.java index 1255637ad..a2f089254 100644 --- a/trunk/src/com/jpexs/decompiler/flash/TagNode.java +++ b/trunk/src/com/jpexs/decompiler/flash/TagNode.java @@ -44,6 +44,7 @@ import com.jpexs.decompiler.flash.tags.DefineText2Tag; import com.jpexs.decompiler.flash.tags.DefineTextTag; import com.jpexs.decompiler.flash.tags.ExportAssetsTag; import com.jpexs.decompiler.flash.tags.ShowFrameTag; +import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.base.ASMSource; import com.jpexs.decompiler.flash.tags.base.Container; import com.jpexs.decompiler.flash.tags.base.Exportable; @@ -230,11 +231,11 @@ public class TagNode { } } - public static List exportNodeAS(AbortRetryIgnoreHandler handler, List nodeList, String outdir, boolean isPcode) throws IOException { - return exportNodeAS(handler, nodeList, outdir, isPcode, null); + public static List exportNodeAS(List allTags, AbortRetryIgnoreHandler handler, List nodeList, String outdir, boolean isPcode) throws IOException { + return exportNodeAS(allTags, handler, nodeList, outdir, isPcode, null); } - public static List exportNodeAS(AbortRetryIgnoreHandler handler, List nodeList, String outdir, boolean isPcode, EventListener ev) throws IOException { + public static List exportNodeAS(List allTags, AbortRetryIgnoreHandler handler, List nodeList, String outdir, boolean isPcode, EventListener ev) throws IOException { File dir = new File(outdir); List ret = new ArrayList<>(); if (!outdir.endsWith(File.separator)) { @@ -244,7 +245,7 @@ public class TagNode { for (TagNode node : nodeList) { String name = ""; if (node.tag instanceof Exportable) { - name = ((Exportable) node.tag).getExportFileName(); + name = ((Exportable) node.tag).getExportFileName(allTags); } else { name = Helper.makeFileName(node.tag.toString()); } @@ -304,7 +305,7 @@ public class TagNode { } while (retry); } } else { - ret.addAll(exportNodeAS(handler, node.subItems, outdir + name, isPcode, ev)); + ret.addAll(exportNodeAS(allTags, handler, node.subItems, outdir + name, isPcode, ev)); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java index 92f28684f..4d0ae6e57 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java @@ -99,6 +99,7 @@ import java.awt.Component; import java.awt.Cursor; import java.awt.Dimension; import java.awt.FlowLayout; +import java.awt.GraphicsEnvironment; import java.awt.Insets; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; @@ -132,6 +133,7 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Random; @@ -147,6 +149,7 @@ import javax.swing.BoxLayout; import javax.swing.Icon; import javax.swing.JButton; import javax.swing.JCheckBoxMenuItem; +import javax.swing.JComboBox; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JLabel; @@ -244,6 +247,7 @@ public class MainFrame extends AppFrame implements ActionListener, TreeSelection private JButton errorNotificationButton; private ErrorLogFrame errorLogFrame; private ComponentListener fontChangeList; + private JComboBox fontSelection; private AbortRetryIgnoreHandler errorHandler = new AbortRetryIgnoreHandler() { @Override public int handle(Throwable thrown) { @@ -928,7 +932,7 @@ public class MainFrame extends AppFrame implements ActionListener, TreeSelection fontChangeList.componentResized(null); - fontParams1.setLayout(new BoxLayout(fontParams1, BoxLayout.Y_AXIS)); + fontParams1.setLayout(new ListLayout()); fontParams1.add(fontParams2); JPanel fontAddCharsPanel = new JPanel(new FlowLayout()); @@ -942,6 +946,15 @@ public class MainFrame extends AppFrame implements ActionListener, TreeSelection fontAddCharsPanel.add(fontAddCharsButton); fontParams1.add(fontAddCharsPanel); + JPanel fontSelectionPanel = new JPanel(new FlowLayout()); + fontSelectionPanel.add(new JLabel(translate("font.source"))); + String fontNames[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); + fontSelection = new JComboBox<>(fontNames); + fontSelection.setSelectedIndex(0); + fontSelection.setSelectedItem("Times New Roman"); + fontSelection.setSelectedItem("Arial"); + fontSelectionPanel.add(fontSelection); + fontParams1.add(fontSelectionPanel); fontPanel.setLayout(new BorderLayout()); fontPanel.add(new JScrollPane(fontParams1), BorderLayout.CENTER); @@ -1751,7 +1764,7 @@ public class MainFrame extends AppFrame implements ActionListener, TreeSelection allNodes.add(asn); TagNode.setExport(allNodes, false); TagNode.setExport(actionNodes, true); - ret.addAll(TagNode.exportNodeAS(handler, allNodes, selFile, isPcode)); + ret.addAll(TagNode.exportNodeAS(swf.tags, handler, allNodes, selFile, isPcode)); } } return ret; @@ -1801,7 +1814,7 @@ public class MainFrame extends AppFrame implements ActionListener, TreeSelection for (int i = 0; i < newchars.length(); i++) { char c = newchars.charAt(i); if (oldchars.indexOf((int) c) == -1) { - f.addCharacter(swf.tags, c); + f.addCharacter(swf.tags, c, fontSelection.getSelectedItem().toString()); } } fontAddCharactersField.setText(""); @@ -1982,7 +1995,7 @@ public class MainFrame extends AppFrame implements ActionListener, TreeSelection case "SAVETEXT": if (oldValue instanceof TextTag) { try { - ((TextTag) oldValue).setFormattedText(swf.tags, textValue.getText()); + ((TextTag) oldValue).setFormattedText(swf.tags, textValue.getText(), fontSelection.getSelectedItem().toString()); setEditText(false); } catch (ParseException ex) { JOptionPane.showMessageDialog(null, translate("error.text.invalid").replace("%text%", ex.text).replace("%line%", "" + ex.line), translate("error"), JOptionPane.ERROR_MESSAGE); @@ -2500,7 +2513,7 @@ public class MainFrame extends AppFrame implements ActionListener, TreeSelection sos2.writeUI8(0); sos2.writeUI8(swf.frameRate); sos2.writeUI16(100); //framecnt - sos2.writeTag(new SetBackgroundColorTag(new RGB(255, 255, 255))); + sos2.writeTag(new SetBackgroundColorTag(null, new RGB(255, 255, 255))); if (tagObj instanceof FrameNode) { FrameNode fn = (FrameNode) tagObj; @@ -2554,12 +2567,12 @@ public class MainFrame extends AppFrame implements ActionListener, TreeSelection mat.translateX = mat.translateX + width / 2; mat.translateY = mat.translateY + height / 2; } - sos2.writeTag(new PlaceObject2Tag(false, false, false, false, false, true, false, true, depth, chid, mat, null, 0, null, 0, null)); + sos2.writeTag(new PlaceObject2Tag(null, false, false, false, false, false, true, false, true, depth, chid, mat, null, 0, null, 0, null)); } } } - sos2.writeTag(new ShowFrameTag()); + sos2.writeTag(new ShowFrameTag(null)); } else { if (tagObj instanceof DefineBitsTag) { @@ -2624,26 +2637,26 @@ public class MainFrame extends AppFrame implements ActionListener, TreeSelection rec.add(tr); mat.translateX = x * width / sloupcu; mat.translateY = y * height / radku; - sos2.writeTag(new DefineTextTag(999 + f, new RECT(0, width, 0, height), new MATRIX(), SWFOutputStream.getNeededBitsU(countGlyphs - 1), SWFOutputStream.getNeededBitsU(0), rec)); - sos2.writeTag(new PlaceObject2Tag(false, false, false, true, false, true, true, false, 1 + f, 999 + f, mat, null, 0, null, 0, null)); + sos2.writeTag(new DefineTextTag(null, 999 + f, new RECT(0, width, 0, height), new MATRIX(), SWFOutputStream.getNeededBitsU(countGlyphs - 1), SWFOutputStream.getNeededBitsU(0), rec)); + sos2.writeTag(new PlaceObject2Tag(null, false, false, false, true, false, true, true, false, 1 + f, 999 + f, mat, null, 0, null, 0, null)); x++; } - sos2.writeTag(new ShowFrameTag()); + sos2.writeTag(new ShowFrameTag(null)); } else if ((tagObj instanceof DefineMorphShapeTag) || (tagObj instanceof DefineMorphShape2Tag)) { - sos2.writeTag(new PlaceObject2Tag(false, false, false, true, false, true, true, false, 1, chtId, mat, null, 0, null, 0, null)); - sos2.writeTag(new ShowFrameTag()); + sos2.writeTag(new PlaceObject2Tag(null, false, false, false, true, false, true, true, false, 1, chtId, mat, null, 0, null, 0, null)); + sos2.writeTag(new ShowFrameTag(null)); int numFrames = 100; for (int ratio = 0; ratio < 65536; ratio += 65536 / numFrames) { - sos2.writeTag(new PlaceObject2Tag(false, false, false, true, false, true, false, true, 1, chtId, mat, null, ratio, null, 0, null)); - sos2.writeTag(new ShowFrameTag()); + sos2.writeTag(new PlaceObject2Tag(null, false, false, false, true, false, true, false, true, 1, chtId, mat, null, ratio, null, 0, null)); + sos2.writeTag(new ShowFrameTag(null)); } } else { - sos2.writeTag(new PlaceObject2Tag(false, false, false, true, false, true, true, false, 1, chtId, mat, null, 0, null, 0, null)); - sos2.writeTag(new ShowFrameTag()); + sos2.writeTag(new PlaceObject2Tag(null, false, false, false, true, false, true, true, false, 1, chtId, mat, null, 0, null, 0, null)); + sos2.writeTag(new ShowFrameTag(null)); } }//not showframe - sos2.writeTag(new EndTag()); + sos2.writeTag(new EndTag(null)); byte data[] = baos.toByteArray(); sos.writeUI32(sos.getPos() + data.length + 4); @@ -2672,11 +2685,15 @@ public class MainFrame extends AppFrame implements ActionListener, TreeSelection fontNameLabel.setText(ft.getFontName(swf.tags)); fontIsBoldLabel.setText(ft.isBold() ? translate("yes") : translate("no")); fontIsItalicLabel.setText(ft.isItalic() ? translate("yes") : translate("no")); - fontDescentLabel.setText("" + ft.getDescent()); - fontAscentLabel.setText("" + ft.getDescent()); - fontLeadingLabel.setText("" + ft.getDescent()); + fontDescentLabel.setText(ft.getDescent() == -1 ? translate("value.unknown") : "" + ft.getDescent()); + fontAscentLabel.setText(ft.getAscent() == -1 ? translate("value.unknown") : "" + ft.getAscent()); + fontLeadingLabel.setText(ft.getLeading() == -1 ? translate("value.unknown") : "" + ft.getLeading()); String chars = ft.getCharacters(swf.tags); fontCharactersTextArea.setText(chars); + fontSelection.setSelectedIndex(0); + fontSelection.setSelectedItem("Times New Roman"); + fontSelection.setSelectedItem("Arial"); + fontSelection.setSelectedItem(ft.getFontName(swf.tags)); fontChangeList.componentResized(null); showDetailWithPreview(CARDFONTPANEL); } else { diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties index ed08d7e85..6f8116478 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties @@ -322,4 +322,6 @@ FileChooser.folderNameLabelText = Folder name: error.occured = Error occured : %error% button.abort = Abort button.retry = Retry -button.ignore = Ignore \ No newline at end of file +button.ignore = Ignore + +font.source = Source Font: \ No newline at end of file diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties index a6e188e32..5f9c0021e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties @@ -320,4 +320,6 @@ FileChooser.folderNameLabelText = N\u00e1zev slo\u017eky: error.occured = Do\u0161lo k chyb\u011b : %error% button.abort = P\u0159eru\u0161it button.retry = Znovu -button.ignore = Ignorovat \ No newline at end of file +button.ignore = Ignorovat + +font.source = Zdrojov\u00e9 p\u00edsmo: \ No newline at end of file diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java index 279b212b2..6e765d8db 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/CSMTextSettingsTag.java @@ -16,8 +16,10 @@ */ package com.jpexs.decompiler.flash.tags; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -35,6 +37,7 @@ public class CSMTextSettingsTag extends Tag { public int gridFit; public float thickness; public float sharpness; + public static final int ID = 74; /** * Gets data bytes @@ -63,12 +66,14 @@ public class CSMTextSettingsTag extends Tag { /** * Constructor * + * @param swf * @param data Data bytes * @param version SWF version + * @param pos * @throws IOException */ - public CSMTextSettingsTag(byte data[], int version, long pos) throws IOException { - super(74, "CSMTextSettings", data, pos); + public CSMTextSettingsTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "CSMTextSettings", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); textID = sis.readUI16(); useFlashType = (int) sis.readUB(2); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java index 63e970f2c..9893a5d2d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DebugIDTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -31,6 +32,7 @@ import java.io.OutputStream; public class DebugIDTag extends Tag { public byte debugId[]; + public static final int ID = 63; /** * Gets data bytes @@ -53,12 +55,13 @@ public class DebugIDTag extends Tag { /** * Constructor * + * @param swf * @param data Data bytes * @param version SWF version * @throws IOException */ - public DebugIDTag(byte data[], int version, long pos) throws IOException { - super(63, "DebugID", data, pos); + public DebugIDTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DebugID", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); debugId = sis.readBytes(16); } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java index 0b9825542..57c8ac0ab 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBinaryDataTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -51,8 +52,8 @@ public class DefineBinaryDataTag extends CharacterTag { return baos.toByteArray(); } - public DefineBinaryDataTag(byte[] data, int version, long pos) throws IOException { - super(ID, "DefineBinaryData", data, pos); + public DefineBinaryDataTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineBinaryData", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); tag = sis.readUI16(); reserved = sis.readUI32(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java index d6d43c3f9..d28b4c734 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG2Tag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.AloneTag; import com.jpexs.decompiler.flash.tags.base.ImageTag; import java.awt.image.BufferedImage; @@ -53,8 +54,8 @@ public class DefineBitsJPEG2Tag extends ImageTag implements AloneTag { return null; } - public DefineBitsJPEG2Tag(byte[] data, int version, long pos) throws IOException { - super(ID, "DefineBitsJPEG2", data, pos); + public DefineBitsJPEG2Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineBitsJPEG2", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterID = sis.readUI16(); imageData = sis.readBytes(sis.available()); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java index a623c185b..514057410 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG3Tag.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.AloneTag; import com.jpexs.decompiler.flash.tags.base.ImageTag; import java.awt.image.BufferedImage; @@ -94,8 +95,8 @@ public class DefineBitsJPEG3Tag extends ImageTag implements AloneTag { return null; } - public DefineBitsJPEG3Tag(byte[] data, int version, long pos) throws IOException { - super(ID, "DefineBitsJPEG3", data, pos); + public DefineBitsJPEG3Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineBitsJPEG3", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterID = sis.readUI16(); long alphaDataOffset = sis.readUI32(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java index 7efbf299e..abb8c918a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsJPEG4Tag.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.AloneTag; import com.jpexs.decompiler.flash.tags.base.ImageTag; import java.awt.image.BufferedImage; @@ -129,8 +130,8 @@ public class DefineBitsJPEG4Tag extends ImageTag implements AloneTag { * @param version SWF version * @throws IOException */ - public DefineBitsJPEG4Tag(byte data[], int version, long pos) throws IOException { - super(ID, "DefineBitsJPEG4", data, pos); + public DefineBitsJPEG4Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineBitsJPEG4", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterID = sis.readUI16(); long alphaDataOffset = sis.readUI32(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java index 36aa58502..331d8cead 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLossless2Tag.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.AloneTag; import com.jpexs.decompiler.flash.tags.base.ImageTag; import com.jpexs.decompiler.flash.types.ALPHABITMAPDATA; @@ -87,8 +88,8 @@ public class DefineBitsLossless2Tag extends ImageTag implements AloneTag { decompressed = false; } - public DefineBitsLossless2Tag(byte[] data, int version, long pos) throws IOException { - super(ID, "DefineBitsLossless2", data, pos); + public DefineBitsLossless2Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineBitsLossless2", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterID = sis.readUI16(); bitmapFormat = sis.readUI8(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java index 6fbf4a9d0..a3ae37d10 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsLosslessTag.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.AloneTag; import com.jpexs.decompiler.flash.tags.base.ImageTag; import com.jpexs.decompiler.flash.types.BITMAPDATA; @@ -155,8 +156,8 @@ public class DefineBitsLosslessTag extends ImageTag implements AloneTag { decompressed = true; } - public DefineBitsLosslessTag(byte[] data, int version, long pos) throws IOException { - super(ID, "DefineBitsLossless", data, pos); + public DefineBitsLosslessTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineBitsLossless", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterID = sis.readUI16(); bitmapFormat = sis.readUI8(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java index f71a85bfd..03bde5588 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineBitsTag.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.ImageTag; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; @@ -45,8 +46,8 @@ public class DefineBitsTag extends ImageTag { return false; } - public DefineBitsTag(byte[] data, int version, long pos) throws IOException { - super(ID, "DefineBits", data, pos); + public DefineBitsTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineBits", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterID = sis.readUI16(); jpegData = sis.readBytes(sis.available()); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java index e0c75382d..5d9a98fa7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButton2Tag.java @@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.Layer; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.abc.CopyOutputStream; import com.jpexs.decompiler.flash.helpers.Cache; import com.jpexs.decompiler.flash.tags.base.BoundedTag; @@ -91,8 +92,8 @@ public class DefineButton2Tag extends CharacterTag implements Container, Bounded * @param pos * @throws IOException */ - public DefineButton2Tag(byte data[], int version, long pos) throws IOException { - super(ID, "DefineButton2", data, pos); + public DefineButton2Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineButton2", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); buttonId = sis.readUI16(); sis.readUB(7); //reserved diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java index ed022e14b..994a707d2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonCxformTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.types.CXFORM; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -61,8 +62,8 @@ public class DefineButtonCxformTag extends Tag { * @param version SWF version * @throws IOException */ - public DefineButtonCxformTag(byte data[], int version, long pos) throws IOException { - super(ID, "DefineButtonCxform", data, pos); + public DefineButtonCxformTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineButtonCxform", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); buttonId = sis.readUI16(); buttonColorTransform = sis.readCXFORM(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java index c8b87bcd4..a04706c41 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonSoundTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import com.jpexs.decompiler.flash.types.SOUNDINFO; import java.io.ByteArrayInputStream; @@ -89,8 +90,8 @@ public class DefineButtonSoundTag extends CharacterTag { * @param version SWF version * @throws IOException */ - public DefineButtonSoundTag(byte data[], int version, long pos) throws IOException { - super(ID, "DefineButtonSound", data, pos); + public DefineButtonSoundTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineButtonSound", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); buttonId = sis.readUI16(); buttonSoundChar0 = sis.readUI16(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java index 7cf0496cc..ebd8ec904 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineButtonTag.java @@ -23,6 +23,7 @@ import com.jpexs.decompiler.flash.ReReadableInputStream; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.abc.CopyOutputStream; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.helpers.Cache; @@ -90,8 +91,8 @@ public class DefineButtonTag extends CharacterTag implements ASMSource, BoundedT * @param pos * @throws IOException */ - public DefineButtonTag(byte[] data, int version, long pos) throws IOException { - super(ID, "DefineButton", data, pos); + public DefineButtonTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineButton", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); buttonId = sis.readUI16(); characters = sis.readBUTTONRECORDList(false); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java index a0c907cf0..041ee76ed 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineEditTextTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.BoundedTag; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import com.jpexs.decompiler.flash.tags.base.TextTag; @@ -162,7 +163,7 @@ public class DefineEditTextTag extends CharacterTag implements BoundedTag, TextT } @Override - public void setFormattedText(List tags, String text) throws ParseException { + public void setFormattedText(List tags, String text, String fontName) throws ParseException { try { TextLexer lexer = new TextLexer(new InputStreamReader(new ByteArrayInputStream(text.getBytes("UTF-8")), "UTF-8")); ParsedSymbol s = null; @@ -468,8 +469,8 @@ public class DefineEditTextTag extends CharacterTag implements BoundedTag, TextT * @param pos * @throws IOException */ - public DefineEditTextTag(byte data[], int version, long pos) throws IOException { - super(ID, "DefineEditText", data, pos); + public DefineEditTextTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineEditText", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterID = sis.readUI16(); bounds = sis.readRECT(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java index 01127d040..73879cd8d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont2Tag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.FontTag; import com.jpexs.decompiler.flash.types.KERNINGRECORD; import com.jpexs.decompiler.flash.types.LANGCODE; @@ -163,13 +164,14 @@ public class DefineFont2Tag extends FontTag { /** * Constructor * + * @param swf * @param data Data bytes * @param version SWF version * @param pos * @throws IOException */ - public DefineFont2Tag(byte data[], int version, long pos) throws IOException { - super(ID, "DefineFont2", data, pos); + public DefineFont2Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineFont2", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); fontId = sis.readUI16(); fontFlagsHasLayout = sis.readUB(1) == 1; @@ -307,17 +309,16 @@ public class DefineFont2Tag extends FontTag { } @Override - public void addCharacter(List tags, char character) { + public void addCharacter(List tags, char character, String fontName) { int fontStyle = getFontStyle(); - String fname = getFontName(tags); - SHAPE shp = SHAPERECORD.systemFontCharacterToSHAPE(fname, fontStyle, getDivider() * 1024, character); + SHAPE shp = SHAPERECORD.systemFontCharacterToSHAPE(fontName, fontStyle, getDivider() * 1024, character); glyphShapeTable.add(shp); codeTable.add((int) character); if (fontFlagsHasLayout) { fontBoundsTable.add(shp.getBounds()); - Font fnt = new Font(fname, fontStyle, getDivider() * 1024); + Font fnt = new Font(fontName, fontStyle, getDivider() * 1024); fontAdvanceTable.add((new JPanel()).getFontMetrics(fnt).charWidth(character)); } numGlyphs++; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java index 01ab255cb..2fa17dfe4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont3Tag.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.abc.CopyOutputStream; import com.jpexs.decompiler.flash.tags.base.FontTag; import com.jpexs.decompiler.flash.types.KERNINGRECORD; @@ -89,8 +90,8 @@ public class DefineFont3Tag extends FontTag { return codeTable.indexOf((Integer) (int) c); } - public DefineFont3Tag(byte[] data, int version, long pos) throws IOException { - super(ID, "DefineFont3", data, pos); + public DefineFont3Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineFont3", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); fontId = sis.readUI16(); fontFlagsHasLayout = sis.readUB(1) == 1; @@ -299,15 +300,14 @@ public class DefineFont3Tag extends FontTag { } @Override - public void addCharacter(List tags, char character) { + public void addCharacter(List tags, char character, String fontName) { int fontStyle = getFontStyle(); - String fname = getFontName(tags); - SHAPE shp = SHAPERECORD.systemFontCharacterToSHAPE(fname, fontStyle, getDivider() * 1024, character); + SHAPE shp = SHAPERECORD.systemFontCharacterToSHAPE(fontName, fontStyle, getDivider() * 1024, character); glyphShapeTable.add(shp); codeTable.add((int) character); if (fontFlagsHasLayout) { fontBoundsTable.add(shp.getBounds()); - Font fnt = new Font(fname, fontStyle, getDivider() * 1024); + Font fnt = new Font(fontName, fontStyle, getDivider() * 1024); fontAdvanceTable.add((new JPanel()).getFontMetrics(fnt).charWidth(character)); } numGlyphs++; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java index 27d65b8ca..6826d4755 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFont4Tag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -39,8 +40,8 @@ public class DefineFont4Tag extends CharacterTag { return fontID; } - public DefineFont4Tag(byte[] data, int version, long pos) throws IOException { - super(ID, "DefineFont4", data, pos); + public DefineFont4Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineFont4", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); fontID = sis.readUI16(); sis.readUB(5); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java index af1bcd9f0..d6033d7ee 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontAlignZonesTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.types.ZONERECORD; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -33,8 +34,8 @@ public class DefineFontAlignZonesTag extends Tag { public List zoneTable; public static final int ID = 73; - public DefineFontAlignZonesTag(byte[] data, int version, long pos) throws IOException { - super(ID, "DefineFontAlignZones", data, pos); + public DefineFontAlignZonesTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineFontAlignZones", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); fontID = sis.readUI16(); CSMTableHint = (int) sis.readUB(2); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java index d48fc9ef2..5c022160e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontInfo2Tag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.types.LANGCODE; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -83,8 +84,8 @@ public class DefineFontInfo2Tag extends Tag { * @param version SWF version * @throws IOException */ - public DefineFontInfo2Tag(byte data[], int version, long pos) throws IOException { - super(ID, "DefineFontInfo2", data, pos); + public DefineFontInfo2Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineFontInfo2", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); fontID = sis.readUI16(); int fontNameLen = sis.readUI8(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java index 12a86cdc5..032603c84 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontInfoTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -85,8 +86,8 @@ public class DefineFontInfoTag extends Tag { * @param pos * @throws IOException */ - public DefineFontInfoTag(byte data[], int version, long pos) throws IOException { - super(ID, "DefineFontInfo", data, pos); + public DefineFontInfoTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineFontInfo", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); fontId = sis.readUI16(); int fontNameLen = sis.readUI8(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java index 5ef8b8cc4..0013678d4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontNameTag.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.tags; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -27,8 +28,8 @@ public class DefineFontNameTag extends Tag { public String fontCopyright; public static final int ID = 88; - public DefineFontNameTag(byte[] data, int version, long pos) throws IOException { - super(ID, "DefineFontName", data, pos); + public DefineFontNameTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineFontName", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); fontId = sis.readUI16(); fontName = sis.readString(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java index 6728c9120..2f051d535 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineFontTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.FontTag; import com.jpexs.decompiler.flash.types.SHAPE; import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD; @@ -39,6 +40,7 @@ public class DefineFontTag extends FontTag { public List glyphShapeTable; private DefineFontInfoTag fontInfoTag = null; private DefineFontInfo2Tag fontInfo2Tag = null; + public static final int ID = 10; @Override public boolean isSmall() { @@ -130,13 +132,14 @@ public class DefineFontTag extends FontTag { /** * Constructor * + * @param swf * @param data Data bytes * @param version SWF version * @param pos * @throws IOException */ - public DefineFontTag(byte data[], int version, long pos) throws IOException { - super(10, "DefineFont", data, pos); + public DefineFontTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineFont", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); fontId = sis.readUI16(); int firstOffset = sis.readUI16(); @@ -221,8 +224,8 @@ public class DefineFontTag extends FontTag { } @Override - public void addCharacter(List tags, char character) { - glyphShapeTable.add(SHAPERECORD.systemFontCharacterToSHAPE(getFontName(tags), getFontStyle(), getDivider() * 1024, character)); + public void addCharacter(List tags, char character, String fontName) { + glyphShapeTable.add(SHAPERECORD.systemFontCharacterToSHAPE(fontName, getFontStyle(), getDivider() * 1024, character)); ensureFontInfo(tags); if (fontInfoTag != null) { fontInfoTag.codeTable.add((int) character); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java index 124add797..a3b4ac3a9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShape2Tag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.BoundedTag; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import com.jpexs.decompiler.flash.tags.base.DrawableTag; @@ -133,8 +134,8 @@ public class DefineMorphShape2Tag extends CharacterTag implements BoundedTag, Mo * @param pos * @throws IOException */ - public DefineMorphShape2Tag(byte data[], int version, long pos) throws IOException { - super(ID, "DefineMorphShape2", data, pos); + public DefineMorphShape2Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineMorphShape2", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterId = sis.readUI16(); startBounds = sis.readRECT(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java index 507f7d82f..e89bc00e0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineMorphShapeTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.BoundedTag; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import com.jpexs.decompiler.flash.tags.base.DrawableTag; @@ -115,8 +116,8 @@ public class DefineMorphShapeTag extends CharacterTag implements BoundedTag, Mor * @param pos * @throws IOException */ - public DefineMorphShapeTag(byte data[], int version, long pos) throws IOException { - super(ID, "DefineMorphShape", data, pos); + public DefineMorphShapeTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineMorphShape", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterId = sis.readUI16(); startBounds = sis.readRECT(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java index a83e5448f..a3ee2b2e2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineScalingGridTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.types.RECT; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -33,8 +34,8 @@ public class DefineScalingGridTag extends Tag { private RECT splitter; public static final int ID = 78; - public DefineScalingGridTag(byte[] data, int version, long pos) throws IOException { - super(ID, "DefineScalingGrid", data, pos); + public DefineScalingGridTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineScalingGrid", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterId = sis.readUI16(); splitter = sis.readRECT(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java index 7fdcbd56f..a2c895416 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSceneAndFrameLabelDataTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -72,8 +73,8 @@ public class DefineSceneAndFrameLabelDataTag extends Tag { * @param version SWF version * @throws IOException */ - public DefineSceneAndFrameLabelDataTag(byte data[], int version, long pos) throws IOException { - super(ID, "DefineSceneAndFrameLabelData", data, pos); + public DefineSceneAndFrameLabelDataTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineSceneAndFrameLabelData", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); int sceneCount = (int) sis.readEncodedU32(); sceneOffsets = new long[sceneCount]; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java index 7b1b47a93..ae3c34af2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape2Tag.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.tags; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.tags.base.BoundedTag; import com.jpexs.decompiler.flash.tags.base.CharacterTag; @@ -80,8 +81,8 @@ public class DefineShape2Tag extends CharacterTag implements BoundedTag, ShapeTa return shapeBounds; } - public DefineShape2Tag(byte[] data, int version, long pos) throws IOException { - super(ID, "DefineShape2", data, pos); + public DefineShape2Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineShape2", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); shapeId = sis.readUI16(); shapeBounds = sis.readRECT(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java index e30bedb2e..5dacff3cc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape3Tag.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.tags; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.tags.base.BoundedTag; import com.jpexs.decompiler.flash.tags.base.CharacterTag; @@ -80,8 +81,8 @@ public class DefineShape3Tag extends CharacterTag implements BoundedTag, ShapeTa return shapeId; } - public DefineShape3Tag(byte[] data, int version, long pos) throws IOException { - super(ID, "DefineShape3", data, pos); + public DefineShape3Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineShape3", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); shapeId = sis.readUI16(); shapeBounds = sis.readRECT(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java index 81ba97094..d10de0e9f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShape4Tag.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.tags; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.tags.base.BoundedTag; import com.jpexs.decompiler.flash.tags.base.CharacterTag; @@ -84,8 +85,8 @@ public class DefineShape4Tag extends CharacterTag implements BoundedTag, ShapeTa return shapeBounds; } - public DefineShape4Tag(byte[] data, int version, long pos) throws IOException { - super(ID, "DefineShape4", data, pos); + public DefineShape4Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineShape4", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); shapeId = sis.readUI16(); shapeBounds = sis.readRECT(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java index 4e6c000f6..bb5598368 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineShapeTag.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.tags; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.tags.base.BoundedTag; import com.jpexs.decompiler.flash.tags.base.CharacterTag; @@ -60,8 +61,8 @@ public class DefineShapeTag extends CharacterTag implements BoundedTag, ShapeTag return shapeBounds; } - public DefineShapeTag(byte[] data, int version, long pos) throws IOException { - super(ID, "DefineShape", data, pos); + public DefineShapeTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineShape", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); shapeId = sis.readUI16(); shapeBounds = sis.readRECT(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java index da6455f47..38cc599da 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -84,8 +85,8 @@ public class DefineSoundTag extends CharacterTag { * @param version SWF version * @throws IOException */ - public DefineSoundTag(byte data[], int version, long pos) throws IOException { - super(ID, "DefineSound", data, pos); + public DefineSoundTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineSound", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); soundId = sis.readUI16(); soundFormat = (int) sis.readUB(4); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java index 4d204bc71..e47ee01f1 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineSpriteTag.java @@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.abc.CopyOutputStream; import com.jpexs.decompiler.flash.helpers.Cache; import com.jpexs.decompiler.flash.tags.base.BoundedTag; @@ -179,6 +180,7 @@ public class DefineSpriteTag extends CharacterTag implements Container, BoundedT /** * Constructor * + * @param swf * @param data Data bytes * @param version SWF version * @param level @@ -187,12 +189,12 @@ public class DefineSpriteTag extends CharacterTag implements Container, BoundedT * @param skipUnusualTags * @throws IOException */ - public DefineSpriteTag(byte[] data, int version, int level, long pos, boolean paralel, boolean skipUnusualTags) throws IOException { - super(ID, "DefineSprite", data, pos); + public DefineSpriteTag(SWF swf, byte data[], int version, int level, long pos, boolean paralel, boolean skipUnusualTags) throws IOException { + super(swf, ID, "DefineSprite", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version, pos); spriteId = sis.readUI16(); frameCount = sis.readUI16(); - subTags = sis.readTagList(level + 1, paralel, skipUnusualTags); + subTags = sis.readTagList(swf, level + 1, paralel, skipUnusualTags); } static int c = 0; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java index edae0829f..5df815eaa 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineText2Tag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.helpers.Helper; import com.jpexs.decompiler.flash.tags.base.BoundedTag; import com.jpexs.decompiler.flash.tags.base.CharacterTag; @@ -163,7 +164,7 @@ public class DefineText2Tag extends CharacterTag implements BoundedTag, TextTag, } @Override - public void setFormattedText(List tags, String text) throws ParseException { + public void setFormattedText(List tags, String text, String fontName) throws ParseException { try { TextLexer lexer = new TextLexer(new InputStreamReader(new ByteArrayInputStream(text.getBytes("UTF-8")), "UTF-8")); ParsedSymbol s = null; @@ -335,7 +336,7 @@ public class DefineText2Tag extends CharacterTag implements BoundedTag, TextTag, char c = txt.charAt(i); tr.glyphEntries[i] = new GLYPHENTRY(); if (!font.containsChar(tags, c)) { - font.addCharacter(tags, c); + font.addCharacter(tags, c, fontName); } tr.glyphEntries[i].glyphIndex = font.charToGlyph(tags, c); @@ -427,8 +428,8 @@ public class DefineText2Tag extends CharacterTag implements BoundedTag, TextTag, * @param pos * @throws IOException */ - public DefineText2Tag(byte data[], int version, long pos) throws IOException { - super(ID, "DefineText2", data, pos); + public DefineText2Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineText2", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterID = sis.readUI16(); textBounds = sis.readRECT(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java index 284cf8f71..8cc5843e4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineTextTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.helpers.Helper; import com.jpexs.decompiler.flash.tags.base.BoundedTag; import com.jpexs.decompiler.flash.tags.base.CharacterTag; @@ -163,7 +164,7 @@ public class DefineTextTag extends CharacterTag implements BoundedTag, TextTag, } @Override - public void setFormattedText(List tags, String text) throws ParseException { + public void setFormattedText(List tags, String text, String fontName) throws ParseException { try { TextLexer lexer = new TextLexer(new InputStreamReader(new ByteArrayInputStream(text.getBytes("UTF-8")), "UTF-8")); ParsedSymbol s = null; @@ -334,7 +335,7 @@ public class DefineTextTag extends CharacterTag implements BoundedTag, TextTag, char c = txt.charAt(i); tr.glyphEntries[i] = new GLYPHENTRY(); if (!font.containsChar(tags, c)) { - font.addCharacter(tags, c); + font.addCharacter(tags, c, fontName); } tr.glyphEntries[i].glyphIndex = font.charToGlyph(tags, c); @@ -388,8 +389,8 @@ public class DefineTextTag extends CharacterTag implements BoundedTag, TextTag, return characterID; } - public DefineTextTag(int characterID, RECT textBounds, MATRIX textMatrix, int glyphBits, int advanceBits, List textRecords) { - super(ID, "DefineText", new byte[0], 0); + public DefineTextTag(SWF swf, int characterID, RECT textBounds, MATRIX textMatrix, int glyphBits, int advanceBits, List textRecords) { + super(swf, ID, "DefineText", new byte[0], 0); this.characterID = characterID; this.textBounds = textBounds; this.textMatrix = textMatrix; @@ -427,13 +428,14 @@ public class DefineTextTag extends CharacterTag implements BoundedTag, TextTag, /** * Constructor * + * @param swf * @param data Data bytes * @param version SWF version * @param pos * @throws IOException */ - public DefineTextTag(byte data[], int version, long pos) throws IOException { - super(11, "DefineText", data, pos); + public DefineTextTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineText", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterID = sis.readUI16(); textBounds = sis.readRECT(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java index 76e2d8fb5..6a87d65b8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DefineVideoStreamTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -81,8 +82,8 @@ public class DefineVideoStreamTag extends CharacterTag { * @param version SWF version * @throws IOException */ - public DefineVideoStreamTag(byte data[], int version, long pos) throws IOException { - super(ID, "DefineVideoStream", data, pos); + public DefineVideoStreamTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DefineVideoStream", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterID = sis.readUI16(); numFrames = sis.readUI16(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java index bc33348c1..bc66155d7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DoABCDefineTag.java @@ -19,9 +19,11 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.CopyOutputStream; import java.io.*; +import java.util.List; /** * Defines a series of ActionScript 3 bytecodes to be executed @@ -50,19 +52,21 @@ public class DoABCDefineTag extends Tag implements ABCContainerTag { public static final int ID = 82; @Override - public String getName() { + public String getName(List tags) { return "DoABCDefine (" + name + ")"; } /** * Constructor * + * @param swf * @param data Data bytes * @param version SWF version + * @param pos * @throws IOException */ - public DoABCDefineTag(byte[] data, int version, long pos) throws IOException { - super(ID, "DoABCDefine", data, pos); + public DoABCDefineTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DoABCDefine", data, pos); InputStream is = new ByteArrayInputStream(data); SWFInputStream sis = new SWFInputStream(is, version); flags = sis.readUI32(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DoABCTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DoABCTag.java index 87b50c530..e544557a9 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DoABCTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DoABCTag.java @@ -18,9 +18,11 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.CopyOutputStream; import java.io.*; +import java.util.List; /** * Defines a series of ActionScript 3 bytecodes to be executed @@ -39,19 +41,21 @@ public class DoABCTag extends Tag implements ABCContainerTag { } @Override - public String getName() { + public String getName(List tags) { return "DoABC"; } /** * Constructor * + * @param swf * @param data Data bytes * @param version SWF version + * @param pos * @throws IOException */ - public DoABCTag(byte[] data, int version, long pos) throws IOException { - super(ID, "DoABC", data, pos); + public DoABCTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DoABC", data, pos); InputStream is = new ByteArrayInputStream(data); abc = new ABC(is); } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java index d70da53c1..a36843019 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DoActionTag.java @@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.DisassemblyListener; import com.jpexs.decompiler.flash.ReReadableInputStream; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.tags.base.ASMSource; import java.io.ByteArrayInputStream; @@ -50,8 +51,8 @@ public class DoActionTag extends Tag implements ASMSource { * @param version SWF version * @param pos */ - public DoActionTag(byte[] data, int version, long pos) { - super(ID, "DoAction", data, pos); + public DoActionTag(SWF swf, byte data[], int version, long pos) { + super(swf, ID, "DoAction", data, pos); actionBytes = data; } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java index 4ecf7453c..bf98ae485 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/DoInitActionTag.java @@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.DisassemblyListener; import com.jpexs.decompiler.flash.ReReadableInputStream; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.helpers.Helper; import com.jpexs.decompiler.flash.tags.base.ASMSource; @@ -49,13 +50,14 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource { /** * Constructor * + * @param swf * @param data Data bytes * @param version SWF version * @param pos * @throws IOException */ - public DoInitActionTag(byte[] data, int version, long pos) throws IOException { - super(ID, "DoInitAction", data, pos); + public DoInitActionTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "DoInitAction", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); spriteId = sis.readUI16(); //actions = sis.readActionList(); @@ -166,7 +168,7 @@ public class DoInitActionTag extends CharacterIdTag implements ASMSource { } @Override - public String getExportFileName() { + public String getExportFileName(List tags) { String expName = getExportName(); if ((expName == null) || expName.equals("")) { return super.toString(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/EnableDebugger2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/EnableDebugger2Tag.java index 9d5b6cf06..bca754d0c 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/EnableDebugger2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/EnableDebugger2Tag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -64,8 +65,8 @@ public class EnableDebugger2Tag extends Tag { * @param version SWF version * @throws IOException */ - public EnableDebugger2Tag(byte data[], int version, long pos) throws IOException { - super(ID, "EnableDebugger2", data, pos); + public EnableDebugger2Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "EnableDebugger2", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); reserved = sis.readUI16(); passwordHash = sis.readString(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/EnableDebuggerTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/EnableDebuggerTag.java index 81fa944d3..c9d566085 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/EnableDebuggerTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/EnableDebuggerTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -63,8 +64,8 @@ public class EnableDebuggerTag extends Tag { * @param version SWF version * @throws IOException */ - public EnableDebuggerTag(byte data[], int version, long pos) throws IOException { - super(ID, "EnableDebugger", data, pos); + public EnableDebuggerTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "EnableDebugger", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); passwordHash = sis.readString(); } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/EndTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/EndTag.java index 49f2c9237..3ea0ac067 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/EndTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/EndTag.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.tags; +import com.jpexs.decompiler.flash.SWF; import java.io.IOException; /** @@ -40,16 +41,18 @@ public class EndTag extends Tag { /** * Constructor * + * @param swf * @param data Data bytes * @param version SWF version + * @param pos * @throws IOException */ - public EndTag(byte data[], int version, long pos) throws IOException { - super(ID, "End", data, pos); + public EndTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "End", data, pos); } - public EndTag() { - super(0, "End", new byte[0], 0); + public EndTag(SWF swf) { + super(swf, ID, "End", new byte[0], 0); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java index a9ebbb97a..6243b118a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/ExportAssetsTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -46,8 +47,8 @@ public class ExportAssetsTag extends Tag { * @param version SWF version * @throws IOException */ - public ExportAssetsTag(byte[] data, int version, long pos) throws IOException { - super(ID, "ExportAssets", data, pos); + public ExportAssetsTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "ExportAssets", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); int count = sis.readUI16(); tags = new ArrayList<>(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/FileAttributesTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/FileAttributesTag.java index 0db4f325f..e9558b47f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/FileAttributesTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/FileAttributesTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -36,8 +37,8 @@ public class FileAttributesTag extends Tag { private int reserved3; public static final int ID = 69; - public FileAttributesTag(byte[] data, int version, long pos) throws IOException { - super(ID, "FileAttributes", data, pos); + public FileAttributesTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "FileAttributes", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); reserved1 = (int) sis.readUB(1); // reserved // UB[1] == 0 (reserved) diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/FrameLabelTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/FrameLabelTag.java index 2a1ee6860..ef40bc51f 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/FrameLabelTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/FrameLabelTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -37,8 +38,8 @@ public class FrameLabelTag extends Tag { return namedAnchor; } - public FrameLabelTag(byte[] data, int version, long pos) throws IOException { - super(ID, "FrameLabel", data, pos); + public FrameLabelTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "FrameLabel", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); name = sis.readString(); if (sis.available() > 0) { diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/ImportAssets2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/ImportAssets2Tag.java index 22cd7b56c..cbad6064e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/ImportAssets2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/ImportAssets2Tag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.ImportTag; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -46,8 +47,8 @@ public class ImportAssets2Tag extends Tag implements ImportTag { * @param version SWF version * @throws IOException */ - public ImportAssets2Tag(byte data[], int version, long pos) throws IOException { - super(ID, "ImportAssets2", data, pos); + public ImportAssets2Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "ImportAssets2", data, pos); assets = new HashMap<>(); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); url = sis.readString(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/ImportAssetsTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/ImportAssetsTag.java index 9219b694e..1fc1992e2 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/ImportAssetsTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/ImportAssetsTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.ImportTag; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -46,8 +47,8 @@ public class ImportAssetsTag extends Tag implements ImportTag { * @param version SWF version * @throws IOException */ - public ImportAssetsTag(byte data[], int version, long pos) throws IOException { - super(ID, "ImportAssets", data, pos); + public ImportAssetsTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "ImportAssets", data, pos); assets = new HashMap<>(); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); url = sis.readString(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/JPEGTablesTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/JPEGTablesTag.java index 82e13def3..a8a536f71 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/JPEGTablesTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/JPEGTablesTag.java @@ -16,13 +16,14 @@ */ package com.jpexs.decompiler.flash.tags; +import com.jpexs.decompiler.flash.SWF; import java.io.IOException; public class JPEGTablesTag extends Tag { public static final int ID = 8; - public JPEGTablesTag(byte[] data, long pos) throws IOException { - super(ID, "JPEGTables", data, pos); //data is JPEG data + public JPEGTablesTag(SWF swf, byte data[], long pos) throws IOException { + super(swf, ID, "JPEGTables", data, pos); //data is JPEG data } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/MetadataTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/MetadataTag.java index f4936028f..99fb40293 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/MetadataTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/MetadataTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -28,8 +29,8 @@ public class MetadataTag extends Tag { public String xmlMetadata; public static final int ID = 77; - public MetadataTag(byte[] data, int version, long pos) { - super(ID, "Metadata", data, pos); + public MetadataTag(SWF swf, byte data[], int version, long pos) { + super(swf, ID, "Metadata", data, pos); try { SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); xmlMetadata = sis.readString(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java index b45c5fb48..0e13f20c3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject2Tag.java @@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.abc.CopyOutputStream; import com.jpexs.decompiler.flash.tags.base.CharacterIdTag; import com.jpexs.decompiler.flash.tags.base.Container; @@ -178,8 +179,8 @@ public class PlaceObject2Tag extends CharacterIdTag implements Container, PlaceO return baos.toByteArray(); } - public PlaceObject2Tag(boolean placeFlagHasClipActions, boolean placeFlagHasClipDepth, boolean placeFlagHasName, boolean placeFlagHasRatio, boolean placeFlagHasColorTransform, boolean placeFlagHasMatrix, boolean placeFlagHasCharacter, boolean placeFlagMove, int depth, int characterId, MATRIX matrix, CXFORMWITHALPHA colorTransform, int ratio, String name, int clipDepth, CLIPACTIONS clipActions) { - super(ID, "PlaceObject2", new byte[0], 0); + public PlaceObject2Tag(SWF swf, boolean placeFlagHasClipActions, boolean placeFlagHasClipDepth, boolean placeFlagHasName, boolean placeFlagHasRatio, boolean placeFlagHasColorTransform, boolean placeFlagHasMatrix, boolean placeFlagHasCharacter, boolean placeFlagMove, int depth, int characterId, MATRIX matrix, CXFORMWITHALPHA colorTransform, int ratio, String name, int clipDepth, CLIPACTIONS clipActions) { + super(swf, ID, "PlaceObject2", new byte[0], 0); this.placeFlagHasClipActions = placeFlagHasClipActions; this.placeFlagHasClipDepth = placeFlagHasClipDepth; this.placeFlagHasName = placeFlagHasName; @@ -201,13 +202,14 @@ public class PlaceObject2Tag extends CharacterIdTag implements Container, PlaceO /** * Constructor * + * @param swf * @param data Data bytes * @param version SWF version * @param pos * @throws IOException */ - public PlaceObject2Tag(byte data[], int version, long pos) throws IOException { - super(26, "PlaceObject2", data, pos); + public PlaceObject2Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "PlaceObject2", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); placeFlagHasClipActions = sis.readUB(1) == 1; placeFlagHasClipDepth = sis.readUB(1) == 1; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java index 7c450f5c2..969d40c69 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObject3Tag.java @@ -20,6 +20,7 @@ import com.jpexs.decompiler.flash.Configuration; import com.jpexs.decompiler.flash.EndOfStreamException; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.abc.CopyOutputStream; import com.jpexs.decompiler.flash.tags.base.CharacterIdTag; import com.jpexs.decompiler.flash.tags.base.Container; @@ -278,8 +279,8 @@ public class PlaceObject3Tag extends CharacterIdTag implements Container, PlaceO * @param pos * @throws IOException */ - public PlaceObject3Tag(byte data[], int version, long pos) throws IOException { - super(ID, "PlaceObject3", data, pos); + public PlaceObject3Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "PlaceObject3", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); placeFlagHasClipActions = sis.readUB(1) == 1; placeFlagHasClipDepth = sis.readUB(1) == 1; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObjectTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObjectTag.java index 70a913234..83d9f46d3 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObjectTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/PlaceObjectTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.CharacterIdTag; import com.jpexs.decompiler.flash.tags.base.PlaceObjectTypeTag; import com.jpexs.decompiler.flash.types.CLIPACTIONS; @@ -95,13 +96,14 @@ public class PlaceObjectTag extends CharacterIdTag implements PlaceObjectTypeTag /** * Constructor * + * @param swf * @param data Data bytes * @param version SWF version * @param pos * @throws IOException */ - public PlaceObjectTag(byte data[], int version, long pos) throws IOException { - super(ID, "PlaceObject", data, pos); + public PlaceObjectTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "PlaceObject", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterId = sis.readUI16(); depth = sis.readUI16(); @@ -111,8 +113,8 @@ public class PlaceObjectTag extends CharacterIdTag implements PlaceObjectTypeTag } } - public PlaceObjectTag(int characterId, int depth, MATRIX matrix, CXFORM colorTransform) { - super(4, "PlaceObject", new byte[0], 0); + public PlaceObjectTag(SWF swf, int characterId, int depth, MATRIX matrix, CXFORM colorTransform) { + super(swf, ID, "PlaceObject", new byte[0], 0); this.characterId = characterId; this.depth = depth; this.matrix = matrix; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/ProductInfoTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/ProductInfoTag.java index 649f3919d..fc1ec02ad 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/ProductInfoTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/ProductInfoTag.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.tags; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -31,8 +32,8 @@ public class ProductInfoTag extends Tag { public long compilationDate; public static final int ID = 41; - public ProductInfoTag(byte[] data, int version, long pos) throws IOException { - super(ID, "ProductInfo", data, pos); + public ProductInfoTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "ProductInfo", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); /* * 0: Unknown diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/ProtectTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/ProtectTag.java index e13e43e98..a82d69357 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/ProtectTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/ProtectTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -63,8 +64,8 @@ public class ProtectTag extends Tag { * @param version SWF version * @throws IOException */ - public ProtectTag(byte data[], int version, long pos) throws IOException { - super(ID, "Protect", data, pos); + public ProtectTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "Protect", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); if (sis.available() > 0) { passwordHash = sis.readString(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/RemoveObject2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/RemoveObject2Tag.java index c2e12431f..b97a7ba2b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/RemoveObject2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/RemoveObject2Tag.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.tags; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.tags.base.RemoveTag; import java.io.ByteArrayInputStream; @@ -26,8 +27,8 @@ public class RemoveObject2Tag extends Tag implements RemoveTag { public int depth; public static final int ID = 28; - public RemoveObject2Tag(byte[] data, int version, long pos) throws IOException { - super(ID, "RemoveObject2", data, pos); + public RemoveObject2Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "RemoveObject2", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); depth = sis.readUI16(); } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/RemoveObjectTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/RemoveObjectTag.java index d78f17094..399fa5f5e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/RemoveObjectTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/RemoveObjectTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.CharacterIdTag; import com.jpexs.decompiler.flash.tags.base.RemoveTag; import java.io.ByteArrayInputStream; @@ -68,8 +69,8 @@ public class RemoveObjectTag extends CharacterIdTag implements RemoveTag { * @param version SWF version * @throws IOException */ - public RemoveObjectTag(byte data[], int version, long pos) throws IOException { - super(ID, "RemoveObject", data, pos); + public RemoveObjectTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "RemoveObject", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterId = sis.readUI16(); depth = sis.readUI16(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/ScriptLimitsTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/ScriptLimitsTag.java index 50cc389ef..e5e554deb 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/ScriptLimitsTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/ScriptLimitsTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -29,8 +30,8 @@ public class ScriptLimitsTag extends Tag { public int scriptTimeoutSeconds; public static final int ID = 65; - public ScriptLimitsTag(byte[] data, int version, long pos) throws IOException { - super(ID, "ScriptLimits", data, pos); + public ScriptLimitsTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "ScriptLimits", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); maxRecursionDepth = sis.readUI16(); scriptTimeoutSeconds = sis.readUI16(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/SetBackgroundColorTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/SetBackgroundColorTag.java index 22e92dd6e..c1523dd52 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/SetBackgroundColorTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/SetBackgroundColorTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.types.RGB; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -28,14 +29,14 @@ public class SetBackgroundColorTag extends Tag { public RGB backgroundColor; public static final int ID = 9; - public SetBackgroundColorTag(byte[] data, int version, long pos) throws IOException { - super(ID, "SetBackgroundColor", data, pos); + public SetBackgroundColorTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "SetBackgroundColor", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); backgroundColor = sis.readRGB(); } - public SetBackgroundColorTag(RGB backgroundColor) { - super(ID, "SetBackgroundColor", new byte[0], 0); + public SetBackgroundColorTag(SWF swf, RGB backgroundColor) { + super(swf, ID, "SetBackgroundColor", new byte[0], 0); this.backgroundColor = backgroundColor; } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/SetTabIndexTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/SetTabIndexTag.java index dc62803b9..8c922a59b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/SetTabIndexTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/SetTabIndexTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -67,8 +68,8 @@ public class SetTabIndexTag extends Tag { * @param pos * @throws IOException */ - public SetTabIndexTag(byte data[], int version, long pos) throws IOException { - super(ID, "SetTabIndex", data, pos); + public SetTabIndexTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "SetTabIndex", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); depth = sis.readUI16(); tabIndex = sis.readUI16(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/ShowFrameTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/ShowFrameTag.java index fb8d28925..3c60ebd91 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/ShowFrameTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/ShowFrameTag.java @@ -16,6 +16,8 @@ */ package com.jpexs.decompiler.flash.tags; +import com.jpexs.decompiler.flash.SWF; + /** * Instructs Flash Player to display the contents of the display list * @@ -28,14 +30,15 @@ public class ShowFrameTag extends Tag { /** * Constructor * + * @param swf * @param pos */ - public ShowFrameTag(long pos) { - super(ID, "ShowFrame", new byte[0], pos); + public ShowFrameTag(SWF swf, long pos) { + super(swf, ID, "ShowFrame", new byte[0], pos); } - public ShowFrameTag() { - super(ID, "ShowFrame", new byte[0], 0); + public ShowFrameTag(SWF swf) { + super(swf, ID, "ShowFrame", new byte[0], 0); } /** diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/SoundStreamBlockTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/SoundStreamBlockTag.java index 60f4a61c1..5dd7dd39e 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/SoundStreamBlockTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/SoundStreamBlockTag.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.tags; +import com.jpexs.decompiler.flash.SWF; import java.io.IOException; /** @@ -30,11 +31,13 @@ public class SoundStreamBlockTag extends Tag { /** * Constructor * + * @param swf * @param data Data bytes * @param version SWF version + * @param pos * @throws IOException */ - public SoundStreamBlockTag(byte data[], int version, long pos) throws IOException { - super(ID, "SoundStreamBlock", data, pos); //all data is streamSoundData + public SoundStreamBlockTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "SoundStreamBlock", data, pos); //all data is streamSoundData } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/SoundStreamHead2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/SoundStreamHead2Tag.java index 32fd33437..a0697cb93 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/SoundStreamHead2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/SoundStreamHead2Tag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import com.jpexs.decompiler.flash.tags.base.SoundStreamHeadTypeTag; import java.io.ByteArrayInputStream; @@ -107,8 +108,8 @@ public class SoundStreamHead2Tag extends CharacterTag implements SoundStreamHead * @param pos * @throws IOException */ - public SoundStreamHead2Tag(byte data[], int version, long pos) throws IOException { - super(ID, "SoundStreamHead2", data, pos); + public SoundStreamHead2Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "SoundStreamHead2", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); sis.readUB(4);//reserved playBackSoundRate = (int) sis.readUB(2); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/SoundStreamHeadTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/SoundStreamHeadTag.java index bb4677b16..1e2b69ff8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/SoundStreamHeadTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/SoundStreamHeadTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import com.jpexs.decompiler.flash.tags.base.SoundStreamHeadTypeTag; import java.io.ByteArrayInputStream; @@ -106,8 +107,8 @@ public class SoundStreamHeadTag extends CharacterTag implements SoundStreamHeadT * @param version SWF version * @throws IOException */ - public SoundStreamHeadTag(byte data[], int version, long pos) throws IOException { - super(ID, "SoundStreamHead", data, pos); + public SoundStreamHeadTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "SoundStreamHead", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); sis.readUB(4);//reserved playBackSoundRate = (int) sis.readUB(2); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/StartSound2Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/StartSound2Tag.java index 22b376801..1981f6600 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/StartSound2Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/StartSound2Tag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.types.SOUNDINFO; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -60,8 +61,8 @@ public class StartSound2Tag extends Tag { * @param version SWF version * @throws IOException */ - public StartSound2Tag(byte data[], int version, long pos) throws IOException { - super(ID, "StartSound2", data, pos); + public StartSound2Tag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "StartSound2", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); soundClassName = sis.readString(); soundInfo = sis.readSOUNDINFO(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/StartSoundTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/StartSoundTag.java index e793c6d0b..39f89d4e7 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/StartSoundTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/StartSoundTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.types.SOUNDINFO; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -61,8 +62,8 @@ public class StartSoundTag extends Tag { * @param version SWF version * @throws IOException */ - public StartSoundTag(byte data[], int version, long pos) throws IOException { - super(ID, "StartSound", data, pos); + public StartSoundTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "StartSound", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); soundId = sis.readUI16(); soundInfo = sis.readSOUNDINFO(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/SymbolClassTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/SymbolClassTag.java index c51e37db9..5beaec8ae 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/SymbolClassTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/SymbolClassTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -29,8 +30,8 @@ public class SymbolClassTag extends Tag { public String classNames[]; public static final int ID = 76; - public SymbolClassTag(byte[] data, int version, long pos) throws IOException { - super(ID, "SymbolClass", data, pos); + public SymbolClassTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "SymbolClass", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); int numSymbols = sis.readUI16(); tagIDs = new int[numSymbols]; diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/Tag.java b/trunk/src/com/jpexs/decompiler/flash/tags/Tag.java index 36fae4836..22b666051 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/Tag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/Tag.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.tags; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import com.jpexs.decompiler.flash.tags.base.Exportable; import com.jpexs.decompiler.flash.tags.base.NeedsCharacters; @@ -45,14 +46,15 @@ public class Tag implements NeedsCharacters, Exportable { private final long pos; protected String name; public Tag previousTag; + protected SWF swf; - public String getName() { + public String getName(List tags) { return name; } @Override - public String getExportFileName() { - return getName(); + public String getExportFileName(List tags) { + return getName(tags); } /** @@ -67,16 +69,18 @@ public class Tag implements NeedsCharacters, Exportable { /** * Constructor * + * @param swf * @param id Tag type identifier * @param name Tag name * @param data Bytes of data * @param pos */ - public Tag(int id, String name, byte[] data, long pos) { + public Tag(SWF swf, int id, String name, byte data[], long pos) { this.id = id; this.name = name; this.data = data; this.pos = pos; + this.swf = swf; } /** @@ -105,7 +109,7 @@ public class Tag implements NeedsCharacters, Exportable { */ @Override public String toString() { - return getName(); + return getName(swf.tags); } public final long getOrigDataLength() { diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/TagStub.java b/trunk/src/com/jpexs/decompiler/flash/tags/TagStub.java index e3cabe2b6..d87bfd432 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/TagStub.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/TagStub.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -30,6 +31,8 @@ import java.io.OutputStream; */ public class TagStub extends Tag { + public static final int ID = -1; //TODO: Enter correct ID + /** * Gets data bytes * @@ -51,13 +54,14 @@ public class TagStub extends Tag { /** * Constructor * + * @param swf * @param data Data bytes * @param version SWF version * @param pos * @throws IOException */ - public TagStub(byte data[], int version, long pos) throws IOException { - super(0, "", data, pos); + public TagStub(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java index e95fb8c7b..00f3febcc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/VideoFrameTag.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.tags; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.SWF; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -62,8 +63,8 @@ public class VideoFrameTag extends Tag { * @param version SWF version * @throws IOException */ - public VideoFrameTag(byte data[], int version, long pos) throws IOException { - super(ID, "VideoFrame", data, pos); + public VideoFrameTag(SWF swf, byte data[], int version, long pos) throws IOException { + super(swf, ID, "VideoFrame", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); streamID = sis.readUI16(); frameNum = sis.readUI16(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/CharacterIdTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/CharacterIdTag.java index 953c46105..51e224dc8 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/CharacterIdTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/CharacterIdTag.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.tags.base; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.ExportAssetsTag; import com.jpexs.decompiler.flash.tags.Tag; import java.util.ArrayList; @@ -27,8 +28,8 @@ import java.util.List; */ public abstract class CharacterIdTag extends Tag { - public CharacterIdTag(int id, String name, byte[] data, long pos) { - super(id, name, data, pos); + public CharacterIdTag(SWF swf, int id, String name, byte[] data, long pos) { + super(swf, id, name, data, pos); } public abstract int getCharacterId(); @@ -36,8 +37,8 @@ public abstract class CharacterIdTag extends Tag { * List of ExportAssetsTag used for converting to String */ public List exportAssetsTags = new ArrayList<>(); - private String className; - private String exportName; + protected String className; + protected String exportName; public void setExportName(String exportName) { this.exportName = exportName; @@ -52,7 +53,7 @@ public abstract class CharacterIdTag extends Tag { } @Override - public String getName() { + public String getName(List tags) { String nameAppend = ""; if (exportName != null) { nameAppend = ": " + exportName; @@ -60,12 +61,12 @@ public abstract class CharacterIdTag extends Tag { if (className != null) { nameAppend = ": " + className; } - return super.getName() + " (" + getCharacterId() + nameAppend + ")"; + return super.getName(tags) + " (" + getCharacterId() + nameAppend + ")"; } @Override - public String getExportFileName() { - return super.getName() + "_" + getCharacterId() + (((exportName != null) && (!exportName.equals(""))) ? "_" + exportName : ""); + public String getExportFileName(List tags) { + return super.getName(tags) + "_" + getCharacterId() + (((exportName != null) && (!exportName.equals(""))) ? "_" + exportName : ""); } public String getCharacterExportFileName() { diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/CharacterTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/CharacterTag.java index a440443c7..fe7ebf81d 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/CharacterTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/CharacterTag.java @@ -16,13 +16,15 @@ */ package com.jpexs.decompiler.flash.tags.base; +import com.jpexs.decompiler.flash.SWF; + /** * * @author JPEXS */ public abstract class CharacterTag extends CharacterIdTag { - public CharacterTag(int id, String name, byte[] data, long pos) { - super(id, name, data, pos); + public CharacterTag(SWF swf, int id, String name, byte[] data, long pos) { + super(swf, id, name, data, pos); } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/Exportable.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/Exportable.java index b9eb8ac8d..563f6a133 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/Exportable.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/Exportable.java @@ -16,11 +16,14 @@ */ package com.jpexs.decompiler.flash.tags.base; +import com.jpexs.decompiler.flash.tags.Tag; +import java.util.List; + /** * * @author JPEXS */ public interface Exportable { - public String getExportFileName(); + public String getExportFileName(List tags); } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java index 4426a02a0..366bfb2dd 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/FontTag.java @@ -16,6 +16,7 @@ */ package com.jpexs.decompiler.flash.tags.base; +import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.types.SHAPE; import java.awt.Font; @@ -27,15 +28,15 @@ import java.util.List; */ public abstract class FontTag extends CharacterTag implements AloneTag { - public FontTag(int id, String name, byte data[], long pos) { - super(id, name, data, pos); + public FontTag(SWF swf, int id, String name, byte data[], long pos) { + super(swf, id, name, data, pos); } public abstract int getFontId(); public abstract List getGlyphShapeTable(); - public abstract void addCharacter(List tags, char character); + public abstract void addCharacter(List tags, char character, String fontName); public abstract char glyphToChar(List tags, int glyphIndex); @@ -77,4 +78,20 @@ public abstract class FontTag extends CharacterTag implements AloneTag { } public abstract String getCharacters(List tags); + + @Override + public String getName(List tags) { + String nameAppend = ""; + if (exportName != null) { + nameAppend = ": " + exportName; + } + if (className != null) { + nameAppend = ": " + className; + } + String fontName = getFontName(tags); + if (fontName != null) { + nameAppend = ": " + fontName; + } + return name + " (" + getCharacterId() + nameAppend + ")"; + } } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/ImageTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/ImageTag.java index 81b47d6f8..dfa5dbc1a 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/ImageTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/ImageTag.java @@ -28,8 +28,8 @@ import java.util.List; */ public abstract class ImageTag extends CharacterTag { - public ImageTag(int id, String name, byte[] data, long pos) { - super(id, name, data, pos); + public ImageTag(SWF swf, int id, String name, byte[] data, long pos) { + super(swf, id, name, data, pos); } public abstract BufferedImage getImage(List tags); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/base/TextTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/base/TextTag.java index 334037440..ffb26d962 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/base/TextTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/base/TextTag.java @@ -34,7 +34,7 @@ public interface TextTag { public String getFormattedText(List tags); - public void setFormattedText(List tags, String text) throws ParseException; + public void setFormattedText(List tags, String text, String fontName) throws ParseException; public int getCharacterId(); diff --git a/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java b/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java index 3f7e46d69..f412dff0b 100644 --- a/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java +++ b/trunk/src/com/jpexs/decompiler/flash/types/BUTTONCONDACTION.java @@ -22,6 +22,7 @@ import com.jpexs.decompiler.flash.ReReadableInputStream; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.helpers.Helper; +import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.base.ASMSource; import com.jpexs.decompiler.flash.tags.base.Exportable; import java.io.ByteArrayInputStream; @@ -258,7 +259,7 @@ public class BUTTONCONDACTION implements ASMSource, Exportable { } @Override - public String getExportFileName() { + public String getExportFileName(List tags) { return getHeader(true); } diff --git a/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java b/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java index 08d97a34c..a3af624cf 100644 --- a/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java +++ b/trunk/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java @@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.DisassemblyListener; import com.jpexs.decompiler.flash.ReReadableInputStream; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.action.Action; +import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.base.ASMSource; import com.jpexs.decompiler.flash.tags.base.Exportable; import java.io.ByteArrayInputStream; @@ -215,7 +216,7 @@ public class CLIPACTIONRECORD implements ASMSource, Exportable { } @Override - public String getExportFileName() { + public String getExportFileName(List tags) { return eventFlags.getHeader(keyCode, true); }