1 #ifndef DALI_INTERNAL_VECTOR_IMAGE_RENDERER_PLUGIN_PROXY_H
2 #define DALI_INTERNAL_VECTOR_IMAGE_RENDERER_PLUGIN_PROXY_H
5 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/devel-api/adaptor-framework/vector-image-renderer-plugin.h>
23 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
36 * Proxy class to dynamically load, use and unload vector image renderer plugin.
38 class VectorImageRendererPluginProxy
45 VectorImageRendererPluginProxy( std::string sharedObjectName );
50 ~VectorImageRendererPluginProxy();
53 * @copydoc Dali::VectorImageRendererPlugin::Initialize()
58 * @copydoc Dali::VectorImageRendererPlugin::SetBuffer()
60 void SetBuffer( Dali::Devel::PixelBuffer &buffer );
63 * @copydoc Dali::VectorImageRendererPlugin::Render()
65 bool Render(float scale);
68 * @copydoc Dali::VectorImageRendererPlugin::Load()
70 bool Load( const std::string& url );
73 * @copydoc Dali::VectorImageRendererPlugin::Load()
75 bool Load( const char *data, uint32_t size );
78 * @copydoc Dali::VectorImageRendererPlugin::GetDefaultSize()
80 void GetDefaultSize( uint32_t& width, uint32_t& height ) const;
82 // Not copyable or movable
83 VectorImageRendererPluginProxy( const VectorImageRendererPluginProxy& ) = delete; ///< Deleted copy constructor
84 VectorImageRendererPluginProxy( VectorImageRendererPluginProxy&& ) = delete; ///< Deleted move constructor
85 VectorImageRendererPluginProxy& operator=( const VectorImageRendererPluginProxy& ) = delete; ///< Deleted copy assignment operator
86 VectorImageRendererPluginProxy& operator=( VectorImageRendererPluginProxy&& ) = delete; ///< Deleted move assignment operator
91 * Dynamically loads the plugin.
93 void InitializePlugin();
97 using CreateVectorImageRendererFunction = Dali::VectorImageRendererPlugin* (*)();
99 std::string mSharedObjectName; ///< Shared object name
100 void* mLibHandle; ///< Handle for the loaded library
101 Dali::VectorImageRendererPlugin* mPlugin; ///< Plugin handle
103 CreateVectorImageRendererFunction mCreateVectorImageRendererPtr; ///< Function pointer called in adaptor to create a plugin instance
107 } // namespace Adaptor
109 } // namespace Internal
113 #endif // DALI_INTERNAL_VECTOR_IMAGE_RENDERER_PLUGIN_PROXY_H