Skip to content
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

Closed

Conversation

migueldeicaza
Copy link
Contributor

No description provided.

@monojenkins
Copy link
Collaborator

Build failure

@@ -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);
Copy link
Contributor

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

@@ -579,6 +579,15 @@ public void EOClip ()
}

[DllImport (Constants.CoreGraphicsLibrary)]
extern static void CGContextResetClip (/* CGContextRef */ IntPtr c);
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it


static PathApplyProxy static_apply;

delegate void PathApplyProxy (IntPtr block, IntPtr element);
Copy link
Contributor

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, VS


[Internal]
[Field ("kCGColorConversionTRCSize")]
NSString TrcSize { get; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs avail attribute

}

[iOS (10,0)][TV (10,0)][Watch (3,0)][Mac (10,12)]
[StrongDictionary ("CGColorConversionInfo")]
interface CGColorConversionOptions {
bool BlackPointCompensation { get; set; }
//CGSize TrcSize { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why commented?

Copy link
Contributor Author

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

Copy link
Contributor

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotit

@monojenkins
Copy link
Collaborator

Build failure

Copy link
Member

@rolfbjarne rolfbjarne left a 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.

@@ -258,6 +258,36 @@ public CGPDFDictionary GetInfo ()
{
return new CGPDFDictionary (CGPDFDocumentGetInfo (handle));
}

[DllImport (Constants.CoreGraphicsLibrary
Copy link
Member

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.

@monojenkins
Copy link
Collaborator

Build failure

[iOS (11,0), Mac(10,3), TV(11,0), Watch(4,0)]
extern static void CGContextResetClip (/* CGContextRef */ IntPtr c);

[iOS (11,0)]
Copy link
Contributor

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

[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)
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

extern static /* CFDictionaryPtry */ IntPtr CGPDFDocumentGetOutline (/* CGPDFDocumentRef */ IntPtr document);

[iOS (11,0), Mac(10,3)]
public CGPDFOutlineOptions GetOutline ()
Copy link
Contributor

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)]

return new CGPDFOutlineOptions (new NSDictionary (ptr));
}

[DllImport (Constants.CoreGraphicsLibrary)]
Copy link
Contributor

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


#if !COREBUILD
[DllImport (Constants.CoreGraphicsLibrary)]
unsafe extern static void CGPathApplyWithBlock (IntPtr handle, BlockLiteral *blockEnumerator);
Copy link
Contributor

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

}
}

public void Apply (Action<CGPathElement> block)
Copy link
Contributor

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

@monojenkins
Copy link
Collaborator

Build failure

public CGPDFOutlineOptions GetOutline ()
{
var ptr = CGPDFDocumentGetOutline (handle);
return new CGPDFOutlineOptions (new NSDictionary (ptr));
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@monojenkins
Copy link
Collaborator

Build failure

Copy link
Contributor Author

@migueldeicaza migueldeicaza left a 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.

@monojenkins
Copy link
Collaborator

Build failure

@monojenkins
Copy link
Collaborator

Build failure

static void Check11 ()
{
#if MONOMAC || IOS
if (PlatformHelper.CheckSystemVersion (11, 0))
Copy link
Member

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 😄

@rolfbjarne rolfbjarne self-assigned this Sep 15, 2017
@rolfbjarne
Copy link
Member

I'll look into this PR, CoreGraphics changed a bit more (and some changes were reverted) in later betas.

@rolfbjarne
Copy link
Member

Superseded (and rebased on the xcode9.1 branch) by PR #2812.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants