neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_native_window.hpp
Go to the documentation of this file.
1// i_native_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>
23#include <neogfx/core/event.hpp>
28
29namespace neogfx
30{
31 class i_surface_window;
32
34 {
35 public:
37 public:
39 declare_event(added_to_nest)
40 public:
41 struct window_not_attached_to_surface : std::logic_error { window_not_attached_to_surface() : std::logic_error("neogfx::i_native_window::window_not_attached_to_surface") {} };
42 struct no_current_event : std::logic_error { no_current_event() : std::logic_error("neogfx::i_native_window::no_current_event") {} };
43 struct no_parent : std::logic_error { no_parent() : std::logic_error("neogfx::i_native_window::no_parent") {} };
44 public:
46 public:
47 virtual ~i_native_window() = default;
48 public:
49 virtual bool has_parent() const = 0;
50 virtual const i_native_window& parent() const = 0;
51 virtual i_native_window& parent() = 0;
52 virtual bool is_nested() const = 0;
53 public:
54 virtual i_surface_window& surface_window() const = 0;
55 public:
56 virtual void* target_handle() const = 0;
57 virtual void* target_device_handle() const = 0;
58 virtual bool attached() const = 0;
59 virtual i_native_surface& attachment() const = 0;
60 virtual void attach(i_native_surface& aSurface) = 0;
61 virtual void detach() = 0;
62 public:
63 virtual size& pixel_density() const = 0;
64 virtual void handle_dpi_changed() = 0;
65 public:
66 virtual bool initialising() const = 0;
67 virtual void initialisation_complete() = 0;
68 virtual void* handle() const = 0;
69 virtual void* native_handle() const = 0;
70 virtual point surface_position() const = 0;
71 virtual void move_surface(const point& aPosition) = 0;
72 virtual size surface_extents() const = 0;
73 virtual void resize_surface(const size& aExtents) = 0;
74 public:
75 virtual void display_error_message(std::string const& aTitle, std::string const& aMessage) const = 0;
76 virtual bool events_queued() const = 0;
77 virtual void push_event(const native_event& aEvent) = 0;
78 virtual bool pump_event() = 0;
79 virtual void handle_event(const native_event& aNativeEvent) = 0;
80 virtual bool has_current_event() const = 0;
81 virtual const native_event& current_event() const = 0;
83 virtual void handle_event() = 0;
84 virtual bool processing_event() const = 0;
85 virtual void close(bool aForce = false) = 0;
86 virtual bool placement_changed_explicitly() const = 0;
88 virtual bool visible() const = 0;
89 virtual void show(bool aActivate = false) = 0;
90 virtual void hide() = 0;
91 virtual double opacity() const = 0;
92 virtual void set_opacity(double aOpacity) = 0;
93 virtual double transparency() const = 0;
94 virtual void set_transparency(double aTransparency) = 0;
95 virtual bool is_effectively_active() const = 0;
96 virtual bool is_active() const = 0;
97 virtual void activate() = 0;
98 virtual void deactivate() = 0;
99 virtual bool is_iconic() const = 0;
100 virtual void iconize() = 0;
101 virtual bool is_maximized() const = 0;
102 virtual void maximize() = 0;
103 virtual bool is_restored() const = 0;
104 virtual void restore() = 0;
105 virtual bool is_fullscreen() const = 0;
106 virtual void enter_fullscreen(const video_mode& aVideoMode) = 0;
107 virtual bool enabled() const = 0;
108 virtual void enable(bool aEnable) = 0;
109 virtual bool is_capturing() const = 0;
110 virtual void set_capture() = 0;
111 virtual void release_capture() = 0;
112 virtual void non_client_set_capture() = 0;
113 virtual void non_client_release_capture() = 0;
114 virtual i_string const& title_text() const = 0;
115 virtual void set_title_text(i_string const& aTitleText) = 0;
116 virtual border border_thickness() const = 0;
117 public:
118 virtual bool can_render() const = 0;
119 virtual void render(bool aOOBRequest = false) = 0;
120 virtual void display() = 0;
121 };
122}
virtual ~i_native_window()=default
virtual bool is_iconic() const =0
virtual bool can_render() const =0
virtual bool initialising() const =0
virtual void move_surface(const point &aPosition)=0
virtual void render(bool aOOBRequest=false)=0
virtual void attach(i_native_surface &aSurface)=0
virtual void * target_handle() const =0
virtual double opacity() const =0
virtual void non_client_release_capture()=0
virtual bool processing_event() const =0
virtual void enable(bool aEnable)=0
virtual point surface_position() const =0
virtual bool enabled() const =0
virtual void initialisation_complete()=0
virtual bool visible() const =0
virtual bool has_current_event() const =0
virtual void display()=0
virtual void set_title_text(i_string const &aTitleText)=0
virtual bool has_parent() const =0
virtual i_native_window & parent()=0
virtual bool is_fullscreen() const =0
virtual void enter_fullscreen(const video_mode &aVideoMode)=0
virtual void maximize()=0
virtual void restore()=0
virtual border border_thickness() const =0
virtual void handle_dpi_changed()=0
virtual bool is_active() const =0
virtual void push_event(const native_event &aEvent)=0
virtual void set_placement_changed_explicitly()=0
virtual void handle_event()=0
virtual void non_client_set_capture()=0
virtual bool pump_event()=0
virtual const native_event & current_event() const =0
virtual void set_opacity(double aOpacity)=0
virtual double transparency() const =0
virtual i_native_surface & attachment() const =0
virtual void set_capture()=0
virtual void display_error_message(std::string const &aTitle, std::string const &aMessage) const =0
virtual void resize_surface(const size &aExtents)=0
virtual const i_native_window & parent() const =0
virtual i_string const & title_text() const =0
virtual bool is_restored() const =0
virtual void * native_handle() const =0
neolib::variant< window_event, mouse_event, non_client_mouse_event, keyboard_event > native_event
virtual void handle_event(const native_event &aNativeEvent)=0
i_native_window abstract_type
virtual bool attached() const =0
virtual void show(bool aActivate=false)=0
virtual void iconize()=0
virtual void * handle() const =0
virtual bool is_nested() const =0
virtual void set_transparency(double aTransparency)=0
virtual size & pixel_density() const =0
virtual void hide()=0
virtual void * target_device_handle() const =0
virtual size surface_extents() const =0
virtual void release_capture()=0
virtual void detach()=0
virtual bool events_queued() const =0
virtual bool is_capturing() const =0
virtual void activate()=0
virtual i_surface_window & surface_window() const =0
virtual bool is_maximized() const =0
virtual void close(bool aForce=false)=0
virtual bool is_effectively_active() const =0
virtual void deactivate()=0
virtual bool placement_changed_explicitly() const =0
virtual native_event & current_event()=0
#define declare_event(declName,...)
Definition i_event.hpp:305