LibreOffice Module vcl (master) 1
|
#include <implimagetree.hxx>
Classes | |
struct | IconSet |
Public Member Functions | |
ImplImageTree () | |
~ImplImageTree () | |
OUString | getImageUrl (OUString const &name, OUString const &style, OUString const &lang) |
std::shared_ptr< SvMemoryStream > | getImageStream (OUString const &rName, OUString const &rStyle, OUString const &rLang) |
bool | loadImage (OUString const &name, OUString const &style, BitmapEx &bitmap, bool localized, const ImageLoadFlags eFlags, sal_Int32 nScalePercentage=-1) |
void | shutdown () |
a crude form of life cycle control (called from DeInitVCL; otherwise, if the ImplImageTree singleton were destroyed during exit that would be too late for the destructors of the bitmaps in maIconCache) More... | |
css::uno::Reference< css::container::XNameAccess > const & | getNameAccess () |
Private Types | |
typedef std::unordered_map< OUString, std::pair< bool, BitmapEx > > | IconCache |
typedef std::unordered_map< sal_Int32, IconCache > | ScaledIconCache |
typedef std::unordered_map< OUString, OUString > | IconLinkHash |
Private Member Functions | |
ImplImageTree (const ImplImageTree &)=delete | |
ImplImageTree & | operator= (const ImplImageTree &)=delete |
IconSet & | getCurrentIconSet () |
bool | doLoadImage (ImageRequestParameters &rParameters) |
std::vector< OUString > | getPaths (OUString const &name, LanguageTag const &rLanguageTag) |
bool | checkPathAccess () |
void | setStyle (OUString const &rStyle) |
void | createStyle () |
IconCache & | getIconCache (const ImageRequestParameters &rParameters) |
Find an icon cache for the right scale factor. More... | |
bool | iconCacheLookup (ImageRequestParameters &rParameters) |
bool | findImage (std::vector< OUString > const &rPaths, ImageRequestParameters &rParameters) |
void | loadImageLinks () |
void | parseLinkFile (std::shared_ptr< SvStream > const &aStream) |
OUString const & | getRealImageName (OUString const &rName) |
Return name of a real .png according to links.txt. More... | |
Static Private Member Functions | |
static OUString | fallbackStyle (std::u16string_view rStyle) |
Return name of the fallback style for the provided one. More... | |
Private Attributes | |
std::unordered_map< OUString, IconSet > | maIconSets |
Remember all the (used) icon styles and individual icons in them. More... | |
OUString | maCurrentStyle |
Style used for the current operations; switches switch several times during fallback search. More... | |
Definition at line 65 of file implimagetree.hxx.
|
private |
Definition at line 94 of file implimagetree.hxx.
|
private |
Definition at line 96 of file implimagetree.hxx.
|
private |
Definition at line 95 of file implimagetree.hxx.
ImplImageTree::ImplImageTree | ( | ) |
Definition at line 208 of file ImplImageTree.cxx.
ImplImageTree::~ImplImageTree | ( | ) |
Definition at line 212 of file ImplImageTree.cxx.
|
privatedelete |
|
private |
Definition at line 674 of file ImplImageTree.cxx.
References getCurrentIconSet(), comphelper::getProcessComponentContext(), isVclDemo(), ImplImageTree::IconSet::maNameAccess, ImplImageTree::IconSet::maURL, and TOOLS_INFO_EXCEPTION.
Referenced by findImage(), getImageStream(), getImageUrl(), getNameAccess(), and loadImageLinks().
|
private |
Definition at line 467 of file ImplImageTree.cxx.
References INetURLObject::All, INetURLObject::Append(), INetURLObject::GetMainURL(), vcl::IconThemeScanner::GetStandardIconThemePath(), INetURLObject::HasError(), isVclDemo(), loadImageLinks(), maCurrentStyle, maIconSets, nIndex, and INetURLObject::NONE.
Referenced by setStyle().
|
private |
Definition at line 396 of file ImplImageTree.cxx.
References findImage(), getIconCache(), getPaths(), Application::GetSettings(), AllSettings::GetUILanguageTag(), iconCacheLookup(), BitmapEx::IsEmpty(), ImageRequestParameters::mbLocalized, ImageRequestParameters::mbWriteImageToCache, ImageRequestParameters::mrBitmap, ImageRequestParameters::msName, ImageRequestParameters::msStyle, BitmapEx::SetEmpty(), setStyle(), and TOOLS_INFO_EXCEPTION.
Referenced by loadImage().
|
staticprivate |
Return name of the fallback style for the provided one.
Must not be cyclic :-) The last theme in the chain returns an empty string.
Definition at line 317 of file ImplImageTree.cxx.
References u.
Referenced by getImageStream(), getImageUrl(), and loadImage().
|
private |
Definition at line 545 of file ImplImageTree.cxx.
References checkPathAccess(), getCurrentIconSet(), and ImplImageTree::IconSet::maNameAccess.
Referenced by doLoadImage().
|
inlineprivate |
Definition at line 124 of file implimagetree.hxx.
References maCurrentStyle, and maIconSets.
Referenced by checkPathAccess(), findImage(), getIconCache(), getImageStream(), getImageUrl(), getNameAccess(), loadImageLinks(), and parseLinkFile().
|
private |
Find an icon cache for the right scale factor.
Definition at line 521 of file ImplImageTree.cxx.
References getCurrentIconSet(), ImageRequestParameters::mnScalePercentage, and rSet.
Referenced by doLoadImage(), and iconCacheLookup().
std::shared_ptr< SvMemoryStream > ImplImageTree::getImageStream | ( | OUString const & | rName, |
OUString const & | rStyle, | ||
OUString const & | rLang | ||
) |
Definition at line 277 of file ImplImageTree.cxx.
References checkPathAccess(), fallbackStyle(), getCurrentIconSet(), getPaths(), ImplImageTree::IconSet::maNameAccess, setStyle(), and TOOLS_INFO_EXCEPTION.
OUString ImplImageTree::getImageUrl | ( | OUString const & | name, |
OUString const & | style, | ||
OUString const & | lang | ||
) |
Definition at line 238 of file ImplImageTree.cxx.
References checkPathAccess(), fallbackStyle(), getCurrentIconSet(), getPaths(), ImplImageTree::IconSet::maNameAccess, ImplImageTree::IconSet::maURL, setStyle(), and TOOLS_INFO_EXCEPTION.
uno::Reference< container::XNameAccess > const & ImplImageTree::getNameAccess | ( | ) |
Definition at line 700 of file ImplImageTree.cxx.
References checkPathAccess(), getCurrentIconSet(), and ImplImageTree::IconSet::maNameAccess.
|
private |
Definition at line 216 of file ImplImageTree.cxx.
References LanguageTag::getFallbackStrings(), getRealImageName(), name, and pos.
Referenced by doLoadImage(), getImageStream(), and getImageUrl().
|
private |
Return name of a real .png according to links.txt.
Definition at line 623 of file ImplImageTree.cxx.
References maCurrentStyle, and maIconSets.
Referenced by getPaths(), and iconCacheLookup().
|
private |
Definition at line 531 of file ImplImageTree.cxx.
References getIconCache(), getRealImageName(), i, ImageRequestParameters::mbLocalized, ImageRequestParameters::mrBitmap, and ImageRequestParameters::msName.
Referenced by doLoadImage().
bool ImplImageTree::loadImage | ( | OUString const & | name, |
OUString const & | style, | ||
BitmapEx & | bitmap, | ||
bool | localized, | ||
const ImageLoadFlags | eFlags, | ||
sal_Int32 | nScalePercentage = -1 |
||
) |
Definition at line 333 of file ImplImageTree.cxx.
References doLoadImage(), and fallbackStyle().
|
private |
Definition at line 569 of file ImplImageTree.cxx.
References checkPathAccess(), getCurrentIconSet(), ImplImageTree::IconSet::maNameAccess, parseLinkFile(), u, and xStream.
Referenced by createStyle().
|
privatedelete |
|
private |
Definition at line 590 of file ImplImageTree.cxx.
References getCurrentIconSet(), o3tl::getToken(), ImplImageTree::IconSet::maLinkHash, nIndex, SAL_WARN, and xStream.
Referenced by loadImageLinks().
|
private |
Definition at line 447 of file ImplImageTree.cxx.
References createStyle(), and maCurrentStyle.
Referenced by doLoadImage(), getImageStream(), and getImageUrl().
void ImplImageTree::shutdown | ( | ) |
a crude form of life cycle control (called from DeInitVCL; otherwise, if the ImplImageTree singleton were destroyed during exit that would be too late for the destructors of the bitmaps in maIconCache)
Definition at line 441 of file ImplImageTree.cxx.
References maCurrentStyle, and maIconSets.
|
private |
Style used for the current operations; switches switch several times during fallback search.
Definition at line 122 of file implimagetree.hxx.
Referenced by createStyle(), getCurrentIconSet(), getRealImageName(), setStyle(), and shutdown().
|
private |
Remember all the (used) icon styles and individual icons in them.
Map between the theme name(s) and the content.
Definition at line 119 of file implimagetree.hxx.
Referenced by createStyle(), getCurrentIconSet(), getRealImageName(), and shutdown().