Update _cocoalayer.mm

This commit is contained in:
annes 2025-12-02 00:06:53 +08:00 committed by GitHub
parent ebe7c22ce1
commit c468628564
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,7 +3,7 @@
#import <objc/runtime.h> #import <objc/runtime.h>
#include "_cocoalayer.h" #include "_cocoalayer.h"
// Example: make a global function you can call // Example: make a global function you can call
extern "C" void _cocoasetdockicon(unsigned char* data, int width, int height) extern "C" void CocoaSetDockIcon(unsigned char* data, int width, int height)
{ {
NSImage *dockIcon = [[NSImage alloc] initWithSize:NSMakeSize(width, height)]; NSImage *dockIcon = [[NSImage alloc] initWithSize:NSMakeSize(width, height)];
CGDataProviderRef provider = CGDataProviderCreateWithData(nullptr, data, width*height*4, nullptr); CGDataProviderRef provider = CGDataProviderCreateWithData(nullptr, data, width*height*4, nullptr);