diff options
Diffstat (limited to 'addons/library.kodi.guilib/libKODI_guilib.h')
| -rw-r--r-- | addons/library.kodi.guilib/libKODI_guilib.h | 845 |
1 files changed, 845 insertions, 0 deletions
diff --git a/addons/library.kodi.guilib/libKODI_guilib.h b/addons/library.kodi.guilib/libKODI_guilib.h new file mode 100644 index 0000000..26be664 --- /dev/null +++ b/addons/library.kodi.guilib/libKODI_guilib.h | |||
| @@ -0,0 +1,845 @@ | |||
| 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 <string> | ||
| 23 | #include <vector> | ||
| 24 | #include <string.h> | ||
| 25 | #include <stdlib.h> | ||
| 26 | #include <stdio.h> | ||
| 27 | #include "libXBMC_addon.h" | ||
| 28 | |||
| 29 | typedef void* GUIHANDLE; | ||
| 30 | |||
| 31 | #ifdef _WIN32 | ||
| 32 | #define GUI_HELPER_DLL "\\library.kodi.guilib\\libKODI_guilib" ADDON_HELPER_EXT | ||
| 33 | #else | ||
| 34 | #define GUI_HELPER_DLL_NAME "libKODI_guilib-" ADDON_HELPER_ARCH ADDON_HELPER_EXT | ||
| 35 | #define GUI_HELPER_DLL "/library.kodi.guilib/" GUI_HELPER_DLL_NAME | ||
| 36 | #endif | ||
| 37 | |||
| 38 | /* current ADDONGUI API version */ | ||
| 39 | #define KODI_GUILIB_API_VERSION "5.8.0" | ||
| 40 | |||
| 41 | /* min. ADDONGUI API version */ | ||
| 42 | #define KODI_GUILIB_MIN_API_VERSION "5.8.0" | ||
| 43 | |||
| 44 | #define ADDON_ACTION_PREVIOUS_MENU 10 | ||
| 45 | #define ADDON_ACTION_CLOSE_DIALOG 51 | ||
| 46 | #define ADDON_ACTION_NAV_BACK 92 | ||
| 47 | |||
| 48 | class CAddonGUIWindow; | ||
| 49 | class CAddonGUISpinControl; | ||
| 50 | class CAddonGUIRadioButton; | ||
| 51 | class CAddonGUIProgressControl; | ||
| 52 | class CAddonListItem; | ||
| 53 | class CAddonGUIRenderingControl; | ||
| 54 | class CAddonGUISliderControl; | ||
| 55 | class CAddonGUISettingsSliderControl; | ||
| 56 | |||
| 57 | class CHelper_libKODI_guilib | ||
| 58 | { | ||
| 59 | public: | ||
| 60 | CHelper_libKODI_guilib() | ||
| 61 | { | ||
| 62 | m_libKODI_guilib = NULL; | ||
| 63 | m_Handle = NULL; | ||
| 64 | } | ||
| 65 | |||
| 66 | ~CHelper_libKODI_guilib() | ||
| 67 | { | ||
| 68 | if (m_libKODI_guilib) | ||
| 69 | { | ||
| 70 | GUI_unregister_me(m_Handle, m_Callbacks); | ||
| 71 | dlclose(m_libKODI_guilib); | ||
| 72 | } | ||
| 73 | } | ||
| 74 | |||
| 75 | bool RegisterMe(void *Handle) | ||
| 76 | { | ||
| 77 | m_Handle = Handle; | ||
| 78 | |||
| 79 | std::string libBasePath; | ||
| 80 | libBasePath = ((cb_array*)m_Handle)->libPath; | ||
| 81 | libBasePath += GUI_HELPER_DLL; | ||
| 82 | |||
| 83 | #if defined(ANDROID) | ||
| 84 | struct stat st; | ||
| 85 | if(stat(libBasePath.c_str(),&st) != 0) | ||
| 86 | { | ||
| 87 | std::string tempbin = getenv("XBMC_ANDROID_LIBS"); | ||
| 88 | libBasePath = tempbin + "/" + GUI_HELPER_DLL_NAME; | ||
| 89 | } | ||
| 90 | #endif | ||
| 91 | |||
| 92 | m_libKODI_guilib = dlopen(libBasePath.c_str(), RTLD_LAZY); | ||
| 93 | if (m_libKODI_guilib == NULL) | ||
| 94 | { | ||
| 95 | fprintf(stderr, "Unable to load %s\n", dlerror()); | ||
| 96 | return false; | ||
| 97 | } | ||
| 98 | |||
| 99 | GUI_register_me = (void* (*)(void *HANDLE)) | ||
| 100 | dlsym(m_libKODI_guilib, "GUI_register_me"); | ||
| 101 | if (GUI_register_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 102 | |||
| 103 | GUI_unregister_me = (void (*)(void *HANDLE, void *CB)) | ||
| 104 | dlsym(m_libKODI_guilib, "GUI_unregister_me"); | ||
| 105 | if (GUI_unregister_me == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 106 | |||
| 107 | GUI_lock = (void (*)(void *HANDLE, void *CB)) | ||
| 108 | dlsym(m_libKODI_guilib, "GUI_lock"); | ||
| 109 | if (GUI_lock == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 110 | |||
| 111 | GUI_unlock = (void (*)(void *HANDLE, void *CB)) | ||
| 112 | dlsym(m_libKODI_guilib, "GUI_unlock"); | ||
| 113 | if (GUI_unlock == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 114 | |||
| 115 | GUI_get_screen_height = (int (*)(void *HANDLE, void *CB)) | ||
| 116 | dlsym(m_libKODI_guilib, "GUI_get_screen_height"); | ||
| 117 | if (GUI_get_screen_height == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 118 | |||
| 119 | GUI_get_screen_width = (int (*)(void *HANDLE, void *CB)) | ||
| 120 | dlsym(m_libKODI_guilib, "GUI_get_screen_width"); | ||
| 121 | if (GUI_get_screen_width == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 122 | |||
| 123 | GUI_get_video_resolution = (int (*)(void *HANDLE, void *CB)) | ||
| 124 | dlsym(m_libKODI_guilib, "GUI_get_video_resolution"); | ||
| 125 | if (GUI_get_video_resolution == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 126 | |||
| 127 | GUI_Window_create = (CAddonGUIWindow* (*)(void *HANDLE, void *CB, const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog)) | ||
| 128 | dlsym(m_libKODI_guilib, "GUI_Window_create"); | ||
| 129 | if (GUI_Window_create == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 130 | |||
| 131 | GUI_Window_destroy = (void (*)(CAddonGUIWindow* p)) | ||
| 132 | dlsym(m_libKODI_guilib, "GUI_Window_destroy"); | ||
| 133 | if (GUI_Window_destroy == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 134 | |||
| 135 | GUI_control_get_spin = (CAddonGUISpinControl* (*)(void *HANDLE, void *CB, CAddonGUIWindow *window, int controlId)) | ||
| 136 | dlsym(m_libKODI_guilib, "GUI_control_get_spin"); | ||
| 137 | if (GUI_control_get_spin == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 138 | |||
| 139 | GUI_control_release_spin = (void (*)(CAddonGUISpinControl* p)) | ||
| 140 | dlsym(m_libKODI_guilib, "GUI_control_release_spin"); | ||
| 141 | if (GUI_control_release_spin == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 142 | |||
| 143 | GUI_control_get_radiobutton = (CAddonGUIRadioButton* (*)(void *HANDLE, void *CB, CAddonGUIWindow *window, int controlId)) | ||
| 144 | dlsym(m_libKODI_guilib, "GUI_control_get_radiobutton"); | ||
| 145 | if (GUI_control_get_radiobutton == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 146 | |||
| 147 | GUI_control_release_radiobutton = (void (*)(CAddonGUIRadioButton* p)) | ||
| 148 | dlsym(m_libKODI_guilib, "GUI_control_release_radiobutton"); | ||
| 149 | if (GUI_control_release_radiobutton == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 150 | |||
| 151 | GUI_control_get_progress = (CAddonGUIProgressControl* (*)(void *HANDLE, void *CB, CAddonGUIWindow *window, int controlId)) | ||
| 152 | dlsym(m_libKODI_guilib, "GUI_control_get_progress"); | ||
| 153 | if (GUI_control_get_progress == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 154 | |||
| 155 | GUI_control_release_progress = (void (*)(CAddonGUIProgressControl* p)) | ||
| 156 | dlsym(m_libKODI_guilib, "GUI_control_release_progress"); | ||
| 157 | if (GUI_control_release_progress == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 158 | |||
| 159 | GUI_ListItem_create = (CAddonListItem* (*)(void *HANDLE, void *CB, const char *label, const char *label2, const char *iconImage, const char *thumbnailImage, const char *path)) | ||
| 160 | dlsym(m_libKODI_guilib, "GUI_ListItem_create"); | ||
| 161 | if (GUI_ListItem_create == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 162 | |||
| 163 | GUI_ListItem_destroy = (void (*)(CAddonListItem* p)) | ||
| 164 | dlsym(m_libKODI_guilib, "GUI_ListItem_destroy"); | ||
| 165 | if (GUI_ListItem_destroy == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 166 | |||
| 167 | GUI_control_get_rendering = (CAddonGUIRenderingControl* (*)(void *HANDLE, void *CB, CAddonGUIWindow *window, int controlId)) | ||
| 168 | dlsym(m_libKODI_guilib, "GUI_control_get_rendering"); | ||
| 169 | if (GUI_control_get_rendering == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 170 | |||
| 171 | GUI_control_release_rendering = (void (*)(CAddonGUIRenderingControl* p)) | ||
| 172 | dlsym(m_libKODI_guilib, "GUI_control_release_rendering"); | ||
| 173 | if (GUI_control_release_rendering == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 174 | |||
| 175 | GUI_control_get_slider = (CAddonGUISliderControl* (*)(void *HANDLE, void *CB, CAddonGUIWindow *window, int controlId)) | ||
| 176 | dlsym(m_libKODI_guilib, "GUI_control_get_slider"); | ||
| 177 | if (GUI_control_get_slider == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 178 | |||
| 179 | GUI_control_release_slider = (void (*)(CAddonGUISliderControl* p)) | ||
| 180 | dlsym(m_libKODI_guilib, "GUI_control_release_slider"); | ||
| 181 | if (GUI_control_release_slider == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 182 | |||
| 183 | GUI_control_get_settings_slider = (CAddonGUISettingsSliderControl* (*)(void *HANDLE, void *CB, CAddonGUIWindow *window, int controlId)) | ||
| 184 | dlsym(m_libKODI_guilib, "GUI_control_get_settings_slider"); | ||
| 185 | if (GUI_control_get_settings_slider == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 186 | |||
| 187 | GUI_control_release_settings_slider = (void (*)(CAddonGUISettingsSliderControl* p)) | ||
| 188 | dlsym(m_libKODI_guilib, "GUI_control_release_settings_slider"); | ||
| 189 | if (GUI_control_release_settings_slider == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 190 | |||
| 191 | GUI_dialog_keyboard_show_and_get_input_with_head = (bool (*)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, bool hiddenInput, unsigned int autoCloseMs)) | ||
| 192 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_show_and_get_input_with_head"); | ||
| 193 | if (GUI_dialog_keyboard_show_and_get_input_with_head == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 194 | |||
| 195 | GUI_dialog_keyboard_show_and_get_input = (bool (*)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, bool allowEmptyResult, unsigned int autoCloseMs)) | ||
| 196 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_show_and_get_input"); | ||
| 197 | if (GUI_dialog_keyboard_show_and_get_input == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 198 | |||
| 199 | GUI_dialog_keyboard_show_and_get_new_password_with_head = (bool (*)(void *HANDLE, void *CB, char &newPassword, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, unsigned int autoCloseMs)) | ||
| 200 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_show_and_get_new_password_with_head"); | ||
| 201 | if (GUI_dialog_keyboard_show_and_get_new_password_with_head == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 202 | |||
| 203 | GUI_dialog_keyboard_show_and_get_new_password = (bool (*)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs)) | ||
| 204 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_show_and_get_new_password"); | ||
| 205 | if (GUI_dialog_keyboard_show_and_get_new_password == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 206 | |||
| 207 | GUI_dialog_keyboard_show_and_verify_new_password_with_head = (bool (*)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, unsigned int autoCloseMs)) | ||
| 208 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_show_and_verify_new_password_with_head"); | ||
| 209 | if (GUI_dialog_keyboard_show_and_verify_new_password_with_head == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 210 | |||
| 211 | GUI_dialog_keyboard_show_and_verify_new_password = (bool (*)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs)) | ||
| 212 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_show_and_verify_new_password"); | ||
| 213 | if (GUI_dialog_keyboard_show_and_verify_new_password == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 214 | |||
| 215 | GUI_dialog_keyboard_show_and_verify_password = (int (*)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries, unsigned int autoCloseMs)) | ||
| 216 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_show_and_verify_password"); | ||
| 217 | if (GUI_dialog_keyboard_show_and_verify_password == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 218 | |||
| 219 | GUI_dialog_keyboard_show_and_get_filter = (bool (*)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, bool searching, unsigned int autoCloseMs)) | ||
| 220 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_show_and_get_filter"); | ||
| 221 | if (GUI_dialog_keyboard_show_and_get_filter == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 222 | |||
| 223 | GUI_dialog_keyboard_send_text_to_active_keyboard = (bool (*)(void *HANDLE, void *CB, const char *aTextString, bool closeKeyboard)) | ||
| 224 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_send_text_to_active_keyboard"); | ||
| 225 | if (GUI_dialog_keyboard_send_text_to_active_keyboard == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 226 | |||
| 227 | GUI_dialog_keyboard_is_activated = (bool (*)(void *HANDLE, void *CB)) | ||
| 228 | dlsym(m_libKODI_guilib, "GUI_dialog_keyboard_is_activated"); | ||
| 229 | if (GUI_dialog_keyboard_is_activated == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 230 | |||
| 231 | GUI_dialog_numeric_show_and_verify_new_password = (bool (*)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize)) | ||
| 232 | dlsym(m_libKODI_guilib, "GUI_dialog_numeric_show_and_verify_new_password"); | ||
| 233 | if (GUI_dialog_numeric_show_and_verify_new_password == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 234 | |||
| 235 | GUI_dialog_numeric_show_and_verify_password = (int (*)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries)) | ||
| 236 | dlsym(m_libKODI_guilib, "GUI_dialog_numeric_show_and_verify_password"); | ||
| 237 | if (GUI_dialog_numeric_show_and_verify_password == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 238 | |||
| 239 | GUI_dialog_numeric_show_and_verify_input = (bool (*)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, bool bGetUserInput)) | ||
| 240 | dlsym(m_libKODI_guilib, "GUI_dialog_numeric_show_and_verify_input"); | ||
| 241 | if (GUI_dialog_numeric_show_and_verify_input == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 242 | |||
| 243 | GUI_dialog_numeric_show_and_get_time = (bool (*)(void *HANDLE, void *CB, tm &time, const char *strHeading)) | ||
| 244 | dlsym(m_libKODI_guilib, "GUI_dialog_numeric_show_and_get_time"); | ||
| 245 | if (GUI_dialog_numeric_show_and_get_time == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 246 | |||
| 247 | GUI_dialog_numeric_show_and_get_date = (bool (*)(void *HANDLE, void *CB, tm &date, const char *strHeading)) | ||
| 248 | dlsym(m_libKODI_guilib, "GUI_dialog_numeric_show_and_get_date"); | ||
| 249 | if (GUI_dialog_numeric_show_and_get_date == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 250 | |||
| 251 | GUI_dialog_numeric_show_and_get_ipaddress = (bool (*)(void *HANDLE, void *CB, char &IPAddress, unsigned int iMaxStringSize, const char *strHeading)) | ||
| 252 | dlsym(m_libKODI_guilib, "GUI_dialog_numeric_show_and_get_ipaddress"); | ||
| 253 | if (GUI_dialog_numeric_show_and_get_ipaddress == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 254 | |||
| 255 | GUI_dialog_numeric_show_and_get_number = (bool (*)(void *HANDLE, void *CB, char &strInput, unsigned int iMaxStringSize, const char *strHeading, unsigned int iAutoCloseTimeoutMs)) | ||
| 256 | dlsym(m_libKODI_guilib, "GUI_dialog_numeric_show_and_get_number"); | ||
| 257 | if (GUI_dialog_numeric_show_and_get_number == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 258 | |||
| 259 | GUI_dialog_numeric_show_and_get_seconds = (bool (*)(void *HANDLE, void *CB, char &strTime, unsigned int iMaxStringSize, const char *strHeading)) | ||
| 260 | dlsym(m_libKODI_guilib, "GUI_dialog_numeric_show_and_get_seconds"); | ||
| 261 | if (GUI_dialog_numeric_show_and_get_seconds == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 262 | |||
| 263 | GUI_dialog_filebrowser_show_and_get_file = (bool (*)(void *HANDLE, void *CB, const char *directory, const char *mask, const char *heading, char &path, unsigned int iMaxStringSize, bool useThumbs, bool useFileDirectories, bool singleList)) | ||
| 264 | dlsym(m_libKODI_guilib, "GUI_dialog_filebrowser_show_and_get_file"); | ||
| 265 | if (GUI_dialog_filebrowser_show_and_get_file == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 266 | |||
| 267 | GUI_dialog_ok_show_and_get_input_single_text = (void (*)(void *HANDLE, void *CB, const char *heading, const char *text)) | ||
| 268 | dlsym(m_libKODI_guilib, "GUI_dialog_ok_show_and_get_input_single_text"); | ||
| 269 | if (GUI_dialog_ok_show_and_get_input_single_text == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 270 | |||
| 271 | GUI_dialog_ok_show_and_get_input_line_text = (void (*)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2)) | ||
| 272 | dlsym(m_libKODI_guilib, "GUI_dialog_ok_show_and_get_input_line_text"); | ||
| 273 | if (GUI_dialog_ok_show_and_get_input_line_text == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 274 | |||
| 275 | GUI_dialog_yesno_show_and_get_input_singletext = (bool (*)(void *HANDLE, void *CB, const char *heading, const char *text, bool& bCanceled, const char *noLabel, const char *yesLabel)) | ||
| 276 | dlsym(m_libKODI_guilib, "GUI_dialog_yesno_show_and_get_input_singletext"); | ||
| 277 | if (GUI_dialog_yesno_show_and_get_input_singletext == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 278 | |||
| 279 | GUI_dialog_yesno_show_and_get_input_linetext = (bool (*)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2, const char *noLabel, const char *yesLabel)) | ||
| 280 | dlsym(m_libKODI_guilib, "GUI_dialog_yesno_show_and_get_input_linetext"); | ||
| 281 | if (GUI_dialog_yesno_show_and_get_input_linetext == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 282 | |||
| 283 | GUI_dialog_yesno_show_and_get_input_linebuttontext = (bool (*)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2, bool &bCanceled, const char *noLabel, const char *yesLabel)) | ||
| 284 | dlsym(m_libKODI_guilib, "GUI_dialog_yesno_show_and_get_input_linebuttontext"); | ||
| 285 | if (GUI_dialog_yesno_show_and_get_input_linebuttontext == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 286 | |||
| 287 | GUI_dialog_text_viewer = (void (*)(void *hdl, void *cb, const char *heading, const char *text)) | ||
| 288 | dlsym(m_libKODI_guilib, "GUI_dialog_text_viewer"); | ||
| 289 | if (GUI_dialog_text_viewer == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 290 | |||
| 291 | GUI_dialog_select = (int (*)(void *hdl, void *cb, const char *heading, const char *entries[], unsigned int size, int selected)) | ||
| 292 | dlsym(m_libKODI_guilib, "GUI_dialog_select"); | ||
| 293 | if (GUI_dialog_select == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } | ||
| 294 | |||
| 295 | m_Callbacks = GUI_register_me(m_Handle); | ||
| 296 | return m_Callbacks != NULL; | ||
| 297 | } | ||
| 298 | |||
| 299 | void Lock() | ||
| 300 | { | ||
| 301 | return GUI_lock(m_Handle, m_Callbacks); | ||
| 302 | } | ||
| 303 | |||
| 304 | void Unlock() | ||
| 305 | { | ||
| 306 | return GUI_unlock(m_Handle, m_Callbacks); | ||
| 307 | } | ||
| 308 | |||
| 309 | int GetScreenHeight() | ||
| 310 | { | ||
| 311 | return GUI_get_screen_height(m_Handle, m_Callbacks); | ||
| 312 | } | ||
| 313 | |||
| 314 | int GetScreenWidth() | ||
| 315 | { | ||
| 316 | return GUI_get_screen_width(m_Handle, m_Callbacks); | ||
| 317 | } | ||
| 318 | |||
| 319 | int GetVideoResolution() | ||
| 320 | { | ||
| 321 | return GUI_get_video_resolution(m_Handle, m_Callbacks); | ||
| 322 | } | ||
| 323 | |||
| 324 | CAddonGUIWindow* Window_create(const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog) | ||
| 325 | { | ||
| 326 | return GUI_Window_create(m_Handle, m_Callbacks, xmlFilename, defaultSkin, forceFallback, asDialog); | ||
| 327 | } | ||
| 328 | |||
| 329 | void Window_destroy(CAddonGUIWindow* p) | ||
| 330 | { | ||
| 331 | return GUI_Window_destroy(p); | ||
| 332 | } | ||
| 333 | |||
| 334 | CAddonGUISpinControl* Control_getSpin(CAddonGUIWindow *window, int controlId) | ||
| 335 | { | ||
| 336 | return GUI_control_get_spin(m_Handle, m_Callbacks, window, controlId); | ||
| 337 | } | ||
| 338 | |||
| 339 | void Control_releaseSpin(CAddonGUISpinControl* p) | ||
| 340 | { | ||
| 341 | return GUI_control_release_spin(p); | ||
| 342 | } | ||
| 343 | |||
| 344 | CAddonGUIRadioButton* Control_getRadioButton(CAddonGUIWindow *window, int controlId) | ||
| 345 | { | ||
| 346 | return GUI_control_get_radiobutton(m_Handle, m_Callbacks, window, controlId); | ||
| 347 | } | ||
| 348 | |||
| 349 | void Control_releaseRadioButton(CAddonGUIRadioButton* p) | ||
| 350 | { | ||
| 351 | return GUI_control_release_radiobutton(p); | ||
| 352 | } | ||
| 353 | |||
| 354 | CAddonGUIProgressControl* Control_getProgress(CAddonGUIWindow *window, int controlId) | ||
| 355 | { | ||
| 356 | return GUI_control_get_progress(m_Handle, m_Callbacks, window, controlId); | ||
| 357 | } | ||
| 358 | |||
| 359 | void Control_releaseProgress(CAddonGUIProgressControl* p) | ||
| 360 | { | ||
| 361 | return GUI_control_release_progress(p); | ||
| 362 | } | ||
| 363 | |||
| 364 | CAddonListItem* ListItem_create(const char *label, const char *label2, const char *iconImage, const char *thumbnailImage, const char *path) | ||
| 365 | { | ||
| 366 | return GUI_ListItem_create(m_Handle, m_Callbacks, label, label2, iconImage, thumbnailImage, path); | ||
| 367 | } | ||
| 368 | |||
| 369 | void ListItem_destroy(CAddonListItem* p) | ||
| 370 | { | ||
| 371 | return GUI_ListItem_destroy(p); | ||
| 372 | } | ||
| 373 | |||
| 374 | CAddonGUIRenderingControl* Control_getRendering(CAddonGUIWindow *window, int controlId) | ||
| 375 | { | ||
| 376 | return GUI_control_get_rendering(m_Handle, m_Callbacks, window, controlId); | ||
| 377 | } | ||
| 378 | |||
| 379 | void Control_releaseRendering(CAddonGUIRenderingControl* p) | ||
| 380 | { | ||
| 381 | return GUI_control_release_rendering(p); | ||
| 382 | } | ||
| 383 | |||
| 384 | CAddonGUISliderControl* Control_getSlider(CAddonGUIWindow *window, int controlId) | ||
| 385 | { | ||
| 386 | return GUI_control_get_slider(m_Handle, m_Callbacks, window, controlId); | ||
| 387 | } | ||
| 388 | |||
| 389 | void Control_releaseSlider(CAddonGUISliderControl* p) | ||
| 390 | { | ||
| 391 | return GUI_control_release_slider(p); | ||
| 392 | } | ||
| 393 | |||
| 394 | CAddonGUISettingsSliderControl* Control_getSettingsSlider(CAddonGUIWindow *window, int controlId) | ||
| 395 | { | ||
| 396 | return GUI_control_get_settings_slider(m_Handle, m_Callbacks, window, controlId); | ||
| 397 | } | ||
| 398 | |||
| 399 | void Control_releaseSettingsSlider(CAddonGUISettingsSliderControl* p) | ||
| 400 | { | ||
| 401 | return GUI_control_release_settings_slider(p); | ||
| 402 | } | ||
| 403 | |||
| 404 | /*! @name GUI Keyboard functions */ | ||
| 405 | //@{ | ||
| 406 | bool Dialog_Keyboard_ShowAndGetInput(char &strText, unsigned int iMaxStringSize, const char *strHeading, bool allowEmptyResult, bool hiddenInput, unsigned int autoCloseMs = 0) | ||
| 407 | { | ||
| 408 | return GUI_dialog_keyboard_show_and_get_input_with_head(m_Handle, m_Callbacks, strText, iMaxStringSize, strHeading, allowEmptyResult, hiddenInput, autoCloseMs); | ||
| 409 | } | ||
| 410 | |||
| 411 | bool Dialog_Keyboard_ShowAndGetInput(char &strText, unsigned int iMaxStringSize, bool allowEmptyResult, unsigned int autoCloseMs = 0) | ||
| 412 | { | ||
| 413 | return GUI_dialog_keyboard_show_and_get_input(m_Handle, m_Callbacks, strText, iMaxStringSize, allowEmptyResult, autoCloseMs); | ||
| 414 | } | ||
| 415 | |||
| 416 | bool Dialog_Keyboard_ShowAndGetNewPassword(char &strNewPassword, unsigned int iMaxStringSize, const char *strHeading, bool allowEmptyResult, unsigned int autoCloseMs = 0) | ||
| 417 | { | ||
| 418 | return GUI_dialog_keyboard_show_and_get_new_password_with_head(m_Handle, m_Callbacks, strNewPassword, iMaxStringSize, strHeading, allowEmptyResult, autoCloseMs); | ||
| 419 | } | ||
| 420 | |||
| 421 | bool Dialog_Keyboard_ShowAndGetNewPassword(char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs = 0) | ||
| 422 | { | ||
| 423 | return GUI_dialog_keyboard_show_and_get_new_password(m_Handle, m_Callbacks, strNewPassword, iMaxStringSize, autoCloseMs); | ||
| 424 | } | ||
| 425 | |||
| 426 | bool Dialog_Keyboard_ShowAndVerifyNewPassword(char &strNewPassword, unsigned int iMaxStringSize, const char *strHeading, bool allowEmptyResult, unsigned int autoCloseMs = 0) | ||
| 427 | { | ||
| 428 | return GUI_dialog_keyboard_show_and_verify_new_password_with_head(m_Handle, m_Callbacks, strNewPassword, iMaxStringSize, strHeading, allowEmptyResult, autoCloseMs); | ||
| 429 | } | ||
| 430 | |||
| 431 | bool Dialog_Keyboard_ShowAndVerifyNewPassword(char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs = 0) | ||
| 432 | { | ||
| 433 | return GUI_dialog_keyboard_show_and_verify_new_password(m_Handle, m_Callbacks, strNewPassword, iMaxStringSize, autoCloseMs); | ||
| 434 | } | ||
| 435 | |||
| 436 | int Dialog_Keyboard_ShowAndVerifyPassword(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries, unsigned int autoCloseMs = 0) | ||
| 437 | { | ||
| 438 | return GUI_dialog_keyboard_show_and_verify_password(m_Handle, m_Callbacks, strPassword, iMaxStringSize, strHeading, iRetries, autoCloseMs); | ||
| 439 | } | ||
| 440 | |||
| 441 | bool Dialog_Keyboard_ShowAndGetFilter(char &strText, unsigned int iMaxStringSize, bool searching, unsigned int autoCloseMs = 0) | ||
| 442 | { | ||
| 443 | return GUI_dialog_keyboard_show_and_get_filter(m_Handle, m_Callbacks, strText, iMaxStringSize, searching, autoCloseMs); | ||
| 444 | } | ||
| 445 | |||
| 446 | bool Dialog_Keyboard_SendTextToActiveKeyboard(const char *aTextString, bool closeKeyboard = false) | ||
| 447 | { | ||
| 448 | return GUI_dialog_keyboard_send_text_to_active_keyboard(m_Handle, m_Callbacks, aTextString, closeKeyboard); | ||
| 449 | } | ||
| 450 | |||
| 451 | bool Dialog_Keyboard_isKeyboardActivated() | ||
| 452 | { | ||
| 453 | return GUI_dialog_keyboard_is_activated(m_Handle, m_Callbacks); | ||
| 454 | } | ||
| 455 | //@} | ||
| 456 | |||
| 457 | /*! @name GUI Numeric functions */ | ||
| 458 | //@{ | ||
| 459 | bool Dialog_Numeric_ShowAndVerifyNewPassword(char &strNewPassword, unsigned int iMaxStringSize) | ||
| 460 | { | ||
| 461 | return GUI_dialog_numeric_show_and_verify_new_password(m_Handle, m_Callbacks, strNewPassword, iMaxStringSize); | ||
| 462 | } | ||
| 463 | |||
| 464 | int Dialog_Numeric_ShowAndVerifyPassword(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries) | ||
| 465 | { | ||
| 466 | return GUI_dialog_numeric_show_and_verify_password(m_Handle, m_Callbacks, strPassword, iMaxStringSize, strHeading, iRetries); | ||
| 467 | } | ||
| 468 | |||
| 469 | bool Dialog_Numeric_ShowAndVerifyInput(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, bool bGetUserInput) | ||
| 470 | { | ||
| 471 | return GUI_dialog_numeric_show_and_verify_input(m_Handle, m_Callbacks, strPassword, iMaxStringSize, strHeading, bGetUserInput); | ||
| 472 | } | ||
| 473 | |||
| 474 | bool Dialog_Numeric_ShowAndGetTime(tm &time, const char *strHeading) | ||
| 475 | { | ||
| 476 | return GUI_dialog_numeric_show_and_get_time(m_Handle, m_Callbacks, time, strHeading); | ||
| 477 | } | ||
| 478 | |||
| 479 | bool Dialog_Numeric_ShowAndGetDate(tm &date, const char *strHeading) | ||
| 480 | { | ||
| 481 | return GUI_dialog_numeric_show_and_get_date(m_Handle, m_Callbacks, date, strHeading); | ||
| 482 | } | ||
| 483 | |||
| 484 | bool Dialog_Numeric_ShowAndGetIPAddress(char &strIPAddress, unsigned int iMaxStringSize, const char *strHeading) | ||
| 485 | { | ||
| 486 | return GUI_dialog_numeric_show_and_get_ipaddress(m_Handle, m_Callbacks, strIPAddress, iMaxStringSize, strHeading); | ||
| 487 | } | ||
| 488 | |||
| 489 | bool Dialog_Numeric_ShowAndGetNumber(char &strInput, unsigned int iMaxStringSize, const char *strHeading, unsigned int iAutoCloseTimeoutMs = 0) | ||
| 490 | { | ||
| 491 | return GUI_dialog_numeric_show_and_get_number(m_Handle, m_Callbacks, strInput, iMaxStringSize, strHeading, iAutoCloseTimeoutMs = 0); | ||
| 492 | } | ||
| 493 | |||
| 494 | bool Dialog_Numeric_ShowAndGetSeconds(char &strTime, unsigned int iMaxStringSize, const char *strHeading) | ||
| 495 | { | ||
| 496 | return GUI_dialog_numeric_show_and_get_seconds(m_Handle, m_Callbacks, strTime, iMaxStringSize, strHeading); | ||
| 497 | } | ||
| 498 | //@} | ||
| 499 | |||
| 500 | /*! @name GUI File browser functions */ | ||
| 501 | //@{ | ||
| 502 | bool Dialog_FileBrowser_ShowAndGetFile(const char *directory, const char *mask, const char *heading, char &strPath, unsigned int iMaxStringSize, bool useThumbs = false, bool useFileDirectories = false, bool singleList = false) | ||
| 503 | { | ||
| 504 | return GUI_dialog_filebrowser_show_and_get_file(m_Handle, m_Callbacks, directory, mask, heading, strPath, iMaxStringSize, useThumbs, useFileDirectories, singleList); | ||
| 505 | } | ||
| 506 | //@} | ||
| 507 | |||
| 508 | /*! @name GUI OK Dialog functions */ | ||
| 509 | //@{ | ||
| 510 | void Dialog_OK_ShowAndGetInput(const char *heading, const char *text) | ||
| 511 | { | ||
| 512 | GUI_dialog_ok_show_and_get_input_single_text(m_Handle, m_Callbacks, heading, text); | ||
| 513 | } | ||
| 514 | |||
| 515 | void Dialog_OK_ShowAndGetInput(const char *heading, const char *line0, const char *line1, const char *line2) | ||
| 516 | { | ||
| 517 | GUI_dialog_ok_show_and_get_input_line_text(m_Handle, m_Callbacks, heading, line0, line1, line2); | ||
| 518 | } | ||
| 519 | //@} | ||
| 520 | |||
| 521 | /*! @name GUI Yes No Dialog functions */ | ||
| 522 | //@{ | ||
| 523 | bool Dialog_YesNo_ShowAndGetInput(const char *heading, const char *text, bool& bCanceled, const char *noLabel = "", const char *yesLabel = "") | ||
| 524 | { | ||
| 525 | return GUI_dialog_yesno_show_and_get_input_singletext(m_Handle, m_Callbacks, heading, text, bCanceled, noLabel, yesLabel); | ||
| 526 | } | ||
| 527 | |||
| 528 | bool Dialog_YesNo_ShowAndGetInput(const char *heading, const char *line0, const char *line1, const char *line2, const char *noLabel = "", const char *yesLabel = "") | ||
| 529 | { | ||
| 530 | return GUI_dialog_yesno_show_and_get_input_linetext(m_Handle, m_Callbacks, heading, line0, line1, line2, noLabel, yesLabel); | ||
| 531 | } | ||
| 532 | |||
| 533 | bool Dialog_YesNo_ShowAndGetInput(const char *heading, const char *line0, const char *line1, const char *line2, bool &bCanceled, const char *noLabel = "", const char *yesLabel = "") | ||
| 534 | { | ||
| 535 | return GUI_dialog_yesno_show_and_get_input_linebuttontext(m_Handle, m_Callbacks, heading, line0, line1, line2, bCanceled, noLabel, yesLabel); | ||
| 536 | } | ||
| 537 | //@} | ||
| 538 | |||
| 539 | /*! @name GUI Text viewer Dialog */ | ||
| 540 | //@{ | ||
| 541 | void Dialog_TextViewer(const char *heading, const char *text) | ||
| 542 | { | ||
| 543 | return GUI_dialog_text_viewer(m_Handle, m_Callbacks, heading, text); | ||
| 544 | } | ||
| 545 | //@} | ||
| 546 | |||
| 547 | /*! @name GUI select Dialog */ | ||
| 548 | //@{ | ||
| 549 | int Dialog_Select(const char *heading, const char *entries[], unsigned int size, int selected = -1) | ||
| 550 | { | ||
| 551 | return GUI_dialog_select(m_Handle, m_Callbacks, heading, entries, size, selected); | ||
| 552 | } | ||
| 553 | //@} | ||
| 554 | |||
| 555 | protected: | ||
| 556 | void* (*GUI_register_me)(void *HANDLE); | ||
| 557 | void (*GUI_unregister_me)(void *HANDLE, void* CB); | ||
| 558 | void (*GUI_lock)(void *HANDLE, void* CB); | ||
| 559 | void (*GUI_unlock)(void *HANDLE, void* CB); | ||
| 560 | int (*GUI_get_screen_height)(void *HANDLE, void* CB); | ||
| 561 | int (*GUI_get_screen_width)(void *HANDLE, void* CB); | ||
| 562 | int (*GUI_get_video_resolution)(void *HANDLE, void* CB); | ||
| 563 | CAddonGUIWindow* (*GUI_Window_create)(void *HANDLE, void* CB, const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog); | ||
| 564 | void (*GUI_Window_destroy)(CAddonGUIWindow* p); | ||
| 565 | CAddonGUISpinControl* (*GUI_control_get_spin)(void *HANDLE, void* CB, CAddonGUIWindow *window, int controlId); | ||
| 566 | void (*GUI_control_release_spin)(CAddonGUISpinControl* p); | ||
| 567 | CAddonGUIRadioButton* (*GUI_control_get_radiobutton)(void *HANDLE, void* CB, CAddonGUIWindow *window, int controlId); | ||
| 568 | void (*GUI_control_release_radiobutton)(CAddonGUIRadioButton* p); | ||
| 569 | CAddonGUIProgressControl* (*GUI_control_get_progress)(void *HANDLE, void* CB, CAddonGUIWindow *window, int controlId); | ||
| 570 | void (*GUI_control_release_progress)(CAddonGUIProgressControl* p); | ||
| 571 | CAddonListItem* (*GUI_ListItem_create)(void *HANDLE, void* CB, const char *label, const char *label2, const char *iconImage, const char *thumbnailImage, const char *path); | ||
| 572 | void (*GUI_ListItem_destroy)(CAddonListItem* p); | ||
| 573 | CAddonGUIRenderingControl* (*GUI_control_get_rendering)(void *HANDLE, void* CB, CAddonGUIWindow *window, int controlId); | ||
| 574 | void (*GUI_control_release_rendering)(CAddonGUIRenderingControl* p); | ||
| 575 | CAddonGUISliderControl* (*GUI_control_get_slider)(void *HANDLE, void* CB, CAddonGUIWindow *window, int controlId); | ||
| 576 | void (*GUI_control_release_slider)(CAddonGUISliderControl* p); | ||
| 577 | CAddonGUISettingsSliderControl* (*GUI_control_get_settings_slider)(void *HANDLE, void* CB, CAddonGUIWindow *window, int controlId); | ||
| 578 | void (*GUI_control_release_settings_slider)(CAddonGUISettingsSliderControl* p); | ||
| 579 | bool (*GUI_dialog_keyboard_show_and_get_input_with_head)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, bool hiddenInput, unsigned int autoCloseMs); | ||
| 580 | bool (*GUI_dialog_keyboard_show_and_get_input)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, bool allowEmptyResult, unsigned int autoCloseMs); | ||
| 581 | bool (*GUI_dialog_keyboard_show_and_get_new_password_with_head)(void *HANDLE, void *CB, char &newPassword, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, unsigned int autoCloseMs); | ||
| 582 | bool (*GUI_dialog_keyboard_show_and_get_new_password)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs); | ||
| 583 | bool (*GUI_dialog_keyboard_show_and_verify_new_password_with_head)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, unsigned int autoCloseMs); | ||
| 584 | bool (*GUI_dialog_keyboard_show_and_verify_new_password)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs); | ||
| 585 | int (*GUI_dialog_keyboard_show_and_verify_password)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries, unsigned int autoCloseMs); | ||
| 586 | bool (*GUI_dialog_keyboard_show_and_get_filter)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, bool searching, unsigned int autoCloseMs); | ||
| 587 | bool (*GUI_dialog_keyboard_send_text_to_active_keyboard)(void *HANDLE, void *CB, const char *aTextString, bool closeKeyboard); | ||
| 588 | bool (*GUI_dialog_keyboard_is_activated)(void *HANDLE, void *CB); | ||
| 589 | bool (*GUI_dialog_numeric_show_and_verify_new_password)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize); | ||
| 590 | int (*GUI_dialog_numeric_show_and_verify_password)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries); | ||
| 591 | bool (*GUI_dialog_numeric_show_and_verify_input)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, bool bGetUserInput); | ||
| 592 | bool (*GUI_dialog_numeric_show_and_get_time)(void *HANDLE, void *CB, tm &time, const char *strHeading); | ||
| 593 | bool (*GUI_dialog_numeric_show_and_get_date)(void *HANDLE, void *CB, tm &date, const char *strHeading); | ||
| 594 | bool (*GUI_dialog_numeric_show_and_get_ipaddress)(void *HANDLE, void *CB, char &IPAddress, unsigned int iMaxStringSize, const char *strHeading); | ||
| 595 | bool (*GUI_dialog_numeric_show_and_get_number)(void *HANDLE, void *CB, char &strInput, unsigned int iMaxStringSize, const char *strHeading, unsigned int iAutoCloseTimeoutMs); | ||
| 596 | bool (*GUI_dialog_numeric_show_and_get_seconds)(void *HANDLE, void *CB, char &strTime, unsigned int iMaxStringSize, const char *strHeading); | ||
| 597 | bool (*GUI_dialog_filebrowser_show_and_get_file)(void *HANDLE, void *CB, const char *directory, const char *mask, const char *heading, char &path, unsigned int iMaxStringSize, bool useThumbs, bool useFileDirectories, bool singleList); | ||
| 598 | void (*GUI_dialog_ok_show_and_get_input_single_text)(void *HANDLE, void *CB, const char *heading, const char *text); | ||
| 599 | void (*GUI_dialog_ok_show_and_get_input_line_text)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2); | ||
| 600 | bool (*GUI_dialog_yesno_show_and_get_input_singletext)(void *HANDLE, void *CB, const char *heading, const char *text, bool& bCanceled, const char *noLabel, const char *yesLabel); | ||
| 601 | bool (*GUI_dialog_yesno_show_and_get_input_linetext)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2, const char *noLabel, const char *yesLabel); | ||
| 602 | bool (*GUI_dialog_yesno_show_and_get_input_linebuttontext)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2, bool &bCanceled, const char *noLabel, const char *yesLabel); | ||
| 603 | void (*GUI_dialog_text_viewer)(void *hdl, void *cb, const char *heading, const char *text); | ||
| 604 | int (*GUI_dialog_select)(void *hdl, void *cb, const char *heading, const char *entries[], unsigned int size, int selected); | ||
| 605 | |||
| 606 | private: | ||
| 607 | void *m_libKODI_guilib; | ||
| 608 | void *m_Handle; | ||
| 609 | void *m_Callbacks; | ||
| 610 | struct cb_array | ||
| 611 | { | ||
| 612 | const char* libPath; | ||
| 613 | }; | ||
| 614 | }; | ||
| 615 | |||
| 616 | class CAddonGUISpinControl | ||
| 617 | { | ||
| 618 | public: | ||
| 619 | CAddonGUISpinControl(void *hdl, void *cb, CAddonGUIWindow *window, int controlId); | ||
| 620 | virtual ~CAddonGUISpinControl(void) {} | ||
| 621 | |||
| 622 | virtual void SetVisible(bool yesNo); | ||
| 623 | virtual void SetText(const char *label); | ||
| 624 | virtual void Clear(); | ||
| 625 | virtual void AddLabel(const char *label, int iValue); | ||
| 626 | virtual int GetValue(); | ||
| 627 | virtual void SetValue(int iValue); | ||
| 628 | |||
| 629 | private: | ||
| 630 | CAddonGUIWindow *m_Window; | ||
| 631 | int m_ControlId; | ||
| 632 | GUIHANDLE m_SpinHandle; | ||
| 633 | void *m_Handle; | ||
| 634 | void *m_cb; | ||
| 635 | }; | ||
| 636 | |||
| 637 | class CAddonGUIRadioButton | ||
| 638 | { | ||
| 639 | public: | ||
| 640 | CAddonGUIRadioButton(void *hdl, void *cb, CAddonGUIWindow *window, int controlId); | ||
| 641 | virtual ~CAddonGUIRadioButton() {} | ||
| 642 | |||
| 643 | virtual void SetVisible(bool yesNo); | ||
| 644 | virtual void SetText(const char *label); | ||
| 645 | virtual void SetSelected(bool yesNo); | ||
| 646 | virtual bool IsSelected(); | ||
| 647 | |||
| 648 | private: | ||
| 649 | CAddonGUIWindow *m_Window; | ||
| 650 | int m_ControlId; | ||
| 651 | GUIHANDLE m_ButtonHandle; | ||
| 652 | void *m_Handle; | ||
| 653 | void *m_cb; | ||
| 654 | }; | ||
| 655 | |||
| 656 | class CAddonGUIProgressControl | ||
| 657 | { | ||
| 658 | public: | ||
| 659 | CAddonGUIProgressControl(void *hdl, void *cb, CAddonGUIWindow *window, int controlId); | ||
| 660 | virtual ~CAddonGUIProgressControl(void) {} | ||
| 661 | |||
| 662 | virtual void SetPercentage(float fPercent); | ||
| 663 | virtual float GetPercentage() const; | ||
| 664 | virtual void SetInfo(int iInfo); | ||
| 665 | virtual int GetInfo() const; | ||
| 666 | virtual std::string GetDescription() const; | ||
| 667 | |||
| 668 | private: | ||
| 669 | CAddonGUIWindow *m_Window; | ||
| 670 | int m_ControlId; | ||
| 671 | GUIHANDLE m_ProgressHandle; | ||
| 672 | void *m_Handle; | ||
| 673 | void *m_cb; | ||
| 674 | }; | ||
| 675 | |||
| 676 | class CAddonGUISliderControl | ||
| 677 | { | ||
| 678 | public: | ||
| 679 | CAddonGUISliderControl(void *hdl, void *cb, CAddonGUIWindow *window, int controlId); | ||
| 680 | virtual ~CAddonGUISliderControl(void) {} | ||
| 681 | |||
| 682 | virtual void SetVisible(bool yesNo); | ||
| 683 | virtual std::string GetDescription() const; | ||
| 684 | |||
| 685 | virtual void SetIntRange(int iStart, int iEnd); | ||
| 686 | virtual void SetIntValue(int iValue); | ||
| 687 | virtual int GetIntValue() const; | ||
| 688 | virtual void SetIntInterval(int iInterval); | ||
| 689 | |||
| 690 | virtual void SetPercentage(float fPercent); | ||
| 691 | virtual float GetPercentage() const; | ||
| 692 | |||
| 693 | virtual void SetFloatRange(float fStart, float fEnd); | ||
| 694 | virtual void SetFloatValue(float fValue); | ||
| 695 | virtual float GetFloatValue() const; | ||
| 696 | virtual void SetFloatInterval(float fInterval); | ||
| 697 | |||
| 698 | private: | ||
| 699 | CAddonGUIWindow *m_Window; | ||
| 700 | int m_ControlId; | ||
| 701 | GUIHANDLE m_SliderHandle; | ||
| 702 | void *m_Handle; | ||
| 703 | void *m_cb; | ||
| 704 | }; | ||
| 705 | |||
| 706 | class CAddonGUISettingsSliderControl | ||
| 707 | { | ||
| 708 | public: | ||
| 709 | CAddonGUISettingsSliderControl(void *hdl, void *cb, CAddonGUIWindow *window, int controlId); | ||
| 710 | virtual ~CAddonGUISettingsSliderControl(void) {} | ||
| 711 | |||
| 712 | virtual void SetVisible(bool yesNo); | ||
| 713 | virtual void SetText(const char *label); | ||
| 714 | virtual std::string GetDescription() const; | ||
| 715 | |||
| 716 | virtual void SetIntRange(int iStart, int iEnd); | ||
| 717 | virtual void SetIntValue(int iValue); | ||
| 718 | virtual int GetIntValue() const; | ||
| 719 | virtual void SetIntInterval(int iInterval); | ||
| 720 | |||
| 721 | virtual void SetPercentage(float fPercent); | ||
| 722 | virtual float GetPercentage() const; | ||
| 723 | |||
| 724 | virtual void SetFloatRange(float fStart, float fEnd); | ||
| 725 | virtual void SetFloatValue(float fValue); | ||
| 726 | virtual float GetFloatValue() const; | ||
| 727 | virtual void SetFloatInterval(float fInterval); | ||
| 728 | |||
| 729 | private: | ||
| 730 | CAddonGUIWindow *m_Window; | ||
| 731 | int m_ControlId; | ||
| 732 | GUIHANDLE m_SettingsSliderHandle; | ||
| 733 | void *m_Handle; | ||
| 734 | void *m_cb; | ||
| 735 | }; | ||
| 736 | |||
| 737 | class CAddonListItem | ||
| 738 | { | ||
| 739 | friend class CAddonGUIWindow; | ||
| 740 | |||
| 741 | public: | ||
| 742 | CAddonListItem(void *hdl, void *cb, const char *label, const char *label2, const char *iconImage, const char *thumbnailImage, const char *path); | ||
| 743 | virtual ~CAddonListItem(void) {} | ||
| 744 | |||
| 745 | virtual const char *GetLabel(); | ||
| 746 | virtual void SetLabel(const char *label); | ||
| 747 | virtual const char *GetLabel2(); | ||
| 748 | virtual void SetLabel2(const char *label); | ||
| 749 | virtual void SetIconImage(const char *image); | ||
| 750 | virtual void SetThumbnailImage(const char *image); | ||
| 751 | virtual void SetInfo(const char *Info); | ||
| 752 | virtual void SetProperty(const char *key, const char *value); | ||
| 753 | virtual const char *GetProperty(const char *key) const; | ||
| 754 | virtual void SetPath(const char *Path); | ||
| 755 | |||
| 756 | // {(char*)"select(); | ||
| 757 | // {(char*)"isSelected(); | ||
| 758 | protected: | ||
| 759 | GUIHANDLE m_ListItemHandle; | ||
| 760 | void *m_Handle; | ||
| 761 | void *m_cb; | ||
| 762 | }; | ||
| 763 | |||
| 764 | class CAddonGUIWindow | ||
| 765 | { | ||
| 766 | friend class CAddonGUISpinControl; | ||
| 767 | friend class CAddonGUIRadioButton; | ||
| 768 | friend class CAddonGUIProgressControl; | ||
| 769 | friend class CAddonGUIRenderingControl; | ||
| 770 | friend class CAddonGUISliderControl; | ||
| 771 | friend class CAddonGUISettingsSliderControl; | ||
| 772 | |||
| 773 | public: | ||
| 774 | CAddonGUIWindow(void *hdl, void *cb, const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog); | ||
| 775 | virtual ~CAddonGUIWindow(); | ||
| 776 | |||
| 777 | virtual bool Show(); | ||
| 778 | virtual void Close(); | ||
| 779 | virtual void DoModal(); | ||
| 780 | virtual bool SetFocusId(int iControlId); | ||
| 781 | virtual int GetFocusId(); | ||
| 782 | virtual bool SetCoordinateResolution(int res); | ||
| 783 | virtual void SetProperty(const char *key, const char *value); | ||
| 784 | virtual void SetPropertyInt(const char *key, int value); | ||
| 785 | virtual void SetPropertyBool(const char *key, bool value); | ||
| 786 | virtual void SetPropertyDouble(const char *key, double value); | ||
| 787 | virtual const char *GetProperty(const char *key) const; | ||
| 788 | virtual int GetPropertyInt(const char *key) const; | ||
| 789 | virtual bool GetPropertyBool(const char *key) const; | ||
| 790 | virtual double GetPropertyDouble(const char *key) const; | ||
| 791 | virtual void ClearProperties(); | ||
| 792 | virtual int GetListSize(); | ||
| 793 | virtual void ClearList(); | ||
| 794 | virtual GUIHANDLE AddStringItem(const char *name, int itemPosition = -1); | ||
| 795 | virtual void AddItem(GUIHANDLE item, int itemPosition = -1); | ||
| 796 | virtual void AddItem(CAddonListItem *item, int itemPosition = -1); | ||
| 797 | virtual void RemoveItem(int itemPosition); | ||
| 798 | virtual GUIHANDLE GetListItem(int listPos); | ||
| 799 | virtual void SetCurrentListPosition(int listPos); | ||
| 800 | virtual int GetCurrentListPosition(); | ||
| 801 | virtual void SetControlLabel(int controlId, const char *label); | ||
| 802 | virtual void MarkDirtyRegion(); | ||
| 803 | |||
| 804 | virtual bool OnClick(int controlId); | ||
| 805 | virtual bool OnFocus(int controlId); | ||
| 806 | virtual bool OnInit(); | ||
| 807 | virtual bool OnAction(int actionId); | ||
| 808 | |||
| 809 | GUIHANDLE m_cbhdl; | ||
| 810 | bool (*CBOnInit)(GUIHANDLE cbhdl); | ||
| 811 | bool (*CBOnFocus)(GUIHANDLE cbhdl, int controlId); | ||
| 812 | bool (*CBOnClick)(GUIHANDLE cbhdl, int controlId); | ||
| 813 | bool (*CBOnAction)(GUIHANDLE cbhdl, int actionId); | ||
| 814 | |||
| 815 | protected: | ||
| 816 | GUIHANDLE m_WindowHandle; | ||
| 817 | void *m_Handle; | ||
| 818 | void *m_cb; | ||
| 819 | }; | ||
| 820 | |||
| 821 | class CAddonGUIRenderingControl | ||
| 822 | { | ||
| 823 | public: | ||
| 824 | CAddonGUIRenderingControl(void *hdl, void *cb, CAddonGUIWindow *window, int controlId); | ||
| 825 | virtual ~CAddonGUIRenderingControl(); | ||
| 826 | virtual void Init(); | ||
| 827 | |||
| 828 | virtual bool Create(int x, int y, int w, int h, void *device); | ||
| 829 | virtual void Render(); | ||
| 830 | virtual void Stop(); | ||
| 831 | virtual bool Dirty(); | ||
| 832 | |||
| 833 | GUIHANDLE m_cbhdl; | ||
| 834 | bool (*CBCreate)(GUIHANDLE cbhdl, int x, int y, int w, int h, void *device); | ||
| 835 | void (*CBRender)(GUIHANDLE cbhdl); | ||
| 836 | void (*CBStop)(GUIHANDLE cbhdl); | ||
| 837 | bool (*CBDirty)(GUIHANDLE cbhdl); | ||
| 838 | |||
| 839 | private: | ||
| 840 | CAddonGUIWindow *m_Window; | ||
| 841 | int m_ControlId; | ||
| 842 | GUIHANDLE m_RenderingHandle; | ||
| 843 | void *m_Handle; | ||
| 844 | void *m_cb; | ||
| 845 | }; | ||
