[Libreoffice-commits] core.git: avmedia/source include/avmedia

Caolán McNamara caolanm at redhat.com
Fri Dec 23 20:49:20 UTC 2016


 avmedia/source/framework/MediaControlBase.cxx |   46 ++++++++++---
 avmedia/source/framework/mediacontrol.cxx     |    4 -
 avmedia/source/framework/mediacontrol.hrc     |   25 ++++---
 avmedia/source/framework/mediacontrol.src     |   91 ++++++++++++++++++--------
 include/avmedia/MediaControlBase.hxx          |    5 -
 5 files changed, 119 insertions(+), 52 deletions(-)

New commits:
commit 7a339a03d2dbdd84fdc2b583b2c52a7f2f477589
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Dec 23 20:40:22 2016 +0000

    unwind AVMEDIA_IMGLST/AVMEDIA_IMGLST_L ImageLists
    
    Change-Id: Idf115c12c5da138141010673ed2bf0525aec6aaa

diff --git a/avmedia/source/framework/MediaControlBase.cxx b/avmedia/source/framework/MediaControlBase.cxx
index 522479d..29921e7 100644
--- a/avmedia/source/framework/MediaControlBase.cxx
+++ b/avmedia/source/framework/MediaControlBase.cxx
@@ -34,8 +34,7 @@ using ::rtl::OUString;
 
 namespace avmedia {
 
-MediaControlBase::MediaControlBase():
-    maImageList( SvtMiscOptions().AreCurrentSymbolsLarge() ? AVMEDIA_RESID( AVMEDIA_IMGLST_L ) : AVMEDIA_RESID( AVMEDIA_IMGLST ) )
+MediaControlBase::MediaControlBase()
 {
 }
 
@@ -97,21 +96,21 @@ void MediaControlBase::UpdateTimeSlider( MediaItem aMediaItem )
 
 void MediaControlBase::InitializeWidgets()
 {
-    mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_PLAY, GetImage( AVMEDIA_IMG_PLAY ), OUString( AVMEDIA_RESID( AVMEDIA_STR_PLAY ) ), ToolBoxItemBits::CHECKABLE );
+    mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_PLAY, GetImage(AVMEDIA_TOOLBOXITEM_PLAY), OUString( AVMEDIA_RESID( AVMEDIA_STR_PLAY ) ), ToolBoxItemBits::CHECKABLE );
     mpPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_PLAY, HID_AVMEDIA_TOOLBOXITEM_PLAY );
 
-    mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_PAUSE, GetImage( AVMEDIA_IMG_PAUSE ), OUString( AVMEDIA_RESID( AVMEDIA_STR_PAUSE ) ), ToolBoxItemBits::CHECKABLE );
+    mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_PAUSE, GetImage(AVMEDIA_TOOLBOXITEM_PAUSE), OUString( AVMEDIA_RESID( AVMEDIA_STR_PAUSE ) ), ToolBoxItemBits::CHECKABLE );
     mpPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_PAUSE, HID_AVMEDIA_TOOLBOXITEM_PAUSE );
 
-    mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_STOP, GetImage( AVMEDIA_IMG_STOP ), OUString( AVMEDIA_RESID( AVMEDIA_STR_STOP ) ), ToolBoxItemBits::CHECKABLE );
+    mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_STOP, GetImage(AVMEDIA_TOOLBOXITEM_STOP), OUString( AVMEDIA_RESID( AVMEDIA_STR_STOP ) ), ToolBoxItemBits::CHECKABLE );
     mpPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_STOP, HID_AVMEDIA_TOOLBOXITEM_STOP );
 
     mpPlayToolBox->InsertSeparator();
 
-    mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_LOOP, GetImage( AVMEDIA_IMG_ENDLESS ), OUString( AVMEDIA_RESID( AVMEDIA_STR_ENDLESS ) ) );
+    mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_LOOP, GetImage(AVMEDIA_TOOLBOXITEM_LOOP), OUString( AVMEDIA_RESID( AVMEDIA_STR_LOOP ) ) );
     mpPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_LOOP, HID_AVMEDIA_TOOLBOXITEM_LOOP );
 
-    mpMuteToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_MUTE, GetImage( AVMEDIA_IMG_MUTE ), OUString( AVMEDIA_RESID( AVMEDIA_STR_MUTE ) ) );
+    mpMuteToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_MUTE, GetImage(AVMEDIA_TOOLBOXITEM_MUTE), OUString( AVMEDIA_RESID( AVMEDIA_STR_MUTE ) ) );
     mpMuteToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_MUTE, HID_AVMEDIA_TOOLBOXITEM_MUTE );
 
     mpZoomListBox->InsertEntry( OUString( AVMEDIA_RESID( AVMEDIA_STR_ZOOM_50 ) ), AVMEDIA_ZOOMLEVEL_50 );
@@ -265,9 +264,38 @@ void MediaControlBase::SelectPlayToolBoxItem( MediaItem& aExecItem, MediaItem aI
     }
 }
 
-Image MediaControlBase::GetImage( sal_Int32 nImageId) const
+Image MediaControlBase::GetImage(sal_Int32 nImageId)
 {
-    return maImageList.GetImage( static_cast< sal_uInt16 >( nImageId ) );
+    const bool bLarge = SvtMiscOptions().AreCurrentSymbolsLarge();
+
+    switch (nImageId)
+    {
+        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;
+
+    }
+
+    return Image(BitmapEx(AVMEDIA_RESID(nImageId)));
 }
 
 }
diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx
index 872abab..8d3ac38 100644
--- a/avmedia/source/framework/mediacontrol.cxx
+++ b/avmedia/source/framework/mediacontrol.cxx
@@ -123,9 +123,9 @@ void MediaControl::InitializeWidgets()
 {
     if( MEDIACONTROLSTYLE_SINGLELINE != meControlStyle )
     {
-        mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_OPEN, GetImage( AVMEDIA_IMG_OPEN ), OUString( AVMEDIA_RESID( AVMEDIA_STR_OPEN ) ) );
+        mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_OPEN, GetImage(AVMEDIA_TOOLBOXITEM_OPEN), OUString( AVMEDIA_RESID( AVMEDIA_STR_OPEN ) ) );
         mpPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_OPEN, HID_AVMEDIA_TOOLBOXITEM_OPEN );
-        mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_INSERT, GetImage( AVMEDIA_IMG_INSERT ), OUString( AVMEDIA_RESID( AVMEDIA_STR_INSERT ) ) );
+        mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_INSERT, GetImage(AVMEDIA_TOOLBOXITEM_INSERT), OUString( AVMEDIA_RESID( AVMEDIA_STR_INSERT ) ) );
         mpPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_INSERT, HID_AVMEDIA_TOOLBOXITEM_INSERT );
         mpPlayToolBox->InsertSeparator();
     }
diff --git a/avmedia/source/framework/mediacontrol.hrc b/avmedia/source/framework/mediacontrol.hrc
index 2f91740..c221d65 100644
--- a/avmedia/source/framework/mediacontrol.hrc
+++ b/avmedia/source/framework/mediacontrol.hrc
@@ -20,7 +20,7 @@
 #define AVMEDIA_STR_PLAY        1024
 #define AVMEDIA_STR_PAUSE       1025
 #define AVMEDIA_STR_STOP        1026
-#define AVMEDIA_STR_ENDLESS     1027
+#define AVMEDIA_STR_LOOP        1027
 #define AVMEDIA_STR_ZOOM        1028
 #define AVMEDIA_STR_ZOOM_50     1029
 #define AVMEDIA_STR_ZOOM_100    1030
@@ -31,16 +31,21 @@
 #define AVMEDIA_STR_INSERT      1035
 #define AVMEDIA_STR_MEDIAPLAYER 1036
 
-#define AVMEDIA_IMG_OPEN        2048
-#define AVMEDIA_IMG_PLAY        2049
-#define AVMEDIA_IMG_PAUSE       2050
-#define AVMEDIA_IMG_STOP        2051
-#define AVMEDIA_IMG_ENDLESS     2052
-#define AVMEDIA_IMG_INSERT      2053
-#define AVMEDIA_IMG_MUTE        2054
+#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_IMGLST          3072
-#define AVMEDIA_IMGLST_L        3074
+#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 c7ab725..1d3e585 100644
--- a/avmedia/source/framework/mediacontrol.src
+++ b/avmedia/source/framework/mediacontrol.src
@@ -44,7 +44,7 @@ String AVMEDIA_STR_STOP
     Text[en-US] = "Stop";
 };
 
-String AVMEDIA_STR_ENDLESS
+String AVMEDIA_STR_LOOP
 {
     Text[en-US] = "Repeat";
 };
@@ -84,38 +84,75 @@ String AVMEDIA_STR_MEDIAPLAYER
     Text[en-US] = "Media Player";
 };
 
-ImageList AVMEDIA_IMGLST
+Bitmap AVMEDIA_IMG_OPEN_NORMAL
 {
-    Prefix = "av";
-    IdList =
-    {
-        AVMEDIA_IMG_OPEN;
-        AVMEDIA_IMG_PLAY;
-        AVMEDIA_IMG_PAUSE;
-        AVMEDIA_IMG_STOP;
-        AVMEDIA_IMG_ENDLESS;
-        AVMEDIA_IMG_INSERT;
-        AVMEDIA_IMG_MUTE;
-    };
-    IdCount = 7;
+    File = "av02048.png";
 };
 
-ImageList AVMEDIA_IMGLST_L
+Bitmap AVMEDIA_IMG_PLAY_NORMAL
 {
-    Prefix = "avl";
-    IdList =
-    {
-        AVMEDIA_IMG_OPEN;
-        AVMEDIA_IMG_PLAY;
-        AVMEDIA_IMG_PAUSE;
-        AVMEDIA_IMG_STOP;
-        AVMEDIA_IMG_ENDLESS;
-        AVMEDIA_IMG_INSERT;
-        AVMEDIA_IMG_MUTE;
-    };
-    IdCount = 7;
+    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/include/avmedia/MediaControlBase.hxx b/include/avmedia/MediaControlBase.hxx
index 2a34f90..bc73f64 100644
--- a/include/avmedia/MediaControlBase.hxx
+++ b/include/avmedia/MediaControlBase.hxx
@@ -69,16 +69,13 @@ protected:
     VclPtr<Slider>      mpVolumeSlider;
     VclPtr<ListBox>     mpZoomListBox;
     VclPtr<Edit>        mpTimeEdit;
-    Image GetImage( sal_Int32 nImageId ) const;
+    static Image GetImage(sal_Int32 nImageId);
     virtual void InitializeWidgets();
     virtual void UpdateToolBoxes( MediaItem aMediaItem );
     void UpdateVolumeSlider( MediaItem aMediaItem );
     void UpdateTimeSlider( MediaItem aMediaItem );
     void UpdateTimeField( MediaItem aMediaItem, double fTime );
     void SelectPlayToolBoxItem( MediaItem& aExecItem, MediaItem aItem, sal_uInt16 nId);
-
-private:
-    ImageList           maImageList;
 };
 
 }


More information about the Libreoffice-commits mailing list