1*d119d52dSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*d119d52dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*d119d52dSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*d119d52dSAndrew Rist * distributed with this work for additional information 6*d119d52dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*d119d52dSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*d119d52dSAndrew Rist * "License"); you may not use this file except in compliance 9*d119d52dSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*d119d52dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*d119d52dSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*d119d52dSAndrew Rist * software distributed under the License is distributed on an 15*d119d52dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*d119d52dSAndrew Rist * KIND, either express or implied. See the License for the 17*d119d52dSAndrew Rist * specific language governing permissions and limitations 18*d119d52dSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*d119d52dSAndrew Rist *************************************************************/ 21*d119d52dSAndrew Rist 22*d119d52dSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_sfx2.hxx" 26cdf0e10cSrcweir 27cdf0e10cSrcweir #ifndef GCC 28cdf0e10cSrcweir #endif 29cdf0e10cSrcweir 30cdf0e10cSrcweir #include "intro.hxx" 31cdf0e10cSrcweir 32cdf0e10cSrcweir #include <tools/stream.hxx> 33cdf0e10cSrcweir #include <tools/urlobj.hxx> 34cdf0e10cSrcweir #include <unotools/pathoptions.hxx> 35cdf0e10cSrcweir #include <unotools/configmgr.hxx> 36cdf0e10cSrcweir #include <com/sun/star/uno/Any.h> 37cdf0e10cSrcweir 38cdf0e10cSrcweir #include <sfx2/sfxuno.hxx> 39cdf0e10cSrcweir 40cdf0e10cSrcweir // ----------------------------------------------------------------------- 41cdf0e10cSrcweir 42cdf0e10cSrcweir void IntroWindow_Impl::Init() 43cdf0e10cSrcweir { 44cdf0e10cSrcweir Size aSize = aIntroBmp.GetSizePixel(); 45cdf0e10cSrcweir SetOutputSizePixel( aSize ); 46cdf0e10cSrcweir Size aScreenSize( GetDesktopRectPixel().GetSize() ); 47cdf0e10cSrcweir Size aWinSize( GetSizePixel() ); 48cdf0e10cSrcweir Point aWinPos( ( aScreenSize.Width() - aWinSize.Width() ) / 2, 49cdf0e10cSrcweir ( aScreenSize.Height() - aWinSize.Height() ) / 2 ); 50cdf0e10cSrcweir SetPosPixel( aWinPos ); 51cdf0e10cSrcweir 52cdf0e10cSrcweir if ( GetColorCount() >= 16 ) 53cdf0e10cSrcweir { 54cdf0e10cSrcweir Show(); 55cdf0e10cSrcweir Update(); 56cdf0e10cSrcweir } 57cdf0e10cSrcweir } 58cdf0e10cSrcweir 59cdf0e10cSrcweir // ----------------------------------------------------------------------- 60cdf0e10cSrcweir 61cdf0e10cSrcweir IntroWindow_Impl::IntroWindow_Impl( const Bitmap& rBmp ) : 62cdf0e10cSrcweir 63cdf0e10cSrcweir WorkWindow( NULL, (WinBits)0 ), 64cdf0e10cSrcweir 65cdf0e10cSrcweir aIntroBmp( rBmp ) 66cdf0e10cSrcweir 67cdf0e10cSrcweir { 68cdf0e10cSrcweir Hide(); 69cdf0e10cSrcweir 70cdf0e10cSrcweir // load bitmap depends on productname ("StarOffice", "StarSuite",...) 71cdf0e10cSrcweir ::com::sun::star::uno::Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ); 72cdf0e10cSrcweir rtl::OUString aTmp; 73cdf0e10cSrcweir aRet >>= aTmp; 74cdf0e10cSrcweir String aBmpFileName = aTmp; 75cdf0e10cSrcweir aBmpFileName += String( DEFINE_CONST_UNICODE("_intro.bmp") ); 76cdf0e10cSrcweir INetURLObject aObj( SvtPathOptions().GetModulePath(), INET_PROT_FILE ); 77cdf0e10cSrcweir aObj.insertName( aBmpFileName ); 78cdf0e10cSrcweir SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ ); 79cdf0e10cSrcweir if ( !aStrm.GetError() ) 80cdf0e10cSrcweir aStrm >> aIntroBmp; 81cdf0e10cSrcweir 82cdf0e10cSrcweir Init(); 83cdf0e10cSrcweir } 84cdf0e10cSrcweir 85cdf0e10cSrcweir // ----------------------------------------------------------------------- 86cdf0e10cSrcweir 87cdf0e10cSrcweir IntroWindow_Impl::~IntroWindow_Impl() 88cdf0e10cSrcweir { 89cdf0e10cSrcweir Hide(); 90cdf0e10cSrcweir } 91cdf0e10cSrcweir 92cdf0e10cSrcweir // ----------------------------------------------------------------------- 93cdf0e10cSrcweir 94cdf0e10cSrcweir void IntroWindow_Impl::Paint( const Rectangle& ) 95cdf0e10cSrcweir { 96cdf0e10cSrcweir DrawBitmap( Point(), aIntroBmp ); 97cdf0e10cSrcweir Flush(); 98cdf0e10cSrcweir } 99cdf0e10cSrcweir 100cdf0e10cSrcweir // ----------------------------------------------------------------------- 101cdf0e10cSrcweir 102cdf0e10cSrcweir void IntroWindow_Impl::Slide() 103cdf0e10cSrcweir { 104cdf0e10cSrcweir } 105cdf0e10cSrcweir 106cdf0e10cSrcweir 107