Mir
|
Window management functions for querying and updating MirAL's model. More...
#include <window_manager_tools.h>
Public Member Functions | |
WindowManagerTools (WindowManagerToolsImplementation *tools) | |
WindowManagerTools (WindowManagerTools const &) | |
WindowManagerTools & | operator= (WindowManagerTools const &) |
~WindowManagerTools () | |
void | invoke_under_lock (std::function< void()> const &callback) |
Multi-thread support Allows threads that don't hold a lock on the model to acquire one and call the "Update Model" member functions. More... | |
Query & Update Model | |
These functions assume that the BasicWindowManager data structures can be accessed freely. I.e. they should only be used by a thread that has called the WindowManagementPolicy methods (where any necessary locks are held) or via a invoke_under_lock() callback. | |
auto | count_applications () const -> unsigned int |
count the applications More... | |
void | for_each_application (std::function< void(ApplicationInfo &info)> const &functor) |
execute functor for each application More... | |
auto | find_application (std::function< bool(ApplicationInfo const &info)> const &predicate) -> Application |
find an application meeting the predicate More... | |
auto | info_for (std::weak_ptr< mir::scene::Session > const &session) const -> ApplicationInfo & |
retrieve metadata for an application More... | |
auto | info_for (std::weak_ptr< mir::scene::Surface > const &surface) const -> WindowInfo & |
retrieve metadata for a window More... | |
auto | info_for (Window const &window) const -> WindowInfo & |
retrieve metadata for a window More... | |
auto | info_for_window_id (std::string const &id) const -> WindowInfo & |
retrieve metadata for a persistent surface id More... | |
auto | id_for_window (Window const &window) const -> std::string |
retrieve the persistent surface id for a window More... | |
void | ask_client_to_close (Window const &window) |
Send close request to the window. More... | |
auto | active_window () const -> Window |
retrieve the active window More... | |
auto | select_active_window (Window const &hint) -> Window |
select a new active window based on the hint More... | |
void | drag_active_window (mir::geometry::Displacement movement) |
move the active window More... | |
void | drag_window (Window const &window, mir::geometry::Displacement movement) |
move the window More... | |
void | focus_next_application () |
make the next application active More... | |
void | focus_prev_application () |
make the previous application active More... | |
void | focus_next_within_application () |
make the next surface active within the active application More... | |
void | focus_prev_within_application () |
make the prev surface active within the active application More... | |
auto | window_at (mir::geometry::Point cursor) const -> Window |
Find the topmost window at the cursor. More... | |
auto | active_output () -> mir::geometry::Rectangle const |
Find the active output area. More... | |
auto | active_application_zone () const -> Zone |
Find the active zone area. More... | |
void | raise_tree (Window const &root) |
Raise window and all its children. More... | |
void | start_drag_and_drop (WindowInfo &window_info, std::vector< uint8_t > const &handle) |
Start drag and drop. More... | |
void | end_drag_and_drop () |
End drag and drop. More... | |
void | modify_window (WindowInfo &window_info, WindowSpecification const &modifications) |
Apply modifications to a window. More... | |
void | modify_window (Window const &window, WindowSpecification const &modifications) |
Apply modifications to a window. More... | |
void | place_and_size_for_state (WindowSpecification &modifications, WindowInfo const &window_info) const |
Set a default size and position to reflect state change. More... | |
auto | create_workspace () -> std::shared_ptr< Workspace > |
Create a workspace. More... | |
void | add_tree_to_workspace (Window const &window, std::shared_ptr< Workspace > const &workspace) |
Add the tree containing window to a workspace. More... | |
void | remove_tree_from_workspace (Window const &window, std::shared_ptr< Workspace > const &workspace) |
Remove the tree containing window from a workspace. More... | |
void | move_workspace_content_to_workspace (std::shared_ptr< Workspace > const &to_workspace, std::shared_ptr< Workspace > const &from_workspace) |
Moves all the content from one workspace to another. More... | |
void | for_each_workspace_containing (Window const &window, std::function< void(std::shared_ptr< Workspace > const &workspace)> const &callback) |
invoke callback with each workspace containing window More... | |
void | for_each_window_in_workspace (std::shared_ptr< Workspace > const &workspace, std::function< void(Window const &window)> const &callback) |
invoke callback with each window contained in workspace More... | |
Window management functions for querying and updating MirAL's model.
|
explicit |
miral::WindowManagerTools::WindowManagerTools | ( | WindowManagerTools const & | ) |
miral::WindowManagerTools::~WindowManagerTools | ( | ) |
auto miral::WindowManagerTools::active_application_zone | ( | ) | const -> Zone |
Find the active zone area.
auto miral::WindowManagerTools::active_output | ( | ) | -> mir::geometry::Rectangle const |
Find the active output area.
auto miral::WindowManagerTools::active_window | ( | ) | const -> Window |
retrieve the active window
void miral::WindowManagerTools::add_tree_to_workspace | ( | Window const & | window, |
std::shared_ptr< Workspace > const & | workspace | ||
) |
Add the tree containing window to a workspace.
window | the window |
workspace | the workspace; |
void miral::WindowManagerTools::ask_client_to_close | ( | Window const & | window | ) |
Send close request to the window.
auto miral::WindowManagerTools::count_applications | ( | ) | const -> unsigned int |
count the applications
auto miral::WindowManagerTools::create_workspace | ( | ) | -> std::shared_ptr< Workspace > |
Create a workspace.
void miral::WindowManagerTools::drag_active_window | ( | mir::geometry::Displacement | movement | ) |
move the active window
void miral::WindowManagerTools::drag_window | ( | Window const & | window, |
mir::geometry::Displacement | movement | ||
) |
move the window
void miral::WindowManagerTools::end_drag_and_drop | ( | ) |
End drag and drop.
auto miral::WindowManagerTools::find_application | ( | std::function< bool(ApplicationInfo const &info)> const & | predicate | ) | -> Application |
find an application meeting the predicate
predicate | the predicate |
void miral::WindowManagerTools::focus_next_application | ( | ) |
make the next application active
void miral::WindowManagerTools::focus_next_within_application | ( | ) |
make the next surface active within the active application
void miral::WindowManagerTools::focus_prev_application | ( | ) |
make the previous application active
void miral::WindowManagerTools::focus_prev_within_application | ( | ) |
make the prev surface active within the active application
void miral::WindowManagerTools::for_each_application | ( | std::function< void(ApplicationInfo &info)> const & | functor | ) |
execute functor for each application
functor | the functor |
void miral::WindowManagerTools::for_each_window_in_workspace | ( | std::shared_ptr< Workspace > const & | workspace, |
std::function< void(Window const &window)> const & | callback | ||
) |
invoke callback with each window contained in workspace
workspace | |
callback |
void miral::WindowManagerTools::for_each_workspace_containing | ( | Window const & | window, |
std::function< void(std::shared_ptr< Workspace > const &workspace)> const & | callback | ||
) |
invoke callback with each workspace containing window
window | |
callback |
auto miral::WindowManagerTools::id_for_window | ( | Window const & | window | ) | const -> std::string |
retrieve the persistent surface id for a window
window | the window |
auto miral::WindowManagerTools::info_for | ( | std::weak_ptr< mir::scene::Session > const & | session | ) | const -> ApplicationInfo & |
retrieve metadata for an application
session | the application session |
auto miral::WindowManagerTools::info_for | ( | std::weak_ptr< mir::scene::Surface > const & | surface | ) | const -> WindowInfo & |
retrieve metadata for a window
surface | the window surface |
auto miral::WindowManagerTools::info_for | ( | Window const & | window | ) | const -> WindowInfo & |
retrieve metadata for a window
window | the window |
auto miral::WindowManagerTools::info_for_window_id | ( | std::string const & | id | ) | const -> WindowInfo & |
retrieve metadata for a persistent surface id
id | the persistent surface id |
invalid_argument | or runtime_error if the id is badly formatted/doesn't identify a current window |
void miral::WindowManagerTools::invoke_under_lock | ( | std::function< void()> const & | callback | ) |
Multi-thread support Allows threads that don't hold a lock on the model to acquire one and call the "Update Model" member functions.
This should NOT be used by a thread that has called the WindowManagementPolicy methods (and already holds the lock).
void miral::WindowManagerTools::modify_window | ( | Window const & | window, |
WindowSpecification const & | modifications | ||
) |
Apply modifications to a window.
void miral::WindowManagerTools::modify_window | ( | WindowInfo & | window_info, |
WindowSpecification const & | modifications | ||
) |
Apply modifications to a window.
void miral::WindowManagerTools::move_workspace_content_to_workspace | ( | std::shared_ptr< Workspace > const & | to_workspace, |
std::shared_ptr< Workspace > const & | from_workspace | ||
) |
Moves all the content from one workspace to another.
from_workspace | the workspace to move the windows from; |
to_workspace | the workspace to move the windows to; |
WindowManagerTools & miral::WindowManagerTools::operator= | ( | WindowManagerTools const & | ) |
void miral::WindowManagerTools::place_and_size_for_state | ( | WindowSpecification & | modifications, |
WindowInfo const & | window_info | ||
) | const |
Set a default size and position to reflect state change.
void miral::WindowManagerTools::raise_tree | ( | Window const & | root | ) |
Raise window and all its children.
void miral::WindowManagerTools::remove_tree_from_workspace | ( | Window const & | window, |
std::shared_ptr< Workspace > const & | workspace | ||
) |
Remove the tree containing window from a workspace.
window | the window |
workspace | the workspace; |
select a new active window based on the hint
hint | the hint |
void miral::WindowManagerTools::start_drag_and_drop | ( | WindowInfo & | window_info, |
std::vector< uint8_t > const & | handle | ||
) |
Start drag and drop.
The handle will be passed to the client which can then use it to talk to the whatever service is being used to support drag and drop (e.g. on Ubuntu the content hub).
window_info | source window |
handle | drag handle |
auto miral::WindowManagerTools::window_at | ( | mir::geometry::Point | cursor | ) | const -> Window |
Find the topmost window at the cursor.
Copyright © 2012-2023
Canonical Ltd.
Generated on Tue 2 May 10:01:24 UTC 2023
This documentation is licensed under the GPL version 2 or 3.