| 26 * POSSIBILITY OF SUCH DAMAGE. |
26 * POSSIBILITY OF SUCH DAMAGE. |
| 27 */ |
27 */ |
| 28 |
28 |
| 29 #import "image.h" |
29 #import "image.h" |
| 30 |
30 |
| |
31 static NSDictionary *standardIconNames; |
| |
32 |
| |
33 void ui_icon_init(void) { |
| |
34 standardIconNames = @{ |
| |
35 @"NSImageNameActionTemplate": NSImageNameActionTemplate, |
| |
36 @"NSImageNameAddTemplate": NSImageNameAddTemplate, |
| |
37 @"NSImageNameAdvanced": NSImageNameAdvanced, |
| |
38 @"NSImageNameApplicationIcon": NSImageNameApplicationIcon, |
| |
39 @"NSImageNameBluetoothTemplate": NSImageNameBluetoothTemplate, |
| |
40 @"NSImageNameBonjour": NSImageNameBonjour, |
| |
41 @"NSImageNameBookmarksTemplate": NSImageNameBookmarksTemplate, |
| |
42 @"NSImageNameCaution": NSImageNameCaution, |
| |
43 // TODO |
| |
44 @"NSImageNameRefreshTemplate": NSImageNameRefreshTemplate, |
| |
45 @"NSImageNameFolder": NSImageNameFolder, |
| |
46 @"NSImageNameGoForwardTemplate": NSImageNameGoForwardTemplate, |
| |
47 @"NSImageNameGoBackTemplate": NSImageNameGoBackTemplate |
| |
48 }; |
| |
49 } |
| |
50 |
| |
51 NSImage* ui_cocoa_named_icon(const char *name) { |
| |
52 NSString *imageName = [[NSString alloc] initWithUTF8String:name]; |
| |
53 NSString *imgName = [standardIconNames objectForKey:imageName]; |
| |
54 if(imgName) { |
| |
55 imageName = imgName; |
| |
56 } |
| |
57 return [NSImage imageNamed:imageName]; |
| |
58 } |
| |
59 |
| 31 |
60 |
| 32 void ui_image_ref(UIIMAGE img) { |
61 void ui_image_ref(UIIMAGE img) { |
| 33 // TODO |
62 // TODO |
| 34 } |
63 } |
| 35 |
64 |