neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
window_manager.hpp
Go to the documentation of this file.
1// 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>
25
26namespace neogfx
27{
29 {
30 private:
31 struct window_sorter
32 {
33 bool operator()(i_window* left, i_window* right) const
34 {
35 return left->is_descendent_of(*right) && left != right;
36 }
37 };
38 typedef std::vector<i_window*> window_list;
39 public:
42 public:
43 void add_window(i_window& aWindow) final;
44 void remove_window(i_window& aWindow) final;
45 bool has_window(i_window& aWindow) const final;
46 std::size_t window_count() const final;
47 i_window& window(std::size_t aIndex) const final;
48 bool any_strong_windows() const final;
49 i_window& hosting_window(const i_window& aNestedWindow) const final;
50 public:
51 rect desktop_rect(const i_window& aWindow) const final;
52 rect window_rect(const i_window& aWindow) const final;
53 double z_order(const i_window& aWindow) const final;
54 void move_window(i_window& aWindow, const point& aPosition) final;
55 void resize_window(i_window& aWindow, const size& aExtents) final;
56 public:
57 bool window_activated() const final;
58 i_window& active_window() const final;
59 void activate_window(i_window& aWindow) final;
60 void deactivate_window(i_window& aWindow) final;
61 public:
62 point mouse_position() const final;
63 point mouse_position(const i_window& aWindow) const final;
64 bool is_mouse_button_pressed(mouse_button aButton) const final;
65 private:
66 sink iSink;
67 window_list iWindows;
68 i_window* iActiveWindow = nullptr;
69 };
70}
bool is_descendent_of(const i_window &aWindow) const
Definition i_window.hpp:203
bool any_strong_windows() const final
point mouse_position() const final
bool is_mouse_button_pressed(mouse_button aButton) const final
i_window & active_window() const final
std::size_t window_count() const final
rect window_rect(const i_window &aWindow) const final
double z_order(const i_window &aWindow) const final
void remove_window(i_window &aWindow) final
bool has_window(i_window &aWindow) const final
void deactivate_window(i_window &aWindow) final
bool window_activated() const final
i_window & hosting_window(const i_window &aNestedWindow) const final
void move_window(i_window &aWindow, const point &aPosition) final
void activate_window(i_window &aWindow) final
rect desktop_rect(const i_window &aWindow) const final
void add_window(i_window &aWindow) final
void resize_window(i_window &aWindow, const size &aExtents) final
mouse_button
Definition i_mouse.hpp:31
Definition plf_hive.h:79