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

core: Introduce a new CogView class #570

Merged
merged 1 commit into from
May 18, 2023
Merged

Conversation

aperezdc
Copy link
Member

Add a new CogView class, which extends WebKitWebView to avoid needing to specify the view backend for each instantiated view. Instead, the creation is delegated to the current CogPlatform, in one of the following two ways:

  • Overriding a new get_view_type vfunc, which returns the GType of a CogView subclass specific to the platform plug-in. The custom view class needs to implement a create_backend vfunc that creates the view backend to use.

  • Letting the core library use its fallback CogView subclass, which relies on the platform's get_view_backend vfunc. This matches the existing behaviour.

This way platform plug-ins can opt-in to the new behaviour by implementing their own CogView subclass, and unchanged plug-ins will continue working during the transition.

@aperezdc aperezdc added the enhancement New feature or request label May 11, 2023
@aperezdc aperezdc self-assigned this May 11, 2023
@aperezdc aperezdc enabled auto-merge (rebase) May 11, 2023 23:08
@aperezdc aperezdc force-pushed the aperezdc/add-cogview branch 2 times, most recently from c2e0f69 to b66a0b3 Compare May 11, 2023 23:15
@aperezdc
Copy link
Member Author

Note that this patch, in the same vein as #566, removes the code to handle plain WPE backends. If this gets merged before, plain backends will not work until the other PR is also merged, so merging #566 first would be ideal.

Add a new CogView class, which extends WebKitWebView to avoid needing
to specify the view backend for each instantiated view. Instead, the
creation is delegated to the current CogPlatform, in one of the
following two ways:

- Overriding a new get_view_type vfunc, which returns the GType of
  a CogView subclass specific to the platform plug-in. The custom view
  class needs to implement a create_backend vfunc that creates the
  view backend to use.

- Letting the core library use its fallback CogView subclass, which
  relies on the platform's get_view_backend vfunc. This matches the
  existing behaviour.

This way platform plug-ins can opt-in to the new behaviour by
implementing their own CogView subclass, and unchanged plug-ins will
continue working during the transition.
@aperezdc aperezdc merged commit 9001a8d into master May 18, 2023
@aperezdc aperezdc deleted the aperezdc/add-cogview branch May 18, 2023 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants