neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_surface.hpp
Go to the documentation of this file.
1// i_surface.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/core/event.hpp>
29#include <neogfx/hid/mouse.hpp>
30
31namespace neogfx
32{
33 class i_widget;
34 class i_window;
35 class i_surface_window;
36
37 enum class surface_type
38 {
39 Window,
41 Paper // Printing support
42 };
43
44 class i_rendering_engine;
45 class i_native_surface;
46
48
50 {
51 public:
52 declare_event(dpi_changed)
53 declare_event(rendering)
54 declare_event(rendering_finished)
55 declare_event(closing)
56 declare_event(closed)
57 public:
58 typedef i_surface abstract_type;
59 public:
60 struct no_native_surface : std::logic_error { no_native_surface() : std::logic_error("neogfx::i_surface::no_native_surface") {} };
61 struct not_a_window : std::logic_error { not_a_window() : std::logic_error("neogfx::i_surface::not_a_window") {} };
62 public:
63 virtual ~i_surface() = default;
64 public:
66 public:
67 virtual bool has_parent_surface() const = 0;
68 virtual const i_surface& parent_surface() const = 0;
69 virtual i_surface& parent_surface() = 0;
70 virtual bool is_owner_of(const i_surface& aChildSurface) const = 0;
71 public:
72 virtual bool is_strong() const = 0;
73 virtual bool is_weak() const = 0;
74 virtual bool can_close() const = 0;
75 virtual bool is_closed() const = 0;
76 virtual void close() = 0;
77 public:
78 virtual bool is_window() const = 0;
79 virtual bool is_nested_window() const = 0;
80 virtual const i_surface_window& as_surface_window() const = 0;
82 public:
84 virtual surface_style style() const = 0;
85 virtual void set_style(surface_style aStyle) = 0;
89 virtual void set_logical_coordinates(const neogfx::logical_coordinates& aCoordinates) = 0;
90 virtual double z_order() const = 0;
91 virtual void layout_surface() = 0;
92 virtual void invalidate_surface(const rect& aInvalidatedRect, bool aInternal = true) = 0;
93 virtual bool has_invalidated_area() const = 0;
94 virtual const rect& invalidated_area() const = 0;
95 virtual rect validate() = 0;
96 virtual double rendering_priority() const = 0;
97 virtual void render_surface() = 0;
98 virtual void pause_rendering() = 0;
99 virtual void resume_rendering() = 0;
100 virtual bool has_native_surface() const = 0;
101 virtual const i_native_surface& native_surface() const = 0;
103 public:
104 virtual point surface_position() const = 0;
105 virtual void move_surface(const point& aPosition) = 0;
106 virtual size surface_extents() const = 0;
107 virtual void resize_surface(const size& aExtents) = 0;
108 virtual double surface_opacity() const = 0;
109 virtual void set_surface_opacity(double aOpacity) = 0;
110 virtual double surface_transparency() const = 0;
111 virtual void set_surface_transparency(double aTransparency) = 0;
112 };
113}
virtual bool has_native_surface() const =0
virtual const i_surface_window & as_surface_window() const =0
virtual double rendering_priority() const =0
virtual bool is_nested_window() const =0
virtual const rect & invalidated_area() const =0
virtual rect validate()=0
virtual bool is_owner_of(const i_surface &aChildSurface) const =0
virtual void invalidate_surface(const rect &aInvalidatedRect, bool aInternal=true)=0
virtual point surface_position() const =0
virtual neogfx::logical_coordinates logical_coordinates() const =0
virtual void set_logical_coordinate_system(neogfx::logical_coordinate_system aSystem)=0
virtual void close()=0
virtual i_native_surface & native_surface()=0
virtual bool is_window() const =0
virtual bool can_close() const =0
virtual i_surface & parent_surface()=0
virtual bool has_invalidated_area() const =0
virtual size surface_extents() const =0
virtual double surface_transparency() const =0
virtual double z_order() const =0
virtual i_rendering_engine & rendering_engine() const =0
virtual void resume_rendering()=0
virtual void set_style(surface_style aStyle)=0
virtual bool is_strong() const =0
virtual bool has_parent_surface() const =0
virtual void resize_surface(const size &aExtents)=0
virtual i_surface_window & as_surface_window()=0
virtual ~i_surface()=default
virtual double surface_opacity() const =0
virtual const i_surface & parent_surface() const =0
virtual bool is_weak() const =0
virtual surface_style style() const =0
virtual bool is_closed() const =0
virtual void layout_surface()=0
virtual void set_surface_transparency(double aTransparency)=0
virtual neogfx::surface_type surface_type() const =0
virtual neogfx::logical_coordinate_system logical_coordinate_system() const =0
virtual void move_surface(const point &aPosition)=0
virtual void render_surface()=0
virtual void set_surface_opacity(double aOpacity)=0
virtual const i_native_surface & native_surface() const =0
virtual void set_logical_coordinates(const neogfx::logical_coordinates &aCoordinates)=0
virtual void pause_rendering()=0
logical_coordinate_system
window_style surface_style
Definition i_surface.hpp:47
#define declare_event(declName,...)
Definition i_event.hpp:305