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

Avoid Reflection #1006

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Avoid Reflection #1006

wants to merge 1 commit into from

Conversation

badcel
Copy link
Member

@badcel badcel commented Jan 20, 2024

  • I agree that my contribution may be licensed either under MIT or any version of LGPL license.

Fixes: #397, #919

Before working on this there should probably be a PR which introduces a new way of registering classes and subclasses. Additionally there should be a source generator which uses this way to register the types and subclasses with the existing TypeDictionary. Subclasses can be registered in their static constructor as they can't be created by GObject before they were used in c#. If this is done there can be work done to remove reflection and the TypeDictionary. In this PR.

Todo:

  • Ensure that classes and subclass can be created with their own gtype.
  • Allow users to Register their subclasses manually so all types are known to the typesystem
  • Create SourceGenerator to automatically register all subclasses (optional)
  • Find a way to remove the TypeDictionary and pass on the GType through constructor chain if a subclass is instantiated manually thus avoiding the lookup in the type dictionary
  • Make sure that it is possible to get an instance of a subclass even if the metod returns a GObject.Object

@badcel badcel linked an issue Jan 21, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant