summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorCarsten Driesner <cd@openoffice.org>2009-12-14 13:46:00 +0100
committerCarsten Driesner <cd@openoffice.org>2009-12-14 13:46:00 +0100
commit8d867c72e6c982c65b267daceb43dc7f3e5ad351 (patch)
tree3d855e11e597a22869e48272cb3369f825725dcf /desktop
parent4f2b43e261d4632321770b75c3c89b484b123a8f (diff)
Support png instead of bmp file format for splash/about images
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/splash/splash.cxx26
-rw-r--r--desktop/source/splash/splash.hxx4
2 files changed, 21 insertions, 9 deletions
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index 6e949c1bf00c..4dbecbd9dcc7 100644
--- a/desktop/source/splash/splash.cxx
+++ b/desktop/source/splash/splash.cxx
@@ -44,6 +44,9 @@
#include <rtl/logfile.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/math.hxx>
+#include <vcl/graph.hxx>
+#include <svtools/filter.hxx>
+#include <vcl/msgbox.hxx>
#define NOT_LOADED ((long)-1)
@@ -373,6 +376,9 @@ void SplashScreen::loadConfig()
void SplashScreen::initBitmap()
{
+ MessBox aMsgBox(0, WB_OK, String::CreateFromAscii("Oracle OpenOffice.org"), String::CreateFromAscii("Stop!"));
+ aMsgBox.Execute();
+
if ( _bShowLogo )
{
OUString sExecutePath;
@@ -418,9 +424,15 @@ bool SplashScreen::loadBitmap(
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)
- aStrm >> _aIntroBmp;
+ _aIntroBmp = aGraphic.GetBitmapEx();
return true;
}
@@ -439,7 +451,7 @@ bool SplashScreen::findBitmap(rtl::OUString const & path) {
}
if ( !haveBitmap )
haveBitmap = loadBitmap(
- path, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("intro.bmp")));
+ path, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("intro.png")));
return haveBitmap;
}
@@ -469,7 +481,7 @@ bool SplashScreen::findScreenBitmap(rtl::OUString const & path)
aStrBuf.append( OUString::valueOf( nWidth ));
aStrBuf.appendAscii( "x" );
aStrBuf.append( OUString::valueOf( nHeight ));
- aStrBuf.appendAscii( ".bmp" );
+ aStrBuf.appendAscii( ".png" );
OUString aBmpFileName = aStrBuf.makeStringAndClear();
bool haveBitmap = loadBitmap( path, aBmpFileName );
@@ -480,7 +492,7 @@ bool SplashScreen::findScreenBitmap(rtl::OUString const & path)
aStrBuf.append( OUString::valueOf( nWidth ));
aStrBuf.appendAscii( "x" );
aStrBuf.append( OUString::valueOf( nHeight ));
- aStrBuf.appendAscii( ".bmp" );
+ aStrBuf.appendAscii( ".png" );
aBmpFileName = aStrBuf.makeStringAndClear();
haveBitmap = loadBitmap( path, aBmpFileName );
@@ -498,7 +510,7 @@ bool SplashScreen::findAppBitmap(rtl::OUString const & path)
aStrBuf.appendAscii( "intro_" );
aStrBuf.appendAscii( "_" );
aStrBuf.append( _sAppName );
- aStrBuf.appendAscii( ".bmp" );
+ aStrBuf.appendAscii( ".png" );
OUString aBmpFileName = aStrBuf.makeStringAndClear();
haveBitmap = loadBitmap( path, aBmpFileName );
}
@@ -586,7 +598,7 @@ void SplashScreen::Paint( const Rectangle&)
// in case of native controls we need to draw directly to the window
if( IsNativeControlSupported( CTRL_INTROPROGRESS, PART_ENTIRE_CONTROL ) )
{
- DrawBitmap( Point(), _aIntroBmp );
+ DrawBitmapEx( Point(), _aIntroBmp );
ImplControlValue aValue( _iProgress * _barwidth / _iMax);
Rectangle aDrawRect( Point(_tlx, _tly), Size( _barwidth, _barheight ) );
@@ -612,7 +624,7 @@ void SplashScreen::Paint( const Rectangle&)
//non native drawing
// draw bitmap
if (_bPaintBitmap)
- _vdev.DrawBitmap( Point(), _aIntroBmp );
+ _vdev.DrawBitmapEx( Point(), _aIntroBmp );
if (_bPaintProgress) {
// draw progress...
diff --git a/desktop/source/splash/splash.hxx b/desktop/source/splash/splash.hxx
index f56fff54b931..a01967d36c44 100644
--- a/desktop/source/splash/splash.hxx
+++ b/desktop/source/splash/splash.hxx
@@ -34,7 +34,7 @@
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <vcl/introwin.hxx>
-#include <vcl/bitmap.hxx>
+#include <vcl/bitmapex.hxx>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <osl/mutex.hxx>
#include <vcl/virdev.hxx>
@@ -86,7 +86,7 @@ private:
Reference< XMultiServiceFactory > _rFactory;
VirtualDevice _vdev;
- Bitmap _aIntroBmp;
+ BitmapEx _aIntroBmp;
Color _cProgressFrameColor;
Color _cProgressBarColor;
OUString _sAppName;