bool IdeIconDes::Load(const char *_filename) { Clear(); filename = _filename; filetime = FileGetTime(filename); Array<ImlImage> m; int f; if(!LoadIml(LoadFile(filename), m, f)) return false; format = f; for(int i = 0; i < m.GetCount(); i++) AddImage(m[i].name, m[i].image, m[i].exp); return true; }
virtual Image Make() const { Vector<String> s = Split(id, ':'); if(s.GetCount() != 3) return LayImg::ImageError(); Array<ImlImage> iml; int f; LoadIml(LoadFile(SourcePath(s[0], s[1])), iml, f); bool recolor = false; if(*s[2].Last() == '*') { s[2].Trim(s[2].GetLength() - 1); recolor = true; } Image m = LayImg::ImageError(); for(int i = 0; i < iml.GetCount(); i++) if(iml[i].name == s[2]) { m = iml[i].image; break; } return recolor ? AdjustColors(m) : m; }
int _CRTAPI1 main( int argc, char *argv[] ) { int Result; char *s; PWSTR pw; PINSTALLATION_MODIFICATION_LOGFILE pIml; InitCommonCode( "SHOWINST", "[-c]", "-c specifies to display the contents of text files\n" ); DisplayContentsOfTextFiles = FALSE; while (--argc) { s = *++argv; if (*s == '-' || *s == '/') { while (*++s) { switch( tolower( *s ) ) { case 'c': DisplayContentsOfTextFiles = TRUE; break; default: CommonSwitchProcessing( &argc, &argv, *s ); break; } } } else if (!CommonArgProcessing( &argc, &argv )) { Usage( "Arguments not supported - '%s'", (ULONG)s ); } } if (ImlPath == NULL) { Usage( "Must specify an installation name as first argument", 0 ); } if (!SetCurrentDirectory( InstalerDirectory )) { FatalError( "Unable to change to '%ws' directory (%u)", (ULONG)InstalerDirectory, GetLastError() ); } pIml = LoadIml( ImlPath ); if (pIml == NULL) { FatalError( "Unable to open '%ws' (%u)", (ULONG)ImlPath, GetLastError() ); } Result = ProcessShowIml( pIml ); CloseIml( pIml ); exit( Result ); return Result; }