mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 20:50:44 +00:00
NSView: define layer-related properties
Define layer-related properties in NSView for compatibility purposes, and keep their getters and setters as stubs, since they will not have any effect before NSView-CALayer integration is implemented.
This commit is contained in:
parent
9e80b07531
commit
bb6805742d
2 changed files with 72 additions and 0 deletions
|
@ -72,6 +72,31 @@ enum _NSBorderType {
|
|||
};
|
||||
typedef NSUInteger NSBorderType;
|
||||
|
||||
typedef NSInteger NSViewLayerContentsRedrawPolicy;
|
||||
enum {
|
||||
NSViewLayerContentsRedrawNever = 0,
|
||||
NSViewLayerContentsRedrawOnSetNeedsDisplay = 1,
|
||||
NSViewLayerContentsRedrawDuringViewResize = 2,
|
||||
NSViewLayerContentsRedrawBeforeViewResize = 3,
|
||||
NSViewLayerContentsRedrawCrossfade = 4
|
||||
};
|
||||
|
||||
typedef NSInteger NSViewLayerContentsPlacement;
|
||||
enum {
|
||||
NSViewLayerContentsPlacementScaleAxesIndependently = 0,
|
||||
NSViewLayerContentsPlacementScaleProportionallyToFit = 1,
|
||||
NSViewLayerContentsPlacementScaleProportionallyToFill = 2,
|
||||
NSViewLayerContentsPlacementCenter = 3,
|
||||
NSViewLayerContentsPlacementTop = 4,
|
||||
NSViewLayerContentsPlacementTopRight = 5,
|
||||
NSViewLayerContentsPlacementRight = 6,
|
||||
NSViewLayerContentsPlacementBottomRight = 7,
|
||||
NSViewLayerContentsPlacementBottom = 8,
|
||||
NSViewLayerContentsPlacementBottomLeft = 9,
|
||||
NSViewLayerContentsPlacementLeft = 10,
|
||||
NSViewLayerContentsPlacementTopLeft = 11
|
||||
};
|
||||
|
||||
/*
|
||||
* autoresize constants which NSView uses in
|
||||
* determining the parts of a view which are
|
||||
|
@ -590,6 +615,19 @@ PACKAGE_SCOPE
|
|||
- (NSAttributedString *)pageHeader;
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
|
||||
#if GS_HAS_DECLARED_PROPERTIES
|
||||
@property (nonatomic) NSViewLayerContentsPlacement layerContentsPlacement;
|
||||
@property (nonatomic) NSViewLayerContentsRedrawPolicy layerContentsRedrawPolicy;
|
||||
#else
|
||||
- (NSViewLayerContentsPlacement) layerContentsPlacement;
|
||||
- (void) setLayerContentsPlacement: (NSViewLayerContentsPlacement)placement;
|
||||
|
||||
- (NSViewLayerContentsRedrawPolicy) layerContentsRedrawPolicy;
|
||||
- (void) setLayerContentsRedrawPolicy: (NSViewLayerContentsRedrawPolicy) pol;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
|
|
@ -5086,6 +5086,40 @@ static NSView* findByTag(NSView *view, NSInteger aTag, NSUInteger *level)
|
|||
}
|
||||
}
|
||||
|
||||
- (NSViewLayerContentsPlacement) layerContentsPlacement
|
||||
{
|
||||
// FIXME (when views have CALayer support)
|
||||
return NSViewLayerContentsPlacementScaleAxesIndependently;
|
||||
}
|
||||
|
||||
- (void) setLayerContentsPlacement: (NSViewLayerContentsPlacement)placement
|
||||
{
|
||||
// FIXME (when views have CALayer support)
|
||||
static BOOL logged = NO;
|
||||
if (!logged)
|
||||
{
|
||||
NSLog(@"warning: stub no-op implementation of -[NSView setLayerContentsPlacement:]");
|
||||
logged = YES;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSViewLayerContentsRedrawPolicy) layerContentsRedrawPolicy
|
||||
{
|
||||
// FIXME (when views have CALayer support)
|
||||
return NSViewLayerContentsRedrawNever;
|
||||
}
|
||||
|
||||
- (void) setLayerContentsRedrawPolicy: (NSViewLayerContentsRedrawPolicy) pol
|
||||
{
|
||||
// FIXME (when views have CALayer support)
|
||||
static BOOL logged = NO;
|
||||
if (!logged)
|
||||
{
|
||||
NSLog(@"warning: stub no-op implementation of -[NSView setLayerContentsRedrawPolicy:]");
|
||||
logged = YES;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSView(KeyViewLoop)
|
||||
|
|
Loading…
Reference in a new issue