|
@@ -352,6 +352,7 @@ SetWindowStyle(SDL_Window * window, NSUInteger style)
|
|
[center addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:window];
|
|
[center addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:window];
|
|
[center addObserver:self selector:@selector(windowDidResignKey:) name:NSWindowDidResignKeyNotification object:window];
|
|
[center addObserver:self selector:@selector(windowDidResignKey:) name:NSWindowDidResignKeyNotification object:window];
|
|
[center addObserver:self selector:@selector(windowDidChangeBackingProperties:) name:NSWindowDidChangeBackingPropertiesNotification object:window];
|
|
[center addObserver:self selector:@selector(windowDidChangeBackingProperties:) name:NSWindowDidChangeBackingPropertiesNotification object:window];
|
|
|
|
+ [center addObserver:self selector:@selector(windowDidChangeScreenProfile:) name:NSWindowDidChangeScreenProfileNotification object:window];
|
|
[center addObserver:self selector:@selector(windowWillEnterFullScreen:) name:NSWindowWillEnterFullScreenNotification object:window];
|
|
[center addObserver:self selector:@selector(windowWillEnterFullScreen:) name:NSWindowWillEnterFullScreenNotification object:window];
|
|
[center addObserver:self selector:@selector(windowDidEnterFullScreen:) name:NSWindowDidEnterFullScreenNotification object:window];
|
|
[center addObserver:self selector:@selector(windowDidEnterFullScreen:) name:NSWindowDidEnterFullScreenNotification object:window];
|
|
[center addObserver:self selector:@selector(windowWillExitFullScreen:) name:NSWindowWillExitFullScreenNotification object:window];
|
|
[center addObserver:self selector:@selector(windowWillExitFullScreen:) name:NSWindowWillExitFullScreenNotification object:window];
|
|
@@ -483,6 +484,7 @@ SetWindowStyle(SDL_Window * window, NSUInteger style)
|
|
[center removeObserver:self name:NSWindowDidBecomeKeyNotification object:window];
|
|
[center removeObserver:self name:NSWindowDidBecomeKeyNotification object:window];
|
|
[center removeObserver:self name:NSWindowDidResignKeyNotification object:window];
|
|
[center removeObserver:self name:NSWindowDidResignKeyNotification object:window];
|
|
[center removeObserver:self name:NSWindowDidChangeBackingPropertiesNotification object:window];
|
|
[center removeObserver:self name:NSWindowDidChangeBackingPropertiesNotification object:window];
|
|
|
|
+ [center removeObserver:self name:NSWindowDidChangeScreenProfileNotification object:window];
|
|
[center removeObserver:self name:NSWindowWillEnterFullScreenNotification object:window];
|
|
[center removeObserver:self name:NSWindowWillEnterFullScreenNotification object:window];
|
|
[center removeObserver:self name:NSWindowDidEnterFullScreenNotification object:window];
|
|
[center removeObserver:self name:NSWindowDidEnterFullScreenNotification object:window];
|
|
[center removeObserver:self name:NSWindowWillExitFullScreenNotification object:window];
|
|
[center removeObserver:self name:NSWindowWillExitFullScreenNotification object:window];
|
|
@@ -750,6 +752,11 @@ SetWindowStyle(SDL_Window * window, NSUInteger style)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+- (void)windowDidChangeScreenProfile:(NSNotification *)aNotification
|
|
|
|
+{
|
|
|
|
+ SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_ICCPROF_CHANGED, 0, 0);
|
|
|
|
+}
|
|
|
|
+
|
|
- (void)windowWillEnterFullScreen:(NSNotification *)aNotification
|
|
- (void)windowWillEnterFullScreen:(NSNotification *)aNotification
|
|
{
|
|
{
|
|
SDL_Window *window = _data->window;
|
|
SDL_Window *window = _data->window;
|
|
@@ -1981,6 +1988,42 @@ Cocoa_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void*
|
|
|
|
+Cocoa_GetWindowICCProfile(_THIS, SDL_Window * window, size_t * size)
|
|
|
|
+{
|
|
|
|
+ SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
|
|
|
|
+ NSWindow *nswindow = data->nswindow;
|
|
|
|
+ NSScreen *screen = [nswindow screen];
|
|
|
|
+ NSData* iccProfileData = nil;
|
|
|
|
+ void* retIccProfileData = NULL;
|
|
|
|
+
|
|
|
|
+ if (screen == nil) {
|
|
|
|
+ SDL_SetError("Could not get screen of window.");
|
|
|
|
+ return NULL;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ([screen colorSpace] == nil) {
|
|
|
|
+ SDL_SetError("Could not get colorspace information of screen.");
|
|
|
|
+ return NULL;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ iccProfileData = [[screen colorSpace] ICCProfileData];
|
|
|
|
+ if (iccProfileData == nil) {
|
|
|
|
+ SDL_SetError("Could not get ICC profile data.");
|
|
|
|
+ return NULL;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ retIccProfileData = SDL_malloc([iccProfileData length]);
|
|
|
|
+ if (!retIccProfileData) {
|
|
|
|
+ SDL_OutOfMemory();
|
|
|
|
+ return NULL;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [iccProfileData getBytes:retIccProfileData length:[iccProfileData length]];
|
|
|
|
+ *size = [iccProfileData length];
|
|
|
|
+ return retIccProfileData;
|
|
|
|
+}
|
|
|
|
+
|
|
int
|
|
int
|
|
Cocoa_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp)
|
|
Cocoa_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp)
|
|
{
|
|
{
|