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) |
css::uno::Reference< css::io::XInputStream > | getImageXInputStream (OUString const &rName, OUString const &rStyle, OUString const &rLang) |
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 69 of file implimagetree.hxx.
|
private |
Definition at line 101 of file implimagetree.hxx.
|
private |
Definition at line 103 of file implimagetree.hxx.
|
private |
Definition at line 102 of file implimagetree.hxx.
ImplImageTree::ImplImageTree | ( | ) |
Definition at line 210 of file ImplImageTree.cxx.
ImplImageTree::~ImplImageTree | ( | ) |
Definition at line 214 of file ImplImageTree.cxx.
|
privatedelete |
|
private |
Definition at line 684 of file ImplImageTree.cxx.
References getCurrentIconSet(), comphelper::getProcessComponentContext(), isVclDemo(), ImplImageTree::IconSet::maNameAccess, ImplImageTree::IconSet::maURL, and TOOLS_INFO_EXCEPTION.
Referenced by findImage(), getImageUrl(), getImageXInputStream(), getNameAccess(), and loadImageLinks().
|
private |
Definition at line 477 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 406 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 327 of file ImplImageTree.cxx.
References u.
Referenced by getImageUrl(), getImageXInputStream(), and loadImage().
|
private |
Definition at line 555 of file ImplImageTree.cxx.
References checkPathAccess(), getCurrentIconSet(), and ImplImageTree::IconSet::maNameAccess.
Referenced by doLoadImage().
|
inlineprivate |
Definition at line 131 of file implimagetree.hxx.
References maCurrentStyle, and maIconSets.
Referenced by checkPathAccess(), findImage(), getIconCache(), getImageUrl(), getImageXInputStream(), getNameAccess(), loadImageLinks(), and parseLinkFile().
|
private |
Find an icon cache for the right scale factor.
Definition at line 531 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 319 of file ImplImageTree.cxx.
References getImageXInputStream(), and xStream.
OUString ImplImageTree::getImageUrl | ( | OUString const & | name, |
OUString const & | style, | ||
OUString const & | lang | ||
) |
Definition at line 240 of file ImplImageTree.cxx.
References checkPathAccess(), fallbackStyle(), getCurrentIconSet(), getPaths(), ImplImageTree::IconSet::maNameAccess, ImplImageTree::IconSet::maURL, setStyle(), and TOOLS_INFO_EXCEPTION.
uno::Reference< io::XInputStream > ImplImageTree::getImageXInputStream | ( | OUString const & | rName, |
OUString const & | rStyle, | ||
OUString const & | rLang | ||
) |
Definition at line 279 of file ImplImageTree.cxx.
References checkPathAccess(), fallbackStyle(), getCurrentIconSet(), getPaths(), ImplImageTree::IconSet::maNameAccess, setStyle(), and TOOLS_INFO_EXCEPTION.
Referenced by getImageStream().
uno::Reference< container::XNameAccess > const & ImplImageTree::getNameAccess | ( | ) |
Definition at line 710 of file ImplImageTree.cxx.
References checkPathAccess(), getCurrentIconSet(), and ImplImageTree::IconSet::maNameAccess.
|
private |
Definition at line 218 of file ImplImageTree.cxx.
References LanguageTag::getFallbackStrings(), getRealImageName(), name, and pos.
Referenced by doLoadImage(), getImageUrl(), and getImageXInputStream().
|
private |
Return name of a real .png according to links.txt.
Definition at line 633 of file ImplImageTree.cxx.
References maCurrentStyle, and maIconSets.
Referenced by getPaths(), and iconCacheLookup().
|
private |
Definition at line 541 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 343 of file ImplImageTree.cxx.
References doLoadImage(), and fallbackStyle().
|
private |
Definition at line 579 of file ImplImageTree.cxx.
References checkPathAccess(), getCurrentIconSet(), ImplImageTree::IconSet::maNameAccess, parseLinkFile(), u, and xStream.
Referenced by createStyle().
|
privatedelete |
|
private |
Definition at line 600 of file ImplImageTree.cxx.
References getCurrentIconSet(), o3tl::getToken(), ImplImageTree::IconSet::maLinkHash, nIndex, SAL_WARN, and xStream.
Referenced by loadImageLinks().
|
private |
Definition at line 457 of file ImplImageTree.cxx.
References createStyle(), and maCurrentStyle.
Referenced by doLoadImage(), getImageUrl(), and getImageXInputStream().
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 451 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 129 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 126 of file implimagetree.hxx.
Referenced by createStyle(), getCurrentIconSet(), getRealImageName(), and shutdown().