function dumpContent($tagCode, $opts = array()) { echo "\tCharacterID:{$this->CharacterID}\n"; echo "\t" . IO_SWF_Type_RECT::string($this->Bounds) . "\n"; echo "\tWordWrap:{$this->WordWrap} Multiline:{$this->Multiline} Password:{$this->Password} ReadOnly:{$this->ReadOnly}\n"; if (is_null($this->FontID) === false) { echo "\tFontID:{$this->FontID} FontHeight:" . $this->FontHeight / 20 . "\n"; } if (is_null($this->FontClass) === false) { echo "\tFontClass:{$this->FontClass}({" . bin2hex($this->FontClass) . ")\n"; } if (is_null($this->TextColor) === false) { echo "\tTextColor" . IO_SWF_Type_RGBA::string($this->TextColor) . "\n"; } if (is_null($this->MaxLength) === false) { echo "\tMaxLength:{$this->MaxLength}\n"; } if (is_null($this->Align) === false) { echo "\tAlign:{$this->Align} LeftMargin:{$this->LeftMargin} RightMargin:{$this->RightMargin} Indent:{$this->Indent} Leading:" . $this->Leading / 20 . "\n"; } echo "\tVariableName:{$this->VariableName}\n"; if (is_null($this->InitialText) == false) { echo "\tInitialText:{$this->InitialText}\n"; } }
static function string($fillStyle, $opts = array()) { $tagCode = $opts['tagCode']; $isMorph = $tagCode == 46 || $tagCode == 84; $text = ''; $fillStyleType = $fillStyle['FillStyleType']; switch ($fillStyleType) { case 0x0: // solid fill if ($isMorph === false) { $color = $fillStyle['Color']; if ($tagCode < 32) { // 32:DefineShape3 $color_str = IO_SWF_Type_RGB::string($color); } else { $color_str = IO_SWF_Type_RGBA::string($color); } $text .= "solid fill: {$color_str}\n"; } else { $startColor = $fillStyle['StartColor']; $endColor = $fillStyle['EndColor']; $startColor_str = IO_SWF_Type_RGBA::string($startColor); $endColor_str = IO_SWF_Type_RGBA::string($endColor); $text .= "solid fill: {$startColor_str} => {$endColor_str}\n"; } break; case 0x10: // linear gradient fill // linear gradient fill case 0x12: // radial gradient fill if ($fillStyleType == 0x10) { $text .= "linear gradient fill\n"; } else { $text .= "radial gradient fill\n"; } $opts = array('indent' => 2); if ($isMorph === false) { $matrix_str = IO_SWF_Type_MATRIX::string($fillStyle['GradientMatrix'], $opts); $text .= $matrix_str . "\n"; $spreadMode = $fillStyle['SpreadMode']; $interpolationMode = $fillStyle['InterpolationMode']; } else { $matrix_str = IO_SWF_Type_MATRIX::string($fillStyle['StartGradientMatrix'], $opts); $matrix_str = IO_SWF_Type_MATRIX::string($fillStyle['EndGradientMatrix'], $opts); $text .= $matrix_str . "\n"; } foreach ($fillStyle['GradientRecords'] as $gradientRecord) { if ($isMorph === false) { $ratio = $gradientRecord['Ratio']; $color = $gradientRecord['Color']; if ($tagCode < 32) { // 32:DefineShape3 $color_str = IO_SWF_Type_RGB::string($color); } else { $color_str = IO_SWF_Type_RGBA::string($color); } $text .= "\t\tRatio: {$ratio} Color:{$color_str}\n"; } else { $startRatio = $gradientRecord['StartRatio']; $startColorStr = IO_SWF_Type_RGBA::string($gradientRecord['StartColor']); $endRatio = $gradientRecord['EndRatio']; $endColorStr = IO_SWF_Type_RGBA::string($gradientRecord['EndColor']); $text .= "\t\tStart: Ratio:{$startRatio} Color:{$startColorStr} => End: Ratio:{$endRatio} Color:{$endColorStr}\n"; } } break; case 0x40: // repeating bitmap fill // repeating bitmap fill case 0x41: // clipped bitmap fill // clipped bitmap fill case 0x42: // non-smoothed repeating bitmap fill // non-smoothed repeating bitmap fill case 0x43: // non-smoothed clipped bitmap fill $text .= "Bitmap({$fillStyleType}): "; $text .= " BitmapId: " . $fillStyle['BitmapId'] . "\n"; if ($isMorph === false) { $text .= "\tBitmapMatrix:\n"; $opts = array('indent' => 2); $matrix_str = IO_SWF_Type_MATRIX::string($fillStyle['BitmapMatrix'], $opts); $text .= $matrix_str . "\n"; } else { $opts = array('indent' => 2); $text .= "\tStartBitmapMatrix:\n"; $matrix_str = IO_SWF_Type_MATRIX::string($fillStyle['StartBitmapMatrix'], $opts); $text .= $matrix_str . "\n"; $text .= "\tEndBitmapMatrix:\n"; $matrix_str = IO_SWF_Type_MATRIX::string($fillStyle['EndBitmapMatrix'], $opts); $text .= $matrix_str . "\n"; } break; default: $text .= "Unknown FillStyleType({$fillStyleType})\n"; } return $text; }
static function string($lineStyle, $opts = array()) { $tagCode = $opts['tagCode']; $isMorph = $tagCode == 46 || $tagCode == 84; $text = ''; if ($isMorph === false) { $text .= "Width:{$lineStyle['Width']} "; if ($tagCode == 83) { // DefineShape4 $text .= "StartCapStyle:{$lineStyle['StartCapStyle']} JoinStyle:{$lineStyle['JoinStyle']} "; $text .= "HasFillFlag:{$lineStyle['HasFillFlag']} NoHScaleFlag:{$lineStyle['NoHScaleFlag']} NoVScaleFlag:{$lineStyle['NoVScaleFlag']} PixelHintingFlag:{$lineStyle['PixelHintingFlag']} "; } if ($tagCode < 32) { // DefineShape1,2 $color_str = IO_SWF_Type_RGB::string($lineStyle['Color']); $text .= "Color: {$color_str} "; } else { if ($tagCode == 32) { // DefineShape3 $color_str = IO_SWF_Type_RGBA::string($lineStyle['Color']); $text .= "Color: {$color_str} "; } else { // DefineShape4 if ($lineStyle['HasFillFlag'] == 0) { $color_str = IO_SWF_Type_RGBA::string($lineStyle['Color']); $text .= "Color: {$color_str} "; } else { $filltype_str = IO_SWF_Type_FILLSTYLE::string($lineStyle['FillType']); $text .= "FillType: " . $filltype_str; } } } } else { $startWidth = $lineStyle['StartWidth']; $endWidth = $lineStyle['EndWidth']; $startColorStr = IO_SWF_Type_RGBA::string($lineStyle['StartColor']); $endColorStr = IO_SWF_Type_RGBA::string($lineStyle['EndColor']); $text .= "Width: {$startWidth} => {$endWidth} Color: {$startColorStr} => {$endColorStr} "; } return $text . PHP_EOL; }
static function string($textrecord, $opts = array()) { $text = ''; if ($textrecord['StyleFlagsHasFont']) { $text .= "FontID: {$textrecord['FontID']} TextHeight: {$textrecord['TextHeight']} "; } if ($textrecord['StyleFlagsHasColor']) { if ($opts['tagCode'] == 11) { // DefintText $color_str = IO_SWF_Type_RGB::string($textrecord['TextColor']); } else { // DefineText2 $color_str = IO_SWF_Type_RGBA::string($textrecord['TextColor']); } $text .= "TextColor: {$color_str} "; } if ($textrecord['StyleFlagsHasXOffeet']) { $text .= "XOffset: {$textrecord['XOffset']}"; } if ($textrecord['StyleFlagsHasYOffeet']) { $text .= "YOffset: {$textrecord['YOffset']}"; } if ($text != '') { $text .= "\n\t"; } $text .= "GryphEntries:"; foreach ($textrecord['GlyphEntries'] as $glyphEntrie) { $text .= "\n\t\t" . IO_SWF_Type_GLYPHENTRY::string($glyphEntrie, $opts); } $text .= "\n"; return $text; }