Mir
minimal_window_manager.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2019 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 #ifndef MIRAL_MINIMAL_WINDOW_MANAGER_H
20 #define MIRAL_MINIMAL_WINDOW_MANAGER_H
21 
24 
25 namespace miral
26 {
30 {
31 public:
34 
36  auto place_new_window(
37  ApplicationInfo const& app_info,
38  WindowSpecification const& requested_specification) -> WindowSpecification override;
39 
41  void handle_window_ready(WindowInfo& window_info) override;
42 
44  void handle_modify_window(WindowInfo& window_info, WindowSpecification const& modifications) override;
45 
47  void handle_raise_window(WindowInfo& window_info) override;
48 
51  WindowInfo const& window_info, MirWindowState new_state, Rectangle const& new_placement) -> Rectangle override;
52 
54  bool handle_keyboard_event(MirKeyboardEvent const* event) override;
55 
57  bool handle_touch_event(MirTouchEvent const* event) override;
58 
60  bool handle_pointer_event(MirPointerEvent const* event) override;
61 
63  void handle_request_drag_and_drop(WindowInfo& window_info) override;
64 
66  void handle_request_move(WindowInfo& window_info, MirInputEvent const* input_event) override;
67 
69  void handle_request_resize(WindowInfo& window_info, MirInputEvent const* input_event, MirResizeEdge edge) override;
70 
72  auto confirm_inherited_move(WindowInfo const& window_info, Displacement movement) -> Rectangle override;
73 
75  void advise_focus_gained(WindowInfo const& window_info) override;
76 
77 protected:
79 
80  bool begin_pointer_move(WindowInfo const& window_info, MirInputEvent const* input_event);
81  bool begin_pointer_resize(WindowInfo const& window_info, MirInputEvent const* input_event, MirResizeEdge const& edge);
82 
83  bool begin_touch_move(WindowInfo const& window_info, MirInputEvent const* input_event);
84  bool begin_touch_resize(WindowInfo const& window_info, MirInputEvent const* input_event, MirResizeEdge const& edge);
85 
86 private:
87  struct Impl;
88  Impl* const self;
89 };
90 }
91 
92 #endif //MIRAL_MINIMAL_WINDOW_MANAGER_H
window_management_policy.h
MirKeyboardEvent
struct MirKeyboardEvent MirKeyboardEvent
An event type describing a change in keyboard state.
Definition: keyboard_event.h:41
miral
Mir Abstraction Layer.
Definition: floating_window_manager.h:29
miral::ApplicationInfo
Definition: application_info.h:31
miral::MinimalWindowManager::begin_touch_move
bool begin_touch_move(WindowInfo const &window_info, MirInputEvent const *input_event)
window_manager_tools.h
miral::MinimalWindowManager::handle_keyboard_event
bool handle_keyboard_event(MirKeyboardEvent const *event) override
Handles Alt-Tab, Alt-Grave and Alt-F4.
miral::WindowSpecification
Definition: window_specification.h:43
miral::MinimalWindowManager::place_new_window
auto place_new_window(ApplicationInfo const &app_info, WindowSpecification const &requested_specification) -> WindowSpecification override
Honours the requested specification.
miral::MinimalWindowManager::handle_raise_window
void handle_raise_window(WindowInfo &window_info) override
Gives focus to the requesting window (tree)
miral::MinimalWindowManager::MinimalWindowManager
MinimalWindowManager(WindowManagerTools const &tools)
miral::MinimalWindowManager
Minimal implementation of a floating window management policy.
Definition: minimal_window_manager.h:29
miral::MinimalWindowManager::handle_touch_event
bool handle_touch_event(MirTouchEvent const *event) override
Handles touch to focus.
miral::MinimalWindowManager::tools
WindowManagerTools tools
Definition: minimal_window_manager.h:78
mir::geometry::Rectangle
Definition: rectangle.h:33
miral::WindowManagementPolicy
The interface through which the window management policy is determined.
Definition: window_management_policy.h:46
MirResizeEdge
MirResizeEdge
Hints for resizing a window.
Definition: common.h:412
miral::MinimalWindowManager::handle_request_move
void handle_request_move(WindowInfo &window_info, MirInputEvent const *input_event) override
Initiates a move gesture (only implemented for pointers)
MirPointerEvent
struct MirPointerEvent MirPointerEvent
An event type describing a change in pointer device state.
Definition: pointer_event.h:35
miral::MinimalWindowManager::confirm_placement_on_display
auto confirm_placement_on_display(WindowInfo const &window_info, MirWindowState new_state, Rectangle const &new_placement) -> Rectangle override
Honours the requested placement.
MirWindowState
MirWindowState
Definition: common.h:141
miral::MinimalWindowManager::handle_modify_window
void handle_modify_window(WindowInfo &window_info, WindowSpecification const &modifications) override
Honours the requested modifications.
miral::MinimalWindowManager::advise_focus_gained
void advise_focus_gained(WindowInfo const &window_info) override
Raises newly focused window.
MirInputEvent
struct MirInputEvent MirInputEvent
Definition: event.h:70
mir::geometry::Displacement
Definition: displacement.h:33
miral::WindowManagerTools
Window management functions for querying and updating MirAL's model.
Definition: window_manager_tools.h:58
miral::WindowInfo
Definition: window_info.h:32
miral::MinimalWindowManager::handle_window_ready
void handle_window_ready(WindowInfo &window_info) override
If the window can have focus it is given focus.
miral::MinimalWindowManager::begin_touch_resize
bool begin_touch_resize(WindowInfo const &window_info, MirInputEvent const *input_event, MirResizeEdge const &edge)
miral::MinimalWindowManager::begin_pointer_resize
bool begin_pointer_resize(WindowInfo const &window_info, MirInputEvent const *input_event, MirResizeEdge const &edge)
MirTouchEvent
struct MirTouchEvent MirTouchEvent
An event type describing a change in touch device state.
Definition: touch_event.h:33
miral::MinimalWindowManager::begin_pointer_move
bool begin_pointer_move(WindowInfo const &window_info, MirInputEvent const *input_event)
miral::MinimalWindowManager::~MinimalWindowManager
~MinimalWindowManager()
miral::MinimalWindowManager::handle_request_drag_and_drop
void handle_request_drag_and_drop(WindowInfo &window_info) override
Currently unimplemented.
miral::MinimalWindowManager::handle_request_resize
void handle_request_resize(WindowInfo &window_info, MirInputEvent const *input_event, MirResizeEdge edge) override
Initiates a resize gesture (only implemented for pointers)
miral::MinimalWindowManager::confirm_inherited_move
auto confirm_inherited_move(WindowInfo const &window_info, Displacement movement) -> Rectangle override
Honours the requested movement.
miral::MinimalWindowManager::handle_pointer_event
bool handle_pointer_event(MirPointerEvent const *event) override
Handles pre-existing move & resize gestures, plus click to focus.

Copyright © 2012-2020 Canonical Ltd.
Generated on Mon Jun 29 21:51:46 UTC 2020
This documentation is licensed under the GPL version 2 or 3.