Skip to content

Add new functions to Opal#7

Open
theiostream wants to merge 13 commits into
gnustep:masterfrom
theiostream:new-functions
Open

Add new functions to Opal#7
theiostream wants to merge 13 commits into
gnustep:masterfrom
theiostream:new-functions

Conversation

@theiostream
Copy link
Copy Markdown
Contributor

@theiostream theiostream commented Aug 5, 2017

Add some new functions to Opal which are required by WebKit.


This change is Reviewable

In CGContext.m we had CGContextDrawShading()'s definition repeated from
the header; we did not, however, have an actual stub for this function,
which caused linking errors with Opal clients. This turns this still
unimplemented function into an actual stub.
Add an actual implementation for CGContextAddEllipseInRect() which makes
use of CGPath APIs. Implement CGContextFillEllipseInRect() and
CGContextStrokeEllipseInRect() as well.
CoreGraphics posesses the private getter counterparts for some setter
functions, such as antialiasing and font smoothing. This implements
those getters.
Define the private CoreGraphics CGContextGetType() API, which determines
the type of a CGContextRef (a bitmap context, PostScript context, PDF
context etc.).
Implement the private function CGContextSetCTM(), which allows clients
to set the current transformation matrix of a context.
Copy link
Copy Markdown
Member

@ivucica ivucica left a comment

Choose a reason for hiding this comment

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

I can merge as is, but I'd really like private stuff slightly more ... distinct.

bool CGContextPathContainsPoint(CGContextRef c,
CGPoint point, CGPathDrawingMode mode);

/* CoreGraphics Private APIs */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since these are not part of the public API, I propose we move them into a separate header + implementation file.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This function gets exported by the Apple implementation as well. Having it here is fine.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well, I selected line 584 when I was creating the commit, not my fault that GitHub has... flaws. 😄

I was referring to all the APIs below that were marked as private. I did not check any to be private except CGContextSetCTM()


CGContextType CGContextGetType(CGContextRef ctx);

void CGContextSetCTM(CGContextRef ctx, CGAffineTransform m);
Copy link
Copy Markdown
Member

@fredkiefer fredkiefer Aug 7, 2017

Choose a reason for hiding this comment

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

The last two are the one functions I cannot find in the Apple header, these should be moved away.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Out of these, it looks like only CGContextGetShouldAntialias() is public.

};
typedef int CGTextEncoding;

// NOTE: This `typedef enum` in opposition to defining enum constants and
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where did you find these values? As WebKit has its own definitions of these values we should kept them private within Opal.

Copy link
Copy Markdown
Member

@fredkiefer fredkiefer left a comment

Choose a reason for hiding this comment

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

I agree with Ivan that we should keep the private functions and types within Opal and not export them. Please changes this and the code could be merged from my side.

Create stubs for yet unimplemented private CoreGraphics functions, for
increased compatibility with CG.
Create a stub for the private function CGFontGetGlyphAdvancesForStyle
for increased compatibility.
Add private constant and function stubs for CGImageSource for increased
compatibility.
Add stubs for some private functions and constants in CTFont for
compatibility purposes.
Create a stub for the CTFontDescriptorIsSystemUIFont() private function
for increased compatibility.
Add a stub for the CTLineCreateWithUniCharProvider() private function
for increased compatibility purposes.
Add stubs for private functions in CTRun for increased compatibility.
…tions()

Add stub for CTTypesetterCreateWithUniCharProviderAndOptions(), a
private function, for increased compatibility.
@fredkiefer
Copy link
Copy Markdown
Member

Please move all the private functions out of the public headers. Otherwise we won't be able to merge this.

@ivucica
Copy link
Copy Markdown
Member

ivucica commented Aug 31, 2017

Will there be more progress on this? :) @theiostream

@fredkiefer
Copy link
Copy Markdown
Member

@ivucica I suggest we just merge this pull request. I am not totally happy with it, but there won't be any future progress and at least there isn't anything fundamentally wrong in this code.

@ivucica
Copy link
Copy Markdown
Member

ivucica commented Feb 24, 2020

Marking this as something to review one of the evenings this week. I see the old comments about not making some internal API public, and we should at least do that when merging, otherwise we'll never do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants