Package tv.porst.splib.binaryparser

Examples of tv.porst.splib.binaryparser.Flag


  public static ActionGetURL2 parse(final SWFBinaryParser parser, final UINT8 actionCode, final String fieldName) throws SWFParserException {
    final UINT16 length = parseUINT16(parser, 0x00006, fieldName + "::Length");
    final UBits sendVarsMethod = parseUBits(parser, 2, 0x00006, fieldName + "::SendVarsMethod");
    final UBits reserved = parseUBits(parser, 4, 0x00006, fieldName + "::Reserved");
    final Flag loadTargetFlag = parseFlag(parser, 0x00006, fieldName + "::LoadTargetFlag");
    final Flag loadVariablesFlag = parseFlag(parser, 0x00006, fieldName + "::LoadVariablesFlag");

    return new ActionGetURL2(actionCode, length, sendVarsMethod, reserved, loadTargetFlag, loadVariablesFlag);
  }
View Full Code Here


public class ActionGotoFrame2Parser {

  public static ActionGotoFrame2 parse(final SWFBinaryParser parser, final UINT8 actionCode, final String fieldName) throws SWFParserException {
    final UINT16 length = parseUINT16(parser, 0x00006, fieldName + "::Length");
    final UBits reserved = parseUBits(parser, 6, 0x00006, fieldName + "::Reserved");
    final Flag sceneBiasFlag = parseFlag(parser, 0x00006, fieldName + "::SceneBiasFlag");
    final Flag playFlag = parseFlag(parser, 0x00006, fieldName + "::PlayFlag");
    final UINT16 sceneBias = parseUINT16If(parser, 0x00006, sceneBiasFlag, fieldName + "::SceneBias");

    return new ActionGotoFrame2(actionCode, length, reserved, sceneBiasFlag, playFlag, sceneBias);
  }
View Full Code Here

   * @throws SWFParserException Thrown if the structure could not be parsed.
   */
  public static ButtonRecord2 parse(final SWFBinaryParser parser, final String fieldName) throws SWFParserException {

    final UBits buttonReserved = parseUBits(parser, 2, 0x00006, fieldName + "::ButtonReserved");
    final Flag buttonHasBlendMode = parseFlag(parser, 0x00006, fieldName + "::ButtonHasBlendMode");
    final Flag buttonHasFilterList = parseFlag(parser, 0x00006, fieldName + "::ButtonHasFilterList");
    final Flag buttonStateHitTest = parseFlag(parser, 0x00006, fieldName + "::ButtonStateHitTest");
    final Flag buttonStateDown = parseFlag(parser, 0x00006, fieldName + "::ButtonStateDown");
    final Flag buttonStateOver = parseFlag(parser, 0x00006, fieldName + "::ButtonStateOver");
    final Flag buttonStateUp = parseFlag(parser, 0x00006, fieldName + "::ButtonStateUp");
    final UINT16 characterID = parseUINT16(parser, 0x00006, fieldName + "::CharacterID");
    final UINT16 placeDepth = parseUINT16(parser, 0x00006, fieldName + "::PlaceDepth");
    final Matrix placeMatrix = MatrixParser.parse(parser, fieldName + "::PlaceMatrix");
    final CxFormWithAlpha colorTransform = CxFormWithAlphaParser.parse(parser, fieldName + "::CxFormWithAlpha");
    final FilterList filterList = FilterListParser.parseIf(parser, buttonHasFilterList, fieldName + "::FilterList");
View Full Code Here

    final UINT16 numFrames = parseUINT16(parser, 0x00006, "DefineVideoStream::NumFrames");
    final UINT16 width = parseUINT16(parser, 0x00006, "DefineVideoStream::Width");
    final UINT16 height = parseUINT16(parser, 0x00006, "DefineVideoStream::Height");
    final UBits videoFlagsReserved = parseUBits(parser, 4, 0x00006, "DefineVideoStream::VideoFlagsReserved");
    final UBits videoFlagsDeblocking = parseUBits(parser, 3, 0x00006, "DefineVideoStream::VideoFlagsDeblocking");
    final Flag videoFlagsSmoothing = parseFlag(parser, 0x00006, "DefineVideoStream::VideoFlagsSmoothing");
    final UINT8 codecId = parseUINT8(parser, 0x00006, "DefineVideoStream::CodecID");

    return new DefineVideoStreamTag(header, characterId, numFrames, width, height,
        videoFlagsReserved, videoFlagsDeblocking, videoFlagsSmoothing,
        codecId);
View Full Code Here

   */
  public static DefineEditTextTag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {

    final UINT16 characterId = parseUINT16(parser, 0x00006, "DefineEditText::CharacterId");
    final Rect bounds = RectParser.parse(parser, "DefineEditText::Bounds");
    final Flag hasText = parseFlag(parser, 0x00006, "DefineEditText::HasText");
    final Flag wordWrap = parseFlag(parser, 0x00006, "DefineEditText::WordWrap");
    final Flag multiline = parseFlag(parser, 0x00006, "DefineEditText::Multiline");
    final Flag password = parseFlag(parser, 0x00006, "DefineEditText::Password");
    final Flag readOnly = parseFlag(parser, 0x00006, "DefineEditText::ReadOnly");
    final Flag hasTextColor = parseFlag(parser, 0x00006, "DefineEditText::HasTextColor");
    final Flag hasMaxLength = parseFlag(parser, 0x00006, "DefineEditText::HasMaxLength");
    final Flag hasFont = parseFlag(parser, 0x00006, "DefineEditText::HasFont");
    final Flag hasFontClass = parseFlag(parser, 0x00006, "DefineEditText::HasFontClass");
    final Flag autoSize = parseFlag(parser, 0x00006, "DefineEditText::HasAutoSize");
    final Flag hasLayout = parseFlag(parser, 0x00006, "DefineEditText::HasLayout");
    final Flag noSelect = parseFlag(parser, 0x00006, "DefineEditText::NoSelect");
    final Flag border = parseFlag(parser, 0x00006, "DefineEditText::Border");
    final Flag wasStatic = parseFlag(parser, 0x00006, "DefineEditText::WasStatic");
    final Flag html = parseFlag(parser, 0x00006, "DefineEditText::HTML");
    final Flag useOutlines = parseFlag(parser, 0x00006, "DefineEditText::UseOutlines");
    final UINT16 fontID = parseUINT16If(parser, 0x00006, hasFont, "DefineEditText::FontID");
    final AsciiString fontClass = parseStringIf(parser, 0x00006, hasFontClass, "DefineEditText::FontClass");
    final UINT16 fontHeight = parseUINT16If(parser, 0x00006, hasFont, "DefineEditText::FontHeight");
    final RGBA textColor = RGBAParser.parseIf(parser, hasTextColor, "DefineEditText::TextColor");
    final UINT16 maxLength = parseUINT16If(parser, 0x00006, hasMaxLength, "DefineEditText::MaxLength");
View Full Code Here

    final UINT16 fontId = parseUINT16(parser, 0x00006, "DefineFontInfo2::FontId");
    final UINT8 fontNameLen = parseUINT8(parser, 0x00006, "DefineFontInfo2::FontNameLen");
    final AsciiString fontName = parseString(parser, fontNameLen.value(), 0x00006, "DefineFontInfo2::FontName");
    final UBits fontFlagsReserved = parseUBits(parser, 2, 0x00006, "DefineFontInfo2::FontFlagsReserved");
    final Flag fontFlagsSmallText = parseFlag(parser, 0x00006, "DefineFontInfo2::FontFlagsSmallText");
    final Flag fontFlagsShiftJIS = parseFlag(parser, 0x00006, "DefineFontInfo2::FontFlagsShiftJIS");
    final Flag fontFlagsANSI = parseFlag(parser, 0x00006, "DefineFontInfo2::FontFlagsANSI");
    final Flag fontFlagsItalic = parseFlag(parser, 0x00006, "DefineFontInfo2::FontFlagsItalic");
    final Flag fontFlagsBold = parseFlag(parser, 0x00006, "DefineFontInfo2::FontFlagsBold");
    final Flag fontFlagsWideCodes = parseFlag(parser, 0x00006, "DefineFontInfo2::FontFlagsWideCodes");
    final UINT8 languageCode = parseUINT8(parser, 0x00006, "DefineFont2::LanguageCode");

    final int remainingBytes = header.getNormalizedLength() - 2 - 1 - fontNameLen.value() - 1;

    final int numberOfGlyphs = remainingBytes / (fontFlagsWideCodes.value() ? 2 : 1);

    final List<IParsedINTElement> codeTable = new ArrayList<IParsedINTElement>();

    for (int i=0;i<numberOfGlyphs;i++) {
      if (fontFlagsWideCodes.value()) {
        codeTable.add(parseUINT16(parser, 0x00006, String.format("DefineFontInfo2::CodeTable[%d]", i)));
      }
      else {
        codeTable.add(parseUINT8(parser, 0x00006, String.format("DefineFontInfo2::CodeTable[%d]", i)));
      }
View Full Code Here

   *
   * @throws SWFParserException Thrown if parsing the tag failed.
   */
  public static PlaceObject3Tag parse(final RecordHeader header, final SWFBinaryParser parser, final int version) throws SWFParserException {

    final Flag placeFlagHasClipActions = parseFlag(parser, 0x00006, "PlaceObject3::PlaceFlagHasClipActions");
    final Flag placeFlagHasClipDepth = parseFlag(parser, 0x00006, "PlaceObject3::PlaceFlagHasClipDepth");
    final Flag placeFlagHasName = parseFlag(parser, 0x00006, "PlaceObject3::PlaceFlagHasName");
    final Flag placeFlagHasRatio = parseFlag(parser, 0x00006, "PlaceObject3::PlaceFlagHasRatio");
    final Flag placeFlagHasColorTransform = parseFlag(parser, 0x00006, "PlaceObject3::PlaceFlagHasColorTransform");
    final Flag placeFlagHasMatrix = parseFlag(parser, 0x00006, "PlaceObject3::PlaceFlagHasMatrix");
    final Flag placeFlagHasCharacter = parseFlag(parser, 0x00006, "PlaceObject3::PlaceFlagHasCharacter");
    final Flag placeFlagHasMove = parseFlag(parser, 0x00006, "PlaceObject3::PlaceFlagHasMove");
    final UBits reserved = parseUBits(parser, 3, 0x0000006, "PlaceObject3::Reserved");
    final Flag placeFlagHasImage = parseFlag(parser, 0x00006, "PlaceObject3::PlaceFlagHasImage");
    final Flag placeFlagHasClassName = parseFlag(parser, 0x00006, "PlaceObject3::PlaceFlagHasClassName");
    final Flag placeFlagHasCacheAsBitmap = parseFlag(parser, 0x00006, "PlaceObject3::PlaceFlagHasCacheAsBitmap");
    final Flag placeFlagHasBlendMode = parseFlag(parser, 0x00006, "PlaceObject3::PlaceFlagHasBlendMode");
    final Flag placeFlagHasFilterList = parseFlag(parser, 0x00006, "PlaceObject3::PlaceFlagHasFilterList");
    final UINT16 depth = parseUINT16(parser, 0x00005, "PlaceObject3::Depth");
    final AsciiString className = parseStringIf(parser, 0x00006, placeFlagHasClassName.value() || (placeFlagHasImage.value() && placeFlagHasCharacter.value()), "PlaceObject3::ClassName");
    final UINT16 characterId = parseUINT16If(parser, 0x00006, placeFlagHasCharacter, "PlaceObject3::CharacterId");
    final Matrix matrix = MatrixParser.parseIf(parser, placeFlagHasMatrix, "PlaceObject3::Matrix");
    final CxFormWithAlpha colorTransform = CxFormWithAlphaParser.parseIf(parser, placeFlagHasColorTransform, "PlaceObject3::CxFormWithAlpha");
View Full Code Here

   */
  public static DefineButton2Tag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {

    final UINT16 buttonId = parseUINT16(parser, 0x00006, "DefineButton2::ButtonId");
    final UBits reservedFlags = parseUBits(parser, 7, 0x00006, "DefineButton2::ReservedFlags");
    final Flag trackAsMenu = parseFlag(parser, 0x00006, "DefineButton2::TrackAsMenu");
    final UINT16 actionOffset = parseUINT16(parser, 0x00006, "DefineButton2::ActionOffset");

    final List<ButtonRecord2> characters = new ArrayList<ButtonRecord2>();

    do {
View Full Code Here

  public static DefineFont3Tag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {

    final int endPosition = parser.getBytePosition() + header.getNormalizedLength();

    final UINT16 fontId = parseUINT16(parser, 0x00006, "DefineFont3::FontId");
    final Flag fontFlagsHasLayout = parser.readFlag();
    final Flag fontFlagsShiftJIS = parseFlag(parser, 0x00006, "DefineFont3::FontFlagsShiftJIS");
    final Flag fontFlagsSmallText = parseFlag(parser, 0x00006, "DefineFont3::FontFlagsSmallText");
    final Flag fontFlagsANSI = parseFlag(parser, 0x00006, "DefineFont3::FontFlagsANSI");
    final Flag fontFlagsWideOffsets = parseFlag(parser, 0x00006, "DefineFont3::FontFlagsWideOffsets");
    final Flag fontFlagsWideCodes = parseFlag(parser, 0x00006, "DefineFont3::FontFlagsWideCodes");
    final Flag fontFlagsItalic = parseFlag(parser, 0x00006, "DefineFont3::FontFlagsItalic");
    final Flag fontFlagsBold = parseFlag(parser, 0x00006, "DefineFont3::FontFlagsBold");
    final UINT8 languageCode = parseUINT8(parser, 0x00006, "DefineFont3::LanguageCode");
    final UINT8 fontNameLen = parseUINT8(parser, 0x00006, "DefineFont3::FontNameLen");
    final AsciiString fontName = parseString(parser, fontNameLen.value(), 0x00006, "DefineFont3::FontName");
    final UINT16 numGlyphs = parseUINT16(parser, 0x00006, "DefineFont3::NumGlyphs");
View Full Code Here

   * @throws SWFParserException Thrown if parsing the tag failed.
   */
  public static DefineFont2Tag parse(final RecordHeader header, final SWFBinaryParser parser) throws SWFParserException {

    final UINT16 fontId = parseUINT16(parser, 0x00006, "DefineFont2::FontId");
    final Flag fontFlagsHasLayout = parser.readFlag();
    final Flag fontFlagsShiftJIS = parseFlag(parser, 0x00006, "DefineFont2::FontFlagsShiftJIS");
    final Flag fontFlagsSmallText = parseFlag(parser, 0x00006, "DefineFont2::FontFlagsSmallText");
    final Flag fontFlagsANSI = parseFlag(parser, 0x00006, "DefineFont2::FontFlagsANSI");
    final Flag fontFlagsWideOffsets = parseFlag(parser, 0x00006, "DefineFont2::FontFlagsWideOffsets");
    final Flag fontFlagsWideCodes = parseFlag(parser, 0x00006, "DefineFont2::FontFlagsWideCodes");
    final Flag fontFlagsItalic = parseFlag(parser, 0x00006, "DefineFont2::FontFlagsItalic");
    final Flag fontFlagsBold = parseFlag(parser, 0x00006, "DefineFont2::FontFlagsBold");
    final UINT8 languageCode = parseUINT8(parser, 0x00006, "Define2::LanguageCode");
    final UINT8 fontNameLen = parseUINT8(parser, 0x00006, "DefineFont2::FontNameLen");
    final AsciiString fontName = parseString(parser, fontNameLen.value(), 0x00006, "DefineFont2::FontName");
    final UINT16 numGlyphs = parseUINT16(parser, 0x00006, "DefineFont2::NumGlyphs");

View Full Code Here

TOP

Related Classes of tv.porst.splib.binaryparser.Flag

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.