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: Remove view and viewport handling from CogShell #685

Merged
merged 2 commits into from
Jan 3, 2024

Conversation

aperezdc
Copy link
Member

Remove handling of viewports and views from CogShell. Tracking live viewports can be done using CogPlatform since #683 and platform plug-ins no longer depend on CogShell for that. The following are no longer needed in CogShell:

  • The :web-view and :viewport properties, and their accessors.
  • The ::create-view and ::create-viewport signals.
  • The .create_view() virtual function and its default implementation.
  • The cog_shell_add_viewport(), cog_shell_remove_viewport(), cog_shell_get_n_viewports(), and cog_shell_get_nth_viewport() methods.

As a side effect of the above removals, the examples have been changed to have them create their views using cog_view_new() instead of relying on the default implementation of the CogShell.create_view() virtual function.

The launcher also needed a number of changes, which now manages itself a viewport as it cannot rely on the shell for that. Some code was moved around to accommodate creation of the view in cog_launcher_startup() without relying on the CogShell::create-view signal, and similarly for web view creation when running in automation mode.

There are more opportunities for further simplifications that would be better done in separate patches: this one focuses on the minimum amount of changes needed to get view and viewport handling out of CogShell.

@aperezdc aperezdc added the enhancement New feature or request label Dec 20, 2023
@aperezdc aperezdc self-assigned this Dec 20, 2023
@aperezdc aperezdc force-pushed the aperezdc/multiple-views branch 2 times, most recently from f14ad9a to 8519a74 Compare December 20, 2023 21:50
Remove handling of viewports and views from CogShell. Tracking live
viewports can be done using CogPlatform since #683 and platform
plug-ins no longer depend on CogShell for that. The following are
no longer needed in CogShell:

- The :web-view and :viewport properties, and their accessors.
- The ::create-view and ::create-viewport signals.
- The .create_view() virtual function and its default implementation.
- The cog_shell_add_viewport(), cog_shell_remove_viewport(),
  cog_shell_get_n_viewports(), and cog_shell_get_nth_viewport()
  methods.

As a side effect of the above removals, the examples have been changed
to have them create their views using cog_view_new() instead of relying
on the default implementation of the CogShell.create_view() virtual
function.

The launcher also needed a number of changes, which now manages itself
a viewport as it cannot rely on the shell for that. Some code was moved
around to accommodate creation of the view in cog_launcher_startup()
without relying on the CogShell::create-view signal, and similarly for
web view creation when running in automation mode.

There are more opportunities for further simplifications that would be
better done in separate patches: this one focuses on the minimum amount
of changes needed to get view and viewport handling out of CogShell.
Remove the CogShell.startup() and CogShell.shutdown() virtual functions,
which are not needed anymore now that CogShell does not know anything
about web views nor viewports.
@aperezdc aperezdc force-pushed the aperezdc/multiple-views branch from 8519a74 to 3477cc0 Compare December 26, 2023 22:05
@psaavedra
Copy link
Member

tested on my rpi3.

@aperezdc aperezdc merged commit 260dfab into master Jan 3, 2024
5 checks passed
@aperezdc aperezdc deleted the aperezdc/multiple-views branch January 3, 2024 20:43
@aperezdc
Copy link
Member Author

aperezdc commented Jan 3, 2024

Thanks @psaavedra!

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