neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_window_manager.hpp
Go to the documentation of this file.
1// i_window_manager.hpp
2/*
3 neogfx C++ App/Game Engine
4 Copyright (c) 2015, 2020 Leigh Johnston. All Rights Reserved.
5
6 This program is free software: you can redistribute it and / or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
24#include <neogfx/hid/mouse.hpp>
25
26namespace neogfx
27{
28 class i_widget;
29 class i_window;
30
32 {
33 public:
34 struct window_not_found : std::logic_error { window_not_found() : std::logic_error("neogfx::i_surface_manager::window_not_found") {} };
35 struct no_window_active : std::logic_error { no_window_active() : std::logic_error("neogfx::i_surface_manager::no_window_active") {} };
36 public:
37 virtual ~i_window_manager() = default;
38 public:
39 virtual void add_window(i_window& aWindow) = 0;
40 virtual void remove_window(i_window& aWindow) = 0;
41 virtual bool has_window(i_window& aWindow) const = 0;
42 virtual std::size_t window_count() const = 0;
43 virtual i_window& window(std::size_t aIndex) const = 0;
44 virtual bool any_strong_windows() const = 0;
45 virtual i_window& hosting_window(const i_window& aNestedWindow) const = 0;
46 public:
47 virtual rect desktop_rect(const i_window& aWindow) const = 0;
48 virtual rect window_rect(const i_window& aWindow) const = 0;
49 virtual double z_order(const i_window& aWindow) const = 0;
50 virtual void move_window(i_window& aWindow, const point& aPosition) = 0;
51 virtual void resize_window(i_window& aWindow, const size& aExtents) = 0;
52 public:
53 virtual bool window_activated() const = 0;
54 virtual i_window& active_window() const = 0;
55 virtual void activate_window(i_window& aWindow) = 0;
56 virtual void deactivate_window(i_window& aWindow) = 0;
57 public:
58 virtual i_window* window_from_position(const point& aPosition) const = 0;
59 virtual i_window* window_from_position(const point& aPosition, i_widget const& aIgnore) const = 0;
60 public:
61 virtual point mouse_position() const = 0;
62 virtual point mouse_position(const i_window& aWindow) const = 0;
63 virtual bool is_mouse_button_pressed(mouse_button aButton) const = 0;
64 public:
65 virtual void save_mouse_cursor() = 0;
66 virtual void set_mouse_cursor(mouse_system_cursor aSystemCursor) = 0;
67 virtual void restore_mouse_cursor(const i_window& aWindow) = 0;
68 virtual void update_mouse_cursor(const i_window& aWindow) = 0;
69 public:
70 static uuid const& iid() { static uuid const sIid{ 0x6246e0a9, 0x85d7, 0x4feb, 0xa273, { 0x7d, 0xb1, 0x4d, 0xed, 0x12, 0x12 } }; return sIid; }
71 };
72}
virtual void remove_window(i_window &aWindow)=0
virtual bool is_mouse_button_pressed(mouse_button aButton) const =0
virtual ~i_window_manager()=default
virtual void add_window(i_window &aWindow)=0
virtual bool any_strong_windows() const =0
virtual void restore_mouse_cursor(const i_window &aWindow)=0
virtual point mouse_position(const i_window &aWindow) const =0
virtual rect desktop_rect(const i_window &aWindow) const =0
virtual void resize_window(i_window &aWindow, const size &aExtents)=0
virtual i_window & active_window() const =0
virtual i_window * window_from_position(const point &aPosition) const =0
virtual double z_order(const i_window &aWindow) const =0
virtual void save_mouse_cursor()=0
virtual void deactivate_window(i_window &aWindow)=0
virtual std::size_t window_count() const =0
virtual rect window_rect(const i_window &aWindow) const =0
virtual point mouse_position() const =0
virtual void activate_window(i_window &aWindow)=0
virtual void set_mouse_cursor(mouse_system_cursor aSystemCursor)=0
virtual void move_window(i_window &aWindow, const point &aPosition)=0
static uuid const & iid()
virtual i_window & window(std::size_t aIndex) const =0
virtual bool has_window(i_window &aWindow) const =0
virtual i_window & hosting_window(const i_window &aNestedWindow) const =0
virtual i_window * window_from_position(const point &aPosition, i_widget const &aIgnore) const =0
virtual void update_mouse_cursor(const i_window &aWindow)=0
virtual bool window_activated() const =0
mouse_system_cursor
Definition i_mouse.hpp:49
mouse_button
Definition i_mouse.hpp:31