AppView 0.8.2
app_view_2d.hpp
Go to the documentation of this file.
1// Copyright 2008-2023 by Rightware. All rights reserved.
2
3#ifndef APP_VIEW_2D_HPP
4#define APP_VIEW_2D_HPP
5
6#include <kanzi/core.ui/node/node2d.hpp>
7#include <app_view.hpp>
8
9namespace kanzi
10{
11
12namespace plugin
13{
14
15namespace appview
16{
17
18class AppView2D;
19using AppView2DSharedPtr = shared_ptr<AppView2D>;
20
22class APP_VIEW_PLUGIN_API AppView2D : public AppViewConceptImpl<Node2D, AppView2D>
23{
24public:
26
27 static AppView2DSharedPtr create(Domain* domain, string_view name);
28
29 KZ_METACLASS_BEGIN(AppView2D, ConceptClass, "Kanzi.AppView2D")
30 KZ_METACLASS_END()
31
32 void onStartApp(const StartAppMessageArguments& messageArguments)
33 {
34 ConceptClass::handleStartAppMessage(messageArguments);
35 }
36
37 void onFinishApp(FinishAppMessageArguments& messageArguments)
38 {
39 ConceptClass::handleFinishAppMessage(messageArguments);
40 }
41
42 void onNavigateBack(const NavigateBackMessageArguments& messageArguments)
43 {
44 ConceptClass::handleNavigateBackMessage(messageArguments);
45 }
46
48 {
49 ConceptClass::handleUpdateVirtualDisplayMessage(messageArguments);
50 }
51
52protected:
53 explicit AppView2D(Domain* domain, string_view name);
54
55 void onAttached() override;
56
57 Vector2 measureOverride(Vector2 /*availableSize*/) override;
58
59 void updateRenderOverride() override;
60
61 void setupMaterialOverride() override;
62
64 void onNodePropertyChanged(AbstractPropertyType propertyType, PropertyNotificationReason reason) override;
65
67 const TouchPoint& touchPoint,
68 Vector2& outHitUV) override;
69
71 void onAppViewTextureChanged() override;
72
73 static PropertyTypeEditorInfoSharedPtr makeEditorInfo();
74
75private:
77 ClassPropertyDefaultValue<Node::ContentStretch> m_contentStretchDefaultValue;
78
80 bool m_contentTextureUpdateRequired = true;
81};
82
83}
84
85}
86
87}
88
89#endif
Definition app_view.hpp:12
shared_ptr< AppView2D > AppView2DSharedPtr
Definition app_view_2d.hpp:19
App View. Starts and renders a 3rd party application.
Definition app_view_2d.hpp:23
void onAppViewTextureChanged() override
AppView::onAppViewTextureChanged() implementation.
Vector2 measureOverride(Vector2) override
bool calculateHitUV(const TouchPoint &touchPoint, Vector2 &outHitUV) override
void onNavigateBack(const NavigateBackMessageArguments &messageArguments)
Definition app_view_2d.hpp:42
AppView2D(Domain *domain, string_view name)
void onNodePropertyChanged(AbstractPropertyType propertyType, PropertyNotificationReason reason) override
Node::onNodePropertyChanged() implementation.
static PropertyTypeEditorInfoSharedPtr makeEditorInfo()
static AppView2DSharedPtr create(Domain *domain, string_view name)
void onFinishApp(FinishAppMessageArguments &messageArguments)
Definition app_view_2d.hpp:37
void onUpdateVirtualDisplay(const UpdateVirtualDisplayMessageArguments &messageArguments)
Definition app_view_2d.hpp:47