diff options
| author | manuel <manuel@mausz.at> | 2015-03-04 00:23:39 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2015-03-04 00:23:39 +0100 |
| commit | 9d11b08ad61b1f0d6d7023ce403285d8662efaed (patch) | |
| tree | 5bc0c947d9e10d3e8c9dc1e6b26f3d6599f0cea1 /xbmc/addons/Skin.h | |
| parent | c159d9f91f1573901868100a9464527a5a71575b (diff) | |
| download | kodi-pvr-build-9d11b08ad61b1f0d6d7023ce403285d8662efaed.tar.gz kodi-pvr-build-9d11b08ad61b1f0d6d7023ce403285d8662efaed.tar.bz2 kodi-pvr-build-9d11b08ad61b1f0d6d7023ce403285d8662efaed.zip | |
sync with upstream
Diffstat (limited to 'xbmc/addons/Skin.h')
| -rw-r--r-- | xbmc/addons/Skin.h | 155 |
1 files changed, 0 insertions, 155 deletions
diff --git a/xbmc/addons/Skin.h b/xbmc/addons/Skin.h deleted file mode 100644 index 42bddf8..0000000 --- a/xbmc/addons/Skin.h +++ /dev/null | |||
| @@ -1,155 +0,0 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | /* | ||
| 4 | * Copyright (C) 2005-2013 Team XBMC | ||
| 5 | * http://xbmc.org | ||
| 6 | * | ||
| 7 | * This Program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2, or (at your option) | ||
| 10 | * any later version. | ||
| 11 | * | ||
| 12 | * This Program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with XBMC; see the file COPYING. If not, see | ||
| 19 | * <http://www.gnu.org/licenses/>. | ||
| 20 | * | ||
| 21 | */ | ||
| 22 | |||
| 23 | #include <vector> | ||
| 24 | |||
| 25 | #include "Addon.h" | ||
| 26 | #include "guilib/GraphicContext.h" // needed for the RESOLUTION members | ||
| 27 | #include "guilib/GUIIncludes.h" // needed for the GUIInclude member | ||
| 28 | #define CREDIT_LINE_LENGTH 50 | ||
| 29 | |||
| 30 | class CSetting; | ||
| 31 | |||
| 32 | namespace ADDON | ||
| 33 | { | ||
| 34 | |||
| 35 | class CSkinInfo : public CAddon | ||
| 36 | { | ||
| 37 | public: | ||
| 38 | class CStartupWindow | ||
| 39 | { | ||
| 40 | public: | ||
| 41 | CStartupWindow(int id, const std::string &name): | ||
| 42 | m_id(id), m_name(name) | ||
| 43 | { | ||
| 44 | }; | ||
| 45 | int m_id; | ||
| 46 | std::string m_name; | ||
| 47 | }; | ||
| 48 | |||
| 49 | //FIXME remove this, kept for current repo handling | ||
| 50 | CSkinInfo(const AddonProps &props, const RESOLUTION_INFO &res = RESOLUTION_INFO()); | ||
| 51 | CSkinInfo(const cp_extension_t *ext); | ||
| 52 | virtual ~CSkinInfo(); | ||
| 53 | virtual AddonPtr Clone() const; | ||
| 54 | |||
| 55 | /*! \brief Load resultion information from directories in Path(). | ||
| 56 | */ | ||
| 57 | void Start(); | ||
| 58 | |||
| 59 | bool HasSkinFile(const std::string &strFile) const; | ||
| 60 | |||
| 61 | /*! \brief Get the full path to the specified file in the skin | ||
| 62 | We search for XML files in the skin folder that best matches the current resolution. | ||
| 63 | \param file XML file to look for | ||
| 64 | \param res [out] If non-NULL, the resolution that the returned XML file is in is returned. Defaults to NULL. | ||
| 65 | \param baseDir [in] If non-empty, the given directory is searched instead of the skin's directory. Defaults to empty. | ||
| 66 | \return path to the XML file | ||
| 67 | */ | ||
| 68 | std::string GetSkinPath(const std::string& file, RESOLUTION_INFO *res = NULL, const std::string& baseDir = "") const; | ||
| 69 | |||
| 70 | AddonVersion APIVersion() const { return m_version; }; | ||
| 71 | |||
| 72 | /*! \brief Return whether skin debugging is enabled | ||
| 73 | \return true if skin debugging (set via <debugging>true</debugging> in skin.xml) is enabled. | ||
| 74 | */ | ||
| 75 | bool IsDebugging() const { return m_debugging; }; | ||
| 76 | |||
| 77 | /*! \brief Get the id of the first window to load | ||
| 78 | The first window is generally Startup.xml unless it doesn't exist or if the skinner | ||
| 79 | has specified which start windows they support and the user is going to somewhere other | ||
| 80 | than the home screen. | ||
| 81 | \return id of the first window to load | ||
| 82 | */ | ||
| 83 | int GetFirstWindow() const; | ||
| 84 | |||
| 85 | /*! \brief Get the id of the window the user wants to start in after any skin animation | ||
| 86 | \return id of the start window | ||
| 87 | */ | ||
| 88 | int GetStartWindow() const; | ||
| 89 | |||
| 90 | /*! \brief Translate a resolution string | ||
| 91 | \param name the string to translate | ||
| 92 | \param res [out] the resolution structure if name is valid | ||
| 93 | \return true if the resolution is valid, false otherwise | ||
| 94 | */ | ||
| 95 | static bool TranslateResolution(const std::string &name, RESOLUTION_INFO &res); | ||
| 96 | |||
| 97 | void ResolveIncludes(TiXmlElement *node, std::map<INFO::InfoPtr, bool>* xmlIncludeConditions = NULL); | ||
| 98 | |||
| 99 | float GetEffectsSlowdown() const { return m_effectsSlowDown; }; | ||
| 100 | |||
| 101 | const std::vector<CStartupWindow> &GetStartupWindows() const { return m_startupWindows; }; | ||
| 102 | |||
| 103 | /*! \brief Retrieve the skin paths to search for skin XML files | ||
| 104 | \param paths [out] vector of paths to search, in order. | ||
| 105 | */ | ||
| 106 | void GetSkinPaths(std::vector<std::string> &paths) const; | ||
| 107 | |||
| 108 | bool IsInUse() const; | ||
| 109 | |||
| 110 | const std::string& GetCurrentAspect() const { return m_currentAspect; } | ||
| 111 | |||
| 112 | void LoadIncludes(); | ||
| 113 | const INFO::CSkinVariableString* CreateSkinVariable(const std::string& name, int context); | ||
| 114 | |||
| 115 | static void SettingOptionsSkinColorsFiller(const CSetting *setting, std::vector< std::pair<std::string, std::string> > &list, std::string ¤t, void *data); | ||
| 116 | static void SettingOptionsSkinFontsFiller(const CSetting *setting, std::vector< std::pair<std::string, std::string> > &list, std::string ¤t, void *data); | ||
| 117 | static void SettingOptionsSkinSoundFiller(const CSetting *setting, std::vector< std::pair<std::string, std::string> > &list, std::string ¤t, void *data); | ||
| 118 | static void SettingOptionsSkinThemesFiller(const CSetting *setting, std::vector< std::pair<std::string, std::string> > &list, std::string ¤t, void *data); | ||
| 119 | static void SettingOptionsStartupWindowsFiller(const CSetting *setting, std::vector< std::pair<std::string, int> > &list, int ¤t, void *data); | ||
| 120 | |||
| 121 | virtual bool OnPreInstall(); | ||
| 122 | virtual void OnPostInstall(bool restart, bool update, bool modal); | ||
| 123 | protected: | ||
| 124 | /*! \brief Given a resolution, retrieve the corresponding directory name | ||
| 125 | \param res RESOLUTION to translate | ||
| 126 | \return directory name for res | ||
| 127 | */ | ||
| 128 | std::string GetDirFromRes(RESOLUTION res) const; | ||
| 129 | |||
| 130 | /*! \brief grab a resolution tag from a skin's configuration data | ||
| 131 | \param props passed addoninfo structure to check for resolution | ||
| 132 | \param tag name of the tag to look for | ||
| 133 | \param res resolution to return | ||
| 134 | \return true if we find a valid resolution, false otherwise | ||
| 135 | */ | ||
| 136 | void GetDefaultResolution(const cp_extension_t *ext, const char *tag, RESOLUTION &res, const RESOLUTION &def) const; | ||
| 137 | |||
| 138 | bool LoadStartupWindows(const cp_extension_t *ext); | ||
| 139 | |||
| 140 | RESOLUTION_INFO m_defaultRes; | ||
| 141 | std::vector<RESOLUTION_INFO> m_resolutions; | ||
| 142 | |||
| 143 | AddonVersion m_version; | ||
| 144 | |||
| 145 | float m_effectsSlowDown; | ||
| 146 | CGUIIncludes m_includes; | ||
| 147 | std::string m_currentAspect; | ||
| 148 | |||
| 149 | std::vector<CStartupWindow> m_startupWindows; | ||
| 150 | bool m_debugging; | ||
| 151 | }; | ||
| 152 | |||
| 153 | } /*namespace ADDON*/ | ||
| 154 | |||
| 155 | extern std::shared_ptr<ADDON::CSkinInfo> g_SkinInfo; | ||
