mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2024-11-23 04:00:00 +00:00
Add/fix lots of protocols and type definitions
This commit is contained in:
parent
daaca1710c
commit
16206c19e0
@ -88,6 +88,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
#import <AppKit/NSImageCell.h>
|
||||
#import <AppKit/NSImageRep.h>
|
||||
#import <AppKit/NSImageView.h>
|
||||
#import <AppKit/NSInputServer.h>
|
||||
#import <AppKit/NSInterfaceStyle.h>
|
||||
#import <AppKit/NSKeyBindingManager.h>
|
||||
#import <AppKit/NSKeyValueBinding.h>
|
||||
@ -124,6 +125,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
#import <AppKit/NSPathControl.h>
|
||||
#import <AppKit/NSPopUpButton.h>
|
||||
#import <AppKit/NSPopUpButtonCell.h>
|
||||
#import <AppKit/NSPopover.h>
|
||||
#import <AppKit/NSPopoverTouchBarItem.h>
|
||||
#import <AppKit/NSPrintInfo.h>
|
||||
#import <AppKit/NSPrintOperation.h>
|
||||
@ -150,6 +152,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
#import <AppKit/NSSliderCell.h>
|
||||
#import <AppKit/NSSound.h>
|
||||
#import <AppKit/NSSpaceTouchBarItem.h>
|
||||
#import <AppKit/NSSpeechRecognizer.h>
|
||||
#import <AppKit/NSSpeechSynthesizer.h>
|
||||
#import <AppKit/NSSpellChecker.h>
|
||||
#import <AppKit/NSSplitView.h>
|
||||
@ -174,6 +177,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
#import <AppKit/NSTextContainer.h>
|
||||
#import <AppKit/NSTextField.h>
|
||||
#import <AppKit/NSTextFieldCell.h>
|
||||
#import <AppKit/NSTextFinder.h>
|
||||
#import <AppKit/NSTextList.h>
|
||||
#import <AppKit/NSTextStorage.h>
|
||||
#import <AppKit/NSTextTab.h>
|
||||
@ -192,11 +196,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
#import <AppKit/NSTreeController.h>
|
||||
#import <AppKit/NSTreeNode.h>
|
||||
#import <AppKit/NSUserDefaultsController.h>
|
||||
#import <AppKit/NSUserInterfaceItemIdentification.h>
|
||||
#import <AppKit/NSUserInterfaceItemSearching.h>
|
||||
#import <AppKit/NSView.h>
|
||||
#import <AppKit/NSViewController.h>
|
||||
#import <AppKit/NSVisualEffectView.h>
|
||||
#import <AppKit/NSWindow.h>
|
||||
#import <AppKit/NSWindowController.h>
|
||||
#import <AppKit/NSWindowRestoration.h>
|
||||
#import <AppKit/NSWorkspace.h>
|
||||
|
||||
#import <ApplicationServices/ApplicationServices.h>
|
||||
|
@ -99,6 +99,6 @@ typedef NSInteger NSModalResponse;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (NSAlertDelegate)
|
||||
@protocol NSAlertDelegate <NSObject>
|
||||
- (BOOL) alertShowHelp: (NSAlert *) alert;
|
||||
@end
|
||||
|
@ -109,7 +109,7 @@ APPKIT_EXPORT NSString *NSAnimationTriggerOrderOut;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (NSAnimationDelegate)
|
||||
@protocol NSAnimationDelegate <NSObject>
|
||||
- (BOOL) animationShouldStart: (NSAnimation *) animation;
|
||||
- (float) animation: (NSAnimation *) animation
|
||||
valueForProgress: (NSAnimationProgress) progress;
|
||||
|
@ -134,7 +134,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (NSBrowser_delegate)
|
||||
@protocol NSBrowserDelegate <NSObject>
|
||||
- (BOOL) browser: (NSBrowser *) browser isColumnValid: (NSInteger) column;
|
||||
|
||||
- (NSInteger) browser: (NSBrowser *) browser
|
||||
|
@ -66,3 +66,7 @@ typedef NSString *NSCollectionViewSupplementaryElementKind;
|
||||
- (NSCollectionViewItem *) newItemForRepresentedObject: object;
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSCollectionViewDelegate <NSObject>
|
||||
// TODO
|
||||
@end
|
||||
|
@ -69,9 +69,15 @@ APPKIT_EXPORT NSString *const NSComboBoxWillPopUpNotification;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (NSComboBox)
|
||||
@protocol NSComboBoxDelegate <NSObject>
|
||||
- (void) comboBoxWillPopUp: (NSNotification *) note;
|
||||
- (void) comboBoxWillDismiss: (NSNotification *) note;
|
||||
- (void) comboBoxSelectionDidChange: (NSNotification *) note;
|
||||
- (void) comboBoxSelectionIsChanging: (NSNotification *) note;
|
||||
@end
|
||||
|
||||
@protocol NSComboBoxDataSource <NSObject>
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
||||
|
@ -82,7 +82,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (NSComboBoxCell_dataSource)
|
||||
@protocol NSComboBoxCellDataSource <NSObject>
|
||||
- (NSString *) comboBoxCell: (NSComboBoxCell *) cell
|
||||
completedString: (NSString *) string;
|
||||
@end
|
||||
|
@ -101,7 +101,7 @@ typedef NSUInteger NSDatePickerStyle;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (NSDatePickerCellDelegate)
|
||||
@protocol NSDatePickerCellDelegate <NSObject>
|
||||
- (void) datePickerCell: (NSDatePickerCell *) datePickerCell
|
||||
validateProposedDateValue: (NSDate **) dateValue
|
||||
timeInterval: (NSTimeInterval *) timeInterval;
|
||||
|
@ -25,3 +25,7 @@
|
||||
- (void) display;
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSDockTilePlugIn <NSObject>
|
||||
|
||||
@end
|
||||
|
@ -47,7 +47,7 @@ enum {
|
||||
- (NSArray *) namesOfPromisedFilesDroppedAtDestination: (NSURL *) destination;
|
||||
@end
|
||||
|
||||
@interface NSObject (NSDragging_destination)
|
||||
@protocol NSDraggingDestination <NSObject>
|
||||
- (BOOL) prepareForDragOperation: (id<NSDraggingInfo>) sender;
|
||||
- (BOOL) performDragOperation: (id<NSDraggingInfo>) sender;
|
||||
- (void) concludeDragOperation: (id<NSDraggingInfo>) sender;
|
||||
@ -59,7 +59,7 @@ enum {
|
||||
- (BOOL) wantsPeriodicDraggingUpdates;
|
||||
@end
|
||||
|
||||
@interface NSObject (NSDragging_source)
|
||||
@protocol NSDraggingSource <NSObject>
|
||||
- (BOOL) ignoreModifierKeysWhileDragging;
|
||||
- (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL) flag;
|
||||
- (void) draggedImage: (NSImage *) image beganAt: (NSPoint) point;
|
||||
|
@ -113,7 +113,7 @@ APPKIT_EXPORT NSString *const NSDrawerDidCloseNotification;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (NSDrawer_delegate)
|
||||
@protocol NSDrawerDelegate <NSObject>
|
||||
|
||||
- (NSSize) drawerWillResizeContents: (NSDrawer *) drawer
|
||||
toSize: (NSSize) contentSize;
|
||||
|
@ -153,6 +153,12 @@ typedef enum {
|
||||
- (NSString *) pathForImageResource: (NSString *) name;
|
||||
@end
|
||||
|
||||
@protocol NSImageDelegate <NSObject>
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
||||
|
||||
typedef NSString *NSImageName;
|
||||
typedef NSString *NSImageHintKey;
|
||||
|
||||
@ -224,4 +230,4 @@ APPKIT_EXPORT NSImageName const NSImageNameTouchBarPauseTemplate;
|
||||
APPKIT_EXPORT NSImageName const NSImageNameTouchBarPlayTemplate;
|
||||
APPKIT_EXPORT NSImageName const NSImageNameTouchBarRecordStopTemplate;
|
||||
|
||||
APPKIT_EXPORT NSImageHintKey const NSImageHintInterpolation;
|
||||
APPKIT_EXPORT NSImageHintKey const NSImageHintInterpolation;
|
||||
|
13
AppKit/include/AppKit/NSInputServer.h
Normal file
13
AppKit/include/AppKit/NSInputServer.h
Normal file
@ -0,0 +1,13 @@
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
@protocol NSInputServiceProvider
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSInputServerMouseTracker
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
@ -281,3 +281,7 @@ typedef enum {
|
||||
atCharacterIndex: (NSUInteger) charIndex
|
||||
effectiveRange: (NSRangePointer) effectiveCharRange;
|
||||
@end
|
||||
|
||||
@protocol NSTextLayoutOrientationProvider
|
||||
|
||||
@end
|
||||
|
@ -177,3 +177,9 @@ typedef enum {
|
||||
- (BOOL) sendAction;
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSMatrixDelegate <NSControlTextEditingDelegate>
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
||||
|
@ -20,6 +20,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
#import <AppKit/AppKitExport.h>
|
||||
#import <AppKit/NSDragging.h>
|
||||
#import <AppKit/NSTableView.h>
|
||||
#import <AppKit/NSControl.h>
|
||||
|
||||
@class NSTableColumn, NSButtonCell;
|
||||
|
||||
@ -95,7 +96,7 @@ APPKIT_EXPORT NSString *const NSOutlineViewDisclosureButtonKey;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (NSOutlineView_dataSource)
|
||||
@protocol NSOutlineViewDataSource <NSObject>
|
||||
- (NSInteger) outlineView: (NSOutlineView *) outlineView
|
||||
numberOfChildrenOfItem: item;
|
||||
- (BOOL) outlineView: (NSOutlineView *) outlineView isItemExpandable: item;
|
||||
@ -111,7 +112,7 @@ APPKIT_EXPORT NSString *const NSOutlineViewDisclosureButtonKey;
|
||||
byItem: item;
|
||||
@end
|
||||
|
||||
@interface NSObject (NSOutlineView_delegate)
|
||||
@protocol NSOutlineViewDelegate <NSControlTextEditingDelegate>
|
||||
- (BOOL) outlineView: (NSOutlineView *) outlineView shouldExpandItem: item;
|
||||
- (BOOL) outlineView: (NSOutlineView *) outlineView shouldCollapseItem: item;
|
||||
- (BOOL) selectionShouldChangeInOutlineView: (NSOutlineView *) outlineView;
|
||||
|
@ -4,3 +4,7 @@
|
||||
@interface NSPageController : NSViewController
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSPageControllerDelegate <NSObject>
|
||||
|
||||
@end
|
||||
|
@ -110,3 +110,15 @@ APPKIT_EXPORT const NSPasteboardReadingOptionKey
|
||||
- (BOOL) setPropertyList: plist forType: (NSPasteboardType) type;
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSPasteboardReading <NSObject>
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSPasteboardWriting <NSObject>
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
||||
|
@ -21,3 +21,9 @@
|
||||
|
||||
@interface NSPasteboardItem : NSObject
|
||||
@end
|
||||
|
||||
@protocol NSPasteboardItemDataProvider <NSObject>
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
||||
|
@ -66,3 +66,9 @@ typedef NSInteger NSPathStyle;
|
||||
- (void) setDelegate: (id) delegate;
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSPathCellDelegate <NSObject>
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
||||
|
7
AppKit/include/AppKit/NSPopover.h
Normal file
7
AppKit/include/AppKit/NSPopover.h
Normal file
@ -0,0 +1,7 @@
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
@protocol NSPopoverDelegate <NSObject>
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
@ -34,5 +34,11 @@ typedef NSInteger NSPrintPanelOptions;
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSPrintPanelAccessorizing
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
||||
|
||||
APPKIT_EXPORT NSString *const NSPrintPanelAccessorySummaryItemNameKey;
|
||||
APPKIT_EXPORT NSString *const NSPrintPanelAccessorySummaryItemDescriptionKey;
|
||||
|
@ -7,3 +7,9 @@ APPKIT_EXPORT NSString *const NSRuleEditorRowsDidChangeNotification;
|
||||
@interface NSRuleEditor : NSControl <NSCoding>
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSRuleEditorDelegate <NSObject>
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
||||
|
@ -90,3 +90,9 @@ enum {
|
||||
- (IBAction) _selectFile: (id) sender;
|
||||
- (IBAction) _cancel: (id) sender;
|
||||
@end
|
||||
|
||||
@protocol NSOpenSavePanelDelegate <NSObject>
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
||||
|
@ -25,5 +25,13 @@
|
||||
@interface NSSharingServicePicker : NSObject
|
||||
@end
|
||||
|
||||
@protocol NSSharingServiceDelegate <NSObject>
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSSharingServicePickerDelegate <NSObject>
|
||||
|
||||
@end
|
||||
|
||||
// @interface NSItemProvider (NSCloudKitSharing)
|
||||
// @end
|
||||
|
@ -41,3 +41,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
@interface NSBundle (NSSound)
|
||||
- (NSString *) pathForSoundResource: (NSString *) sound;
|
||||
@end
|
||||
|
||||
@protocol NSSoundDelegate <NSObject>
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
||||
|
7
AppKit/include/AppKit/NSSpeechRecognizer.h
Normal file
7
AppKit/include/AppKit/NSSpeechRecognizer.h
Normal file
@ -0,0 +1,7 @@
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
@protocol NSSpeechRecognizerDelegate <NSObject>
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
@ -25,3 +25,9 @@ APPKIT_EXPORT NSString *const NSVoiceName;
|
||||
|
||||
@interface NSSpeechSynthesizer : NSObject
|
||||
@end
|
||||
|
||||
@protocol NSSpeechSynthesizerDelegate <NSObject>
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
||||
|
@ -61,7 +61,7 @@ typedef enum {
|
||||
|
||||
// nb. it looks like the API for this is changed in MacOS X, replacing
|
||||
// splitView:constrainMix:max:ofSubviewAt with two individual methods for each.
|
||||
@interface NSObject (NSSplitView_delegate)
|
||||
@protocol NSSplitViewDelegate <NSObject>
|
||||
- (BOOL) splitView: (NSSplitView *) splitView
|
||||
canCollapseSubview: (NSView *) subview;
|
||||
- (BOOL) splitView: (NSSplitView *) splitView
|
||||
|
@ -93,7 +93,7 @@ typedef enum {
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (NSTabView_delegate)
|
||||
@protocol NSTabViewDelegate <NSObject>
|
||||
- (void) tabViewDidChangeNumberOfTabViewItems: (NSTabView *) tabView;
|
||||
|
||||
- (BOOL) tabView: (NSTabView *) tabView
|
||||
|
@ -242,7 +242,7 @@ typedef enum {
|
||||
- (void) setSortDescriptors: (NSArray *) value;
|
||||
@end
|
||||
|
||||
@interface NSObject (NSTableView_dataSource)
|
||||
@protocol NSTableViewDataSource <NSObject>
|
||||
- (NSInteger) numberOfRowsInTableView: (NSTableView *) tableView;
|
||||
- (id) tableView: (NSTableView *) tableView
|
||||
objectValueForTableColumn: (NSTableColumn *) tableColumn
|
||||
@ -264,7 +264,7 @@ typedef enum {
|
||||
dropOperation: (NSTableViewDropOperation) dropOperation;
|
||||
@end
|
||||
|
||||
@interface NSObject (NSTableView_delegate)
|
||||
@protocol NSTableViewDelegate <NSObject>
|
||||
- (BOOL) tableView: (NSTableView *) tableView
|
||||
shouldEditTableColumn: (NSTableColumn *) tableColumn
|
||||
row: (NSInteger) row;
|
||||
|
@ -50,3 +50,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (void) setTitleWithMnemonic: (NSString *) value;
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSTextFieldDelegate <NSObject>
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
||||
|
9
AppKit/include/AppKit/NSTextFinder.h
Normal file
9
AppKit/include/AppKit/NSTextFinder.h
Normal file
@ -0,0 +1,9 @@
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
@protocol NSTextFinderBarContainer <NSObject>
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSTextFinderClient <NSObject>
|
||||
|
||||
@end
|
5
AppKit/include/AppKit/NSTextInputClient.h
Normal file
5
AppKit/include/AppKit/NSTextInputClient.h
Normal file
@ -0,0 +1,5 @@
|
||||
@protocol NSTextInputClient
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
@ -60,7 +60,7 @@ APPKIT_EXPORT NSString *const NSTextStorageDidProcessEditingNotification;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (NSTextStorage_delegate)
|
||||
@protocol NSTextStorageDelegate <NSObject>
|
||||
- (void) textStorageWillProcessEditing: (NSNotification *) note;
|
||||
- (void) textStorageDidProcessEditing: (NSNotification *) note;
|
||||
@end
|
||||
|
@ -29,6 +29,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
#import <AppKit/NSParagraphStyle.h>
|
||||
#import <AppKit/NSText.h>
|
||||
#import <AppKit/NSTextInput.h>
|
||||
#import <AppKit/NSTextInputClient.h>
|
||||
|
||||
#import <Foundation/NSTextCheckingResult.h>
|
||||
|
||||
|
@ -35,3 +35,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
- (void) setCompletionDelay: (NSTimeInterval) delay;
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSTokenFieldDelegate <NSTextFieldDelegate>
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
||||
|
@ -46,3 +46,9 @@ typedef enum {
|
||||
- (void) setDelegate: delegate;
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSTokenFieldCellDelegate <NSObject>
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
||||
|
@ -0,0 +1,3 @@
|
||||
@protocol NSUserInterfaceItemIdentification
|
||||
|
||||
@end
|
7
AppKit/include/AppKit/NSUserInterfaceItemSearching.h
Normal file
7
AppKit/include/AppKit/NSUserInterfaceItemSearching.h
Normal file
@ -0,0 +1,7 @@
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
@protocol NSUserInterfaceItemSearching <NSObject>
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
@ -4,3 +4,9 @@
|
||||
- (NSInteger) tag;
|
||||
- (SEL) action;
|
||||
@end
|
||||
|
||||
@protocol NSUserInterfaceValidations
|
||||
|
||||
// TODO
|
||||
|
||||
@end
|
||||
|
5
AppKit/include/AppKit/NSWindowRestoration.h
Normal file
5
AppKit/include/AppKit/NSWindowRestoration.h
Normal file
@ -0,0 +1,5 @@
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
@protocol NSWindowRestoration <NSObject>
|
||||
|
||||
@end
|
@ -28,13 +28,6 @@ bool CGAffineTransformIsIdentity(CGAffineTransform xform) {
|
||||
xform.tx == 0 && xform.ty == 0;
|
||||
}
|
||||
|
||||
CGAffineTransform CGAffineTransformMake(CGFloat a, CGFloat b, CGFloat c,
|
||||
CGFloat d, CGFloat tx, CGFloat ty)
|
||||
{
|
||||
CGAffineTransform xform = {a, b, c, d, tx, ty};
|
||||
return xform;
|
||||
}
|
||||
|
||||
CGAffineTransform CGAffineTransformMakeRotation(CGFloat radians) {
|
||||
CGAffineTransform xform = {
|
||||
cos(radians), sin(radians), -sin(radians), cos(radians), 0, 0};
|
||||
@ -106,24 +99,6 @@ CGAffineTransform CGAffineTransformTranslate(CGAffineTransform xform,
|
||||
return CGAffineTransformConcat(translate, xform);
|
||||
}
|
||||
|
||||
CGPoint CGPointApplyAffineTransform(CGPoint point, CGAffineTransform xform) {
|
||||
CGPoint p;
|
||||
|
||||
p.x = xform.a * point.x + xform.c * point.y + xform.tx;
|
||||
p.y = xform.b * point.x + xform.d * point.y + xform.ty;
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
CGSize CGSizeApplyAffineTransform(CGSize size, CGAffineTransform xform) {
|
||||
CGSize s;
|
||||
|
||||
s.width = xform.a * size.width + xform.c * size.height;
|
||||
s.height = xform.b * size.width + xform.d * size.height;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
CGRect CGRectApplyAffineTransform(CGRect rect, CGAffineTransform t) {
|
||||
printf("CGRectApplyAffineTransform STUB\n");
|
||||
return rect;
|
||||
|
@ -33,8 +33,14 @@ COREGRAPHICS_EXPORT const CGAffineTransform CGAffineTransformIdentity;
|
||||
|
||||
COREGRAPHICS_EXPORT bool CGAffineTransformIsIdentity(CGAffineTransform xform);
|
||||
|
||||
COREGRAPHICS_EXPORT CGAffineTransform CGAffineTransformMake(
|
||||
CGFloat a, CGFloat b, CGFloat c, CGFloat d, CGFloat tx, CGFloat ty);
|
||||
static CGAffineTransform __CGAffineTransformMake(CGFloat a, CGFloat b, CGFloat c,
|
||||
CGFloat d, CGFloat tx, CGFloat ty)
|
||||
{
|
||||
CGAffineTransform xform = {a, b, c, d, tx, ty};
|
||||
return xform;
|
||||
}
|
||||
#define CGAffineTransformMake __CGAffineTransformMake
|
||||
|
||||
COREGRAPHICS_EXPORT CGAffineTransform
|
||||
CGAffineTransformMakeRotation(CGFloat radians);
|
||||
COREGRAPHICS_EXPORT CGAffineTransform
|
||||
@ -54,10 +60,25 @@ CGAffineTransformScale(CGAffineTransform xform, CGFloat scalex, CGFloat scaley);
|
||||
COREGRAPHICS_EXPORT CGAffineTransform
|
||||
CGAffineTransformTranslate(CGAffineTransform xform, CGFloat tx, CGFloat ty);
|
||||
|
||||
COREGRAPHICS_EXPORT CGPoint
|
||||
CGPointApplyAffineTransform(CGPoint point, CGAffineTransform xform);
|
||||
COREGRAPHICS_EXPORT CGSize CGSizeApplyAffineTransform(CGSize size,
|
||||
CGAffineTransform xform);
|
||||
static CGPoint __CGPointApplyAffineTransform(CGPoint point, CGAffineTransform xform) {
|
||||
CGPoint p;
|
||||
|
||||
p.x = xform.a * point.x + xform.c * point.y + xform.tx;
|
||||
p.y = xform.b * point.x + xform.d * point.y + xform.ty;
|
||||
|
||||
return p;
|
||||
}
|
||||
#define CGPointApplyAffineTransform __CGPointApplyAffineTransform
|
||||
|
||||
static CGSize __CGSizeApplyAffineTransform(CGSize size, CGAffineTransform xform) {
|
||||
CGSize s;
|
||||
|
||||
s.width = xform.a * size.width + xform.c * size.height;
|
||||
s.height = xform.b * size.width + xform.d * size.height;
|
||||
|
||||
return s;
|
||||
}
|
||||
#define CGSizeApplyAffineTransform __CGSizeApplyAffineTransform
|
||||
|
||||
COREGRAPHICS_EXPORT CGRect CGRectApplyAffineTransform(CGRect rect,
|
||||
CGAffineTransform t);
|
||||
|
@ -10,11 +10,13 @@ typedef double CGFloat;
|
||||
#define CGFLOAT_MIN DBL_MIN
|
||||
#define CGFLOAT_MAX DBL_MAX
|
||||
#define CGFLOAT_SCAN "%lg"
|
||||
#define CGFLOAT_IS_DOUBLE 1
|
||||
#else
|
||||
typedef float CGFloat;
|
||||
#define CGFLOAT_MIN FLT_MIN
|
||||
#define CGFLOAT_MAX FLT_MAX
|
||||
#define CGFLOAT_SCAN "%g"
|
||||
#define CGFLOAT_IS_DOUBLE 0
|
||||
#endif
|
||||
|
||||
#define CGFLOAT_DEFINED 1
|
||||
|
@ -13,6 +13,19 @@ typedef struct CF_BRIDGED_TYPE(id) O2DataProvider *CGDataProviderRef;
|
||||
|
||||
typedef void (*CGDataProviderReleaseDataCallback)(void *info, const void *data, size_t size);
|
||||
|
||||
typedef size_t (*CGDataProviderGetBytesCallback)(void* info, void* buffer, size_t count);
|
||||
typedef off_t (*CGDataProviderSkipForwardCallback)(void* info, off_t count);
|
||||
typedef void (*CGDataProviderRewindCallback)(void* info);
|
||||
typedef void (*CGDataProviderReleaseInfoCallback)(void* info);
|
||||
|
||||
typedef struct CGDataProviderSequentialCallbacks {
|
||||
unsigned int version;
|
||||
CGDataProviderGetBytesCallback getBytes;
|
||||
CGDataProviderSkipForwardCallback skipForward;
|
||||
CGDataProviderRewindCallback rewind;
|
||||
CGDataProviderReleaseInfoCallback releaseInfo;
|
||||
} CGDataProviderSequentialCallbacks;
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
|
||||
COREGRAPHICS_EXPORT CGDataProviderRef CGDataProviderRetain(CGDataProviderRef provider);
|
||||
@ -22,6 +35,8 @@ COREGRAPHICS_EXPORT CGDataProviderRef CGDataProviderCreateWithCFData(CFDataRef d
|
||||
|
||||
COREGRAPHICS_EXPORT CGDataProviderRef CGDataProviderCreateWithData(void *info, const void *data, size_t size, CGDataProviderReleaseDataCallback releaseCallback);
|
||||
|
||||
COREGRAPHICS_EXPORT CGDataProviderRef __nullable CGDataProviderCreateSequential(void* info, const CGDataProviderSequentialCallbacks* callbacks);
|
||||
|
||||
COREGRAPHICS_EXPORT CFDataRef CGDataProviderCopyData(CGDataProviderRef self);
|
||||
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
15
CoreGraphics/include/CoreGraphics/CGDisplayConfiguration.h
Normal file
15
CoreGraphics/include/CoreGraphics/CGDisplayConfiguration.h
Normal file
@ -0,0 +1,15 @@
|
||||
#import <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
typedef CF_OPTIONS(uint32_t, CGDisplayChangeSummaryFlags) {
|
||||
kCGDisplayBeginConfigurationFlag = (1 << 0),
|
||||
kCGDisplayMovedFlag = (1 << 1),
|
||||
kCGDisplaySetMainFlag = (1 << 2),
|
||||
kCGDisplaySetModeFlag = (1 << 3),
|
||||
kCGDisplayAddFlag = (1 << 4),
|
||||
kCGDisplayRemoveFlag = (1 << 5),
|
||||
kCGDisplayEnabledFlag = (1 << 8),
|
||||
kCGDisplayDisabledFlag = (1 << 9),
|
||||
kCGDisplayMirrorFlag = (1 << 10),
|
||||
kCGDisplayUnMirrorFlag = (1 << 11),
|
||||
kCGDisplayDesktopShapeChangedFlag = (1 << 12),
|
||||
};
|
@ -28,6 +28,8 @@ typedef uint16_t CGGlyph;
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
|
||||
COREGRAPHICS_EXPORT CFArrayRef CGFontCopyTableTags(CGFontRef font);
|
||||
|
||||
COREGRAPHICS_EXPORT CGFontRef CGFontCreateWithFontName(CFStringRef name);
|
||||
COREGRAPHICS_EXPORT CGFontRef CGFontRetain(CGFontRef self);
|
||||
COREGRAPHICS_EXPORT void CGFontRelease(CGFontRef self);
|
||||
|
@ -22,6 +22,8 @@
|
||||
|
||||
#include <CoreFoundation/CFString.h>
|
||||
#include <CoreGraphics/CoreGraphicsExport.h>
|
||||
#include <CoreGraphics/CGContext.h>
|
||||
#include <CoreGraphics/CGDataConsumer.h>
|
||||
|
||||
COREGRAPHICS_EXPORT const CFStringRef kCGPDFContextKeywords;
|
||||
COREGRAPHICS_EXPORT const CFStringRef kCGPDFContextTitle;
|
||||
|
1
CoreGraphics/include/CoreGraphics/CGPDFDictionary.h
Normal file
1
CoreGraphics/include/CoreGraphics/CGPDFDictionary.h
Normal file
@ -0,0 +1 @@
|
||||
typedef struct CGPDFDictionary *CGPDFDictionaryRef;
|
1
CoreGraphics/include/CoreGraphics/CGPDFObject.h
Normal file
1
CoreGraphics/include/CoreGraphics/CGPDFObject.h
Normal file
@ -0,0 +1 @@
|
||||
typedef struct CGPDFObject* CGPDFObjectRef;
|
22
CoreGraphics/include/CoreGraphics/CGPSConverter.h
Normal file
22
CoreGraphics/include/CoreGraphics/CGPSConverter.h
Normal file
@ -0,0 +1,22 @@
|
||||
#import <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
typedef struct CF_BRIDGED_TYPE(id) CGPSConverter* CGPSConverterRef;
|
||||
|
||||
typedef void (*CGPSConverterBeginDocumentCallback)(void* info);
|
||||
typedef void (*CGPSConverterEndDocumentCallback)(void* info, bool success);
|
||||
typedef void (*CGPSConverterBeginPageCallback)(void* info, size_t pageNumber, CFDictionaryRef pageInfo);
|
||||
typedef void (*CGPSConverterEndPageCallback)(void* info, size_t pageNumber, CFDictionaryRef pageInfo);
|
||||
typedef void (*CGPSConverterProgressCallback)(void* info);
|
||||
typedef void (*CGPSConverterMessageCallback)(void* info, CFStringRef message);
|
||||
typedef void (*CGPSConverterReleaseInfoCallback)(void* info);
|
||||
|
||||
typedef struct CGPSConverterCallbacks {
|
||||
unsigned int version;
|
||||
CGPSConverterBeginDocumentCallback beginDocument;
|
||||
CGPSConverterEndDocumentCallback endDocument;
|
||||
CGPSConverterBeginPageCallback beginPage;
|
||||
CGPSConverterEndPageCallback endPage;
|
||||
CGPSConverterProgressCallback noteProgress;
|
||||
CGPSConverterMessageCallback noteMessage;
|
||||
CGPSConverterReleaseInfoCallback releaseInfo;
|
||||
} CGPSConverterCallbacks;
|
@ -27,6 +27,7 @@ typedef uint32_t CGButtonCount;
|
||||
typedef uint32_t CGWheelCount;
|
||||
typedef uint16_t CGCharCode;
|
||||
typedef uint16_t CGKeyCode;
|
||||
typedef uint32_t CGRectCount;
|
||||
|
||||
typedef CF_OPTIONS(uint32_t, CGEventFilterMask) {
|
||||
kCGEventFilterMaskPermitLocalMouseEvents = 0x00000001,
|
||||
@ -40,6 +41,16 @@ typedef CF_ENUM(uint32_t, CGEventSuppressionState) {
|
||||
kCGNumberOfEventSuppressionStates
|
||||
};
|
||||
|
||||
typedef CF_OPTIONS(uint32_t, CGScreenUpdateOperation) {
|
||||
kCGScreenUpdateOperationRefresh = 0,
|
||||
kCGScreenUpdateOperationMove = 1u << 0,
|
||||
kCGScreenUpdateOperationReducedDirtyRectangleCount = 1u << 31,
|
||||
};
|
||||
|
||||
typedef struct CGScreenUpdateMoveDelta {
|
||||
int32_t dX, dY;
|
||||
} CGScreenUpdateMoveDelta;
|
||||
|
||||
#define kCGEventFilterMaskPermitAllEvents (kCGEventFilterMaskPermitLocalMouseEvents | kCGEventFilterMaskPermitLocalKeyboardEvents | kCGEventFilterMaskPermitSystemDefinedEvents)
|
||||
|
||||
// TODO: All those deprecated functions
|
||||
|
@ -1,3 +1,5 @@
|
||||
#ifdef __OBJC__
|
||||
|
||||
#import <CoreGraphics/CGGeometry.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@ -11,3 +13,5 @@
|
||||
- (void) setFrame: (CGRect) frame;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
@ -20,7 +20,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#import <CoreGraphics/CGSubWindow.h>
|
||||
#import <CoreGraphics/CGWindowLevel.h>
|
||||
#import <CoreGraphics/CGImage.h>
|
||||
#ifdef __OBJC__
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
#import <OpenGL/CGLTypes.h>
|
||||
|
||||
extern const CFStringRef kCGWindowAlpha;
|
||||
@ -28,7 +31,9 @@ extern const CFStringRef kCGWindowBounds;
|
||||
extern const CFStringRef kCGWindowLayer;
|
||||
extern const CFStringRef kCGWindowOwnerPID;
|
||||
|
||||
#ifdef __OBJC__
|
||||
@class CGEvent;
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
CGSBackingStoreRetained = 0,
|
||||
@ -36,6 +41,27 @@ typedef enum {
|
||||
CGSBackingStoreBuffered = 2
|
||||
} CGSBackingStoreType;
|
||||
|
||||
typedef CF_OPTIONS(uint32_t, CGWindowListOption) {
|
||||
kCGWindowListOptionAll = 0,
|
||||
kCGWindowListOptionOnScreenOnly = (1 << 0),
|
||||
kCGWindowListOptionOnScreenAboveWindow = (1 << 1),
|
||||
kCGWindowListOptionOnScreenBelowWindow = (1 << 2),
|
||||
kCGWindowListOptionIncludingWindow = (1 << 3),
|
||||
kCGWindowListExcludeDesktopElements = (1 << 4),
|
||||
};
|
||||
|
||||
typedef CF_OPTIONS(uint32_t, CGWindowImageOption) {
|
||||
kCGWindowImageDefault = 0,
|
||||
kCGWindowImageBoundsIgnoreFraming = (1 << 0),
|
||||
kCGWindowImageShouldBeOpaque = (1 << 1),
|
||||
kCGWindowImageOnlyShadows = (1 << 2),
|
||||
kCGWindowImageBestResolution = (1 << 3),
|
||||
kCGWindowImageNominalResolution = (1 << 4),
|
||||
};
|
||||
|
||||
typedef uint32_t CGWindowID;
|
||||
|
||||
#ifdef __OBJC__
|
||||
@interface CGWindow : NSObject
|
||||
|
||||
- (void) setDelegate: delegate;
|
||||
@ -138,3 +164,12 @@ typedef enum {
|
||||
- (void) platformWindowShouldZoom: (CGWindow *) window;
|
||||
|
||||
@end
|
||||
#endif
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
|
||||
COREGRAPHICS_EXPORT CFArrayRef CGWindowListCreate(CGWindowListOption option, CGWindowID relativeToWindow);
|
||||
COREGRAPHICS_EXPORT CFArrayRef CGWindowListCreateDescriptionFromArray(CFArrayRef windowArray);
|
||||
COREGRAPHICS_EXPORT CGImageRef CGWindowListCreateImageFromArray(CGRect screenBounds, CFArrayRef windowArray, CGWindowImageOption imageOption);
|
||||
|
||||
CF_IMPLICIT_BRIDGING_DISABLED
|
||||
|
@ -15,18 +15,23 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
#import <CoreGraphics/CGDataProvider.h>
|
||||
#import <CoreGraphics/CGDirectDisplay.h>
|
||||
#import <CoreGraphics/CGDisplayFade.h>
|
||||
#import <CoreGraphics/CGDisplayConfiguration.h>
|
||||
#import <CoreGraphics/CGFont.h>
|
||||
#import <CoreGraphics/CGFunction.h>
|
||||
#import <CoreGraphics/CGGeometry.h>
|
||||
#import <CoreGraphics/CGImage.h>
|
||||
#import <CoreGraphics/CGLayer.h>
|
||||
#import <CoreGraphics/CGPDFContext.h>
|
||||
#import <CoreGraphics/CGPDFDictionary.h>
|
||||
#import <CoreGraphics/CGPDFDocument.h>
|
||||
#import <CoreGraphics/CGPDFObject.h>
|
||||
#import <CoreGraphics/CGPDFPage.h>
|
||||
#import <CoreGraphics/CGPath.h>
|
||||
#import <CoreGraphics/CGPattern.h>
|
||||
#import <CoreGraphics/CGPSConverter.h>
|
||||
#import <CoreGraphics/CGShading.h>
|
||||
#import <CoreGraphics/CGWindowLevel.h>
|
||||
#import <CoreGraphics/CGWindow.h>
|
||||
|
||||
#include <CoreGraphics/CGEvent.h>
|
||||
#include <CoreGraphics/CGPDFContext.h>
|
||||
|
@ -51,6 +51,13 @@ typedef enum {
|
||||
kCTFontControlContentFontType = 26
|
||||
} CTFontUIFontType;
|
||||
|
||||
typedef CF_OPTIONS(uint32_t, CTFontTableOptions) {
|
||||
kCTFontTableOptionNoOptions = 0,
|
||||
kCTFontTableOptionExcludeSynthetic = 1,
|
||||
};
|
||||
|
||||
typedef FourCharCode CTFontTableTag;
|
||||
|
||||
CF_IMPLICIT_BRIDGING_ENABLED
|
||||
|
||||
CORETEXT_EXPORT CTFontRef CTFontCreateWithGraphicsFont(
|
||||
|
61
CoreText/include/CoreText/CTParagraphStyle.h
Normal file
61
CoreText/include/CoreText/CTParagraphStyle.h
Normal file
@ -0,0 +1,61 @@
|
||||
#import <CoreFoundation/CFBase.h>
|
||||
|
||||
typedef const struct __CTParagraphStyle* CTParagraphStyleRef;
|
||||
|
||||
typedef CF_ENUM(uint32_t, CTParagraphStyleSpecifier) {
|
||||
kCTParagraphStyleSpecifierAlignment = 0,
|
||||
kCTParagraphStyleSpecifierFirstLineHeadIndent = 1,
|
||||
kCTParagraphStyleSpecifierHeadIndent = 2,
|
||||
kCTParagraphStyleSpecifierTailIndent = 3,
|
||||
kCTParagraphStyleSpecifierTabStops = 4,
|
||||
kCTParagraphStyleSpecifierDefaultTabInterval = 5,
|
||||
kCTParagraphStyleSpecifierLineBreakMode = 6,
|
||||
kCTParagraphStyleSpecifierLineHeightMultiple = 7,
|
||||
kCTParagraphStyleSpecifierMaximumLineHeight = 8,
|
||||
kCTParagraphStyleSpecifierMinimumLineHeight = 9,
|
||||
kCTParagraphStyleSpecifierLineSpacing = 10,
|
||||
kCTParagraphStyleSpecifierParagraphSpacing = 11,
|
||||
kCTParagraphStyleSpecifierParagraphSpacingBefore = 12,
|
||||
kCTParagraphStyleSpecifierBaseWritingDirection = 13,
|
||||
kCTParagraphStyleSpecifierMaximumLineSpacing = 14,
|
||||
kCTParagraphStyleSpecifierMinimumLineSpacing = 15,
|
||||
kCTParagraphStyleSpecifierLineSpacingAdjustment = 16,
|
||||
kCTParagraphStyleSpecifierLineBoundsOptions = 17,
|
||||
|
||||
kCTParagraphStyleSpecifierCount
|
||||
};
|
||||
|
||||
typedef CF_ENUM(uint8_t, CTTextAlignment) {
|
||||
kCTTextAlignmentLeft = 0,
|
||||
kCTTextAlignmentRight = 1,
|
||||
kCTTextAlignmentCenter = 2,
|
||||
kCTTextAlignmentJustified = 3,
|
||||
kCTTextAlignmentNatural = 4,
|
||||
|
||||
kCTLeftTextAlignment = kCTTextAlignmentLeft,
|
||||
kCTRightTextAlignment = kCTTextAlignmentRight,
|
||||
kCTCenterTextAlignment = kCTTextAlignmentCenter,
|
||||
kCTJustifiedTextAlignment = kCTTextAlignmentJustified,
|
||||
kCTNaturalTextAlignment = kCTTextAlignmentNatural,
|
||||
};
|
||||
|
||||
typedef CF_ENUM(uint8_t, CTLineBreakMode) {
|
||||
kCTLineBreakByWordWrapping = 0,
|
||||
kCTLineBreakByCharWrapping = 1,
|
||||
kCTLineBreakByClipping = 2,
|
||||
kCTLineBreakByTruncatingHead = 3,
|
||||
kCTLineBreakByTruncatingTail = 4,
|
||||
kCTLineBreakByTruncatingMiddle = 5,
|
||||
};
|
||||
|
||||
typedef CF_ENUM(int8_t, CTWritingDirection) {
|
||||
kCTWritingDirectionNatural = -1,
|
||||
kCTWritingDirectionLeftToRight = 0,
|
||||
kCTWritingDirectionRightToLeft = 1,
|
||||
};
|
||||
|
||||
typedef struct CTParagraphStyleSetting {
|
||||
CTParagraphStyleSpecifier spec;
|
||||
size_t valueSize;
|
||||
const void* value;
|
||||
} CTParagraphStyleSetting;
|
@ -7,3 +7,4 @@ The above copyright notice and this permission notice shall be included in all c
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
|
||||
#import <CoreText/CTFont.h>
|
||||
#import <CoreText/CTParagraphStyle.h>
|
||||
|
Loading…
Reference in New Issue
Block a user