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

Allow custom viewport implementations #662

Merged
merged 4 commits into from
Nov 16, 2023
Merged

Conversation

psaavedra
Copy link
Member

@psaavedra psaavedra commented Nov 15, 2023

excerpt: This PR allows platform implementations to provide their own viewport class. The WL Viewport class will handle the things associated with the window geometry instead of this being handled directly from the platform object.

motivation Optionally, platform plug-in implementations can provide their own viewport class by overriding the CogPlatform.get_viewport_type method. The CogWlWindow is moved inside of the CogWlViewport. The Window struct contains the information related to the geometry of the surface where the webview has to be painted. This information naturally belongs to the Viewport and not directly to the platform. With this change we correctly encapsulate the Window information in the right place.

@psaavedra psaavedra added the enhancement New feature or request label Nov 15, 2023
@psaavedra psaavedra self-assigned this Nov 15, 2023
Copy link
Member

@aperezdc aperezdc left a comment

Choose a reason for hiding this comment

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

I like the direction of this patch, and I have a couple of minor comments. Please fix the missing voids in function argument lists and this can be merged.

(Nice to see one more step in the right direction to allow programs that use the cogcore library to decide themselves how to display the web views, I feel like we are getting close! 👏🏼)

core/cog-viewport.c Show resolved Hide resolved
core/cog-viewport.c Show resolved Hide resolved
core/cog-viewport.c Outdated Show resolved Hide resolved
core/cog-viewport.c Outdated Show resolved Hide resolved
core/cog-viewport.h Outdated Show resolved Hide resolved
Optionally, platform plug-in implementations can provide their own
viewport class by overriding the CogPlatform.get_viewport_type method.
@psaavedra psaavedra merged commit 5064ad8 into master Nov 16, 2023
5 checks passed
@psaavedra psaavedra deleted the psaavedra/custom_viewport branch November 16, 2023 16:06
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