Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Conversation

@riccioclista
Copy link

This PR changes the API of interface methods and GObject virtual method overrides to return the accessor parameter as return value instead of an out parameter. This also makes the API of GInterface interfaces and adapters on one side and implementor interfaces on the other side more consistent (because accessor methods now have matching signatures).

All API changes can be viewed here: https://gist.github.com/antoniusriha/04a8e3f7e87c9a4714b2

All changes in the generated code files can be viewed here: https://github.com/antoniusriha/gtk-generated-files-compare/commit/875f8a49bb86169bc27829829d58ffc27e160c86

@knocte
Copy link
Contributor

knocte commented Jun 15, 2015

I think this change is great.

@bl8 can you review?

Two nitpicks I would see: a) please add the "generator: " tag in the first line of commit messages; b) is it really necessary to split this PR in two commits? IMO one commit is just fine (in case this needs to be reverted, it would be less confusing to do with just one commit)

@riccioclista
Copy link
Author

@knocte, I think the format is good enough for reviewing. If it does get accepted, I'm happy to revise it further.

This fixes inconsistent method generation in GIntrface interfaces, adapters and implementor
interfaces. For example, in Atk.IText the method GetRangeExtents existed with two different
signatures. In Atk.IText and Atk.TextAdapter we had:
 (1) Atk.TextRectangle GetRangeExtents(int start_offset, int end_offset, Atk.CoordType coord_type);
whereas the signature in Atk.ITextImplementor was:
 (2) void GetRangeExtents (int start_offset, int end_offset, Atk.CoordType coord_type,
                           out Atk.TextRectangle rect);

This fix ensures that all interface methods have the form as shown in (1). This has been
implemented by applying the same rules for "Accessor"-methods in InterfaceVM as are already in
place in class Method. Essentially these rules state that all methods with one out-parameter are
Accessor-methods.
@directhex directhex closed this Mar 9, 2021
@directhex directhex deleted the branch mono:master March 9, 2021 14:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants