21 #include "../../SDL_internal.h"
23 #if SDL_VIDEO_DRIVER_COCOA
25 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
26 # error SDL for Mac OS X must be built with a 10.7 SDK or above.
32 #include "../SDL_sysvideo.h"
33 #include "../../events/SDL_keyboard_c.h"
34 #include "../../events/SDL_mouse_c.h"
35 #include "../../events/SDL_touch_c.h"
36 #include "../../events/SDL_windowevents_c.h"
37 #include "../../events/SDL_dropevents_c.h"
47 #ifdef DEBUG_COCOAWINDOW
48 #define DLog(fmt, ...) printf("%s: " fmt "\n", __func__, ##__VA_ARGS__)
50 #define DLog(...) do { } while (0)
54 #define FULLSCREEN_MASK (SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_FULLSCREEN)
56 #ifndef MAC_OS_X_VERSION_10_12
57 #define NSEventModifierFlagCapsLock NSAlphaShiftKeyMask
59 #ifndef NSAppKitVersionNumber10_14
60 #define NSAppKitVersionNumber10_14 1671
63 @interface SDLWindow : NSWindow <NSDraggingDestination>
65 - (BOOL)canBecomeKeyWindow;
66 - (BOOL)canBecomeMainWindow;
67 - (
void)sendEvent:(NSEvent *)event;
68 - (
void)doCommandBySelector:(
SEL)aSelector;
71 - (NSDragOperation)draggingEntered:(
id <NSDraggingInfo>)sender;
72 - (BOOL)performDragOperation:(
id <NSDraggingInfo>)sender;
73 - (BOOL)wantsPeriodicDraggingUpdates;
74 - (BOOL)validateMenuItem:(NSMenuItem *)menuItem;
79 @implementation SDLWindow
81 - (BOOL)validateMenuItem:(NSMenuItem *)menuItem
86 if ([menuItem
action] ==
@selector(toggleFullScreen:)) {
96 return [
super validateMenuItem:menuItem];
99 - (BOOL)canBecomeKeyWindow
104 - (BOOL)canBecomeMainWindow
109 - (
void)sendEvent:(NSEvent *)event
111 [
super sendEvent:event];
113 if ([
event type] != NSEventTypeLeftMouseUp) {
117 id delegate = [
self delegate];
122 if ([delegate isMoving]) {
123 [delegate windowDidFinishMoving];
130 - (
void)doCommandBySelector:(
SEL)aSelector
135 - (NSDragOperation)draggingEntered:(
id <NSDraggingInfo>)sender
137 if (([sender draggingSourceOperationMask] & NSDragOperationGeneric) == NSDragOperationGeneric) {
138 return NSDragOperationGeneric;
141 return NSDragOperationNone;
144 - (BOOL)performDragOperation:(
id <NSDraggingInfo>)sender
147 NSPasteboard *pasteboard = [sender draggingPasteboard];
148 NSArray *
types = [NSArray arrayWithObject:NSFilenamesPboardType];
149 NSString *desiredType = [pasteboard availableTypeFromArray:types];
152 if (desiredType == nil) {
156 NSData *
data = [pasteboard dataForType:desiredType];
161 SDL_assert([desiredType isEqualToString:NSFilenamesPboardType]);
162 NSArray *
array = [pasteboard propertyListForType:@"NSFilenamesPboardType"];
165 NSURL *fileURL = [NSURL fileURLWithPath:path];
166 NSNumber *isAlias = nil;
168 [fileURL getResourceValue:&isAlias forKey:NSURLIsAliasFileKey error:nil];
171 if ([isAlias boolValue]) {
172 NSURLBookmarkResolutionOptions opts = NSURLBookmarkResolutionWithoutMounting | NSURLBookmarkResolutionWithoutUI;
173 NSData *bookmark = [NSURL bookmarkDataWithContentsOfURL:fileURL error:nil];
174 if (bookmark != nil) {
175 NSURL *resolvedURL = [NSURL URLByResolvingBookmarkData:bookmark
178 bookmarkDataIsStale:nil
181 if (resolvedURL != nil) {
182 fileURL = resolvedURL;
196 - (BOOL)wantsPeriodicDraggingUpdates
210 if (nswindow ==
self) {
224 static void ConvertNSRect(NSScreen *
screen, BOOL fullscreen, NSRect *
r)
226 r->origin.
y = CGDisplayPixelsHigh(kCGDirectMainDisplay) -
r->origin.
y -
r->
size.
height;
238 #pragma clang diagnostic push
239 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
242 NSOpenGLContext *currentContext = [NSOpenGLContext currentContext];
243 NSMutableArray *contexts =
data->nscontexts;
244 @
synchronized (contexts) {
245 for (SDLOpenGLContext *
context in contexts) {
246 if (
context == currentContext) {
249 [context scheduleUpdate];
255 #pragma clang diagnostic pop
261 GetHintCtrlClickEmulateRightClick()
269 NSUInteger style = 0;
272 style = NSWindowStyleMaskBorderless;
274 style = (NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable);
277 style |= NSWindowStyleMaskResizable;
285 NSUInteger style = 0;
288 style = NSWindowStyleMaskBorderless;
290 style = GetWindowWindowedStyle(
window);
302 if ([
data->sdlContentView nextResponder] ==
data->listener) {
303 [data->sdlContentView setNextResponder:nil];
306 [nswindow setStyleMask:style];
309 if ([
data->sdlContentView nextResponder] !=
data->listener) {
310 [data->sdlContentView setNextResponder:data->listener];
321 NSNotificationCenter *center;
323 NSView *view =
data->sdlContentView;
335 center = [NSNotificationCenter defaultCenter];
337 if ([
window delegate] != nil) {
338 [center addObserver:self selector:@selector(windowDidExpose:) name:NSWindowDidExposeNotification object:window];
339 [center addObserver:self selector:@selector(windowDidMove:) name:NSWindowDidMoveNotification object:window];
340 [center addObserver:self selector:@selector(windowDidResize:) name:NSWindowDidResizeNotification object:window];
341 [center addObserver:self selector:@selector(windowDidMiniaturize:) name:NSWindowDidMiniaturizeNotification object:window];
342 [center addObserver:self selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification object:window];
343 [center addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:window];
344 [center addObserver:self selector:@selector(windowDidResignKey:) name:NSWindowDidResignKeyNotification object:window];
345 [center addObserver:self selector:@selector(windowDidChangeBackingProperties:) name:NSWindowDidChangeBackingPropertiesNotification object:window];
346 [center addObserver:self selector:@selector(windowWillEnterFullScreen:) name:NSWindowWillEnterFullScreenNotification object:window];
347 [center addObserver:self selector:@selector(windowDidEnterFullScreen:) name:NSWindowDidEnterFullScreenNotification object:window];
348 [center addObserver:self selector:@selector(windowWillExitFullScreen:) name:NSWindowWillExitFullScreenNotification object:window];
349 [center addObserver:self selector:@selector(windowDidExitFullScreen:) name:NSWindowDidExitFullScreenNotification object:window];
350 [center addObserver:self selector:@selector(windowDidFailToEnterFullScreen:) name:@"NSWindowDidFailToEnterFullScreenNotification" object:window];
351 [center addObserver:self selector:@selector(windowDidFailToExitFullScreen:) name:@"NSWindowDidFailToExitFullScreenNotification" object:window];
353 [window setDelegate:self];
360 [window addObserver:self
361 forKeyPath:@"visible"
362 options:NSKeyValueObservingOptionNew
365 [window setNextResponder:self];
366 [window setAcceptsMouseMovedEvents:YES];
368 [view setNextResponder:self];
370 [view setAcceptsTouchEvents:YES];
373 - (
void)observeValueForKeyPath:(NSString *)keyPath
375 change:(NSDictionary *)change
376 context:(
void *)context
382 if (
object ==
_data->
nswindow && [keyPath isEqualToString:
@"visible"]) {
383 int newVisibility = [[change objectForKey:@"new"] intValue];
400 BOOL isVisible = [_data->nswindow isVisible];
413 -(BOOL) setFullscreenSpace:(BOOL) state
431 [
self addPendingWindowOperation:PENDING_OPERATION_ENTER_FULLSCREEN];
433 [
self addPendingWindowOperation:PENDING_OPERATION_LEAVE_FULLSCREEN];
440 [nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
441 [nswindow performSelectorOnMainThread: @selector(toggleFullScreen:) withObject:nswindow waitUntilDone:NO];
462 NSNotificationCenter *center;
464 NSView *view = [window contentView];
466 center = [NSNotificationCenter defaultCenter];
468 if ([
window delegate] !=
self) {
469 [center removeObserver:self name:NSWindowDidExposeNotification object:window];
470 [center removeObserver:self name:NSWindowDidMoveNotification object:window];
471 [center removeObserver:self name:NSWindowDidResizeNotification object:window];
472 [center removeObserver:self name:NSWindowDidMiniaturizeNotification object:window];
473 [center removeObserver:self name:NSWindowDidDeminiaturizeNotification object:window];
474 [center removeObserver:self name:NSWindowDidBecomeKeyNotification object:window];
475 [center removeObserver:self name:NSWindowDidResignKeyNotification object:window];
476 [center removeObserver:self name:NSWindowDidChangeBackingPropertiesNotification object:window];
477 [center removeObserver:self name:NSWindowWillEnterFullScreenNotification object:window];
478 [center removeObserver:self name:NSWindowDidEnterFullScreenNotification object:window];
479 [center removeObserver:self name:NSWindowWillExitFullScreenNotification object:window];
480 [center removeObserver:self name:NSWindowDidExitFullScreenNotification object:window];
481 [center removeObserver:self name:@"NSWindowDidFailToEnterFullScreenNotification" object:window];
482 [center removeObserver:self name:@"NSWindowDidFailToExitFullScreenNotification" object:window];
484 [window setDelegate:nil];
487 [window removeObserver:self forKeyPath:@"visible"];
489 if ([
window nextResponder] ==
self) {
490 [window setNextResponder:nil];
492 if ([view nextResponder] ==
self) {
493 [view setNextResponder:nil];
502 -(
void) setPendingMoveX:(
int)x Y:(
int)y
524 - (BOOL)windowShouldClose:(
id)sender
530 - (
void)windowDidExpose:(NSNotification *)aNotification
535 - (
void)windowWillMove:(NSNotification *)aNotification
543 - (
void)windowDidMove:(NSNotification *)aNotification
549 NSRect
rect = [nswindow contentRectForFrameRect:[nswindow frame]];
550 ConvertNSRect([nswindow
screen], fullscreen, &
rect);
566 ConvertNSRect([nswindow
screen], fullscreen, &
rect);
567 [nswindow setFrameOrigin:rect.origin];
575 ScheduleContextUpdates(
_data);
580 - (
void)windowDidResize:(NSNotification *)aNotification
590 NSRect
rect = [nswindow contentRectForFrameRect:[nswindow frame]];
595 h = (
int)
rect.size.height;
601 ScheduleContextUpdates(
_data);
608 const BOOL zoomed = [nswindow isZoomed];
616 - (
void)windowDidMiniaturize:(NSNotification *)aNotification
621 - (
void)windowDidDeminiaturize:(NSNotification *)aNotification
626 - (
void)windowDidBecomeKey:(NSNotification *)aNotification
644 point = [_data->nswindow mouseLocationOutsideOfEventStream];
657 [NSMenu setMenuBarVisible:NO];
665 - (
void)windowDidResignKey:(NSNotification *)aNotification
683 [NSMenu setMenuBarVisible:YES];
687 - (
void)windowDidChangeBackingProperties:(NSNotification *)aNotification
689 NSNumber *oldscale = [[aNotification userInfo] objectForKey:NSBackingPropertyOldScaleFactorKey];
695 if ([oldscale doubleValue] != [
_data->
nswindow backingScaleFactor]) {
699 [
self windowDidResize:aNotification];
703 - (
void)windowWillEnterFullScreen:(NSNotification *)aNotification
707 SetWindowStyle(
window, (NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable|NSWindowStyleMaskResizable));
713 - (
void)windowDidFailToEnterFullScreen:(NSNotification *)aNotification
717 if (
window->is_destroying) {
726 [
self windowDidExitFullScreen:nil];
729 - (
void)windowDidEnterFullScreen:(NSNotification *)aNotification
739 [
self setFullscreenSpace:NO];
744 SetWindowStyle(
window, [nswindow styleMask] & (~NSWindowStyleMaskResizable));
747 [NSMenu setMenuBarVisible:NO];
756 [
self windowDidMove:aNotification];
757 [
self windowDidResize:aNotification];
761 - (
void)windowWillExitFullScreen:(NSNotification *)aNotification
776 SetWindowStyle(
window, GetWindowWindowedStyle(
window) | NSWindowStyleMaskResizable);
779 - (
void)windowDidFailToExitFullScreen:(NSNotification *)aNotification
783 if (
window->is_destroying) {
787 SetWindowStyle(
window, (NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable|NSWindowStyleMaskResizable));
792 [
self windowDidEnterFullScreen:nil];
795 - (
void)windowDidExitFullScreen:(NSNotification *)aNotification
812 [nswindow setLevel:NSFloatingWindowLevel];
814 [nswindow setLevel:kCGNormalWindowLevel];
819 [
self setFullscreenSpace:YES];
822 [nswindow miniaturize:nil];
827 [nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
829 [nswindow setCollectionBehavior:NSWindowCollectionBehaviorManaged];
831 [NSMenu setMenuBarVisible:YES];
852 [nswindow setContentSize:rect.size];
853 [nswindow setFrameOrigin:rect.origin];
863 [
self windowDidMove:aNotification];
864 [
self windowDidResize:aNotification];
878 button = [nswindow standardWindowButton:NSWindowMiniaturizeButton];
889 -(NSApplicationPresentationOptions)
window:(NSWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions
892 return NSApplicationPresentationFullScreen | NSApplicationPresentationHideDock | NSApplicationPresentationHideMenuBar;
894 return proposedOptions;
902 - (
void)flagsChanged:(NSEvent *)theEvent
917 if (osenabled ^ sdlenabled) {
922 - (
void)keyDown:(NSEvent *)theEvent
926 - (
void)keyUp:(NSEvent *)theEvent
934 - (
void)doCommandBySelector:(
SEL)aSelector
939 - (BOOL)processHitTest:(NSEvent *)theEvent
944 const NSPoint
location = [theEvent locationInWindow];
950 [_data->nswindow setMovableByWindowBackground:YES];
958 [_data->nswindow setMovableByWindowBackground:NO];
965 - (
void)mouseDown:(NSEvent *)theEvent
978 NSRect windowRect = [[[theEvent window] contentView] frame];
979 if (!NSMouseInRect([theEvent locationInWindow], windowRect, NO)) {
984 if ([
self processHitTest:theEvent]) {
989 switch ([theEvent buttonNumber]) {
991 if (([theEvent modifierFlags] & NSEventModifierFlagControl) &&
992 GetHintCtrlClickEmulateRightClick()) {
1007 button = (
int) [theEvent buttonNumber] + 1;
1011 clicks = (
int) [theEvent clickCount];
1016 - (
void)rightMouseDown:(NSEvent *)theEvent
1018 [
self mouseDown:theEvent];
1021 - (
void)otherMouseDown:(NSEvent *)theEvent
1023 [
self mouseDown:theEvent];
1026 - (
void)mouseUp:(NSEvent *)theEvent
1037 if ([
self processHitTest:theEvent]) {
1042 switch ([theEvent buttonNumber]) {
1058 button = (
int) [theEvent buttonNumber] + 1;
1062 clicks = (
int) [theEvent clickCount];
1067 - (
void)rightMouseUp:(NSEvent *)theEvent
1069 [
self mouseUp:theEvent];
1072 - (
void)otherMouseUp:(NSEvent *)theEvent
1074 [
self mouseUp:theEvent];
1077 - (
void)mouseMoved:(NSEvent *)theEvent
1089 if ([
self processHitTest:theEvent]) {
1098 point = [theEvent locationInWindow];
1115 #if !SDL_MAC_NO_SANDBOX
1125 CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);
1126 CGAssociateMouseAndMouseCursorPosition(YES);
1136 - (
void)mouseDragged:(NSEvent *)theEvent
1138 [
self mouseMoved:theEvent];
1141 - (
void)rightMouseDragged:(NSEvent *)theEvent
1143 [
self mouseMoved:theEvent];
1146 - (
void)otherMouseDragged:(NSEvent *)theEvent
1148 [
self mouseMoved:theEvent];
1151 - (
void)scrollWheel:(NSEvent *)theEvent
1156 - (
void)touchesBeganWithEvent:(NSEvent *) theEvent
1162 NSSet *touches = [theEvent touchesMatchingPhase:NSTouchPhaseAny inView:nil];
1164 int existingTouchCount = 0;
1166 for (NSTouch* touch
in touches) {
1167 if ([touch phase] != NSTouchPhaseBegan) {
1168 existingTouchCount++;
1171 if (existingTouchCount == 0) {
1173 DLog(
"Reset Lost Fingers: %d", numFingers);
1174 for (--numFingers; numFingers >= 0; --numFingers) {
1186 DLog(
"Began Fingers: %lu .. existing: %d", (
unsigned long)[touches
count], existingTouchCount);
1187 [
self handleTouches:NSTouchPhaseBegan withEvent:theEvent];
1190 - (
void)touchesMovedWithEvent:(NSEvent *) theEvent
1192 [
self handleTouches:NSTouchPhaseMoved withEvent:theEvent];
1195 - (
void)touchesEndedWithEvent:(NSEvent *) theEvent
1197 [
self handleTouches:NSTouchPhaseEnded withEvent:theEvent];
1200 - (
void)touchesCancelledWithEvent:(NSEvent *) theEvent
1202 [
self handleTouches:NSTouchPhaseCancelled withEvent:theEvent];
1205 - (
void)handleTouches:(NSTouchPhase) phase withEvent:(NSEvent *) theEvent
1207 NSSet *touches = [theEvent touchesMatchingPhase:phase inView:nil];
1213 for (NSTouch *touch
in touches) {
1224 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 101202
1225 if ([touch respondsToSelector:
@selector(
type)]) {
1233 if ([touch
type] == NSTouchTypeDirect) {
1244 float x = [touch normalizedPosition].x;
1245 float y = [touch normalizedPosition].y;
1250 case NSTouchPhaseBegan:
1253 case NSTouchPhaseEnded:
1254 case NSTouchPhaseCancelled:
1257 case NSTouchPhaseMoved:
1268 @interface SDLView : NSView {
1275 - (
void)rightMouseDown:(NSEvent *)theEvent;
1276 - (BOOL)mouseDownCanMoveWindow;
1277 - (
void)drawRect:(NSRect)dirtyRect;
1278 - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent;
1279 - (BOOL)wantsUpdateLayer;
1280 - (
void)updateLayer;
1283 @implementation SDLView
1294 - (
void)drawRect:(NSRect)dirtyRect
1299 if ([NSGraphicsContext currentContext]) {
1300 [[NSColor blackColor] setFill];
1301 NSRectFill(dirtyRect);
1302 }
else if (
self.
layer) {
1303 self.layer.backgroundColor = CGColorGetConstantColor(kCGColorBlack);
1309 - (BOOL)wantsUpdateLayer
1320 self.layer.backgroundColor = CGColorGetConstantColor(kCGColorBlack);
1321 ScheduleContextUpdates((
SDL_WindowData *) _sdlWindow->driverdata);
1325 - (
void)rightMouseDown:(NSEvent *)theEvent
1327 [[
self nextResponder] rightMouseDown:theEvent];
1330 - (BOOL)mouseDownCanMoveWindow
1338 - (
void)resetCursorRects
1340 [
super resetCursorRects];
1344 [
self addCursorRect:[
self bounds]
1345 cursor:mouse->cur_cursor->driverdata];
1347 [
self addCursorRect:[
self bounds]
1348 cursor:[NSCursor invisibleCursor]];
1352 - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
1375 data->nswindow = nswindow;
1376 data->created = created;
1377 data->videodata = videodata;
1378 data->nscontexts = [[NSMutableArray alloc] init];
1379 data->sdlContentView = nsview;
1386 NSRect
rect = [nswindow contentRectForFrameRect:[nswindow frame]];
1395 [data->listener listen:data];
1397 if ([nswindow isVisible]) {
1404 unsigned long style = [nswindow styleMask];
1406 if (style == NSWindowStyleMaskBorderless) {
1411 if (style & NSWindowStyleMaskResizable) {
1425 if ([nswindow isMiniaturized]) {
1431 if ([nswindow isKeyWindow]) {
1439 [nswindow setOneShot:NO];
1456 NSArray *screens = [NSScreen screens];
1465 style = GetWindowStyle(
window);
1469 for (NSScreen *candidate
in screens) {
1470 NSRect screenRect = [candidate frame];
1471 if (
rect.origin.
x >= screenRect.origin.x &&
1472 rect.origin.
x < screenRect.origin.x + screenRect.size.width &&
1473 rect.origin.
y >= screenRect.origin.y &&
1474 rect.origin.
y < screenRect.origin.y + screenRect.size.height) {
1476 rect.origin.
x -= screenRect.origin.
x;
1477 rect.origin.
y -= screenRect.origin.
y;
1482 nswindow = [[SDLWindow alloc] initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:NO screen:screen];
1484 @catch (NSException *
e) {
1488 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 101200
1490 if ([nswindow respondsToSelector:
@selector(setTabbingMode:)]) {
1491 [nswindow setTabbingMode:NSWindowTabbingModeDisallowed];
1497 SDL_assert([nswindow respondsToSelector:
@selector(toggleFullScreen:)]);
1501 [nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
1506 [nswindow setLevel:NSFloatingWindowLevel];
1510 rect = [nswindow contentRectForFrameRect:[nswindow frame]];
1511 SDLView *contentView = [[SDLView alloc] initWithFrame:rect];
1512 [contentView setSDLWindow:window];
1516 #pragma clang diagnostic push
1517 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
1521 if ([contentView respondsToSelector:
@selector(setWantsBestResolutionOpenGLSurface:)]) {
1523 [contentView setWantsBestResolutionOpenGLSurface:highdpi];
1526 #pragma clang diagnostic pop
1529 #if SDL_VIDEO_OPENGL_ES2
1530 #if SDL_VIDEO_OPENGL_EGL
1533 [contentView setWantsLayer:TRUE];
1537 [nswindow setContentView:contentView];
1538 [contentView release];
1550 #if SDL_VIDEO_OPENGL_ES2
1552 #if SDL_VIDEO_OPENGL_EGL
1559 return SDL_SetError(
"Could not create GLES window surface (EGL support not configured)");
1570 NSView* nsview = nil;
1571 NSWindow *nswindow = nil;
1573 if ([(
id)
data isKindOfClass:[NSWindow
class]]) {
1574 nswindow = (NSWindow*)
data;
1575 nsview = [nswindow contentView];
1576 }
else if ([(
id)
data isKindOfClass:[NSView class]]) {
1577 nsview = (NSView*)
data;
1578 nswindow = [nsview window];
1586 title = [nswindow title];
1593 #pragma clang diagnostic push
1594 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
1598 if ([nsview respondsToSelector:
@selector(setWantsBestResolutionOpenGLSurface:)]) {
1600 [nsview setWantsBestResolutionOpenGLSurface:highdpi];
1603 #pragma clang diagnostic pop
1613 const char *title =
window->title ?
window->title :
"";
1615 NSString *
string = [[NSString alloc] initWithUTF8String:title];
1616 [nswindow setTitle:string];
1627 [NSApp setApplicationIconImage:nsimage];
1636 NSWindow *nswindow = windata->
nswindow;
1646 moveHack = s_moveHack;
1648 [nswindow setFrameOrigin:rect.origin];
1649 s_moveHack = moveHack;
1651 ScheduleContextUpdates(windata);
1659 NSWindow *nswindow = windata->
nswindow;
1673 moveHack = s_moveHack;
1675 [nswindow setFrame:[nswindow frameRectForContentRect:rect] display:YES];
1676 s_moveHack = moveHack;
1678 ScheduleContextUpdates(windata);
1689 minSize.height =
window->min_h;
1691 [windata->
nswindow setContentMinSize:minSize];
1702 maxSize.height =
window->max_h;
1704 [windata->
nswindow setContentMaxSize:maxSize];
1712 NSWindow *nswindow = windowData->
nswindow;
1714 if (![nswindow isMiniaturized]) {
1715 [windowData->listener pauseVisibleObservation];
1716 [nswindow makeKeyAndOrderFront:nil];
1717 [windowData->listener resumeVisibleObservation];
1727 [nswindow orderOut:nil];
1735 NSWindow *nswindow = windowData->
nswindow;
1740 [windowData->listener pauseVisibleObservation];
1741 if (![nswindow isMiniaturized] && [nswindow isVisible]) {
1742 [NSApp activateIgnoringOtherApps:YES];
1743 [nswindow makeKeyAndOrderFront:nil];
1745 [windowData->listener resumeVisibleObservation];
1753 NSWindow *nswindow = windata->
nswindow;
1755 [nswindow zoom:nil];
1757 ScheduleContextUpdates(windata);
1767 [data->listener addPendingWindowOperation:PENDING_OPERATION_MINIMIZE];
1769 [nswindow miniaturize:nil];
1779 if ([nswindow isMiniaturized]) {
1780 [nswindow deminiaturize:nil];
1782 [nswindow zoom:nil];
1821 if ([
data->sdlContentView nextResponder] ==
data->listener) {
1822 [data->sdlContentView setNextResponder:nil];
1829 rect.origin.
x = bounds.
x;
1830 rect.origin.
y = bounds.
y;
1831 rect.size.width = bounds.
w;
1832 rect.size.height = bounds.
h;
1833 ConvertNSRect([nswindow
screen], fullscreen, &
rect);
1838 if (
floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_14) {
1839 NSRect screenRect = [[nswindow screen] frame];
1840 if (screenRect.size.height >= 1.0f) {
1845 [nswindow setStyleMask:NSWindowStyleMaskBorderless];
1851 ConvertNSRect([nswindow
screen], fullscreen, &
rect);
1859 [nswindow setStyleMask:GetWindowWindowedStyle(window)];
1862 NSRect frameRect = [nswindow frame];
1863 [nswindow setFrame:NSMakeRect(frameRect.origin.x, frameRect.origin.y, frameRect.size.width + 1, frameRect.size.height) display:NO];
1864 [nswindow setFrame:frameRect display:NO];
1868 if ([
data->sdlContentView nextResponder] !=
data->listener) {
1869 [data->sdlContentView setNextResponder:data->listener];
1873 [nswindow setContentSize:rect.size];
1874 [nswindow setFrameOrigin:rect.origin];
1884 [nswindow setLevel:CGShieldingWindowLevel()];
1886 [nswindow setLevel:NSFloatingWindowLevel];
1888 [nswindow setLevel:kCGNormalWindowLevel];
1891 if ([nswindow isVisible] || fullscreen) {
1892 [data->listener pauseVisibleObservation];
1893 [nswindow makeKeyAndOrderFront:nil];
1894 [data->listener resumeVisibleObservation];
1897 ScheduleContextUpdates(
data);
1906 CGGammaValue redTable[tableSize];
1907 CGGammaValue greenTable[tableSize];
1908 CGGammaValue blueTable[tableSize];
1910 float inv65535 = 1.0f / 65535.0f;
1913 for (
i = 0;
i < 256;
i++) {
1914 redTable[i] = ramp[0*256+i] * inv65535;
1915 greenTable[i] = ramp[1*256+i] * inv65535;
1916 blueTable[i] = ramp[2*256+i] * inv65535;
1919 if (CGSetDisplayTransferByTable(
display_id, tableSize,
1920 redTable, greenTable, blueTable) != CGDisplayNoErr) {
1932 CGGammaValue redTable[tableSize];
1933 CGGammaValue greenTable[tableSize];
1934 CGGammaValue blueTable[tableSize];
1937 if (CGGetDisplayTransferByTable(
display_id, tableSize,
1938 redTable, greenTable, blueTable, &tableCopied) != CGDisplayNoErr) {
1942 for (
i = 0;
i < tableCopied;
i++) {
1943 ramp[0*256+i] = (
Uint16)(redTable[
i] * 65535.0
f);
1944 ramp[1*256+i] = (
Uint16)(greenTable[
i] * 65535.0
f);
1945 ramp[2*256+i] = (
Uint16)(blueTable[
i] * 65535.0
f);
1970 DLog(
"Returning cursor to (%g, %g)", cgpoint.x, cgpoint.y);
1971 CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);
1979 [data->nswindow setLevel:CGShieldingWindowLevel()];
1981 [data->nswindow setLevel:NSFloatingWindowLevel];
1983 [data->nswindow setLevel:kCGNormalWindowLevel];
1996 [NSMenu setMenuBarVisible:YES];
1998 [data->listener close];
1999 [data->listener release];
2000 if (
data->created) {
2002 [data->nswindow setContentView:nil];
2003 [data->nswindow close];
2006 NSArray *contexts = [[data->nscontexts copy] autorelease];
2007 for (SDLOpenGLContext *
context in contexts) {
2009 [context setWindow:NULL];
2011 [data->nscontexts release];
2028 SDL_SetError(
"Application not compiled with SDL %d.%d",
2053 if (
data->inWindowFullscreenTransition) {
2058 if ([
data->listener setFullscreenSpace:(
state ? YES : NO)]) {
2059 const int maxattempts = 3;
2061 while (++attempt <= maxattempts) {
2065 const int limit = 10000;
2078 if (![
data->listener setFullscreenSpace:(
state ? YES : NO)])
2100 [data->nswindow registerForDraggedTypes:[NSArray arrayWithObject:(NSString *)kUTTypeFileURL]];
2102 [data->nswindow unregisterDraggedTypes];
2110 [
data->nswindow setAlphaValue:opacity];
#define SDL_assert(condition)
void Cocoa_CheckClipboardUpdate(struct SDL_VideoData *data)
int Cocoa_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect)
void Cocoa_HandleMouseWarp(CGFloat x, CGFloat y)
void Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent *event)
void Cocoa_EnableMouseEventTap(SDL_MouseData *driverdata, SDL_bool enabled)
int Cocoa_ResizeWindowShape(SDL_Window *window)
#define NSEventSubtypeMouseEvent
NSImage * Cocoa_CreateImage(SDL_Surface *surface)
static const NSUInteger NSEventModifierFlagCapsLock
void Cocoa_SetWindowPosition(_THIS, SDL_Window *window)
int Cocoa_SetWindowOpacity(_THIS, SDL_Window *window, float opacity)
void Cocoa_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
void Cocoa_SetWindowGrab(_THIS, SDL_Window *window, SDL_bool grabbed)
void Cocoa_ShowWindow(_THIS, SDL_Window *window)
void Cocoa_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon)
int Cocoa_GetWindowGammaRamp(_THIS, SDL_Window *window, Uint16 *ramp)
int Cocoa_SetWindowHitTest(SDL_Window *window, SDL_bool enabled)
int Cocoa_CreateWindowFrom(_THIS, SDL_Window *window, const void *data)
void Cocoa_SetWindowSize(_THIS, SDL_Window *window)
@ PENDING_OPERATION_LEAVE_FULLSCREEN
@ PENDING_OPERATION_MINIMIZE
@ PENDING_OPERATION_ENTER_FULLSCREEN
void Cocoa_SetWindowMaximumSize(_THIS, SDL_Window *window)
void Cocoa_MaximizeWindow(_THIS, SDL_Window *window)
void Cocoa_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept)
void Cocoa_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered)
int Cocoa_SetWindowGammaRamp(_THIS, SDL_Window *window, const Uint16 *ramp)
void Cocoa_HideWindow(_THIS, SDL_Window *window)
void Cocoa_SetWindowMinimumSize(_THIS, SDL_Window *window)
void Cocoa_MinimizeWindow(_THIS, SDL_Window *window)
void Cocoa_DestroyWindow(_THIS, SDL_Window *window)
void Cocoa_RestoreWindow(_THIS, SDL_Window *window)
SDL_bool Cocoa_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
void Cocoa_RaiseWindow(_THIS, SDL_Window *window)
void Cocoa_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable)
int Cocoa_CreateWindow(_THIS, SDL_Window *window)
void Cocoa_SetWindowTitle(_THIS, SDL_Window *window)
int SDL_SendDropFile(SDL_Window *window, const char *file)
int SDL_SendDropComplete(SDL_Window *window)
#define SDL_GetMouseState
#define SDL_GetNumTouchFingers
#define SDL_GetKeyboardFocus
#define SDL_GetTouchFinger
#define SDL_GetMouseFocus
#define SDL_GetHintBoolean
#define SDL_IsShapedWindow
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 void
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 Uint32 * e
#define SDL_OutOfMemory()
#define SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH
Allow mouse click events when clicking to focus an SDL window.
#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK
A variable that determines whether ctrl+click should generate a right-click event on Mac.
void SDL_ToggleModState(const SDL_Keymod modstate, const SDL_bool toggle)
void SDL_SetKeyboardFocus(SDL_Window *window)
int SDL_SendKeyboardKey(Uint8 state, SDL_Scancode scancode)
SDL_Mouse * SDL_GetMouse(void)
int SDL_SendMouseButtonClicks(SDL_Window *window, SDL_MouseID mouseID, Uint8 state, Uint8 button, int clicks)
void SDL_SetMouseFocus(SDL_Window *window)
int SDL_SendMouseMotion(SDL_Window *window, SDL_MouseID mouseID, int relative, int x, int y)
#define SDL_BUTTON_MIDDLE
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLint GLint GLint GLint GLint x
GLint GLint GLsizei GLsizei height
GLuint GLuint GLsizei GLenum type
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLsizei GLenum GLenum * types
GLsizei const GLchar *const * path
GLenum GLuint GLint GLint layer
GLfloat GLfloat GLfloat GLfloat h
GLubyte GLubyte GLubyte GLubyte w
SDL_bool SDL_ShouldAllowTopmost(void)
SDL_VideoDevice * SDL_GetVideoDevice(void)
SDL_VideoDisplay * SDL_GetDisplayForWindow(SDL_Window *window)
Uint32 SDL_GetTicks(void)
Get the number of milliseconds since the SDL library initialization.
int SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window *window, SDL_bool down, float x, float y, float pressure)
int SDL_AddTouch(SDL_TouchID touchID, SDL_TouchDeviceType type, const char *name)
int SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window *window, float x, float y, float pressure)
#define SDL_MOUSE_TOUCHID
@ SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE
#define SDL_MINOR_VERSION
#define SDL_MAJOR_VERSION
static SDL_VideoDevice * _this
SDL_HitTestResult
Possible return values from the SDL_HitTest callback.
@ SDL_WINDOW_ALLOW_HIGHDPI
@ SDL_WINDOW_ALWAYS_ON_TOP
@ SDL_WINDOW_INPUT_GRABBED
@ SDL_WINDOW_FULLSCREEN_DESKTOP
@ SDL_WINDOWEVENT_RESIZED
@ SDL_WINDOWEVENT_HIT_TEST
@ SDL_WINDOWEVENT_MINIMIZED
@ SDL_WINDOWEVENT_MAXIMIZED
@ SDL_WINDOWEVENT_RESTORED
@ SDL_WINDOWEVENT_EXPOSED
@ SDL_GL_CONTEXT_PROFILE_ES
int SDL_SendWindowEvent(SDL_Window *window, Uint8 windowevent, int data1, int data2)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
EGLSurface EGLNativeWindowType * window
EGLNativeDisplayType * display_id
BOOL isInFullscreenSpace()
BOOL inFullscreenTransition
void windowDidFinishMoving()
PendingWindowOperation pendingWindowOperation
void pauseVisibleObservation()
BOOL isInFullscreenSpaceTransition()
void resumeVisibleObservation()
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst op &r &cond WK op &r &cond WK op &r &cond WK else op &m &cond &ia op &r &cond WK else op &m &cond &ia elseif elseif else error unsupported base if elseif elseif else error unsupported unaligned pixldst unaligned endm macro pixst base base else pixldst base endif endm macro PF base if bpp PF set rept prefetch_distance PF set OFFSET endr endif endm macro preload_leading_step2 base if bpp ifc DST PF PF else if bpp lsl PF PF lsl PF PF lsl PF PF PF else PF lsl PF lsl PF lsl PF endif SIZE macro preload_middle scratch_holds_offset if bpp if else PF PF endif endif endif endm macro preload_trailing base if bpp if bpp *pix_per_block PF PF lsl PF PF PF PF PF else PF lsl PF lsl PF PF PF PF PF base if bpp if narrow_case &&bpp<=dst_w_bpp) PF bic, WK0, base, #31 PF pld,[WK0] PF add, WK1, base, X, LSL #bpp_shift PF sub, WK1, WK1, #1 PF bic, WK1, WK1, #31 PF cmp, WK1, WK0 PF beq, 90f PF pld,[WK1]90:.else PF bic, WK0, base, #31 PF pld,[WK0] PF add, WK1, base, X, lsl #bpp_shift PF sub, WK1, WK1, #1 PF bic, WK1, WK1, #31 PF cmp, WK1, WK0 PF beq, 92f91:PF add, WK0, WK0, #32 PF cmp, WK0, WK1 PF pld,[WK0] PF bne, 91b92:.endif .endif.endm.macro conditional_process1_helper cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx process_head cond, numbytes, firstreg, unaligned_src, unaligned_mask, 0 .if decrementx sub &cond X, X, #8 *numbytes/dst_w_bpp .endif process_tail cond, numbytes, firstreg .if !((flags) &FLAG_PROCESS_DOES_STORE) pixst cond, numbytes, firstreg, DST .endif.endm.macro conditional_process1 cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx .if(flags) &FLAG_BRANCH_OVER .ifc cond, mi bpl 100f .endif .ifc cond, cs bcc 100f .endif .ifc cond, ne beq 100f .endif conditional_process1_helper, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx100:.else conditional_process1_helper cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx .endif.endm.macro conditional_process2 test, cond1, cond2, process_head, process_tail, numbytes1, numbytes2, firstreg1, firstreg2, unaligned_src, unaligned_mask, decrementx .if(flags) &(FLAG_DST_READWRITE|FLAG_BRANCH_OVER|FLAG_PROCESS_CORRUPTS_PSR|FLAG_PROCESS_DOES_STORE) test conditional_process1 cond1, process_head, process_tail, numbytes1, firstreg1, unaligned_src, unaligned_mask, decrementx .if(flags) &FLAG_PROCESS_CORRUPTS_PSR test .endif conditional_process1 cond2, process_head, process_tail, numbytes2, firstreg2, unaligned_src, unaligned_mask, decrementx .else test process_head cond1, numbytes1, firstreg1, unaligned_src, unaligned_mask, 0 process_head cond2, numbytes2, firstreg2, unaligned_src, unaligned_mask, 0 .if decrementx sub &cond1 X, X, #8 *numbytes1/dst_w_bpp sub &cond2 X, X, #8 *numbytes2/dst_w_bpp .endif process_tail cond1, numbytes1, firstreg1 process_tail cond2, numbytes2, firstreg2 pixst cond1, numbytes1, firstreg1, DST pixst cond2, numbytes2, firstreg2, DST .endif.endm.macro test_bits_1_0_ptr .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 movs SCRATCH, X, lsl #32-1 .else movs SCRATCH, WK0, lsl #32-1 .endif.endm.macro test_bits_3_2_ptr .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 movs SCRATCH, X, lsl #32-3 .else movs SCRATCH, WK0, lsl #32-3 .endif.endm.macro leading_15bytes process_head, process_tail .set DECREMENT_X, 1 .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 .set DECREMENT_X, 0 sub X, X, WK0, lsr #dst_bpp_shift str X,[sp, #LINE_SAVED_REG_COUNT *4] mov X, WK0 .endif .if dst_w_bpp==8 conditional_process2 test_bits_1_0_ptr, mi, cs, process_head, process_tail, 1, 2, 1, 2, 1, 1, DECREMENT_X .elseif dst_w_bpp==16 test_bits_1_0_ptr conditional_process1 cs, process_head, process_tail, 2, 2, 1, 1, DECREMENT_X .endif conditional_process2 test_bits_3_2_ptr, mi, cs, process_head, process_tail, 4, 8, 1, 2, 1, 1, DECREMENT_X .if(flags) &FLAG_PROCESS_CORRUPTS_WK0 ldr X,[sp, #LINE_SAVED_REG_COUNT *4] .endif.endm.macro test_bits_3_2_pix movs SCRATCH, X, lsl #dst_bpp_shift+32-3.endm.macro test_bits_1_0_pix .if dst_w_bpp==8 movs SCRATCH, X, lsl #dst_bpp_shift+32-1 .else movs SCRATCH, X, lsr #1 .endif.endm.macro trailing_15bytes process_head, process_tail, unaligned_src, unaligned_mask conditional_process2 test_bits_3_2_pix, cs, mi, process_head, process_tail, 8, 4, 0, 2, unaligned_src, unaligned_mask, 0 .if dst_w_bpp==16 test_bits_1_0_pix conditional_process1 cs, process_head, process_tail, 2, 0, unaligned_src, unaligned_mask, 0 .elseif dst_w_bpp==8 conditional_process2 test_bits_1_0_pix, cs, mi, process_head, process_tail, 2, 1, 0, 1, unaligned_src, unaligned_mask, 0 .endif.endm.macro wide_case_inner_loop process_head, process_tail, unaligned_src, unaligned_mask, dst_alignment110:.set SUBBLOCK, 0 .rept pix_per_block *dst_w_bpp/128 process_head, 16, 0, unaligned_src, unaligned_mask, 1 .if(src_bpp > 0) &&(mask_bpp==0) &&((flags) &FLAG_PROCESS_PRESERVES_SCRATCH) preload_middle src_bpp, SRC, 1 .elseif(src_bpp==0) &&(mask_bpp > 0) &&((flags) &FLAG_PROCESS_PRESERVES_SCRATCH) preload_middle mask_bpp, MASK, 1 .else preload_middle src_bpp, SRC, 0 preload_middle mask_bpp, MASK, 0 .endif .if(dst_r_bpp > 0) &&((SUBBLOCK % 2)==0) &&(((flags) &FLAG_NO_PRELOAD_DST)==0) PF pld,[DST, #32 *prefetch_distance - dst_alignment] .endif process_tail, 16, 0 .if !((flags) &FLAG_PROCESS_DOES_STORE) pixst, 16, 0, DST .endif .set SUBBLOCK, SUBBLOCK+1 .endr subs X, X, #pix_per_block bhs 110b.endm.macro wide_case_inner_loop_and_trailing_pixels process_head, process_tail, process_inner_loop, exit_label, unaligned_src, unaligned_mask .if dst_r_bpp > tst bne process_inner_loop DST_PRELOAD_BIAS endif preload_trailing SRC preload_trailing MASK DST endif add medium_case_inner_loop_and_trailing_pixels unaligned_mask endm macro medium_case_inner_loop_and_trailing_pixels DST endif subs bhs tst beq exit_label trailing_15bytes unaligned_mask endm macro narrow_case_inner_loop_and_trailing_pixels unaligned_mask tst conditional_process1 trailing_15bytes unaligned_mask endm macro switch_on_alignment action
int(* SetRelativeMouseMode)(SDL_bool enabled)
SDL_bool relative_mode_warp
int(* WarpMouseGlobal)(int x, int y)
The structure that defines a point (integer)
A rectangle, with the origin at the upper left (integer).
A collection of pixels used in software blitting.
union SDL_SysWMinfo::@10 info
unsigned int modifierFlags
struct SDL_VideoDevice::@440 gl_config
struct SDL_VideoData * videodata
The type used to identify a window.
static screen_context_t context
typedef int(__stdcall *FARPROC)()