summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/DllAddon.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/addons/DllAddon.h')
-rw-r--r--xbmc/addons/DllAddon.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/xbmc/addons/DllAddon.h b/xbmc/addons/DllAddon.h
new file mode 100644
index 0000000..3ea4e8d
--- /dev/null
+++ b/xbmc/addons/DllAddon.h
@@ -0,0 +1,70 @@
1#pragma once
2/*
3* Copyright (C) 2005-2013 Team XBMC
4* http://xbmc.org
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 2, or (at your option)
9* 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 XBMC; see the file COPYING. If not, see
18* <http://www.gnu.org/licenses/>.
19*
20*/
21
22#include "DynamicDll.h"
23#include "addons/include/xbmc_addon_cpp_dll.h"
24
25template <typename TheStruct, typename Props>
26class DllAddonInterface
27{
28public:
29 virtual ~DllAddonInterface() {}
30 virtual void GetAddon(TheStruct* pAddon) =0;
31 virtual ADDON_STATUS Create(void *cb, Props *info) =0;
32 virtual void Stop() =0;
33 virtual void Destroy() =0;
34 virtual ADDON_STATUS GetStatus() =0;
35 virtual bool HasSettings() =0;
36 virtual unsigned int GetSettings(ADDON_StructSetting*** sSet)=0;
37 virtual void FreeSettings()=0;
38 virtual ADDON_STATUS SetSetting(const char *settingName, const void *settingValue) =0;
39 virtual void Announce(const char *flag, const char *sender, const char *message, const void *data) =0;
40};
41
42template <typename TheStruct, typename Props>
43class DllAddon : public DllDynamic, public DllAddonInterface<TheStruct, Props>
44{
45public:
46 DECLARE_DLL_WRAPPER_TEMPLATE(DllAddon)
47 DEFINE_METHOD2(ADDON_STATUS, Create, (void* p1, Props* p2))
48 DEFINE_METHOD0(void, Stop)
49 DEFINE_METHOD0(void, Destroy)
50 DEFINE_METHOD0(ADDON_STATUS, GetStatus)
51 DEFINE_METHOD0(bool, HasSettings)
52 DEFINE_METHOD1(unsigned int, GetSettings, (ADDON_StructSetting ***p1))
53 DEFINE_METHOD0(void, FreeSettings)
54 DEFINE_METHOD2(ADDON_STATUS, SetSetting, (const char *p1, const void *p2))
55 DEFINE_METHOD1(void, GetAddon, (TheStruct* p1))
56 DEFINE_METHOD4(void, Announce, (const char *p1, const char *p2, const char *p3, const void *p4))
57 BEGIN_METHOD_RESOLVE()
58 RESOLVE_METHOD_RENAME(get_addon,GetAddon)
59 RESOLVE_METHOD_RENAME(ADDON_Create, Create)
60 RESOLVE_METHOD_RENAME(ADDON_Stop, Stop)
61 RESOLVE_METHOD_RENAME(ADDON_Destroy, Destroy)
62 RESOLVE_METHOD_RENAME(ADDON_GetStatus, GetStatus)
63 RESOLVE_METHOD_RENAME(ADDON_HasSettings, HasSettings)
64 RESOLVE_METHOD_RENAME(ADDON_SetSetting, SetSetting)
65 RESOLVE_METHOD_RENAME(ADDON_GetSettings, GetSettings)
66 RESOLVE_METHOD_RENAME(ADDON_FreeSettings, FreeSettings)
67 RESOLVE_METHOD_RENAME(ADDON_Announce, Announce)
68 END_METHOD_RESOLVE()
69};
70