-
Notifications
You must be signed in to change notification settings - Fork 4
/
IconsCore.h
1379 lines (1182 loc) · 41.9 KB
/
IconsCore.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
File: LaunchServices/IconsCore.h
Contains: Icon Utilities and Icon Services Interfaces.
Version: LaunchServices-283~12
Copyright: © 1990-2006 by Apple Computer, Inc. All rights reserved
Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://developer.apple.com/bugreporter/
*/
#ifndef __ICONSCORE__
#define __ICONSCORE__
#ifndef __CARBONCORE__
#include <CarbonCore/CarbonCore.h>
#endif
#ifndef __OSSERVICES__
#include <OSServices/OSServices.h>
#endif
#include <AvailabilityMacros.h>
#if PRAGMA_ONCE
#pragma once
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* The following are icons for which there are both icon suites and SICNs. */
/* Avoid using icon resources if possible. Use IconServices instead. */
enum {
kGenericDocumentIconResource = -4000,
kGenericStationeryIconResource = -3985,
kGenericEditionFileIconResource = -3989,
kGenericApplicationIconResource = -3996,
kGenericDeskAccessoryIconResource = -3991,
kGenericFolderIconResource = -3999,
kPrivateFolderIconResource = -3994,
kFloppyIconResource = -3998,
kTrashIconResource = -3993,
kGenericRAMDiskIconResource = -3988,
kGenericCDROMIconResource = -3987
};
/* The following are icons for which there are SICNs only. */
/* Avoid using icon resources if possible. Use IconServices instead. */
enum {
kDesktopIconResource = -3992,
kOpenFolderIconResource = -3997,
kGenericHardDiskIconResource = -3995,
kGenericFileServerIconResource = -3972,
kGenericSuitcaseIconResource = -3970,
kGenericMoverObjectIconResource = -3969
};
/* The following are icons for which there are icon suites only. */
/* Avoid using icon resources if possible. Use IconServices instead. */
enum {
kGenericPreferencesIconResource = -3971,
kGenericQueryDocumentIconResource = -16506,
kGenericExtensionIconResource = -16415,
kSystemFolderIconResource = -3983,
kHelpIconResource = -20271,
kAppleMenuFolderIconResource = -3982
};
/* Obsolete. Use named constants defined above. */
enum {
genericDocumentIconResource = kGenericDocumentIconResource,
genericStationeryIconResource = kGenericStationeryIconResource,
genericEditionFileIconResource = kGenericEditionFileIconResource,
genericApplicationIconResource = kGenericApplicationIconResource,
genericDeskAccessoryIconResource = kGenericDeskAccessoryIconResource,
genericFolderIconResource = kGenericFolderIconResource,
privateFolderIconResource = kPrivateFolderIconResource,
floppyIconResource = kFloppyIconResource,
trashIconResource = kTrashIconResource,
genericRAMDiskIconResource = kGenericRAMDiskIconResource,
genericCDROMIconResource = kGenericCDROMIconResource,
desktopIconResource = kDesktopIconResource,
openFolderIconResource = kOpenFolderIconResource,
genericHardDiskIconResource = kGenericHardDiskIconResource,
genericFileServerIconResource = kGenericFileServerIconResource,
genericSuitcaseIconResource = kGenericSuitcaseIconResource,
genericMoverObjectIconResource = kGenericMoverObjectIconResource,
genericPreferencesIconResource = kGenericPreferencesIconResource,
genericQueryDocumentIconResource = kGenericQueryDocumentIconResource,
genericExtensionIconResource = kGenericExtensionIconResource,
systemFolderIconResource = kSystemFolderIconResource,
appleMenuFolderIconResource = kAppleMenuFolderIconResource
};
/* Avoid using icon resources if possible. Use IconServices instead. */
enum {
kStartupFolderIconResource = -3981,
kOwnedFolderIconResource = -3980,
kDropFolderIconResource = -3979,
kSharedFolderIconResource = -3978,
kMountedFolderIconResource = -3977,
kControlPanelFolderIconResource = -3976,
kPrintMonitorFolderIconResource = -3975,
kPreferencesFolderIconResource = -3974,
kExtensionsFolderIconResource = -3973,
kFontsFolderIconResource = -3968,
kFullTrashIconResource = -3984
};
/* Obsolete. Use named constants defined above. */
enum {
startupFolderIconResource = kStartupFolderIconResource,
ownedFolderIconResource = kOwnedFolderIconResource,
dropFolderIconResource = kDropFolderIconResource,
sharedFolderIconResource = kSharedFolderIconResource,
mountedFolderIconResource = kMountedFolderIconResource,
controlPanelFolderIconResource = kControlPanelFolderIconResource,
printMonitorFolderIconResource = kPrintMonitorFolderIconResource,
preferencesFolderIconResource = kPreferencesFolderIconResource,
extensionsFolderIconResource = kExtensionsFolderIconResource,
fontsFolderIconResource = kFontsFolderIconResource,
fullTrashIconResource = kFullTrashIconResource
};
/* IconRefs are 32-bit values identifying cached icon data. IconRef 0 is invalid.*/
typedef struct OpaqueIconRef* IconRef;
/*
IconServices is an efficient mechanism to share icon data amongst multiple
clients. It avoids duplication of data; it provides efficient caching,
releasing memory when the icon data is no longer needed; it can provide
the appropriate icon for any filesystem object; it can provide commonly
used icons (caution, note, help...); it is Appearance-savvy: the icons
are switched when appropriate.
IconServices refer to cached icon data using IconRef, a 32-bit opaque
value. IconRefs are reference counted. When there are no more "owners"
of an IconRef, the memory used by the icon bitmap is disposed of.
Two files of same type and creator with no custom icon will have the same IconRef.
Files with custom icons will have their own IconRef.
*/
/*
Use the special creator kSystemIconsCreator to get "standard" icons
that are not associated with a file, such as the help icon.
Note that all lowercase creators are reserved by Apple.
*/
enum {
kSystemIconsCreator = 'macs'
};
/*
Type of the predefined/generic icons. For example, the call:
err = GetIconRef(kOnSystemDisk, kSystemIconsCreator, kHelpIcon, &iconRef);
will retun in iconRef the IconRef for the standard help icon.
*/
/* Generic Finder icons */
enum {
kClipboardIcon = 'CLIP',
kClippingUnknownTypeIcon = 'clpu',
kClippingPictureTypeIcon = 'clpp',
kClippingTextTypeIcon = 'clpt',
kClippingSoundTypeIcon = 'clps',
kDesktopIcon = 'desk',
kFinderIcon = 'FNDR',
kComputerIcon = 'root',
kFontSuitcaseIcon = 'FFIL',
kFullTrashIcon = 'ftrh',
kGenericApplicationIcon = 'APPL',
kGenericCDROMIcon = 'cddr',
kGenericControlPanelIcon = 'APPC',
kGenericControlStripModuleIcon = 'sdev',
kGenericComponentIcon = 'thng',
kGenericDeskAccessoryIcon = 'APPD',
kGenericDocumentIcon = 'docu',
kGenericEditionFileIcon = 'edtf',
kGenericExtensionIcon = 'INIT',
kGenericFileServerIcon = 'srvr',
kGenericFontIcon = 'ffil',
kGenericFontScalerIcon = 'sclr',
kGenericFloppyIcon = 'flpy',
kGenericHardDiskIcon = 'hdsk',
kGenericIDiskIcon = 'idsk',
kGenericRemovableMediaIcon = 'rmov',
kGenericMoverObjectIcon = 'movr',
kGenericPCCardIcon = 'pcmc',
kGenericPreferencesIcon = 'pref',
kGenericQueryDocumentIcon = 'qery',
kGenericRAMDiskIcon = 'ramd',
kGenericSharedLibaryIcon = 'shlb',
kGenericStationeryIcon = 'sdoc',
kGenericSuitcaseIcon = 'suit',
kGenericURLIcon = 'gurl',
kGenericWORMIcon = 'worm',
kInternationalResourcesIcon = 'ifil',
kKeyboardLayoutIcon = 'kfil',
kSoundFileIcon = 'sfil',
kSystemSuitcaseIcon = 'zsys',
kTrashIcon = 'trsh',
kTrueTypeFontIcon = 'tfil',
kTrueTypeFlatFontIcon = 'sfnt',
kTrueTypeMultiFlatFontIcon = 'ttcf',
kUserIDiskIcon = 'udsk',
kUnknownFSObjectIcon = 'unfs',
kInternationResourcesIcon = kInternationalResourcesIcon /* old name*/
};
/* Internet locations */
enum {
kInternetLocationHTTPIcon = 'ilht',
kInternetLocationFTPIcon = 'ilft',
kInternetLocationAppleShareIcon = 'ilaf',
kInternetLocationAppleTalkZoneIcon = 'ilat',
kInternetLocationFileIcon = 'ilfi',
kInternetLocationMailIcon = 'ilma',
kInternetLocationNewsIcon = 'ilnw',
kInternetLocationNSLNeighborhoodIcon = 'ilns',
kInternetLocationGenericIcon = 'ilge'
};
/* Folders */
enum {
kGenericFolderIcon = 'fldr',
kDropFolderIcon = 'dbox',
kMountedFolderIcon = 'mntd',
kOpenFolderIcon = 'ofld',
kOwnedFolderIcon = 'ownd',
kPrivateFolderIcon = 'prvf',
kSharedFolderIcon = 'shfl'
};
/* Sharing Privileges icons */
enum {
kSharingPrivsNotApplicableIcon = 'shna',
kSharingPrivsReadOnlyIcon = 'shro',
kSharingPrivsReadWriteIcon = 'shrw',
kSharingPrivsUnknownIcon = 'shuk',
kSharingPrivsWritableIcon = 'writ'
};
/* Users and Groups icons */
enum {
kUserFolderIcon = 'ufld',
kWorkgroupFolderIcon = 'wfld',
kGuestUserIcon = 'gusr',
kUserIcon = 'user',
kOwnerIcon = 'susr',
kGroupIcon = 'grup'
};
/* Special folders */
enum {
kAppearanceFolderIcon = 'appr',
kAppleExtrasFolderIcon = 0x616578C4/*'aexÄ'*/,
kAppleMenuFolderIcon = 'amnu',
kApplicationsFolderIcon = 'apps',
kApplicationSupportFolderIcon = 'asup',
kAssistantsFolderIcon = 0x617374C4/*'astÄ'*/,
kColorSyncFolderIcon = 'prof',
kContextualMenuItemsFolderIcon = 'cmnu',
kControlPanelDisabledFolderIcon = 'ctrD',
kControlPanelFolderIcon = 'ctrl',
kControlStripModulesFolderIcon = 0x736476C4/*'sdvÄ'*/,
kDocumentsFolderIcon = 'docs',
kExtensionsDisabledFolderIcon = 'extD',
kExtensionsFolderIcon = 'extn',
kFavoritesFolderIcon = 'favs',
kFontsFolderIcon = 'font',
kHelpFolderIcon = (long)0xC4686C70/*'Ählp' */,
kInternetFolderIcon = 0x696E74C4/*'intÄ'*/,
kInternetPlugInFolderIcon = (long)0xC46E6574/*'Änet' */,
kInternetSearchSitesFolderIcon = 'issf',
kLocalesFolderIcon = (long)0xC46C6F63/*'Äloc' */,
kMacOSReadMeFolderIcon = 0x6D6F72C4/*'morÄ'*/,
kPublicFolderIcon = 'pubf',
kPreferencesFolderIcon = 0x707266C4/*'prfÄ'*/,
kPrinterDescriptionFolderIcon = 'ppdf',
kPrinterDriverFolderIcon = (long)0xC4707264/*'Äprd' */,
kPrintMonitorFolderIcon = 'prnt',
kRecentApplicationsFolderIcon = 'rapp',
kRecentDocumentsFolderIcon = 'rdoc',
kRecentServersFolderIcon = 'rsrv',
kScriptingAdditionsFolderIcon = (long)0xC4736372/*'Äscr' */,
kSharedLibrariesFolderIcon = (long)0xC46C6962/*'Älib' */,
kScriptsFolderIcon = 0x736372C4/*'scrÄ'*/,
kShutdownItemsDisabledFolderIcon = 'shdD',
kShutdownItemsFolderIcon = 'shdf',
kSpeakableItemsFolder = 'spki',
kStartupItemsDisabledFolderIcon = 'strD',
kStartupItemsFolderIcon = 'strt',
kSystemExtensionDisabledFolderIcon = 'macD',
kSystemFolderIcon = 'macs',
kTextEncodingsFolderIcon = (long)0xC4746578/*'Ätex' */,
kUsersFolderIcon = 0x757372C4/*'usrÄ'*/,
kUtilitiesFolderIcon = 0x757469C4/*'utiÄ'*/,
kVoicesFolderIcon = 'fvoc'
};
/* Badges */
enum {
kAppleScriptBadgeIcon = 'scrp',
kLockedBadgeIcon = 'lbdg',
kMountedBadgeIcon = 'mbdg',
kSharedBadgeIcon = 'sbdg',
kAliasBadgeIcon = 'abdg',
kAlertCautionBadgeIcon = 'cbdg'
};
/* Alert icons */
enum {
kAlertNoteIcon = 'note',
kAlertCautionIcon = 'caut',
kAlertStopIcon = 'stop'
};
/* Networking icons */
enum {
kAppleTalkIcon = 'atlk',
kAppleTalkZoneIcon = 'atzn',
kAFPServerIcon = 'afps',
kFTPServerIcon = 'ftps',
kHTTPServerIcon = 'htps',
kGenericNetworkIcon = 'gnet',
kIPFileServerIcon = 'isrv'
};
/* Toolbar icons */
enum {
kToolbarCustomizeIcon = 'tcus',
kToolbarDeleteIcon = 'tdel',
kToolbarFavoritesIcon = 'tfav',
kToolbarHomeIcon = 'thom'
};
/* Other icons */
enum {
kAppleLogoIcon = 'capl',
kAppleMenuIcon = 'sapl',
kBackwardArrowIcon = 'baro',
kFavoriteItemsIcon = 'favr',
kForwardArrowIcon = 'faro',
kGridIcon = 'grid',
kHelpIcon = 'help',
kKeepArrangedIcon = 'arng',
kLockedIcon = 'lock',
kNoFilesIcon = 'nfil',
kNoFolderIcon = 'nfld',
kNoWriteIcon = 'nwrt',
kProtectedApplicationFolderIcon = 'papp',
kProtectedSystemFolderIcon = 'psys',
kRecentItemsIcon = 'rcnt',
kShortcutIcon = 'shrt',
kSortAscendingIcon = 'asnd',
kSortDescendingIcon = 'dsnd',
kUnlockedIcon = 'ulck',
kConnectToIcon = 'cnct',
kGenericWindowIcon = 'gwin',
kQuestionMarkIcon = 'ques',
kDeleteAliasIcon = 'dali',
kEjectMediaIcon = 'ejec',
kBurningIcon = 'burn',
kRightContainerArrowIcon = 'rcar'
};
/* IconServicesUsageFlags */
typedef UInt32 IconServicesUsageFlags;
enum {
kIconServicesNormalUsageFlag = 0x00000000,
kIconServicesNoBadgeFlag = 0x00000001, /* available on Panther and later */
kIconServicesUpdateIfNeededFlag = 0x00000002 /* available on Panther and later */
};
/*
kIconServicesCatalogInfoMask - Minimal bitmask for use with
GetIconRefFromFileInfo(). Use this mask with FSGetCatalogInfo
before calling GetIconRefFromFileInfo(). Please note kFSCatInfoFinderXInfo flag is
valid only on MacOS X and must be cleared from CatalogInfoMask before
passing to GetIconRefFromFileInfo while running under MacOS 9 (or error will be returned)
*/
enum {
kIconServicesCatalogInfoMask = (kFSCatInfoNodeID | kFSCatInfoParentDirID | kFSCatInfoVolume | kFSCatInfoNodeFlags | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo | kFSCatInfoUserAccess | kFSCatInfoPermissions | kFSCatInfoContentMod)
};
/*
==============================================================================
Reference counting
==============================================================================
*/
/*
GetIconRefOwners
This routine returns the reference count for the IconRef, or number of owners.
A valid IconRef always has at least one owner.
*/
/*
* GetIconRefOwners()
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in IconServicesLib 8.5 and later
*/
extern OSErr
GetIconRefOwners(
IconRef theIconRef,
UInt16 * owners) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
/*
AcquireIconRef
This routine increments the reference count for the IconRef
*/
/*
* AcquireIconRef()
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in IconServicesLib 8.5 and later
*/
extern OSErr
AcquireIconRef(IconRef theIconRef) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
/*
ReleaseIconRef
This routine decrements the reference count for the IconRef.
When the reference count reaches 0, all memory allocated for the icon
is disposed. Any subsequent use of the IconRef is invalid.
*/
/*
* ReleaseIconRef()
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in IconServicesLib 8.5 and later
*/
extern OSErr
ReleaseIconRef(IconRef theIconRef) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
/*
==============================================================================
Getting an IconRef
==============================================================================
*/
/*
GetIconRefFromFile
This routine returns an icon ref for the specified file, folder or volume.
The label information is provided separately, since two files with the same icon
but a different label would share the same iconRef. The label can be used in
PlotIconRef() for example.
Use this routine if you have no information about the file system object. If
you have already done a GetCatInfo on the file and want to save some I/O,
call GetIconRefFromFolder() if you know it's a folder with no custom icon or
call GetIconRef() if it's a file with no custom icon.
This routine increments the reference count of the returned IconRef. Call
ReleaseIconRef() when you're done with it.
This call is deprecated. Please use GetIconRefFromFileInfo() instead.
*/
#if !__LP64__
/*
* GetIconRefFromFile() *** DEPRECATED ***
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in IconServicesLib 8.5 and later
*/
extern OSErr
GetIconRefFromFile(
const FSSpec * theFile,
IconRef * theIconRef,
SInt16 * theLabel) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
/*
GetIconRef
This routine returns an icon ref for an icon in the desktop database or
for a registered icon.
The system registers a set of icon such as the help icon with the creator
code kSystemIconsCreator. See above for a list of the registered system types.
The vRefNum is used as a hint on where to look for the icon first. Use
kOnSystemDisk if you don't know what to pass.
This routine increments the reference count of the returned IconRef. Call
ReleaseIconRef() when you're done with it.
*/
#endif /* !__LP64__ */
/*
* GetIconRef()
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in IconServicesLib 8.5 and later
*/
extern OSErr
GetIconRef(
SInt16 vRefNum,
OSType creator,
OSType iconType,
IconRef * theIconRef) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
/*
GetIconRefFromFolder
This routine returns an icon ref for a folder with no custom icon.
Use the more generic, but slightly slower, GetIconRefFromFile() if
you don't already have the necessary info about the file.
Attributes should be CInfoPBRec.dirInfo.ioFlAttrib for this folder.
Access privileges should be CInfoPBRec.dirInfo.ioACUser for this folder.
This routine increments the reference count of the IconRef. Call ReleaseIconRef()
when you're done with it.
*/
/*
* GetIconRefFromFolder()
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in IconServicesLib 8.5 and later
*/
extern OSErr
GetIconRefFromFolder(
SInt16 vRefNum,
SInt32 parentFolderID,
SInt32 folderID,
SInt8 attributes,
SInt8 accessPrivileges,
IconRef * theIconRef) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
/* GetIconRefFromFileInfo*/
/*
* GetIconRefFromFileInfo()
*
* Summary:
* This routine returns an IconRef for a file with minimal file I/O.
*
* Discussion:
* To minimize file operations, FSGetCatalogInfo should be called
* prior to calling this routine. The FSCatalogInfo should
* correspond to kIconServicesCatalogInfoMask The name should be
* fetched and passed in. If either the name or the correct catalog
* info is not passed in, this routine will do file operations for
* this information instead.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* inRef:
* An FSRef for the target file
*
* inFileNameLength:
* The length of the name of the target file
*
* inFileName:
* The name of the target file
*
* inWhichInfo:
* The mask of file info already acquired.
*
* inCatalogInfo:
* The catalog info already acquired.
*
* inUsageFlags:
* The usage flags for this call (use
* kIconServicesNormalUsageFlag).
*
* outIconRef:
* The output IconRef for the routine.
*
* outLabel:
* The output label for the icon/file.
*
* Availability:
* Mac OS X: in version 10.1 and later in ApplicationServices.framework
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
* Non-Carbon CFM: not available
*/
extern OSStatus
GetIconRefFromFileInfo(
const FSRef * inRef,
UniCharCount inFileNameLength,
const UniChar * inFileName, /* can be NULL */
FSCatalogInfoBitmap inWhichInfo,
const FSCatalogInfo * inCatalogInfo, /* can be NULL */
IconServicesUsageFlags inUsageFlags,
IconRef * outIconRef,
SInt16 * outLabel) /* can be NULL */ AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER;
/* GetIconRefFromTypeInfo*/
/*
* GetIconRefFromTypeInfo()
*
* Summary:
* Create an IconRef for a type information.
*
* Discussion:
* Creates IconRef based on provided type info. Any of the input
* parameters can be zero (meaning it is unknown). Returns generic
* document icon in case if all parameters are zeroes. Calling the
* routine with non zero inCreator and inType and zero inExtension
* and inMIMEType is equivalent to GetIconRef(kOnSystemDisk,
* inCreator, inType).
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inCreator:
* The creator.
*
* inType:
* The type.
*
* inExtension:
* The extension.
*
* inMIMEType:
* The MIME type.
*
* inUsageFlags:
* The usage flags for this call (use
* kIconServicesNormalUsageFlag).
*
* outIconRef:
* The output IconRef for the routine.
*
* Availability:
* Mac OS X: in version 10.3 and later in ApplicationServices.framework
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
*/
extern OSErr
GetIconRefFromTypeInfo(
OSType inCreator,
OSType inType,
CFStringRef inExtension,
CFStringRef inMIMEType,
IconServicesUsageFlags inUsageFlags,
IconRef * outIconRef) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
/* GetIconRefFromIconFamilyPtr*/
/*
* GetIconRefFromIconFamilyPtr()
*
* Summary:
* Create an IconRef for the IconFamilyPtr.
*
* Discussion:
* This routine creates IconRef for the IconFamilyPtr.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inIconFamilyPtr:
* The icon data
*
* inSize:
* The icon data size
*
* outIconRef:
* The output IconRef for the routine.
*
* Availability:
* Mac OS X: in version 10.3 and later in ApplicationServices.framework
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.3 and later
* Non-Carbon CFM: not available
*/
extern OSStatus
GetIconRefFromIconFamilyPtr(
const IconFamilyResource * inIconFamilyPtr,
Size inSize,
IconRef * outIconRef) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
/* GetIconRefFromComponent*/
/*
* GetIconRefFromComponent()
*
* Summary:
* Create an IconRef for the component.
*
* Discussion:
* Creates IconRef based on componentIconFamily field of component's
* 'thng' resource.. This routine increments the reference count of
* the IconRef. Call ReleaseIconRef() when you're done with it.
*
* Mac OS X threading:
* Thread safe since version 10.5
*
* Parameters:
*
* inComponent:
* A component identifier.
*
* outIconRef:
* The output IconRef for the routine.
*
* Availability:
* Mac OS X: in version 10.5 and later in ApplicationServices.framework
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.5 and later
* Non-Carbon CFM: not available
*/
extern OSStatus
GetIconRefFromComponent(
Component inComponent,
IconRef * outIconRef) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
/*
==============================================================================
Adding and modifying IconRef
==============================================================================
*/
/*
RegisterIconRefFromIconFamily
This routine adds a new entry to the IconRef registry. Other clients will be
able to access it using the (creator, iconType) pair specified here.
Lower-case creators are reserved for the system.
Consider using RegisterIconRefFromResource() if possible, since the data
registered using RegisterIconRefFromFamily() cannot be purged.
The iconFamily data is copied and the caller is reponsible for disposing of it.
This routine increments the reference count of the IconRef. Call ReleaseIconRef()
when you're done with it.
*/
/*
* RegisterIconRefFromIconFamily()
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in IconServicesLib 8.5 and later
*/
extern OSErr
RegisterIconRefFromIconFamily(
OSType creator,
OSType iconType,
IconFamilyHandle iconFamily,
IconRef * theIconRef) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
/*
RegisterIconRefFromResource
Registers an IconRef from a resouce file.
Lower-case creators are reserved for the system.
The icon data to be fetched is either classic icon data or an icon family.
The 'icns' icon family is searched for before the classic icon data.
This routine increments the reference count of the IconRef. Call ReleaseIconRef()
when you're done with it.
*/
#if !__LP64__
/*
* RegisterIconRefFromResource() *** DEPRECATED ***
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in IconServicesLib 8.5 and later
*/
extern OSErr
RegisterIconRefFromResource(
OSType creator,
OSType iconType,
const FSSpec * resourceFile,
SInt16 resourceID,
IconRef * theIconRef) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
/* RegisterIconRefFromFSRef*/
#endif /* !__LP64__ */
/*
* RegisterIconRefFromFSRef()
*
* Discussion:
* This routine registers an IconRef from a ".icns" file and
* associates it with a creator/type pair.
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Parameters:
*
* creator:
* The creator code for the icns file.
*
* iconType:
* The type code for the icns file
*
* iconFile:
* The FSRef of the icns file.
*
* theIconRef:
* The output IconRef for the routine.
*
* Availability:
* Mac OS X: in version 10.1 and later in ApplicationServices.framework
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.1 and later
* Non-Carbon CFM: not available
*/
extern OSStatus
RegisterIconRefFromFSRef(
OSType creator,
OSType iconType,
const FSRef * iconFile,
IconRef * theIconRef) AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER;
/*
UnregisterIconRef
Removes the specified icon from the icon cache (if there are no users of it).
If some clients are using this iconRef, then the IconRef will be removed when the
last user calls ReleaseIconRef.
*/
/*
* UnregisterIconRef()
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in IconServicesLib 8.5 and later
*/
extern OSErr
UnregisterIconRef(
OSType creator,
OSType iconType) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
/*
UpdateIconRef
Call this routine to force an update of the data for iconRef.
For example after changing an icon in the desktop database or changing the custom
icon of a file. Note that after _adding_ a custom icon to file or folder, you
need to call GetIconRefFromFile() to get a new IconRef specific to this file.
This routine does nothing if the IconRef is a registered icon.
*/
/*
* UpdateIconRef()
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in IconServicesLib 8.5 and later
*/
extern OSErr
UpdateIconRef(IconRef theIconRef) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
/*
OverrideIconRefFromResource
This routines replaces the bitmaps of the specified IconRef with the ones
in the specified resource file.
*/
#if !__LP64__
/*
* OverrideIconRefFromResource() *** DEPRECATED ***
*
* Mac OS X threading:
* Thread safe since version 10.2
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework [32-bit only] but deprecated in 10.5
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in IconServicesLib 8.5 and later
*/
extern OSErr
OverrideIconRefFromResource(
IconRef theIconRef,
const FSSpec * resourceFile,
SInt16 resourceID) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5;
/*
OverrideIconRef
This routines replaces the bitmaps of the specified IconRef with the ones
from the new IconRef.
*/
#endif /* !__LP64__ */
/*
* OverrideIconRef()
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in ApplicationServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in IconServicesLib 8.5 and later
*/
extern OSErr
OverrideIconRef(
IconRef oldIconRef,
IconRef newIconRef) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
/*
RemoveIconRefOverride
This routine remove an override if one was applied to the icon and