diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-19 12:02:25 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-04-25 17:02:15 +0200 |
commit | d7559de4f70afdf64dea3bfbf462f5f188da7d05 (patch) | |
tree | f27987aec5a5518928a8271af04bd875bb92ef58 /avmedia | |
parent | e68b6e349c31ac1376e90218013e1e7612f2b522 (diff) |
remove bitmaps from .src files
and into includeable .hlst files, add them to
postprocess/CustomTarget_images.mk
to continue only including used bitmaps in icon-theme zips
Change-Id: I5c24c3eca93a9c4101bcdcacb0e4b2712133968e
Reviewed-on: https://gerrit.libreoffice.org/36941
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/inc/bitmaps.hlst | 32 | ||||
-rw-r--r-- | avmedia/source/framework/MediaControlBase.cxx | 82 | ||||
-rw-r--r-- | avmedia/source/framework/mediacontrol.hrc | 16 | ||||
-rw-r--r-- | avmedia/source/framework/mediacontrol.src | 69 | ||||
-rw-r--r-- | avmedia/source/viewer/mediawindow.cxx | 5 | ||||
-rw-r--r-- | avmedia/source/viewer/mediawindow.hrc | 3 | ||||
-rw-r--r-- | avmedia/source/viewer/mediawindow.src | 10 | ||||
-rw-r--r-- | avmedia/source/viewer/mediawindow_impl.cxx | 5 |
8 files changed, 96 insertions, 126 deletions
diff --git a/avmedia/inc/bitmaps.hlst b/avmedia/inc/bitmaps.hlst new file mode 100644 index 000000000000..24441a26f688 --- /dev/null +++ b/avmedia/inc/bitmaps.hlst @@ -0,0 +1,32 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_AVMEDIA_INC_BITMAPS_HRC +#define INCLUDED_AVMEDIA_INC_BITMAPS_HRC + +#define AVMEDIA_IMG_OPEN_NORMAL "avmedia/res/av02048.png" +#define AVMEDIA_IMG_PLAY_NORMAL "avmedia/res/av02049.png" +#define AVMEDIA_IMG_PAUSE_NORMAL "avmedia/res/av02050.png" +#define AVMEDIA_IMG_STOP_NORMAL "avmedia/res/av02051.png" +#define AVMEDIA_IMG_LOOP_NORMAL "avmedia/res/av02052.png" +#define AVMEDIA_IMG_INSERT_NORMAL "avmedia/res/av02053.png" +#define AVMEDIA_IMG_MUTE_NORMAL "avmedia/res/av02054.png" +#define AVMEDIA_IMG_OPEN_LARGE "avmedia/res/avl02048.png" +#define AVMEDIA_IMG_PLAY_LARGE "avmedia/res/avl02049.png" +#define AVMEDIA_IMG_PAUSE_LARGE "avmedia/res/avl02050.png" +#define AVMEDIA_IMG_STOP_LARGE "avmedia/res/avl02051.png" +#define AVMEDIA_IMG_LOOP_LARGE "avmedia/res/avl02052.png" +#define AVMEDIA_IMG_INSERT_LARGE "avmedia/res/avl02053.png" +#define AVMEDIA_IMG_MUTE_LARGE "avmedia/res/avl02054.png" +#define AVMEDIA_BMP_AUDIOLOGO "avmedia/res/avaudiologo.png" +#define AVMEDIA_BMP_EMPTYLOGO "avmedia/res/avemptylogo.png" + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/avmedia/source/framework/MediaControlBase.cxx b/avmedia/source/framework/MediaControlBase.cxx index f134d3038ef4..6e879244cd07 100644 --- a/avmedia/source/framework/MediaControlBase.cxx +++ b/avmedia/source/framework/MediaControlBase.cxx @@ -26,6 +26,7 @@ #include <svtools/miscopt.hxx> #include <tools/time.hxx> #include <vcl/lstbox.hxx> +#include "bitmaps.hlst" #include "mediacontrol.hrc" #include "helpids.hrc" #include "mediamisc.hxx" @@ -268,34 +269,67 @@ Image MediaControlBase::GetImage(sal_Int32 nImageId) { const bool bLarge = SvtMiscOptions().AreCurrentSymbolsLarge(); - switch (nImageId) + OUString sImageId; + + if (bLarge) { - default: - case AVMEDIA_TOOLBOXITEM_PLAY: - nImageId = bLarge ? AVMEDIA_IMG_PLAY_LARGE : AVMEDIA_IMG_PLAY_NORMAL; - break; - case AVMEDIA_TOOLBOXITEM_PAUSE: - nImageId = bLarge ? AVMEDIA_IMG_PAUSE_LARGE : AVMEDIA_IMG_PAUSE_NORMAL; - break; - case AVMEDIA_TOOLBOXITEM_STOP: - nImageId = bLarge ? AVMEDIA_IMG_STOP_LARGE : AVMEDIA_IMG_STOP_NORMAL; - break; - case AVMEDIA_TOOLBOXITEM_MUTE: - nImageId = bLarge ? AVMEDIA_IMG_MUTE_LARGE : AVMEDIA_IMG_MUTE_NORMAL; - break; - case AVMEDIA_TOOLBOXITEM_LOOP: - nImageId = bLarge ? AVMEDIA_IMG_LOOP_LARGE : AVMEDIA_IMG_LOOP_NORMAL; - break; - case AVMEDIA_TOOLBOXITEM_OPEN: - nImageId = bLarge ? AVMEDIA_IMG_OPEN_LARGE : AVMEDIA_IMG_OPEN_NORMAL; - break; - case AVMEDIA_TOOLBOXITEM_INSERT: - nImageId = bLarge ? AVMEDIA_IMG_INSERT_LARGE : AVMEDIA_IMG_INSERT_NORMAL; - break; + switch (nImageId) + { + default: + case AVMEDIA_TOOLBOXITEM_PLAY: + sImageId = AVMEDIA_IMG_PLAY_LARGE; + break; + case AVMEDIA_TOOLBOXITEM_PAUSE: + sImageId = AVMEDIA_IMG_PAUSE_LARGE; + break; + case AVMEDIA_TOOLBOXITEM_STOP: + sImageId = AVMEDIA_IMG_STOP_LARGE; + break; + case AVMEDIA_TOOLBOXITEM_MUTE: + sImageId = AVMEDIA_IMG_MUTE_LARGE; + break; + case AVMEDIA_TOOLBOXITEM_LOOP: + sImageId = AVMEDIA_IMG_LOOP_LARGE; + break; + case AVMEDIA_TOOLBOXITEM_OPEN: + sImageId = AVMEDIA_IMG_OPEN_LARGE; + break; + case AVMEDIA_TOOLBOXITEM_INSERT: + sImageId = AVMEDIA_IMG_INSERT_LARGE; + break; + } + } + else + { + switch (nImageId) + { + default: + case AVMEDIA_TOOLBOXITEM_PLAY: + sImageId = AVMEDIA_IMG_PLAY_NORMAL; + break; + case AVMEDIA_TOOLBOXITEM_PAUSE: + sImageId = AVMEDIA_IMG_PAUSE_NORMAL; + break; + case AVMEDIA_TOOLBOXITEM_STOP: + sImageId = AVMEDIA_IMG_STOP_NORMAL; + break; + case AVMEDIA_TOOLBOXITEM_MUTE: + sImageId = AVMEDIA_IMG_MUTE_NORMAL; + break; + case AVMEDIA_TOOLBOXITEM_LOOP: + sImageId = AVMEDIA_IMG_LOOP_NORMAL; + break; + case AVMEDIA_TOOLBOXITEM_OPEN: + sImageId = AVMEDIA_IMG_OPEN_NORMAL; + break; + case AVMEDIA_TOOLBOXITEM_INSERT: + sImageId = AVMEDIA_IMG_INSERT_NORMAL; + break; + } } - return Image(BitmapEx(AVMEDIA_RESID(nImageId))); + return Image(BitmapEx(sImageId)); } } diff --git a/avmedia/source/framework/mediacontrol.hrc b/avmedia/source/framework/mediacontrol.hrc index c221d65786a2..3086496eb214 100644 --- a/avmedia/source/framework/mediacontrol.hrc +++ b/avmedia/source/framework/mediacontrol.hrc @@ -31,22 +31,6 @@ #define AVMEDIA_STR_INSERT 1035 #define AVMEDIA_STR_MEDIAPLAYER 1036 -#define AVMEDIA_IMG_OPEN_NORMAL 2048 -#define AVMEDIA_IMG_PLAY_NORMAL 2049 -#define AVMEDIA_IMG_PAUSE_NORMAL 2050 -#define AVMEDIA_IMG_STOP_NORMAL 2051 -#define AVMEDIA_IMG_LOOP_NORMAL 2052 -#define AVMEDIA_IMG_INSERT_NORMAL 2053 -#define AVMEDIA_IMG_MUTE_NORMAL 2054 - -#define AVMEDIA_IMG_OPEN_LARGE 2148 -#define AVMEDIA_IMG_PLAY_LARGE 2149 -#define AVMEDIA_IMG_PAUSE_LARGE 2150 -#define AVMEDIA_IMG_STOP_LARGE 2151 -#define AVMEDIA_IMG_LOOP_LARGE 2152 -#define AVMEDIA_IMG_INSERT_LARGE 2153 -#define AVMEDIA_IMG_MUTE_LARGE 2154 - #define AVMEDIA_MEDIA_PATH 4076 #define AVMEDIA_MEDIA_PATH_DEFAULT 4078 diff --git a/avmedia/source/framework/mediacontrol.src b/avmedia/source/framework/mediacontrol.src index 1d3e5855c4aa..e62c43a27b4c 100644 --- a/avmedia/source/framework/mediacontrol.src +++ b/avmedia/source/framework/mediacontrol.src @@ -84,75 +84,6 @@ String AVMEDIA_STR_MEDIAPLAYER Text[en-US] = "Media Player"; }; -Bitmap AVMEDIA_IMG_OPEN_NORMAL -{ - File = "av02048.png"; -}; - -Bitmap AVMEDIA_IMG_PLAY_NORMAL -{ - File = "av02049.png"; -}; - -Bitmap AVMEDIA_IMG_PAUSE_NORMAL -{ - File = "av02050.png"; -}; - -Bitmap AVMEDIA_IMG_STOP_NORMAL -{ - File = "av02051.png"; -}; - -Bitmap AVMEDIA_IMG_LOOP_NORMAL -{ - File = "av02052.png"; -}; - -Bitmap AVMEDIA_IMG_INSERT_NORMAL -{ - File = "av02053.png"; -}; - -Bitmap AVMEDIA_IMG_MUTE_NORMAL -{ - File = "av02054.png"; -}; - -Bitmap AVMEDIA_IMG_OPEN_LARGE -{ - File = "avl02048.png"; -}; - -Bitmap AVMEDIA_IMG_PLAY_LARGE -{ - File = "avl02049.png"; -}; - -Bitmap AVMEDIA_IMG_PAUSE_LARGE -{ - File = "avl02050.png"; -}; - -Bitmap AVMEDIA_IMG_STOP_LARGE -{ - File = "avl02051.png"; -}; - -Bitmap AVMEDIA_IMG_LOOP_LARGE -{ - File = "avl02052.png"; -}; - -Bitmap AVMEDIA_IMG_INSERT_LARGE -{ - File = "avl02053.png"; -}; - -Bitmap AVMEDIA_IMG_MUTE_LARGE -{ - File = "avl02054.png"; -}; String AVMEDIA_MEDIA_PATH { Text[en-US] = "Media Path"; diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx index 74bb879a5233..71227b86265c 100644 --- a/avmedia/source/viewer/mediawindow.cxx +++ b/avmedia/source/viewer/mediawindow.cxx @@ -20,6 +20,7 @@ #include <avmedia/mediawindow.hxx> #include "mediawindow_impl.hxx" #include "mediamisc.hxx" +#include "bitmaps.hlst" #include "mediawindow.hrc" #include <tools/urlobj.hxx> #include <vcl/layout.hxx> @@ -392,7 +393,7 @@ uno::Reference< graphic::XGraphic > MediaWindow::grabFrame( const OUString& rURL if( !aPrefSize.Width && !aPrefSize.Height ) { - const BitmapEx aBmpEx( AVMEDIA_RESID(AVMEDIA_BMP_AUDIOLOGO) ); + const BitmapEx aBmpEx(AVMEDIA_BMP_AUDIOLOGO); xGraphic.reset( new Graphic( aBmpEx ) ); } } @@ -400,7 +401,7 @@ uno::Reference< graphic::XGraphic > MediaWindow::grabFrame( const OUString& rURL if( !xRet.is() && !xGraphic.get() ) { - const BitmapEx aBmpEx( AVMEDIA_RESID(AVMEDIA_BMP_EMPTYLOGO) ); + const BitmapEx aBmpEx(AVMEDIA_BMP_EMPTYLOGO); xGraphic.reset( new Graphic( aBmpEx ) ); } diff --git a/avmedia/source/viewer/mediawindow.hrc b/avmedia/source/viewer/mediawindow.hrc index 3288eeae83f1..b4ec26c6e357 100644 --- a/avmedia/source/viewer/mediawindow.hrc +++ b/avmedia/source/viewer/mediawindow.hrc @@ -23,7 +23,4 @@ #define AVMEDIA_STR_ALL_FILES 16387 #define AVMEDIA_STR_ERR_URL 16388 -#define AVMEDIA_BMP_AUDIOLOGO 20000 -#define AVMEDIA_BMP_EMPTYLOGO 20001 - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/avmedia/source/viewer/mediawindow.src b/avmedia/source/viewer/mediawindow.src index db2749368a1c..9c753a6f5b57 100644 --- a/avmedia/source/viewer/mediawindow.src +++ b/avmedia/source/viewer/mediawindow.src @@ -39,16 +39,6 @@ String AVMEDIA_STR_ALL_FILES Text[en-US] = "All files"; }; -Bitmap AVMEDIA_BMP_AUDIOLOGO -{ - file = "avaudiologo.png"; -}; - -Bitmap AVMEDIA_BMP_EMPTYLOGO -{ - file = "avemptylogo.png"; -}; - String AVMEDIA_STR_ERR_URL { Text[en-US] = "The format of the selected file is not supported."; diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx index 518b83eaf119..172e4a3610ab 100644 --- a/avmedia/source/viewer/mediawindow_impl.cxx +++ b/avmedia/source/viewer/mediawindow_impl.cxx @@ -23,6 +23,7 @@ #include "mediawindow_impl.hxx" #include "mediaevent_impl.hxx" #include "mediamisc.hxx" +#include "bitmaps.hlst" #include "mediawindow.hrc" #include "helpids.hrc" @@ -605,14 +606,14 @@ void MediaWindowImpl::Paint(vcl::RenderContext& rRenderContext, const tools::Rec if (!mxPlayer.is()) { if (!mpEmptyBmpEx) - mpEmptyBmpEx = new BitmapEx(AVMEDIA_RESID(AVMEDIA_BMP_EMPTYLOGO)); + mpEmptyBmpEx = new BitmapEx(AVMEDIA_BMP_EMPTYLOGO); pLogo = mpEmptyBmpEx; } else if (!mxPlayerWindow.is()) { if (!mpAudioBmpEx) - mpAudioBmpEx = new BitmapEx(AVMEDIA_RESID(AVMEDIA_BMP_AUDIOLOGO)); + mpAudioBmpEx = new BitmapEx(AVMEDIA_BMP_AUDIOLOGO); pLogo = mpAudioBmpEx; } |