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

Callbacks improved #25

Merged
merged 26 commits into from
Dec 28, 2022
Merged

Callbacks improved #25

merged 26 commits into from
Dec 28, 2022

Conversation

jwharm
Copy link
Owner

@jwharm jwharm commented Dec 23, 2022

  • Moved most of the callback code into a new type Closure, which Signal now also implements so they both use the same code.
  • Removed the user_data parameters from the Java API. They have no purpose in language bindings.
  • Removed the source parameter in signal handlers. I think it is not necessary. It also doesn't exist in the GIR files, only in the header files.
  • Completely reworked the code generation of parameters (in the Variable class) because it was slowly becoming a mess. It is hopefully a bit more logical now.
  • Added generation of callbacks with out-parameters.

Some of these changes (the removal of the signal source parameter, and the user_data parameter) breaks API so if you have any objections I will rethink this.

jwharm and others added 22 commits December 9, 2022 20:17
# Conflicts:
#	generator/src/main/java/io/github/jwharm/javagi/model/Alias.java
#	generator/src/main/java/io/github/jwharm/javagi/model/Callback.java
#	generator/src/main/java/io/github/jwharm/javagi/model/Parameters.java
#	generator/src/main/java/io/github/jwharm/javagi/model/RegisteredType.java
#	generator/src/main/java/io/github/jwharm/javagi/model/Union.java
#	glib/src/main/java/io/github/jwharm/javagi/Interop.java
#	glib/src/main/java/io/github/jwharm/javagi/ObjectBase.java
#	glib/src/main/java/io/github/jwharm/javagi/Signal.java
@jwharm jwharm requested a review from JFronny December 23, 2022 22:08
Copy link
Contributor

@JFronny JFronny 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 that the removed parameters don't make sense in an environment like java where their value is usually already available implicitly.

@jwharm jwharm merged commit eeb2e91 into main Dec 28, 2022
@jwharm jwharm deleted the callbacks_improved branch December 28, 2022 15:53
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.

2 participants