neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_surface_window.hpp
Go to the documentation of this file.
1// i_surface_window.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>
27
28namespace neogfx
29{
30 class i_native_window;
31 class i_window;
32 class i_widget;
33
35 {
36 public:
38 public:
39 struct no_native_window : std::logic_error { no_native_window() : std::logic_error("neogfx::i_surface::no_native_window") {} };
40 struct widget_not_clicked : std::logic_error { widget_not_clicked() : std::logic_error("neogfx::i_surface_window::widget_not_clicked") {} };
41 struct widget_not_capturing : std::logic_error { widget_not_capturing() : std::logic_error("neogfx::i_surface_window::widget_not_capturing") {} };
42 public:
43 virtual bool has_native_window() const = 0;
44 virtual const i_native_window& native_window() const = 0;
46 virtual void set_native_window(i_native_window& aNativeWindow) = 0;
47 public:
48 virtual void handle_dpi_changed() = 0;
49 public:
50 virtual bool has_clicked_widget() const = 0;
51 virtual i_widget& clicked_widget() const = 0;
52 virtual bool has_capturing_widget() const = 0;
53 virtual i_widget& capturing_widget() const = 0;
54 virtual void set_capture(i_widget& aWidget) = 0;
55 virtual void release_capture(i_widget& aWidget) = 0;
56 virtual void non_client_set_capture(i_widget& aWidget) = 0;
57 virtual void non_client_release_capture(i_widget& aWidget) = 0;
58 public:
60 virtual bool is_closing() const = 0;
61 virtual bool native_window_can_close() const = 0;
62 virtual void native_window_closing() = 0;
63 virtual void native_window_closed() = 0;
64 virtual void native_window_focus_gained() = 0;
65 virtual void native_window_focus_lost() = 0;
66 virtual void native_window_resized() = 0;
67 virtual void native_window_moved() = 0;
68 virtual double native_window_rendering_priority() const = 0;
69 virtual bool native_window_ready_to_render() const = 0;
70 virtual void native_window_render(const rect& aInvalidatedRect) const = 0;
72 virtual void native_window_mouse_wheel_scrolled(mouse_wheel aWheel, const point& aPosition, delta aDelta, key_modifiers_e aKeyModifiers) = 0;
73 virtual void native_window_mouse_button_pressed(mouse_button aButton, const point& aPosition, key_modifiers_e aKeyModifiers) = 0;
74 virtual void native_window_mouse_button_double_clicked(mouse_button aButton, const point& aPosition, key_modifiers_e aKeyModifiers) = 0;
75 virtual void native_window_mouse_button_released(mouse_button aButton, const point& aPosition) = 0;
76 virtual void native_window_mouse_moved(const point& aPosition, key_modifiers_e aKeyModifiers) = 0;
77 virtual void native_window_non_client_mouse_wheel_scrolled(mouse_wheel aWheel, const point& aPosition, delta aDelta, key_modifiers_e aKeyModifiers) = 0;
78 virtual void native_window_non_client_mouse_button_pressed(mouse_button aButton, const point& aPosition, key_modifiers_e aKeyModifiers) = 0;
79 virtual void native_window_non_client_mouse_button_double_clicked(mouse_button aButton, const point& aPosition, key_modifiers_e aKeyModifiers) = 0;
80 virtual void native_window_non_client_mouse_button_released(mouse_button aButton, const point& aPosition) = 0;
81 virtual void native_window_non_client_mouse_moved(const point& aPosition, key_modifiers_e aKeyModifiers) = 0;
82 virtual void native_window_mouse_entered(const point& aPosition) = 0;
83 virtual void native_window_mouse_left() = 0;
84 virtual widget_part native_window_hit_test(const point& aPosition) const = 0;
85 virtual rect native_window_widget_part_rect(widget_part_e aWidgetPart) const = 0;
86 virtual void native_window_key_pressed(scan_code_e aScanCode, key_code_e aKeyCode, key_modifiers_e aKeyModifiers) = 0;
87 virtual void native_window_key_released(scan_code_e aScanCode, key_code_e aKeyCode, key_modifiers_e aKeyModifiers) = 0;
88 virtual void native_window_text_input(i_string const& aText) = 0;
89 virtual void native_window_sys_text_input(i_string const& aText) = 0;
91 virtual void native_window_title_text_changed(i_string const& aTitleText) = 0;
92 public:
93 virtual window_style style() const = 0;
94 virtual void set_style(window_style aStyle) = 0;
95 public:
96 virtual const i_window& as_window() const = 0;
97 virtual i_window& as_window() = 0;
98 virtual const i_widget& as_widget() const = 0;
99 virtual i_widget& as_widget() = 0;
100 };
101}
virtual void native_window_closed()=0
virtual void native_window_sys_text_input(i_string const &aText)=0
virtual void native_window_render(const rect &aInvalidatedRect) const =0
virtual void native_window_mouse_moved(const point &aPosition, key_modifiers_e aKeyModifiers)=0
virtual void handle_dpi_changed()=0
virtual i_widget & capturing_widget() const =0
virtual mouse_event_location current_mouse_event_location() const =0
virtual double native_window_rendering_priority() const =0
virtual i_window & as_window()=0
virtual void native_window_mouse_button_pressed(mouse_button aButton, const point &aPosition, key_modifiers_e aKeyModifiers)=0
virtual bool native_window_ready_to_render() const =0
virtual void release_capture(i_widget &aWidget)=0
virtual void native_window_mouse_wheel_scrolled(mouse_wheel aWheel, const point &aPosition, delta aDelta, key_modifiers_e aKeyModifiers)=0
virtual void non_client_release_capture(i_widget &aWidget)=0
virtual void native_window_key_released(scan_code_e aScanCode, key_code_e aKeyCode, key_modifiers_e aKeyModifiers)=0
virtual void set_style(window_style aStyle)=0
virtual neogfx::mouse_cursor native_window_mouse_cursor() const =0
virtual void native_window_non_client_mouse_button_released(mouse_button aButton, const point &aPosition)=0
virtual void native_window_mouse_button_double_clicked(mouse_button aButton, const point &aPosition, key_modifiers_e aKeyModifiers)=0
virtual widget_part native_window_hit_test(const point &aPosition) const =0
virtual void native_window_key_pressed(scan_code_e aScanCode, key_code_e aKeyCode, key_modifiers_e aKeyModifiers)=0
virtual void native_window_mouse_entered(const point &aPosition)=0
virtual void native_window_focus_gained()=0
virtual bool has_capturing_widget() const =0
virtual void native_window_non_client_mouse_wheel_scrolled(mouse_wheel aWheel, const point &aPosition, delta aDelta, key_modifiers_e aKeyModifiers)=0
virtual void native_window_mouse_button_released(mouse_button aButton, const point &aPosition)=0
virtual bool is_closing() const =0
virtual const i_widget & as_widget() const =0
virtual void native_window_text_input(i_string const &aText)=0
virtual void native_window_non_client_mouse_moved(const point &aPosition, key_modifiers_e aKeyModifiers)=0
virtual void native_window_closing()=0
virtual i_widget & as_widget()=0
virtual void native_window_title_text_changed(i_string const &aTitleText)=0
virtual void non_client_set_capture(i_widget &aWidget)=0
virtual void native_window_non_client_mouse_button_double_clicked(mouse_button aButton, const point &aPosition, key_modifiers_e aKeyModifiers)=0
virtual window_style style() const =0
virtual i_widget & clicked_widget() const =0
virtual void native_window_mouse_left()=0
virtual void native_window_moved()=0
virtual bool native_window_can_close() const =0
virtual void set_native_window(i_native_window &aNativeWindow)=0
virtual bool has_native_window() const =0
virtual const i_native_window & native_window() const =0
virtual void native_window_focus_lost()=0
virtual bool has_clicked_widget() const =0
virtual void native_window_dismiss_children()=0
virtual rect native_window_widget_part_rect(widget_part_e aWidgetPart) const =0
virtual const i_window & as_window() const =0
virtual void native_window_resized()=0
virtual i_native_window & native_window()=0
virtual void native_window_non_client_mouse_button_pressed(mouse_button aButton, const point &aPosition, key_modifiers_e aKeyModifiers)=0
virtual void set_capture(i_widget &aWidget)=0
mouse_wheel
Definition i_mouse.hpp:42
mouse_button
Definition i_mouse.hpp:31