summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/AddonCallbacks.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/addons/AddonCallbacks.h')
-rw-r--r--xbmc/addons/AddonCallbacks.h466
1 files changed, 466 insertions, 0 deletions
diff --git a/xbmc/addons/AddonCallbacks.h b/xbmc/addons/AddonCallbacks.h
new file mode 100644
index 0000000..f0902e4
--- /dev/null
+++ b/xbmc/addons/AddonCallbacks.h
@@ -0,0 +1,466 @@
1#pragma once
2/*
3 * Copyright (C) 2012-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 <stdint.h>
23#include "cores/dvdplayer/DVDDemuxers/DVDDemuxUtils.h"
24#include "addons/include/xbmc_pvr_types.h"
25#include "addons/include/xbmc_codec_types.h"
26#include "../../addons/library.xbmc.gui/libXBMC_gui.h"
27
28#ifdef TARGET_WINDOWS
29#ifndef _SSIZE_T_DEFINED
30typedef intptr_t ssize_t;
31#define _SSIZE_T_DEFINED
32#endif // !_SSIZE_T_DEFINED
33#endif // TARGET_WINDOWS
34
35typedef void (*AddOnLogCallback)(void *addonData, const ADDON::addon_log_t loglevel, const char *msg);
36typedef void (*AddOnQueueNotification)(void *addonData, const ADDON::queue_msg_t type, const char *msg);
37typedef bool (*AddOnWakeOnLan)(const char* mac);
38typedef bool (*AddOnGetSetting)(void *addonData, const char *settingName, void *settingValue);
39typedef char* (*AddOnUnknownToUTF8)(const char *sourceDest);
40typedef char* (*AddOnGetLocalizedString)(const void* addonData, long dwCode);
41typedef char* (*AddOnGetDVDMenuLanguage)(const void* addonData);
42typedef void (*AddOnFreeString)(const void* addonData, char* str);
43
44typedef void* (*AddOnOpenFile)(const void* addonData, const char* strFileName, unsigned int flags);
45typedef void* (*AddOnOpenFileForWrite)(const void* addonData, const char* strFileName, bool bOverWrite);
46typedef ssize_t (*AddOnReadFile)(const void* addonData, void* file, void* lpBuf, size_t uiBufSize);
47typedef bool (*AddOnReadFileString)(const void* addonData, void* file, char *szLine, int iLineLength);
48typedef ssize_t (*AddOnWriteFile)(const void* addonData, void* file, const void* lpBuf, size_t uiBufSize);
49typedef void (*AddOnFlushFile)(const void* addonData, void* file);
50typedef int64_t (*AddOnSeekFile)(const void* addonData, void* file, int64_t iFilePosition, int iWhence);
51typedef int (*AddOnTruncateFile)(const void* addonData, void* file, int64_t iSize);
52typedef int64_t (*AddOnGetFilePosition)(const void* addonData, void* file);
53typedef int64_t (*AddOnGetFileLength)(const void* addonData, void* file);
54typedef void (*AddOnCloseFile)(const void* addonData, void* file);
55typedef int (*AddOnGetFileChunkSize)(const void* addonData, void* file);
56typedef bool (*AddOnFileExists)(const void* addonData, const char *strFileName, bool bUseCache);
57typedef int (*AddOnStatFile)(const void* addonData, const char *strFileName, struct __stat64* buffer);
58typedef bool (*AddOnDeleteFile)(const void* addonData, const char *strFileName);
59typedef bool (*AddOnCanOpenDirectory)(const void* addonData, const char* strURL);
60typedef bool (*AddOnCreateDirectory)(const void* addonData, const char *strPath);
61typedef bool (*AddOnDirectoryExists)(const void* addonData, const char *strPath);
62typedef bool (*AddOnRemoveDirectory)(const void* addonData, const char *strPath);
63
64typedef struct CB_AddOn
65{
66 AddOnLogCallback Log;
67 AddOnQueueNotification QueueNotification;
68 AddOnWakeOnLan WakeOnLan;
69 AddOnGetSetting GetSetting;
70 AddOnUnknownToUTF8 UnknownToUTF8;
71 AddOnGetLocalizedString GetLocalizedString;
72 AddOnGetDVDMenuLanguage GetDVDMenuLanguage;
73 AddOnFreeString FreeString;
74
75 AddOnOpenFile OpenFile;
76 AddOnOpenFileForWrite OpenFileForWrite;
77 AddOnReadFile ReadFile;
78 AddOnReadFileString ReadFileString;
79 AddOnWriteFile WriteFile;
80 AddOnFlushFile FlushFile;
81 AddOnSeekFile SeekFile;
82 AddOnTruncateFile TruncateFile;
83 AddOnGetFilePosition GetFilePosition;
84 AddOnGetFileLength GetFileLength;
85 AddOnCloseFile CloseFile;
86 AddOnGetFileChunkSize GetFileChunkSize;
87 AddOnFileExists FileExists;
88 AddOnStatFile StatFile;
89 AddOnDeleteFile DeleteFile;
90 AddOnCanOpenDirectory CanOpenDirectory;
91 AddOnCreateDirectory CreateDirectory;
92 AddOnDirectoryExists DirectoryExists;
93 AddOnRemoveDirectory RemoveDirectory;
94} CB_AddOnLib;
95
96typedef xbmc_codec_t (*CODECGetCodecByName)(const void* addonData, const char* strCodecName);
97
98typedef struct CB_CODEC
99{
100 CODECGetCodecByName GetCodecByName;
101} CB_CODECLib;
102
103typedef void (*GUILock)();
104typedef void (*GUIUnlock)();
105typedef int (*GUIGetScreenHeight)();
106typedef int (*GUIGetScreenWidth)();
107typedef int (*GUIGetVideoResolution)();
108typedef GUIHANDLE (*GUIWindow_New)(void *addonData, const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog);
109typedef void (*GUIWindow_Delete)(void *addonData, GUIHANDLE handle);
110typedef void (*GUIWindow_SetCallbacks)(void *addonData, GUIHANDLE handle, GUIHANDLE clienthandle, bool (*)(GUIHANDLE handle), bool (*)(GUIHANDLE handle, int), bool (*)(GUIHANDLE handle, int), bool (*)(GUIHANDLE handle, int));
111typedef bool (*GUIWindow_Show)(void *addonData, GUIHANDLE handle);
112typedef bool (*GUIWindow_Close)(void *addonData, GUIHANDLE handle);
113typedef bool (*GUIWindow_DoModal)(void *addonData, GUIHANDLE handle);
114typedef bool (*GUIWindow_SetFocusId)(void *addonData, GUIHANDLE handle, int iControlId);
115typedef int (*GUIWindow_GetFocusId)(void *addonData, GUIHANDLE handle);
116typedef bool (*GUIWindow_SetCoordinateResolution)(void *addonData, GUIHANDLE handle, int res);
117typedef void (*GUIWindow_SetProperty)(void *addonData, GUIHANDLE handle, const char *key, const char *value);
118typedef void (*GUIWindow_SetPropertyInt)(void *addonData, GUIHANDLE handle, const char *key, int value);
119typedef void (*GUIWindow_SetPropertyBool)(void *addonData, GUIHANDLE handle, const char *key, bool value);
120typedef void (*GUIWindow_SetPropertyDouble)(void *addonData, GUIHANDLE handle, const char *key, double value);
121typedef const char* (*GUIWindow_GetProperty)(void *addonData, GUIHANDLE handle, const char *key);
122typedef int (*GUIWindow_GetPropertyInt)(void *addonData, GUIHANDLE handle, const char *key);
123typedef bool (*GUIWindow_GetPropertyBool)(void *addonData, GUIHANDLE handle, const char *key);
124typedef double (*GUIWindow_GetPropertyDouble)(void *addonData, GUIHANDLE handle, const char *key);
125typedef void (*GUIWindow_ClearProperties)(void *addonData, GUIHANDLE handle);
126typedef int (*GUIWindow_GetListSize)(void *addonData, GUIHANDLE handle);
127typedef void (*GUIWindow_ClearList)(void *addonData, GUIHANDLE handle);
128typedef GUIHANDLE (*GUIWindow_AddItem)(void *addonData, GUIHANDLE handle, GUIHANDLE item, int itemPosition);
129typedef GUIHANDLE (*GUIWindow_AddStringItem)(void *addonData, GUIHANDLE handle, const char *itemName, int itemPosition);
130typedef void (*GUIWindow_RemoveItem)(void *addonData, GUIHANDLE handle, int itemPosition);
131typedef GUIHANDLE (*GUIWindow_GetListItem)(void *addonData, GUIHANDLE handle, int listPos);
132typedef void (*GUIWindow_SetCurrentListPosition)(void *addonData, GUIHANDLE handle, int listPos);
133typedef int (*GUIWindow_GetCurrentListPosition)(void *addonData, GUIHANDLE handle);
134typedef GUIHANDLE (*GUIWindow_GetControl_Spin)(void *addonData, GUIHANDLE handle, int controlId);
135typedef GUIHANDLE (*GUIWindow_GetControl_Button)(void *addonData, GUIHANDLE handle, int controlId);
136typedef GUIHANDLE (*GUIWindow_GetControl_RadioButton)(void *addonData, GUIHANDLE handle, int controlId);
137typedef GUIHANDLE (*GUIWindow_GetControl_Edit)(void *addonData, GUIHANDLE handle, int controlId);
138typedef GUIHANDLE (*GUIWindow_GetControl_Progress)(void *addonData, GUIHANDLE handle, int controlId);
139typedef GUIHANDLE (*GUIWindow_GetControl_RenderAddon)(void *addonData, GUIHANDLE handle, int controlId);
140typedef void (*GUIWindow_SetControlLabel)(void *addonData, GUIHANDLE handle, int controlId, const char *label);
141typedef void (*GUIWindow_MarkDirtyRegion)(void *addonData, GUIHANDLE handle);
142typedef void (*GUIControl_Spin_SetVisible)(void *addonData, GUIHANDLE spinhandle, bool yesNo);
143typedef void (*GUIControl_Spin_SetText)(void *addonData, GUIHANDLE spinhandle, const char *label);
144typedef void (*GUIControl_Spin_Clear)(void *addonData, GUIHANDLE spinhandle);
145typedef void (*GUIControl_Spin_AddLabel)(void *addonData, GUIHANDLE spinhandle, const char *label, int iValue);
146typedef int (*GUIControl_Spin_GetValue)(void *addonData, GUIHANDLE spinhandle);
147typedef void (*GUIControl_Spin_SetValue)(void *addonData, GUIHANDLE spinhandle, int iValue);
148typedef void (*GUIControl_RadioButton_SetVisible)(void *addonData, GUIHANDLE handle, bool yesNo);
149typedef void (*GUIControl_RadioButton_SetText)(void *addonData, GUIHANDLE handle, const char *label);
150typedef void (*GUIControl_RadioButton_SetSelected)(void *addonData, GUIHANDLE handle, bool yesNo);
151typedef bool (*GUIControl_RadioButton_IsSelected)(void *addonData, GUIHANDLE handle);
152typedef void (*GUIControl_Progress_SetPercentage)(void *addonData, GUIHANDLE handle, float fPercent);
153typedef float (*GUIControl_Progress_GetPercentage)(void *addonData, GUIHANDLE handle);
154typedef void (*GUIControl_Progress_SetInfo)(void *addonData, GUIHANDLE handle, int iInfo);
155typedef int (*GUIControl_Progress_GetInfo)(void *addonData, GUIHANDLE handle);
156typedef const char* (*GUIControl_Progress_GetDescription)(void *addonData, GUIHANDLE handle);
157typedef GUIHANDLE (*GUIWindow_GetControl_Slider)(void *addonData, GUIHANDLE handle, int controlId);
158typedef void (*GUIControl_Slider_SetVisible)(void *addonData, GUIHANDLE handle, bool yesNo);
159typedef const char *(*GUIControl_Slider_GetDescription)(void *addonData, GUIHANDLE handle);
160typedef void (*GUIControl_Slider_SetIntRange)(void *addonData, GUIHANDLE handle, int iStart, int iEnd);
161typedef void (*GUIControl_Slider_SetIntValue)(void *addonData, GUIHANDLE handle, int iValue);
162typedef int (*GUIControl_Slider_GetIntValue)(void *addonData, GUIHANDLE handle);
163typedef void (*GUIControl_Slider_SetIntInterval)(void *addonData, GUIHANDLE handle, int iInterval);
164typedef void (*GUIControl_Slider_SetPercentage)(void *addonData, GUIHANDLE handle, float fPercent);
165typedef float (*GUIControl_Slider_GetPercentage)(void *addonData, GUIHANDLE handle);
166typedef void (*GUIControl_Slider_SetFloatRange)(void *addonData, GUIHANDLE handle, float fStart, float fEnd);
167typedef void (*GUIControl_Slider_SetFloatValue)(void *addonData, GUIHANDLE handle, float fValue);
168typedef float (*GUIControl_Slider_GetFloatValue)(void *addonData, GUIHANDLE handle);
169typedef void (*GUIControl_Slider_SetFloatInterval)(void *addonData, GUIHANDLE handle, float fInterval);
170typedef GUIHANDLE (*GUIWindow_GetControl_SettingsSlider)(void *addonData, GUIHANDLE handle, int controlId);
171typedef void (*GUIControl_SettingsSlider_SetVisible)(void *addonData, GUIHANDLE handle, bool yesNo);
172typedef void (*GUIControl_SettingsSlider_SetText)(void *addonData, GUIHANDLE handle, const char *label);
173typedef const char *(*GUIControl_SettingsSlider_GetDescription)(void *addonData, GUIHANDLE handle);
174typedef void (*GUIControl_SettingsSlider_SetIntRange)(void *addonData, GUIHANDLE handle, int iStart, int iEnd);
175typedef void (*GUIControl_SettingsSlider_SetIntValue)(void *addonData, GUIHANDLE handle, int iValue);
176typedef int (*GUIControl_SettingsSlider_GetIntValue)(void *addonData, GUIHANDLE handle);
177typedef void (*GUIControl_SettingsSlider_SetIntInterval)(void *addonData, GUIHANDLE handle, int iInterval);
178typedef void (*GUIControl_SettingsSlider_SetPercentage)(void *addonData, GUIHANDLE handle, float fPercent);
179typedef float (*GUIControl_SettingsSlider_GetPercentage)(void *addonData, GUIHANDLE handle);
180typedef void (*GUIControl_SettingsSlider_SetFloatRange)(void *addonData, GUIHANDLE handle, float fStart, float fEnd);
181typedef void (*GUIControl_SettingsSlider_SetFloatValue)(void *addonData, GUIHANDLE handle, float fValue);
182typedef float (*GUIControl_SettingsSlider_GetFloatValue)(void *addonData, GUIHANDLE handle);
183typedef void (*GUIControl_SettingsSlider_SetFloatInterval)(void *addonData, GUIHANDLE handle, float fInterval);
184typedef GUIHANDLE (*GUIListItem_Create)(void *addonData, const char *label, const char *label2, const char *iconImage, const char *thumbnailImage, const char *path);
185typedef const char* (*GUIListItem_GetLabel)(void *addonData, GUIHANDLE handle);
186typedef void (*GUIListItem_SetLabel)(void *addonData, GUIHANDLE handle, const char *label);
187typedef const char* (*GUIListItem_GetLabel2)(void *addonData, GUIHANDLE handle);
188typedef void (*GUIListItem_SetLabel2)(void *addonData, GUIHANDLE handle, const char *label);
189typedef void (*GUIListItem_SetIconImage)(void *addonData, GUIHANDLE handle, const char *image);
190typedef void (*GUIListItem_SetThumbnailImage)(void *addonData, GUIHANDLE handle, const char *image);
191typedef void (*GUIListItem_SetInfo)(void *addonData, GUIHANDLE handle, const char *info);
192typedef void (*GUIListItem_SetProperty)(void *addonData, GUIHANDLE handle, const char *key, const char *value);
193typedef const char* (*GUIListItem_GetProperty)(void *addonData, GUIHANDLE handle, const char *key);
194typedef void (*GUIListItem_SetPath)(void *addonData, GUIHANDLE handle, const char *path);
195typedef void (*GUIRenderAddon_SetCallbacks)(void *addonData, GUIHANDLE handle, GUIHANDLE clienthandle, bool (*createCB)(GUIHANDLE,int,int,int,int,void*), void (*renderCB)(GUIHANDLE), void (*stopCB)(GUIHANDLE), bool (*dirtyCB)(GUIHANDLE));
196typedef void (*GUIRenderAddon_Delete)(void *addonData, GUIHANDLE handle);
197typedef void (*GUIRenderAddon_MarkDirty)(void *addonData, GUIHANDLE handle);
198
199typedef bool (*GUIDialog_Keyboard_ShowAndGetInputWithHead)(char &strTextString, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, bool hiddenInput, unsigned int autoCloseMs);
200typedef bool (*GUIDialog_Keyboard_ShowAndGetInput)(char &strTextString, unsigned int iMaxStringSize, bool allowEmptyResult, unsigned int autoCloseMs);
201typedef bool (*GUIDialog_Keyboard_ShowAndGetNewPasswordWithHead)(char &newPassword, unsigned int iMaxStringSize, const char *strHeading, bool allowEmptyResult, unsigned int autoCloseMs);
202typedef bool (*GUIDialog_Keyboard_ShowAndGetNewPassword)(char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs);
203typedef bool (*GUIDialog_Keyboard_ShowAndVerifyNewPasswordWithHead)(char &strNewPassword, unsigned int iMaxStringSize, const char *strHeading, bool allowEmpty, unsigned int autoCloseMs);
204typedef bool (*GUIDialog_Keyboard_ShowAndVerifyNewPassword)(char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs);
205typedef int (*GUIDialog_Keyboard_ShowAndVerifyPassword)(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries, unsigned int autoCloseMs);
206typedef bool (*GUIDialog_Keyboard_ShowAndGetFilter)(char &aTextString, unsigned int iMaxStringSize, bool searching, unsigned int autoCloseMs);
207typedef bool (*GUIDialog_Keyboard_SendTextToActiveKeyboard)(const char *aTextString, bool closeKeyboard);
208typedef bool (*GUIDialog_Keyboard_isKeyboardActivated)();
209
210typedef bool (*GUIDialog_Numeric_ShowAndVerifyNewPassword)(char &strNewPassword, unsigned int iMaxStringSize);
211typedef int (*GUIDialog_Numeric_ShowAndVerifyPassword)(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries);
212typedef bool (*GUIDialog_Numeric_ShowAndVerifyInput)(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, bool bGetUserInput);
213typedef bool (*GUIDialog_Numeric_ShowAndGetTime)(tm &time, const char *strHeading);
214typedef bool (*GUIDialog_Numeric_ShowAndGetDate)(tm &date, const char *strHeading);
215typedef bool (*GUIDialog_Numeric_ShowAndGetIPAddress)(char &strIPAddress, unsigned int iMaxStringSize, const char *strHeading);
216typedef bool (*GUIDialog_Numeric_ShowAndGetNumber)(char &strInput, unsigned int iMaxStringSize, const char *strHeading, unsigned int iAutoCloseTimeoutMs);
217typedef bool (*GUIDialog_Numeric_ShowAndGetSeconds)(char &timeString, unsigned int iMaxStringSize, const char *strHeading);
218
219typedef bool (*GUIDialog_FileBrowser_ShowAndGetFile)(const char *directory, const char *mask, const char *heading, char &path, unsigned int iMaxStringSize, bool useThumbs, bool useFileDirectories, bool singleList);
220
221typedef void (*GUIDialog_OK_ShowAndGetInputSingleText)(const char *heading, const char *text);
222typedef void (*GUIDialog_OK_ShowAndGetInputLineText)(const char *heading, const char *line0, const char *line1, const char *line2);
223
224typedef bool (*GUIDialog_YesNo_ShowAndGetInputSingleText)(const char *heading, const char *text, bool& bCanceled, const char *noLabel, const char *yesLabel);
225typedef bool (*GUIDialog_YesNo_ShowAndGetInputLineText)(const char *heading, const char *line0, const char *line1, const char *line2, const char *noLabel, const char *yesLabel);
226typedef bool (*GUIDialog_YesNo_ShowAndGetInputLineButtonText)(const char *heading, const char *line0, const char *line1, const char *line2, bool &bCanceled, const char *noLabel, const char *yesLabel);
227
228typedef void (*GUIDialog_TextViewer)(const char *heading, const char *text);
229
230typedef int (*GUIDialog_Select)(const char *heading, const char *entries[], unsigned int size, int selected);
231
232typedef struct CB_GUILib
233{
234 GUILock Lock;
235 GUIUnlock Unlock;
236 GUIGetScreenHeight GetScreenHeight;
237 GUIGetScreenWidth GetScreenWidth;
238 GUIGetVideoResolution GetVideoResolution;
239 GUIWindow_New Window_New;
240 GUIWindow_Delete Window_Delete;
241 GUIWindow_SetCallbacks Window_SetCallbacks;
242 GUIWindow_Show Window_Show;
243 GUIWindow_Close Window_Close;
244 GUIWindow_DoModal Window_DoModal;
245 GUIWindow_SetFocusId Window_SetFocusId;
246 GUIWindow_GetFocusId Window_GetFocusId;
247 GUIWindow_SetCoordinateResolution Window_SetCoordinateResolution;
248 GUIWindow_SetProperty Window_SetProperty;
249 GUIWindow_SetPropertyInt Window_SetPropertyInt;
250 GUIWindow_SetPropertyBool Window_SetPropertyBool;
251 GUIWindow_SetPropertyDouble Window_SetPropertyDouble;
252 GUIWindow_GetProperty Window_GetProperty;
253 GUIWindow_GetPropertyInt Window_GetPropertyInt;
254 GUIWindow_GetPropertyBool Window_GetPropertyBool;
255 GUIWindow_GetPropertyDouble Window_GetPropertyDouble;
256 GUIWindow_ClearProperties Window_ClearProperties;
257 GUIWindow_GetListSize Window_GetListSize;
258 GUIWindow_ClearList Window_ClearList;
259 GUIWindow_AddItem Window_AddItem;
260 GUIWindow_AddStringItem Window_AddStringItem;
261 GUIWindow_RemoveItem Window_RemoveItem;
262 GUIWindow_GetListItem Window_GetListItem;
263 GUIWindow_SetCurrentListPosition Window_SetCurrentListPosition;
264 GUIWindow_GetCurrentListPosition Window_GetCurrentListPosition;
265 GUIWindow_GetControl_Spin Window_GetControl_Spin;
266 GUIWindow_GetControl_Button Window_GetControl_Button;
267 GUIWindow_GetControl_RadioButton Window_GetControl_RadioButton;
268 GUIWindow_GetControl_Edit Window_GetControl_Edit;
269 GUIWindow_GetControl_Progress Window_GetControl_Progress;
270 GUIWindow_GetControl_RenderAddon Window_GetControl_RenderAddon;
271 GUIWindow_SetControlLabel Window_SetControlLabel;
272 GUIWindow_MarkDirtyRegion Window_MarkDirtyRegion;
273 GUIControl_Spin_SetVisible Control_Spin_SetVisible;
274 GUIControl_Spin_SetText Control_Spin_SetText;
275 GUIControl_Spin_Clear Control_Spin_Clear;
276 GUIControl_Spin_AddLabel Control_Spin_AddLabel;
277 GUIControl_Spin_GetValue Control_Spin_GetValue;
278 GUIControl_Spin_SetValue Control_Spin_SetValue;
279 GUIControl_RadioButton_SetVisible Control_RadioButton_SetVisible;
280 GUIControl_RadioButton_SetText Control_RadioButton_SetText;
281 GUIControl_RadioButton_SetSelected Control_RadioButton_SetSelected;
282 GUIControl_RadioButton_IsSelected Control_RadioButton_IsSelected;
283 GUIControl_Progress_SetPercentage Control_Progress_SetPercentage;
284 GUIControl_Progress_GetPercentage Control_Progress_GetPercentage;
285 GUIControl_Progress_SetInfo Control_Progress_SetInfo;
286 GUIControl_Progress_GetInfo Control_Progress_GetInfo;
287 GUIControl_Progress_GetDescription Control_Progress_GetDescription;
288 GUIListItem_Create ListItem_Create;
289 GUIListItem_GetLabel ListItem_GetLabel;
290 GUIListItem_SetLabel ListItem_SetLabel;
291 GUIListItem_GetLabel2 ListItem_GetLabel2;
292 GUIListItem_SetLabel2 ListItem_SetLabel2;
293 GUIListItem_SetIconImage ListItem_SetIconImage;
294 GUIListItem_SetThumbnailImage ListItem_SetThumbnailImage;
295 GUIListItem_SetInfo ListItem_SetInfo;
296 GUIListItem_SetProperty ListItem_SetProperty;
297 GUIListItem_GetProperty ListItem_GetProperty;
298 GUIListItem_SetPath ListItem_SetPath;
299 GUIRenderAddon_SetCallbacks RenderAddon_SetCallbacks;
300 GUIRenderAddon_Delete RenderAddon_Delete;
301
302 GUIWindow_GetControl_Slider Window_GetControl_Slider;
303 GUIControl_Slider_SetVisible Control_Slider_SetVisible;
304 GUIControl_Slider_GetDescription Control_Slider_GetDescription;
305 GUIControl_Slider_SetIntRange Control_Slider_SetIntRange;
306 GUIControl_Slider_SetIntValue Control_Slider_SetIntValue;
307 GUIControl_Slider_GetIntValue Control_Slider_GetIntValue;
308 GUIControl_Slider_SetIntInterval Control_Slider_SetIntInterval;
309 GUIControl_Slider_SetPercentage Control_Slider_SetPercentage;
310 GUIControl_Slider_GetPercentage Control_Slider_GetPercentage;
311 GUIControl_Slider_SetFloatRange Control_Slider_SetFloatRange;
312 GUIControl_Slider_SetFloatValue Control_Slider_SetFloatValue;
313 GUIControl_Slider_GetFloatValue Control_Slider_GetFloatValue;
314 GUIControl_Slider_SetFloatInterval Control_Slider_SetFloatInterval;
315
316 GUIWindow_GetControl_SettingsSlider Window_GetControl_SettingsSlider;
317 GUIControl_SettingsSlider_SetVisible Control_SettingsSlider_SetVisible;
318 GUIControl_SettingsSlider_SetText Control_SettingsSlider_SetText;
319 GUIControl_SettingsSlider_GetDescription Control_SettingsSlider_GetDescription;
320 GUIControl_SettingsSlider_SetIntRange Control_SettingsSlider_SetIntRange;
321 GUIControl_SettingsSlider_SetIntValue Control_SettingsSlider_SetIntValue;
322 GUIControl_SettingsSlider_GetIntValue Control_SettingsSlider_GetIntValue;
323 GUIControl_SettingsSlider_SetIntInterval Control_SettingsSlider_SetIntInterval;
324 GUIControl_SettingsSlider_SetPercentage Control_SettingsSlider_SetPercentage;
325 GUIControl_SettingsSlider_GetPercentage Control_SettingsSlider_GetPercentage;
326 GUIControl_SettingsSlider_SetFloatRange Control_SettingsSlider_SetFloatRange;
327 GUIControl_SettingsSlider_SetFloatValue Control_SettingsSlider_SetFloatValue;
328 GUIControl_SettingsSlider_GetFloatValue Control_SettingsSlider_GetFloatValue;
329 GUIControl_SettingsSlider_SetFloatInterval Control_SettingsSlider_SetFloatInterval;
330
331 GUIDialog_Keyboard_ShowAndGetInputWithHead Dialog_Keyboard_ShowAndGetInputWithHead;
332 GUIDialog_Keyboard_ShowAndGetInput Dialog_Keyboard_ShowAndGetInput;
333 GUIDialog_Keyboard_ShowAndGetNewPasswordWithHead Dialog_Keyboard_ShowAndGetNewPasswordWithHead;
334 GUIDialog_Keyboard_ShowAndGetNewPassword Dialog_Keyboard_ShowAndGetNewPassword;
335 GUIDialog_Keyboard_ShowAndVerifyNewPasswordWithHead Dialog_Keyboard_ShowAndVerifyNewPasswordWithHead;
336 GUIDialog_Keyboard_ShowAndVerifyNewPassword Dialog_Keyboard_ShowAndVerifyNewPassword;
337 GUIDialog_Keyboard_ShowAndVerifyPassword Dialog_Keyboard_ShowAndVerifyPassword;
338 GUIDialog_Keyboard_ShowAndGetFilter Dialog_Keyboard_ShowAndGetFilter;
339 GUIDialog_Keyboard_SendTextToActiveKeyboard Dialog_Keyboard_SendTextToActiveKeyboard;
340 GUIDialog_Keyboard_isKeyboardActivated Dialog_Keyboard_isKeyboardActivated;
341
342 GUIDialog_Numeric_ShowAndVerifyNewPassword Dialog_Numeric_ShowAndVerifyNewPassword;
343 GUIDialog_Numeric_ShowAndVerifyPassword Dialog_Numeric_ShowAndVerifyPassword;
344 GUIDialog_Numeric_ShowAndVerifyInput Dialog_Numeric_ShowAndVerifyInput;
345 GUIDialog_Numeric_ShowAndGetTime Dialog_Numeric_ShowAndGetTime;
346 GUIDialog_Numeric_ShowAndGetDate Dialog_Numeric_ShowAndGetDate;
347 GUIDialog_Numeric_ShowAndGetIPAddress Dialog_Numeric_ShowAndGetIPAddress;
348 GUIDialog_Numeric_ShowAndGetNumber Dialog_Numeric_ShowAndGetNumber;
349 GUIDialog_Numeric_ShowAndGetSeconds Dialog_Numeric_ShowAndGetSeconds;
350
351 GUIDialog_FileBrowser_ShowAndGetFile Dialog_FileBrowser_ShowAndGetFile;
352
353 GUIDialog_OK_ShowAndGetInputSingleText Dialog_OK_ShowAndGetInputSingleText;
354 GUIDialog_OK_ShowAndGetInputLineText Dialog_OK_ShowAndGetInputLineText;
355
356 GUIDialog_YesNo_ShowAndGetInputSingleText Dialog_YesNo_ShowAndGetInputSingleText;
357 GUIDialog_YesNo_ShowAndGetInputLineText Dialog_YesNo_ShowAndGetInputLineText;
358 GUIDialog_YesNo_ShowAndGetInputLineButtonText Dialog_YesNo_ShowAndGetInputLineButtonText;
359
360 GUIDialog_TextViewer Dialog_TextViewer;
361 GUIDialog_Select Dialog_Select;
362} CB_GUILib;
363
364typedef void (*PVRTransferEpgEntry)(void *userData, const ADDON_HANDLE handle, const EPG_TAG *epgentry);
365typedef void (*PVRTransferChannelEntry)(void *userData, const ADDON_HANDLE handle, const PVR_CHANNEL *chan);
366typedef void (*PVRTransferTimerEntry)(void *userData, const ADDON_HANDLE handle, const PVR_TIMER *timer);
367typedef void (*PVRTransferRecordingEntry)(void *userData, const ADDON_HANDLE handle, const PVR_RECORDING *recording);
368typedef void (*PVRAddMenuHook)(void *addonData, PVR_MENUHOOK *hook);
369typedef void (*PVRRecording)(void *addonData, const char *Name, const char *FileName, bool On);
370typedef void (*PVRTriggerChannelUpdate)(void *addonData);
371typedef void (*PVRTriggerTimerUpdate)(void *addonData);
372typedef void (*PVRTriggerRecordingUpdate)(void *addonData);
373typedef void (*PVRTriggerChannelGroupsUpdate)(void *addonData);
374typedef void (*PVRTriggerEpgUpdate)(void *addonData, unsigned int iChannelUid);
375
376typedef void (*PVRTransferChannelGroup)(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP *group);
377typedef void (*PVRTransferChannelGroupMember)(void *addonData, const ADDON_HANDLE handle, const PVR_CHANNEL_GROUP_MEMBER *member);
378
379typedef void (*PVRFreeDemuxPacket)(void *addonData, DemuxPacket* pPacket);
380typedef DemuxPacket* (*PVRAllocateDemuxPacket)(void *addonData, int iDataSize);
381
382typedef struct CB_PVRLib
383{
384 PVRTransferEpgEntry TransferEpgEntry;
385 PVRTransferChannelEntry TransferChannelEntry;
386 PVRTransferTimerEntry TransferTimerEntry;
387 PVRTransferRecordingEntry TransferRecordingEntry;
388 PVRAddMenuHook AddMenuHook;
389 PVRRecording Recording;
390 PVRTriggerChannelUpdate TriggerChannelUpdate;
391 PVRTriggerTimerUpdate TriggerTimerUpdate;
392 PVRTriggerRecordingUpdate TriggerRecordingUpdate;
393 PVRTriggerChannelGroupsUpdate TriggerChannelGroupsUpdate;
394 PVRTriggerEpgUpdate TriggerEpgUpdate;
395 PVRFreeDemuxPacket FreeDemuxPacket;
396 PVRAllocateDemuxPacket AllocateDemuxPacket;
397 PVRTransferChannelGroup TransferChannelGroup;
398 PVRTransferChannelGroupMember TransferChannelGroupMember;
399
400} CB_PVRLib;
401
402
403typedef CB_AddOnLib* (*XBMCAddOnLib_RegisterMe)(void *addonData);
404typedef void (*XBMCAddOnLib_UnRegisterMe)(void *addonData, CB_AddOnLib *cbTable);
405typedef CB_CODECLib* (*XBMCCODECLib_RegisterMe)(void *addonData);
406typedef void (*XBMCCODECLib_UnRegisterMe)(void *addonData, CB_CODECLib *cbTable);
407typedef CB_GUILib* (*XBMCGUILib_RegisterMe)(void *addonData);
408typedef void (*XBMCGUILib_UnRegisterMe)(void *addonData, CB_GUILib *cbTable);
409typedef CB_PVRLib* (*XBMCPVRLib_RegisterMe)(void *addonData);
410typedef void (*XBMCPVRLib_UnRegisterMe)(void *addonData, CB_PVRLib *cbTable);
411
412typedef struct AddonCB
413{
414 const char *libBasePath; ///> Never, never change this!!!
415 void *addonData;
416 XBMCAddOnLib_RegisterMe AddOnLib_RegisterMe;
417 XBMCAddOnLib_UnRegisterMe AddOnLib_UnRegisterMe;
418 XBMCCODECLib_RegisterMe CODECLib_RegisterMe;
419 XBMCCODECLib_UnRegisterMe CODECLib_UnRegisterMe;
420 XBMCGUILib_RegisterMe GUILib_RegisterMe;
421 XBMCGUILib_UnRegisterMe GUILib_UnRegisterMe;
422 XBMCPVRLib_RegisterMe PVRLib_RegisterMe;
423 XBMCPVRLib_UnRegisterMe PVRLib_UnRegisterMe;
424} AddonCB;
425
426
427namespace ADDON
428{
429
430class CAddon;
431class CAddonCallbacksAddon;
432class CAddonCallbacksCodec;
433class CAddonCallbacksGUI;
434class CAddonCallbacksPVR;
435
436class CAddonCallbacks
437{
438public:
439 CAddonCallbacks(CAddon* addon);
440 ~CAddonCallbacks();
441 AddonCB *GetCallbacks() { return m_callbacks; }
442
443 static CB_AddOnLib* AddOnLib_RegisterMe(void *addonData);
444 static void AddOnLib_UnRegisterMe(void *addonData, CB_AddOnLib *cbTable);
445 static CB_CODECLib* CODECLib_RegisterMe(void *addonData);
446 static void CODECLib_UnRegisterMe(void *addonData, CB_CODECLib *cbTable);
447 static CB_GUILib* GUILib_RegisterMe(void *addonData);
448 static void GUILib_UnRegisterMe(void *addonData, CB_GUILib *cbTable);
449 static CB_PVRLib* PVRLib_RegisterMe(void *addonData);
450 static void PVRLib_UnRegisterMe(void *addonData, CB_PVRLib *cbTable);
451
452 CAddonCallbacksAddon *GetHelperAddon() { return m_helperAddon; }
453 CAddonCallbacksCodec *GetHelperCodec() { return m_helperCODEC; }
454 CAddonCallbacksGUI *GetHelperGUI() { return m_helperGUI; }
455 CAddonCallbacksPVR *GetHelperPVR() { return m_helperPVR; }
456
457private:
458 AddonCB *m_callbacks;
459 CAddon *m_addon;
460 CAddonCallbacksAddon *m_helperAddon;
461 CAddonCallbacksCodec *m_helperCODEC;
462 CAddonCallbacksGUI *m_helperGUI;
463 CAddonCallbacksPVR *m_helperPVR;
464};
465
466}; /* namespace ADDON */