mirror of
https://github.com/Team-Resurgent/XBMC4Xbox.git
synced 2026-08-15 11:18:13 -07:00
If ever adding the XBMC4Xbox source to GitHub use "git add -f -A" or it wont add all the files.
27 lines
598 B
Objective-C
27 lines
598 B
Objective-C
/*
|
|
* Simple tool for setting an icon on a file.
|
|
*/
|
|
#import <Cocoa/Cocoa.h>
|
|
#include <stdio.h>
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
if (argc != 3) {
|
|
fprintf(stderr, "Usage: seticon ICON TARGET");
|
|
return 1;
|
|
}
|
|
|
|
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
|
NSString* iconPath = [NSString stringWithUTF8String:argv[1]];
|
|
NSString* filePath = [NSString stringWithUTF8String:argv[2]];
|
|
|
|
[NSApplication sharedApplication];
|
|
|
|
[[NSWorkspace sharedWorkspace]
|
|
setIcon: [[NSImage alloc] initWithContentsOfFile: iconPath]
|
|
forFile: filePath
|
|
options: 0];
|
|
[pool release];
|
|
return 0;
|
|
}
|