 |
 |
Icon Services woes
|
 |
|
 |
|
Ambrosia - el Presidente
Join Date: Sep 2000
Location: Rochester, NY
Status:
Offline
|
|
Looking at Preview.app's info.plist, it appears to provide an icon for files of the type 'JPEG' and creator 'prvw':
<key>CFBundleSignature</key>
<string>prvw</string>
...
<key>CFBundleTypeOSTypes</key>
<array>
<string>JPEG</string>
</array>
However, if I call IconServices to get an IconRef to this icon:
GetIconRef(kOnAppropriateDisk, 'prvw', 'JPEG', &iconRef);
...it returns a generic document icon. This same code path *does* work for other applications such as GraphicConverter, PhotoShop, ImageReady, etc.
Yes Preview.app is in my /Applications dir -- and I've tried the constants kOnSystemDisk and kUserDomain without effect. I've also tried this for every file type that Preview.app purports to support, and it doesn't work.
So what am I doing wrong, or is IconServices still not quite complete?
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2001
Location: Seattle, WA
Status:
Offline
|
|
I would bet not complete. Though I am just guessing...
But Moki as El Pres of Ambrosia don't you have contacts inside apple? Fire off a email and ask if it's not fully implemented, as what you are doing *should* work.
|
|
The spirit of resistance to government is so valuable on certain occasions, that I wish it always to be kept alive.
- Thomas Jefferson, 1787
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
Methinks I once saw something about getting icons in LaunchServices that might work...
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by juanvaldes:
<strong>But Moki as El Pres of Ambrosia don't you have contacts inside apple? Fire off a email and ask if it's not fully implemented, as what you are doing *should* work.</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">Well, he's probably a member of ADC and as such could use up a technical support incident, but since they cost $300 a pop or something extortionate like that I expect he'd probably prefer not to.
Anyway, I'm pretty sure I heard that Icon Services has some bugs under OS X. I'd suggest trying the LaunchServices calls first, though.
|
|
|
| |
|
|
|
 |
|
 |
|
Ambrosia - el Presidente
Join Date: Sep 2000
Location: Rochester, NY
Status:
Offline
|
|
It turns out to be yet another limitation in the OS X Carbon APIs -- if IconServices will just return what icons are in the OS 9 desktop database file (if you have one), which of course won't include applications that doesn't include OS 9-style bundles (such as Cocoa apps).
As a (lame) work-around, I simply create a temporary file of the type/creator I want an icon to, and call GetIconRefFromFile() on it.
Silly, slow, and inefficient, but it works. :/
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status:
Offline
|
|
not very elegant, either, but you could open the (cocoa) app's Contents/Info.plist and then look at the key for CFBundleIconFile and assemble the path...
as i said, not very elegant, but should work...
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|