2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/devel-api/addons/addon-base.h>
20 #include <dali-test-suite-utils.h>
22 static const std::string DUMMY_ADDON_NAME = "SampleAddOn";
24 int StringLen( const char* str )
29 int DoSum( int a, int b )
34 class TestDummyAddOn : public Dali::AddOns::AddOnBase
38 void GetAddOnInfo( Dali::AddOnInfo& info ) override
40 info.type = Dali::AddOnType::GENERIC;
41 info.name = "SampleAddOn";
42 info.version = Dali::DALI_ADDON_VERSION( 1, 0, 0 );
44 tet_printf( "SampleAddOn: GetAddOnInfo() : name = %s\n", info.name.c_str());
48 * Dispatch table for global functions
51 Dali::AddOns::DispatchTable* GetGlobalDispatchTable() override
53 static Dali::AddOns::DispatchTable dispatchTable{};
54 if( dispatchTable.Empty() )
56 dispatchTable["DoSum"] = DoSum;
57 dispatchTable["StringLen"] = StringLen;
59 return &dispatchTable;
66 void OnStart() override
70 void OnStop() override
74 void OnPause() override
78 void OnResume() override
83 * Dispatch table for instance functions
86 Dali::AddOns::DispatchTable* GetInstanceDispatchTable() override
92 REGISTER_ADDON_CLASS( TestDummyAddOn );