diff options
Diffstat (limited to 'src/nsterm.h')
| -rw-r--r-- | src/nsterm.h | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/src/nsterm.h b/src/nsterm.h index 0596f3f3c10..4c61a50ecb2 100644 --- a/src/nsterm.h +++ b/src/nsterm.h | |||
| @@ -348,16 +348,6 @@ typedef id instancetype; | |||
| 348 | #endif | 348 | #endif |
| 349 | 349 | ||
| 350 | 350 | ||
| 351 | /* macOS 10.14 and above cannot draw directly "to the glass" and | ||
| 352 | therefore we draw to an offscreen buffer and swap it in when the | ||
| 353 | toolkit wants to draw the frame. GNUstep and macOS 10.7 and below | ||
| 354 | do not support this method, so we revert to drawing directly to the | ||
| 355 | glass. */ | ||
| 356 | #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 101400 | ||
| 357 | #define NS_DRAW_TO_BUFFER 1 | ||
| 358 | #endif | ||
| 359 | |||
| 360 | |||
| 361 | /* ========================================================================== | 351 | /* ========================================================================== |
| 362 | 352 | ||
| 363 | NSColor, EmacsColor category. | 353 | NSColor, EmacsColor category. |
| @@ -423,7 +413,7 @@ typedef id instancetype; | |||
| 423 | ========================================================================== */ | 413 | ========================================================================== */ |
| 424 | 414 | ||
| 425 | @class EmacsToolbar; | 415 | @class EmacsToolbar; |
| 426 | @class EmacsSurface; | 416 | @class EmacsLayer; |
| 427 | 417 | ||
| 428 | #ifdef NS_IMPL_COCOA | 418 | #ifdef NS_IMPL_COCOA |
| 429 | @interface EmacsView : NSView <NSTextInput, NSWindowDelegate> | 419 | @interface EmacsView : NSView <NSTextInput, NSWindowDelegate> |
| @@ -444,9 +434,6 @@ typedef id instancetype; | |||
| 444 | NSWindow *nonfs_window; | 434 | NSWindow *nonfs_window; |
| 445 | BOOL fs_is_native; | 435 | BOOL fs_is_native; |
| 446 | BOOL in_fullscreen_transition; | 436 | BOOL in_fullscreen_transition; |
| 447 | #ifdef NS_DRAW_TO_BUFFER | ||
| 448 | EmacsSurface *surface; | ||
| 449 | #endif | ||
| 450 | @public | 437 | @public |
| 451 | struct frame *emacsframe; | 438 | struct frame *emacsframe; |
| 452 | int scrollbarsNeedingUpdate; | 439 | int scrollbarsNeedingUpdate; |
| @@ -486,9 +473,9 @@ typedef id instancetype; | |||
| 486 | #endif | 473 | #endif |
| 487 | - (int)fullscreenState; | 474 | - (int)fullscreenState; |
| 488 | 475 | ||
| 489 | #ifdef NS_DRAW_TO_BUFFER | 476 | #ifdef NS_IMPL_COCOA |
| 490 | - (void)focusOnDrawingBuffer; | 477 | - (void)lockFocus; |
| 491 | - (void)unfocusDrawingBuffer; | 478 | - (void)unlockFocus; |
| 492 | #endif | 479 | #endif |
| 493 | - (void)copyRect:(NSRect)srcRect to:(NSRect)dstRect; | 480 | - (void)copyRect:(NSRect)srcRect to:(NSRect)dstRect; |
| 494 | 481 | ||
| @@ -715,23 +702,17 @@ typedef id instancetype; | |||
| 715 | + (CGFloat)scrollerWidth; | 702 | + (CGFloat)scrollerWidth; |
| 716 | @end | 703 | @end |
| 717 | 704 | ||
| 718 | #ifdef NS_DRAW_TO_BUFFER | 705 | #ifdef NS_IMPL_COCOA |
| 719 | @interface EmacsSurface : NSObject | 706 | @interface EmacsLayer : CALayer |
| 720 | { | 707 | { |
| 721 | NSMutableArray *cache; | 708 | NSMutableArray *cache; |
| 722 | NSSize size; | ||
| 723 | CGColorSpaceRef colorSpace; | 709 | CGColorSpaceRef colorSpace; |
| 724 | IOSurfaceRef currentSurface; | 710 | IOSurfaceRef currentSurface; |
| 725 | IOSurfaceRef lastSurface; | ||
| 726 | CGContextRef context; | 711 | CGContextRef context; |
| 727 | CGFloat scale; | ||
| 728 | } | 712 | } |
| 729 | - (id) initWithSize: (NSSize)s ColorSpace: (CGColorSpaceRef)cs Scale: (CGFloat)scale; | 713 | - (id) initWithColorSpace: (CGColorSpaceRef)cs; |
| 730 | - (void) dealloc; | 714 | - (void) setColorSpace: (CGColorSpaceRef)cs; |
| 731 | - (NSSize) getSize; | ||
| 732 | - (CGContextRef) getContext; | 715 | - (CGContextRef) getContext; |
| 733 | - (void) releaseContext; | ||
| 734 | - (IOSurfaceRef) getSurface; | ||
| 735 | @end | 716 | @end |
| 736 | #endif | 717 | #endif |
| 737 | 718 | ||