diff --git a/JavaApp/src/main/java/org/lwjgl/glfw/GLFW.java b/JavaApp/src/main/java/org/lwjgl/glfw/GLFW.java index 4d780f67..2a2bfc68 100644 --- a/JavaApp/src/main/java/org/lwjgl/glfw/GLFW.java +++ b/JavaApp/src/main/java/org/lwjgl/glfw/GLFW.java @@ -1104,7 +1104,7 @@ public class GLFW break; case CallbackBridge.EVENT_TYPE_SCROLL: if (mGLFWScrollCallback != null) { - mGLFWScrollCallback.invoke(ptr, (int)dataArr[1], (int)dataArr[2]); + mGLFWScrollCallback.invoke(ptr, (double)dataArr[1], (double)dataArr[2]); } break; case CallbackBridge.EVENT_TYPE_WINDOW_POS: diff --git a/Natives/CMakeLists.txt b/Natives/CMakeLists.txt index 5959bbc1..39c182bc 100644 --- a/Natives/CMakeLists.txt +++ b/Natives/CMakeLists.txt @@ -5,6 +5,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcommon -fobjc-arc -ObjC") set(CMAKE_C_FLAGS_DEBUG "-funwind-tables -g") include_directories( + "resources/Frameworks/Alderis.framework/Headers" "resources/Frameworks/MetalANGLE.framework/Headers" "external/DBNumberedSlider/Classes" "external/fishhook" @@ -80,6 +81,8 @@ add_executable(PojavLauncher target_link_libraries(PojavLauncher "-F'${CMAKE_CURRENT_LIST_DIR}/build'" + "-F'${CMAKE_CURRENT_LIST_DIR}/resources/Frameworks'" + "-framework Alderis" "-framework AuthenticationServices" "-framework CoreGraphics" "-framework GameController" diff --git a/Natives/CustomControlsViewController.m b/Natives/CustomControlsViewController.m index e19b309c..270a6a39 100644 --- a/Natives/CustomControlsViewController.m +++ b/Natives/CustomControlsViewController.m @@ -1,3 +1,5 @@ +#import "Alderis.h" +#import "Alderis-Swift.h" #import "CustomControlsViewController.h" #import "DBNumberedSlider.h" #import "FileListViewController.h" @@ -347,19 +349,10 @@ NSMutableArray *keyCodeMap, *keyValueMap; - (void)actionMenuBtnEdit { shouldDismissPopover = NO; CCMenuViewController *vc = [[CCMenuViewController alloc] init]; - vc.modalPresentationStyle = UIModalPresentationPopover; - vc.preferredContentSize = CGSizeMake(350, 250); - UIPopoverPresentationController *popoverController = [vc popoverPresentationController]; - popoverController.sourceView = self.currentGesture.view; - if ([self.currentGesture isKindOfClass:[UILongPressGestureRecognizer class]]) { - CGPoint point = [self.currentGesture locationInView:self.currentGesture.view]; - popoverController.sourceRect = self.selectedPoint; - } else { + vc.modalPresentationStyle = UIModalPresentationFormSheet; + if (![self.currentGesture isKindOfClass:[UILongPressGestureRecognizer class]]) { vc.targetButton = (ControlButton *)self.currentGesture.view; - popoverController.sourceRect = self.currentGesture.view.bounds; } - popoverController.permittedArrowDirections = UIPopoverArrowDirectionAny; - popoverController.delegate = self; [self presentViewController:vc animated:YES completion:nil]; } @@ -516,18 +509,20 @@ NSMutableArray *keyCodeMap, *keyValueMap; CGFloat currentY; -@interface CCMenuViewController () { +@interface CCMenuViewController () { } @property(nonatomic) NSArray* arrOrientation; +@property UITextField *activeField; @property(nonatomic) UIScrollView* scrollView; @property(nonatomic) UITextField *editName, *editSizeWidth, *editSizeHeight, *editDynamicX, *editDynamicY; @property(nonatomic) UITextView* editMapping; @property(nonatomic) UIPickerView* pickerMapping; @property(nonatomic) UISegmentedControl* ctrlOrientation; @property(nonatomic) UISwitch *switchToggleable, *switchMousePass, *switchSwipeable, *switchDynamicPos; -@property(nonatomic) UIColorWell API_AVAILABLE(ios(14.0)) *colorWellBackground, *colorWellStroke; +@property(nonatomic) UIColorWell API_AVAILABLE(ios(14.0)) *colorWellINTBackground, *colorWellINTStroke; +@property(nonatomic) HBColorWell *colorWellEXTBackground, *colorWellEXTStroke; @property(nonatomic) DBNumberedSlider *sliderStrokeWidth, *sliderCornerRadius, *sliderOpacity; @end @@ -545,19 +540,18 @@ CGFloat currentY; - (void)viewDidLoad { [super viewDidLoad]; + [self registerForKeyboardNotifications]; currentY = 6.0; - self.view.frame = CGRectMake(0, 0, self.preferredContentSize.width, self.preferredContentSize.height); - UIBarButtonItem *btnFlexibleSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil]; - UIToolbar *popoverToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0.0, 0.0, self.preferredContentSize.width, 44.0)]; + UIToolbar *popoverToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0.0, 0.0, self.view.frame.size.width, 44.0)]; UIBarButtonItem *popoverCancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(actionEditCancel)]; UIBarButtonItem *popoverDoneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(actionEditFinish)]; popoverToolbar.items = @[popoverCancelButton, btnFlexibleSpace, popoverDoneButton]; [self.view addSubview:popoverToolbar]; - self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(5.0, popoverToolbar.frame.size.height, self.preferredContentSize.width - 10.0, self.preferredContentSize.height - popoverToolbar.frame.size.height)]; + self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(5.0, popoverToolbar.frame.size.height, self.view.frame.size.width - 10.0, self.view.frame.size.height - popoverToolbar.frame.size.height)]; [self.view addSubview:self.scrollView]; UIToolbar *editPickToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0.0, 0.0, self.view.frame.size.width, 44.0)]; @@ -666,12 +660,16 @@ CGFloat currentY; currentY += labelName.frame.size.height + 12.0; UILabel *labelBGColor = [self addLabel:@"Background color"]; if(@available(iOS 14.0, *)) { - self.colorWellBackground = [[UIColorWell alloc] initWithFrame:CGRectMake(width - 42.0, currentY - 5.0, 30.0, 30.0)]; - self.colorWellBackground.selectedColor = self.targetButton.backgroundColor; - [self.scrollView addSubview:self.colorWellBackground]; + self.colorWellINTBackground = [[UIColorWell alloc] initWithFrame:CGRectMake(width - 42.0, currentY - 5.0, 30.0, 30.0)]; + self.colorWellINTBackground.selectedColor = self.targetButton.backgroundColor; + [self.scrollView addSubview:self.colorWellINTBackground]; } else { - - // TODO: color picker for iOS < 14.0 + self.colorWellEXTBackground = [[HBColorWell alloc] initWithFrame:CGRectMake(width - 42.0, currentY - 5.0, 30.0, 30.0)]; + self.colorWellEXTBackground.color = self.targetButton.backgroundColor; + self.colorWellEXTBackground.isDragInteractionEnabled = YES; + self.colorWellEXTBackground.isDropInteractionEnabled = YES; + [self.colorWellEXTBackground addTarget:self action:@selector(presentColorPicker:) forControlEvents:UIControlEventTouchUpInside]; + [self.scrollView addSubview:self.colorWellEXTBackground]; } @@ -691,14 +689,16 @@ CGFloat currentY; currentY += labelName.frame.size.height + 12.0; UILabel *labelStrokeColor = [self addLabel:@"Stroke color"]; if(@available(iOS 14.0, *)) { - self.colorWellStroke = [[UIColorWell alloc] initWithFrame:CGRectMake(width - 42.0, currentY - 5.0, 30.0, 30.0)]; - self.colorWellStroke.supportsAlpha = NO; - self.colorWellStroke.selectedColor = [[UIColor alloc] initWithCGColor:self.targetButton.layer.borderColor]; - [self.scrollView addSubview:self.colorWellStroke]; - [self sliderValueChanged:self.sliderStrokeWidth]; + self.colorWellINTStroke = [[UIColorWell alloc] initWithFrame:CGRectMake(width - 42.0, currentY - 5.0, 30.0, 30.0)]; + self.colorWellINTStroke.selectedColor = [[UIColor alloc] initWithCGColor:self.targetButton.layer.borderColor]; + self.colorWellINTStroke.supportsAlpha = NO; } else { - // TODO: color picker for iOS < 14.0 + self.colorWellEXTStroke = [[HBColorWell alloc] initWithFrame:CGRectMake(width - 42.0, currentY - 5.0, 30.0, 30.0)]; + self.colorWellEXTStroke.color = [[UIColor alloc] initWithCGColor:self.targetButton.layer.borderColor]; + [self.colorWellEXTStroke addTarget:self action:@selector(presentColorPicker:) forControlEvents:UIControlEventTouchUpInside]; + [self.scrollView addSubview:self.colorWellEXTStroke]; } + [self sliderValueChanged:self.sliderStrokeWidth]; // Property: Corner radius @@ -759,14 +759,82 @@ CGFloat currentY; currentY += labelName.frame.size.height + 12.0; - self.scrollView.contentSize = CGSizeMake(self.scrollView.contentSize.width, currentY + 100.0); + self.scrollView.contentSize = CGSizeMake(self.scrollView.contentSize.width, currentY); } -- (void)viewSafeAreaInsetsDidChange { - [super viewSafeAreaInsetsDidChange]; - self.scrollView.contentInset = self.view.safeAreaInsets; - self.scrollView.frame = CGRectMake(self.scrollView.frame.origin.x, self.scrollView.frame.origin.y + self.view.safeAreaInsets.top, self.scrollView.frame.size.width + self.view.safeAreaInsets.left, self.scrollView.frame.size.height + self.view.safeAreaInsets.bottom); - self.view.subviews[0].frame = CGRectOffset(self.view.subviews[0].frame, self.view.safeAreaInsets.left, self.view.safeAreaInsets.top); +#pragma mark - Alderis functions +// HBColorWell +- (void)presentColorPicker:(HBColorWell *)sender { + HBColorPickerViewController *vc = [[HBColorPickerViewController alloc] init]; + vc.delegate = self; + vc.popoverPresentationController.sourceView = sender; + vc.configuration = [[HBColorPickerConfiguration alloc] initWithColor:sender.color]; + if (sender == self.colorWellEXTBackground) { + vc.configuration.title = @"Background color"; + vc.configuration.supportsAlpha = YES; + } else if (sender == self.colorWellEXTStroke) { + vc.configuration.title = @"Stroke color"; + vc.configuration.supportsAlpha = NO; + } else { + NSLog(@"Unknown color well: %@", sender); + abort(); + } + [self presentViewController:vc animated:YES completion:nil]; +} + +// HBColorPickerDelegate +- (void)colorPicker:(HBColorPickerViewController *)picker didSelectColor:(UIColor *)color { + if ([picker.configuration.title isEqualToString:@"Background color"]) { + self.colorWellEXTBackground.color = color; + } else if ([picker.configuration.title isEqualToString:@"Stroke color"]) { + self.colorWellEXTStroke.color = color; + } else { + NSLog(@"Unknown color well: %@", picker.configuration.title); + abort(); + } +} + +#pragma mark - Keyboard observer functions +- (void)registerForKeyboardNotifications +{ + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardWasShown:) + name:UIKeyboardDidShowNotification object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardWillBeHidden:) + name:UIKeyboardWillHideNotification object:nil]; + +} + +- (void)keyboardWasShown:(NSNotification*)aNotification +{ + NSDictionary* info = [aNotification userInfo]; + CGSize kbSize = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size; + + UIEdgeInsets contentInsets = UIEdgeInsetsMake(0.0, 0.0, kbSize.height, 0.0); + self.scrollView.contentInset = contentInsets; + self.scrollView.scrollIndicatorInsets = contentInsets; + CGRect aRect = self.view.frame; + aRect.size.height -= kbSize.height; + if (!CGRectContainsPoint(aRect, self.activeField.frame.origin) ) { + [self.scrollView scrollRectToVisible:self.activeField.frame animated:YES]; + } +} + +- (void)keyboardWillBeHidden:(NSNotification*)aNotification +{ + UIEdgeInsets contentInsets = UIEdgeInsetsZero; + self.scrollView.contentInset = contentInsets; + self.scrollView.scrollIndicatorInsets = contentInsets; +} + +- (void)textFieldDidBeginEditing:(UITextField *)textField { + self.activeField = textField; +} + + - (void)textFieldDidEndEditing:(UITextField *)textField { + self.activeField = nil; } #pragma mark - Control editor @@ -795,8 +863,11 @@ CGFloat currentY; self.targetButton.properties[@"passThruEnabled"] = @(self.switchMousePass.isOn); self.targetButton.properties[@"isSwipeable"] = @(self.switchSwipeable.isOn); if(@available(iOS 14.0, *)) { - self.targetButton.properties[@"bgColor"] = @(convertUIColor2ARGB(self.colorWellBackground.selectedColor)); - self.targetButton.properties[@"strokeColor"] = @(convertUIColor2RGB(self.colorWellStroke.selectedColor)); + self.targetButton.properties[@"bgColor"] = @(convertUIColor2ARGB(self.colorWellINTBackground.selectedColor)); + self.targetButton.properties[@"strokeColor"] = @(convertUIColor2RGB(self.colorWellINTStroke.selectedColor)); + } else { + self.targetButton.properties[@"bgColor"] = @(convertUIColor2ARGB(self.colorWellEXTBackground.color)); + self.targetButton.properties[@"strokeColor"] = @(convertUIColor2RGB(self.colorWellEXTStroke.color)); } self.targetButton.properties[@"strokeWidth"] = @((NSInteger) self.sliderStrokeWidth.value); self.targetButton.properties[@"cornerRadius"] = @((NSInteger) self.sliderCornerRadius.value); @@ -812,9 +883,9 @@ CGFloat currentY; [sender setValue:(NSInteger)sender.value animated:NO]; if (sender.tag == TAG_SLIDER_STROKEWIDTH) { if(@available(iOS 14.0, *)) { - self.colorWellStroke.enabled = sender.value != 0; + self.colorWellINTStroke.enabled = sender.value != 0; } else { - // TODO + self.colorWellEXTStroke.enabled = sender.value != 0; } } } diff --git a/Natives/LoginViewController.m b/Natives/LoginViewController.m index 2b2a6ad4..0dc50ae3 100644 --- a/Natives/LoginViewController.m +++ b/Natives/LoginViewController.m @@ -439,6 +439,7 @@ -(void)latestLogShare { NSString *latestlogPath = [NSString stringWithFormat:@"file://%s/latestlog.old.txt", getenv("HOME")]; + NSLog(@"Path is %@", latestlogPath); activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[@"latestlog.txt", [NSURL URLWithString:latestlogPath]] applicationActivities:nil]; [self presentViewController:activityViewController animated:YES completion:nil]; diff --git a/Natives/resources/Frameworks/Alderis.framework/Alderis b/Natives/resources/Frameworks/Alderis.framework/Alderis new file mode 100755 index 00000000..6fbb541e Binary files /dev/null and b/Natives/resources/Frameworks/Alderis.framework/Alderis differ diff --git a/Natives/resources/Frameworks/Alderis.framework/Assets.car b/Natives/resources/Frameworks/Alderis.framework/Assets.car new file mode 100644 index 00000000..97196c46 Binary files /dev/null and b/Natives/resources/Frameworks/Alderis.framework/Assets.car differ diff --git a/Natives/resources/Frameworks/Alderis.framework/Headers/Alderis-Swift.h b/Natives/resources/Frameworks/Alderis.framework/Headers/Alderis-Swift.h new file mode 100644 index 00000000..e6ddf3f0 --- /dev/null +++ b/Natives/resources/Frameworks/Alderis.framework/Headers/Alderis-Swift.h @@ -0,0 +1,1300 @@ +#if 0 +#elif defined(__arm64e__) && __arm64e__ +// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#include +#include +#include +#include + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif + +#if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#else +# define SWIFT_COMPILE_NAME(X) +#endif +#if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#else +# define SWIFT_METHOD_FAMILY(X) +#endif +#if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +#else +# define SWIFT_NOESCAPE +#endif +#if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#else +# define SWIFT_RELEASES_ARGUMENT +#endif +#if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +# define SWIFT_WARN_UNUSED_RESULT +#endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +#else +# define SWIFT_NORETURN +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#else +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#endif +#if !defined(IBSegueAction) +# define IBSegueAction +#endif +#if __has_feature(modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +@import CoreGraphics; +@import Foundation; +@import ObjectiveC; +@import UIKit; +#endif + +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Alderis",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +@protocol UIViewControllerContextTransitioning; + +SWIFT_CLASS("_TtC7Alderis21BottomSheetTransition") +@interface BottomSheetTransition : NSObject +- (NSTimeInterval)transitionDuration:(id _Nullable)transitionContext SWIFT_WARN_UNUSED_RESULT; +- (void)animateTransition:(id _Nonnull)transitionContext; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class UIViewController; + +SWIFT_CLASS("_TtC7Alderis32BottomSheetTransitioningDelegate") +@interface BottomSheetTransitioningDelegate : NSObject +- (id _Nullable)animationControllerForPresentedController:(UIViewController * _Nonnull)presented presentingController:(UIViewController * _Nonnull)presenting sourceController:(UIViewController * _Nonnull)source SWIFT_WARN_UNUSED_RESULT; +- (id _Nullable)animationControllerForDismissedController:(UIViewController * _Nonnull)dismissed SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + +@class UIColor; +@class NSCoder; +@class UITraitCollection; +@class UIAction; + +/// ColorWell can be used to present the user’s color selection in your user interface. It +/// optionally also supports drag-and-drop operations. +/// By default, drop interactions are supported, which causes a UIControl.Event.valueChanged event +/// to be emitted. Optionally, drag operations can be enabled, allowing the color to be dropped +/// elsewhere. +/// You can also use UIControl.Event.touchUpInside to perform an action, such as to initialise +/// and present an instance of ColorPickerViewController. +SWIFT_CLASS_NAMED("ColorWell") +@interface HBColorWell : UIControl +/// Set the color to be displayed by the view. +@property (nonatomic, strong) UIColor * _Nullable color; +/// Override the default border color if desired. +@property (nonatomic, strong) UIColor * _Nullable borderColor; +/// Whether the user can begin a drag interaction from this view, allowing them to drop the color +/// into a supporting app. The default is false. +@property (nonatomic) BOOL isDragInteractionEnabled; +/// Whether the user can end a drag interaction by dropping on this view, allowing them to drag a +/// color from a supporting app onto this view. The default is true. +/// To handle a color being dropped on this view, add an action for the .valueChanged event. For +/// example: +/// \code +/// circleView.addTarget(self, action: #selector(self.handleColorDropEvent(_:)), for: .valueChanged) +/// +/// \endcode +@property (nonatomic) BOOL isDropInteractionEnabled; +/// :nodoc: +- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER; +/// :nodoc: +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +/// :nodoc: +- (void)layoutSubviews; +/// :nodoc: +- (void)didMoveToWindow; +/// :nodoc: +- (void)traitCollectionDidChange:(UITraitCollection * _Nullable)previousTraitCollection; +/// :nodoc: +- (void)addTarget:(id _Nullable)target action:(SEL _Nonnull)action forControlEvents:(UIControlEvents)controlEvents; +/// :nodoc: +- (void)addAction:(UIAction * _Nonnull)action forControlEvents:(UIControlEvents)controlEvents /*SWIFT_AVAILABILITY(maccatalyst,introduced=14)*/ SWIFT_AVAILABILITY(ios,introduced=14); +/// :nodoc: +- (void)removeTarget:(id _Nullable)target action:(SEL _Nullable)action forControlEvents:(UIControlEvents)controlEvents; +/// :nodoc: +- (void)removeAction:(UIAction * _Nonnull)action forControlEvents:(UIControlEvents)controlEvents /*SWIFT_AVAILABILITY(maccatalyst,introduced=14)*/ SWIFT_AVAILABILITY(ios,introduced=14); +/// :nodoc: +- (void)removeActionForIdentifier:(UIActionIdentifier _Nonnull)actionIdentifier forControlEvents:(UIControlEvents)controlEvents /*SWIFT_AVAILABILITY(maccatalyst,introduced=14)*/ SWIFT_AVAILABILITY(ios,introduced=14); +@end + + +/// Deprecated. Use ColorWell instead. +SWIFT_CLASS_NAMED("ColorPickerCircleView") SWIFT_DEPRECATED_MSG("", "HBColorWell") +@interface HBColorPickerCircleView : HBColorWell +- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER; +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +@end + + +SWIFT_CLASS("_TtC7Alderis21ColorPickerSliderBase") +@interface ColorPickerSliderBase : UIControl +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +- (void)sliderChanged; +- (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE; +@end + + +SWIFT_CLASS("_TtC7Alderis26ColorPickerComponentSlider") +@interface ColorPickerComponentSlider : ColorPickerSliderBase +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +@end + +enum HBColorPickerTab : NSInteger; + +/// ColorPickerConfiguration is used to configure an instance of ColorPickerViewController. +SWIFT_CLASS_NAMED("ColorPickerConfiguration") +@interface HBColorPickerConfiguration : NSObject +/// Initialise a configuration object with the required color property configured. +- (nonnull instancetype)initWithColor:(UIColor * _Nonnull)color OBJC_DESIGNATED_INITIALIZER; +/// The initial color to use when launching the color picker. Required. If you don’t have a value +/// set yet, provide a sensible default. +@property (nonatomic, strong) UIColor * _Nonnull color; +/// Whether to allow the user to set an alpha transparency value on the color. This controls the +/// visibility of an Alpha slider on the Sliders tab. When set to false, alpha values provided via +/// the color property, or by the user when entering a hexadecimal value on the Sliders tab, +/// will be discarded. +@property (nonatomic) BOOL supportsAlpha; +/// The title to display at the top of the popup. If set to nil, no title will be displayed. The +/// default is nil. +@property (nonatomic, copy) NSString * _Nullable title; +/// The initial tab to select when the color picker is presented. The default is +/// ColorPickerTab.swatch. +/// This value must be found in visibleTabs. +///
    +///
  • +/// see: visibleTabs +///
  • +///
+@property (nonatomic) enum HBColorPickerTab initialTab; +/// Maps visibleTabs to Objective-C due to Swift limitations. This is an implementation detail. +/// Ignore this and use visibleTabs per usual. +@property (nonatomic, copy) NSArray * _Nonnull visibleTabs; +/// Whether to display the tab selection at the top of the popup. The default is true. When set to +/// false, the user will only be able to access the tab specified in initialTab. +@property (nonatomic) BOOL showTabs; +/// When the Smart Invert accessibility feature is enabled, Alderis instructs the system to not +/// invert most of its user interface. This ensures the user can make a more accurate color +/// selection. If this behavior is not desired, you can disable it here. +@property (nonatomic) BOOL overrideSmartInvert; +/// Whether the user can end a drag interaction by dropping on the color picker window, allowing +/// them to drag a color from a supporting app. The default is true. +@property (nonatomic) BOOL isDropInteractionEnabled; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class HBColorPickerViewController; + +/// Use ColorPickerDelegate to handle the user’s response to ColorPickerViewController. +SWIFT_PROTOCOL_NAMED("ColorPickerDelegate") +@protocol HBColorPickerDelegate +@optional +/// Informs the delegate that the user has selected a color in the color picker. Optional. +/// Use this to update your user interface with the new color value, if suitable to your use case. +/// You should, at minimum, implement either this method or colorPicker(_:didAccept:). If you +/// don’t intend to implement this method, it is expected that you implement +/// colorPicker(_:didAccept:). If you implement this method and the user selects Cancel, this +/// method will be called with the initial color passed in via ColorPickerConfiguration.color to +/// undo the selection. +///
    +///
  • +/// see: colorPicker(_:didAccept:) +///
  • +///
+/// \param colorPicker The ColorPickerViewController instance that triggered the action. +/// +/// \param color The UIColor selection the user made. +/// +- (void)colorPicker:(HBColorPickerViewController * _Nonnull)colorPicker didSelectColor:(UIColor * _Nonnull)color; +/// Informs the delegate that the user has dismissed the color picker with a positive response, +/// having selected the selected color. Optional. +/// You should, at minimum, implement either this method or colorPicker(_:didSelect:). +///
    +///
  • +/// see: colorPicker(_:didSelect:) +///
  • +///
+/// \param colorPicker The ColorPickerViewController instance that triggered the action. +/// +/// \param color The UIColor selection the user made. +/// +- (void)colorPicker:(HBColorPickerViewController * _Nonnull)colorPicker didAcceptColor:(UIColor * _Nonnull)color; +/// Informs the delegate that the user has dismissed the color picker with a negative response. +/// Optional. +/// You usually do not need to handle this condition. +/// \param colorPicker The ColorPickerViewController instance that triggered the action. +/// +- (void)colorPickerDidCancel:(HBColorPickerViewController * _Nonnull)colorPicker; +@end + +@protocol UIContentContainer; +@class NSBundle; + +SWIFT_CLASS("_TtC7Alderis30ColorPickerInnerViewController") +@interface ColorPickerInnerViewController : UIViewController +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +- (void)viewDidLoad; +- (void)viewWillLayoutSubviews; +- (void)viewDidLayoutSubviews; +- (void)preferredContentSizeDidChangeForChildContentContainer:(id _Nonnull)container; +- (void)saveTapped; +- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil SWIFT_UNAVAILABLE; +@end + + + +@class UIPresentationController; + +@interface ColorPickerInnerViewController (SWIFT_EXTENSION(Alderis)) +- (void)presentationControllerWillDismiss:(UIPresentationController * _Nonnull)presentationController; +@end + +@class UIDropInteraction; +@protocol UIDropSession; +@class UIDropProposal; + +@interface ColorPickerInnerViewController (SWIFT_EXTENSION(Alderis)) +- (BOOL)dropInteraction:(UIDropInteraction * _Nonnull)interaction canHandleSession:(id _Nonnull)session SWIFT_WARN_UNUSED_RESULT; +- (UIDropProposal * _Nonnull)dropInteraction:(UIDropInteraction * _Nonnull)interaction sessionDidUpdate:(id _Nonnull)session SWIFT_WARN_UNUSED_RESULT; +- (void)dropInteraction:(UIDropInteraction * _Nonnull)interaction performDrop:(id _Nonnull)session; +@end + + +SWIFT_CLASS("_TtC7Alderis20ColorPickerMapSlider") +@interface ColorPickerMapSlider : ColorPickerComponentSlider +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +@end + + +SWIFT_CLASS("_TtC7Alderis32ColorPickerTabViewControllerBase") +@interface ColorPickerTabViewControllerBase : UIViewController +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil SWIFT_UNAVAILABLE; +@end + + +SWIFT_CLASS("_TtC7Alderis28ColorPickerMapViewController") +@interface ColorPickerMapViewController : ColorPickerTabViewControllerBase +- (void)viewDidLoad; +- (void)viewDidLayoutSubviews; +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +@end + + + + +SWIFT_CLASS("_TtC7Alderis24ColorPickerNumericSlider") +@interface ColorPickerNumericSlider : ColorPickerComponentSlider +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +@end + +@class UITextField; + +@interface ColorPickerNumericSlider (SWIFT_EXTENSION(Alderis)) +- (BOOL)textField:(UITextField * _Nonnull)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString * _Nonnull)string SWIFT_WARN_UNUSED_RESULT; +@end + + +@class UISegmentedControl; +@class UITouch; +@class UIEvent; + +SWIFT_CLASS("_TtC7Alderis32ColorPickerSlidersViewController") +@interface ColorPickerSlidersViewController : ColorPickerTabViewControllerBase +- (void)viewDidLoad; +- (void)segmentControlChanged:(UISegmentedControl * _Nonnull)sender; +- (void)touchesBegan:(NSSet * _Nonnull)touches withEvent:(UIEvent * _Nullable)event; +- (void)sliderChanged:(ColorPickerNumericSlider * _Nonnull)slider; +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +@end + + +@interface ColorPickerSlidersViewController (SWIFT_EXTENSION(Alderis)) +- (BOOL)textFieldShouldReturn:(UITextField * _Nonnull)textField SWIFT_WARN_UNUSED_RESULT; +- (BOOL)textField:(UITextField * _Nonnull)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString * _Nonnull)string SWIFT_WARN_UNUSED_RESULT; +@end + + +SWIFT_CLASS("_TtC7Alderis31ColorPickerSwatchViewController") +@interface ColorPickerSwatchViewController : ColorPickerTabViewControllerBase +- (void)viewDidLoad; +- (void)viewDidLayoutSubviews; +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +@end + +/// An enumeration of the tabs ColorPickerViewController features. Use these enumeration values to +/// set tab-related settings on ColorPickerConfiguration. +typedef SWIFT_ENUM_NAMED(NSInteger, HBColorPickerTab, "ColorPickerTab", open) { +/// Tab 1: A grid of 9 variations of 11 colours, and a grayscale ramp. The first and default tab. + HBColorPickerTabSwatch = 0, +/// Tab 2: A color wheel displaying every possible hue and saturation combination. The user can +/// additionally adjust the brightness of the colour using a slider. + HBColorPickerTabMap = 1, +/// Tab 3: A set of sliders for red, green, and blue color values, which can be switched to hue, +/// saturation, and brightness. The user can additionally copy or enter a color value expressed +/// using a CSS-style hexadecimal string, and adjust alpha transparency. + HBColorPickerTabSliders = 2, +}; + + + +/// Provides the Color Picker user interface. +/// Present this view controller to display the color picker. Do not push it onto a navigation +/// controller stack. In horizontally and vertically regular size class environments, for instance +/// on iPad and Mac, the picker will be presented as a popover. This means that you must set +/// sourceView or other similar properties on the view controller’s popoverPresentationController +/// before presentation. +/// To review examples of ColorPickerViewController in use, run pod try Alderis. +SWIFT_CLASS_NAMED("ColorPickerViewController") +@interface HBColorPickerViewController : UIViewController +/// Initialise an instance of ColorPickerViewController with a configuration object. +/// Remember to set the delegate before presenting the view controller. +- (nonnull instancetype)initWithConfiguration:(HBColorPickerConfiguration * _Nonnull)configuration OBJC_DESIGNATED_INITIALIZER; +/// The delegate that will receive the user’s selection upon tapping the Done button, or a +/// cancellation upon tapping the Cancel button. +@property (nonatomic, weak) id _Nullable delegate; +/// The configuration of the color picker. Use this to set the initially selected color, as well +/// as other behavioral options. +/// Making changes to this value or its properties after the color picker interface has been +/// presented may result in undefined behavior. +///
    +///
  • +/// see: ColorPickerConfiguration +///
  • +///
+@property (nonatomic, strong) HBColorPickerConfiguration * _Null_unspecified configuration; +/// Deprecated. Set overrideSmartInvert on the ColorPickerConfiguration instead. +///
    +///
  • +/// see: ColorPickerConfiguration.overrideSmartInvert +///
  • +///
+@property (nonatomic) BOOL overrideSmartInvert SWIFT_DEPRECATED_MSG("Use ColorPickerConfiguration instead"); +/// Deprecated. Set color on the ColorPickerConfiguration instead. +///
    +///
  • +/// see: ColorPickerConfiguration.color +///
  • +///
+@property (nonatomic, strong) UIColor * _Nonnull color SWIFT_DEPRECATED_MSG("Use ColorPickerConfiguration instead"); +/// :nodoc: +- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil OBJC_DESIGNATED_INITIALIZER; +/// :nodoc: +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +/// :nodoc: +- (void)viewDidLoad; +/// :nodoc: +- (void)viewWillLayoutSubviews; +/// :nodoc: +- (void)viewSafeAreaInsetsDidChange; +/// :nodoc: +- (void)preferredContentSizeDidChangeForChildContentContainer:(id _Nonnull)container; +/// :nodoc: +- (void)viewWillAppear:(BOOL)animated; +/// :nodoc: +- (void)viewDidAppear:(BOOL)animated; +/// :nodoc: +- (void)viewWillDisappear:(BOOL)animated; +/// :nodoc: +- (void)traitCollectionDidChange:(UITraitCollection * _Nullable)previousTraitCollection; +@end + + +SWIFT_CLASS("_TtC7Alderis20ColorPickerWheelView") +@interface ColorPickerWheelView : UIView +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +- (void)layoutSubviews; +- (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE; +@end + + +@class UIDragInteraction; +@protocol UIDragSession; +@class UIDragItem; + +@interface HBColorWell (SWIFT_EXTENSION(Alderis)) +/// :nodoc: +- (NSArray * _Nonnull)dragInteraction:(UIDragInteraction * _Nonnull)interaction itemsForBeginningSession:(id _Nonnull)session SWIFT_WARN_UNUSED_RESULT; +@end + + +@interface HBColorWell (SWIFT_EXTENSION(Alderis)) +/// :nodoc: +- (BOOL)dropInteraction:(UIDropInteraction * _Nonnull)interaction canHandleSession:(id _Nonnull)session SWIFT_WARN_UNUSED_RESULT; +/// :nodoc: +- (UIDropProposal * _Nonnull)dropInteraction:(UIDropInteraction * _Nonnull)interaction sessionDidUpdate:(id _Nonnull)session SWIFT_WARN_UNUSED_RESULT; +/// :nodoc: +- (void)dropInteraction:(UIDropInteraction * _Nonnull)interaction performDrop:(id _Nonnull)session; +@end + + +SWIFT_CLASS("_TtC7Alderis12DialogButton") +@interface DialogButton : UIButton +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE; +@end + + +SWIFT_CLASS("_TtC7Alderis13SeparatorView") +@interface SeparatorView : UIView +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +- (void)updateConstraints; +- (void)didMoveToWindow; +- (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE; +@end + + +@interface UIColor (SWIFT_EXTENSION(Alderis)) +/// Maps init(propertyListValue:) to Objective-C due to Swift limitations. This is an +/// implementation detail. Ignore this and use UIColor(propertyListValue:) or +/// -[UIColor initWithHbcp_propertyListValue:] as per usual. +///
    +///
  • +/// see: init(propertyListValue:) +///
  • +///
+/// \param value The object to retrieve data from. See the discussion for the supported +/// object types. +/// +/// +/// returns: +/// An initialized color object, or nil if the value does not conform to the expected +/// type. The color information represented by this object is in the device RGB colorspace. +/// device RGB colorspace. +- (nullable instancetype)initWithHbcp_propertyListValue:(id _Nullable)propertyListValue; +/// Returns a string that represents the color. +/// The output is a string in the format #AABBCC:0.5, where the initial #AABBCC portion is a +/// 6-character CSS-style hex string, and the final :0.5 portion represents the alpha value. If +/// the color’s alpha value is 1, the alpha portion is excluded. +/// If the color is dynamic, for instance if it is a UIKit system color, or initialised via +/// UIColor(dynamicProvider:), the color that matches the current trait collection is used. +///
    +///
  • +/// see: init(propertyListValue:) +///
  • +///
+/// +/// returns: +/// A string representing the color, in the format discussed above. +@property (nonatomic, readonly, copy) NSString * _Nonnull hbcp_propertyListValue; +@end + +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#pragma clang diagnostic pop + +#elif defined(__arm64__) && __arm64__ +// Generated by Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgcc-compat" + +#if !defined(__has_include) +# define __has_include(x) 0 +#endif +#if !defined(__has_attribute) +# define __has_attribute(x) 0 +#endif +#if !defined(__has_feature) +# define __has_feature(x) 0 +#endif +#if !defined(__has_warning) +# define __has_warning(x) 0 +#endif + +#if __has_include() +# include +#endif + +#pragma clang diagnostic ignored "-Wauto-import" +#include +#include +#include +#include + +#if !defined(SWIFT_TYPEDEFS) +# define SWIFT_TYPEDEFS 1 +# if __has_include() +# include +# elif !defined(__cplusplus) +typedef uint_least16_t char16_t; +typedef uint_least32_t char32_t; +# endif +typedef float swift_float2 __attribute__((__ext_vector_type__(2))); +typedef float swift_float3 __attribute__((__ext_vector_type__(3))); +typedef float swift_float4 __attribute__((__ext_vector_type__(4))); +typedef double swift_double2 __attribute__((__ext_vector_type__(2))); +typedef double swift_double3 __attribute__((__ext_vector_type__(3))); +typedef double swift_double4 __attribute__((__ext_vector_type__(4))); +typedef int swift_int2 __attribute__((__ext_vector_type__(2))); +typedef int swift_int3 __attribute__((__ext_vector_type__(3))); +typedef int swift_int4 __attribute__((__ext_vector_type__(4))); +typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); +typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); +typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); +#endif + +#if !defined(SWIFT_PASTE) +# define SWIFT_PASTE_HELPER(x, y) x##y +# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) +#endif +#if !defined(SWIFT_METATYPE) +# define SWIFT_METATYPE(X) Class +#endif +#if !defined(SWIFT_CLASS_PROPERTY) +# if __has_feature(objc_class_property) +# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ +# else +# define SWIFT_CLASS_PROPERTY(...) +# endif +#endif + +#if __has_attribute(objc_runtime_name) +# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) +#else +# define SWIFT_RUNTIME_NAME(X) +#endif +#if __has_attribute(swift_name) +# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) +#else +# define SWIFT_COMPILE_NAME(X) +#endif +#if __has_attribute(objc_method_family) +# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) +#else +# define SWIFT_METHOD_FAMILY(X) +#endif +#if __has_attribute(noescape) +# define SWIFT_NOESCAPE __attribute__((noescape)) +#else +# define SWIFT_NOESCAPE +#endif +#if __has_attribute(ns_consumed) +# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) +#else +# define SWIFT_RELEASES_ARGUMENT +#endif +#if __has_attribute(warn_unused_result) +# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +# define SWIFT_WARN_UNUSED_RESULT +#endif +#if __has_attribute(noreturn) +# define SWIFT_NORETURN __attribute__((noreturn)) +#else +# define SWIFT_NORETURN +#endif +#if !defined(SWIFT_CLASS_EXTRA) +# define SWIFT_CLASS_EXTRA +#endif +#if !defined(SWIFT_PROTOCOL_EXTRA) +# define SWIFT_PROTOCOL_EXTRA +#endif +#if !defined(SWIFT_ENUM_EXTRA) +# define SWIFT_ENUM_EXTRA +#endif +#if !defined(SWIFT_CLASS) +# if __has_attribute(objc_subclassing_restricted) +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# else +# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA +# endif +#endif +#if !defined(SWIFT_RESILIENT_CLASS) +# if __has_attribute(objc_class_stub) +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) +# else +# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) +# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) +# endif +#endif + +#if !defined(SWIFT_PROTOCOL) +# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA +#endif + +#if !defined(SWIFT_EXTENSION) +# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) +#endif + +#if !defined(OBJC_DESIGNATED_INITIALIZER) +# if __has_attribute(objc_designated_initializer) +# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) +# else +# define OBJC_DESIGNATED_INITIALIZER +# endif +#endif +#if !defined(SWIFT_ENUM_ATTR) +# if defined(__has_attribute) && __has_attribute(enum_extensibility) +# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) +# else +# define SWIFT_ENUM_ATTR(_extensibility) +# endif +#endif +#if !defined(SWIFT_ENUM) +# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# if __has_feature(generalized_swift_name) +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type +# else +# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) +# endif +#endif +#if !defined(SWIFT_UNAVAILABLE) +# define SWIFT_UNAVAILABLE __attribute__((unavailable)) +#endif +#if !defined(SWIFT_UNAVAILABLE_MSG) +# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) +#endif +#if !defined(SWIFT_AVAILABILITY) +# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) +#endif +#if !defined(SWIFT_WEAK_IMPORT) +# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) +#endif +#if !defined(SWIFT_DEPRECATED) +# define SWIFT_DEPRECATED __attribute__((deprecated)) +#endif +#if !defined(SWIFT_DEPRECATED_MSG) +# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) +#endif +#if __has_feature(attribute_diagnose_if_objc) +# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) +#else +# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) +#endif +#if !defined(IBSegueAction) +# define IBSegueAction +#endif +#if __has_feature(modules) +#if __has_warning("-Watimport-in-framework-header") +#pragma clang diagnostic ignored "-Watimport-in-framework-header" +#endif +@import CoreGraphics; +@import Foundation; +@import ObjectiveC; +@import UIKit; +#endif + +#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" +#pragma clang diagnostic ignored "-Wduplicate-method-arg" +#if __has_warning("-Wpragma-clang-attribute") +# pragma clang diagnostic ignored "-Wpragma-clang-attribute" +#endif +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wnullability" + +#if __has_attribute(external_source_symbol) +# pragma push_macro("any") +# undef any +# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="Alderis",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) +# pragma pop_macro("any") +#endif + +@protocol UIViewControllerContextTransitioning; + +SWIFT_CLASS("_TtC7Alderis21BottomSheetTransition") +@interface BottomSheetTransition : NSObject +- (NSTimeInterval)transitionDuration:(id _Nullable)transitionContext SWIFT_WARN_UNUSED_RESULT; +- (void)animateTransition:(id _Nonnull)transitionContext; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class UIViewController; + +SWIFT_CLASS("_TtC7Alderis32BottomSheetTransitioningDelegate") +@interface BottomSheetTransitioningDelegate : NSObject +- (id _Nullable)animationControllerForPresentedController:(UIViewController * _Nonnull)presented presentingController:(UIViewController * _Nonnull)presenting sourceController:(UIViewController * _Nonnull)source SWIFT_WARN_UNUSED_RESULT; +- (id _Nullable)animationControllerForDismissedController:(UIViewController * _Nonnull)dismissed SWIFT_WARN_UNUSED_RESULT; +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +@end + +@class UIColor; +@class NSCoder; +@class UITraitCollection; +@class UIAction; + +/// ColorWell can be used to present the user’s color selection in your user interface. It +/// optionally also supports drag-and-drop operations. +/// By default, drop interactions are supported, which causes a UIControl.Event.valueChanged event +/// to be emitted. Optionally, drag operations can be enabled, allowing the color to be dropped +/// elsewhere. +/// You can also use UIControl.Event.touchUpInside to perform an action, such as to initialise +/// and present an instance of ColorPickerViewController. +SWIFT_CLASS_NAMED("ColorWell") +@interface HBColorWell : UIControl +/// Set the color to be displayed by the view. +@property (nonatomic, strong) UIColor * _Nullable color; +/// Override the default border color if desired. +@property (nonatomic, strong) UIColor * _Nullable borderColor; +/// Whether the user can begin a drag interaction from this view, allowing them to drop the color +/// into a supporting app. The default is false. +@property (nonatomic) BOOL isDragInteractionEnabled; +/// Whether the user can end a drag interaction by dropping on this view, allowing them to drag a +/// color from a supporting app onto this view. The default is true. +/// To handle a color being dropped on this view, add an action for the .valueChanged event. For +/// example: +/// \code +/// circleView.addTarget(self, action: #selector(self.handleColorDropEvent(_:)), for: .valueChanged) +/// +/// \endcode +@property (nonatomic) BOOL isDropInteractionEnabled; +/// :nodoc: +- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER; +/// :nodoc: +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +/// :nodoc: +- (void)layoutSubviews; +/// :nodoc: +- (void)didMoveToWindow; +/// :nodoc: +- (void)traitCollectionDidChange:(UITraitCollection * _Nullable)previousTraitCollection; +/// :nodoc: +- (void)addTarget:(id _Nullable)target action:(SEL _Nonnull)action forControlEvents:(UIControlEvents)controlEvents; +/// :nodoc: +- (void)addAction:(UIAction * _Nonnull)action forControlEvents:(UIControlEvents)controlEvents /*SWIFT_AVAILABILITY(maccatalyst,introduced=14)*/ SWIFT_AVAILABILITY(ios,introduced=14); +/// :nodoc: +- (void)removeTarget:(id _Nullable)target action:(SEL _Nullable)action forControlEvents:(UIControlEvents)controlEvents; +/// :nodoc: +- (void)removeAction:(UIAction * _Nonnull)action forControlEvents:(UIControlEvents)controlEvents /*SWIFT_AVAILABILITY(maccatalyst,introduced=14)*/ SWIFT_AVAILABILITY(ios,introduced=14); +/// :nodoc: +- (void)removeActionForIdentifier:(UIActionIdentifier _Nonnull)actionIdentifier forControlEvents:(UIControlEvents)controlEvents /*SWIFT_AVAILABILITY(maccatalyst,introduced=14)*/ SWIFT_AVAILABILITY(ios,introduced=14); +@end + + +/// Deprecated. Use ColorWell instead. +SWIFT_CLASS_NAMED("ColorPickerCircleView") SWIFT_DEPRECATED_MSG("", "HBColorWell") +@interface HBColorPickerCircleView : HBColorWell +- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER; +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +@end + + +SWIFT_CLASS("_TtC7Alderis21ColorPickerSliderBase") +@interface ColorPickerSliderBase : UIControl +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +- (void)sliderChanged; +- (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE; +@end + + +SWIFT_CLASS("_TtC7Alderis26ColorPickerComponentSlider") +@interface ColorPickerComponentSlider : ColorPickerSliderBase +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +@end + +enum HBColorPickerTab : NSInteger; + +/// ColorPickerConfiguration is used to configure an instance of ColorPickerViewController. +SWIFT_CLASS_NAMED("ColorPickerConfiguration") +@interface HBColorPickerConfiguration : NSObject +/// Initialise a configuration object with the required color property configured. +- (nonnull instancetype)initWithColor:(UIColor * _Nonnull)color OBJC_DESIGNATED_INITIALIZER; +/// The initial color to use when launching the color picker. Required. If you don’t have a value +/// set yet, provide a sensible default. +@property (nonatomic, strong) UIColor * _Nonnull color; +/// Whether to allow the user to set an alpha transparency value on the color. This controls the +/// visibility of an Alpha slider on the Sliders tab. When set to false, alpha values provided via +/// the color property, or by the user when entering a hexadecimal value on the Sliders tab, +/// will be discarded. +@property (nonatomic) BOOL supportsAlpha; +/// The title to display at the top of the popup. If set to nil, no title will be displayed. The +/// default is nil. +@property (nonatomic, copy) NSString * _Nullable title; +/// The initial tab to select when the color picker is presented. The default is +/// ColorPickerTab.swatch. +/// This value must be found in visibleTabs. +///
    +///
  • +/// see: visibleTabs +///
  • +///
+@property (nonatomic) enum HBColorPickerTab initialTab; +/// Maps visibleTabs to Objective-C due to Swift limitations. This is an implementation detail. +/// Ignore this and use visibleTabs per usual. +@property (nonatomic, copy) NSArray * _Nonnull visibleTabs; +/// Whether to display the tab selection at the top of the popup. The default is true. When set to +/// false, the user will only be able to access the tab specified in initialTab. +@property (nonatomic) BOOL showTabs; +/// When the Smart Invert accessibility feature is enabled, Alderis instructs the system to not +/// invert most of its user interface. This ensures the user can make a more accurate color +/// selection. If this behavior is not desired, you can disable it here. +@property (nonatomic) BOOL overrideSmartInvert; +/// Whether the user can end a drag interaction by dropping on the color picker window, allowing +/// them to drag a color from a supporting app. The default is true. +@property (nonatomic) BOOL isDropInteractionEnabled; +- (nonnull instancetype)init SWIFT_UNAVAILABLE; ++ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); +@end + +@class HBColorPickerViewController; + +/// Use ColorPickerDelegate to handle the user’s response to ColorPickerViewController. +SWIFT_PROTOCOL_NAMED("ColorPickerDelegate") +@protocol HBColorPickerDelegate +@optional +/// Informs the delegate that the user has selected a color in the color picker. Optional. +/// Use this to update your user interface with the new color value, if suitable to your use case. +/// You should, at minimum, implement either this method or colorPicker(_:didAccept:). If you +/// don’t intend to implement this method, it is expected that you implement +/// colorPicker(_:didAccept:). If you implement this method and the user selects Cancel, this +/// method will be called with the initial color passed in via ColorPickerConfiguration.color to +/// undo the selection. +///
    +///
  • +/// see: colorPicker(_:didAccept:) +///
  • +///
+/// \param colorPicker The ColorPickerViewController instance that triggered the action. +/// +/// \param color The UIColor selection the user made. +/// +- (void)colorPicker:(HBColorPickerViewController * _Nonnull)colorPicker didSelectColor:(UIColor * _Nonnull)color; +/// Informs the delegate that the user has dismissed the color picker with a positive response, +/// having selected the selected color. Optional. +/// You should, at minimum, implement either this method or colorPicker(_:didSelect:). +///
    +///
  • +/// see: colorPicker(_:didSelect:) +///
  • +///
+/// \param colorPicker The ColorPickerViewController instance that triggered the action. +/// +/// \param color The UIColor selection the user made. +/// +- (void)colorPicker:(HBColorPickerViewController * _Nonnull)colorPicker didAcceptColor:(UIColor * _Nonnull)color; +/// Informs the delegate that the user has dismissed the color picker with a negative response. +/// Optional. +/// You usually do not need to handle this condition. +/// \param colorPicker The ColorPickerViewController instance that triggered the action. +/// +- (void)colorPickerDidCancel:(HBColorPickerViewController * _Nonnull)colorPicker; +@end + +@protocol UIContentContainer; +@class NSBundle; + +SWIFT_CLASS("_TtC7Alderis30ColorPickerInnerViewController") +@interface ColorPickerInnerViewController : UIViewController +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +- (void)viewDidLoad; +- (void)viewWillLayoutSubviews; +- (void)viewDidLayoutSubviews; +- (void)preferredContentSizeDidChangeForChildContentContainer:(id _Nonnull)container; +- (void)saveTapped; +- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil SWIFT_UNAVAILABLE; +@end + + + +@class UIPresentationController; + +@interface ColorPickerInnerViewController (SWIFT_EXTENSION(Alderis)) +- (void)presentationControllerWillDismiss:(UIPresentationController * _Nonnull)presentationController; +@end + +@class UIDropInteraction; +@protocol UIDropSession; +@class UIDropProposal; + +@interface ColorPickerInnerViewController (SWIFT_EXTENSION(Alderis)) +- (BOOL)dropInteraction:(UIDropInteraction * _Nonnull)interaction canHandleSession:(id _Nonnull)session SWIFT_WARN_UNUSED_RESULT; +- (UIDropProposal * _Nonnull)dropInteraction:(UIDropInteraction * _Nonnull)interaction sessionDidUpdate:(id _Nonnull)session SWIFT_WARN_UNUSED_RESULT; +- (void)dropInteraction:(UIDropInteraction * _Nonnull)interaction performDrop:(id _Nonnull)session; +@end + + +SWIFT_CLASS("_TtC7Alderis20ColorPickerMapSlider") +@interface ColorPickerMapSlider : ColorPickerComponentSlider +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +@end + + +SWIFT_CLASS("_TtC7Alderis32ColorPickerTabViewControllerBase") +@interface ColorPickerTabViewControllerBase : UIViewController +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil SWIFT_UNAVAILABLE; +@end + + +SWIFT_CLASS("_TtC7Alderis28ColorPickerMapViewController") +@interface ColorPickerMapViewController : ColorPickerTabViewControllerBase +- (void)viewDidLoad; +- (void)viewDidLayoutSubviews; +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +@end + + + + +SWIFT_CLASS("_TtC7Alderis24ColorPickerNumericSlider") +@interface ColorPickerNumericSlider : ColorPickerComponentSlider +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +@end + +@class UITextField; + +@interface ColorPickerNumericSlider (SWIFT_EXTENSION(Alderis)) +- (BOOL)textField:(UITextField * _Nonnull)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString * _Nonnull)string SWIFT_WARN_UNUSED_RESULT; +@end + + +@class UISegmentedControl; +@class UITouch; +@class UIEvent; + +SWIFT_CLASS("_TtC7Alderis32ColorPickerSlidersViewController") +@interface ColorPickerSlidersViewController : ColorPickerTabViewControllerBase +- (void)viewDidLoad; +- (void)segmentControlChanged:(UISegmentedControl * _Nonnull)sender; +- (void)touchesBegan:(NSSet * _Nonnull)touches withEvent:(UIEvent * _Nullable)event; +- (void)sliderChanged:(ColorPickerNumericSlider * _Nonnull)slider; +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +@end + + +@interface ColorPickerSlidersViewController (SWIFT_EXTENSION(Alderis)) +- (BOOL)textFieldShouldReturn:(UITextField * _Nonnull)textField SWIFT_WARN_UNUSED_RESULT; +- (BOOL)textField:(UITextField * _Nonnull)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString * _Nonnull)string SWIFT_WARN_UNUSED_RESULT; +@end + + +SWIFT_CLASS("_TtC7Alderis31ColorPickerSwatchViewController") +@interface ColorPickerSwatchViewController : ColorPickerTabViewControllerBase +- (void)viewDidLoad; +- (void)viewDidLayoutSubviews; +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +@end + +/// An enumeration of the tabs ColorPickerViewController features. Use these enumeration values to +/// set tab-related settings on ColorPickerConfiguration. +typedef SWIFT_ENUM_NAMED(NSInteger, HBColorPickerTab, "ColorPickerTab", open) { +/// Tab 1: A grid of 9 variations of 11 colours, and a grayscale ramp. The first and default tab. + HBColorPickerTabSwatch = 0, +/// Tab 2: A color wheel displaying every possible hue and saturation combination. The user can +/// additionally adjust the brightness of the colour using a slider. + HBColorPickerTabMap = 1, +/// Tab 3: A set of sliders for red, green, and blue color values, which can be switched to hue, +/// saturation, and brightness. The user can additionally copy or enter a color value expressed +/// using a CSS-style hexadecimal string, and adjust alpha transparency. + HBColorPickerTabSliders = 2, +}; + + + +/// Provides the Color Picker user interface. +/// Present this view controller to display the color picker. Do not push it onto a navigation +/// controller stack. In horizontally and vertically regular size class environments, for instance +/// on iPad and Mac, the picker will be presented as a popover. This means that you must set +/// sourceView or other similar properties on the view controller’s popoverPresentationController +/// before presentation. +/// To review examples of ColorPickerViewController in use, run pod try Alderis. +SWIFT_CLASS_NAMED("ColorPickerViewController") +@interface HBColorPickerViewController : UIViewController +/// Initialise an instance of ColorPickerViewController with a configuration object. +/// Remember to set the delegate before presenting the view controller. +- (nonnull instancetype)initWithConfiguration:(HBColorPickerConfiguration * _Nonnull)configuration OBJC_DESIGNATED_INITIALIZER; +/// The delegate that will receive the user’s selection upon tapping the Done button, or a +/// cancellation upon tapping the Cancel button. +@property (nonatomic, weak) id _Nullable delegate; +/// The configuration of the color picker. Use this to set the initially selected color, as well +/// as other behavioral options. +/// Making changes to this value or its properties after the color picker interface has been +/// presented may result in undefined behavior. +///
    +///
  • +/// see: ColorPickerConfiguration +///
  • +///
+@property (nonatomic, strong) HBColorPickerConfiguration * _Null_unspecified configuration; +/// Deprecated. Set overrideSmartInvert on the ColorPickerConfiguration instead. +///
    +///
  • +/// see: ColorPickerConfiguration.overrideSmartInvert +///
  • +///
+@property (nonatomic) BOOL overrideSmartInvert SWIFT_DEPRECATED_MSG("Use ColorPickerConfiguration instead"); +/// Deprecated. Set color on the ColorPickerConfiguration instead. +///
    +///
  • +/// see: ColorPickerConfiguration.color +///
  • +///
+@property (nonatomic, strong) UIColor * _Nonnull color SWIFT_DEPRECATED_MSG("Use ColorPickerConfiguration instead"); +/// :nodoc: +- (nonnull instancetype)initWithNibName:(NSString * _Nullable)nibNameOrNil bundle:(NSBundle * _Nullable)nibBundleOrNil OBJC_DESIGNATED_INITIALIZER; +/// :nodoc: +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +/// :nodoc: +- (void)viewDidLoad; +/// :nodoc: +- (void)viewWillLayoutSubviews; +/// :nodoc: +- (void)viewSafeAreaInsetsDidChange; +/// :nodoc: +- (void)preferredContentSizeDidChangeForChildContentContainer:(id _Nonnull)container; +/// :nodoc: +- (void)viewWillAppear:(BOOL)animated; +/// :nodoc: +- (void)viewDidAppear:(BOOL)animated; +/// :nodoc: +- (void)viewWillDisappear:(BOOL)animated; +/// :nodoc: +- (void)traitCollectionDidChange:(UITraitCollection * _Nullable)previousTraitCollection; +@end + + +SWIFT_CLASS("_TtC7Alderis20ColorPickerWheelView") +@interface ColorPickerWheelView : UIView +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +- (void)layoutSubviews; +- (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE; +@end + + +@class UIDragInteraction; +@protocol UIDragSession; +@class UIDragItem; + +@interface HBColorWell (SWIFT_EXTENSION(Alderis)) +/// :nodoc: +- (NSArray * _Nonnull)dragInteraction:(UIDragInteraction * _Nonnull)interaction itemsForBeginningSession:(id _Nonnull)session SWIFT_WARN_UNUSED_RESULT; +@end + + +@interface HBColorWell (SWIFT_EXTENSION(Alderis)) +/// :nodoc: +- (BOOL)dropInteraction:(UIDropInteraction * _Nonnull)interaction canHandleSession:(id _Nonnull)session SWIFT_WARN_UNUSED_RESULT; +/// :nodoc: +- (UIDropProposal * _Nonnull)dropInteraction:(UIDropInteraction * _Nonnull)interaction sessionDidUpdate:(id _Nonnull)session SWIFT_WARN_UNUSED_RESULT; +/// :nodoc: +- (void)dropInteraction:(UIDropInteraction * _Nonnull)interaction performDrop:(id _Nonnull)session; +@end + + +SWIFT_CLASS("_TtC7Alderis12DialogButton") +@interface DialogButton : UIButton +- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +- (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE; +@end + + +SWIFT_CLASS("_TtC7Alderis13SeparatorView") +@interface SeparatorView : UIView +- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER; +- (void)updateConstraints; +- (void)didMoveToWindow; +- (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE; +@end + + +@interface UIColor (SWIFT_EXTENSION(Alderis)) +/// Maps init(propertyListValue:) to Objective-C due to Swift limitations. This is an +/// implementation detail. Ignore this and use UIColor(propertyListValue:) or +/// -[UIColor initWithHbcp_propertyListValue:] as per usual. +///
    +///
  • +/// see: init(propertyListValue:) +///
  • +///
+/// \param value The object to retrieve data from. See the discussion for the supported +/// object types. +/// +/// +/// returns: +/// An initialized color object, or nil if the value does not conform to the expected +/// type. The color information represented by this object is in the device RGB colorspace. +/// device RGB colorspace. +- (nullable instancetype)initWithHbcp_propertyListValue:(id _Nullable)propertyListValue; +/// Returns a string that represents the color. +/// The output is a string in the format #AABBCC:0.5, where the initial #AABBCC portion is a +/// 6-character CSS-style hex string, and the final :0.5 portion represents the alpha value. If +/// the color’s alpha value is 1, the alpha portion is excluded. +/// If the color is dynamic, for instance if it is a UIKit system color, or initialised via +/// UIColor(dynamicProvider:), the color that matches the current trait collection is used. +///
    +///
  • +/// see: init(propertyListValue:) +///
  • +///
+/// +/// returns: +/// A string representing the color, in the format discussed above. +@property (nonatomic, readonly, copy) NSString * _Nonnull hbcp_propertyListValue; +@end + +#if __has_attribute(external_source_symbol) +# pragma clang attribute pop +#endif +#pragma clang diagnostic pop + +#endif diff --git a/Natives/resources/Frameworks/Alderis.framework/Headers/Alderis.h b/Natives/resources/Frameworks/Alderis.framework/Headers/Alderis.h new file mode 100644 index 00000000..4836fe1a --- /dev/null +++ b/Natives/resources/Frameworks/Alderis.framework/Headers/Alderis.h @@ -0,0 +1,11 @@ +// +// Alderis.h +// Alderis +// +// Created by Adam Demasi on 16/3/20. +// Copyright © 2020 HASHBANG Productions. All rights reserved. +// + +#import + +#import "AlderisSDKCompatibility.h" diff --git a/Natives/resources/Frameworks/Alderis.framework/Headers/AlderisSDKCompatibility.h b/Natives/resources/Frameworks/Alderis.framework/Headers/AlderisSDKCompatibility.h new file mode 100644 index 00000000..3f2bfd71 --- /dev/null +++ b/Natives/resources/Frameworks/Alderis.framework/Headers/AlderisSDKCompatibility.h @@ -0,0 +1,21 @@ +// +// AlderisSDKCompatibility.h +// Alderis +// +// Created by Adam Demasi on 3/10/20. +// Copyright © 2020 HASHBANG Productions. All rights reserved. +// + +#import + +#ifndef __IPHONE_14_0 +// Allows building with the iOS 13 SDK while retaining iOS 14 compatibility. + +@interface UIControl () + +- (void)addAction:(UIAction *)action forControlEvents:(UIControlEvents)controlEvents NS_SWIFT_NAME(addAction(_:for:)) API_AVAILABLE(ios(14.0)); +- (void)removeAction:(UIAction *)action forControlEvents:(UIControlEvents)controlEvents NS_SWIFT_NAME(removeAction(_:for:)) API_AVAILABLE(ios(14.0)); +- (void)removeActionForIdentifier:(UIActionIdentifier)actionIdentifier forControlEvents:(UIControlEvents)controlEvents NS_SWIFT_NAME(removeAction(identifiedBy:for:)) API_AVAILABLE(ios(14.0)); + +@end +#endif diff --git a/Natives/resources/Frameworks/Alderis.framework/Info.plist b/Natives/resources/Frameworks/Alderis.framework/Info.plist new file mode 100644 index 00000000..bf60b1b3 Binary files /dev/null and b/Natives/resources/Frameworks/Alderis.framework/Info.plist differ diff --git a/README.md b/README.md index 6b4db92d..8c50f790 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ PojavLauncher is amazing, and surprisingly stable, and it wouldn't be this way w - [OpenJDK 16](https://www.ios-repo-updates.com/repository/procursus/package/openjdk-16-jre) ported to iOS by @Diatrus: [GNU GPLv2 License](https://openjdk.java.net/legal/gplv2+ce.html). - [LWJGL3](https://github.com/PojavLauncherTeam/lwjgl3): [BSD-3 License](https://github.com/LWJGL/lwjgl3/blob/master/LICENSE.md). - [LWJGLX](https://github.com/PojavLauncherTeam/lwjglx) (LWJGL2 API compatibility layer for LWJGL3): unknown license. +- [Alderis](https://github.com/hbang/Alderis) (color picker for iOS < 14): [Apache 2.0 License](https://github.com/hbang/Alderis/blob/master/LICENSE.md). - [DBNumberedSlider](https://github.com/immago/DBNumberedSlider): [Apache 2.0 License](https://github.com/immago/DBNumberedSlider/blob/master/LICENSE) - [fishhook](https://github.com/facebook/fishhook) (jailed environment usage only): [BSD-3 License](https://github.com/facebook/fishhook/blob/main/LICENSE). - [Java Native Access](https://github.com/java-native-access/jna): [Apache 2.0 License](https://github.com/java-native-access/jna/blob/master/LICENSE).