From 2e0f3ea3ac0c7e27684f877050792a7160aff42a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Thu, 26 Sep 2013 15:42:53 +0200 Subject: [PATCH] ScaleForm GFx opening from open/save dialog GFx classes refactoring --- trunk/src/com/jpexs/decompiler/flash/SWF.java | 32 ++++++-- .../decompiler/flash/SWFInputStream.java | 30 +++++--- .../com/jpexs/decompiler/flash/gui/Main.java | 77 ++++++++++++++++--- .../jpexs/decompiler/flash/gui/MainFrame.java | 8 +- .../flash/gui/locales/MainFrame.properties | 5 +- .../flash/gui/locales/MainFrame_cs.properties | 5 +- .../DefineCompactedFont.java} | 10 ++- .../DefineExternalGradient.java} | 7 +- .../DefineExternalImage.java} | 7 +- .../DefineExternalImage2.java} | 7 +- .../DefineExternalSound.java} | 7 +- .../DefineExternalStreamSound.java} | 7 +- .../DefineGradientMap.java} | 7 +- .../DefineSubImage.java} | 7 +- .../ExporterInfoTag.java} | 7 +- .../FontTextureInfo.java} | 7 +- 16 files changed, 169 insertions(+), 61 deletions(-) rename trunk/src/com/jpexs/decompiler/flash/tags/{GFxDefineCompactedFont.java => gfx/DefineCompactedFont.java} (94%) rename trunk/src/com/jpexs/decompiler/flash/tags/{GFxDefineExternalGradient.java => gfx/DefineExternalGradient.java} (88%) rename trunk/src/com/jpexs/decompiler/flash/tags/{GFxDefineExternalImage.java => gfx/DefineExternalImage.java} (89%) rename trunk/src/com/jpexs/decompiler/flash/tags/{GFxDefineExternalImage2.java => gfx/DefineExternalImage2.java} (89%) rename trunk/src/com/jpexs/decompiler/flash/tags/{GFxDefineExternalSound.java => gfx/DefineExternalSound.java} (90%) rename trunk/src/com/jpexs/decompiler/flash/tags/{GFxDefineExternalStreamSound.java => gfx/DefineExternalStreamSound.java} (89%) rename trunk/src/com/jpexs/decompiler/flash/tags/{GFxDefineGradientMap.java => gfx/DefineGradientMap.java} (87%) rename trunk/src/com/jpexs/decompiler/flash/tags/{GFxDefineSubImage.java => gfx/DefineSubImage.java} (88%) rename trunk/src/com/jpexs/decompiler/flash/tags/{GFxExporterInfoTag.java => gfx/ExporterInfoTag.java} (91%) rename trunk/src/com/jpexs/decompiler/flash/tags/{GFxFontTextureInfo.java => gfx/FontTextureInfo.java} (91%) diff --git a/trunk/src/com/jpexs/decompiler/flash/SWF.java b/trunk/src/com/jpexs/decompiler/flash/SWF.java index 780038843..57f73ceaf 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWF.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWF.java @@ -185,7 +185,11 @@ public class SWF { */ public byte[] lzmaProperties; public FileAttributesTag fileAttributes; - + /** + * ScaleForm GFx + */ + public boolean gfx = false; + /** * Gets all tags with specified id * @@ -225,10 +229,19 @@ public class SWF { } else if (compressed) { os.write('C'); } else { - os.write('F'); + if (gfx) { + os.write('G'); + } else { + os.write('F'); + } + } + if (gfx) { + os.write('F'); + os.write('X'); + } else { + os.write('W'); + os.write('S'); } - os.write('W'); - os.write('S'); os.write(version); byte[] data = baos.toByteArray(); sos = new SWFOutputStream(os, version); @@ -300,13 +313,22 @@ public class SWF { byte[] hdr = new byte[3]; is.read(hdr); String shdr = new String(hdr, "utf-8"); - if ((!shdr.equals("FWS")) && (!shdr.equals("CWS")) && (!shdr.equals("ZWS"))) { + if (!Arrays.asList( + "FWS", //Uncompressed Flash + "CWS", //ZLib compressed Flash + "ZWS", //LZMA compressed Flash + "GFX", //Uncompressed ScaleForm GFx + "CFX" //Compressed ScaleForm GFx + ).contains(shdr)) { throw new IOException("Invalid SWF file"); } version = is.read(); SWFInputStream sis = new SWFInputStream(is, version, 4); fileSize = sis.readUI32(); + if(hdr[1] == 'F' && hdr[2] == 'X'){ + gfx = true; + } if (hdr[0] == 'C') { sis = new SWFInputStream(new InflaterInputStream(is), version, 8); compressed = true; diff --git a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java index 8238d760b..4aeb860e0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java +++ b/trunk/src/com/jpexs/decompiler/flash/SWFInputStream.java @@ -16,6 +16,16 @@ */ package com.jpexs.decompiler.flash; +import com.jpexs.decompiler.flash.tags.gfx.DefineGradientMap; +import com.jpexs.decompiler.flash.tags.gfx.DefineExternalImage2; +import com.jpexs.decompiler.flash.tags.gfx.FontTextureInfo; +import com.jpexs.decompiler.flash.tags.gfx.DefineExternalSound; +import com.jpexs.decompiler.flash.tags.gfx.DefineExternalImage; +import com.jpexs.decompiler.flash.tags.gfx.DefineCompactedFont; +import com.jpexs.decompiler.flash.tags.gfx.ExporterInfoTag; +import com.jpexs.decompiler.flash.tags.gfx.DefineExternalGradient; +import com.jpexs.decompiler.flash.tags.gfx.DefineSubImage; +import com.jpexs.decompiler.flash.tags.gfx.DefineExternalStreamSound; import com.jpexs.decompiler.flash.action.Action; import com.jpexs.decompiler.flash.action.ActionListReader; import com.jpexs.decompiler.flash.action.model.ConstantPool; @@ -954,34 +964,34 @@ public class SWFInputStream extends InputStream { ret = new PlaceObject4Tag(swf, data, version, pos); break; case 1000: - ret = new GFxExporterInfoTag(swf, data, version, pos); + ret = new ExporterInfoTag(swf, data, version, pos); break; case 1001: - ret = new GFxDefineExternalImage(swf, data, version, pos); + ret = new DefineExternalImage(swf, data, version, pos); break; case 1002: - ret = new GFxFontTextureInfo(swf, data, version, pos); + ret = new FontTextureInfo(swf, data, version, pos); break; case 1003: - ret = new GFxDefineExternalGradient(swf, data, version, pos); + ret = new DefineExternalGradient(swf, data, version, pos); break; case 1004: - ret = new GFxDefineGradientMap(swf, data, version, pos); + ret = new DefineGradientMap(swf, data, version, pos); break; case 1005: - ret = new GFxDefineCompactedFont(swf, data, version, pos); + ret = new DefineCompactedFont(swf, data, version, pos); break; case 1006: - ret = new GFxDefineExternalSound(swf, data, version, pos); + ret = new DefineExternalSound(swf, data, version, pos); break; case 1007: - ret = new GFxDefineExternalStreamSound(swf, data, version, pos); + ret = new DefineExternalStreamSound(swf, data, version, pos); break; case 1008: - ret = new GFxDefineSubImage(swf, data, version, pos); + ret = new DefineSubImage(swf, data, version, pos); break; case 1009: - ret = new GFxDefineExternalImage2(swf, data, version, pos); + ret = new DefineExternalImage2(swf, data, version, pos); break; default: ret = new Tag(swf, tag.getId(), "Unknown", data, pos); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/Main.java b/trunk/src/com/jpexs/decompiler/flash/gui/Main.java index c8cd23049..38b1b0038 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/Main.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/Main.java @@ -413,28 +413,59 @@ public class Main { public static boolean saveFileDialog() { JFileChooser fc = new JFileChooser(); - fc.setCurrentDirectory(new File(Configuration.getConfig("lastSaveDir", "."))); - fc.setFileFilter(new FileFilter() { + fc.setCurrentDirectory(new File(Configuration.getConfig("lastSaveDir", "."))); + FileFilter swfFilter = new FileFilter() { @Override public boolean accept(File f) { - return (f.getName().endsWith(".swf")) || (f.isDirectory()); + return (f.getName().toLowerCase().endsWith(".swf")) || (f.isDirectory()); } @Override public String getDescription() { return translate("filter.swf"); } - }); + }; + if(!swf.gfx){ + fc.setFileFilter(swfFilter); + }else{ + fc.addChoosableFileFilter(swfFilter); + } + FileFilter gfxFilter = new FileFilter() { + @Override + public boolean accept(File f) { + return (f.getName().toLowerCase().endsWith(".gfx")) || (f.isDirectory()); + } + + @Override + public String getDescription() { + return translate("filter.gfx"); + } + }; + if(swf.gfx){ + fc.setFileFilter(gfxFilter); + }else{ + fc.addChoosableFileFilter(gfxFilter); + } fc.setAcceptAllFileFilterUsed(false); JFrame f = new JFrame(); View.setWindowIcon(f); int returnVal = fc.showSaveDialog(f); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = Helper.fixDialogFile(fc.getSelectedFile()); + FileFilter selFilter = fc.getFileFilter(); try { String fileName = file.getAbsolutePath(); - if (!fileName.toLowerCase().endsWith(".swf")) { - fileName += ".swf"; + if(selFilter == swfFilter){ + if (!fileName.toLowerCase().endsWith(".swf")) { + fileName += ".swf"; + } + swf.gfx = false; + } + if(selFilter == gfxFilter){ + if (!fileName.toLowerCase().endsWith(".gfx")) { + fileName += ".gfx"; + } + swf.gfx = true; } Main.saveFile(fileName); Configuration.setConfig("lastSaveDir", file.getParentFile().getAbsolutePath()); @@ -452,17 +483,45 @@ public class Main { fileTitle = null; JFileChooser fc = new JFileChooser(); fc.setCurrentDirectory(new File(Configuration.getConfig("lastOpenDir", "."))); - fc.setFileFilter(new FileFilter() { + FileFilter allSupportedFilter = new FileFilter() { @Override public boolean accept(File f) { - return (f.getName().endsWith(".swf")) || (f.isDirectory()); + return (f.getName().toLowerCase().toLowerCase().endsWith(".swf")) + || (f.getName().toLowerCase().toLowerCase().endsWith(".gfx")) + || (f.isDirectory()); + } + + @Override + public String getDescription() { + return translate("filter.supported"); + } + }; + fc.setFileFilter(allSupportedFilter); + FileFilter swfFilter = new FileFilter() { + @Override + public boolean accept(File f) { + return (f.getName().toLowerCase().endsWith(".swf")) || (f.isDirectory()); } @Override public String getDescription() { return translate("filter.swf"); } - }); + }; + fc.addChoosableFileFilter(swfFilter); + FileFilter gfxFilter = new FileFilter() { + @Override + public boolean accept(File f) { + return (f.getName().toLowerCase().endsWith(".gfx")) || (f.isDirectory()); + } + + @Override + public String getDescription() { + return translate("filter.gfx"); + } + }; + fc.addChoosableFileFilter(gfxFilter); + fc.setAcceptAllFileFilterUsed(true); JFrame f = new JFrame(); View.setWindowIcon(f); int returnVal = fc.showOpenDialog(f); diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java index f2c3ff451..d343cdd79 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/MainFrame.java @@ -67,7 +67,7 @@ import com.jpexs.decompiler.flash.tags.DefineVideoStreamTag; import com.jpexs.decompiler.flash.tags.DoActionTag; import com.jpexs.decompiler.flash.tags.EndTag; import com.jpexs.decompiler.flash.tags.ExportAssetsTag; -import com.jpexs.decompiler.flash.tags.GFxDefineCompactedFont; +import com.jpexs.decompiler.flash.tags.gfx.DefineCompactedFont; import com.jpexs.decompiler.flash.tags.JPEGTablesTag; import com.jpexs.decompiler.flash.tags.PlaceObject2Tag; import com.jpexs.decompiler.flash.tags.SetBackgroundColorTag; @@ -1764,7 +1764,7 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel || (t instanceof DefineFont2Tag) || (t instanceof DefineFont3Tag) || (t instanceof DefineFont4Tag) - || (t instanceof GFxDefineCompactedFont)) { + || (t instanceof DefineCompactedFont)) { return "font"; } if ((t instanceof DefineTextTag) @@ -2949,8 +2949,8 @@ public class MainFrame extends AppRibbonFrame implements ActionListener, TreeSel } private static Tag classicTag(Tag t) { - if (t instanceof GFxDefineCompactedFont) { - return ((GFxDefineCompactedFont) t).toClassicFont(); + if (t instanceof DefineCompactedFont) { + return ((DefineCompactedFont) t).toClassicFont(); } return t; } 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 8fdf99f7c..f848b7b53 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties +++ b/trunk/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties @@ -362,4 +362,7 @@ button.addtrait = Add trait button.font.embed = Embed... button.yes.all = Yes to all button.no.all = No to all -message.font.add.exists = Character %char% already exists in the font tag.\nDo you want to replace it? \ No newline at end of file +message.font.add.exists = Character %char% already exists in the font tag.\nDo you want to replace it? + +filter.gfx = ScaleForm GFx files (*.gfx) +filter.supported = All supported filetypes (*.swf, *.gfx) 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 0d47703c4..d9afa3dd7 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 @@ -367,4 +367,7 @@ button.addtrait = P\u0159idat vlastnost button.font.embed = Vlo\u017eit... button.yes.all = Ano v\u0161em button.no.all = Ne v\u0161em -message.font.add.exists = Znak %char% ji\u017e v tagu p\u00edsma existuje.\nChcete ho nahradit? \ No newline at end of file +message.font.add.exists = Znak %char% ji\u017e v tagu p\u00edsma existuje.\nChcete ho nahradit? + +filter.gfx = ScaleForm GFx soubory (*.gfx) +filter.supported = V\u0161echny podporovan\u00e9 typy (*.swf, *.gfx) diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineCompactedFont.java b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java similarity index 94% rename from trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineCompactedFont.java rename to trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java index 6017cdf38..f51e2dea0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineCompactedFont.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineCompactedFont.java @@ -14,11 +14,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.jpexs.decompiler.flash.tags; +package com.jpexs.decompiler.flash.tags.gfx; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.tags.DefineFont2Tag; +import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.base.CharacterTag; import com.jpexs.decompiler.flash.tags.base.DrawableTag; import com.jpexs.decompiler.flash.tags.base.FontTag; @@ -63,7 +65,7 @@ import javax.swing.JPanel; * * @author JPEXS */ -public class GFxDefineCompactedFont extends FontTag implements DrawableTag { +public class DefineCompactedFont extends FontTag implements DrawableTag { public static final int ID = 1005; public int fontId; @@ -128,7 +130,7 @@ public class GFxDefineCompactedFont extends FontTag implements DrawableTag { * @param pos * @throws IOException */ - public GFxDefineCompactedFont(SWF swf, byte[] data, int version, long pos) throws IOException { + public DefineCompactedFont(SWF swf, byte[] data, int version, long pos) throws IOException { super(swf, ID, "DefineCompactedFont", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); @@ -409,7 +411,7 @@ public class GFxDefineCompactedFont extends FontTag implements DrawableTag { }*/ return ret; } catch (IOException ex) { - Logger.getLogger(GFxDefineCompactedFont.class.getName()).log(Level.SEVERE, null, ex); + Logger.getLogger(DefineCompactedFont.class.getName()).log(Level.SEVERE, null, ex); } return null; } diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineExternalGradient.java b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java similarity index 88% rename from trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineExternalGradient.java rename to trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java index eeab24654..06cf02094 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineExternalGradient.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java @@ -14,11 +14,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.jpexs.decompiler.flash.tags; +package com.jpexs.decompiler.flash.tags.gfx; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.tags.Tag; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -29,7 +30,7 @@ import java.io.OutputStream; * * @author JPEXS */ -public class GFxDefineExternalGradient extends Tag { +public class DefineExternalGradient extends Tag { public static final int ID = 1003; public static final int BITMAP_FORMAT_DEFAULT = 0; @@ -72,7 +73,7 @@ public class GFxDefineExternalGradient extends Tag { * @param pos * @throws IOException */ - public GFxDefineExternalGradient(SWF swf, byte[] data, int version, long pos) throws IOException { + public DefineExternalGradient(SWF swf, byte[] data, int version, long pos) throws IOException { super(swf, ID, "DefineExternalGradient", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); gradientId = sis.readUI16(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineExternalImage.java b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java similarity index 89% rename from trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineExternalImage.java rename to trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java index cbc82be72..83ff0bcec 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineExternalImage.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java @@ -14,11 +14,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.jpexs.decompiler.flash.tags; +package com.jpexs.decompiler.flash.tags.gfx; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.tags.Tag; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -29,7 +30,7 @@ import java.io.OutputStream; * * @author JPEXS */ -public class GFxDefineExternalImage extends Tag { +public class DefineExternalImage extends Tag { public static final int ID = 1001; public int characterId; @@ -74,7 +75,7 @@ public class GFxDefineExternalImage extends Tag { * @param pos * @throws IOException */ - public GFxDefineExternalImage(SWF swf, byte[] data, int version, long pos) throws IOException { + public DefineExternalImage(SWF swf, byte[] data, int version, long pos) throws IOException { super(swf, ID, "DefineExternalImage", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterId = sis.readUI16(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineExternalImage2.java b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java similarity index 89% rename from trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineExternalImage2.java rename to trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java index f289bde6d..4880eb0ca 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineExternalImage2.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java @@ -14,11 +14,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.jpexs.decompiler.flash.tags; +package com.jpexs.decompiler.flash.tags.gfx; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.tags.Tag; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -29,7 +30,7 @@ import java.io.OutputStream; * * @author JPEXS */ -public class GFxDefineExternalImage2 extends Tag { +public class DefineExternalImage2 extends Tag { public static final int ID = 1009; public long characterId; @@ -78,7 +79,7 @@ public class GFxDefineExternalImage2 extends Tag { * @param pos * @throws IOException */ - public GFxDefineExternalImage2(SWF swf, byte[] data, int version, long pos) throws IOException { + public DefineExternalImage2(SWF swf, byte[] data, int version, long pos) throws IOException { super(swf, ID, "DefineExternalImage2", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterId = sis.readUI32(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineExternalSound.java b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java similarity index 90% rename from trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineExternalSound.java rename to trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java index 21e657c4e..42f305039 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineExternalSound.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalSound.java @@ -14,11 +14,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.jpexs.decompiler.flash.tags; +package com.jpexs.decompiler.flash.tags.gfx; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.tags.Tag; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -29,7 +30,7 @@ import java.io.OutputStream; * * @author JPEXS */ -public class GFxDefineExternalSound extends Tag { +public class DefineExternalSound extends Tag { public static final int ID = 1006; public int characterId; @@ -82,7 +83,7 @@ public class GFxDefineExternalSound extends Tag { * @param pos * @throws IOException */ - public GFxDefineExternalSound(SWF swf, byte[] data, int version, long pos) throws IOException { + public DefineExternalSound(SWF swf, byte[] data, int version, long pos) throws IOException { super(swf, ID, "DefineExternalSound", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterId = sis.readUI16(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineExternalStreamSound.java b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java similarity index 89% rename from trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineExternalStreamSound.java rename to trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java index c62b25e25..7f1f067e4 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineExternalStreamSound.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalStreamSound.java @@ -14,11 +14,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.jpexs.decompiler.flash.tags; +package com.jpexs.decompiler.flash.tags.gfx; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.tags.Tag; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -29,7 +30,7 @@ import java.io.OutputStream; * * @author JPEXS */ -public class GFxDefineExternalStreamSound extends Tag { +public class DefineExternalStreamSound extends Tag { public static final int ID = 1007; public int soundFormat; @@ -80,7 +81,7 @@ public class GFxDefineExternalStreamSound extends Tag { * @param pos * @throws IOException */ - public GFxDefineExternalStreamSound(SWF swf, byte[] data, int version, long pos) throws IOException { + public DefineExternalStreamSound(SWF swf, byte[] data, int version, long pos) throws IOException { super(swf, ID, "DefineExternalStreamSound", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); soundFormat = sis.readUI16(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineGradientMap.java b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java similarity index 87% rename from trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineGradientMap.java rename to trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java index c0a6908c9..a7892e3dc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineGradientMap.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java @@ -14,11 +14,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.jpexs.decompiler.flash.tags; +package com.jpexs.decompiler.flash.tags.gfx; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.tags.Tag; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -29,7 +30,7 @@ import java.io.OutputStream; * * @author JPEXS */ -public class GFxDefineGradientMap extends Tag { +public class DefineGradientMap extends Tag { public static final int ID = 1004; public int indices[]; @@ -64,7 +65,7 @@ public class GFxDefineGradientMap extends Tag { * @param pos * @throws IOException */ - public GFxDefineGradientMap(SWF swf, byte[] data, int version, long pos) throws IOException { + public DefineGradientMap(SWF swf, byte[] data, int version, long pos) throws IOException { super(swf, ID, "DefineGradientMap", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); int numGradients = sis.readUI16(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineSubImage.java b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java similarity index 88% rename from trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineSubImage.java rename to trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java index e88fee478..9a9da0f55 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/GFxDefineSubImage.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/DefineSubImage.java @@ -14,11 +14,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.jpexs.decompiler.flash.tags; +package com.jpexs.decompiler.flash.tags.gfx; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.tags.Tag; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -29,7 +30,7 @@ import java.io.OutputStream; * * @author JPEXS */ -public class GFxDefineSubImage extends Tag { +public class DefineSubImage extends Tag { public static final int ID = 1008; public int characterId; @@ -71,7 +72,7 @@ public class GFxDefineSubImage extends Tag { * @param pos * @throws IOException */ - public GFxDefineSubImage(SWF swf, byte[] data, int version, long pos) throws IOException { + public DefineSubImage(SWF swf, byte[] data, int version, long pos) throws IOException { super(swf, ID, "DefineSubImage", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); characterId = sis.readUI16(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/GFxExporterInfoTag.java b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfoTag.java similarity index 91% rename from trunk/src/com/jpexs/decompiler/flash/tags/GFxExporterInfoTag.java rename to trunk/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfoTag.java index 5bdaf413c..455f8d0f0 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/GFxExporterInfoTag.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfoTag.java @@ -14,11 +14,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.jpexs.decompiler.flash.tags; +package com.jpexs.decompiler.flash.tags.gfx; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.tags.Tag; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -31,7 +32,7 @@ import java.util.List; * * @author JPEXS */ -public class GFxExporterInfoTag extends Tag { +public class ExporterInfoTag extends Tag { public static final int ID = 1000; //Version (1.10 will be encoded as 0x10A) @@ -90,7 +91,7 @@ public class GFxExporterInfoTag extends Tag { * @param pos * @throws IOException */ - public GFxExporterInfoTag(SWF swf, byte[] data, int version, long pos) throws IOException { + public ExporterInfoTag(SWF swf, byte[] data, int version, long pos) throws IOException { super(swf, ID, "ExporterInfo", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); this.version = sis.readUI16(); diff --git a/trunk/src/com/jpexs/decompiler/flash/tags/GFxFontTextureInfo.java b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java similarity index 91% rename from trunk/src/com/jpexs/decompiler/flash/tags/GFxFontTextureInfo.java rename to trunk/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java index 1093f7d6f..84bd4c144 100644 --- a/trunk/src/com/jpexs/decompiler/flash/tags/GFxFontTextureInfo.java +++ b/trunk/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java @@ -14,11 +14,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package com.jpexs.decompiler.flash.tags; +package com.jpexs.decompiler.flash.tags.gfx; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.SWFInputStream; import com.jpexs.decompiler.flash.SWFOutputStream; +import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.types.gfx.FONTINFO; import com.jpexs.decompiler.flash.types.gfx.GFxInputStream; import com.jpexs.decompiler.flash.types.gfx.GFxOutputStream; @@ -33,7 +34,7 @@ import java.io.OutputStream; * * @author JPEXS */ -public class GFxFontTextureInfo extends Tag { +public class FontTextureInfo extends Tag { public static final int ID = 1002; public long textureID; @@ -92,7 +93,7 @@ public class GFxFontTextureInfo extends Tag { * @param pos * @throws IOException */ - public GFxFontTextureInfo(SWF swf, byte[] data, int version, long pos) throws IOException { + public FontTextureInfo(SWF swf, byte[] data, int version, long pos) throws IOException { super(swf, ID, "FontTextureInfo", data, pos); SWFInputStream sis = new SWFInputStream(new ByteArrayInputStream(data), version); textureID = sis.readUI32();