icosrc/0040755000076500000240000000000007506274234011561 5ustar chmod007stafficosrc/Credits.rtf0100644000076500000240000000244007506274234013670 0ustar chmod007staff{\rtf1\mac\ansicpg10000\cocoartf100 {\fonttbl\f0\fnil\fcharset77 Zapfino;\f1\fswiss\fcharset77 Optima-Regular;} {\colortbl;\red255\green255\blue255;\red58\green54\blue177;} \margl1440\margr1440\vieww5760\viewh8080\viewkind0 \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \f0\fs128 \cf0 icon\cf2 2\cf0 ico \f1\fs24 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural \cf0 icon2ico is a tool to convert Mac icons into Windows .ico icons compatible with Windows XP.\ \ When a file is dragged onto the application, it will create a Windows icon with the same name but the .ico file name extension on it in the same folder as the dragged file. The created icon will contain icons of various sizes (16x16, 32x32 and 48x48) and is compatible with Windows versions that support 4, 8 or 32 bit color icons (including Windows 3.1 through Windows XP).\ \ icon2ico was created by David Remahl and Infinity-to-the-Power-of-Infinity. It is released into the Public Domain for unrestricted use and abuse. People who would like to support continued development of icon2ico and other programs are encouraged to check out Can Combine Icons - a versatile shareware icon creation tool. Information about Can Combine Icons is available on ITTPOI's website:\ \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc \cf0 http://www.ittpoi.com/}icosrc/DRIcon2IcoController.h0100644000076500000240000000030107506274234015620 0ustar chmod007staff/* DRIcon2IcoController */ #import @interface DRIcon2IcoController : NSObject { BOOL startByDaD; IBOutlet NSWindow *win; } - (IBAction)openURL:(id)sender; @end icosrc/DRIcon2IcoController.m0100644000076500000240000000233507506274234015636 0ustar chmod007staff#import "DRIcon2IcoController.h" #import "NSBitmapImageRep-PremultAdditions.h" #import "DRXPIconImageRep.h" @implementation DRIcon2IcoController - (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename { NSWorkspace *sw = [NSWorkspace sharedWorkspace]; NSImage *imageToConv = nil; if( [[filename pathExtension] isEqualToString:@"icns"] ) imageToConv = [[NSImage alloc] initWithContentsOfFile:filename]; else imageToConv = [sw iconForFile:filename]; if( !imageToConv ) return NO; [[imageToConv XPIconData] writeToFile:[[filename stringByDeletingPathExtension] stringByAppendingPathExtension:@"ico"] atomically:NO]; startByDaD = YES; [sw noteFileSystemChanged:[filename stringByDeletingLastPathComponent]]; return YES; } - (void)applicationDidFinishLaunching:(NSNotification *)notification { if( startByDaD ) [NSApp terminate:nil]; else [NSBundle loadNibNamed:@"icon2icowin" owner:self]; } - (IBAction)openURL:(id)sender { NSArray *array = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"DRURLs"]; NSString *url = [array objectAtIndex:[sender tag]]; [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:url]]; } @end icosrc/DRXPIconImageRep.h0100640000076500000240000000052007506274234014720 0ustar chmod007staff// // DRXPIconImageRep.h // Can Combine Icons // // Created by David Remahl on Wed Mar 13 2002. // Copyright (c) 2001 Infinity-to-the-Power-of-Infinity. All rights reserved. // #import @interface DRXPIconImageRep : NSCustomImageRep { } @end @interface NSImage( DRXPIconAdditions ) - (NSData*)XPIconData; @endicosrc/DRXPIconImageRep.m0100640000076500000240000004240507506274234014735 0ustar chmod007staff// // DRXPIconImageRep.m // Can Combine Icons // // Created by David Remahl on Wed Mar 13 2002. // Copyright (c) 2001 Infinity-to-the-Power-of-Infinity. All rights reserved. // #import "DRXPIconImageRep.h" #import "IconFamily.h" #import "NSBitmapImageRep-PremultAdditions.h" #import "NSImage-RepMatchingAdditions.h" @interface NSImage( DRXPIconAdditionsPrivate ) - (NSImage*) resampleToIconWidth:(int)width usingImageInterpolation:(NSImageInterpolation)imageInterpolation; @end typedef struct { UInt8 rgbBlue; UInt8 rgbGreen; UInt8 rgbRed; UInt8 rgbReserved; } XP_RGBQuad; typedef struct { UInt32 biSize; UInt32 biWidth; UInt32 biHeight; UInt16 biPlanes; UInt16 biBitCount; UInt32 biCompression; UInt32 biSizeImage; UInt32 biXPelsPerMeter; UInt32 biYPelsPerMeter; UInt32 biClrUsed; UInt32 biClrImportant; } XP_BitmapInfoHeader; typedef struct { UInt8 bWidth; // Width, in pixels, of the image UInt8 bHeight; // Height, in pixels, of the image UInt8 bColorCount; // Number of colors in image (0 if >=8bpp) UInt8 bReserved; // Reserved ( must be 0) UInt16 wPlanes; // Color Planes UInt16 wBitCount; // Bits per pixel UInt32 dwBytesInRes; // How many bytes in this resource? ( header + ctab + and + xor ) UInt32 dwImageOffset; // Where in the file is this image? } XP_IconDirEntry; typedef struct { UInt16 idReserved; // Reserved (must be 0) UInt16 idType; // Resource Type (1 for icons) UInt16 idCount; // How many images? XP_IconDirEntry idEntries[1]; // An entry for each image (idCount of 'em) } XP_IconDir; typedef struct { XP_BitmapInfoHeader icHeader; // DIB header XP_RGBQuad icColors[1]; // Color table UInt8 icXOR[1]; // DIB bits for XOR mask UInt8 icAND[1]; // DIB bits for AND mask } XP_IconImage; UInt8 DR_MatchBestEntry( const XP_RGBQuad *table, int numEntries, const XP_RGBQuad *match ) { int i; float minDistSqr = 0.0; int minEntr = -1; for( i = 0; i < numEntries; i++ ) { float rd = table[i].rgbRed - match->rgbRed; float gd = table[i].rgbGreen - match->rgbGreen; float bd = table[i].rgbBlue - match->rgbBlue; float distSqr = ( rd * rd + gd * gd + bd * bd ); if( minEntr < 0 || distSqr < minDistSqr ) { minEntr = i; minDistSqr = distSqr; } } return minEntr; } inline UInt32 DR_SwapFourBytes(UInt32 dw) { UInt32 tmp; tmp = (dw & 0x000000FF); tmp = ((dw & 0x0000FF00) >> 0x08) | (tmp << 0x08); tmp = ((dw & 0x00FF0000) >> 0x10) | (tmp << 0x08); tmp = ((dw & 0xFF000000) >> 0x18) | (tmp << 0x08); return(tmp); } inline UInt16 DR_SwapTwoBytes(UInt16 w) { UInt16 tmp; tmp = (w & 0x00FF); tmp = ((w & 0xFF00) >> 0x08) | (tmp << 0x08); return(tmp); } @implementation DRXPIconImageRep + (void)load { [NSImageRep unregisterImageRepClass:[NSBitmapImageRep class]]; [NSImageRep registerImageRepClass:self]; [NSImageRep registerImageRepClass:[NSBitmapImageRep class]]; } + (NSArray*)imageUnfilteredFileTypes { return [NSArray arrayWithObject:@"ico"]; } + (NSArray*)imageUnfilteredPasteboardTypes { return [self imageUnfilteredFileTypes]; } - (BOOL)canInitWithData:(NSData *)data { const unsigned char *bytes = [data bytes]; if( strncmp( bytes, "\0\0\1\0", 4 ) == 0 ) // header matches { return YES; } return NO; } + (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard { return NO; } - (id)initWithData:(NSData*)inData { return [[[self class] imageRepsWithData:inData] objectAtIndex:0]; } + (id)imageRepsWithData:(NSData*)inData { NSMutableArray* outReps = [NSMutableArray array]; void* dataPtr = (void*)[inData bytes]; XP_IconDir* iconDir = malloc( sizeof( XP_IconDir ) ); int i = 0, j = 0; bcopy( dataPtr, iconDir, sizeof(XP_IconDir) ); swab( iconDir, iconDir, 3* sizeof( UInt16 ) ); if( iconDir->idReserved != 0 || iconDir->idType != 1 ) { free( iconDir ); return NULL; } iconDir = realloc( iconDir, ( sizeof( UInt16 ) * 3 ) + ( sizeof( XP_IconDirEntry ) * iconDir->idCount ) ); // Read the ICONDIRENTRY elements bcopy( dataPtr+(sizeof( UInt16 ) * 3), &(iconDir->idEntries), iconDir->idCount * sizeof(XP_IconDirEntry) ); // Loop through and read in each image for( i = 0; i < iconDir->idCount; i++ ) { // Allocate memory to hold the image XP_IconImage* xpImg = NULL; // Seek to the location in the file that has the image void* imgSrc = NULL; iconDir->idEntries[i].dwBytesInRes = DR_SwapFourBytes(iconDir->idEntries[i].dwBytesInRes); iconDir->idEntries[i].dwImageOffset = DR_SwapFourBytes(iconDir->idEntries[i].dwImageOffset); iconDir->idEntries[i].wPlanes = DR_SwapTwoBytes(iconDir->idEntries[i].wPlanes); iconDir->idEntries[i].wBitCount = DR_SwapTwoBytes(iconDir->idEntries[i].wBitCount); xpImg = malloc( iconDir->idEntries[i].dwBytesInRes ); imgSrc = dataPtr + iconDir->idEntries[i].dwImageOffset; bcopy( imgSrc, xpImg, iconDir->idEntries[i].dwBytesInRes ); xpImg->icHeader.biSize = DR_SwapFourBytes(xpImg->icHeader.biSize); xpImg->icHeader.biWidth = DR_SwapFourBytes(xpImg->icHeader.biWidth); xpImg->icHeader.biHeight = DR_SwapFourBytes(xpImg->icHeader.biHeight); xpImg->icHeader.biBitCount = DR_SwapTwoBytes(xpImg->icHeader.biBitCount); if( xpImg->icHeader.biBitCount == 32 && ( xpImg->icHeader.biWidth == 48 ) ) { unsigned int bytesPerRow = 4 * xpImg->icHeader.biWidth; NSBitmapImageRep* imgRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:xpImg->icHeader.biWidth pixelsHigh:xpImg->icHeader.biWidth bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace bytesPerRow:bytesPerRow bitsPerPixel:32]; unsigned char* bitmapData = [imgRep bitmapData]; XP_RGBQuad *quad = NULL; int numPixels = xpImg->icHeader.biWidth * xpImg->icHeader.biWidth; for( j = 0; j < xpImg->icHeader.biWidth; j++ ) bcopy( ((void*)xpImg->icXOR) + bytesPerRow * j - 4, ( ((void*)bitmapData) + bytesPerRow * xpImg->icHeader.biWidth ) - (j+1) * bytesPerRow, bytesPerRow ); quad = (XP_RGBQuad *)bitmapData; for( j = 0; j < numPixels; j++ ) { UInt8 tempRed = quad[j].rgbRed; quad[j].rgbRed = quad[j].rgbBlue; quad[j].rgbBlue = tempRed; } [imgRep premultiply]; [outReps addObject:imgRep]; [imgRep release]; } free( xpImg ); } free( iconDir ); if( ![outReps count] ) [outReps addObjectsFromArray:[NSBitmapImageRep imageRepsWithData:inData]]; return outReps; } @end @implementation NSImage( DRXPIconAdditions ) - (NSImage*) resampleToIconWidth:(int)iconWidth usingImageInterpolation:(NSImageInterpolation)imageInterpolation { NSGraphicsContext* graphicsContext; BOOL wasAntialiasing; NSImageInterpolation previousImageInterpolation; NSImage* newImage; NSImage* workingImage; NSImageRep* workingImageRep; NSSize size, pixelSize, newSize, sizeRep; NSRect iconRect; NSRect targetRect; workingImage = [self copyWithZone:[self zone]]; [workingImage setScalesWhenResized:YES]; size = [workingImage size]; workingImageRep = [workingImage repBestMatchingRect:NSMakeRect(0,0,iconWidth,iconWidth)]; sizeRep = [workingImageRep size]; if ([workingImageRep isKindOfClass:[NSBitmapImageRep class]]) { pixelSize.width = [workingImageRep pixelsWide]; pixelSize.height = [workingImageRep pixelsHigh]; if (!NSEqualSizes( size, pixelSize )) { [workingImage setSize:pixelSize]; [workingImageRep setSize:pixelSize]; size = pixelSize; } } if (size.width >= size.height) { newSize.width = iconWidth; newSize.height = floor( (float) iconWidth * size.height / size.width + 0.5 ); } else { newSize.height = iconWidth; newSize.width = floor( (float) iconWidth * size.width / size.height + 0.5 ); } [workingImage setSize:newSize]; // Create a new image the size of the icon, and clear it to transparent. newImage = [[NSImage alloc] initWithSize:NSMakeSize(iconWidth,iconWidth)]; [newImage lockFocus]; iconRect.origin.x = iconRect.origin.y = 0; iconRect.size.width = iconRect.size.height = iconWidth; [[NSColor clearColor] set]; NSRectFill( iconRect ); // Set current graphics context to use antialiasing and high-quality // image scaling. graphicsContext = [NSGraphicsContext currentContext]; wasAntialiasing = [graphicsContext shouldAntialias]; previousImageInterpolation = [graphicsContext imageInterpolation]; [graphicsContext setShouldAntialias:YES]; [graphicsContext setImageInterpolation:imageInterpolation]; // Composite the working image into the icon bitmap, centered. targetRect.origin.x = ((float)iconWidth - newSize.width ) / 2.0; targetRect.origin.y = ((float)iconWidth - newSize.height) / 2.0; targetRect.size.width = newSize.width; targetRect.size.height = newSize.height; [workingImageRep drawInRect:targetRect]; // Restore previous graphics context settings. [graphicsContext setShouldAntialias:wasAntialiasing]; [graphicsContext setImageInterpolation:previousImageInterpolation]; [newImage unlockFocus]; [workingImage release]; // Return the new image! return [newImage autorelease]; } - (NSData*)XPIconData { int numBitSizes = 3; int bitSizes[] = { 4, 8, 32 }; int numPixSizes = 3; int pixSizes[] = { 16, 32, 48 }; int numEntries = numBitSizes * numPixSizes; int lastOffset = 3 * sizeof( UInt16 ) + numEntries * sizeof( XP_IconDirEntry ); NSMutableData* iconData = [NSMutableData data]; UInt16 uInt16 = 0; int curBitInd = 0, curPixInd = 0; XP_IconDirEntry *headers = NULL; int headerNum = 0; NSDictionary *xpPalDict = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"XPPal" ofType:@"dict"]]; const XP_RGBQuad *sixteenCtab = NULL; const XP_RGBQuad *twofivesixCtab = NULL; int rowBytes; sixteenCtab = [[xpPalDict objectForKey:@"4BitPalette"] bytes]; twofivesixCtab = [[xpPalDict objectForKey:@"8BitPalette"] bytes]; uInt16 = 0; [iconData appendBytes:&uInt16 length:2]; // reserved uInt16 = DR_SwapTwoBytes(1); [iconData appendBytes:&uInt16 length:2]; // type uInt16 = DR_SwapTwoBytes(numEntries); [iconData appendBytes:&uInt16 length:2]; // num entries headers = malloc( numEntries * sizeof( XP_IconDirEntry ) ); for( curPixInd = 0; curPixInd < numPixSizes; curPixInd++ ) { int curPix = pixSizes[curPixInd]; rowBytes = ( ( ( curPix - 1 ) / 32 ) + 1 ) * 32 / 8; for( curBitInd = 0; curBitInd < numBitSizes; curBitInd++ ) { UInt16 curBit = bitSizes[curBitInd]; int size; size = 40; if( curBit <= 8 ) size += pow(2,curBit) * 4; size += curPix * curPix * curBit / 8.0f; size += rowBytes * curPix; headers[headerNum].bWidth = curPix; headers[headerNum].bHeight = headers[headerNum].bWidth; headers[headerNum].bColorCount = ( curBit < 8 ? pow(2,curBit) : 0 ); headers[headerNum].bReserved = 0; headers[headerNum].wPlanes = DR_SwapTwoBytes( 1 ); headers[headerNum].wBitCount = DR_SwapTwoBytes( curBit ); headers[headerNum].dwBytesInRes = DR_SwapFourBytes( size ); headers[headerNum].dwImageOffset = DR_SwapFourBytes( lastOffset ); lastOffset += size; headerNum++; } } [iconData appendBytes:headers length:numEntries * sizeof( XP_IconDirEntry )]; for( curPixInd = 0; curPixInd < numPixSizes; curPixInd++ ) { UInt16 curPix = pixSizes[curPixInd]; NSImage *scaledImage = [self resampleToIconWidth:curPix usingImageInterpolation:NSImageInterpolationHigh]; NSBitmapImageRep *curRep; UInt8 *repData = NULL; UInt8 *andData = NULL; int andDataSize; rowBytes = ( ( ( curPix - 1 ) / 32 ) + 1 ) * 32 / 8; andDataSize = rowBytes * curPix; [scaledImage lockFocus]; curRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:NSMakeRect(0, 0, 128, 128)]; [scaledImage unlockFocus]; [curRep unmultiply]; [curRep flipVertically]; repData = [curRep bitmapData]; { int x, y; andData = malloc( andDataSize ); bzero( andData, andDataSize ); for( y = 0; y < curPix; y++ ) { UInt8 *bitrow = andData + y * rowBytes; XP_RGBQuad *colrow = (XP_RGBQuad*)(repData + y * curPix * 4); for( x = 0; x < curPix; x += 8 ) { UInt8 *byte = bitrow + x/8; XP_RGBQuad *pixe = colrow + x; *byte |= (pixe[0].rgbReserved < 85) << 7; *byte |= (pixe[1].rgbReserved < 85) << 6; *byte |= (pixe[2].rgbReserved < 85) << 5; *byte |= (pixe[3].rgbReserved < 85) << 4; *byte |= (pixe[4].rgbReserved < 85) << 3; *byte |= (pixe[5].rgbReserved < 85) << 2; *byte |= (pixe[6].rgbReserved < 85) << 1; *byte |= (pixe[7].rgbReserved < 85) << 0; } } } for( curBitInd = 0; curBitInd < numBitSizes; curBitInd++ ) { int curBit = bitSizes[curBitInd]; XP_BitmapInfoHeader infoHeader; infoHeader.biSize = DR_SwapFourBytes( 40 ); infoHeader.biWidth = DR_SwapFourBytes( curPix ); infoHeader.biHeight = DR_SwapFourBytes( curPix * 2 ); infoHeader.biPlanes = DR_SwapTwoBytes( 1 ); infoHeader.biBitCount = DR_SwapTwoBytes( curBit ); infoHeader.biCompression = 0; infoHeader.biSizeImage = 0; infoHeader.biXPelsPerMeter = 0; infoHeader.biYPelsPerMeter = 0; infoHeader.biClrUsed = 0; infoHeader.biClrImportant = 0; [iconData appendBytes:&infoHeader length:40]; if( curBit == 4 ) { UInt8 *sixteenData; int j,k=0; int ev=0; UInt8 bytePart1 = 0, bytePart2 = 0; sixteenData = malloc( curPix * curPix / 2 ); for( j = 0; j < curPix * curPix; j++ ) { XP_RGBQuad col; col.rgbRed = repData[j*4]; col.rgbGreen = repData[j*4 + 1]; col.rgbBlue = repData[j*4 + 2]; if( ev ) { bytePart2 = DR_MatchBestEntry( sixteenCtab, 16, &col ); sixteenData[k++] = ( (bytePart1 << 4) | (bytePart2)); } else { bytePart1 = DR_MatchBestEntry( sixteenCtab, 16, &col ); } ev = !ev; } [iconData appendBytes:sixteenCtab length:16*4]; [iconData appendBytes:sixteenData length:curPix * curPix / 2]; free(sixteenData); } else if( curBit == 8 ) { UInt8 *twofivesixData = malloc( curPix * curPix ); int j; for( j = 0; j < curPix * curPix; j++ ) { XP_RGBQuad col; col.rgbRed = repData[j*4]; col.rgbGreen = repData[j*4 + 1]; col.rgbBlue = repData[j*4 + 2]; twofivesixData[j] = DR_MatchBestEntry( twofivesixCtab, 256, &col ); } [iconData appendBytes:twofivesixCtab length:256*4]; [iconData appendBytes:twofivesixData length:curPix * curPix]; free(twofivesixData); } else if( curBit == 32 ) { XP_RGBQuad *bmpData = malloc( curPix * curPix * sizeof(XP_RGBQuad) ); int j = 0; for( j = 0; j < curPix * curPix; j++ ) { (bmpData + j)->rgbRed = repData[j*4]; (bmpData + j)->rgbGreen = repData[j*4 + 1]; (bmpData + j)->rgbBlue = repData[j*4 + 2]; (bmpData + j)->rgbReserved = repData[j*4 + 3]; } [iconData appendBytes:bmpData length:curPix * curPix * sizeof(XP_RGBQuad)]; free( bmpData ); } [iconData appendBytes:andData length:andDataSize]; } free(andData); } return iconData; } @end icosrc/icon2ico.icns0100644000076500000240000012505307506274234014147 0ustar chmod007stafficns+ics#H?7>?7>ics8++N*N$$NNNzyzV+VV+VVVis32f UŮ/U+ q+羗wpD9qҧhJ/Ue~l`f ofG8 /f-l=8 Óym<]׃Ka3 S႕s3  i  9˼X  UU+ ȟo,q DSֻ+#8݃ef    AL-m=IyM J؃PD A愓sL  ki  3s˼X  UU+ q pA+ Չf #eH |8'l=eUy Oە`w Ss ai   NʼX s8mk/1&X1fW5w'1 )A{;b78n*a2 -r z++Z '%->6.):-wV+:! ;<"a(4Ű!  ICN#&xl????/????&xl????/????icl8V+++OOy+$NNNy+$$NNNz+$$$*NNNz$$$$NNNxV+$$$$NNxxVONONNNrxVVONOyVOyVVVV+VV+V+UyVO++++VVVil32* {f?ݫS,Uμ{l V`ƱngʮUëybfp3v*Իr]d*scmɰj^xcTmUŹxr`[( $=jf3Xyv\V`!1W @xk]ROi[#j=u{\ <:96-  3p#  &$  it32T 4faff]V43f]p{~ƹhUq  ?XvsH3c}uu{̬ñ̻UHA7 602j8Q't/=bܡûwvq^fwmxviZHA8Uȁd3P<D(FNY\I>GFSfjw{mQa߁0½|kk]Sffmxx{vmmddW   JO#08CNZE7;DQ]jl{[::a圢ľ}{uii]Uffmx{{vmmdd[  Ji '2EYE29CNUjl{Q!:`ۗĻ}{z|wgfXUffix{{{vvmddD  -9 >1#:Y@ 04ALUjl{vQ!a웵~sfbWU]hiuts{{niiW  WЁ S-U? ,32)/5>DDKFUQX_hirnx`gJ?,&Xe !*3AA8]p|}}#!&[PG@/&"#..4:?GOO[fcjluqmfgI<5)G !*3A5%UY||p.##$""'-*,39Fdghoxqsd^M?4, / !*3UYqws{bOHDA!*3-0+Z|qhZNF8%P .ig{r]UOH S/!*.(iS]L6"J?widWLG  XV!&.( 4< [md[`/  Nx&&# %#=d[W    9&"="m[  !(#h47:>+"0D  ; Ԓz3:1&""  M% )+#$ YF   o,'  Tg# "G "# E -*% <&  &#! . 11-(Z  "$  -ˍ 84//$o$ G  K83,!v Y4' 8G:4-' f  ZW( fZC7."CED L}( WL=7/#2 dmK7) 3[O?8/#OdmvQ3 },Ɉ) Q[O?8/#e3dv ,߇) [[O?85(sUmvh ƵD% *ddOG?5(kdmvf ξ h ,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 v磏}qG)9?>:͇noNK 0??>:·p~oPX$7?;· v獣⁲o"* 3?FE?;· ġoVd Jan;!  'lb   1Ec@)5COq%"!  Q *6PnA $:H\u0$#"  <; +9Wz 3H]~=7<6"   !~1?dz4"  v"  Ŀb%" !$&5X  첳_&#!!%*/-)%  .춷C'$" "%,291f4   p극9'%#!#&,4<>Eo%  7鹻0)&$" #&,4=FE* 缾-+'$# "&,4=CFbA#  轿Ä/,(%#!!%,4Gb)    $ȽH3.*'$" !%+)07F^t/"     %˵A3.*'$"  $'$,3FZfi%  #./*&$  'ͬ;3.+'$" "!!&-GTaA3% /73-)%!  (Ϣ83.*'$" !"*DP\jM;3,(&&)-><60+&#   )ј83.*&$" ,?KWc?6/,*+.?B:4-'#   )ӎ73-*&$!,;8530.,)''()'%$"  #%%%*/FR\gqTH<3*  (V˴SE?:50.+(&$" !"  #"(AJT_isTH<3'  7ǧxfgjqzF:3-*%" &:BLV`kuTH<3#  EjO@;?Q_eipf9.(#&4;DMWcmvTH<3   *2./137GR\gqP?1$ $'+08BMY4.)$!  #%*07?IS]hsP>0" "$(.6@KXv4,($! #&+18AKU`jtT=.!  #'-4?KW\3,&$  %,3;CLXblwR:+ "%,4>JWH1+&#   (3^:, $+3=IVd3,($!    9s>/"  $+3=IVP2,&!   7Z2#  $+3=IVC1+! !$" '>O'  $+3=IV8/!  "$'+3KD  $+3=IV6$ !#$(,4L:  $+3:51,($"  #%),19R.  $+3>BHP[}x. &($! #%),19R/   %0=h[SLC:3115;FQ\2"/)$  #%),19R/   ",8`UPH@6.(%&*1Lq1&   "$'+/6It(   ,9GTP("$&*-3D\s~~~~~}}|{ywusmY>$  '5BP)!#&),07CMPQSVVXYYXYWVUTSQQQQQPPONMLIFC=6(  #/=Kf5! !"&&)-16:=?@@AA@@>=<;:::::::997642/+&" +8ERo" !%(,/13566756543333333222210/-*(%"  &2?M$   "$'*,,....------------,,+*)(&#!  !,9GZݺ|<%  !"#%%&&&&&&&&&&&&&&&&&%$"  (3@KϡlH<0%     ".9CtZSLC9.#    &1;CJMMKE=3)      )29?BC@<5-%    ")058862,&    &*,,+(#    ""!      icosrc/InfoPlist.strings0100750000076500000240000000111607506274234015075 0ustar chmod007staff/* Localized versions of Info.plist keys */ CFBundleName = "icon2ico"; CFBundleShortVersionString = "icon2ico version 1.0.0"; CFBundleGetInfoString = "icon2ico version 1.0.0, Released into the PD by David."; NSHumanReadableCopyright = "icon2ico version 1.0.0, Released into the PD by David."; icosrc/NSBitmapImageRep-PremultAdditions.h0100644000076500000240000000052707506274234020307 0ustar chmod007staff// // NSBitmapImageRep-PremultAdditions.h // Can Combine Icons // // Created by David Remahl on Wed Jun 19 2002. // Copyright (c) 2002 Infinity-to-the-Power-of-Infinity. All rights reserved. // #import @interface NSBitmapImageRep(PremultAdditions) - (void)premultiply; - (void)unmultiply; - (void)flipVertically; @end icosrc/NSBitmapImageRep-PremultAdditions.m0100644000076500000240000000543407506274234020316 0ustar chmod007staff// // NSBitmapImageRep-PremultAdditions.m // Can Combine Icons // // Created by David Remahl on Wed Jun 19 2002. // Copyright (c) 2002 Infinity-to-the-Power-of-Infinity. All rights reserved. // #import "NSBitmapImageRep-PremultAdditions.h" @implementation NSBitmapImageRep(PremultAdditions) - (void)premultiply { int pixelsHigh = [self pixelsHigh], pixelsWide = [self pixelsWide]; unsigned char *bitmapData = [self bitmapData]; unsigned char *pDest = bitmapData, *pSrc = bitmapData; unsigned char alphaByte; int bytesPerRow = [self bytesPerRow]; int x = 0, y = 0; float oneOverAlpha = 0.0; pSrc = pDest; for (y = 0; y < pixelsHigh; y++) { pSrc = bitmapData + y * bytesPerRow; for (x = 0; x < pixelsWide; x++) { *(pDest+3) = alphaByte = *(pSrc+3); if (alphaByte) { oneOverAlpha = 255.0f / (float)alphaByte; *pDest++ = *(pSrc+0) * oneOverAlpha; *pDest++ = *(pSrc+1) * oneOverAlpha; *pDest++ = *(pSrc+2) * oneOverAlpha; } else { *pDest++ = 0; *pDest++ = 0; *pDest++ = 0; } pDest++; pSrc+=4; } } } - (void)unmultiply { int pixelsHigh = [self pixelsHigh], pixelsWide = [self pixelsWide]; unsigned char *bitmapData = [self bitmapData]; unsigned char *pDest = bitmapData, *pSrc = bitmapData; unsigned char alphaByte; int bytesPerRow = [self bytesPerRow]; int x = 0, y = 0; float alphaOverOne = 0.0; for( y = 0; y < pixelsHigh; y++ ) { pSrc = bitmapData + y * bytesPerRow; for( x = 0; x < pixelsWide; x++ ) { *(pDest+3) = alphaByte = *(pSrc+3); if( alphaByte ) { alphaOverOne = (float)alphaByte/255.0f; *pDest++ = *(pSrc+0) * alphaOverOne; *pDest++ = *(pSrc+1) * alphaOverOne; *pDest++ = *(pSrc+2) * alphaOverOne; } else { *pDest++ = 0; *pDest++ = 0; *pDest++ = 0; } pDest++; pSrc+=4; } } } - (void)flipVertically { int pixelsHigh = [self pixelsHigh]; unsigned char *bitmapData = [self bitmapData]; int bytesPerRow = [self bytesPerRow]; UInt8 *tmpRow; int i; int halfDistance = pixelsHigh / 2; tmpRow = malloc( bytesPerRow ); for( i = 0; i < halfDistance; i++ ) { bcopy( bitmapData + bytesPerRow * i, tmpRow, bytesPerRow ); bcopy( bitmapData + bytesPerRow * (pixelsHigh - 1 - i), bitmapData + bytesPerRow * i, bytesPerRow ); bcopy( tmpRow, bitmapData + bytesPerRow * (pixelsHigh - 1 - i), bytesPerRow ); } free(tmpRow); } @end icosrc/NSImage-RepConversionAdditions.h0100640000076500000240000000052307506274234017637 0ustar chmod007staff// // NSImage-RepConversionAdditions.h // Can Combine Icons // // Created by David Remahl on Wed Dec 26 2001. // Copyright (c) 2001 Infinity-to-the-Power-of-Infinity. All rights reserved. // #import @interface NSImage (RepConversionAdditions) - (void)convertIntoBitmapRepsAllRepsOfClassKind:(Class)oldRepClass; @endicosrc/NSImage-RepConversionAdditions.m0100640000076500000240000000321407506274234017644 0ustar chmod007staff// // NSImage-RepConversionAdditions.m // Can Combine Icons // // Created by David Remahl on Wed Dec 26 2001. // Copyright (c) 2001 Infinity-to-the-Power-of-Infinity. All rights reserved. // #import "NSImage-RepConversionAdditions.h" @implementation NSImage (RepConversionAdditions) - (void)convertIntoBitmapRepsAllRepsOfClassKind:(Class)oldRepClass { NSMutableArray* arrayWithRepsToInsert = [NSMutableArray array]; NSMutableArray* arrayWithRepsToDelete = [NSMutableArray array]; NSEnumerator* repEnum = [[self representations] objectEnumerator]; NSImageRep* currRep = NULL; while( currRep = [repEnum nextObject] ) { if( !oldRepClass || [currRep isKindOfClass:oldRepClass] ) { NSBitmapImageRep* newRep = NULL; NSImage* dummyImage = [[NSImage alloc] initWithSize:[currRep size]]; // [dummyImage addRepresentation:newRep]; [dummyImage lockFocus]; [currRep drawAtPoint:NSMakePoint(0,0)]; newRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:NSMakeRect(0,0,[currRep size].width,[currRep size].height)]; [dummyImage unlockFocus]; [arrayWithRepsToInsert addObject:newRep]; [arrayWithRepsToDelete addObject:currRep]; [newRep release]; [dummyImage release]; } } { NSEnumerator* delEnum = [arrayWithRepsToDelete objectEnumerator]; NSImageRep* delRep = NULL; while( delRep = [delEnum nextObject] ) { [self removeRepresentation:delRep]; } [self addRepresentations:arrayWithRepsToInsert]; } } @end icosrc/NSImage-RepMatchingAdditions.h0100640000076500000240000000043707506274234017250 0ustar chmod007staff// // NSImage-RepMatchingAdditions.h // iConMerge // // Created by david on Fri Oct 12 2001. // Copyright (c) 2001 __MyCompanyName__. All rights reserved. // #import @interface NSImage (RepMatchingAdditions) - (NSImageRep*) repBestMatchingRect:(NSRect)rect; @end icosrc/NSImage-RepMatchingAdditions.m0100640000076500000240000000223007506274234017246 0ustar chmod007staff// // NSImage-RepMatchingAdditions.m // iConMerge // // Created by david on Fri Oct 12 2001. // Copyright (c) 2001 __MyCompanyName__. All rights reserved. // #import "NSImage-RepMatchingAdditions.h" @implementation NSImage (RepMatchingAdditions) - (NSImageRep*) repBestMatchingRect:(NSRect)rect { NSEnumerator* repEnum = [[self representations] objectEnumerator]; NSImageRep* currentRep = nil; NSImageRep* bestRep = nil; NSImageRep* largestRep = nil; float sizeDiff = 1000000000.0; //large num ;-) float largestRepSize = 0.0; while( currentRep = [repEnum nextObject] ) { NSSize currentRepSize = [currentRep size]; if( abs(currentRepSize.width - NSWidth(rect)) < sizeDiff && currentRepSize.width - NSWidth(rect) >= 0 ) { sizeDiff = currentRepSize.width - NSWidth(rect); bestRep = currentRep; } if( currentRepSize.width > largestRepSize ) { largestRepSize = currentRepSize.width; largestRep = currentRep; } } if( !bestRep ) { bestRep = largestRep; } return bestRep; } @end