You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2012/09/22 21:38:56 UTC
svn commit: r1388877 - in /incubator/ooo/trunk/main: cui/source/dialogs/
cui/source/inc/ default_images/introabout/ default_images/res/
desktop/zipintro/ sd/source/ui/slideshow/ sfx2/inc/sfx2/ sfx2/source/appl/
vcl/inc/vcl/ vcl/source/gdi/
Author: arielch
Date: Sat Sep 22 19:38:56 2012
New Revision: 1388877
URL: http://svn.apache.org/viewvc?rev=1388877&view=rev
Log:
#i119418# - About Dialog improvements
Added:
incubator/ooo/trunk/main/default_images/introabout/logo.png (contents, props changed)
- copied, changed from r1388777, incubator/ooo/trunk/main/default_images/res/orb.png
Removed:
incubator/ooo/trunk/main/default_images/res/orb.png
Modified:
incubator/ooo/trunk/main/cui/source/dialogs/about.cxx
incubator/ooo/trunk/main/cui/source/dialogs/about.hrc
incubator/ooo/trunk/main/cui/source/dialogs/about.src
incubator/ooo/trunk/main/cui/source/inc/about.hxx
incubator/ooo/trunk/main/desktop/zipintro/makefile.mk
incubator/ooo/trunk/main/sd/source/ui/slideshow/slideshowimpl.cxx
incubator/ooo/trunk/main/sfx2/inc/sfx2/app.hxx
incubator/ooo/trunk/main/sfx2/source/appl/appmisc.cxx
incubator/ooo/trunk/main/vcl/inc/vcl/imagerepository.hxx
incubator/ooo/trunk/main/vcl/source/gdi/imagerepository.cxx
Modified: incubator/ooo/trunk/main/cui/source/dialogs/about.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/cui/source/dialogs/about.cxx?rev=1388877&r1=1388876&r2=1388877&view=diff
==============================================================================
--- incubator/ooo/trunk/main/cui/source/dialogs/about.cxx (original)
+++ incubator/ooo/trunk/main/cui/source/dialogs/about.cxx Sat Sep 22 19:38:56 2012
@@ -24,12 +24,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_cui.hxx"
-#include <com/sun/star/uno/Any.h>
#include <comphelper/processfactory.hxx>
#include <dialmgr.hxx>
#include <osl/file.hxx>
#include <rtl/bootstrap.hxx>
-#include <sfx2/app.hxx>
#include <sfx2/sfxcommands.h>
#include <sfx2/sfxdefs.hxx>
#include <sfx2/sfxuno.hxx>
@@ -40,14 +38,16 @@
#include <unotools/bootstrap.hxx>
#include <unotools/configmgr.hxx>
#include <vcl/graph.hxx>
+#include <vcl/imagerepository.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
#include <vcl/tabctrl.hxx>
#include <vcl/tabdlg.hxx>
#include <vcl/tabpage.hxx>
-#include <com/sun/star/system/XSystemShellExecute.hpp>
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
+#include <com/sun/star/system/XSystemShellExecute.hpp>
+#include <com/sun/star/uno/Any.h>
#include "about.hxx"
#include "about.hrc"
@@ -55,6 +55,26 @@
#define _STRINGIFY(x) #x
#define STRINGIFY(x) _STRINGIFY(x)
+/* On Windows/OS2, all the three files have .txt extension
+ and the README file name is in lowercase
+ Readme files are localized and have the locale in their file name:
+ README_de README_en-US
+*/
+#if defined(WNT) || defined(OS2)
+#define FILE_EXTENSION ".txt"
+#define README_FILE "readme"
+#else
+#define FILE_EXTENSION
+#define README_FILE "README"
+#endif
+#define LICENSE_FILE "LICENSE" FILE_EXTENSION
+#define NOTICE_FILE "NOTICE" FILE_EXTENSION
+
+// Dir where the files are located
+#define BRAND_DIR_SHARE_README "${BRAND_BASE_DIR}/share/readme/"
+
+using namespace com::sun::star;
+
namespace
{
@@ -198,12 +218,31 @@ namespace
maTabCtrl.Show();
- const rtl::OUString sReadme( RTL_CONSTASCII_USTRINGPARAM( "$BRAND_BASE_DIR/README" ) );
- const rtl::OUString sLicense( RTL_CONSTASCII_USTRINGPARAM( "$BRAND_BASE_DIR/program/LICENSE" ) );
- const rtl::OUString sNotice( RTL_CONSTASCII_USTRINGPARAM( "$BRAND_BASE_DIR/program/NOTICE" ) );
+ // Notice and License are not localized
+ const rtl::OUString sLicense( RTL_CONSTASCII_USTRINGPARAM( BRAND_DIR_SHARE_README LICENSE_FILE ) );
+ const rtl::OUString sNotice( RTL_CONSTASCII_USTRINGPARAM( BRAND_DIR_SHARE_README NOTICE_FILE ) );
+
+ // get localized README
+ rtl::OUStringBuffer aBuff;
+ lang::Locale aLocale = Application::GetSettings().GetUILocale();
+ aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( BRAND_DIR_SHARE_README README_FILE "_" ) );
+ aBuff.append( aLocale.Language );
+ if ( aLocale.Country.getLength() )
+ {
+ aBuff.append( sal_Unicode( '-') );
+ aBuff.append( aLocale.Country );
+ if ( aLocale.Variant.getLength() )
+ {
+ aBuff.append( sal_Unicode( '-' ) );
+ aBuff.append( aLocale.Variant );
+ }
+ }
+#if defined(WNT) || defined(OS2)
+ aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( FILE_EXTENSION ) );
+#endif
rtl::OUString sReadmeTxt, sLicenseTxt, sNoticeTxt;
- lcl_readTxtFile( sReadme, sReadmeTxt );
+ lcl_readTxtFile( aBuff.makeStringAndClear(), sReadmeTxt );
lcl_readTxtFile( sLicense, sLicenseTxt );
lcl_readTxtFile( sNotice, sNoticeTxt );
@@ -248,11 +287,17 @@ AboutDialog::AboutDialog( Window* pParen
maBuildInfoEdit( this, ResId( RID_CUI_ABOUT_FTXT_BUILDDATA, *rId.GetResMgr() ) ),
maCopyrightEdit( this, ResId( RID_CUI_ABOUT_FTXT_COPYRIGHT, *rId.GetResMgr() ) ),
maCreditsLink( this, ResId( RID_CUI_ABOUT_FTXT_WELCOME_LINK, *rId.GetResMgr() ) ),
- maMainLogo( ResId( RID_CUI_ABOUT_LOGO, *rId.GetResMgr() ) ),
maCopyrightTextStr( ResId( RID_CUI_ABOUT_STR_COPYRIGHT, *rId.GetResMgr() ) )
{
- // load image from module path
- maAppLogo = SfxApplication::GetApplicationLogo();
+ bool bLoad = vcl::ImageRepository::loadBrandingImage(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("about")),
+ maAppLogo );
+ OSL_ENSURE( bLoad, "Can't load about image");
+
+ bLoad = vcl::ImageRepository::loadBrandingImage(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("logo")),
+ maMainLogo );
+ OSL_ENSURE( bLoad, "Can't load logo image");
InitControls();
@@ -302,8 +347,8 @@ void AboutDialog::ApplyStyleSettings()
// set for background and text the correct system color
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
- Color aWhiteCol( rSettings.GetWindowColor() );
- Wallpaper aWall( aWhiteCol );
+ Color aWindowColor( rSettings.GetWindowColor() );
+ Wallpaper aWall( aWindowColor );
SetBackground( aWall );
Font aNewFont( maCopyrightEdit.GetFont() );
aNewFont.SetTransparent( sal_True );
@@ -311,10 +356,10 @@ void AboutDialog::ApplyStyleSettings()
maVersionText.SetFont( aNewFont );
maCopyrightEdit.SetFont( aNewFont );
- maVersionText.SetBackground();
- maCopyrightEdit.SetBackground();
- maBuildInfoEdit.SetBackground();
- maCreditsLink.SetBackground();
+ maVersionText.SetBackground(aWall);
+ maCopyrightEdit.SetBackground(aWall);
+ maBuildInfoEdit.SetBackground(aWall);
+ maCreditsLink.SetBackground(aWall);
Color aTextColor( rSettings.GetWindowTextColor() );
maVersionText.SetControlForeground( aTextColor );
@@ -487,21 +532,23 @@ IMPL_LINK ( AboutDialog, OpenLinkHdl_Imp
{
try
{
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xSMGR =
- ::comphelper::getProcessServiceFactory();
- com::sun::star::uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShell(
- xSMGR->createInstance( ::rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ),
- com::sun::star::uno::UNO_QUERY_THROW );
+ uno::Reference< uno::XComponentContext > xContext =
+ ::comphelper::getProcessComponentContext();
+ uno::Reference< system::XSystemShellExecute > xSystemShell(
+ xContext->getServiceManager()->createInstanceWithContext(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ),
+ xContext ),
+ uno::UNO_QUERY_THROW );
if ( xSystemShell.is() )
- xSystemShell->execute( sURL, ::rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS );
+ xSystemShell->execute( sURL, rtl::OUString(), system::SystemShellExecuteFlags::DEFAULTS );
}
- catch( const com::sun::star::uno::Exception& e )
+ catch( const uno::Exception& e )
{
OSL_TRACE( "Caught exception: %s\n thread terminated.\n",
rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
}
}
+
return 0;
}
Modified: incubator/ooo/trunk/main/cui/source/dialogs/about.hrc
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/cui/source/dialogs/about.hrc?rev=1388877&r1=1388876&r2=1388877&view=diff
==============================================================================
--- incubator/ooo/trunk/main/cui/source/dialogs/about.hrc (original)
+++ incubator/ooo/trunk/main/cui/source/dialogs/about.hrc Sat Sep 22 19:38:56 2012
@@ -30,11 +30,10 @@
#define RID_CUI_ABOUT_FTXT_BUILDDATA 5
#define RID_CUI_ABOUT_STR_COPYRIGHT 6
#define RID_CUI_ABOUT_FTXT_WELCOME_LINK 7
-#define RID_CUI_ABOUT_LOGO 8
-#define RID_CUI_README_TBCTL 9
-#define RID_CUI_README_OKBTN 10
-#define RID_CUI_READMEPAGE 11
-#define RID_CUI_LICENSEPAGE 12
-#define RID_CUI_NOTICEPAGE 13
-#define RID_CUI_README_TBPAGE_EDIT 14
+#define RID_CUI_README_TBCTL 8
+#define RID_CUI_README_OKBTN 9
+#define RID_CUI_READMEPAGE 10
+#define RID_CUI_LICENSEPAGE 11
+#define RID_CUI_NOTICEPAGE 12
+#define RID_CUI_README_TBPAGE_EDIT 13
Modified: incubator/ooo/trunk/main/cui/source/dialogs/about.src
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/cui/source/dialogs/about.src?rev=1388877&r1=1388876&r2=1388877&view=diff
==============================================================================
--- incubator/ooo/trunk/main/cui/source/dialogs/about.src (original)
+++ incubator/ooo/trunk/main/cui/source/dialogs/about.src Sat Sep 22 19:38:56 2012
@@ -74,11 +74,6 @@ ModalDialog RID_DEFAULTABOUT
{
Text[ en-US ] = "Copyright © 2012 Apache Software Foundation.\nAll rights reserved.\n\nThis product was created by %OOOVENDOR, based on Apache OpenOffice.\nApache OpenOffice acknowledges all community members, especially those mentioned at";
};
-
- Image RID_CUI_ABOUT_LOGO
- {
- ImageBitmap = Bitmap { File = "orb.png"; };
- };
};
Modified: incubator/ooo/trunk/main/cui/source/inc/about.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/cui/source/inc/about.hxx?rev=1388877&r1=1388876&r2=1388877&view=diff
==============================================================================
--- incubator/ooo/trunk/main/cui/source/inc/about.hxx (original)
+++ incubator/ooo/trunk/main/cui/source/inc/about.hxx Sat Sep 22 19:38:56 2012
@@ -44,12 +44,12 @@ private:
MultiLineEdit maCopyrightEdit;
svt::FixedHyperlink maCreditsLink;
- Image maMainLogo;
- Image maAppLogo;
-
String maCopyrightTextStr;
rtl::OUString maVersionData;
+ Image maMainLogo;
+ Image maAppLogo;
+
void InitControls();
void ApplyStyleSettings();
void LayoutControls( Size& aDlgSize );
Copied: incubator/ooo/trunk/main/default_images/introabout/logo.png (from r1388777, incubator/ooo/trunk/main/default_images/res/orb.png)
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/default_images/introabout/logo.png?p2=incubator/ooo/trunk/main/default_images/introabout/logo.png&p1=incubator/ooo/trunk/main/default_images/res/orb.png&r1=1388777&r2=1388877&rev=1388877&view=diff
==============================================================================
Binary files - no diff available.
Propchange: incubator/ooo/trunk/main/default_images/introabout/logo.png
------------------------------------------------------------------------------
svn:mime-type = image/png
Modified: incubator/ooo/trunk/main/desktop/zipintro/makefile.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/desktop/zipintro/makefile.mk?rev=1388877&r1=1388876&r2=1388877&view=diff
==============================================================================
--- incubator/ooo/trunk/main/desktop/zipintro/makefile.mk (original)
+++ incubator/ooo/trunk/main/desktop/zipintro/makefile.mk Sat Sep 22 19:38:56 2012
@@ -33,16 +33,20 @@ DEFAULT_FLAVOURS=dev dev_nologo nologo i
ZIP1LIST= \
$(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev$/introabout$/intro.png $(INTRO_BITMAPS)) \
- $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS))
+ $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS)) \
+ $(MISC)$/$(RSCDEFIMG)$/introabout$/logo.png
ZIP2LIST= \
$(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/dev_nologo$/introabout$/intro.png $(INTRO_BITMAPS)) \
- $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS))
+ $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS)) \
+ $(MISC)$/$(RSCDEFIMG)$/introabout$/logo.png
ZIP3LIST= \
$(null,$(INTRO_BITMAPS) $(MISC)$/ooo_custom_images$/nologo$/introabout$/intro.png $(INTRO_BITMAPS)) \
- $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS))
+ $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS)) \
+ $(MISC)$/$(RSCDEFIMG)$/introabout$/logo.png
ZIP4LIST= \
$(null,$(INTRO_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/intro.png $(INTRO_BITMAPS)) \
- $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS))
+ $(null,$(ABOUT_BITMAPS) $(MISC)$/$(RSCDEFIMG)$/introabout$/about.png $(ABOUT_BITMAPS)) \
+ $(MISC)$/$(RSCDEFIMG)$/introabout$/logo.png
ZIP1TARGET=dev_intro
ZIP1DEPS=$(ZIP1LIST)
Modified: incubator/ooo/trunk/main/sd/source/ui/slideshow/slideshowimpl.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sd/source/ui/slideshow/slideshowimpl.cxx?rev=1388877&r1=1388876&r2=1388877&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sd/source/ui/slideshow/slideshowimpl.cxx (original)
+++ incubator/ooo/trunk/main/sd/source/ui/slideshow/slideshowimpl.cxx Sat Sep 22 19:38:56 2012
@@ -48,7 +48,6 @@
#include <sfx2/imagemgr.hxx>
#include <sfx2/request.hxx>
#include <sfx2/docfile.hxx>
-#include <sfx2/app.hxx>
#include <svx/unoapi.hxx>
#include <svx/svdoole2.hxx>
@@ -82,6 +81,7 @@
#include "canvas/prioritybooster.hxx"
#include "avmedia/mediawindow.hxx"
#include "svtools/colrdlg.hxx"
+#include <vcl/imagerepository.hxx>
#include <boost/noncopyable.hpp>
#include <boost/bind.hpp>
@@ -3322,7 +3322,12 @@ void SAL_CALL SlideshowImpl::gotoNextSli
{
if ( maPresSettings.mbShowPauseLogo )
{
- Graphic aGraphic( SfxApplication::GetApplicationLogo().GetBitmapEx() );
+ Image aImage;
+ bool bLoad = vcl::ImageRepository::loadBrandingImage(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "logo" ) ),
+ aImage );
+ OSL_ENSURE( bLoad, "Can't load logo image");
+ Graphic aGraphic(aImage.GetBitmapEx());
mpShowWindow->SetPauseMode( 0, maPresSettings.mnPauseTimeout, &aGraphic );
}
else
Modified: incubator/ooo/trunk/main/sfx2/inc/sfx2/app.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sfx2/inc/sfx2/app.hxx?rev=1388877&r1=1388876&r2=1388877&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sfx2/inc/sfx2/app.hxx (original)
+++ incubator/ooo/trunk/main/sfx2/inc/sfx2/app.hxx Sat Sep 22 19:38:56 2012
@@ -306,9 +306,6 @@ public:
SAL_DLLPRIVATE SfxModule* GetModule_Impl();
SAL_DLLPRIVATE ResMgr* GetOffResManager_Impl();
//#endif
-
- /** loads the application logo as used in the about dialog and impress slideshow pause screen */
- static Image GetApplicationLogo();
};
#define SFX_APP() SfxGetpApp()
Modified: incubator/ooo/trunk/main/sfx2/source/appl/appmisc.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sfx2/source/appl/appmisc.cxx?rev=1388877&r1=1388876&r2=1388877&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sfx2/source/appl/appmisc.cxx (original)
+++ incubator/ooo/trunk/main/sfx2/source/appl/appmisc.cxx Sat Sep 22 19:38:56 2012
@@ -283,72 +283,3 @@ SfxDispatcher* SfxApplication::GetAppDis
SfxSlotPool& SfxApplication::GetAppSlotPool_Impl() const { return *pAppData_Impl->pSlotPool; }
//SfxOptions& SfxApplication::GetOptions() { return *pAppData_Impl->pOptions; }
//const SfxOptions& SfxApplication::GetOptions() const { return *pAppData_Impl->pOptions; }
-
-static bool impl_loadBitmap(
- const rtl::OUString &rPath, const rtl::OUString &rBmpFileName,
- Image &rLogo )
-{
- rtl::OUString uri( rPath );
- rtl::Bootstrap::expandMacros( uri );
- INetURLObject aObj( uri );
- aObj.insertName( rBmpFileName );
- SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ );
- if ( !aStrm.GetError() )
- {
- // Use graphic class to also support more graphic formats (bmp,png,...)
- Graphic aGraphic;
-
- GraphicFilter* pGF = GraphicFilter::GetGraphicFilter();
- pGF->ImportGraphic( aGraphic, String(), aStrm, GRFILTER_FORMAT_DONTKNOW );
-
- // Default case, we load the intro bitmap from a seperate file
- // (e.g. staroffice_intro.bmp or starsuite_intro.bmp)
- BitmapEx aBmp = aGraphic.GetBitmapEx();
- rLogo = Image( aBmp );
- return true;
- }
- return false;
-}
-
-/** loads the application logo as used in the about dialog and impress slideshow pause screen */
-Image SfxApplication::GetApplicationLogo()
-{
- Image aAppLogo;
-
- rtl::OUString aAbouts;
- bool bLoaded = false;
- sal_Int32 nIndex = 0;
- do
- {
- bLoaded = impl_loadBitmap(
- rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ),
- aAbouts.getToken( 0, ',', nIndex ), aAppLogo );
- }
- while ( !bLoaded && ( nIndex >= 0 ) );
-
- // fallback to "about.bmp"
- if ( !bLoaded )
- {
- bLoaded = impl_loadBitmap(
- rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program/edition" ),
- rtl::OUString::createFromAscii( "about.png" ), aAppLogo );
- if ( !bLoaded )
- bLoaded = impl_loadBitmap(
- rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program/edition" ),
- rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo );
- }
-
- if ( !bLoaded )
- {
- bLoaded = impl_loadBitmap(
- rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ),
- rtl::OUString::createFromAscii( "about.png" ), aAppLogo );
- if ( !bLoaded )
- bLoaded = impl_loadBitmap(
- rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ),
- rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo );
- }
-
- return aAppLogo;
-}
-
Modified: incubator/ooo/trunk/main/vcl/inc/vcl/imagerepository.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/inc/vcl/imagerepository.hxx?rev=1388877&r1=1388876&r2=1388877&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/inc/vcl/imagerepository.hxx (original)
+++ incubator/ooo/trunk/main/vcl/inc/vcl/imagerepository.hxx Sat Sep 22 19:38:56 2012
@@ -28,18 +28,17 @@
#include <rtl/ustring.hxx>
class BitmapEx;
+class Image;
-//........................................................................
namespace vcl
{
-//........................................................................
- //====================================================================
- //= ImageRepository
- //====================================================================
- // provides access to the application's image repository (image.zip)
- class VCL_DLLPUBLIC ImageRepository
- {
+ /**
+ provides access to the application's image repository
+ (packed images and brand images)
+ */
+ class VCL_DLLPUBLIC ImageRepository
+ {
public:
/** loads an image from the application's image repository
@param _rName
@@ -54,13 +53,28 @@ namespace vcl
static bool loadImage(
const ::rtl::OUString& _rName,
BitmapEx& _out_rImage,
- bool bSearchLanguageDependent
+ bool bSearchLanguageDependent
);
- };
-//........................................................................
-} // namespace vcl
-//........................................................................
+ /** load an image from the application's branding directory
+
+ @param rName
+ the name of the image to load, without extension
+ @param rImage
+ will take the image upon successful return.
+ @param bIgnoreHighContrast
+ if true, high contrast mode is not taken into account when
+ searching for the image
+ @param bSearchLanguageDependent
+ determines whether a language-dependent image is to be searched.
+ */
+ static bool loadBrandingImage(
+ const rtl::OUString &rName,
+ Image &rImage,
+ bool bSearchLanguageDependent = false
+ );
+ };
+}
#endif // VCL_IMAGEREPOSITORY_HXX
Modified: incubator/ooo/trunk/main/vcl/source/gdi/imagerepository.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/gdi/imagerepository.cxx?rev=1388877&r1=1388876&r2=1388877&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/gdi/imagerepository.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/gdi/imagerepository.cxx Sat Sep 22 19:38:56 2012
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -27,27 +27,81 @@
#include <vcl/bitmapex.hxx>
#include <vcl/imagerepository.hxx>
#include <vcl/svapp.hxx>
+#include <vcl/image.hxx>
+#include <vcl/pngread.hxx>
+#include <rtl/bootstrap.hxx>
+#include <tools/stream.hxx>
+#include <tools/urlobj.hxx>
#include "impimagetree.hxx"
-//........................................................................
namespace vcl
{
-//........................................................................
-
- //====================================================================
- //= ImageRepository
- //====================================================================
- //--------------------------------------------------------------------
- bool ImageRepository::loadImage( const ::rtl::OUString& _rName, BitmapEx& _out_rImage, bool _bSearchLanguageDependent )
+ bool ImageRepository::loadImage( const ::rtl::OUString& _rName,
+ BitmapEx& _out_rImage,
+ bool _bSearchLanguageDependent )
{
- ::rtl::OUString sCurrentSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyleName();
+ ::rtl::OUString sCurrentSymbolsStyle =
+ Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyleName();
ImplImageTreeSingletonRef aImplImageTree;
- return aImplImageTree->loadImage( _rName, sCurrentSymbolsStyle, _out_rImage, _bSearchLanguageDependent );
+
+ return aImplImageTree->loadImage( _rName,
+ sCurrentSymbolsStyle,
+ _out_rImage,
+ _bSearchLanguageDependent );
+ }
+
+
+ static bool lcl_loadPNG( const rtl::OUString &rPath,
+ const rtl::OUString &rImageFileName,
+ Image &rImage )
+ {
+ INetURLObject aObj( rPath );
+ aObj.insertName( rImageFileName );
+ SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ );
+ if ( !aStrm.GetError() )
+ {
+ PNGReader aReader( aStrm );
+ BitmapEx aBmp = aReader.Read();
+ rImage = Image( aBmp );
+
+ return true;
+ }
+
+ return false;
}
-//........................................................................
-} // namespace vcl
-//........................................................................
+ /* TODO support bSearchLanguageDependent */
+ bool ImageRepository::loadBrandingImage( const rtl::OUString &rName,
+ Image &rImage,
+ bool /* bSearchLanguageDependent */ )
+ {
+ rtl::OUString sImages;
+ rtl::OUStringBuffer aBuff( rName );
+ rtl::OUString aBasePath( RTL_CONSTASCII_USTRINGPARAM( "$BRAND_BASE_DIR/program" ) );
+ rtl::Bootstrap::expandMacros( aBasePath );
+
+ bool bLoaded = false;
+ sal_Int32 nIndex = 0;
+
+ if ( Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
+ {
+ aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( "_hc.png," ) );
+ aBuff.append( rName );
+ }
+
+ aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( ".png" ) );
+ sImages = aBuff.makeStringAndClear();
+
+ do
+ {
+ bLoaded = lcl_loadPNG( aBasePath,
+ sImages.getToken( 0, ',', nIndex ),
+ rImage );
+ }
+ while ( !bLoaded && ( nIndex >= 0 ) );
+ return bLoaded;
+ }
+}
Re: svn commit: r1388877 - in /incubator/ooo/trunk/main:
cui/source/dialogs/ cui/source/inc/ default_images/introabout/
default_images/res/ desktop/zipintro/ sd/source/ui/slideshow/ sfx2/inc/sfx2/
sfx2/source/appl/ vcl/inc/vcl/ vcl/source/gdi/
Posted by zhangjf <zh...@apache.org>.
Hi,
Before I notice this discussion, I have already committed the fix code
for this problem by revision 1389717. I also don't have an idea why it
doesn't work. The fix code build passed on both Mac and Linux. Let me
know if you have any concerns.
regards,
zhangjf
On Tue, Sep 25, 2012 at 7:12 PM, Andre Fischer <aw...@gmail.com> wrote:
> On 24.09.2012 21:12, Pavel Janík wrote:
>>>
>>> * and the using declaration:
>>>
>>> using namespace com::sun::star;
>>>
>>> The compiler should detect that system::XSystemShellExecute is
>>> com::sun::star::system::XSystemShellExecute and so on, unless it
>>> collides with a system namespace on the system's headers ?
>>>
>>> Anyway feel free to commit it, if this solves your problem.
>
>
> Your change looks fine. Please commit it.
>
>
>> I'll wait for other's opinions, because I too thought that it should work
>> as written (using c:s:s), weird.
>>
>> Other parts of the code use
>>
>> namespace css = com::sun::star;
>> uno::Reference< css::system::XSystemShellExecute> xSystemShell(...
>>
>> despite the fact that using namespace com::sun::star is there as well.
>> Maybe "system" is somehow strange.
>>
>> Any ideas about the strangeness? ;-)
>
>
> Hm, the only thing I can think of is the Koenig lookup that may be
> implemented differently on your compilers. But I assume that the two of you
> both tried this on Linux and thus probably on very similar compilers.
>
> -Andre
>
>
Re: svn commit: r1388877 - in /incubator/ooo/trunk/main: cui/source/dialogs/ cui/source/inc/ default_images/introabout/ default_images/res/ desktop/zipintro/ sd/source/ui/slideshow/ sfx2/inc/sfx2/ sfx2/source/appl/ vcl/inc/vcl/ vcl/source/gdi/
Posted by Pavel Janík <Pa...@Janik.cz>.
> Hm, the only thing I can think of is the Koenig lookup that may be implemented differently on your compilers. But I assume that the two of you both tried this on Linux and thus probably on very similar compilers.
I use Mac OS X, gcc 4.2.1 on the build machine.
--
Pavel Janík
Re: svn commit: r1388877 - in /incubator/ooo/trunk/main: cui/source/dialogs/
cui/source/inc/ default_images/introabout/ default_images/res/ desktop/zipintro/
sd/source/ui/slideshow/ sfx2/inc/sfx2/ sfx2/source/appl/ vcl/inc/vcl/ vcl/source/gdi/
Posted by Andre Fischer <aw...@gmail.com>.
On 24.09.2012 21:12, Pavel Janík wrote:
>> * and the using declaration:
>>
>> using namespace com::sun::star;
>>
>> The compiler should detect that system::XSystemShellExecute is
>> com::sun::star::system::XSystemShellExecute and so on, unless it
>> collides with a system namespace on the system's headers ?
>>
>> Anyway feel free to commit it, if this solves your problem.
Your change looks fine. Please commit it.
> I'll wait for other's opinions, because I too thought that it should work as written (using c:s:s), weird.
>
> Other parts of the code use
>
> namespace css = com::sun::star;
> uno::Reference< css::system::XSystemShellExecute> xSystemShell(...
>
> despite the fact that using namespace com::sun::star is there as well. Maybe "system" is somehow strange.
>
> Any ideas about the strangeness? ;-)
Hm, the only thing I can think of is the Koenig lookup that may be
implemented differently on your compilers. But I assume that the two of
you both tried this on Linux and thus probably on very similar compilers.
-Andre
Re: svn commit: r1388877 - in /incubator/ooo/trunk/main: cui/source/dialogs/ cui/source/inc/ default_images/introabout/ default_images/res/ desktop/zipintro/ sd/source/ui/slideshow/ sfx2/inc/sfx2/ sfx2/source/appl/ vcl/inc/vcl/ vcl/source/gdi/
Posted by Pavel Janík <Pa...@Janik.cz>.
> * and the using declaration:
>
> using namespace com::sun::star;
>
> The compiler should detect that system::XSystemShellExecute is
> com::sun::star::system::XSystemShellExecute and so on, unless it
> collides with a system namespace on the system's headers ?
>
> Anyway feel free to commit it, if this solves your problem.
I'll wait for other's opinions, because I too thought that it should work as written (using c:s:s), weird.
Other parts of the code use
namespace css = com::sun::star;
uno::Reference< css::system::XSystemShellExecute > xSystemShell(...
despite the fact that using namespace com::sun::star is there as well. Maybe "system" is somehow strange.
Any ideas about the strangeness? ;-)
--
Pavel Janík
Re: svn commit: r1388877 - in /incubator/ooo/trunk/main:
cui/source/dialogs/ cui/source/inc/ default_images/introabout/
default_images/res/ desktop/zipintro/ sd/source/ui/slideshow/ sfx2/inc/sfx2/
sfx2/source/appl/ vcl/inc/vcl/ vcl/source/gdi/
Posted by Ariel Constenla-Haile <ar...@apache.org>.
Hi Pavel,
On Mon, Sep 24, 2012 at 08:31:35PM +0200, Pavel Janík wrote:
>
> On Sep 24, 2012, at 8:28 PM, Pavel Janík wrote:
>
> > Hi,
> >
> > the following change made about.cxx uncompilable on my system:
> >
> > Compiling: cui/source/dialogs/about.cxx
> > /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx: In member function ‘long int AboutDialog::OpenLinkHdl_Impl(svt::FixedHyperlink*)’:
> > /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:537: error: ‘system’ has not been declared
> > /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:537: error: ‘XSystemShellExecute’ was not declared in this scope
> > /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:537: error: template argument 1 is invalid
> > /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:537: error: invalid type in declaration before ‘(’ token
> > /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:541: error: initializer expression list treated as compound expression
> > /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:542: error: request for member ‘is’ in ‘xSystemShell’, which is of non-class type ‘int’
> > /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:543: error: base operand of ‘->’ is not a pointer
> > /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:543: error: ‘system’ has not been declared
> > /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:543: error: ‘DEFAULTS’ was not declared in this scope
> > dmake: Error code 1, while making '../../unxmacxi.pro/slo/about.obj'
> > ERROR: error 65280 occurred while making /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs
>
> The following made it compile again:
>
> Index: about.cxx
> ===================================================================
> --- about.cxx (revision 1389508)
> +++ about.cxx (working copy)
> @@ -534,13 +534,13 @@
> {
> uno::Reference< uno::XComponentContext > xContext =
> ::comphelper::getProcessComponentContext();
> - uno::Reference< system::XSystemShellExecute > xSystemShell(
> + uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShell(
it looks like this change shouldn't be needed at all:
* there are the include directives:
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/system/XSystemShellExecute.hpp>
* and the using declaration:
using namespace com::sun::star;
The compiler should detect that system::XSystemShellExecute is
com::sun::star::system::XSystemShellExecute and so on, unless it
collides with a system namespace on the system's headers ?
Anyway feel free to commit it, if this solves your problem.
Regards
--
Ariel Constenla-Haile
La Plata, Argentina
Re: svn commit: r1388877 - in /incubator/ooo/trunk/main: cui/source/dialogs/ cui/source/inc/ default_images/introabout/ default_images/res/ desktop/zipintro/ sd/source/ui/slideshow/ sfx2/inc/sfx2/ sfx2/source/appl/ vcl/inc/vcl/ vcl/source/gdi/
Posted by Pavel Janík <Pa...@Janik.cz>.
On Sep 24, 2012, at 8:28 PM, Pavel Janík wrote:
> Hi,
>
> the following change made about.cxx uncompilable on my system:
>
> Compiling: cui/source/dialogs/about.cxx
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx: In member function ‘long int AboutDialog::OpenLinkHdl_Impl(svt::FixedHyperlink*)’:
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:537: error: ‘system’ has not been declared
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:537: error: ‘XSystemShellExecute’ was not declared in this scope
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:537: error: template argument 1 is invalid
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:537: error: invalid type in declaration before ‘(’ token
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:541: error: initializer expression list treated as compound expression
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:542: error: request for member ‘is’ in ‘xSystemShell’, which is of non-class type ‘int’
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:543: error: base operand of ‘->’ is not a pointer
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:543: error: ‘system’ has not been declared
> /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:543: error: ‘DEFAULTS’ was not declared in this scope
> dmake: Error code 1, while making '../../unxmacxi.pro/slo/about.obj'
> ERROR: error 65280 occurred while making /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs
The following made it compile again:
Index: about.cxx
===================================================================
--- about.cxx (revision 1389508)
+++ about.cxx (working copy)
@@ -534,13 +534,13 @@
{
uno::Reference< uno::XComponentContext > xContext =
::comphelper::getProcessComponentContext();
- uno::Reference< system::XSystemShellExecute > xSystemShell(
+ uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShell(
xContext->getServiceManager()->createInstanceWithContext(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ),
xContext ),
uno::UNO_QUERY_THROW );
if ( xSystemShell.is() )
- xSystemShell->execute( sURL, rtl::OUString(), system::SystemShellExecuteFlags::DEFAULTS );
+ xSystemShell->execute( sURL, rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS );
}
catch( const uno::Exception& e )
{
--
Pavel Janík
Re: svn commit: r1388877 - in /incubator/ooo/trunk/main: cui/source/dialogs/ cui/source/inc/ default_images/introabout/ default_images/res/ desktop/zipintro/ sd/source/ui/slideshow/ sfx2/inc/sfx2/ sfx2/source/appl/ vcl/inc/vcl/ vcl/source/gdi/
Posted by Pavel Janík <Pa...@Janik.cz>.
Hi,
the following change made about.cxx uncompilable on my system:
Compiling: cui/source/dialogs/about.cxx
/Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx: In member function ‘long int AboutDialog::OpenLinkHdl_Impl(svt::FixedHyperlink*)’:
/Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:537: error: ‘system’ has not been declared
/Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:537: error: ‘XSystemShellExecute’ was not declared in this scope
/Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:537: error: template argument 1 is invalid
/Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:537: error: invalid type in declaration before ‘(’ token
/Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:541: error: initializer expression list treated as compound expression
/Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:542: error: request for member ‘is’ in ‘xSystemShell’, which is of non-class type ‘int’
/Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:543: error: base operand of ‘->’ is not a pointer
/Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:543: error: ‘system’ has not been declared
/Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs/about.cxx:543: error: ‘DEFAULTS’ was not declared in this scope
dmake: Error code 1, while making '../../unxmacxi.pro/slo/about.obj'
ERROR: error 65280 occurred while making /Users/pavel/BUILD/BuildDir/ooo_trunk_src/cui/source/dialogs
On Sep 22, 2012, at 9:38 PM, arielch@apache.org wrote:
> Author: arielch
> Date: Sat Sep 22 19:38:56 2012
> New Revision: 1388877
>
> URL: http://svn.apache.org/viewvc?rev=1388877&view=rev
> Log:
> #i119418# - About Dialog improvements
--
Pavel Janík