Add shadow method to NSGraphicsContext and add set method to NSShadow

This commit is contained in:
Gregory John Casamento 2023-12-28 06:47:25 -05:00
parent 345b1b4065
commit 9fab419042
3 changed files with 16 additions and 1 deletions

View file

@ -49,6 +49,7 @@
@class NSSet;
@class NSBitmapImageRep;
@class NSGradient;
@class NSShadow;
typedef struct CGContext *CGContextRef;
@ -188,6 +189,7 @@ APPKIT_EXPORT_CLASS
void *_graphicsPort;
BOOL _isFlipped;
NSCompositingOperation _compositingOperation;
NSShadow *_shadow;
}
+ (BOOL) currentContextDrawingToScreen;
@ -268,6 +270,10 @@ APPKIT_EXPORT NSGraphicsContext *GSCurrentContext(void);
/* Private backend methods */
+ (void) handleExposeRect: (NSRect)rect forDriver: (void *)driver;
/* Private method for handling shadows */
- (void) setShadow: (NSShadow *)shadow;
@end
#endif

View file

@ -320,6 +320,7 @@ NSGraphicsContext *GSCurrentContext(void)
DESTROY(focus_stack);
DESTROY(context_data);
DESTROY(context_info);
DESTROY(_shadow);
[super dealloc];
}
@ -515,6 +516,12 @@ NSGraphicsContext *GSCurrentContext(void)
{
}
/* Private method for handling shadows */
- (void) setShadow: (NSShadow *)shadow
{
ASSIGN(_shadow, shadow);
}
@end
@implementation NSGraphicsContext (Private)

View file

@ -30,6 +30,7 @@
#import <Foundation/NSString.h>
#import "AppKit/NSShadow.h"
#import "AppKit/NSColor.h"
#import "AppKit/NSGraphicsContext.h"
@implementation NSShadow
@ -96,7 +97,8 @@
- (void) set
{
// FIXME: Implement
NSGraphicsContext *ctxt = GSCurrentContext();
[ctxt setShadow: self];
}
- (void) encodeWithCoder: (NSCoder*)aCoder