-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ios11-b1] CoreGraphics bindings #2181
[ios11-b1] CoreGraphics bindings #2181
Conversation
Build failure |
src/CoreGraphics/CGPDFDocument.cs
Outdated
@@ -258,6 +258,34 @@ public CGPDFDictionary GetInfo () | |||
{ | |||
return new CGPDFDictionary (CGPDFDocumentGetInfo (handle)); | |||
} | |||
|
|||
[DllImport (Constants.CoreGraphicsLibrary)] | |||
extern static void CGPDFContextSetOutline (/* CGPDFDocumentRef */ IntPtr document, IntPtr /* dictionary */ outline); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without availability attributes this will fails tests
src/CoreGraphics/CGContext.cs
Outdated
@@ -579,6 +579,15 @@ public void EOClip () | |||
} | |||
|
|||
[DllImport (Constants.CoreGraphicsLibrary)] | |||
extern static void CGContextResetClip (/* CGContextRef */ IntPtr c); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this avail on macOS, tvOS and watchOS?
Needs avail attribute for intro tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it
src/CoreGraphics/CGPath.cs
Outdated
|
||
static PathApplyProxy static_apply; | ||
|
||
delegate void PathApplyProxy (IntPtr block, IntPtr element); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect alignment, mixing spaces and tabs ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, VS
src/coregraphics.cs
Outdated
|
||
[Internal] | ||
[Field ("kCGColorConversionTRCSize")] | ||
NSString TrcSize { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs avail attribute
src/coregraphics.cs
Outdated
} | ||
|
||
[iOS (10,0)][TV (10,0)][Watch (3,0)][Mac (10,12)] | ||
[StrongDictionary ("CGColorConversionInfo")] | ||
interface CGColorConversionOptions { | ||
bool BlackPointCompensation { get; set; } | ||
//CGSize TrcSize { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why commented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs further work in generator.cs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dalexsoto can you file a bug for above ? And assign it to yourself :) thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@migueldeicaza surround it with XAMCORE_2_0
and it will build
#if XAMCORE_2_0
CGSize TrcSize { get; set; }
#endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotit
Build failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the manual bindings also need tests.
src/CoreGraphics/CGPDFDocument.cs
Outdated
@@ -258,6 +258,36 @@ public CGPDFDictionary GetInfo () | |||
{ | |||
return new CGPDFDictionary (CGPDFDocumentGetInfo (handle)); | |||
} | |||
|
|||
[DllImport (Constants.CoreGraphicsLibrary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing )]
at the end of the line.
Build failure |
src/CoreGraphics/CGContext.cs
Outdated
[iOS (11,0), Mac(10,3), TV(11,0), Watch(4,0)] | ||
extern static void CGContextResetClip (/* CGContextRef */ IntPtr c); | ||
|
||
[iOS (11,0)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[iOS (11,0), Mac(10,3), TV(11,0), Watch(4,0)]
should match p/invoke
or developers won't have the correct information displayed in the IDE
src/CoreGraphics/CGPDFDocument.cs
Outdated
[iOS (11,0), Mac(10,3), TV(11,0), Watch(4,0)] | ||
extern static void CGPDFContextSetOutline (/* CGPDFDocumentRef */ IntPtr document, IntPtr /* dictionary */ outline); | ||
|
||
public void SetOutline (CGPDFOutlineOptions options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[iOS (11,0), Mac(10,3), TV(11,0), Watch(4,0)]
for IDE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/CoreGraphics/CGPDFDocument.cs
Outdated
extern static /* CFDictionaryPtry */ IntPtr CGPDFDocumentGetOutline (/* CGPDFDocumentRef */ IntPtr document); | ||
|
||
[iOS (11,0), Mac(10,3)] | ||
public CGPDFOutlineOptions GetOutline () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[iOS (11,0), Mac(10,3), TV(11,0), Watch(4,0)]
src/CoreGraphics/CGPDFDocument.cs
Outdated
return new CGPDFOutlineOptions (new NSDictionary (ptr)); | ||
} | ||
|
||
[DllImport (Constants.CoreGraphicsLibrary)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[iOS(11,0), Mac(10,3)]
for intro tests
src/CoreGraphics/CGPath.cs
Outdated
|
||
#if !COREBUILD | ||
[DllImport (Constants.CoreGraphicsLibrary)] | ||
unsafe extern static void CGPathApplyWithBlock (IntPtr handle, BlockLiteral *blockEnumerator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing availability attributes for intro tests
src/CoreGraphics/CGPath.cs
Outdated
} | ||
} | ||
|
||
public void Apply (Action<CGPathElement> block) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing availability attributes for IDE
Build failure |
src/CoreGraphics/CGPDFDocument.cs
Outdated
public CGPDFOutlineOptions GetOutline () | ||
{ | ||
var ptr = CGPDFDocumentGetOutline (handle); | ||
return new CGPDFOutlineOptions (new NSDictionary (ptr)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Runtime.GetNSObject<NSDictionary> (ptr)
instead of new NSDictionary (ptr)
, since the former will fetch any existing managed NSDictionary instances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Build failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: remove the CGPath.Apply function, which was needed for ObjC users, but we already provide an equivalent version.
Build failure |
Build failure |
static void Check11 () | ||
{ | ||
#if MONOMAC || IOS | ||
if (PlatformHelper.CheckSystemVersion (11, 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macOS 11.0 doesn't exist yet 😄
I'll look into this PR, CoreGraphics changed a bit more (and some changes were reverted) in later betas. |
Superseded (and rebased on the xcode9.1 branch) by PR #2812. |
No description provided.