summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-04-25 19:21:42 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-04-25 19:21:49 +0100
commitf08faa70ccaa3bbf335b7b2ddff02a9f37efe125 (patch)
tree9578aec6c99339221834d86b654a1b209d74cc0c
parent82fbc7147183dd27be81c20d7c362937bafc3546 (diff)
fix attempt to load converted bitmap resource uses from vcl
Change-Id: I9be76bc1ec87b6837df30c2e73729ae1d5cca690
-rw-r--r--vcl/inc/bitmaps.hlst39
-rw-r--r--vcl/inc/svids.hrc4
-rw-r--r--vcl/unx/generic/window/salframe.cxx77
3 files changed, 101 insertions, 19 deletions
diff --git a/vcl/inc/bitmaps.hlst b/vcl/inc/bitmaps.hlst
index 03ea8a9bd63a..00bb64cb061e 100644
--- a/vcl/inc/bitmaps.hlst
+++ b/vcl/inc/bitmaps.hlst
@@ -64,6 +64,45 @@
#define SV_PRINT_COLLATE_BMP "vcl/res/collate.png"
#define SV_PRINT_NOCOLLATE_BMP "vcl/res/ncollate.png"
+#define MAINAPP_48_8 "res/mainapp_48_8.png"
+#define MAINAPP_48_8 "res/mainapp_48_8.png"
+#define ODT_48_8 "res/odt_48_8.png"
+#define OTT_48_8 "res/ott_48_8.png"
+#define ODS_48_8 "res/ods_48_8.png"
+#define OTS_48_8 "res/ots_48_8.png"
+#define ODG_48_8 "res/odg_48_8.png"
+#define ODP_48_8 "res/odp_48_8.png"
+#define ODM_48_8 "res/odm_48_8.png"
+#define ODB_48_8 "res/odb_48_8.png"
+#define ODF_48_8 "res/odf_48_8.png"
+#define MAINAPP_48_8 "res/mainapp_48_8.png"
+
+#define MAINAPP_32_8 "res/mainapp_32_8.png"
+#define MAINAPP_32_8 "res/mainapp_32_8.png"
+#define ODT_32_8 "res/odt_32_8.png"
+#define OTT_32_8 "res/ott_32_8.png"
+#define ODS_32_8 "res/ods_32_8.png"
+#define OTS_32_8 "res/ots_32_8.png"
+#define ODG_32_8 "res/odg_32_8.png"
+#define ODP_32_8 "res/odp_32_8.png"
+#define ODM_32_8 "res/odm_32_8.png"
+#define ODB_32_8 "res/odb_32_8.png"
+#define ODF_32_8 "res/odf_32_8.png"
+#define MAINAPP_32_8 "res/mainapp_32_8.png"
+
+#define MAINAPP_16_8 "res/mainapp_16_8.png"
+#define MAINAPP_16_8 "res/mainapp_16_8.png"
+#define ODT_16_8 "res/odt_16_8.png"
+#define OTT_16_8 "res/ott_16_8.png"
+#define ODS_16_8 "res/ods_16_8.png"
+#define OTS_16_8 "res/ots_16_8.png"
+#define ODG_16_8 "res/odg_16_8.png"
+#define ODP_16_8 "res/odp_16_8.png"
+#define ODM_16_8 "res/odm_16_8.png"
+#define ODB_16_8 "res/odb_16_8.png"
+#define ODF_16_8 "res/odf_16_8.png"
+#define MAINAPP_16_8 "res/mainapp_16_8.png"
+
//start, Throbber::getDefaultImageURLs
#define SPINNER_16_01 "vcl/res/spinner-16-01.png"
#define SPINNER_16_02 "vcl/res/spinner-16-02.png"
diff --git a/vcl/inc/svids.hrc b/vcl/inc/svids.hrc
index 4d825e106f2f..7f2de807de39 100644
--- a/vcl/inc/svids.hrc
+++ b/vcl/inc/svids.hrc
@@ -130,10 +130,6 @@
#define SV_APP_DEFAULT 10804
#define SV_APP_VCLBACKEND 10805
-#define SV_ICON_SIZE48_START 20000
-#define SV_ICON_SIZE32_START 21000
-#define SV_ICON_SIZE16_START 23000
-
#endif // INCLUDED_VCL_INC_SVIDS_HRC
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index f8dfbd385d96..c99e80024f45 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -67,6 +67,7 @@
#include "svdata.hxx"
#include "svids.hrc"
+#include "bitmaps.hlst"
#include "impbmp.hxx"
#include <boost/optional.hpp>
@@ -197,6 +198,57 @@ void X11SalFrame::askForXEmbedFocus( sal_Int32 i_nTimeCode )
typedef std::vector< unsigned long > NetWmIconData;
+namespace
+{
+ const OUStringLiteral SV_ICON_SIZE48[] =
+ {
+ MAINAPP_48_8,
+ MAINAPP_48_8,
+ ODT_48_8,
+ OTT_48_8,
+ ODS_48_8,
+ OTS_48_8,
+ ODG_48_8,
+ ODP_48_8,
+ ODM_48_8,
+ ODB_48_8,
+ ODF_48_8,
+ MAINAPP_48_8
+ };
+
+ const OUStringLiteral SV_ICON_SIZE32[] =
+ {
+ MAINAPP_32_8,
+ MAINAPP_32_8,
+ ODT_32_8,
+ OTT_32_8,
+ ODS_32_8,
+ OTS_32_8,
+ ODG_32_8,
+ ODP_32_8,
+ ODM_32_8,
+ ODB_32_8,
+ ODF_32_8,
+ MAINAPP_32_8
+ };
+
+ const OUStringLiteral SV_ICON_SIZE16[] =
+ {
+ MAINAPP_16_8,
+ MAINAPP_16_8,
+ ODT_16_8,
+ OTT_16_8,
+ ODS_16_8,
+ OTS_16_8,
+ ODG_16_8,
+ ODP_16_8,
+ ODM_16_8,
+ ODB_16_8,
+ ODF_16_8,
+ MAINAPP_16_8
+ };
+}
+
static void CreateNetWmAppIcon( sal_uInt16 nIcon, NetWmIconData& netwm_icon )
{
const int sizes[ 3 ] = { 48, 32, 16 };
@@ -204,16 +256,15 @@ static void CreateNetWmAppIcon( sal_uInt16 nIcon, NetWmIconData& netwm_icon )
int pos = 0;
for(int size : sizes)
{
- sal_uInt16 nIconSizeOffset;
+ OUString sIcon;
if( size >= 48 )
- nIconSizeOffset = SV_ICON_SIZE48_START;
+ sIcon = SV_ICON_SIZE48[nIcon];
else if( size >= 32 )
- nIconSizeOffset = SV_ICON_SIZE32_START;
+ sIcon = SV_ICON_SIZE32[nIcon];
else
- nIconSizeOffset = SV_ICON_SIZE16_START;
+ sIcon = SV_ICON_SIZE16[nIcon];
- BitmapEx aIcon = vcl::bitmap::loadFromResource(ResId(nIconSizeOffset + nIcon, *ImplGetResMgr()),
- ImageLoadFlags::IgnoreScalingFactor);
+ BitmapEx aIcon = vcl::bitmap::loadFromName(sIcon, ImageLoadFlags::IgnoreScalingFactor);
if( aIcon.IsEmpty())
continue;
@@ -255,26 +306,22 @@ static bool lcl_SelectAppIconPixmap( SalDisplay *pDisplay, SalX11Screen nXScreen
sal_uInt16 nIcon, sal_uInt16 iconSize,
Pixmap& icon_pixmap, Pixmap& icon_mask, NetWmIconData& netwm_icon)
{
- if( ! ImplGetResMgr() )
- return false;
-
PreDefaultWinNoOpenGLZone aGuard;
CreateNetWmAppIcon( nIcon, netwm_icon );
- sal_uInt16 nIconSizeOffset;
+ OUString sIcon;
if( iconSize >= 48 )
- nIconSizeOffset = SV_ICON_SIZE48_START;
+ sIcon = SV_ICON_SIZE48[nIcon];
else if( iconSize >= 32 )
- nIconSizeOffset = SV_ICON_SIZE32_START;
+ sIcon = SV_ICON_SIZE32[nIcon];
else if( iconSize >= 16 )
- nIconSizeOffset = SV_ICON_SIZE16_START;
+ sIcon = SV_ICON_SIZE16[nIcon];
else
return false;
- BitmapEx aIcon = vcl::bitmap::loadFromResource(ResId(nIconSizeOffset + nIcon, *ImplGetResMgr()),
- ImageLoadFlags::IgnoreScalingFactor);
+ BitmapEx aIcon = vcl::bitmap::loadFromName(sIcon, ImageLoadFlags::IgnoreScalingFactor);
if( aIcon.IsEmpty() )
return false;