Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
#import <CoreUI/CUINamedImage.h>
#import <CoreUI/CUINamedVectorGlyph.h>
#import <CoreUI/CUINamedVectorImage.h>
#import <CoreUI/CUIStyleEffectConfiguration.h>
#import <CoreUI/CUITypes.h>
#import <Foundation/Foundation.h>
#import <TargetConditionals.h>

CUI_ASSUME_NONNULL_BEGIN

Expand Down Expand Up @@ -118,6 +120,15 @@ CUI_ASSUME_NONNULL_BEGIN
// MARK: - Utility

- (BOOL)containsLookupForName:(NSString *)name;
#if TARGET_OS_OSX
- (BOOL)hasCustomizedAppearanceForWidget:(NSString *)widget;
- (nullable CGColorRef)equivalentForegroundColorForStylePresetWithName:(nullable NSString *)name
styleConfiguration:(CUIStyleEffectConfiguration *)configuration
baseForegroundColor:(nullable CGColorRef)color CF_RETURNS_NOT_RETAINED;
- (nullable id)compositingFilterForStylePresetWithName:(nullable NSString *)name
styleConfiguration:(CUIStyleEffectConfiguration *)configuration
foregroundColor:(nullable CGColorRef)color;
#endif
- (NSArray<NSString *> *)appearanceNames;
- (nullable NSArray<NSString *> *)allImageNames;
- (void)clearCachedImageResources;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,34 @@
CUI_EXTERN_C_BEGIN
CUI_ASSUME_NONNULL_BEGIN

typedef struct CUIRenderer *CUIRendererRef;
typedef struct OpaqueCUIRendererRef *CUIRendererRef;

CUI_EXPORT const CFStringRef kCUIRendererThemeFileBundleIdentifierKey;
CUI_EXPORT const CFStringRef kCUIRendererThemeFileNameKey;
CUI_EXPORT const CFStringRef kCUIRendererDefaultBlendModeKey;

CUI_EXPORT const CFStringRef kCUIWidgetKey;
CUI_EXPORT const CFStringRef kCUIWidgetTitleBarCloseBox;
CUI_EXPORT const CFStringRef kCUIWidgetDisclosureTriangle;
CUI_EXPORT const CFStringRef kCUIWidgetOverlayScrollBar;
CUI_EXPORT const CFStringRef kCUIForegroundTintColor;
CUI_EXPORT const CFStringRef kCUIBezelTintColor;
CUI_EXPORT const CFStringRef kCUIColorTemperatureAdjustment;
CUI_EXPORT const CFStringRef kCUIBezelBrightnessMultiplier;
CUI_EXPORT const CFStringRef kCUITextGlyphBrightnessMultiplier;
CUI_EXPORT const CFStringRef kCUIScaleKey;
CUI_EXPORT const CFStringRef kCUIIsFlippedKey;
CUI_EXPORT const CFStringRef kCUIStateActive;
CUI_EXPORT const CFStringRef kCUIStateInactive;
CUI_EXPORT const CFStringRef kCUIStatePressed;
CUI_EXPORT const CFStringRef kCUIMeasureWidth;
CUI_EXPORT const CFStringRef kCUIMeasureHeight;
CUI_EXPORT const CFStringRef kCUIMeasureContentInsetTopRight;
CUI_EXPORT const CFStringRef kCUIMeasureContentInsetBottomLeft;
CUI_EXPORT const CFStringRef kCUIMeasureEdgeInsetTopRight;
CUI_EXPORT const CFStringRef kCUIMeasureEdgeInsetBottomLeft;
CUI_EXPORT const CFStringRef kCUIMeasureBaseline;
CUI_EXPORT const CFStringRef kCUIMeasureBlendMode;

CUI_EXPORT CUIRendererRef _Nullable CUICreateRenderer(CFDictionaryRef options);
CUI_EXPORT void CUIRendererCopyProperties(CUIRendererRef renderer,
Expand All @@ -30,6 +54,24 @@ CUI_EXPORT CGColorRef _Nullable CUICopyCustomColorWithOptions(CUIRendererRef ren
CFStringRef name,
CFDictionaryRef options) CF_RETURNS_RETAINED;

CUI_EXPORT int32_t CUIDraw(CUIRendererRef _Nullable renderer,
CGRect bounds,
CGContextRef context,
CFDictionaryRef options,
CFDictionaryRef _Nullable * _Nullable result);
CUI_EXPORT int32_t CUICreateLayerContents(CUIRendererRef renderer,
CFDictionaryRef options,
CGImageRef _Nullable * _Nonnull image,
CGRect *contentsCenter);
CUI_EXPORT int32_t CUICopyMeasurements(CUIRendererRef renderer,
CGRect bounds,
CGContextRef _Nullable context,
CFDictionaryRef options,
CFArrayRef keys,
CFDictionaryRef _Nullable * _Nonnull measurements);
CUI_EXPORT uint32_t CUICurrentPlatform(void);
CUI_EXPORT uint32_t CUIMaxScaleForTargetPlatform(uint32_t platform);

CUI_ASSUME_NONNULL_END
CUI_EXTERN_C_END

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
//
// CUIStyleEffectConfiguration.h
// CoreUI
//
// Audited for 918.3
// Status: WIP

#ifndef CUIStyleEffectConfiguration_h
#define CUIStyleEffectConfiguration_h

#import <CoreUI/CUIBase.h>
#import <Foundation/Foundation.h>
#import <TargetConditionals.h>

#if TARGET_OS_OSX

CUI_ASSUME_NONNULL_BEGIN

CUI_EXPORT const CFStringRef kCUIBackgroundTypeLight;
CUI_EXPORT const CFStringRef kCUIBackgroundTypeDark;
CUI_EXPORT const CFStringRef kCUIBackgroundTypeBorderless;
CUI_EXPORT const CFStringRef kCUIBackgroundTypeSourceList;
CUI_EXPORT const CFStringRef kCUIBackgroundTypeSelection;

typedef CUI_ENUM(NSInteger, CoreThemeState) {
kCoreThemeStateNormal = 0,
kCoreThemeStateRollover = 1,
kCoreThemeStatePressed = 2,
obsolete_kCoreThemeStateInactive CUI_SWIFT_NAME(CoreThemeState.obsoleteInactive) = 3,
kCoreThemeStateDisabled = 4,
kCoreThemeStateDeeplyPressed = 5,
};

typedef CUI_ENUM(NSInteger, CoreThemePresentationState) {
kCoreThemePresentationStateActive = 0,
kCoreThemePresentationStateInactive = 1,
kCoreThemePresentationStateActiveMain = 2,
};

typedef CUI_ENUM(NSInteger, CoreThemeValue) {
kCoreThemeValueOff = 0,
kCoreThemeValueOn = 1,
kCoreThemeValueMixed = 2,
};

@interface CUIStyleEffectConfiguration : NSObject <NSCopying>
@property (nonatomic) CoreThemeState state;
@property (nonatomic) CoreThemePresentationState presentationState;
@property (nonatomic) CoreThemeValue value;
@property (nonatomic) CGFloat effectScale;
@property (nonatomic) BOOL useSimplifiedEffect;
@property (nonatomic) BOOL foregroundColorShouldTintEffects;
@property (nonatomic) double brightnessMultiplier;
@property (nonatomic) NSUInteger colorTemperature;
@end

@interface CUIBackgroundStyleEffectConfiguration : CUIStyleEffectConfiguration
@property (nonatomic, copy) NSString *backgroundType;
@property (nonatomic) BOOL shouldRespectOutputBlending;
- (void)setSelectionType:(NSInteger)selectionType;
@end

CUI_ASSUME_NONNULL_END

#endif /* TARGET_OS_OSX */
#endif /* CUIStyleEffectConfiguration_h */
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
#import <CoreUI/CUINamedImage.h>
#import <CoreUI/CUINamedVectorGlyph.h>
#import <CoreUI/CUINamedVectorImage.h>
#import <CoreUI/CUIStyleEffectConfiguration.h>
#import <CoreUI/CUITypes.h>
#import <Foundation/Foundation.h>
#import <TargetConditionals.h>

CUI_ASSUME_NONNULL_BEGIN

Expand Down Expand Up @@ -118,6 +120,15 @@ CUI_ASSUME_NONNULL_BEGIN
// MARK: - Utility

- (BOOL)containsLookupForName:(NSString *)name;
#if TARGET_OS_OSX
- (BOOL)hasCustomizedAppearanceForWidget:(NSString *)widget;
- (nullable CGColorRef)equivalentForegroundColorForStylePresetWithName:(nullable NSString *)name
styleConfiguration:(CUIStyleEffectConfiguration *)configuration
baseForegroundColor:(nullable CGColorRef)color CF_RETURNS_NOT_RETAINED;
- (nullable id)compositingFilterForStylePresetWithName:(nullable NSString *)name
styleConfiguration:(CUIStyleEffectConfiguration *)configuration
foregroundColor:(nullable CGColorRef)color;
#endif
- (NSArray<NSString *> *)appearanceNames;
- (nullable NSArray<NSString *> *)allImageNames;
- (void)clearCachedImageResources;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,34 @@
CUI_EXTERN_C_BEGIN
CUI_ASSUME_NONNULL_BEGIN

typedef struct CUIRenderer *CUIRendererRef;
typedef struct OpaqueCUIRendererRef *CUIRendererRef;

CUI_EXPORT const CFStringRef kCUIRendererThemeFileBundleIdentifierKey;
CUI_EXPORT const CFStringRef kCUIRendererThemeFileNameKey;
CUI_EXPORT const CFStringRef kCUIRendererDefaultBlendModeKey;

CUI_EXPORT const CFStringRef kCUIWidgetKey;
CUI_EXPORT const CFStringRef kCUIWidgetTitleBarCloseBox;
CUI_EXPORT const CFStringRef kCUIWidgetDisclosureTriangle;
CUI_EXPORT const CFStringRef kCUIWidgetOverlayScrollBar;
CUI_EXPORT const CFStringRef kCUIForegroundTintColor;
CUI_EXPORT const CFStringRef kCUIBezelTintColor;
CUI_EXPORT const CFStringRef kCUIColorTemperatureAdjustment;
CUI_EXPORT const CFStringRef kCUIBezelBrightnessMultiplier;
CUI_EXPORT const CFStringRef kCUITextGlyphBrightnessMultiplier;
CUI_EXPORT const CFStringRef kCUIScaleKey;
CUI_EXPORT const CFStringRef kCUIIsFlippedKey;
CUI_EXPORT const CFStringRef kCUIStateActive;
CUI_EXPORT const CFStringRef kCUIStateInactive;
CUI_EXPORT const CFStringRef kCUIStatePressed;
CUI_EXPORT const CFStringRef kCUIMeasureWidth;
CUI_EXPORT const CFStringRef kCUIMeasureHeight;
CUI_EXPORT const CFStringRef kCUIMeasureContentInsetTopRight;
CUI_EXPORT const CFStringRef kCUIMeasureContentInsetBottomLeft;
CUI_EXPORT const CFStringRef kCUIMeasureEdgeInsetTopRight;
CUI_EXPORT const CFStringRef kCUIMeasureEdgeInsetBottomLeft;
CUI_EXPORT const CFStringRef kCUIMeasureBaseline;
CUI_EXPORT const CFStringRef kCUIMeasureBlendMode;

CUI_EXPORT CUIRendererRef _Nullable CUICreateRenderer(CFDictionaryRef options);
CUI_EXPORT void CUIRendererCopyProperties(CUIRendererRef renderer,
Expand All @@ -30,6 +54,24 @@ CUI_EXPORT CGColorRef _Nullable CUICopyCustomColorWithOptions(CUIRendererRef ren
CFStringRef name,
CFDictionaryRef options) CF_RETURNS_RETAINED;

CUI_EXPORT int32_t CUIDraw(CUIRendererRef _Nullable renderer,
CGRect bounds,
CGContextRef context,
CFDictionaryRef options,
CFDictionaryRef _Nullable * _Nullable result);
CUI_EXPORT int32_t CUICreateLayerContents(CUIRendererRef renderer,
CFDictionaryRef options,
CGImageRef _Nullable * _Nonnull image,
CGRect *contentsCenter);
CUI_EXPORT int32_t CUICopyMeasurements(CUIRendererRef renderer,
CGRect bounds,
CGContextRef _Nullable context,
CFDictionaryRef options,
CFArrayRef keys,
CFDictionaryRef _Nullable * _Nonnull measurements);
CUI_EXPORT uint32_t CUICurrentPlatform(void);
CUI_EXPORT uint32_t CUIMaxScaleForTargetPlatform(uint32_t platform);

CUI_ASSUME_NONNULL_END
CUI_EXTERN_C_END

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
//
// CUIStyleEffectConfiguration.h
// CoreUI
//
// Audited for 918.3
// Status: WIP

#ifndef CUIStyleEffectConfiguration_h
#define CUIStyleEffectConfiguration_h

#import <CoreUI/CUIBase.h>
#import <Foundation/Foundation.h>
#import <TargetConditionals.h>

#if TARGET_OS_OSX

CUI_ASSUME_NONNULL_BEGIN

CUI_EXPORT const CFStringRef kCUIBackgroundTypeLight;
CUI_EXPORT const CFStringRef kCUIBackgroundTypeDark;
CUI_EXPORT const CFStringRef kCUIBackgroundTypeBorderless;
CUI_EXPORT const CFStringRef kCUIBackgroundTypeSourceList;
CUI_EXPORT const CFStringRef kCUIBackgroundTypeSelection;

typedef CUI_ENUM(NSInteger, CoreThemeState) {
kCoreThemeStateNormal = 0,
kCoreThemeStateRollover = 1,
kCoreThemeStatePressed = 2,
obsolete_kCoreThemeStateInactive CUI_SWIFT_NAME(CoreThemeState.obsoleteInactive) = 3,
kCoreThemeStateDisabled = 4,
kCoreThemeStateDeeplyPressed = 5,
};

typedef CUI_ENUM(NSInteger, CoreThemePresentationState) {
kCoreThemePresentationStateActive = 0,
kCoreThemePresentationStateInactive = 1,
kCoreThemePresentationStateActiveMain = 2,
};

typedef CUI_ENUM(NSInteger, CoreThemeValue) {
kCoreThemeValueOff = 0,
kCoreThemeValueOn = 1,
kCoreThemeValueMixed = 2,
};

@interface CUIStyleEffectConfiguration : NSObject <NSCopying>
@property (nonatomic) CoreThemeState state;
@property (nonatomic) CoreThemePresentationState presentationState;
@property (nonatomic) CoreThemeValue value;
@property (nonatomic) CGFloat effectScale;
@property (nonatomic) BOOL useSimplifiedEffect;
@property (nonatomic) BOOL foregroundColorShouldTintEffects;
@property (nonatomic) double brightnessMultiplier;
@property (nonatomic) NSUInteger colorTemperature;
@end

@interface CUIBackgroundStyleEffectConfiguration : CUIStyleEffectConfiguration
@property (nonatomic, copy) NSString *backgroundType;
@property (nonatomic) BOOL shouldRespectOutputBlending;
- (void)setSelectionType:(NSInteger)selectionType;
@end

CUI_ASSUME_NONNULL_END

#endif /* TARGET_OS_OSX */
#endif /* CUIStyleEffectConfiguration_h */
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
#import <CoreUI/CUINamedImage.h>
#import <CoreUI/CUINamedVectorGlyph.h>
#import <CoreUI/CUINamedVectorImage.h>
#import <CoreUI/CUIStyleEffectConfiguration.h>
#import <CoreUI/CUITypes.h>
#import <Foundation/Foundation.h>
#import <TargetConditionals.h>

CUI_ASSUME_NONNULL_BEGIN

Expand Down Expand Up @@ -118,6 +120,15 @@ CUI_ASSUME_NONNULL_BEGIN
// MARK: - Utility

- (BOOL)containsLookupForName:(NSString *)name;
#if TARGET_OS_OSX
- (BOOL)hasCustomizedAppearanceForWidget:(NSString *)widget;
- (nullable CGColorRef)equivalentForegroundColorForStylePresetWithName:(nullable NSString *)name
styleConfiguration:(CUIStyleEffectConfiguration *)configuration
baseForegroundColor:(nullable CGColorRef)color CF_RETURNS_NOT_RETAINED;
- (nullable id)compositingFilterForStylePresetWithName:(nullable NSString *)name
styleConfiguration:(CUIStyleEffectConfiguration *)configuration
foregroundColor:(nullable CGColorRef)color;
#endif
- (NSArray<NSString *> *)appearanceNames;
- (nullable NSArray<NSString *> *)allImageNames;
- (void)clearCachedImageResources;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,34 @@
CUI_EXTERN_C_BEGIN
CUI_ASSUME_NONNULL_BEGIN

typedef struct CUIRenderer *CUIRendererRef;
typedef struct OpaqueCUIRendererRef *CUIRendererRef;

CUI_EXPORT const CFStringRef kCUIRendererThemeFileBundleIdentifierKey;
CUI_EXPORT const CFStringRef kCUIRendererThemeFileNameKey;
CUI_EXPORT const CFStringRef kCUIRendererDefaultBlendModeKey;

CUI_EXPORT const CFStringRef kCUIWidgetKey;
CUI_EXPORT const CFStringRef kCUIWidgetTitleBarCloseBox;
CUI_EXPORT const CFStringRef kCUIWidgetDisclosureTriangle;
CUI_EXPORT const CFStringRef kCUIWidgetOverlayScrollBar;
CUI_EXPORT const CFStringRef kCUIForegroundTintColor;
CUI_EXPORT const CFStringRef kCUIBezelTintColor;
CUI_EXPORT const CFStringRef kCUIColorTemperatureAdjustment;
CUI_EXPORT const CFStringRef kCUIBezelBrightnessMultiplier;
CUI_EXPORT const CFStringRef kCUITextGlyphBrightnessMultiplier;
CUI_EXPORT const CFStringRef kCUIScaleKey;
CUI_EXPORT const CFStringRef kCUIIsFlippedKey;
CUI_EXPORT const CFStringRef kCUIStateActive;
CUI_EXPORT const CFStringRef kCUIStateInactive;
CUI_EXPORT const CFStringRef kCUIStatePressed;
CUI_EXPORT const CFStringRef kCUIMeasureWidth;
CUI_EXPORT const CFStringRef kCUIMeasureHeight;
CUI_EXPORT const CFStringRef kCUIMeasureContentInsetTopRight;
CUI_EXPORT const CFStringRef kCUIMeasureContentInsetBottomLeft;
CUI_EXPORT const CFStringRef kCUIMeasureEdgeInsetTopRight;
CUI_EXPORT const CFStringRef kCUIMeasureEdgeInsetBottomLeft;
CUI_EXPORT const CFStringRef kCUIMeasureBaseline;
CUI_EXPORT const CFStringRef kCUIMeasureBlendMode;

CUI_EXPORT CUIRendererRef _Nullable CUICreateRenderer(CFDictionaryRef options);
CUI_EXPORT void CUIRendererCopyProperties(CUIRendererRef renderer,
Expand All @@ -30,6 +54,24 @@ CUI_EXPORT CGColorRef _Nullable CUICopyCustomColorWithOptions(CUIRendererRef ren
CFStringRef name,
CFDictionaryRef options) CF_RETURNS_RETAINED;

CUI_EXPORT int32_t CUIDraw(CUIRendererRef _Nullable renderer,
CGRect bounds,
CGContextRef context,
CFDictionaryRef options,
CFDictionaryRef _Nullable * _Nullable result);
CUI_EXPORT int32_t CUICreateLayerContents(CUIRendererRef renderer,
CFDictionaryRef options,
CGImageRef _Nullable * _Nonnull image,
CGRect *contentsCenter);
CUI_EXPORT int32_t CUICopyMeasurements(CUIRendererRef renderer,
CGRect bounds,
CGContextRef _Nullable context,
CFDictionaryRef options,
CFArrayRef keys,
CFDictionaryRef _Nullable * _Nonnull measurements);
CUI_EXPORT uint32_t CUICurrentPlatform(void);
CUI_EXPORT uint32_t CUIMaxScaleForTargetPlatform(uint32_t platform);

CUI_ASSUME_NONNULL_END
CUI_EXTERN_C_END

Expand Down
Loading
Loading