Subversion Repositories filter_foundry

Compare Revisions

Regard whitespace Rev 374 → Rev 375

/trunk/os_types.php
38,39 → 38,49
ostype_info('cTl7', 'Slider 7 (for non-standalone filter)', 'Telegraphics');
ostype_footer();
 
ostype_header("Resource types");
echo "Note: For standalone plugins, all FourCC codes above will be replaced ";
echo "by different hashes based on the parameter data of the filter (except `tELE` and `Fltr`).\n\n";
 
// TODO: also display Windows types, e.g. RT_RCDATA = 'DATA' ?
ostype_header("Resource fork types");
ostype_info('aete', 'Apple Event Terminology', 'Apple'); // https://developer.apple.com/library/archive/documentation/mac/pdf/Interapplication_Communication/AE_Term_Resources.pdf
ostype_info('tpLT', 'Template for standalone filter resources', 'Telegraphics');
ostype_info('DATA', 'Generic Data (used in for obfuscated filters)', 'Apple?');
//ostype_info('PiMI', 'Plug-in Meta Information', 'Adobe');
ostype_info('PiPL', 'PlugIn Property List', 'Adobe');
ostype_info('DATA', 'Generic data (replaced by `tpLT` and `obFS`)', '?');
ostype_info('tpLT', 'Template for standalone filter resources', 'Telegraphics'); // actually defined by ViaThinkSoft for Filter Foundry
ostype_info('obFS', 'Filter Foundry obfuscated data', 'Telegraphics'); // actually defined by ViaThinkSoft
ostype_info('PARM', 'Filter Factory parameter data (PARM.h)', 'Adobe');
// https://developer.apple.com/library/archive/documentation/mac/pdf/ResEditReference.pdf
// https://developer.apple.com/library/archive/documentation/mac/pdf/MoreMacintoshToolbox.pdf
ostype_info('ALRT', 'Alert', 'Apple');
ostype_info('CITL', 'Dialog template', 'Apple');
ostype_info('CNTL', 'Control', 'Apple');
ostype_info('DLOG', 'Dialog', 'Apple');
ostype_info('dlgx', 'Extended Dialog', 'Apple');
ostype_info('dftb', 'Dialog Font Table', 'Apple');
ostype_info('PICT', 'Picture', 'Apple');
ostype_info('CURS', 'Cursor', 'Apple');
ostype_info('vers', 'Version number', 'Apple');
ostype_info('ALRT', 'Alert (only Macintosh build)', 'Apple');
ostype_info('DITL', 'Dialog template (only Macintosh build)', 'Apple');
ostype_info('CNTL', 'Control (only Macintosh build)', 'Apple');
ostype_info('DLOG', 'Dialog (only Macintosh build)', 'Apple');
ostype_info('dlgx', 'Extended Dialog (only Macintosh build)', 'Apple');
ostype_info('dftb', 'Dialog Font Table (only Macintosh build)', 'Apple');
ostype_info('PICT', 'Picture (only Macintosh build)', 'Apple');
ostype_info('CURS', 'Cursor (only Macintosh build)', 'Apple');
ostype_info('vers', 'Version number (only Macintosh build)', 'Apple');
ostype_footer();
 
ostype_header("PlugIn Property List (PiPL) related");
//ostype_info('PiMI', 'Plug-in Meta Information', 'Adobe');
ostype_info('PiPL', 'PlugIn Property List', 'Adobe');
ostype_info('catg', 'PiPL property "Category"', 'Adobe');
ostype_info('name', 'PiPL property "Name"', 'Adobe');
ostype_info('hstm', 'PiPL property "Has terminology"', 'Adobe');
ostype_info('8BIM', 'Adobe Photoshop vendor code', 'Adobe'); // was '8B##" assigned to Adobe by Apple?
ostype_info('wx86', 'PIWin32X86CodeProperty (PIGeneral.h)', 'Adobe');
ostype_info('8664', 'PIWin64X86CodeProperty (PIGeneral.h)', 'Adobe');
ostype_info('kind', 'PiPL property "Kind" (PIPL.r)', 'Adobe');
ostype_info('8BFM', 'Adobe Filter module (used in \'kind\' property)', 'Adobe'); // was '8B##" assigned to Adobe by Apple?
ostype_info('vers', 'PiPL property "Version" (PIPL.r)', 'Adobe');
ostype_info('mode', 'PiPL property "SupportedModes" (PIPL.r)', 'Adobe');
ostype_info('ms32', 'PiPL property "PlugInMaxSize" (PIPL.r)', 'Adobe');
ostype_info('fici', 'PiPL property "FilterCaseInfo" (PIPL.r)', 'Adobe');
ostype_header("Creator codes");
ostype_info('8BIM', 'Adobe Photoshop', 'Adobe');
ostype_info('8BFM', 'Adobe Filter module (used in `kind` PiPL property)', 'Adobe');
ostype_footer();
 
pipl_property_header("PlugIn Property List (PiPL) properties");
pipl_property_info('8BIM', 'catg', 'PiPL property "Category"', 'Adobe');
pipl_property_info('8BIM', 'name', 'PiPL property "Name"', 'Adobe');
pipl_property_info('8BIM', 'hstm', 'PiPL property "Has terminology"', 'Adobe');
pipl_property_info('8BIM', 'wx86', 'PiPL property PIWin32X86CodeProperty (PIGeneral.h)', 'Adobe');
pipl_property_info('8BIM', '8664', 'PiPL property PIWin64X86CodeProperty (PIGeneral.h)', 'Adobe');
pipl_property_info('8BIM', 'kind', 'PiPL property "Kind" (PIPL.r)', 'Adobe');
pipl_property_info('8BIM', 'vers', 'PiPL property "Version" (PIPL.r)', 'Adobe');
pipl_property_info('8BIM', 'mode', 'PiPL property "SupportedModes" (PIPL.r)', 'Adobe');
pipl_property_info('8BIM', 'ms32', 'PiPL property "PlugInMaxSize" (PIPL.r)', 'Adobe');
pipl_property_info('8BIM', 'fici', 'PiPL property "FilterCaseInfo" (PIPL.r)', 'Adobe');
pipl_property_footer();
 
# ------------------------------------------------------------------------------
 
$out = ob_get_contents();
89,16 → 99,21
$dec = str_pad($dec, strlen(hexdec('ffffffff')), " ", STR_PAD_LEFT);
$desc = str_pad($desc, DESC_WIDTH, " ", STR_PAD_RIGHT);
 
$illegal = false;
if ($vendor != '?') {
$is_all_uppercase = strtoupper($type) == $type;
$is_all_lowercase = strtolower($type) == $type;
$starts_with_uppercase = strtoupper($type[0]) == $type[0];
if (($is_all_uppercase || $is_all_lowercase) && (strpos($vendor,'Apple') === false)) $vendor .= ' (illegal)';
else if (!($is_all_uppercase || $is_all_lowercase) && (strpos($vendor,'Apple') !== false)) $vendor .= ' (illegal)';
else if ($starts_with_uppercase && !$is_all_uppercase && (strpos($vendor,'Adobe') === false)) $vendor .= ' (illegal)';
else if (!$starts_with_uppercase && !$is_all_uppercase && (strpos($vendor,'Adobe') !== false)) $vendor .= ' (illegal)';
if (($is_all_uppercase || $is_all_lowercase) && (strpos($vendor,'Apple') === false)) $illegal = true;
else if (!($is_all_uppercase || $is_all_lowercase) && (strpos($vendor,'Apple') !== false)) $illegal = true;
else if ($starts_with_uppercase && !$is_all_uppercase && (strpos($vendor,'Adobe') === false)) $illegal = true;
else if (!$starts_with_uppercase && !$is_all_uppercase && (strpos($vendor,'Adobe') !== false)) $illegal = true;
}
// In re 8B##, we just assume that 8B## was legally assigned to Adobe by Apple
// Note: "8B" sounds like "Adobe"
if ((substr($type,0,2) === '8B') && (strpos($vendor,'Adobe') !== false)) $illegal = false;
 
if ($illegal) $vendor .= ' (illegal)';
$vendor = str_pad($vendor, VENDOR_WIDTH, " ", STR_PAD_RIGHT);
 
echo "| `$type` | $dec | $hex | $desc | $vendor |\n";
114,5 → 129,42
echo "\n";
echo "| Type | Dec | Hex | ".str_pad('Description', DESC_WIDTH, " ", STR_PAD_RIGHT)." | ".str_pad('Vendor', VENDOR_WIDTH, " ", STR_PAD_RIGHT)." |\n";
echo "|--------|------------|------------|".str_repeat('-', DESC_WIDTH+2)."|".str_repeat('-', VENDOR_WIDTH+2)."|\n";
}
 
# ------------------------------------------------------------------------------
 
function pipl_property_info($ven, $type, $desc, $vendor) {
$vdec = 0;
for ($i=0;$i<4;$i++) $vdec = ($vdec<<8) + ord($ven[$i]);
$vhex = "0x".str_pad(dechex($vdec), 8, "0", STR_PAD_LEFT);
$vdec = str_pad($vdec, strlen(hexdec('ffffffff')), " ", STR_PAD_LEFT);
 
$dec = 0;
for ($i=0;$i<4;$i++) $dec = ($dec<<8) + ord($type[$i]);
$hex = "0x".str_pad(dechex($dec), 8, "0", STR_PAD_LEFT);
$dec = str_pad($dec, strlen(hexdec('ffffffff')), " ", STR_PAD_LEFT);
 
$desc = str_pad($desc, DESC_WIDTH, " ", STR_PAD_RIGHT);
 
// In re 8B##, we just assume that 8B## was legally assigned to Adobe by Apple
// Note: "8B" sounds like "Adobe"
$illegal = (substr($ven,0,2) === '8B') != (strpos($vendor,'Adobe') !== false);
 
if ($illegal) $vendor .= ' (illegal)';
$vendor = str_pad($vendor, VENDOR_WIDTH, " ", STR_PAD_RIGHT);
 
echo "| `$ven` | `$type` | $vdec $dec | $vhex $hex | $desc | $vendor |\n";
}
 
function pipl_property_footer() {
echo "\n";
}
 
function pipl_property_header($title) {
echo "$title\n";
echo str_repeat('-',strlen($title))."\n";
echo "\n";
echo "| C.code | Prpty. | Dec | Hex | ".str_pad('Description', DESC_WIDTH, " ", STR_PAD_RIGHT)." | ".str_pad('Vendor', VENDOR_WIDTH, " ", STR_PAD_RIGHT)." |\n";
echo "|--------|--------|-----------------------|-----------------------|".str_repeat('-', DESC_WIDTH+2)."|".str_repeat('-', VENDOR_WIDTH+2)."|\n";
}