Bug 19428 - [Binding]CGPath missing CreateCopyByStrokingPath (and other) methods
Summary: [Binding]CGPath missing CreateCopyByStrokingPath (and other) methods
Status: RESOLVED FIXED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) ()
Version: Master
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: master
Assignee: Manuel de la Peña [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2014-04-30 14:53 UTC by Jon Goldberger [MSFT]
Modified: 2016-01-11 10:02 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Comment 1 Jon Goldberger [MSFT] 2014-04-30 15:00:52 UTC
According to the Apple docs, https://developer.apple.com/library/ios/documentation/graphicsimaging/reference/CGPath/Reference/reference.html, a CGPath object should contain the following members:

CGPathCreateMutable
CGPathCreateWithEllipseInRect
CGPathCreateWithRect
CGPathCreateWithRoundedRect
CGPathCreateCopy
CGPathCreateCopyByTransformingPath
CGPathCreateCopyByDashingPath
CGPathCreateCopyByStrokingPath
CGPathCreateMutableCopy
CGPathCreateMutableCopyByTransformingPath
CGPathRelease
CGPathRetain

None of these members appear to be in the XamMac.dll however. 

I also can't seem to use the PerformSelector on a CGPath to try a workaround.
Comment 2 Aaron Bockover [MSFT] 2014-04-30 15:15:23 UTC
CGPath is not Objective-C so PerformSelector wouldn't work. These are P/Invokes. I'll look into adding them.
Comment 3 Aaron Bockover [MSFT] 2014-04-30 15:28:57 UTC
The C functions are wrapped by managed API, so they would not show up directly - they're internal.

Already exist in 1.8.0 release:
    * CGPathCreateWithEllipseInRect: CGPath.EllipseFromRect
    * CGPathCreateWithRect: CGPath.FromRect
    * CGPathCreateWithRoundedRect: CGPath.FromRoundedRect (introduced in Mavericks, iOS 7)
    * CGPathCreateCopyByDashingPath: CGPath.CopyByDashingPath
    * CGPathCreateMutableCopy: new CGPath (CGPath basePath)
    * CGPathCreateMutableCopyByTransformingPath: new CGPath (CGPath reference, CGAffineTransform transform)

Will introduce in 1.8.1 release:

    * CGPathCreateCopyByStrokingPath: CGPath.CopyByStrokingPath

Used internally and should not need to be exposed directly as managed API:

    * CGPathCreateMutable
    * CGPathRelease
    * CGPathRetain

Missing:

    * CGPathCreateCopy
    * CGPathCreateCopyByTransformingPath
Comment 4 Aaron Bockover [MSFT] 2014-04-30 15:37:04 UTC
The following file can be dropped in to the user's project until 1.8.1 is released, after which the file can simply be removed and the project rebuilt:

https://gist.github.com/abock/bd946d3fe7436bce79c0
Comment 5 Aaron Bockover [MSFT] 2014-04-30 15:53:56 UTC
Updated extension method with correct mutability and retain semantics:
https://gist.github.com/abock/bd946d3fe7436bce79c0
Comment 6 Timothy Risi 2015-01-16 19:22:34 UTC
Still Missing

 * CGPathCreateCopy
 * CGPathCreateCopyByTransformingPath
Comment 7 Manuel de la Peña [MSFT] 2016-01-11 10:02:58 UTC
This methods where added in the following commit => https://github.com/xamarin/maccore/commit/709079b811163aba831a1f6344c5cc34f9615c9f